@rarog/server 0.0.0-stage → 1.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +161 -2
- package/THIRD-PARTY-NOTICES +2110 -0
- package/bin/rarog.mjs +146 -0
- package/node_modules/@rarog/shared/LICENSE +21 -0
- package/node_modules/@rarog/shared/package.json +43 -0
- package/node_modules/@rarog/shared/src/data-dir.d.mts +49 -0
- package/node_modules/@rarog/shared/src/data-dir.mjs +120 -0
- package/node_modules/@rarog/shared/src/decode.js +381 -0
- package/node_modules/@rarog/shared/src/iroh.js +13 -0
- package/node_modules/@rarog/shared/src/notify-copy.js +12 -0
- package/node_modules/@rarog/shared/src/pairing-link.js +246 -0
- package/node_modules/@rarog/shared/src/protocol/activity.js +42 -0
- package/node_modules/@rarog/shared/src/protocol/attachments.js +192 -0
- package/node_modules/@rarog/shared/src/protocol/background.js +89 -0
- package/node_modules/@rarog/shared/src/protocol/commands.js +34 -0
- package/node_modules/@rarog/shared/src/protocol/consent.js +28 -0
- package/node_modules/@rarog/shared/src/protocol/dictation.js +23 -0
- package/node_modules/@rarog/shared/src/protocol/diff.js +78 -0
- package/node_modules/@rarog/shared/src/protocol/directories.js +44 -0
- package/node_modules/@rarog/shared/src/protocol/files.js +33 -0
- package/node_modules/@rarog/shared/src/protocol/git.js +23 -0
- package/node_modules/@rarog/shared/src/protocol/herdr.js +23 -0
- package/node_modules/@rarog/shared/src/protocol/inbox.js +38 -0
- package/node_modules/@rarog/shared/src/protocol/model.js +214 -0
- package/node_modules/@rarog/shared/src/protocol/notes.js +91 -0
- package/node_modules/@rarog/shared/src/protocol/resume.js +57 -0
- package/node_modules/@rarog/shared/src/protocol/terminal.js +259 -0
- package/node_modules/@rarog/shared/src/protocol.js +864 -0
- package/node_modules/@rarog/shared/src/relay-auth.js +231 -0
- package/node_modules/@rarog/shared/src/relay.js +103 -0
- package/node_modules/@rarog/shared/src/rest.js +898 -0
- package/node_modules/@rarog/shared/src/sentences/commands.js +203 -0
- package/node_modules/@rarog/shared/src/sentences/demo.js +10 -0
- package/node_modules/@rarog/shared/src/sentences/dialogs.js +103 -0
- package/node_modules/@rarog/shared/src/sentences/herdr.js +111 -0
- package/node_modules/@rarog/shared/src/sentences/index.js +362 -0
- package/node_modules/@rarog/shared/src/sentences/model.js +73 -0
- package/node_modules/@rarog/shared/src/sentences/push.js +56 -0
- package/node_modules/@rarog/shared/src/sentences/rest.js +140 -0
- package/node_modules/@rarog/shared/src/sentences/restart.js +71 -0
- package/node_modules/@rarog/shared/src/sentences/session.js +133 -0
- package/node_modules/@rarog/shared/src/sentences/state.js +15 -0
- package/node_modules/@rarog/shared/src/sentences/term.js +34 -0
- package/node_modules/@rarog/shared/src/sentences/transcript.js +24 -0
- package/node_modules/@rarog/shared/src/sentences/uploads.js +32 -0
- package/node_modules/@rarog/shared/src/workflow-phases.js +45 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/camelcase/index.d.ts +63 -0
- package/node_modules/camelcase/index.js +76 -0
- package/node_modules/camelcase/license +9 -0
- package/node_modules/camelcase/package.json +43 -0
- package/node_modules/camelcase/readme.md +99 -0
- package/node_modules/cliui/LICENSE.txt +14 -0
- package/node_modules/cliui/README.md +115 -0
- package/node_modules/cliui/index.js +354 -0
- package/node_modules/cliui/package.json +65 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/decamelize/index.js +13 -0
- package/node_modules/decamelize/license +21 -0
- package/node_modules/decamelize/package.json +38 -0
- package/node_modules/decamelize/readme.md +48 -0
- package/node_modules/dijkstrajs/.travis.yml +4 -0
- package/node_modules/dijkstrajs/CONTRIBUTING.md +8 -0
- package/node_modules/dijkstrajs/LICENSE.md +19 -0
- package/node_modules/dijkstrajs/README.md +18 -0
- package/node_modules/dijkstrajs/dijkstra.js +165 -0
- package/node_modules/dijkstrajs/package.json +60 -0
- package/node_modules/dijkstrajs/test/dijkstra.test.js +96 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +23 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +50 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/find-up/index.d.ts +137 -0
- package/node_modules/find-up/index.js +89 -0
- package/node_modules/find-up/license +9 -0
- package/node_modules/find-up/package.json +53 -0
- package/node_modules/find-up/readme.md +156 -0
- package/node_modules/get-caller-file/LICENSE.md +6 -0
- package/node_modules/get-caller-file/README.md +41 -0
- package/node_modules/get-caller-file/index.d.ts +2 -0
- package/node_modules/get-caller-file/index.js +22 -0
- package/node_modules/get-caller-file/index.js.map +1 -0
- package/node_modules/get-caller-file/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/node_modules/is-fullwidth-code-point/index.js +50 -0
- package/node_modules/is-fullwidth-code-point/license +9 -0
- package/node_modules/is-fullwidth-code-point/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/locate-path/index.d.ts +83 -0
- package/node_modules/locate-path/index.js +65 -0
- package/node_modules/locate-path/license +9 -0
- package/node_modules/locate-path/package.json +45 -0
- package/node_modules/locate-path/readme.md +122 -0
- package/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-limit/license +9 -0
- package/node_modules/p-limit/package.json +52 -0
- package/node_modules/p-limit/readme.md +101 -0
- package/node_modules/p-locate/index.d.ts +64 -0
- package/node_modules/p-locate/index.js +52 -0
- package/node_modules/p-locate/license +9 -0
- package/node_modules/p-locate/package.json +53 -0
- package/node_modules/p-locate/readme.md +90 -0
- package/node_modules/p-try/index.d.ts +39 -0
- package/node_modules/p-try/index.js +9 -0
- package/node_modules/p-try/license +9 -0
- package/node_modules/p-try/package.json +42 -0
- package/node_modules/p-try/readme.md +58 -0
- package/node_modules/path-exists/index.d.ts +28 -0
- package/node_modules/path-exists/index.js +23 -0
- package/node_modules/path-exists/license +9 -0
- package/node_modules/path-exists/package.json +39 -0
- package/node_modules/path-exists/readme.md +52 -0
- package/node_modules/pngjs/.eslintignore +2 -0
- package/node_modules/pngjs/.eslintrc.json +19 -0
- package/node_modules/pngjs/.prettierignore +3 -0
- package/node_modules/pngjs/LICENSE +20 -0
- package/node_modules/pngjs/README.md +429 -0
- package/node_modules/pngjs/browser.js +16096 -0
- package/node_modules/pngjs/coverage/lcov-report/base.css +354 -0
- package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +881 -0
- package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +554 -0
- package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +77 -0
- package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +647 -0
- package/node_modules/pngjs/coverage/lcov-report/constants.js.html +176 -0
- package/node_modules/pngjs/coverage/lcov-report/crc.js.html +200 -0
- package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +593 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +152 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +143 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +611 -0
- package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +359 -0
- package/node_modules/pngjs/coverage/lcov-report/index.html +426 -0
- package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +365 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +230 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +248 -0
- package/node_modules/pngjs/coverage/lcov-report/packer.js.html +467 -0
- package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +128 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +575 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +404 -0
- package/node_modules/pngjs/coverage/lcov-report/parser.js.html +950 -0
- package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +116 -0
- package/node_modules/pngjs/coverage/lcov-report/png.js.html +662 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.css +101 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.js +1007 -0
- package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/sorter.js +169 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +584 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +215 -0
- package/node_modules/pngjs/coverage/lcov.info +2177 -0
- package/node_modules/pngjs/lib/bitmapper.js +267 -0
- package/node_modules/pngjs/lib/bitpacker.js +158 -0
- package/node_modules/pngjs/lib/chunkstream.js +189 -0
- package/node_modules/pngjs/lib/constants.js +32 -0
- package/node_modules/pngjs/lib/crc.js +40 -0
- package/node_modules/pngjs/lib/filter-pack.js +171 -0
- package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
- package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
- package/node_modules/pngjs/lib/filter-parse.js +177 -0
- package/node_modules/pngjs/lib/format-normaliser.js +93 -0
- package/node_modules/pngjs/lib/interlace.js +95 -0
- package/node_modules/pngjs/lib/packer-async.js +50 -0
- package/node_modules/pngjs/lib/packer-sync.js +56 -0
- package/node_modules/pngjs/lib/packer.js +129 -0
- package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
- package/node_modules/pngjs/lib/parser-async.js +165 -0
- package/node_modules/pngjs/lib/parser-sync.js +108 -0
- package/node_modules/pngjs/lib/parser.js +290 -0
- package/node_modules/pngjs/lib/png-sync.js +12 -0
- package/node_modules/pngjs/lib/png.js +194 -0
- package/node_modules/pngjs/lib/sync-inflate.js +168 -0
- package/node_modules/pngjs/lib/sync-reader.js +45 -0
- package/node_modules/pngjs/package.json +73 -0
- package/node_modules/qrcode/README.md +770 -0
- package/node_modules/qrcode/bin/qrcode +159 -0
- package/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/node_modules/qrcode/lib/browser.js +76 -0
- package/node_modules/qrcode/lib/can-promise.js +7 -0
- package/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/node_modules/qrcode/lib/core/mode.js +167 -0
- package/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/node_modules/qrcode/lib/core/regex.js +31 -0
- package/node_modules/qrcode/lib/core/segments.js +330 -0
- package/node_modules/qrcode/lib/core/utils.js +63 -0
- package/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/node_modules/qrcode/lib/core/version.js +163 -0
- package/node_modules/qrcode/lib/index.js +12 -0
- package/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/node_modules/qrcode/lib/server.js +138 -0
- package/node_modules/qrcode/license +10 -0
- package/node_modules/qrcode/package.json +77 -0
- package/node_modules/require-directory/.jshintrc +67 -0
- package/node_modules/require-directory/.npmignore +1 -0
- package/node_modules/require-directory/.travis.yml +3 -0
- package/node_modules/require-directory/LICENSE +22 -0
- package/node_modules/require-directory/README.markdown +184 -0
- package/node_modules/require-directory/index.js +86 -0
- package/node_modules/require-directory/package.json +40 -0
- package/node_modules/require-main-filename/LICENSE.txt +14 -0
- package/node_modules/require-main-filename/README.md +26 -0
- package/node_modules/require-main-filename/index.js +18 -0
- package/node_modules/require-main-filename/package.json +35 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +42 -0
- package/node_modules/string-width/index.d.ts +29 -0
- package/node_modules/string-width/index.js +47 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +56 -0
- package/node_modules/string-width/readme.md +50 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/which-module/LICENSE +13 -0
- package/node_modules/which-module/README.md +58 -0
- package/node_modules/which-module/index.js +9 -0
- package/node_modules/which-module/package.json +41 -0
- package/node_modules/wrap-ansi/index.js +186 -0
- package/node_modules/wrap-ansi/license +9 -0
- package/node_modules/wrap-ansi/package.json +61 -0
- package/node_modules/wrap-ansi/readme.md +97 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/y18n/LICENSE +13 -0
- package/node_modules/y18n/README.md +109 -0
- package/node_modules/y18n/index.js +188 -0
- package/node_modules/y18n/package.json +39 -0
- package/node_modules/yargs/LICENSE +21 -0
- package/node_modules/yargs/README.md +140 -0
- package/node_modules/yargs/build/lib/apply-extends.d.ts +2 -0
- package/node_modules/yargs/build/lib/apply-extends.js +65 -0
- package/node_modules/yargs/build/lib/argsert.d.ts +2 -0
- package/node_modules/yargs/build/lib/argsert.js +65 -0
- package/node_modules/yargs/build/lib/command.d.ts +64 -0
- package/node_modules/yargs/build/lib/command.js +416 -0
- package/node_modules/yargs/build/lib/common-types.d.ts +36 -0
- package/node_modules/yargs/build/lib/common-types.js +25 -0
- package/node_modules/yargs/build/lib/completion-templates.d.ts +2 -0
- package/node_modules/yargs/build/lib/completion-templates.js +50 -0
- package/node_modules/yargs/build/lib/completion.d.ts +21 -0
- package/node_modules/yargs/build/lib/completion.js +135 -0
- package/node_modules/yargs/build/lib/is-promise.d.ts +1 -0
- package/node_modules/yargs/build/lib/is-promise.js +9 -0
- package/node_modules/yargs/build/lib/levenshtein.d.ts +1 -0
- package/node_modules/yargs/build/lib/levenshtein.js +58 -0
- package/node_modules/yargs/build/lib/middleware.d.ts +10 -0
- package/node_modules/yargs/build/lib/middleware.js +57 -0
- package/node_modules/yargs/build/lib/obj-filter.d.ts +1 -0
- package/node_modules/yargs/build/lib/obj-filter.js +14 -0
- package/node_modules/yargs/build/lib/parse-command.d.ts +11 -0
- package/node_modules/yargs/build/lib/parse-command.js +36 -0
- package/node_modules/yargs/build/lib/process-argv.d.ts +2 -0
- package/node_modules/yargs/build/lib/process-argv.js +31 -0
- package/node_modules/yargs/build/lib/usage.d.ts +49 -0
- package/node_modules/yargs/build/lib/usage.js +540 -0
- package/node_modules/yargs/build/lib/validation.d.ts +34 -0
- package/node_modules/yargs/build/lib/validation.js +330 -0
- package/node_modules/yargs/build/lib/yargs.d.ts +274 -0
- package/node_modules/yargs/build/lib/yargs.js +1190 -0
- package/node_modules/yargs/build/lib/yerror.d.ts +4 -0
- package/node_modules/yargs/build/lib/yerror.js +11 -0
- package/node_modules/yargs/index.js +40 -0
- package/node_modules/yargs/locales/be.json +46 -0
- package/node_modules/yargs/locales/de.json +46 -0
- package/node_modules/yargs/locales/en.json +51 -0
- package/node_modules/yargs/locales/es.json +46 -0
- package/node_modules/yargs/locales/fi.json +49 -0
- package/node_modules/yargs/locales/fr.json +53 -0
- package/node_modules/yargs/locales/hi.json +49 -0
- package/node_modules/yargs/locales/hu.json +46 -0
- package/node_modules/yargs/locales/id.json +50 -0
- package/node_modules/yargs/locales/it.json +46 -0
- package/node_modules/yargs/locales/ja.json +51 -0
- package/node_modules/yargs/locales/ko.json +49 -0
- package/node_modules/yargs/locales/nb.json +44 -0
- package/node_modules/yargs/locales/nl.json +49 -0
- package/node_modules/yargs/locales/nn.json +44 -0
- package/node_modules/yargs/locales/pirate.json +13 -0
- package/node_modules/yargs/locales/pl.json +49 -0
- package/node_modules/yargs/locales/pt.json +45 -0
- package/node_modules/yargs/locales/pt_BR.json +48 -0
- package/node_modules/yargs/locales/ru.json +46 -0
- package/node_modules/yargs/locales/th.json +46 -0
- package/node_modules/yargs/locales/tr.json +48 -0
- package/node_modules/yargs/locales/zh_CN.json +48 -0
- package/node_modules/yargs/locales/zh_TW.json +47 -0
- package/node_modules/yargs/package.json +92 -0
- package/node_modules/yargs/yargs.js +14 -0
- package/node_modules/yargs-parser/LICENSE.txt +14 -0
- package/node_modules/yargs-parser/README.md +449 -0
- package/node_modules/yargs-parser/index.js +1032 -0
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
- package/node_modules/yargs-parser/package.json +46 -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 +49 -4
- package/scripts/hooks/canon.mjs +45 -0
- package/scripts/hooks/consent.mjs +728 -0
- package/scripts/hooks/rarog-context.mjs +163 -0
- package/scripts/hooks/rarog-pending.mjs +1498 -0
- package/scripts/hooks/rarog-statusline.mjs +258 -0
- package/scripts/hooks/tall-dialog.mjs +400 -0
- package/scripts/hooks/work-area.mjs +138 -0
- package/scripts/restart.sh +393 -0
- package/server/src/auth/admin.js +272 -0
- package/server/src/auth/consent-socket.js +89 -0
- package/server/src/auth/device.js +81 -0
- package/server/src/auth/devices-store.js +544 -0
- package/server/src/auth/index.js +26 -0
- package/server/src/auth/limiter.js +95 -0
- package/server/src/auth/origin.js +13 -0
- package/server/src/auth/pairing.js +201 -0
- package/server/src/auth/principal.js +28 -0
- package/server/src/auth/redact.js +78 -0
- package/server/src/auth/unix-socket.js +156 -0
- package/server/src/bootstrap/alive-sessions.js +22 -0
- package/server/src/bootstrap/consent.js +453 -0
- package/server/src/bootstrap/devices.js +43 -0
- package/server/src/bootstrap/health.js +45 -0
- package/server/src/bootstrap/herdr.js +25 -0
- package/server/src/bootstrap/hook-files.js +97 -0
- package/server/src/bootstrap/http.js +70 -0
- package/server/src/bootstrap/inbox.js +54 -0
- package/server/src/bootstrap/iroh.js +26 -0
- package/server/src/bootstrap/manager.js +51 -0
- package/server/src/bootstrap/pr-status.js +35 -0
- package/server/src/bootstrap/push.js +88 -0
- package/server/src/bootstrap/sse.js +32 -0
- package/server/src/bootstrap/term.js +54 -0
- package/server/src/bootstrap/versions.js +45 -0
- package/server/src/cli/child-output.js +214 -0
- package/server/src/cli/claude-settings.js +905 -0
- package/server/src/cli/config-rewrite.js +147 -0
- package/server/src/cli/devices.js +417 -0
- package/server/src/cli/dialogs.js +212 -0
- package/server/src/cli/dictation.js +87 -0
- package/server/src/cli/doctor-no-hook.js +162 -0
- package/server/src/cli/doctor-pr-status.js +77 -0
- package/server/src/cli/doctor-write-block.js +65 -0
- package/server/src/cli/doctor.js +1530 -0
- package/server/src/cli/hooks.js +734 -0
- package/server/src/cli/io.js +61 -0
- package/server/src/cli/launchd-loaded.js +82 -0
- package/server/src/cli/lock.js +170 -0
- package/server/src/cli/main.js +129 -0
- package/server/src/cli/restart.js +842 -0
- package/server/src/cli/screen/ask.js +55 -0
- package/server/src/cli/screen/log.js +136 -0
- package/server/src/cli/screen/prose.js +74 -0
- package/server/src/cli/screen/steps.js +528 -0
- package/server/src/cli/screen/style.js +161 -0
- package/server/src/cli/secret-input.js +212 -0
- package/server/src/cli/secrets-file.js +288 -0
- package/server/src/cli/serve.js +687 -0
- package/server/src/cli/service.js +1375 -0
- package/server/src/cli/setup-check.js +287 -0
- package/server/src/cli/setup-config.js +192 -0
- package/server/src/cli/setup-context.js +174 -0
- package/server/src/cli/setup-herdr-agent.js +503 -0
- package/server/src/cli/setup-herdr-unit.js +437 -0
- package/server/src/cli/setup-plan.js +85 -0
- package/server/src/cli/setup-screen.js +372 -0
- package/server/src/cli/setup-secrets.js +179 -0
- package/server/src/cli/setup-settings.js +305 -0
- package/server/src/cli/setup-tailscale-add.js +235 -0
- package/server/src/cli/setup-tailscale-only.js +81 -0
- package/server/src/cli/setup-tailscale-port.js +276 -0
- package/server/src/cli/setup-transport.js +417 -0
- package/server/src/cli/setup-voice.js +174 -0
- package/server/src/cli/setup.js +1191 -0
- package/server/src/cli/systemd-unit.js +370 -0
- package/server/src/cli/templates/herdr-agent.plist +34 -0
- package/server/src/cli/templates/launchd.plist +35 -0
- package/server/src/cli/templates/rarog.service +25 -0
- package/server/src/cli/update-channel.js +100 -0
- package/server/src/cli/update-lock.js +148 -0
- package/server/src/cli/update-provenance.js +303 -0
- package/server/src/cli/update-registry.js +628 -0
- package/server/src/cli/update.js +451 -0
- package/server/src/cli/voice-agent.js +235 -0
- package/server/src/cli/voice-keys.js +71 -0
- package/server/src/cli-store.js +38 -0
- package/server/src/cli-version.js +442 -0
- package/server/src/client-log.js +121 -0
- package/server/src/companion/ask.js +165 -0
- package/server/src/companion/asks-owner.js +205 -0
- package/server/src/companion/catalog.js +22 -0
- package/server/src/companion/cli-literals.js +84 -0
- package/server/src/companion/cli.js +235 -0
- package/server/src/companion/condense.js +274 -0
- package/server/src/companion/conversation.js +21 -0
- package/server/src/companion/index.js +46 -0
- package/server/src/companion/mask.js +37 -0
- package/server/src/companion/openai-token.js +129 -0
- package/server/src/companion/prompt.js +102 -0
- package/server/src/companion/turns-settle.js +33 -0
- package/server/src/companion/turns.js +132 -0
- package/server/src/config/claude-account.js +101 -0
- package/server/src/config/clients.js +45 -0
- package/server/src/config/demo.js +97 -0
- package/server/src/config/files.js +32 -0
- package/server/src/config/flags.js +152 -0
- package/server/src/config/herdr.js +129 -0
- package/server/src/config/listen.js +122 -0
- package/server/src/config/protected-dirs.js +79 -0
- package/server/src/config/push.js +72 -0
- package/server/src/config/roots.js +259 -0
- package/server/src/config/terminal.js +86 -0
- package/server/src/config/voice.js +21 -0
- package/server/src/config/work-area.js +168 -0
- package/server/src/config-env.js +530 -0
- package/server/src/config.js +749 -0
- package/server/src/demo/content/en.js +673 -0
- package/server/src/demo/content/index.js +16 -0
- package/server/src/demo/content/named-set.js +59 -0
- package/server/src/demo/content/pl.js +691 -0
- package/server/src/demo/content/types.js +1 -0
- package/server/src/demo/control.js +574 -0
- package/server/src/demo/files.js +49 -0
- package/server/src/demo/inbox.js +73 -0
- package/server/src/demo/mac.js +20 -0
- package/server/src/demo/mock-herdr.js +251 -0
- package/server/src/demo/notes.js +60 -0
- package/server/src/demo/review-routes.js +101 -0
- package/server/src/demo/scenarios.js +338 -0
- package/server/src/demo/seeds.js +480 -0
- package/server/src/demo/usage.js +29 -0
- package/server/src/demo/voice.js +24 -0
- package/server/src/device-effects.js +39 -0
- package/server/src/drivers/herdr/audit-fields.js +27 -0
- package/server/src/drivers/herdr/cli-reserve.js +238 -0
- package/server/src/drivers/herdr/command-dialog-settle.js +90 -0
- package/server/src/drivers/herdr/commands.js +751 -0
- package/server/src/drivers/herdr/consent-channel.js +231 -0
- package/server/src/drivers/herdr/consent-no-hook-io.js +89 -0
- package/server/src/drivers/herdr/consent-no-hook.js +316 -0
- package/server/src/drivers/herdr/consent-registry-read.js +45 -0
- package/server/src/drivers/herdr/form-reserve.js +203 -0
- package/server/src/drivers/herdr/layer2-card.js +302 -0
- package/server/src/drivers/herdr/layer2-step.js +199 -0
- package/server/src/drivers/herdr/prompt-gates.js +118 -0
- package/server/src/drivers/herdr/prompt-paste.js +106 -0
- package/server/src/drivers/herdr/prompt-queue-store.js +284 -0
- package/server/src/drivers/herdr/prompt-queue.js +921 -0
- package/server/src/drivers/herdr/pull-request-poll.js +61 -0
- package/server/src/drivers/herdr/queue-take-back.js +429 -0
- package/server/src/drivers/herdr/refusals.js +226 -0
- package/server/src/drivers/herdr/returned-prompt.js +172 -0
- package/server/src/drivers/herdr/scheduled-task-poll.js +120 -0
- package/server/src/drivers/herdr/stale-block.js +33 -0
- package/server/src/drivers/herdr/take-back-field.js +311 -0
- package/server/src/drivers/herdr/transcript.js +186 -0
- package/server/src/drivers/herdr/turn-guard.js +328 -0
- package/server/src/drivers/herdr-driver.js +4332 -0
- package/server/src/drivers/mock-driver.js +541 -0
- package/server/src/drivers/runtime.js +76 -0
- package/server/src/drivers/tool-summary.js +95 -0
- package/server/src/drivers/tool-text.js +206 -0
- package/server/src/drivers/types.js +15 -0
- package/server/src/files/file-index.js +246 -0
- package/server/src/files/ignored.js +119 -0
- package/server/src/files/listing.js +76 -0
- package/server/src/files/path-rule.js +145 -0
- package/server/src/files/refusals.js +36 -0
- package/server/src/files/send-file.js +115 -0
- package/server/src/files/session-download.js +51 -0
- package/server/src/files/session-files.js +38 -0
- package/server/src/files/session-gate.js +48 -0
- package/server/src/fs-browse.js +268 -0
- package/server/src/fs-mkdir-child.js +86 -0
- package/server/src/fs-mkdir.js +161 -0
- package/server/src/git-config-guard.js +72 -0
- package/server/src/git-diff.js +356 -0
- package/server/src/git-sandbox.js +100 -0
- package/server/src/git-stats.js +61 -0
- package/server/src/git-status.js +1073 -0
- package/server/src/git-watch.js +299 -0
- package/server/src/git-work-tree.js +33 -0
- package/server/src/health.js +167 -0
- package/server/src/herdr/answer-recheck.js +85 -0
- package/server/src/herdr/argv.js +234 -0
- package/server/src/herdr/audit.js +520 -0
- package/server/src/herdr/background/agent-file.js +411 -0
- package/server/src/herdr/background/artifacts.js +173 -0
- package/server/src/herdr/background/cli-shapes.js +442 -0
- package/server/src/herdr/background/ids.js +29 -0
- package/server/src/herdr/background/incremental-read.js +70 -0
- package/server/src/herdr/background/index.js +93 -0
- package/server/src/herdr/background/jsonl-lines.js +68 -0
- package/server/src/herdr/background/main-scan.js +229 -0
- package/server/src/herdr/background/merge.js +336 -0
- package/server/src/herdr/background/notice.js +110 -0
- package/server/src/herdr/background/notification.js +267 -0
- package/server/src/herdr/background/pull-request-files.js +257 -0
- package/server/src/herdr/background/pull-requests.js +684 -0
- package/server/src/herdr/background/queued-prompt.js +52 -0
- package/server/src/herdr/background/reducer.js +682 -0
- package/server/src/herdr/background/satellite.js +73 -0
- package/server/src/herdr/background/scheduled-task-file.js +118 -0
- package/server/src/herdr/background/scheduled-tasks.js +251 -0
- package/server/src/herdr/background/work.js +134 -0
- package/server/src/herdr/background/workflow-run.js +417 -0
- package/server/src/herdr/client.js +894 -0
- package/server/src/herdr/commands/catalog.js +179 -0
- package/server/src/herdr/commands/discover.js +605 -0
- package/server/src/herdr/commands/guard.js +192 -0
- package/server/src/herdr/commands/index.js +35 -0
- package/server/src/herdr/commands/registry.js +496 -0
- package/server/src/herdr/commands/shape.js +240 -0
- package/server/src/herdr/commands/transcript.js +261 -0
- package/server/src/herdr/consent-evidence.js +592 -0
- package/server/src/herdr/consent-step.js +44 -0
- package/server/src/herdr/consent-subagent.js +423 -0
- package/server/src/herdr/dialogs/cards/build.js +445 -0
- package/server/src/herdr/dialogs/cards/ids.js +101 -0
- package/server/src/herdr/dialogs/cards/roles.js +22 -0
- package/server/src/herdr/dialogs/consent-gate.js +62 -0
- package/server/src/herdr/dialogs/copy.js +97 -0
- package/server/src/herdr/dialogs/cross-check.js +500 -0
- package/server/src/herdr/dialogs/decide/decide.js +825 -0
- package/server/src/herdr/dialogs/decide/input.js +1 -0
- package/server/src/herdr/dialogs/decide/reasons.js +60 -0
- package/server/src/herdr/dialogs/decide/sources.js +322 -0
- package/server/src/herdr/dialogs/hook/answers.js +190 -0
- package/server/src/herdr/dialogs/hook/canon.js +28 -0
- package/server/src/herdr/dialogs/hook/contract.js +232 -0
- package/server/src/herdr/dialogs/hook/dump.js +350 -0
- package/server/src/herdr/dialogs/hook/suggestions.js +75 -0
- package/server/src/herdr/dialogs/hook/target.js +99 -0
- package/server/src/herdr/dialogs/index.js +208 -0
- package/server/src/herdr/dialogs/layer1/always.js +71 -0
- package/server/src/herdr/dialogs/layer1/bind.js +193 -0
- package/server/src/herdr/dialogs/layer1/card.js +190 -0
- package/server/src/herdr/dialogs/layer1/cards.js +37 -0
- package/server/src/herdr/dialogs/layer1/contract.js +399 -0
- package/server/src/herdr/dialogs/layer1/cycle.js +1746 -0
- package/server/src/herdr/dialogs/layer1/desk-reason.js +119 -0
- package/server/src/herdr/dialogs/layer1/desk.js +190 -0
- package/server/src/herdr/dialogs/layer1/frames.js +118 -0
- package/server/src/herdr/dialogs/layer1/hook-list/hook-list.js +1049 -0
- package/server/src/herdr/dialogs/layer1/hook-list/session-facts.js +135 -0
- package/server/src/herdr/dialogs/layer1/mode.js +93 -0
- package/server/src/herdr/dialogs/layer1/observe.js +419 -0
- package/server/src/herdr/dialogs/layer1/proof.js +454 -0
- package/server/src/herdr/dialogs/layer1/receipt.js +71 -0
- package/server/src/herdr/dialogs/layer1/records.js +236 -0
- package/server/src/herdr/dialogs/layer1/registry.js +274 -0
- package/server/src/herdr/dialogs/layer1/resume.js +178 -0
- package/server/src/herdr/dialogs/layer1/sign.js +182 -0
- package/server/src/herdr/dialogs/layer1/top.js +264 -0
- package/server/src/herdr/dialogs/layer1/turns.js +251 -0
- package/server/src/herdr/dialogs/layer1/version-gate.js +162 -0
- package/server/src/herdr/dialogs/layer2/card.js +109 -0
- package/server/src/herdr/dialogs/layer2/match.js +98 -0
- package/server/src/herdr/dialogs/layer2/read-block.js +153 -0
- package/server/src/herdr/dialogs/layer2/shapes.js +61 -0
- package/server/src/herdr/dialogs/layer2/stability.js +104 -0
- package/server/src/herdr/dialogs/layer2/verdict.js +282 -0
- package/server/src/herdr/dialogs/no-hook.js +63 -0
- package/server/src/herdr/dialogs/policy/consent.js +29 -0
- package/server/src/herdr/dialogs/policy/escalation.js +115 -0
- package/server/src/herdr/dialogs/policy/exit-tasks.js +34 -0
- package/server/src/herdr/dialogs/policy/measured-consent.js +123 -0
- package/server/src/herdr/dialogs/policy/option-policy.js +22 -0
- package/server/src/herdr/dialogs/policy/options.js +79 -0
- package/server/src/herdr/dialogs/policy/pause.js +18 -0
- package/server/src/herdr/dialogs/policy/terminal.js +93 -0
- package/server/src/herdr/dialogs/presence.js +49 -0
- package/server/src/herdr/dialogs/refusals.js +271 -0
- package/server/src/herdr/dialogs/router.js +137 -0
- package/server/src/herdr/dialogs/screen/auto-deny.js +31 -0
- package/server/src/herdr/dialogs/screen/bash-zone.js +161 -0
- package/server/src/herdr/dialogs/screen/block-visible.js +60 -0
- package/server/src/herdr/dialogs/screen/block.js +296 -0
- package/server/src/herdr/dialogs/screen/confirm.js +83 -0
- package/server/src/herdr/dialogs/screen/dialog-bottom.js +54 -0
- package/server/src/herdr/dialogs/screen/edit-frame.js +391 -0
- package/server/src/herdr/dialogs/screen/edit-zone.js +33 -0
- package/server/src/herdr/dialogs/screen/excerpt.js +48 -0
- package/server/src/herdr/dialogs/screen/file-dialog.js +38 -0
- package/server/src/herdr/dialogs/screen/form.js +199 -0
- package/server/src/herdr/dialogs/screen/identity.js +23 -0
- package/server/src/herdr/dialogs/screen/kinds.js +39 -0
- package/server/src/herdr/dialogs/screen/known.js +101 -0
- package/server/src/herdr/dialogs/screen/mode-footer.js +90 -0
- package/server/src/herdr/dialogs/screen/operation.js +196 -0
- package/server/src/herdr/dialogs/screen/option-run.js +62 -0
- package/server/src/herdr/dialogs/screen/options.js +534 -0
- package/server/src/herdr/dialogs/screen/parse.js +368 -0
- package/server/src/herdr/dialogs/screen/plan-file.js +53 -0
- package/server/src/herdr/dialogs/screen/queue.js +59 -0
- package/server/src/herdr/dialogs/screen/region.js +92 -0
- package/server/src/herdr/dialogs/screen/resolve.js +305 -0
- package/server/src/herdr/dialogs/screen/review.js +118 -0
- package/server/src/herdr/dialogs/screen/signatures.js +1030 -0
- package/server/src/herdr/dialogs/screen/snippet.js +49 -0
- package/server/src/herdr/dialogs/screen/text.js +50 -0
- package/server/src/herdr/dialogs/screen/trust-arrow.js +122 -0
- package/server/src/herdr/dialogs/screen/write-zone.js +41 -0
- package/server/src/herdr/dialogs/screen-unavailable.js +52 -0
- package/server/src/herdr/dialogs/send/form-submit.js +72 -0
- package/server/src/herdr/dialogs/send/key-row.js +29 -0
- package/server/src/herdr/dialogs/send/keys.js +75 -0
- package/server/src/herdr/dialogs/send/prompt-submit.js +35 -0
- package/server/src/herdr/dialogs/send/take-back-keys.js +33 -0
- package/server/src/herdr/dialogs/send/trust-step.js +52 -0
- package/server/src/herdr/dialogs/shadow/alive-log.js +100 -0
- package/server/src/herdr/dialogs/shadow/alive.js +211 -0
- package/server/src/herdr/dialogs/shadow/atomic.js +55 -0
- package/server/src/herdr/dialogs/shadow/channel.js +321 -0
- package/server/src/herdr/dialogs/shadow/evidence.js +322 -0
- package/server/src/herdr/dialogs/shadow/files.js +375 -0
- package/server/src/herdr/dialogs/shadow/liveness.js +145 -0
- package/server/src/herdr/dialogs/shadow/sweep.js +220 -0
- package/server/src/herdr/dialogs/timing.js +88 -0
- package/server/src/herdr/history-steps.js +190 -0
- package/server/src/herdr/hook-commands.js +355 -0
- package/server/src/herdr/hook-config.js +1468 -0
- package/server/src/herdr/identity.js +277 -0
- package/server/src/herdr/index.js +27 -0
- package/server/src/herdr/input-segments.js +135 -0
- package/server/src/herdr/jsonl-activity.js +122 -0
- package/server/src/herdr/jsonl-follow.js +2358 -0
- package/server/src/herdr/jsonl-pending.js +551 -0
- package/server/src/herdr/jsonl-queue.js +133 -0
- package/server/src/herdr/jsonl-usage.js +174 -0
- package/server/src/herdr/launcher.js +574 -0
- package/server/src/herdr/line-diff.js +104 -0
- package/server/src/herdr/mode-cycle.js +78 -0
- package/server/src/herdr/project-workspace.js +131 -0
- package/server/src/herdr/provenance.js +204 -0
- package/server/src/herdr/session-pulse.js +536 -0
- package/server/src/herdr/socket.js +1003 -0
- package/server/src/herdr/statusline.js +348 -0
- package/server/src/herdr/supervisor.js +1934 -0
- package/server/src/herdr/transcript-path.js +123 -0
- package/server/src/herdr/trust.js +201 -0
- package/server/src/herdr/types.js +163 -0
- package/server/src/herdr/ultracode.js +132 -0
- package/server/src/herdr/uploads-registry.js +173 -0
- package/server/src/herdr/uploads.js +642 -0
- package/server/src/herdr/workspace-resolver.js +219 -0
- package/server/src/hidden-chars.js +52 -0
- package/server/src/inbox/card.js +130 -0
- package/server/src/inbox/dialogs.js +150 -0
- package/server/src/inbox/heads.js +55 -0
- package/server/src/inbox/inbox.js +440 -0
- package/server/src/inbox/index.js +21 -0
- package/server/src/inbox/removals.js +181 -0
- package/server/src/inbox/segments.js +37 -0
- package/server/src/index.js +800 -0
- package/server/src/install/data-dir.js +103 -0
- package/server/src/install/evidence.js +66 -0
- package/server/src/install/mode.js +37 -0
- package/server/src/install/repair.js +223 -0
- package/server/src/install/sdk-lock.json +153 -0
- package/server/src/install/sdk-package.json +7 -0
- package/server/src/install/sdk-probe.js +18 -0
- package/server/src/install/sdk.js +624 -0
- package/server/src/install/service-target.js +106 -0
- package/server/src/iroh/adapter.js +294 -0
- package/server/src/iroh/duplex.js +169 -0
- package/server/src/iroh/endpoint.js +17 -0
- package/server/src/iroh/listener.js +422 -0
- package/server/src/iroh/log-budget.js +70 -0
- package/server/src/iroh/module-probe.js +17 -0
- package/server/src/iroh/path-log.js +96 -0
- package/server/src/iroh/socket.js +89 -0
- package/server/src/live-sessions.js +162 -0
- package/server/src/log-timestamps-install.js +8 -0
- package/server/src/log-timestamps.js +63 -0
- package/server/src/mac-stats.js +261 -0
- package/server/src/notes/store.js +248 -0
- package/server/src/notify/apns-channel.js +70 -0
- package/server/src/notify/apns-devices.js +477 -0
- package/server/src/notify/apns-payload.js +267 -0
- package/server/src/notify/apns-sink.js +207 -0
- package/server/src/notify/apns.js +307 -0
- package/server/src/notify/consent-canary-push.js +163 -0
- package/server/src/notify/content.js +328 -0
- package/server/src/notify/fanout.js +44 -0
- package/server/src/notify/index.js +505 -0
- package/server/src/notify/live-activity-limits.js +126 -0
- package/server/src/notify/live-activity-state.js +176 -0
- package/server/src/notify/live-activity.js +581 -0
- package/server/src/notify/policy.js +273 -0
- package/server/src/notify/presence.js +176 -0
- package/server/src/notify/push-crypto.js +95 -0
- package/server/src/notify/relay-pass.js +487 -0
- package/server/src/notify/relay-sender.js +206 -0
- package/server/src/notify/sender.js +117 -0
- package/server/src/notify/weekly-limit.js +204 -0
- package/server/src/notify/workflow-phase.js +11 -0
- package/server/src/permissions.js +239 -0
- package/server/src/pr-status/gh.js +270 -0
- package/server/src/pr-status/index.js +12 -0
- package/server/src/pr-status/source.js +22 -0
- package/server/src/pr-status/tracker.js +204 -0
- package/server/src/risk.js +100 -0
- package/server/src/router.js +603 -0
- package/server/src/routes/context.js +8 -0
- package/server/src/routes/devices.js +246 -0
- package/server/src/routes/inbox.js +91 -0
- package/server/src/routes/limits.js +41 -0
- package/server/src/routes/notes.js +105 -0
- package/server/src/routes/projects.js +189 -0
- package/server/src/routes/push.js +252 -0
- package/server/src/routes/sessions.js +878 -0
- package/server/src/routes/system.js +275 -0
- package/server/src/routes/terminal.js +140 -0
- package/server/src/safe-read.js +203 -0
- package/server/src/session-label.js +48 -0
- package/server/src/session-list.js +166 -0
- package/server/src/sessions/activity-clocks.js +47 -0
- package/server/src/sessions/attach-slots.js +64 -0
- package/server/src/sessions/claim-window.js +132 -0
- package/server/src/sessions/cli-registry.js +233 -0
- package/server/src/sessions/companion-scope.js +103 -0
- package/server/src/sessions/consent-cards.js +509 -0
- package/server/src/sessions/context-usage.js +23 -0
- package/server/src/sessions/conversation-lists.js +68 -0
- package/server/src/sessions/demo-modules.js +16 -0
- package/server/src/sessions/dialog-timing.js +57 -0
- package/server/src/sessions/diff-measure.js +30 -0
- package/server/src/sessions/driver-events.js +282 -0
- package/server/src/sessions/errors.js +64 -0
- package/server/src/sessions/fallback-label.js +38 -0
- package/server/src/sessions/held-echo.js +258 -0
- package/server/src/sessions/herdr-lifecycle.js +453 -0
- package/server/src/sessions/interrupt-windows.js +141 -0
- package/server/src/sessions/launch-gate.js +299 -0
- package/server/src/sessions/manager-api.js +1 -0
- package/server/src/sessions/manager.js +3957 -0
- package/server/src/sessions/pr-status-link.js +50 -0
- package/server/src/sessions/project-scan.js +48 -0
- package/server/src/sessions/question-card.js +137 -0
- package/server/src/sessions/recent-projects.js +55 -0
- package/server/src/sessions/ring-buffer.js +211 -0
- package/server/src/sessions/seen-marks.js +434 -0
- package/server/src/sessions/send-registry.js +275 -0
- package/server/src/sessions/session-git.js +304 -0
- package/server/src/sessions/session-restart.js +420 -0
- package/server/src/sessions/session-scope.js +30 -0
- package/server/src/sessions/session-take-back.js +118 -0
- package/server/src/sessions/session.js +743 -0
- package/server/src/sessions/state-machine.js +145 -0
- package/server/src/sessions/state-sentences.js +642 -0
- package/server/src/sessions/waiting-line.js +72 -0
- package/server/src/shutdown.js +20 -0
- package/server/src/sse.js +611 -0
- package/server/src/tailnet.js +169 -0
- package/server/src/term/backend.js +59 -0
- package/server/src/term/herdr-backend.js +1649 -0
- package/server/src/term/herdr-stream.js +109 -0
- package/server/src/term/index.js +338 -0
- package/server/src/term/lifecycle.js +182 -0
- package/server/src/term/paste.js +139 -0
- package/server/src/term/registry.js +1032 -0
- package/server/src/term/ws.js +306 -0
- package/server/src/text.js +102 -0
- package/server/src/transcript-import.js +579 -0
- package/server/src/usage.js +255 -0
- package/server/src/version-watch.js +243 -0
- package/server/src/version.js +102 -0
- package/server/src/voice/soniox.js +301 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent channel of the `rarog-pending.mjs` hook (layer 1): registering the secret, claiming the answer file, the
|
|
3
|
+
* signature and the decision for the CLI.
|
|
4
|
+
*
|
|
5
|
+
* On a main-thread `PermissionRequest` in mode `main` (or any request in `all`) the hook draws a secret, registers
|
|
6
|
+
* it on the socket `<dataDir>/run/consent.sock` ({@link registerConsent}) and waits for the file
|
|
7
|
+
* `<dataDir>/consent/<session>/<key>.json` ({@link waitForConsent}). The server writes this file after the decision
|
|
8
|
+
* from the device and signs it with HMAC-SHA256 using this secret. The hook first CLAIMS the file (`rename` to
|
|
9
|
+
* `<key>.claimed`), and only then reads the claimed content and verifies it ({@link verifyConsentFile}): swapping the
|
|
10
|
+
* file between the server's write and the claim cannot get through, because nobody reads it before `rename`. An
|
|
11
|
+
* invalid file goes by `rename` to `<key>.<n>.rejected`, and the wait goes on. A valid file gives `allow`, a bare
|
|
12
|
+
* `deny` with a text from the {@link CONSENT_REASONS} list, or silence (`release`): {@link consentOutput}.
|
|
13
|
+
*
|
|
14
|
+
* "Always" (`allow-always`): `allow` with `updatedPermissions` equal to the `permission_suggestions` of the
|
|
15
|
+
* hook's OWN stdin, never a list from the file. The file carries only the digest of that list
|
|
16
|
+
* (`permissionsSha256`, signed); the hook accepts it only when the digest is the digest of its own list and the list
|
|
17
|
+
* is on the closed list ({@link alwaysAllowed}), else the file is invalid (`permissions`).
|
|
18
|
+
*
|
|
19
|
+
* A valid `allow` goes to the CLI only after the server confirms the receipt ({@link confirmConsent}, `POST`
|
|
20
|
+
* {@link CLAIM_ROUTE} with {@link receiptMac}): the server confirms only the record's live `allow` with the file's
|
|
21
|
+
* `at`, so a copy of an old `allow` (a restored `.revoked`, a file put back after a revoke) gives nothing. `deny`
|
|
22
|
+
* and `release` need no receipt.
|
|
23
|
+
*
|
|
24
|
+
* Everything that goes into the signature is fixed explicitly and computed the same way as in the server
|
|
25
|
+
* (`server/src/herdr/dialogs/layer1/sign.ts`): the message is {@link MAC_PREFIX} and the {@link MAC_FIELDS} fields
|
|
26
|
+
* joined with `|`, the HMAC key is the secret's bytes, `mac` is compared in constant time, and the file has exactly
|
|
27
|
+
* the contract's fields (a `message` field or any other unknown one makes it invalid). The contract values stand here
|
|
28
|
+
* as literals, because the hook does not import TypeScript; `server/test/hook-contract.test.ts` checks they equal
|
|
29
|
+
* `server/src/herdr/dialogs/layer1/contract.ts`, and the server's signature vectors
|
|
30
|
+
* (`server/test/fixtures/hook-kanon/podpis.json`) go through this module in `server/test/hook-channel.test.ts`.
|
|
31
|
+
*
|
|
32
|
+
* Restart break ({@link restartBreak}, {@link waitThroughRestart}): a hook that starts while the server restarts (the
|
|
33
|
+
* old server's `stop` or the new one's `phase: "starting"` in `alive.json`) waits for the next server's channel
|
|
34
|
+
* until `stop.ts + graceMs` instead of taking the shadow path. During the break it registers nothing, takes no file
|
|
35
|
+
* and decides nothing; the hook goes on by `alive.json` when the channel opens, when a server settles without it for
|
|
36
|
+
* this request, or, at the end of the break, exits without a decision.
|
|
37
|
+
*
|
|
38
|
+
* A registered hook that sees such a break while it waits ({@link waitResuming}) pauses the same way: it takes no
|
|
39
|
+
* file, and once the next server opens the channel it registers again with the same body and secret. Only an answer
|
|
40
|
+
* `resumed` from a new server lets it wait on, under the new `bootId`; any other answer, the end of the break or 2G of
|
|
41
|
+
* pauses together end it without a decision.
|
|
42
|
+
*
|
|
43
|
+
* The secret lives only in the hook process's memory and in the registration body: never in argv, env, the dump, a
|
|
44
|
+
* log, a file or on stdout/stderr.
|
|
45
|
+
*
|
|
46
|
+
* Every error path ends WITHOUT a decision (the dialog stays at the desk): no socket, refusal, deadline, invalid
|
|
47
|
+
* file, exception. The module lies in the hook copy (`HOOK_INSTALL_FILES`); the hook loads it dynamically in `try`, so
|
|
48
|
+
* a missing or broken module means "no channel". Imports: only `node:` and `./canon.mjs`.
|
|
49
|
+
*/
|
|
50
|
+
import { constants, closeSync, fstatSync, openSync, readSync, renameSync } from 'node:fs';
|
|
51
|
+
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
52
|
+
import { request } from 'node:http';
|
|
53
|
+
import { join } from 'node:path';
|
|
54
|
+
import { canonicalSha256 } from './canon.mjs';
|
|
55
|
+
|
|
56
|
+
/** `dataDir` subdirectory with the answer files: `CONSENT_DIRNAME` in the layer 1 contract. */
|
|
57
|
+
export const CONSENT_DIR = 'consent';
|
|
58
|
+
|
|
59
|
+
/** Suffix of a file claimed by the hook: `CONSENT_CLAIMED_SUFFIX`. */
|
|
60
|
+
export const CLAIMED_SUFFIX = '.claimed';
|
|
61
|
+
|
|
62
|
+
/** Suffix of a claimed invalid file, `<key>.<n>.rejected`: `CONSENT_REJECTED_SUFFIX`. */
|
|
63
|
+
export const REJECTED_SUFFIX = '.rejected';
|
|
64
|
+
|
|
65
|
+
/** Socket directory under `dataDir`: `ADMIN_RUN_DIRNAME` in `server/src/auth/admin.ts`. */
|
|
66
|
+
export const RUN_DIR = 'run';
|
|
67
|
+
|
|
68
|
+
/** Registration socket: `CONSENT_SOCKET_FILENAME`. */
|
|
69
|
+
export const SOCKET_FILE = 'consent.sock';
|
|
70
|
+
|
|
71
|
+
/** Registration route on the socket: `CONSENT_REGISTER_ROUTE`. */
|
|
72
|
+
export const REGISTER_ROUTE = '/register';
|
|
73
|
+
|
|
74
|
+
/** Receipt route of the registration socket — `CONSENT_CLAIM_ROUTE`. */
|
|
75
|
+
export const CLAIM_ROUTE = '/claim';
|
|
76
|
+
|
|
77
|
+
/** Deadline of the `/claim` answer in ms — `CONSENT_CLAIM_DEADLINE_MS`. After it the hook gives no `allow`. */
|
|
78
|
+
export const CLAIM_DEADLINE_MS = 500;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Response deadline of the registration socket in ms: `CONSENT_REGISTER_DEADLINE_MS`. After it the hook does not wait.
|
|
82
|
+
*/
|
|
83
|
+
export const REGISTER_DEADLINE_MS = 500;
|
|
84
|
+
|
|
85
|
+
/** Cap on the registration socket's response (the response has a few dozen bytes). */
|
|
86
|
+
const REGISTER_RESPONSE_MAX_BYTES = 4096;
|
|
87
|
+
|
|
88
|
+
/** Secret length in bytes: `CONSENT_SECRET_BYTES`; hex in the registration body. */
|
|
89
|
+
export const SECRET_BYTES = 32;
|
|
90
|
+
|
|
91
|
+
/** Domain prefix of the signature: `CONSENT_MAC_PREFIX`. */
|
|
92
|
+
export const MAC_PREFIX = 'rarog-consent-v1|';
|
|
93
|
+
|
|
94
|
+
/** File fields in the signature message, in this order: `CONSENT_MAC_FIELDS`. */
|
|
95
|
+
export const MAC_FIELDS = ['sessionId', 'key', 'decision', 'reasonId', 'inputSha256', 'cardSha256', 'at'];
|
|
96
|
+
|
|
97
|
+
/** Fields of an `allow-always` file in the signature, in this order — `CONSENT_ALWAYS_MAC_FIELDS`. */
|
|
98
|
+
export const ALWAYS_MAC_FIELDS = [...MAC_FIELDS, 'permissionsSha256'];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Version of the "always" file this hook knows — `CONSENT_ALWAYS_VERSION` in `layer1/always.ts`. The registration
|
|
102
|
+
* carries it (`alwaysVersion`) together with `permissionSuggestions`.
|
|
103
|
+
*/
|
|
104
|
+
export const ALWAYS_VERSION = 1;
|
|
105
|
+
|
|
106
|
+
/** Domain prefix of the receipt signature — `CONSENT_RECEIPT_MAC_PREFIX`; differs from {@link MAC_PREFIX}. */
|
|
107
|
+
export const RECEIPT_MAC_PREFIX = 'rarog-consent-receipt-v1|';
|
|
108
|
+
|
|
109
|
+
/** Fields of the receipt signature, in this order — `CONSENT_RECEIPT_MAC_FIELDS`. */
|
|
110
|
+
export const RECEIPT_MAC_FIELDS = ['sessionId', 'key', 'at'];
|
|
111
|
+
|
|
112
|
+
/** `notBefore` margin before the registration moment: `CONSENT_NOT_BEFORE_MARGIN_MS` in `layer1/sign.ts`. */
|
|
113
|
+
export const NOT_BEFORE_MARGIN_MS = 60000;
|
|
114
|
+
|
|
115
|
+
/** Read cap of a claimed file (a signed file has a few hundred bytes); larger = invalid file. */
|
|
116
|
+
const CLAIMED_MAX_BYTES = 64 * 1024;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The `message` text of a bare `deny` from the phone, for the model: `CONSENT_DENY_MESSAGE`. The answer file carries
|
|
120
|
+
* only the `reasonId`, never text, so the model gets only text from this list.
|
|
121
|
+
*/
|
|
122
|
+
export const DENY_MESSAGE = 'The user denied this from the phone. Stop and wait for the user\'s message.';
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Closed list of `reasonId`: the decision the reason belongs to, and the `message` text: `CONSENT_REASONS`.
|
|
126
|
+
*/
|
|
127
|
+
export const CONSENT_REASONS = Object.freeze({
|
|
128
|
+
'allow': Object.freeze({ decision: 'allow', message: null }),
|
|
129
|
+
'allow-always': Object.freeze({ decision: 'allow', message: null }),
|
|
130
|
+
'phone-deny': Object.freeze({ decision: 'deny', message: DENY_MESSAGE }),
|
|
131
|
+
'phone-deny-siblings': Object.freeze({ decision: 'deny', message: DENY_MESSAGE }),
|
|
132
|
+
'release': Object.freeze({ decision: 'release', message: null }),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Reasons {@link verifyConsentFile} rejects a file, in checking order: `CONSENT_VERIFY_FAILURES`
|
|
137
|
+
* in `layer1/sign.ts`. `input` and `card` are a card mismatch, the rest a signature mismatch.
|
|
138
|
+
*/
|
|
139
|
+
export const VERIFY_FAILURES = ['shape', 'message', 'mac', 'binding', 'input', 'card', 'permissions', 'stale'];
|
|
140
|
+
|
|
141
|
+
/** The tool to which `allow` gives the stdin input in `updatedInput` (the CLI requires it for a plan). */
|
|
142
|
+
export const PLAN_TOOL = 'ExitPlanMode';
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Ceiling of `permission_suggestions` the hook carries, as compact JSON in UTF-8 bytes — `HOOK_SUGGESTIONS_MAX_BYTES`
|
|
146
|
+
* in `hook/suggestions.ts`. It keeps the registration body under the socket's ceiling.
|
|
147
|
+
*/
|
|
148
|
+
export const SUGGESTIONS_MAX_BYTES = 16 * 1024;
|
|
149
|
+
|
|
150
|
+
const MAC_SEPARATOR = '|';
|
|
151
|
+
const SECRET_HEX = /^[0-9a-f]{64}$/;
|
|
152
|
+
const DIGEST_HEX = /^[0-9a-f]{64}$/;
|
|
153
|
+
const FILE_FIELDS = [...MAC_FIELDS, 'mac'];
|
|
154
|
+
const ALWAYS_FILE_FIELDS = [...ALWAYS_MAC_FIELDS, 'mac'];
|
|
155
|
+
const ALWAYS_REASON = 'allow-always';
|
|
156
|
+
|
|
157
|
+
/** Closed list of "always" (`layer1/always.ts`): rule destinations and the identifier pattern of a tool name. */
|
|
158
|
+
const ALWAYS_RULE_DESTINATIONS = ['session', 'localSettings'];
|
|
159
|
+
const ALWAYS_TOOL_NAME = /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/;
|
|
160
|
+
const ALWAYS_ITEMS_MAX = 16;
|
|
161
|
+
|
|
162
|
+
const plainObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
163
|
+
const exactKeys = (value, keys) => Object.keys(value).length === keys.length
|
|
164
|
+
&& keys.every((name) => Object.hasOwn(value, name));
|
|
165
|
+
const nonEmptyText = (value) => typeof value === 'string' && value !== '';
|
|
166
|
+
const itemsOf = (value, valid) => Array.isArray(value) && value.length >= 1 && value.length <= ALWAYS_ITEMS_MAX
|
|
167
|
+
&& value.every(valid);
|
|
168
|
+
|
|
169
|
+
/** One rule of an `addRules` entry: `toolName` and an optional non-empty `ruleContent`, nothing else. */
|
|
170
|
+
function alwaysRule(rule) {
|
|
171
|
+
if (!plainObject(rule) || typeof rule.toolName !== 'string' || !ALWAYS_TOOL_NAME.test(rule.toolName)) return false;
|
|
172
|
+
return Object.hasOwn(rule, 'ruleContent')
|
|
173
|
+
? exactKeys(rule, ['toolName', 'ruleContent']) && nonEmptyText(rule.ruleContent)
|
|
174
|
+
: exactKeys(rule, ['toolName']);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* One entry of the closed list: `addRules` allow in `session` or `localSettings`, `setMode acceptEdits` in `session`,
|
|
179
|
+
* `addDirectories` in `session`.
|
|
180
|
+
*/
|
|
181
|
+
function alwaysEntry(entry) {
|
|
182
|
+
if (!plainObject(entry)) return false;
|
|
183
|
+
switch (entry.type) {
|
|
184
|
+
case 'addRules':
|
|
185
|
+
return exactKeys(entry, ['type', 'rules', 'behavior', 'destination']) && entry.behavior === 'allow'
|
|
186
|
+
&& ALWAYS_RULE_DESTINATIONS.includes(entry.destination) && itemsOf(entry.rules, alwaysRule);
|
|
187
|
+
case 'setMode':
|
|
188
|
+
return exactKeys(entry, ['type', 'mode', 'destination']) && entry.mode === 'acceptEdits'
|
|
189
|
+
&& entry.destination === 'session';
|
|
190
|
+
case 'addDirectories':
|
|
191
|
+
return exactKeys(entry, ['type', 'directories', 'destination']) && entry.destination === 'session'
|
|
192
|
+
&& itemsOf(entry.directories, nonEmptyText);
|
|
193
|
+
default:
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Whether `permission_suggestions` from stdin may go out as `updatedPermissions`: a non-empty list of at most 16
|
|
200
|
+
* entries, every entry exactly in a shape of the closed list. Anything else = no "always".
|
|
201
|
+
*/
|
|
202
|
+
export function alwaysAllowed(suggestions) {
|
|
203
|
+
return itemsOf(suggestions, alwaysEntry);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Digest of the hook's own updates for {@link verifyConsentFile}: canonical sha256; `null` outside the closed list. */
|
|
207
|
+
export function alwaysDigest(suggestions) {
|
|
208
|
+
return alwaysAllowed(suggestions) ? canonicalSha256(suggestions) : null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* `permission_suggestions` from stdin as the registration and the per-call dump carry it: the value as it is up to
|
|
213
|
+
* {@link SUGGESTIONS_MAX_BYTES}, `undefined` without the field, over the ceiling or when it does not serialize (the
|
|
214
|
+
* request goes on as without suggestions). Data only: nothing in the hook decides on it, and the server checks it by
|
|
215
|
+
* its own schema.
|
|
216
|
+
*/
|
|
217
|
+
export function carriedSuggestions(value) {
|
|
218
|
+
if (value === undefined) return undefined;
|
|
219
|
+
let serialized;
|
|
220
|
+
try {
|
|
221
|
+
serialized = JSON.stringify(value);
|
|
222
|
+
} catch {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
if (serialized === undefined || Buffer.byteLength(serialized, 'utf8') > SUGGESTIONS_MAX_BYTES) return undefined;
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** New secret: {@link SECRET_BYTES} random bytes as lowercase hex. */
|
|
230
|
+
export function newSecret() {
|
|
231
|
+
return randomBytes(SECRET_BYTES).toString('hex');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* `cardSha256`: sha256 of the canonical form of the card fields (`canon.mjs`). A missing `agentId` or `permissionMode`
|
|
236
|
+
* counts as `null`, extra fields do not go in: like the server's `consentCardSha256`.
|
|
237
|
+
*/
|
|
238
|
+
export function cardSha256(card) {
|
|
239
|
+
return canonicalSha256({
|
|
240
|
+
sessionId: card.sessionId, toolName: card.toolName, toolInput: card.toolInput, cwd: card.cwd,
|
|
241
|
+
agentId: card.agentId ?? null, permissionMode: card.permissionMode ?? null,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const isReasonId = (value) => typeof value === 'string' && Object.hasOwn(CONSENT_REASONS, value);
|
|
246
|
+
const isPlainText = (value) => typeof value === 'string' && value !== '' && !value.includes(MAC_SEPARATOR);
|
|
247
|
+
|
|
248
|
+
/** Whether the fields fit the signature contract; `decision` must be the one from `reasonId`. */
|
|
249
|
+
function signedFieldsValid(fields) {
|
|
250
|
+
const { sessionId, key, decision, reasonId, inputSha256, cardSha256: card, at, permissionsSha256 } = fields;
|
|
251
|
+
if (reasonId === ALWAYS_REASON ? typeof permissionsSha256 !== 'string' || !DIGEST_HEX.test(permissionsSha256)
|
|
252
|
+
: permissionsSha256 !== undefined) return false;
|
|
253
|
+
return isPlainText(sessionId) && isPlainText(key)
|
|
254
|
+
&& isReasonId(reasonId) && CONSENT_REASONS[reasonId].decision === decision
|
|
255
|
+
&& typeof inputSha256 === 'string' && DIGEST_HEX.test(inputSha256)
|
|
256
|
+
&& typeof card === 'string' && DIGEST_HEX.test(card)
|
|
257
|
+
&& typeof at === 'number' && Number.isSafeInteger(at) && at >= 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Signature message. Fields outside the contract throw `TypeError`. */
|
|
261
|
+
export function macMessage(fields) {
|
|
262
|
+
if (!signedFieldsValid(fields)) throw new TypeError('answer file fields outside the signature contract');
|
|
263
|
+
const names = fields.reasonId === ALWAYS_REASON ? ALWAYS_MAC_FIELDS : MAC_FIELDS;
|
|
264
|
+
return MAC_PREFIX + names.map((name) => String(fields[name])).join(MAC_SEPARATOR);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function macOf(secret, fields) {
|
|
268
|
+
if (typeof secret !== 'string' || !SECRET_HEX.test(secret)) {
|
|
269
|
+
throw new TypeError('the consent secret is 32 bytes as lowercase hex');
|
|
270
|
+
}
|
|
271
|
+
return createHmac('sha256', Buffer.from(secret, 'hex')).update(macMessage(fields), 'utf8').digest();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** Signature of the fields (hex). Only the test uses it: the hook computes the signature only to verify. */
|
|
275
|
+
export function signFields(secret, fields) {
|
|
276
|
+
return macOf(secret, fields).toString('hex');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Receipt signature (hex) for `POST /claim`: HMAC-SHA256 with the secret over {@link RECEIPT_MAC_PREFIX} and
|
|
281
|
+
* {@link RECEIPT_MAC_FIELDS} joined with `|`, as `consentReceiptMac` in `layer1/sign.ts`. Fields outside the
|
|
282
|
+
* contract throw `TypeError`.
|
|
283
|
+
*/
|
|
284
|
+
export function receiptMac(secret, fields) {
|
|
285
|
+
if (typeof secret !== 'string' || !SECRET_HEX.test(secret)) {
|
|
286
|
+
throw new TypeError('the consent secret is 32 bytes as lowercase hex');
|
|
287
|
+
}
|
|
288
|
+
const { sessionId, key, at } = fields;
|
|
289
|
+
if (!isPlainText(sessionId) || !isPlainText(key) || typeof at !== 'number' || !Number.isSafeInteger(at) || at < 0) {
|
|
290
|
+
throw new TypeError('receipt fields outside the signature contract');
|
|
291
|
+
}
|
|
292
|
+
const message = RECEIPT_MAC_PREFIX + RECEIPT_MAC_FIELDS.map((name) => String(fields[name])).join(MAC_SEPARATOR);
|
|
293
|
+
return createHmac('sha256', Buffer.from(secret, 'hex')).update(message, 'utf8').digest('hex');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Verification of a claimed file after `JSON.parse`, in {@link VERIFY_FAILURES} order: `{ok: true, file}` (a copy
|
|
298
|
+
* of the contract fields only) or `{ok: false, reason}`. `expected` is what the hook knows by itself: secret, session,
|
|
299
|
+
* key, digests from stdin, `notBefore` and `permissionsSha256` ({@link alwaysDigest} of its stdin; `null` = no
|
|
300
|
+
* `allow-always` valid).
|
|
301
|
+
*/
|
|
302
|
+
export function verifyConsentFile(raw, expected) {
|
|
303
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return { ok: false, reason: 'shape' };
|
|
304
|
+
if (Object.hasOwn(raw, 'message')) return { ok: false, reason: 'message' };
|
|
305
|
+
const names = Object.keys(raw);
|
|
306
|
+
const shape = raw['reasonId'] === ALWAYS_REASON ? ALWAYS_FILE_FIELDS : FILE_FIELDS;
|
|
307
|
+
if (names.length !== shape.length || !shape.every((name) => Object.hasOwn(raw, name))) {
|
|
308
|
+
return { ok: false, reason: 'shape' };
|
|
309
|
+
}
|
|
310
|
+
const mac = raw['mac'];
|
|
311
|
+
if (!signedFieldsValid(raw) || typeof mac !== 'string' || !DIGEST_HEX.test(mac)) {
|
|
312
|
+
return { ok: false, reason: 'shape' };
|
|
313
|
+
}
|
|
314
|
+
if (!timingSafeEqual(macOf(expected.secret, raw), Buffer.from(mac, 'hex'))) return { ok: false, reason: 'mac' };
|
|
315
|
+
if (raw['sessionId'] !== expected.sessionId || raw['key'] !== expected.key) return { ok: false, reason: 'binding' };
|
|
316
|
+
if (raw['inputSha256'] !== expected.inputSha256) return { ok: false, reason: 'input' };
|
|
317
|
+
if (raw['cardSha256'] !== expected.cardSha256) return { ok: false, reason: 'card' };
|
|
318
|
+
if (raw['reasonId'] === ALWAYS_REASON && raw['permissionsSha256'] !== (expected.permissionsSha256 ?? null)) {
|
|
319
|
+
return { ok: false, reason: 'permissions' };
|
|
320
|
+
}
|
|
321
|
+
if (raw['at'] < expected.notBefore) return { ok: false, reason: 'stale' };
|
|
322
|
+
const file = {};
|
|
323
|
+
for (const name of shape) file[name] = raw[name];
|
|
324
|
+
return { ok: true, file };
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** Path of the registration socket under the data directory. */
|
|
328
|
+
export function socketPathOf(dataDir) {
|
|
329
|
+
return join(dataDir, RUN_DIR, SOCKET_FILE);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** `phase` of a server process while it starts — `HOOK_ALIVE_PHASE_STARTING`. */
|
|
333
|
+
export const PHASE_STARTING = 'starting';
|
|
334
|
+
|
|
335
|
+
/** G when the hook sees only {@link PHASE_STARTING}, no `stop` of the old server — `HOOK_RESTART_GRACE_DEFAULT_MS`. */
|
|
336
|
+
export const RESTART_GRACE_DEFAULT_MS = 45000;
|
|
337
|
+
|
|
338
|
+
/** Ceiling of `stop.graceMs`; a larger value means no break — `HOOK_RESTART_GRACE_MAX_MS`. */
|
|
339
|
+
export const RESTART_GRACE_MAX_MS = 600000;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The restart break a hook sees in `alive.json` at its start: `{until, cause}` or `null` (no break). `read` is the
|
|
343
|
+
* hook's read of the file (`readAlive` in `rarog-pending.mjs`): `seen.aliveTs` is the file's `ts`, `restart` its raw
|
|
344
|
+
* `stop` and `phase`, also on a stale file. `stop: {ts, graceMs}` (a normal stop of the old server, `graceMs` a whole
|
|
345
|
+
* number from 1 to {@link RESTART_GRACE_MAX_MS}) lasts until `stop.ts + graceMs`; else `phase: "starting"` (the new
|
|
346
|
+
* server while it starts) until the file's `ts` plus {@link RESTART_GRACE_DEFAULT_MS}. Either way at
|
|
347
|
+
* most G from `now` (a server clock ahead does not stretch it), and only while that moment is ahead. A `stop` outside
|
|
348
|
+
* that shape is no break.
|
|
349
|
+
*/
|
|
350
|
+
export function restartBreak(read, now) {
|
|
351
|
+
const found = breakOf(read);
|
|
352
|
+
if (found === null) return null;
|
|
353
|
+
const until = Math.min(found.anchor + found.grace, now + found.grace);
|
|
354
|
+
return until > now ? { until, cause: found.cause } : null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** The break fields of a read as {@link restartBreak} takes them: `{anchor, grace, cause}`, or `null` for no break. */
|
|
358
|
+
function breakOf(read) {
|
|
359
|
+
const { stop, phase } = read?.restart ?? {};
|
|
360
|
+
if (stop !== undefined) {
|
|
361
|
+
if (!plainObject(stop) || !Number.isSafeInteger(stop.ts) || !Number.isSafeInteger(stop.graceMs)
|
|
362
|
+
|| stop.graceMs < 1 || stop.graceMs > RESTART_GRACE_MAX_MS) return null;
|
|
363
|
+
return { anchor: stop.ts, grace: stop.graceMs, cause: 'stop' };
|
|
364
|
+
}
|
|
365
|
+
if (phase === PHASE_STARTING && typeof read.seen?.aliveTs === 'number') {
|
|
366
|
+
return { anchor: read.seen.aliveTs, grace: RESTART_GRACE_DEFAULT_MS, cause: 'starting' };
|
|
367
|
+
}
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* `alive.json` during the break, from the hook's read (as in {@link restartBreak}) and `channel(alive)`, the hook's
|
|
373
|
+
* rule whether the file's mode opens the channel for this request:
|
|
374
|
+
* - `open` — a fresh file with `send: true`, a channel mode and the session on the list;
|
|
375
|
+
* - `wait` — no file, a bad or stale file, `stop` or `phase: "starting"`, or a channel mode with `send: true` whose
|
|
376
|
+
* list does not have the session yet (the list grows after the start);
|
|
377
|
+
* - `settled` — anything else: a fresh file without the break whose server does not open the channel for this request
|
|
378
|
+
* (`off` of `rarog dialogs off`, `shadow`, `send: false`, `main` for a subagent). The hook goes on as without it.
|
|
379
|
+
*/
|
|
380
|
+
export function breakState(read, sessionId, channel) {
|
|
381
|
+
if (read.veto !== null) return 'wait';
|
|
382
|
+
const opens = read.alive.send === true && channel(read.alive);
|
|
383
|
+
if (opens && read.alive.sessions.includes(sessionId)) return 'open';
|
|
384
|
+
const { stop, phase } = read.restart ?? {};
|
|
385
|
+
return stop !== undefined || phase === PHASE_STARTING || opens ? 'wait' : 'settled';
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Waits through the restart break the hook saw at its start (`first`, {@link restartBreak}): every `pollMs` it reads
|
|
390
|
+
* `alive.json` again (`read()`) until {@link breakState} is `open` or `settled`, or the break ends. Calls
|
|
391
|
+
* `onPause({...first.seen, szczegol: cause})` once, when it starts waiting. Result `{outcome}`: `none` (no break, or
|
|
392
|
+
* the file already says `open` or `settled`), `open`, `settled` or `expired`. Never claims, registers or decides.
|
|
393
|
+
*
|
|
394
|
+
* The grace left is taken once from the wall clock (`now`, `until - now()` at the start); the wait spends it on the
|
|
395
|
+
* monotonic clock (`monotonic`), so a wall clock set back does not stretch the CLI's block past G. The wall clock still
|
|
396
|
+
* ends the break once it passes `until`: the monotonic clock stands while the machine sleeps. After every sleep the
|
|
397
|
+
* deadline comes before the read: a hook woken past it is `expired` whatever the file says.
|
|
398
|
+
*/
|
|
399
|
+
export async function waitThroughRestart(options) {
|
|
400
|
+
const { first, read, sessionId, channel, pollMs, onPause } = options;
|
|
401
|
+
const now = options.now ?? Date.now;
|
|
402
|
+
const monotonic = options.monotonic ?? (() => performance.now());
|
|
403
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => { setTimeout(resolve, ms); }));
|
|
404
|
+
const startedAt = now();
|
|
405
|
+
const startedMono = monotonic();
|
|
406
|
+
const pause = restartBreak(first, startedAt);
|
|
407
|
+
if (pause === null || breakState(first, sessionId, channel) !== 'wait') return { outcome: 'none' };
|
|
408
|
+
const grace = pause.until - startedAt;
|
|
409
|
+
const left = () => Math.min(grace - (monotonic() - startedMono), pause.until - now());
|
|
410
|
+
onPause?.({ ...first.seen, szczegol: pause.cause });
|
|
411
|
+
for (;;) {
|
|
412
|
+
if (left() <= 0) return { outcome: 'expired' };
|
|
413
|
+
await sleep(Math.min(pollMs, Math.max(0, left())));
|
|
414
|
+
if (left() <= 0) return { outcome: 'expired' };
|
|
415
|
+
const state = breakState(read(), sessionId, channel);
|
|
416
|
+
if (state !== 'wait') return { outcome: state };
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Refusals of a registration in a pause that mean "try again at the next poll": the channel is still opening. */
|
|
421
|
+
const RESUME_RETRY_DETAILS = new Set(['503', 'socket', 'deadline', 'response']);
|
|
422
|
+
|
|
423
|
+
/** The `powod` of the `--answer-wait` ceiling (`HOOK_SHADOW_REASONS` of the hook contract). */
|
|
424
|
+
const CEILING = 'sufit';
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The wait of a registered hook for its answer file ({@link waitForConsent}), through server restarts. Before every
|
|
428
|
+
* claim: the ceiling (`deadline`, wall clock ms) gives `sufit`, then `veto(bootId, read)` checks one read of
|
|
429
|
+
* `alive.json` (`read()`) against the `bootId` the hook is registered under (`null` = wait on). A veto whose own read
|
|
430
|
+
* shows a restart break ({@link restartBreak}) opens a pause instead of ending the wait; any other veto ends it as it
|
|
431
|
+
* is. In a pause the hook takes no file and every `pollMs` reads `alive.json` again ({@link breakState}):
|
|
432
|
+
* - `open` — it registers again with the same body (`register(deadlineMs)`, {@link registerConsent}), with at most
|
|
433
|
+
* the time left of the pause and before the ceiling. An answer `resumed` from a server with another `bootId` ends
|
|
434
|
+
* the pause: the wait goes on under that `bootId`. An answer under the `bootId` the hook already has (the old
|
|
435
|
+
* server's socket) and the refusals of a channel still opening (503, no socket, the deadline) are tried again at the
|
|
436
|
+
* next poll. Any other answer (409, accepted without `resumed`) ends the wait, `restart` with the HTTP status or
|
|
437
|
+
* `accepted` in `szczegol`. An answer that comes past the ceiling or the end of the pause is not taken;
|
|
438
|
+
* - `settled` — a server without the channel for this request: the wait ends with `veto(bootId, read)`;
|
|
439
|
+
* - `wait` — the pause goes on; a second restart inside it does not lengthen it.
|
|
440
|
+
* A pause lasts until the end of its break and the pauses of one wait last 2G together, G of the first break; past
|
|
441
|
+
* either the wait ends with `przerwa`. The time is spent on the monotonic clock as in {@link waitThroughRestart}.
|
|
442
|
+
* `onLine(ev, fields)` gets `pauza` at the start of every pause and `czekam` after every resumed registration, with
|
|
443
|
+
* `bootId` and `aliveTs` of the file read. Result: as {@link waitForConsent}; the `alive` fields of an exit from a
|
|
444
|
+
* pause carry the file read and, for `restart`, `szczegol`.
|
|
445
|
+
*/
|
|
446
|
+
export async function waitResuming(options) {
|
|
447
|
+
const { veto, read, onLine } = options;
|
|
448
|
+
const now = options.now ?? Date.now;
|
|
449
|
+
const monotonic = options.monotonic ?? (() => performance.now());
|
|
450
|
+
const ceiling = () => (now() >= options.deadline ? { powod: CEILING } : null);
|
|
451
|
+
let bootId = options.bootId;
|
|
452
|
+
let budget = null;
|
|
453
|
+
for (;;) {
|
|
454
|
+
let first = null;
|
|
455
|
+
const exit = await waitForConsent({
|
|
456
|
+
...options,
|
|
457
|
+
veto: () => {
|
|
458
|
+
const over = ceiling();
|
|
459
|
+
if (over !== null) return over;
|
|
460
|
+
first = read();
|
|
461
|
+
return veto(bootId, first);
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
if (exit.outcome === 'claimed' || exit.powod === CEILING) return exit;
|
|
465
|
+
const startedAt = now();
|
|
466
|
+
const pause = restartBreak(first, startedAt);
|
|
467
|
+
if (pause === null) return exit;
|
|
468
|
+
budget ??= 2 * breakOf(first).grace;
|
|
469
|
+
const startedMono = monotonic();
|
|
470
|
+
const grace = Math.min(pause.until - startedAt, budget);
|
|
471
|
+
const left = () => Math.min(grace - (monotonic() - startedMono), pause.until - now());
|
|
472
|
+
onLine?.('pauza', { ...first.seen, szczegol: pause.cause });
|
|
473
|
+
const end = await pauseForResume({ ...options, first, bootId, ceiling, left });
|
|
474
|
+
budget -= monotonic() - startedMono;
|
|
475
|
+
if (end.bootId === undefined) return { outcome: 'veto', ...end };
|
|
476
|
+
bootId = end.bootId;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* One pause of {@link waitResuming}: `{bootId}` of the server that resumed the registration, or the exit fields.
|
|
482
|
+
* `left()` is the time left of the pause; it comes before every read, so a hook woken past it reads nothing more.
|
|
483
|
+
*/
|
|
484
|
+
async function pauseForResume(options) {
|
|
485
|
+
const { first, bootId, ceiling, left, read, register, sessionId, channel, pollMs, veto, onLine } = options;
|
|
486
|
+
const now = options.now ?? Date.now;
|
|
487
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => { setTimeout(resolve, ms); }));
|
|
488
|
+
let current = first;
|
|
489
|
+
// The ceiling, then the time left of the pause: an answer that comes past either is not taken.
|
|
490
|
+
const ended = () => ceiling() ?? (left() <= 0 ? { powod: 'przerwa', alive: current.seen ?? {} } : null);
|
|
491
|
+
for (;;) {
|
|
492
|
+
const over = ended();
|
|
493
|
+
if (over !== null) return over;
|
|
494
|
+
const state = breakState(current, sessionId, channel);
|
|
495
|
+
if (state === 'settled') return veto(bootId, current) ?? { powod: 'restart', alive: current.seen ?? {} };
|
|
496
|
+
if (state === 'open') {
|
|
497
|
+
// The registration gets at most the time left of the pause and before the ceiling.
|
|
498
|
+
const reply = await register(Math.min(REGISTER_DEADLINE_MS, left(), options.deadline - now()));
|
|
499
|
+
const late = ended();
|
|
500
|
+
if (late !== null) return late;
|
|
501
|
+
if (reply.accepted === true && reply.bootId !== bootId) {
|
|
502
|
+
if (reply.resumed !== true) return { powod: 'restart', alive: { ...current.seen, szczegol: 'accepted' } };
|
|
503
|
+
onLine?.('czekam', { ...current.seen, tryb: current.alive.mode });
|
|
504
|
+
return { bootId: reply.bootId };
|
|
505
|
+
}
|
|
506
|
+
if (reply.accepted !== true && !RESUME_RETRY_DETAILS.has(reply.detail)) {
|
|
507
|
+
return { powod: 'restart', alive: { ...current.seen, szczegol: String(reply.detail).slice(0, 64) } };
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
await sleep(Math.min(pollMs, Math.max(0, left())));
|
|
511
|
+
if (left() > 0) current = read();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Registration on the socket: `POST` {@link REGISTER_ROUTE} with the registration body. Result `{accepted: true,
|
|
517
|
+
* bootId}` only on 200 with the body `{accepted: true, bootId: <non-empty string>}`, with `resumed: true` when the body
|
|
518
|
+
* says so (the server took it as the hook's second registration after a restart); any other outcome (no socket,
|
|
519
|
+
* refusal, the {@link REGISTER_DEADLINE_MS} deadline, a bad response) is `{accepted: false, detail}` without the
|
|
520
|
+
* secret. Never rejects the promise.
|
|
521
|
+
*/
|
|
522
|
+
export function registerConsent(socketPath, body, deadlineMs = REGISTER_DEADLINE_MS) {
|
|
523
|
+
return postSocket(socketPath, REGISTER_ROUTE, body, deadlineMs).then((reply) => {
|
|
524
|
+
if (reply.detail !== undefined) return { accepted: false, detail: reply.detail };
|
|
525
|
+
const { status, parsed } = reply;
|
|
526
|
+
const bootId = parsed !== null && typeof parsed === 'object' ? parsed['bootId'] : undefined;
|
|
527
|
+
if (status === 200 && parsed?.['accepted'] === true && typeof bootId === 'string' && bootId !== '') {
|
|
528
|
+
return { accepted: true, bootId, ...(parsed['resumed'] === true ? { resumed: true } : {}) };
|
|
529
|
+
}
|
|
530
|
+
return { accepted: false, detail: String(status) };
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Receipt on the socket: `POST` {@link CLAIM_ROUTE} with `{key, at, mac}` ({@link receiptMac}). `{confirmed: true}`
|
|
536
|
+
* only on 200 with the body `{confirmed: true}`; any other end (no socket, a server without the route = `404`,
|
|
537
|
+
* a refusal, the deadline {@link CLAIM_DEADLINE_MS}, a bad answer) is `{confirmed: false, detail}`. Never rejects.
|
|
538
|
+
*/
|
|
539
|
+
export function confirmConsent(socketPath, body, deadlineMs = CLAIM_DEADLINE_MS) {
|
|
540
|
+
return postSocket(socketPath, CLAIM_ROUTE, body, deadlineMs).then((reply) => {
|
|
541
|
+
if (reply.detail !== undefined) return { confirmed: false, detail: reply.detail };
|
|
542
|
+
const { status, parsed } = reply;
|
|
543
|
+
if (status === 200 && parsed !== null && typeof parsed === 'object' && parsed['confirmed'] === true) {
|
|
544
|
+
return { confirmed: true };
|
|
545
|
+
}
|
|
546
|
+
return { confirmed: false, detail: String(status) };
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* `POST` of a JSON body to `route` on the socket `socketPath`: `{status, parsed}` after the whole response (`parsed`
|
|
552
|
+
* is `null` when the body is not JSON) or `{detail}`: `socket` (no socket, connection error), `deadline` (after
|
|
553
|
+
* `deadlineMs`), `response` (a response over the ceiling or cut off). Never rejects.
|
|
554
|
+
*/
|
|
555
|
+
function postSocket(socketPath, route, body, deadlineMs) {
|
|
556
|
+
return new Promise((resolve) => {
|
|
557
|
+
let settled = false;
|
|
558
|
+
let req = null;
|
|
559
|
+
const finish = (result) => {
|
|
560
|
+
if (settled) return;
|
|
561
|
+
settled = true;
|
|
562
|
+
clearTimeout(timer);
|
|
563
|
+
try {
|
|
564
|
+
req?.destroy();
|
|
565
|
+
} catch {
|
|
566
|
+
// The connection ends together with the result anyway.
|
|
567
|
+
}
|
|
568
|
+
resolve(result);
|
|
569
|
+
};
|
|
570
|
+
const timer = setTimeout(() => { finish({ detail: 'deadline' }); }, deadlineMs);
|
|
571
|
+
let payload;
|
|
572
|
+
try {
|
|
573
|
+
payload = JSON.stringify(body);
|
|
574
|
+
req = request({
|
|
575
|
+
socketPath, path: route, method: 'POST', agent: false,
|
|
576
|
+
headers: { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload, 'utf8') },
|
|
577
|
+
}, (res) => {
|
|
578
|
+
const chunks = [];
|
|
579
|
+
let size = 0;
|
|
580
|
+
res.on('data', (chunk) => {
|
|
581
|
+
size += chunk.length;
|
|
582
|
+
if (size > REGISTER_RESPONSE_MAX_BYTES) finish({ detail: 'response' });
|
|
583
|
+
else chunks.push(chunk);
|
|
584
|
+
});
|
|
585
|
+
res.on('error', () => { finish({ detail: 'response' }); });
|
|
586
|
+
res.on('end', () => {
|
|
587
|
+
let parsed = null;
|
|
588
|
+
try {
|
|
589
|
+
parsed = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
590
|
+
} catch {
|
|
591
|
+
parsed = null;
|
|
592
|
+
}
|
|
593
|
+
finish({ status: res.statusCode ?? 0, parsed });
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
req.on('error', () => { finish({ detail: 'socket' }); });
|
|
597
|
+
req.end(payload);
|
|
598
|
+
} catch {
|
|
599
|
+
finish({ detail: 'socket' });
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Reads a claimed file: a regular file (without following a symlink, without blocking on a FIFO) up to
|
|
606
|
+
* {@link CLAIMED_MAX_BYTES}. `null` = cannot be read as an answer file.
|
|
607
|
+
*/
|
|
608
|
+
function readClaimed(path) {
|
|
609
|
+
let fd;
|
|
610
|
+
try {
|
|
611
|
+
fd = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
612
|
+
} catch {
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
try {
|
|
616
|
+
const info = fstatSync(fd);
|
|
617
|
+
if (!info.isFile() || info.size > CLAIMED_MAX_BYTES) return null;
|
|
618
|
+
const buffer = Buffer.alloc(info.size);
|
|
619
|
+
let read = 0;
|
|
620
|
+
while (read < buffer.length) {
|
|
621
|
+
const n = readSync(fd, buffer, read, buffer.length - read, read);
|
|
622
|
+
if (n === 0) break;
|
|
623
|
+
read += n;
|
|
624
|
+
}
|
|
625
|
+
return buffer.subarray(0, read).toString('utf8');
|
|
626
|
+
} catch {
|
|
627
|
+
return null;
|
|
628
|
+
} finally {
|
|
629
|
+
try {
|
|
630
|
+
closeSync(fd);
|
|
631
|
+
} catch {
|
|
632
|
+
// The end of the process closes the descriptor anyway.
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/** Disk operations of the claim; the test swaps them to check the order and the race with the server. */
|
|
638
|
+
export const NODE_IO = Object.freeze({ rename: renameSync, readClaimed });
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Claims the answer file `<base>.json` → `<base>.claimed`, then reads the CLAIMED content. `null` = there was no
|
|
642
|
+
* file (or the server managed to revoke it). `{body}` with `body` = `undefined` when the content is not JSON.
|
|
643
|
+
*/
|
|
644
|
+
export function claimConsentFile(base, io = NODE_IO) {
|
|
645
|
+
const claimed = `${base}${CLAIMED_SUFFIX}`;
|
|
646
|
+
try {
|
|
647
|
+
io.rename(`${base}.json`, claimed);
|
|
648
|
+
} catch {
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
const text = io.readClaimed(claimed);
|
|
652
|
+
if (text === null) return { body: undefined };
|
|
653
|
+
try {
|
|
654
|
+
return { body: JSON.parse(text) };
|
|
655
|
+
} catch {
|
|
656
|
+
return { body: undefined };
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/** Moves a claimed invalid file aside to `<base>.<n>.rejected`. Best effort: the server sweeps the directory anyway. */
|
|
661
|
+
function setAside(base, n, io) {
|
|
662
|
+
try {
|
|
663
|
+
io.rename(`${base}${CLAIMED_SUFFIX}`, `${base}.${String(n)}${REJECTED_SUFFIX}`);
|
|
664
|
+
} catch {
|
|
665
|
+
// The claimed file stays as `.claimed`; the next claim overwrites it.
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Waits for the answer file under `base` (`<dataDir>/consent/<session>/<key>`). Each round: first `veto()`
|
|
671
|
+
* (`null` = keep waiting, otherwise the exit object; the hook also keeps its deadline there), then the claim and the
|
|
672
|
+
* verification. An invalid file goes aside, `onRejected(reason, n)` gets the reason from {@link VERIFY_FAILURES}, and
|
|
673
|
+
* the wait goes on without sleeping (the server may already have the next file). Result: `{outcome: 'claimed', file}`
|
|
674
|
+
* (a valid file; ONLY its content is executed) or `{outcome: 'veto', ...}` with the veto object's fields.
|
|
675
|
+
*/
|
|
676
|
+
export async function waitForConsent(options) {
|
|
677
|
+
const { base, expected, pollMs, veto, onRejected } = options;
|
|
678
|
+
const io = options.io ?? NODE_IO;
|
|
679
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => { setTimeout(resolve, ms); }));
|
|
680
|
+
let rejected = 0;
|
|
681
|
+
for (;;) {
|
|
682
|
+
const stop = veto();
|
|
683
|
+
if (stop !== null) return { outcome: 'veto', ...stop };
|
|
684
|
+
const claim = claimConsentFile(base, io);
|
|
685
|
+
if (claim !== null) {
|
|
686
|
+
const verdict = verifyConsentFile(claim.body, expected);
|
|
687
|
+
if (verdict.ok) return { outcome: 'claimed', file: verdict.file };
|
|
688
|
+
rejected += 1;
|
|
689
|
+
setAside(base, rejected, io);
|
|
690
|
+
onRejected(verdict.reason, rejected);
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
await sleep(pollMs);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Hook output for a valid file: an object for stdout or `null` (silence). `allow` without `updatedInput`, except for
|
|
699
|
+
* {@link PLAN_TOOL}, for which `updatedInput` is the stdin input; a bare `deny` with a text from {@link
|
|
700
|
+
* CONSENT_REASONS}; `release` = silence. Never a turn interruption. `allowed: false` (e.g. a subagent's request outside
|
|
701
|
+
* mode `all`) turns `allow` into silence. `allow-always` = `allow` with `updatedPermissions` from `suggestions` (the
|
|
702
|
+
* stdin list) only when {@link alwaysAllowed} holds for it and the tool is not {@link PLAN_TOOL}; otherwise silence.
|
|
703
|
+
*/
|
|
704
|
+
export function consentOutput(file, { hookEventName, toolName, toolInput, allowed = true, suggestions }) {
|
|
705
|
+
const reason = isReasonId(file?.reasonId) ? CONSENT_REASONS[file.reasonId] : null;
|
|
706
|
+
if (reason === null || reason.decision !== file.decision) return null;
|
|
707
|
+
if (file.reasonId === ALWAYS_REASON) {
|
|
708
|
+
if (!allowed || toolName === PLAN_TOOL || !alwaysAllowed(suggestions)) return null;
|
|
709
|
+
return { hookSpecificOutput: { hookEventName, decision: { behavior: 'allow', updatedPermissions: suggestions } } };
|
|
710
|
+
}
|
|
711
|
+
if (reason.decision === 'allow') {
|
|
712
|
+
if (!allowed) return null;
|
|
713
|
+
return {
|
|
714
|
+
hookSpecificOutput: {
|
|
715
|
+
hookEventName,
|
|
716
|
+
decision: {
|
|
717
|
+
behavior: 'allow',
|
|
718
|
+
...(toolName === PLAN_TOOL && toolInput !== null && typeof toolInput === 'object'
|
|
719
|
+
? { updatedInput: toolInput } : {}),
|
|
720
|
+
},
|
|
721
|
+
},
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
if (reason.decision === 'deny' && typeof reason.message === 'string') {
|
|
725
|
+
return { hookSpecificOutput: { hookEventName, decision: { behavior: 'deny', message: reason.message } } };
|
|
726
|
+
}
|
|
727
|
+
return null;
|
|
728
|
+
}
|