dsh-duet 0.2.0 → 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 +6 -3
- 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 +73 -38
- 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/notice.mjs +19 -4
- package/src/client/settings.html +65 -4
- package/src/client/tutorial-adapter.mjs +11 -4
- package/src/client/tutorial.mjs +11 -4
- package/src/client/voices.mjs +137 -0
- 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 +3 -0
- package/src/host/diagnostics.mjs +37 -2
- package/src/host/plugin.mjs +112 -12
- package/src/host/proxy.mjs +93 -19
- package/src/host/service-info.mjs +30 -0
- package/src/host/settings.mjs +23 -2
- package/src/host/trace.mjs +4 -1
- package/src/host/voices.mjs +205 -0
- 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 +31 -7
- package/src/shared/work-mode.mjs +59 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Low-priority trace frames share the already authenticated voice WebSocket. */
|
|
2
|
+
import { gzip } from 'node:zlib'
|
|
3
|
+
import { promisify } from 'node:util'
|
|
4
|
+
import { createHash } from 'node:crypto'
|
|
5
|
+
|
|
6
|
+
export const TRACE_PROTOCOL='duet_trace_v1'
|
|
7
|
+
const compress=promisify(gzip), PART_BYTES=16*1024
|
|
8
|
+
export class AgentTraceSender {
|
|
9
|
+
constructor(store,send,{canSend=()=>true,clock=()=>Date.now(),target=()=>null}={}) {
|
|
10
|
+
this.target=target
|
|
11
|
+
this.store=store;this.send=send;this.canSend=canSend;this.clock=clock
|
|
12
|
+
this.closed=false;this.ready=false;this.busy=false;this.part=0;this.row=null;this.inflight=null
|
|
13
|
+
this.timer=setInterval(()=>void this.flush(),250);this.timer.unref?.()
|
|
14
|
+
}
|
|
15
|
+
offer(protocol){
|
|
16
|
+
const target=this.target()
|
|
17
|
+
this.ready=protocol===TRACE_PROTOCOL && (!this.store.bindTarget || !!target && this.store.bindTarget(target))
|
|
18
|
+
}
|
|
19
|
+
handle(event){
|
|
20
|
+
if(!event.type?.startsWith('duet.trace.'))return false
|
|
21
|
+
if(event.protocol!==TRACE_PROTOCOL)return true
|
|
22
|
+
const f=this.inflight
|
|
23
|
+
if(event.type==='duet.trace.ack' && f && event.stream===f.stream && event.seq===f.seq &&
|
|
24
|
+
event.part===f.part && event.sha256===f.sha256 && event.persisted===true){
|
|
25
|
+
if(f.part+1===f.parts){this.store.acknowledge(f.seq);this.row=null;this.part=0}
|
|
26
|
+
else this.part++
|
|
27
|
+
this.inflight=null;this.attempt=0
|
|
28
|
+
}else if(event.type==='duet.trace.retry'){
|
|
29
|
+
this.sentAt=this.clock();this.retryMs=10000
|
|
30
|
+
}
|
|
31
|
+
return true
|
|
32
|
+
}
|
|
33
|
+
async flush(){
|
|
34
|
+
if(this.closed||!this.ready||this.busy||!this.canSend())return
|
|
35
|
+
if(this.inflight){
|
|
36
|
+
if(this.clock()-this.sentAt<(this.retryMs||5000))return
|
|
37
|
+
this.send(this.inflight);this.sentAt=this.clock();return
|
|
38
|
+
}
|
|
39
|
+
this.busy=true
|
|
40
|
+
try{
|
|
41
|
+
if(!this.row){
|
|
42
|
+
const row=this.store.head();if(!row)return
|
|
43
|
+
this.row={...row,bytes:Buffer.from(row.body)};this.part=0
|
|
44
|
+
}
|
|
45
|
+
const row=this.row,chunk=row.bytes.subarray(this.part*PART_BYTES,(this.part+1)*PART_BYTES)
|
|
46
|
+
const data=await compress(chunk)
|
|
47
|
+
if(this.closed||!this.canSend())return
|
|
48
|
+
this.inflight={type:'duet.trace.batch',protocol:TRACE_PROTOCOL,stream:this.store.id,
|
|
49
|
+
seq:row.seq,part:this.part,parts:Math.ceil(row.bytes.length/PART_BYTES),encoding:'gzip+base64',
|
|
50
|
+
sha256:createHash('sha256').update(chunk).digest('hex'),data:data.toString('base64')}
|
|
51
|
+
this.sentAt=this.clock();this.send(this.inflight)
|
|
52
|
+
}catch{this.sentAt=this.clock();this.retryMs=10000}
|
|
53
|
+
finally{this.busy=false}
|
|
54
|
+
}
|
|
55
|
+
close(){this.closed=true;clearInterval(this.timer)}
|
|
56
|
+
}
|
package/src/host/assets.mjs
CHANGED
|
@@ -15,7 +15,9 @@ const modules = {
|
|
|
15
15
|
connection_hint: 'client/connection-hint',
|
|
16
16
|
controls_layout: 'client/controls-layout',
|
|
17
17
|
notice: 'client/notice',
|
|
18
|
+
voices: 'client/voices',
|
|
18
19
|
workspaces: 'client/workspaces',
|
|
20
|
+
work_mode: 'client/work-mode', work_mode_protocol:'shared/work-mode',
|
|
19
21
|
transport: 'client/transport',
|
|
20
22
|
identity: 'client/identity', identity_protocol: 'shared/identity',
|
|
21
23
|
avatar: 'client/avatar', avatar_protocol: 'shared/avatar',
|
|
@@ -23,6 +25,7 @@ const modules = {
|
|
|
23
25
|
avatar_ui: 'shared/avatar-ui',
|
|
24
26
|
avatar_menu: 'shared/avatar-menu', avatar_menu_ui: 'shared/avatar-menu-ui',
|
|
25
27
|
avatar_tasks: 'client/avatar-tasks',
|
|
28
|
+
agent_tasks: 'client/agent-tasks',
|
|
26
29
|
avatar_surface: 'shared/avatar-surface', avatar_surfaces: 'client/avatar-surfaces',
|
|
27
30
|
input_effect: 'client/input-effect',
|
|
28
31
|
}
|
package/src/host/diagnostics.mjs
CHANGED
|
@@ -5,6 +5,38 @@ import { duetHome } from './storage-paths.mjs'
|
|
|
5
5
|
import { diagnosticPayload, DIAGNOSTICS_PROTOCOL } from '../shared/diagnostics.mjs'
|
|
6
6
|
|
|
7
7
|
const TTL = 6 * 60 * 60 * 1000
|
|
8
|
+
// Cordis can reload an entry (including its module graph) without exiting Node.
|
|
9
|
+
// The uploader and its short-lived, authenticated reporters belong to the host,
|
|
10
|
+
// not to a particular incarnation of the voice proxy.
|
|
11
|
+
const hostsKey = Symbol.for('dsh-duet.host.diagnostics.v1')
|
|
12
|
+
export function acquireHostDiagnostics(server, options = {}) {
|
|
13
|
+
const hosts = globalThis[hostsKey] ??= new Map()
|
|
14
|
+
const root = options.root ?? join(duetHome(), 'diagnostic-outbox')
|
|
15
|
+
// During initial profile activation the configured listener may not be bound yet.
|
|
16
|
+
const port = server.config?.port || server.port
|
|
17
|
+
const key = port ? JSON.stringify([root, server.host, port]) : server
|
|
18
|
+
let host = hosts.get(key)
|
|
19
|
+
if (!host) {
|
|
20
|
+
host = {outbox:new DiagnosticOutbox({...options,root}), reporters:new Map(), refs:0}
|
|
21
|
+
hosts.set(key,host)
|
|
22
|
+
}
|
|
23
|
+
clearTimeout(host.timer)
|
|
24
|
+
host.refs++
|
|
25
|
+
let released = false
|
|
26
|
+
function cleanup() {
|
|
27
|
+
if (host.refs) return
|
|
28
|
+
if (host.reporters.size || host.outbox.active.size || host.outbox.inflight) {
|
|
29
|
+
host.timer = setTimeout(cleanup, 30000); host.timer.unref()
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
hosts.delete(key); host.outbox.dispose()
|
|
33
|
+
}
|
|
34
|
+
return {outbox:host.outbox, reporters:host.reporters, release() {
|
|
35
|
+
if (released) return
|
|
36
|
+
released = true
|
|
37
|
+
if (--host.refs === 0) { host.timer = setTimeout(cleanup, 30000); host.timer.unref() }
|
|
38
|
+
}}
|
|
39
|
+
}
|
|
8
40
|
const ownerAlive = pid => {
|
|
9
41
|
if (!Number.isInteger(pid) || pid <= 0) return false
|
|
10
42
|
try { process.kill(pid, 0); return true } catch (error) { return error.code === 'EPERM' }
|
|
@@ -89,15 +121,18 @@ export class ConnectionDiagnostics {
|
|
|
89
121
|
}
|
|
90
122
|
add(value) {
|
|
91
123
|
const row = diagnosticPayload({...value, ...this.metadata, event_id: value.event_id || randomUUID()})
|
|
92
|
-
if (!row
|
|
124
|
+
if (!row) return false
|
|
125
|
+
if (this.seen.has(row.event_id)) return true
|
|
126
|
+
if (this.count >= 96) return false
|
|
93
127
|
const terminal = /close|failed|error|pagehide/.test(row.event)
|
|
94
|
-
if (!terminal && this.count >= 80) return // Reserve room for the actual ending.
|
|
128
|
+
if (!terminal && this.count >= 80) return false // Reserve room for the actual ending.
|
|
95
129
|
const now = this.outbox?.now() ?? Date.now()
|
|
96
130
|
if (this.expires <= now) this.pending = []
|
|
97
131
|
if (!this.pending.length) this.expires = now + TTL // Retain queued events, not session age.
|
|
98
132
|
this.seen.add(row.event_id); row.sequence=this.count++; this.pending.push(row)
|
|
99
133
|
this.outbox?.save(this)
|
|
100
134
|
this.schedule()
|
|
135
|
+
return true
|
|
101
136
|
}
|
|
102
137
|
offer(offer, config, endpoint) {
|
|
103
138
|
if (this.target || offer?.protocol !== DIAGNOSTICS_PROTOCOL || typeof offer.ticket !== 'string' || offer.ticket.length > 4096) return
|
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'
|
|
@@ -20,6 +24,7 @@ import { AvatarActivityOutbox } from './avatar-activity.mjs'
|
|
|
20
24
|
import { duetEnv } from './environment.mjs'
|
|
21
25
|
import { EndpointDiscovery } from './endpoint-discovery.mjs'
|
|
22
26
|
import { StopTasks } from './stop-task.mjs'
|
|
27
|
+
import { DuetVoices } from './voices.mjs'
|
|
23
28
|
|
|
24
29
|
const ROUTE = '/duplex-control'
|
|
25
30
|
const PAGE_ROUTE = '/duet'
|
|
@@ -141,12 +146,12 @@ function sendError(res, status, message) {
|
|
|
141
146
|
sendJson(res, status, { detail: message })
|
|
142
147
|
}
|
|
143
148
|
|
|
144
|
-
async function readJson(req) {
|
|
149
|
+
async function readJson(req, maximum = MAX_BODY_BYTES) {
|
|
145
150
|
let size = 0
|
|
146
151
|
const chunks = []
|
|
147
152
|
for await (const chunk of req) {
|
|
148
153
|
size += chunk.length
|
|
149
|
-
if (size >
|
|
154
|
+
if (size > maximum) throw new Error('request body is too large')
|
|
150
155
|
chunks.push(chunk)
|
|
151
156
|
}
|
|
152
157
|
if (chunks.length === 0) return {}
|
|
@@ -161,6 +166,34 @@ import { ResultFeed } from './result-feed.mjs'
|
|
|
161
166
|
import { registerSyncFeed } from './sync-feed.mjs'
|
|
162
167
|
|
|
163
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
|
+
}
|
|
164
197
|
const resultFeed = new ResultFeed()
|
|
165
198
|
ctx.effect(() => () => resultFeed.notify())
|
|
166
199
|
const jobs = new Map()
|
|
@@ -191,19 +224,31 @@ export function apply(ctx, options = {}) {
|
|
|
191
224
|
ctx.effect(() => { const avatar=registerAvatarHost(ctx);return ()=>avatar.close() })
|
|
192
225
|
Object.assign(voice, settings.effective())
|
|
193
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')
|
|
194
230
|
const audit = new DuetTrace({ kind: 'host', plugin_version: PLUGIN_VERSION, pid: process.pid },
|
|
195
231
|
{ ...options.traceOptions, secrets: [voice.authorization] })
|
|
196
232
|
ctx.effect(() => () => { void audit.close({ reason: 'plugin_dispose' }) })
|
|
197
233
|
const discovery = new EndpointDiscovery(() => settings.effective(), {...options.endpointDiscoveryOptions, changed: () => {notices.invalidate();serviceInfo.invalidate()}})
|
|
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})
|
|
237
|
+
voice.prepareVoice = () => voices.prepare()
|
|
238
|
+
voice.respondVoiceChallenge = challenge => voices.respondChallenge(challenge)
|
|
239
|
+
voice.applyVoicePolicy = policy => voices.applyPolicy(policy)
|
|
240
|
+
voice.applyVoiceIssue = issue => voices.applyIssue(issue)
|
|
241
|
+
ctx.effect(() => () => voices.close())
|
|
198
242
|
const notices = new ServiceNotices(() => discovery.effective(), (url,options) => discovery.fetch(url,options))
|
|
199
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))
|
|
200
245
|
discovery.refreshIfDue()
|
|
201
246
|
const feedbackStore = options.feedbackStore ?? (options.feedbackDisabled ? null : new RemoteFeedback(()=>discovery.effective(),{keyPath:options.feedbackIdentityPath}))
|
|
202
247
|
const feedback = new FeedbackService(feedbackStore)
|
|
203
248
|
const avatarActivity = new AvatarActivityOutbox(()=>discovery.effective(), options.avatarActivityOptions)
|
|
204
249
|
ctx.effect(()=>()=>avatarActivity.close())
|
|
205
250
|
let duetProxy
|
|
206
|
-
ctx.effect(() => { duetProxy = registerDuetProxy(ctx, voice, feedback, () =>
|
|
251
|
+
ctx.effect(() => { duetProxy = registerDuetProxy(ctx, voice, feedback, () => true, discovery); return duetProxy })
|
|
207
252
|
|
|
208
253
|
ctx.effect(() => () => { hostAbort.abort() })
|
|
209
254
|
|
|
@@ -328,7 +373,8 @@ export function apply(ctx, options = {}) {
|
|
|
328
373
|
|
|
329
374
|
const listSessions = async ({forCatalog = false} = {}) => {
|
|
330
375
|
const { items } = await ctx.sessionController.list({}, hostAbort.signal)
|
|
331
|
-
const
|
|
376
|
+
const managed = new Set(await ctx.get?.('duetAgent')?.managedSessionIds?.() || [])
|
|
377
|
+
const catalog = buildSessionCatalog(items.filter(item=>!managed.has(item.sessionId)), {
|
|
332
378
|
archivedIds: ctx.workspaceRegistry.archivedSessionIds,
|
|
333
379
|
workspaces: ctx.workspaceRegistry.list?.() || [],
|
|
334
380
|
activeId: activeSessionId,
|
|
@@ -538,6 +584,17 @@ export function apply(ctx, options = {}) {
|
|
|
538
584
|
})
|
|
539
585
|
|
|
540
586
|
const handleApi = async (req, res, pathname) => {
|
|
587
|
+
if(pathname===`${ROUTE}/api/voices`){
|
|
588
|
+
const rejection=ctx.connection.requestRejection(req)
|
|
589
|
+
if(rejection){sendError(res,rejection,'DSH connection required');return}
|
|
590
|
+
try {
|
|
591
|
+
if(req.method==='GET'){sendJson(res,200,await voices.refreshAvailability());return}
|
|
592
|
+
if(req.method!=='POST'){sendError(res,405,'method_not_allowed');return}
|
|
593
|
+
if(!identityWriteAllowed(req)){sendError(res,403,'same-origin voice request required');return}
|
|
594
|
+
sendJson(res,200,await voices.update(await readJson(req,14*1024*1024)))
|
|
595
|
+
}catch(error){sendError(res,400,/^[a-z_]+$/.test(error.message)?error.message:'voice_request_failed')}
|
|
596
|
+
return
|
|
597
|
+
}
|
|
541
598
|
if(req.method==='POST'&&pathname===`${ROUTE}/api/avatar/activity`){
|
|
542
599
|
const rejection=ctx.connection.requestRejection(req)
|
|
543
600
|
if(rejection){sendError(res,rejection,'DSH connection required');return}
|
|
@@ -585,20 +642,53 @@ export function apply(ctx, options = {}) {
|
|
|
585
642
|
const body = await readJson(req)
|
|
586
643
|
if (JSON.stringify(body).length > 24000) { sendError(res, 413, 'diagnostic too large'); return }
|
|
587
644
|
audit.event('client.diagnostic', body)
|
|
588
|
-
|
|
589
|
-
|
|
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
|
|
590
650
|
}
|
|
591
651
|
if (req.method === 'GET' && pathname === `${ROUTE}/api/voice/service-info`) {
|
|
592
652
|
sendJson(res, 200, await serviceInfo.get())
|
|
593
653
|
return
|
|
594
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
|
+
}
|
|
595
685
|
if (req.method === 'GET' && pathname === `${ROUTE}/api/voice/config`) {
|
|
596
686
|
let identity
|
|
597
687
|
try {
|
|
598
688
|
if(req.headers[IDENTITY_TRANSPORT_HEADER.toLowerCase()]===IDENTITY_TRANSPORT)identity=feedbackStore?.ensureCredential?.(req,res)
|
|
599
689
|
else feedbackStore?.ensureIdentity?.(req,res)
|
|
600
690
|
} catch {sendJson(res,503,{error_code:'feedback_identity_unavailable'});return}
|
|
601
|
-
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,
|
|
602
692
|
avatar: { web_only: duetEnv('AVATAR_WEB_ONLY') === '1' },
|
|
603
693
|
...(identity?{feedback_identity:identity}:{}), connection: duetProxy?.snapshot?.() || { online: 0, tts_only: 0 } })
|
|
604
694
|
return
|
|
@@ -606,7 +696,17 @@ export function apply(ctx, options = {}) {
|
|
|
606
696
|
if (req.method === 'PUT' && pathname === `${ROUTE}/api/voice/config`) {
|
|
607
697
|
if (!identityWriteAllowed(req)) { sendError(res, 403, 'same-origin settings request required'); return }
|
|
608
698
|
try {
|
|
609
|
-
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)
|
|
610
710
|
Object.assign(voice, settings.effective())
|
|
611
711
|
discovery.invalidate()
|
|
612
712
|
feedback.sessions.clear() // Never send an old rating to a newly selected backend.
|
|
@@ -614,7 +714,7 @@ export function apply(ctx, options = {}) {
|
|
|
614
714
|
notices.invalidate()
|
|
615
715
|
serviceInfo.invalidate()
|
|
616
716
|
duetProxy?.closeConnections?.('voice_settings_changed')
|
|
617
|
-
sendJson(res, 200, result)
|
|
717
|
+
sendJson(res, 200, effectiveWorkPolicy(result,await workPolicy.get()))
|
|
618
718
|
} catch (error) { sendError(res, 400, error.message) }
|
|
619
719
|
return
|
|
620
720
|
}
|
|
@@ -1212,7 +1312,7 @@ export function apply(ctx, options = {}) {
|
|
|
1212
1312
|
const handler = async (req, res) => {
|
|
1213
1313
|
const pathname = new URL(req.url || '/', 'http://localhost').pathname
|
|
1214
1314
|
try {
|
|
1215
|
-
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)) {
|
|
1216
1316
|
const rejection = ctx.connection.requestRejection(req)
|
|
1217
1317
|
if (rejection) { sendError(res, rejection, '请先打开并登录 DSH 主页面'); return }
|
|
1218
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) {
|
|
@@ -91,6 +93,11 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
91
93
|
const timer = setTimeout(() => { void trace.close() }, 1500); timer.unref()
|
|
92
94
|
})
|
|
93
95
|
let back, feedbackTicket = null, connectionRoute, selectedConfig, diagnostics
|
|
96
|
+
let chosenVoice = 'default'
|
|
97
|
+
const policy = config.workPolicy?.()
|
|
98
|
+
const agentMode = (policy?.work_mode ?? config.workMode?.()) === 'agent'
|
|
99
|
+
let agentConnection
|
|
100
|
+
let voiceChallengeStarted = false
|
|
94
101
|
const opening = new AbortController()
|
|
95
102
|
front.once('close', () => feedback?.close(feedbackTicket))
|
|
96
103
|
let state = null
|
|
@@ -105,26 +112,36 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
105
112
|
if (front.readyState === WebSocket.OPEN) front.send(JSON.stringify({ type: 'error', error: { code } }))
|
|
106
113
|
front.close(code === 'capacity_exhausted' ? 1013 : 1008)
|
|
107
114
|
back?.close()
|
|
115
|
+
agentConnection?.close()
|
|
108
116
|
}
|
|
109
117
|
const mode = params.get('mode')
|
|
110
118
|
if (!compatibleVersion(params.get('plugin_version'), config.min_version, config.max_version_exclusive)) { fail('plugin_upgrade_required'); return }
|
|
111
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
|
+
}
|
|
112
124
|
let anonymousUserId
|
|
113
125
|
try{anonymousUserId=feedback?.user(req)}catch{ /* Identity is optional, not admission. */ }
|
|
114
|
-
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'}
|
|
115
129
|
diagnostics = new ConnectionDiagnostics({client_trace_id:clientMetadata.client_trace_id,
|
|
116
130
|
page_id:clientMetadata.page_id, plugin_version:clientMetadata.version, host_version:PLUGIN_VERSION, mode},
|
|
117
131
|
diagnosticOutbox.fetcher, diagnosticOutbox)
|
|
118
|
-
|
|
132
|
+
const reporter = {diagnostics, page_id:clientMetadata.page_id, user:anonymousUserId}
|
|
133
|
+
reporters.set(clientMetadata.client_trace_id, reporter)
|
|
119
134
|
// Allow keepalive HTTP diagnostics to arrive after the browser socket closed.
|
|
120
|
-
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() })
|
|
121
138
|
trace.event('session.metadata',clientMetadata)
|
|
122
139
|
if (!canUseVoice()) { fail('workspace_required'); return }
|
|
123
140
|
connections.set(front, { mode, ready: false, trace })
|
|
124
141
|
front.on('close', () => connections.delete(front))
|
|
125
142
|
const target = config.endpoints[mode]
|
|
126
143
|
if (!target) { fail('voice_mode_unavailable'); return }
|
|
127
|
-
const clientRPC = mode === 'online' && config.control_transport === 'client_rpc_v1'
|
|
144
|
+
const clientRPC = !agentMode && mode === 'online' && config.control_transport === 'client_rpc_v1'
|
|
128
145
|
const rpcRequests = new Map()
|
|
129
146
|
const pending = []
|
|
130
147
|
const startup = setTimeout(() => fail('voice_start_timeout'), 20000)
|
|
@@ -135,7 +152,9 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
135
152
|
if (!binary) {
|
|
136
153
|
const message = JSON.parse(data.toString())
|
|
137
154
|
if (message.type === 'session.update') data = JSON.stringify({...message,
|
|
138
|
-
|
|
155
|
+
session: {...message.session, ...(chosenVoice!=='default'?{voice_id:chosenVoice}:{})},
|
|
156
|
+
client: {...message.client, connection_route: connectionRoute,
|
|
157
|
+
...(chosenVoice!=='default'?{voice_possession_protocol:'voice_possession_v1'}:{})}})
|
|
139
158
|
}
|
|
140
159
|
trace.frame('upstream.send', data, binary)
|
|
141
160
|
back.send(data, {binary})
|
|
@@ -176,7 +195,7 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
176
195
|
initialized = true
|
|
177
196
|
let nickname = null
|
|
178
197
|
try { nickname = normalizeNickname(config.nickname?.()) } catch { /* Default identity. */ }
|
|
179
|
-
|
|
198
|
+
const update = { type: 'session.update',
|
|
180
199
|
client: {...clientMetadata, diagnostics_protocol:DIAGNOSTICS_PROTOCOL,
|
|
181
200
|
...(message.client?.audio_text_protocol === 'audio_text_delta_v1'
|
|
182
201
|
? {audio_text_protocol:'audio_text_delta_v1'} : {}),
|
|
@@ -186,10 +205,21 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
186
205
|
type: 'realtime', preset_id: 'server_default',
|
|
187
206
|
duet_nickname: nickname,
|
|
188
207
|
io_mode:mode === 'tts_only'?'external_only':'online',
|
|
208
|
+
...(agentMode?{work_mode:'agent',work_protocol:'duet_agent_v1'}:{}),
|
|
189
209
|
...(clientRPC ? { harness: { transport: 'client_rpc_v1' } } : {}),
|
|
190
210
|
audio: { input: { format: { type: 'audio/pcm', rate: 16000 } } },
|
|
191
211
|
debug: { enabled: false, slot_grid: false },
|
|
192
|
-
} }
|
|
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))
|
|
193
223
|
return
|
|
194
224
|
}
|
|
195
225
|
if (!initialized) throw new Error('session_not_started')
|
|
@@ -210,14 +240,21 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
210
240
|
return
|
|
211
241
|
}
|
|
212
242
|
if (message.type === 'external_message') {
|
|
213
|
-
if (mode !== 'tts_only') throw new Error('external_only_session_required')
|
|
214
|
-
|
|
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))
|
|
215
250
|
} else if (['output_audio_buffer.playback_progress', 'output_audio_buffer.cleared', 'session.close'].includes(message.type)) {
|
|
216
251
|
forward(raw.toString())
|
|
217
252
|
} else throw new Error('unsupported_voice_event')
|
|
218
253
|
} catch (error) { fail(error.message || 'invalid_voice_event') }
|
|
219
254
|
})
|
|
220
255
|
void (async () => {
|
|
256
|
+
chosenVoice = await config.prepareVoice?.() || 'default'
|
|
257
|
+
if (opening.signal.aborted || front.readyState !== WebSocket.OPEN) return
|
|
221
258
|
const routes = await discovery.plan(mode)
|
|
222
259
|
const selected = await connectEndpoint(WebSocket, routes, {signal: opening.signal, trace})
|
|
223
260
|
if (opening.signal.aborted || front.readyState !== WebSocket.OPEN) { selected.socket.close(); return }
|
|
@@ -231,6 +268,27 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
231
268
|
if (!binary) {
|
|
232
269
|
try {
|
|
233
270
|
const offer = JSON.parse(data.toString())
|
|
271
|
+
if(offer.type==='voice.unavailable'&&offer.selected==='default'){
|
|
272
|
+
chosenVoice='default'
|
|
273
|
+
Promise.resolve(config.applyVoiceIssue?.(offer)).catch(()=>{
|
|
274
|
+
trace.event('voice.issue_persist_failed',{code:'voice_links_unavailable'})
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
if(offer.type==='voice.policy'&&offer.enabled===false&&offer.selected==='default'){
|
|
278
|
+
chosenVoice='default'
|
|
279
|
+
// Queue persistence before forwarding: the reconnect waits for it.
|
|
280
|
+
Promise.resolve(config.applyVoicePolicy?.(offer)).catch(()=>{
|
|
281
|
+
trace.event('voice.policy_persist_failed', {code:'voice_links_unavailable'})
|
|
282
|
+
})
|
|
283
|
+
}
|
|
284
|
+
if (offer.type === 'voice.challenge') {
|
|
285
|
+
if(chosenVoice==='default'||voiceChallengeStarted||!config.respondVoiceChallenge){fail('voice_proof_invalid');return}
|
|
286
|
+
voiceChallengeStarted=true
|
|
287
|
+
Promise.resolve(config.respondVoiceChallenge(offer.challenge)).then(proof=>{
|
|
288
|
+
if(!terminal&&back.readyState===WebSocket.OPEN)back.send(JSON.stringify({type:'voice.proof',...proof}))
|
|
289
|
+
}).catch(()=>fail('voice_proof_invalid'))
|
|
290
|
+
return // Original-file proof and nonce never enter browser/trace.
|
|
291
|
+
}
|
|
234
292
|
if (offer.type === 'client.diagnostics.ready') {
|
|
235
293
|
diagnostics.offer(offer, selectedConfig, selected.route.url)
|
|
236
294
|
return
|
|
@@ -241,16 +299,31 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
241
299
|
if (!binary) {
|
|
242
300
|
try {
|
|
243
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
|
+
}
|
|
244
311
|
if (event.type === 'harness.rpc.request') {
|
|
245
312
|
if (!clientRPC || rpcRequests.size >= 8) { fail('invalid_harness_rpc'); return }
|
|
246
313
|
rpcRequests.set(event.request_id, event.connection_id)
|
|
247
314
|
}
|
|
248
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
|
+
}
|
|
249
322
|
if (!diagnostics.target) { fail('voice_server_upgrade_required'); return }
|
|
250
323
|
if (clientRPC && event.harness_sync?.protocol === 'harness_sync_v1') resultPushConnection = event.harness_sync.connection_id
|
|
251
324
|
hintReporting=event.connection_hint_reporting===true
|
|
252
325
|
if (clientRPC && event.session?.config?.harness_control_transport !== 'client_rpc_v1') { fail('harness_rpc_backend_upgrade_required'); return }
|
|
253
|
-
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 }
|
|
254
327
|
const connection = connections.get(front)
|
|
255
328
|
if (connection) connection.ready = true
|
|
256
329
|
clearTimeout(startup)
|
|
@@ -286,13 +359,14 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
286
359
|
diagnostics.add({event:'proxy.browser_closed',code})
|
|
287
360
|
trace.event('rpc.pending_at_close', { request_ids: [...rpcRequests.keys()] })
|
|
288
361
|
opening.abort(); clearTimeout(startup); back?.close(1000, 'duet_browser_closed')
|
|
362
|
+
agentConnection?.close()
|
|
289
363
|
const timer = setTimeout(() => back?.terminate(), 1000)
|
|
290
364
|
timer.unref()
|
|
291
365
|
})
|
|
292
366
|
})
|
|
293
367
|
},
|
|
294
368
|
})
|
|
295
|
-
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() }
|
|
296
370
|
dispose.snapshot = () => ({
|
|
297
371
|
online: [...connections.values()].filter(c => c.mode === 'online' && c.ready).length,
|
|
298
372
|
tts_only: [...connections.values()].filter(c => c.mode === 'tts_only' && c.ready).length,
|
|
@@ -301,9 +375,9 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
301
375
|
})
|
|
302
376
|
dispose.reportDiagnostic = (req, row) => {
|
|
303
377
|
const entry = reporters.get(row?.client_trace_id)
|
|
304
|
-
if (!entry || entry.page_id !== row.page_id) return
|
|
305
|
-
if (entry.user && feedback?.user(req) !== entry.user) return
|
|
306
|
-
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)
|
|
307
381
|
}
|
|
308
382
|
dispose.closeConnections = code => {
|
|
309
383
|
for (const socket of connections.keys()) {
|