@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,905 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pisarz `~/.claude/settings.json`: Rarog dopisuje i poprawia WŁASNE wpisy w ustawieniach Claude
|
|
3
|
+
* Code wyłącznie z CLI w terminalu, po jednym pytaniu `[y/N/d]` ({@link entriesQuestion}; `d` pokazuje różnicę) i „y”,
|
|
4
|
+
* pod blokadą Raroga, z kopią zapasową oryginału.
|
|
5
|
+
*
|
|
6
|
+
* Wołają go tylko `rarog setup` (krok ustawień Claude), `rarog hooks install` i `rarog service uninstall` w paczce
|
|
7
|
+
* (strażnik `hook-granica-guard.test.ts`); serwer, `restart` i doctor nigdy (warstwa `server/src/cli/`, strażnik
|
|
8
|
+
* `rarog-cli.test.ts`). Flagi pomijającej pytanie nie ma: bez terminala (`confirm` = `null`) pisarz
|
|
9
|
+
* niczego nie zapisuje; różnicę przed pytaniem dostaje `printDiff`.
|
|
10
|
+
*
|
|
11
|
+
* Operacje, lista zamknięta:
|
|
12
|
+
* - `permission`: hooki zgód (`PermissionRequest` bez matchera, `PreToolUse` z matcherem `AskUserQuestion`);
|
|
13
|
+
* - `context`: hook kontekstu `SessionStart`, osobno, bo można go świadomie pominąć;
|
|
14
|
+
* - `statusLine`: komenda paska statusu wskazująca skrypt z kopii;
|
|
15
|
+
* - `denyRead`: dwie ścieżki Raroga w `sandbox.filesystem.denyRead` (`denyReadPaths` z `hook-commands.ts`);
|
|
16
|
+
* - `writeBlock`: the two `Edit` deny rules of the write block in `permissions.deny` (`writeBlockRules` in
|
|
17
|
+
* `hook-commands.ts`): a session that loads the user settings writes neither the data directory nor
|
|
18
|
+
* `~/.config/rarog`;
|
|
19
|
+
* - `remove` (`rarog service uninstall`): odwrotność pozostałych operacji jednym pytaniem i jednym zapisem (niżej).
|
|
20
|
+
* Hooki: każda operacja usuwa z KAŻDEGO zdarzenia handlery Raroga o komendzie bieżącej (dla zgód także historycznej
|
|
21
|
+
* z listy `HISTORICAL_COMMANDS` w `hook-commands.ts`), zostawia na miejscu pierwszy handler równy wpisowi oczekiwanemu,
|
|
22
|
+
* a brakujące wpisy dopisuje jako nowe grupy na końcu tablic. Grupa i zdarzenie opróżnione przez to usunięcie znikają;
|
|
23
|
+
* cudze handlery, matchery, puste grupy i kolejność zostają. Komenda, którą skaner diagnostyczny uznaje za Raroga
|
|
24
|
+
* (`isRarogHookCommand`, `isContextCommand`), a której nie wolno usunąć, oraz zły typ (`hooks` nie obiekt, zdarzenie
|
|
25
|
+
* nie tablica) to konflikt: bez zapisu, komenda pokazana dosłownie.
|
|
26
|
+
* `statusLine`: brak klucza albo komendy = komenda bieżąca; komenda Raroga (bieżąca albo historyczna, z łańcuchem albo
|
|
27
|
+
* bez, `rarogStatuslineChain`) = przebudowa z tym samym łańcuchem; cudza komenda X = bez zmian, gdy w
|
|
28
|
+
* `~/.claude/statusline/` leży zrzut młodszy niż godzina (X sam pisze zrzuty), inaczej łańcuch z X. Inne pola
|
|
29
|
+
* obiektu zostają. Komenda podobna do Raroga spoza tych postaci (`isRarogStatuslineCommand`) to konflikt; `statusLine`
|
|
30
|
+
* nie obiekt, komenda nie napis i nieczytelny katalog zrzutów przy cudzej komendzie = odmowa.
|
|
31
|
+
* `denyRead`: brakujące ścieżki na koniec tablicy, brakujące obiekty powstają; zły typ któregoś poziomu = odmowa.
|
|
32
|
+
* `writeBlock`: the missing rules at the end of `permissions.deny`, compared literally; missing objects are created,
|
|
33
|
+
* a wrong type at any level is a refusal, and a path that gives no rule refuses this operation with its reason.
|
|
34
|
+
* `remove`: z każdego zdarzenia znikają handlery o komendzie bieżącej zgód albo kontekstu i o postaci historycznej
|
|
35
|
+
* hooka; `statusLine` z łańcuchem Raroga wraca do komendy X (inne pola zostają), sama komenda Raroga usuwa klucz,
|
|
36
|
+
* cudza zostaje; z `denyRead` znikają dokładnie dwa napisy Raroga (postać równoważna to wpis użytkownika: `denyRead` jej
|
|
37
|
+
* nie dopisał), and so do the two write block rules from `permissions.deny`. Grupa, zdarzenie, `hooks`, tablice `denyRead`
|
|
38
|
+
* i `deny` oraz obiekty `filesystem`, `sandbox`, `permissions` opróżnione przez to usunięcie znikają, cudze puste
|
|
39
|
+
* zostają. Komenda podobna do Raroga spoza listy postaci (także X, który po zdjęciu
|
|
40
|
+
* łańcucha dalej wygląda jak Raroga) i zły typ `hooks` albo zdarzenia to konflikt CAŁEJ operacji: jedno pytanie, jeden
|
|
41
|
+
* zapis, więc bez zapisu także `statusLine` i `denyRead`. Brak pliku = nic do zdjęcia (pliku nie zakłada); plik po
|
|
42
|
+
* zdjęciu pusty zostaje jako `{}`. Kopii nie potrzebuje.
|
|
43
|
+
*
|
|
44
|
+
* Mechanika jednego zapisu: jeden odczyt (do 4 MB, przez dowiązanie; cel musi być plikiem zwykłym), ścisły JSON
|
|
45
|
+
* (Claude Code odrzuca `//`), wcięcie wykryte z pliku (2 albo 4 spacje, tab; domyślnie 2) i końcowy `\n` jak
|
|
46
|
+
* w oryginale; różnica linii, ścieżka celu i pytanie. Po „y” blokada Raroga na ponowny odczyt i zapis (inne bajty,
|
|
47
|
+
* cel dowiązania albo i-węzeł = odmowa), kopia zapasowa `<dataDir>/claude-settings-backup/` (katalog 0700, plik 0600
|
|
48
|
+
* przez `wx`), plik tymczasowy w katalogu celu (`wx`, prawa celu, `fsync`) i `rename`. Brak pliku: nowy plik 0600
|
|
49
|
+
* przez `link`, z samymi kluczami operacji. Wpisy hooków powstają tylko przy kopii hooka zgodnej ze źródłem,
|
|
50
|
+
* `statusLine` przy zgodnej kopii skryptu (inaczej komenda wskazałaby brakujący albo stary plik); `denyRead`
|
|
51
|
+
* i `writeBlock` kopii nie potrzebują.
|
|
52
|
+
*
|
|
53
|
+
* Claude Code nie zna blokady Raroga: jego własny zapis tego pliku w oknie między ponownym odczytem a `rename`
|
|
54
|
+
* przepada (granica opisana w `docs/security-model.md`, nie zamykana).
|
|
55
|
+
*
|
|
56
|
+
* Poza zapisem moduł daje `rarog service uninstall` ostatnie sprawdzenie przed usunięciem kopii hooka, tym samym
|
|
57
|
+
* odczytem i bez zapisu ({@link copyRemovalCheck}).
|
|
58
|
+
*/
|
|
59
|
+
import { randomBytes } from 'node:crypto';
|
|
60
|
+
import { closeSync, fchmodSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, readlinkSync, realpathSync, renameSync, unlinkSync, writeSync, } from 'node:fs';
|
|
61
|
+
import path from 'node:path';
|
|
62
|
+
import { contextHookCommand, denyReadPaths, entryGroup, expectedContextEntry, expectedHookEntries, historicalCommand, hookCommand, rarogStatuslineChain, statuslineCommand, writeBlockRules, } from '../herdr/hook-commands.js';
|
|
63
|
+
import { STATUSLINE_FRESH_MS, contextHookEntries, handlerEntry, hookCopyReport, isContextCommand, isRarogHookCommand, isRarogStatuslineCommand, newestStatuslineDump, rarogHookEntries, sameHookEntry, statuslineCopyReport, statuslineDumpDir, userSettingsPath, visibleLine, } from '../herdr/hook-config.js';
|
|
64
|
+
import { lineDiff } from '../herdr/line-diff.js';
|
|
65
|
+
import { readRegularFileSync } from '../safe-read.js';
|
|
66
|
+
import { Refusal } from './io.js';
|
|
67
|
+
import { acquireLock } from './lock.js';
|
|
68
|
+
/** A conflict about a command of the user's: the command follows this sentence after one space. */
|
|
69
|
+
const LOOKALIKE = "has a command that looks like Rarog's, but is not one Rarog printed:";
|
|
70
|
+
/**
|
|
71
|
+
* A conflict reason without the command it quotes from the user's settings, for the run log (which never holds the
|
|
72
|
+
* file's content); a reason that quotes nothing stays whole.
|
|
73
|
+
*/
|
|
74
|
+
export function conflictWithoutQuote(reason) {
|
|
75
|
+
const at = reason.indexOf(LOOKALIKE);
|
|
76
|
+
return at === -1 ? reason : reason.slice(0, at + LOOKALIKE.length - 1);
|
|
77
|
+
}
|
|
78
|
+
/** Sufit odczytu pliku ustawień. */
|
|
79
|
+
export const SETTINGS_MAX_BYTES = 4 * 1024 * 1024;
|
|
80
|
+
/** Katalog kopii zapasowych w katalogu danych instalacji. */
|
|
81
|
+
export const SETTINGS_BACKUP_DIRNAME = 'claude-settings-backup';
|
|
82
|
+
/** Prawa nowego pliku ustawień i kopii zapasowej. */
|
|
83
|
+
const PRIVATE_FILE_MODE = 0o600;
|
|
84
|
+
/** Prawa katalogu kopii zapasowych. */
|
|
85
|
+
const BACKUP_DIR_MODE = 0o700;
|
|
86
|
+
/** Zdanie przed pytaniem, gdy zapis zmienia też układ pliku poza wpisami Raroga. */
|
|
87
|
+
export const REFORMAT_NOTE = 'The file will be reformatted (the diff shows every change).';
|
|
88
|
+
/** The entry names in the question and on the setup step line. */
|
|
89
|
+
export const ENTRY_NAMES = {
|
|
90
|
+
permission: 'permission hook', context: 'context hook', statusLine: 'status line', denyRead: 'sandbox read block',
|
|
91
|
+
writeBlock: 'state write block', remove: 'Rarog entries',
|
|
92
|
+
};
|
|
93
|
+
/** The names of the operations in one phrase (`permission and context hooks, status line`). */
|
|
94
|
+
function entryNames(operations) {
|
|
95
|
+
const parts = [];
|
|
96
|
+
if (operations.includes('permission') && operations.includes('context'))
|
|
97
|
+
parts.push('permission and context hooks');
|
|
98
|
+
else
|
|
99
|
+
for (const one of ['permission', 'context'])
|
|
100
|
+
if (operations.includes(one))
|
|
101
|
+
parts.push(ENTRY_NAMES[one]);
|
|
102
|
+
for (const one of ['statusLine', 'denyRead', 'writeBlock']) {
|
|
103
|
+
if (operations.includes(one))
|
|
104
|
+
parts.push(ENTRY_NAMES[one]);
|
|
105
|
+
}
|
|
106
|
+
return parts.join(', ');
|
|
107
|
+
}
|
|
108
|
+
/** `a Rarog entry`, `4 Rarog entries`. */
|
|
109
|
+
function entriesCount(count) {
|
|
110
|
+
return `${count === 1 ? 'a' : String(count)} Rarog ${count === 1 ? 'entry' : 'entries'}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The one `[y/N/d]` question of a write, the same in `rarog setup`, `rarog hooks install` and `rarog service
|
|
114
|
+
* uninstall`: who writes how many entries into which file, `also` for a change after the write (herdr's hook in
|
|
115
|
+
* setup), a clause for a value of the user that changes (the user's own `statusLine` command chained behind the Rarog
|
|
116
|
+
* script) and the reformat sentence before it. Without the clauses it fits one line at 60 columns. The
|
|
117
|
+
* entry names and the diff are not part of the question: the answer `d` shows {@link entriesDiff}. The backup is
|
|
118
|
+
* still made; the line of the write and the run log name it. The removal asks to remove the Rarog entries.
|
|
119
|
+
*/
|
|
120
|
+
export function entriesQuestion(question, also = null) {
|
|
121
|
+
let sentence;
|
|
122
|
+
if (question.changes.includes('remove')) {
|
|
123
|
+
sentence = 'Remove Rarog entries from ~/.claude/settings.json?';
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
sentence = `Add ${entriesCount(question.changes.length)}${also === null ? '' : ` and ${also}`} to`
|
|
127
|
+
+ ' ~/.claude/settings.json';
|
|
128
|
+
if (question.chains)
|
|
129
|
+
sentence += ', with your own status line command chained behind Rarog\'s';
|
|
130
|
+
sentence += '?';
|
|
131
|
+
}
|
|
132
|
+
return question.reformatted ? `${REFORMAT_NOTE} ${sentence}` : sentence;
|
|
133
|
+
}
|
|
134
|
+
/** What the answer `d` shows: the entries by name (not for the removal), then the full diff with its target line. */
|
|
135
|
+
export function entriesDiff(question) {
|
|
136
|
+
if (question.changes.includes('remove'))
|
|
137
|
+
return [...question.diff];
|
|
138
|
+
const names = `${entriesCount(question.changes.length)}: ${entryNames(question.changes)}`;
|
|
139
|
+
return [`${names.charAt(0).toUpperCase()}${names.slice(1)}`, ...question.diff];
|
|
140
|
+
}
|
|
141
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
142
|
+
function errnoCode(failure) {
|
|
143
|
+
return isRecord(failure) && typeof failure['code'] === 'string' ? failure['code'] : 'error';
|
|
144
|
+
}
|
|
145
|
+
/** Napis jako jeden argument powłoki (POSIX). */
|
|
146
|
+
function shellQuote(text) {
|
|
147
|
+
return `'${text.replaceAll("'", `'\\''`)}'`;
|
|
148
|
+
}
|
|
149
|
+
function unlinkQuiet(file) {
|
|
150
|
+
try {
|
|
151
|
+
unlinkSync(file);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// Pliku nie ma (po `rename`) albo nie da się go usunąć — sprzątanie best-effort.
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Nowy plik z `wx`, prawa `mode` niezależnie od umask, pełna treść i `fsync`; przy błędzie plik znika. */
|
|
158
|
+
function writeExclusive(file, bytes, mode) {
|
|
159
|
+
const fd = openSync(file, 'wx', mode);
|
|
160
|
+
let done = false;
|
|
161
|
+
try {
|
|
162
|
+
fchmodSync(fd, mode);
|
|
163
|
+
let at = 0;
|
|
164
|
+
while (at < bytes.length)
|
|
165
|
+
at += writeSync(fd, bytes, at, bytes.length - at);
|
|
166
|
+
fsyncSync(fd);
|
|
167
|
+
done = true;
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
closeSync(fd);
|
|
171
|
+
if (!done)
|
|
172
|
+
unlinkQuiet(file);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const DEFAULT_FS = { writeExclusive, rename: renameSync, link: linkSync };
|
|
176
|
+
/** Plik ustawień: brak, odmowa z powodem albo bajty z korzeniem obiektu i stanem do porównania przed zapisem. */
|
|
177
|
+
function readSettings(file, again) {
|
|
178
|
+
let info;
|
|
179
|
+
try {
|
|
180
|
+
info = lstatSync(file);
|
|
181
|
+
}
|
|
182
|
+
catch (failure) {
|
|
183
|
+
if (errnoCode(failure) !== 'ENOENT')
|
|
184
|
+
return { refused: `cannot check ${file} (${errnoCode(failure)})` };
|
|
185
|
+
const snapshot = {
|
|
186
|
+
real: file, link: null, exists: false, dev: 0, ino: 0, mode: PRIVATE_FILE_MODE, bytes: Buffer.alloc(0),
|
|
187
|
+
};
|
|
188
|
+
return { snapshot, text: '', root: null };
|
|
189
|
+
}
|
|
190
|
+
let real = file;
|
|
191
|
+
let link = null;
|
|
192
|
+
if (info.isSymbolicLink()) {
|
|
193
|
+
try {
|
|
194
|
+
link = readlinkSync(file);
|
|
195
|
+
real = realpathSync(file);
|
|
196
|
+
info = lstatSync(real);
|
|
197
|
+
}
|
|
198
|
+
catch (failure) {
|
|
199
|
+
return {
|
|
200
|
+
refused: `${file} is a symlink${link === null ? '' : ` to ${link}`} that leads to no file`
|
|
201
|
+
+ ` (${errnoCode(failure)}); fix the link, then run ${again} again`,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!info.isFile())
|
|
206
|
+
return { refused: `${real} is not a regular file` };
|
|
207
|
+
let read;
|
|
208
|
+
try {
|
|
209
|
+
read = readRegularFileSync(real, { maxBytes: SETTINGS_MAX_BYTES, followSymlink: false });
|
|
210
|
+
}
|
|
211
|
+
catch (failure) {
|
|
212
|
+
return { refused: `cannot read ${real} (${errnoCode(failure)})` };
|
|
213
|
+
}
|
|
214
|
+
if (read === null)
|
|
215
|
+
return { refused: `${real} is not a regular file` };
|
|
216
|
+
if (read.truncated)
|
|
217
|
+
return { refused: `${real} is larger than 4 MB` };
|
|
218
|
+
const text = read.bytes.toString('utf8');
|
|
219
|
+
if (!Buffer.from(text, 'utf8').equals(read.bytes)) {
|
|
220
|
+
return { refused: `${real} is not valid UTF-8; fix it, then run ${again} again` };
|
|
221
|
+
}
|
|
222
|
+
let parsed;
|
|
223
|
+
try {
|
|
224
|
+
parsed = JSON.parse(text);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
// Bez komunikatu parsera: cytuje fragment pliku, a w ustawieniach bywają klucze (`env`).
|
|
228
|
+
return {
|
|
229
|
+
refused: `${real} is not strict JSON (Claude Code rejects such a file too, e.g. with // comments or a trailing`
|
|
230
|
+
+ ` comma); fix it, then run ${again} again`,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (!isRecord(parsed))
|
|
234
|
+
return { refused: `${real}: the top level is not a JSON object` };
|
|
235
|
+
const snapshot = {
|
|
236
|
+
real, link, exists: true, dev: info.dev, ino: info.ino, mode: info.mode & 0o777, bytes: read.bytes,
|
|
237
|
+
};
|
|
238
|
+
return { snapshot, text, root: parsed };
|
|
239
|
+
}
|
|
240
|
+
/** Ten sam stan pliku przy pytaniu i pod blokadą: istnienie, cel dowiązania, ścieżka, i-węzeł i bajty. */
|
|
241
|
+
function sameSnapshot(a, b) {
|
|
242
|
+
return a.exists === b.exists && a.link === b.link && a.real === b.real && a.dev === b.dev && a.ino === b.ino
|
|
243
|
+
&& a.bytes.equals(b.bytes);
|
|
244
|
+
}
|
|
245
|
+
const NEW_FILE_LAYOUT = { indent: 2, newline: true };
|
|
246
|
+
function layoutOf(text) {
|
|
247
|
+
const unit = /\n([ \t]+)\S/.exec(text)?.[1];
|
|
248
|
+
return { indent: unit === '\t' ? '\t' : unit === ' ' ? 4 : 2, newline: text.endsWith('\n') };
|
|
249
|
+
}
|
|
250
|
+
function render(value, layout) {
|
|
251
|
+
return `${JSON.stringify(value, null, layout.indent)}${layout.newline ? '\n' : ''}`;
|
|
252
|
+
}
|
|
253
|
+
/** Kopia korzenia przez JSON: korzeń pochodzi z `JSON.parse`, więc nic nie ginie, a `__proto__` zostaje własnym polem. */
|
|
254
|
+
function copyRoot(root) {
|
|
255
|
+
return JSON.parse(JSON.stringify(root));
|
|
256
|
+
}
|
|
257
|
+
/** Wpisy, które operacja ma zostawić w pliku. */
|
|
258
|
+
function expectedOf(operation, home) {
|
|
259
|
+
return operation === 'permission'
|
|
260
|
+
? expectedHookEntries(hookCommand(home))
|
|
261
|
+
: [expectedContextEntry(contextHookCommand(home))];
|
|
262
|
+
}
|
|
263
|
+
/** Komenda, którą operacja wolno usunąć: bieżąca albo (zgody) z zamkniętej listy postaci historycznych. */
|
|
264
|
+
function removable(operation, command, home) {
|
|
265
|
+
if (operation === 'context')
|
|
266
|
+
return command === contextHookCommand(home);
|
|
267
|
+
return command === hookCommand(home) || historicalCommand(command, home)?.form.key === 'hooks';
|
|
268
|
+
}
|
|
269
|
+
/** Komenda, którą skaner diagnostyczny uznaje za wpis tej operacji. */
|
|
270
|
+
function lookalike(operation, command) {
|
|
271
|
+
return operation === 'context' ? isContextCommand(command) : isRarogHookCommand(command);
|
|
272
|
+
}
|
|
273
|
+
function kindOf(value) {
|
|
274
|
+
if (Array.isArray(value))
|
|
275
|
+
return 'an array';
|
|
276
|
+
if (value === null)
|
|
277
|
+
return 'null';
|
|
278
|
+
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|
|
279
|
+
}
|
|
280
|
+
/** Hooki na kopii korzenia: nowy korzeń albo konflikty (bez zapisu). */
|
|
281
|
+
function planHooks(root, operation, home) {
|
|
282
|
+
const next = copyRoot(root);
|
|
283
|
+
const expected = expectedOf(operation, home);
|
|
284
|
+
const kept = new Set();
|
|
285
|
+
const emptied = [];
|
|
286
|
+
const conflicts = [];
|
|
287
|
+
const hasHooks = Object.hasOwn(next, 'hooks');
|
|
288
|
+
const hooks = next['hooks'];
|
|
289
|
+
if (hasHooks && !isRecord(hooks))
|
|
290
|
+
return { conflicts: [`"hooks" is ${kindOf(hooks)}, not an object`] };
|
|
291
|
+
for (const [event, groups] of Object.entries(isRecord(hooks) ? hooks : {})) {
|
|
292
|
+
const where = `"hooks.${visibleLine(event)}"`;
|
|
293
|
+
if (!Array.isArray(groups)) {
|
|
294
|
+
conflicts.push(`${where} is ${kindOf(groups)}, not an array`);
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
const dropGroups = [];
|
|
298
|
+
groups.forEach((group, groupIndex) => {
|
|
299
|
+
if (!isRecord(group) || !Array.isArray(group['hooks']))
|
|
300
|
+
return;
|
|
301
|
+
const list = group['hooks'];
|
|
302
|
+
const matcher = typeof group['matcher'] === 'string' ? group['matcher'] : null;
|
|
303
|
+
const drop = [];
|
|
304
|
+
list.forEach((handler, handlerIndex) => {
|
|
305
|
+
const entry = handlerEntry(event, matcher, handler);
|
|
306
|
+
if (entry === null)
|
|
307
|
+
return;
|
|
308
|
+
if (!removable(operation, entry.command, home)) {
|
|
309
|
+
if (lookalike(operation, entry.command)) {
|
|
310
|
+
conflicts.push(`${where} ${LOOKALIKE}`
|
|
311
|
+
+ ` ${visibleLine(entry.command)}`);
|
|
312
|
+
}
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const match = expected.findIndex((one, index) => !kept.has(index) && sameHookEntry(one, entry));
|
|
316
|
+
if (match === -1)
|
|
317
|
+
drop.push(handlerIndex);
|
|
318
|
+
else
|
|
319
|
+
kept.add(match);
|
|
320
|
+
});
|
|
321
|
+
for (const index of drop.reverse())
|
|
322
|
+
list.splice(index, 1);
|
|
323
|
+
if (drop.length > 0 && list.length === 0)
|
|
324
|
+
dropGroups.push(groupIndex);
|
|
325
|
+
});
|
|
326
|
+
for (const index of dropGroups.reverse())
|
|
327
|
+
groups.splice(index, 1);
|
|
328
|
+
if (dropGroups.length > 0 && groups.length === 0)
|
|
329
|
+
emptied.push(event);
|
|
330
|
+
}
|
|
331
|
+
if (conflicts.length > 0)
|
|
332
|
+
return { conflicts };
|
|
333
|
+
const missing = expected.filter((_, index) => !kept.has(index));
|
|
334
|
+
if (missing.length > 0 && !hasHooks)
|
|
335
|
+
next['hooks'] = {};
|
|
336
|
+
const target = next['hooks'];
|
|
337
|
+
for (const entry of missing) {
|
|
338
|
+
// Zdarzenie to stała z `hook-commands.ts`; istniejąca tablica dostaje grupę na końcu (kolejność kluczy zostaje).
|
|
339
|
+
if (Object.hasOwn(target, entry.event))
|
|
340
|
+
target[entry.event]?.push(entryGroup(entry));
|
|
341
|
+
else
|
|
342
|
+
target[entry.event] = [entryGroup(entry)];
|
|
343
|
+
}
|
|
344
|
+
for (const event of emptied) {
|
|
345
|
+
if (target[event]?.length === 0)
|
|
346
|
+
delete target[event];
|
|
347
|
+
}
|
|
348
|
+
return { next };
|
|
349
|
+
}
|
|
350
|
+
/** Zdanie po odmowie z powodu kształtu pliku. */
|
|
351
|
+
const handFix = (again) => `fix it by hand, then run ${again} again`;
|
|
352
|
+
/**
|
|
353
|
+
* `statusLine` na kopii korzenia. Komenda docelowa: bieżąca bez łańcucha (brak klucza albo komendy), bieżąca z łańcuchem
|
|
354
|
+
* komendy Raroga (ten sam X, jedno owinięcie) albo z łańcuchem cudzej komendy X, chyba że X sam pisze zrzuty (zrzut
|
|
355
|
+
* młodszy niż {@link STATUSLINE_FRESH_MS}): wtedy bez zmian.
|
|
356
|
+
*/
|
|
357
|
+
function planStatusLine(root, home, now, again) {
|
|
358
|
+
const next = copyRoot(root);
|
|
359
|
+
const value = Object.hasOwn(next, 'statusLine') ? next['statusLine'] : {};
|
|
360
|
+
if (!isRecord(value))
|
|
361
|
+
return { refused: `"statusLine" is ${kindOf(value)}, not an object; ${handFix(again)}` };
|
|
362
|
+
const raw = value['command'];
|
|
363
|
+
if (Object.hasOwn(value, 'command') && typeof raw !== 'string') {
|
|
364
|
+
return { refused: `"statusLine.command" is ${kindOf(raw)}, not a string; ${handFix(again)}` };
|
|
365
|
+
}
|
|
366
|
+
const command = typeof raw === 'string' && raw.trim() !== '' ? raw : null;
|
|
367
|
+
let target = statuslineCommand(home);
|
|
368
|
+
if (command !== null) {
|
|
369
|
+
const own = rarogStatuslineChain(command, home);
|
|
370
|
+
if (own !== null) {
|
|
371
|
+
target = statuslineCommand(home, own.chain ?? undefined);
|
|
372
|
+
}
|
|
373
|
+
else if (isRarogStatuslineCommand(command)) {
|
|
374
|
+
return {
|
|
375
|
+
conflicts: [`"statusLine" ${LOOKALIKE}`
|
|
376
|
+
+ ` ${visibleLine(command)}`],
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
const dump = newestStatuslineDump(home);
|
|
381
|
+
if ('code' in dump) {
|
|
382
|
+
return {
|
|
383
|
+
refused: `cannot read ${statuslineDumpDir(home)} (${dump.code}), so it is unclear whether your statusLine`
|
|
384
|
+
+ ' command writes the snapshots; nothing written',
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
if (dump.newest !== null && now - dump.newest <= STATUSLINE_FRESH_MS)
|
|
388
|
+
return { next };
|
|
389
|
+
target = statuslineCommand(home, command);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (target === command && value['type'] === 'command')
|
|
393
|
+
return { next };
|
|
394
|
+
// Istniejące klucze zostają na swoich miejscach; nowe (`type`, `command`) idą na koniec obiektu.
|
|
395
|
+
next['statusLine'] = { ...value, type: 'command', command: target };
|
|
396
|
+
return { next };
|
|
397
|
+
}
|
|
398
|
+
/** Ścieżka do porównania wpisów `denyRead`: `~` i `~/…` rozwinięte względem domu, postać znormalizowana. */
|
|
399
|
+
function denyReadKey(entry, home) {
|
|
400
|
+
const expanded = entry === '~' ? home : entry.startsWith('~/') ? path.join(home, entry.slice(2)) : entry;
|
|
401
|
+
const normalized = path.normalize(expanded);
|
|
402
|
+
return normalized.length > 1 && normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* `denyRead` na kopii korzenia: brakujące ścieżki Raroga na koniec `sandbox.filesystem.denyRead`, brakujące obiekty powstają.
|
|
406
|
+
* Ścieżka już obecna w równoważnej postaci (`~/…` albo bezwzględnej) się liczy: wpis użytkownika zostaje, bez duplikatu.
|
|
407
|
+
*/
|
|
408
|
+
function planDenyRead(root, dataDir, again, home) {
|
|
409
|
+
if (!dataDir.ok)
|
|
410
|
+
return { refused: `no data directory for the denyRead path <dataDir>/run: ${dataDir.message}` };
|
|
411
|
+
const next = copyRoot(root);
|
|
412
|
+
let at = next;
|
|
413
|
+
let where = '';
|
|
414
|
+
for (const key of ['sandbox', 'filesystem']) {
|
|
415
|
+
where = where === '' ? key : `${where}.${key}`;
|
|
416
|
+
if (!Object.hasOwn(at, key))
|
|
417
|
+
at[key] = {};
|
|
418
|
+
const value = at[key];
|
|
419
|
+
if (!isRecord(value))
|
|
420
|
+
return { refused: `"${where}" is ${kindOf(value)}, not an object; ${handFix(again)}` };
|
|
421
|
+
at = value;
|
|
422
|
+
}
|
|
423
|
+
if (!Object.hasOwn(at, 'denyRead'))
|
|
424
|
+
at['denyRead'] = [];
|
|
425
|
+
const list = at['denyRead'];
|
|
426
|
+
if (!Array.isArray(list)) {
|
|
427
|
+
return { refused: `"sandbox.filesystem.denyRead" is ${kindOf(list)}, not an array; ${handFix(again)}` };
|
|
428
|
+
}
|
|
429
|
+
const present = new Set(list.filter((one) => typeof one === 'string')
|
|
430
|
+
.map((one) => denyReadKey(one, home)));
|
|
431
|
+
for (const one of denyReadPaths(dataDir.dir)) {
|
|
432
|
+
if (!present.has(denyReadKey(one, home)))
|
|
433
|
+
list.push(one);
|
|
434
|
+
}
|
|
435
|
+
return { next };
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* The write block on a copy of the root: the missing rules of {@link writeBlockRules} at the end of `permissions.deny`,
|
|
439
|
+
* missing objects created. A rule counts only when present literally: an equivalent rule in another spelling is the
|
|
440
|
+
* user's, and the Rarog form goes next to it (`rarog doctor` compares literally too).
|
|
441
|
+
*/
|
|
442
|
+
function planWriteBlock(root, dataDir, again, home) {
|
|
443
|
+
if (!dataDir.ok)
|
|
444
|
+
return { refused: `no data directory for the write block rules: ${dataDir.message}` };
|
|
445
|
+
const built = writeBlockRules(dataDir.dir, home);
|
|
446
|
+
if (!built.ok)
|
|
447
|
+
return { refused: `no write block rule: ${built.reason}` };
|
|
448
|
+
const next = copyRoot(root);
|
|
449
|
+
if (!Object.hasOwn(next, 'permissions'))
|
|
450
|
+
next['permissions'] = {};
|
|
451
|
+
const permissions = next['permissions'];
|
|
452
|
+
if (!isRecord(permissions)) {
|
|
453
|
+
return { refused: `"permissions" is ${kindOf(permissions)}, not an object; ${handFix(again)}` };
|
|
454
|
+
}
|
|
455
|
+
if (!Object.hasOwn(permissions, 'deny'))
|
|
456
|
+
permissions['deny'] = [];
|
|
457
|
+
const list = permissions['deny'];
|
|
458
|
+
if (!Array.isArray(list)) {
|
|
459
|
+
return { refused: `"permissions.deny" is ${kindOf(list)}, not an array; ${handFix(again)}` };
|
|
460
|
+
}
|
|
461
|
+
for (const rule of built.rules)
|
|
462
|
+
if (!list.includes(rule))
|
|
463
|
+
list.push(rule);
|
|
464
|
+
return { next };
|
|
465
|
+
}
|
|
466
|
+
/** Komenda handlera, którą `remove` zdejmuje: bieżąca zgód albo kontekstu, albo postać historyczna hooka. */
|
|
467
|
+
function removableByUninstall(command, home) {
|
|
468
|
+
return removable('permission', command, home) || removable('context', command, home);
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* `remove` na hookach (w miejscu, na kopii korzenia): handlery Raroga znikają, a z nimi opróżnione grupy, zdarzenia
|
|
472
|
+
* i `hooks`.
|
|
473
|
+
*/
|
|
474
|
+
function removeHooks(next, home, conflicts) {
|
|
475
|
+
if (!Object.hasOwn(next, 'hooks'))
|
|
476
|
+
return;
|
|
477
|
+
const hooks = next['hooks'];
|
|
478
|
+
if (!isRecord(hooks)) {
|
|
479
|
+
conflicts.push(`"hooks" is ${kindOf(hooks)}, not an object`);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
let emptiedEvent = false;
|
|
483
|
+
for (const [event, groups] of Object.entries(hooks)) {
|
|
484
|
+
const where = `"hooks.${visibleLine(event)}"`;
|
|
485
|
+
if (!Array.isArray(groups)) {
|
|
486
|
+
conflicts.push(`${where} is ${kindOf(groups)}, not an array`);
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
const dropGroups = [];
|
|
490
|
+
groups.forEach((group, groupIndex) => {
|
|
491
|
+
if (!isRecord(group) || !Array.isArray(group['hooks']))
|
|
492
|
+
return;
|
|
493
|
+
const list = group['hooks'];
|
|
494
|
+
const matcher = typeof group['matcher'] === 'string' ? group['matcher'] : null;
|
|
495
|
+
const drop = [];
|
|
496
|
+
list.forEach((handler, handlerIndex) => {
|
|
497
|
+
const entry = handlerEntry(event, matcher, handler);
|
|
498
|
+
if (entry === null)
|
|
499
|
+
return;
|
|
500
|
+
if (removableByUninstall(entry.command, home))
|
|
501
|
+
drop.push(handlerIndex);
|
|
502
|
+
else if (lookalike('permission', entry.command) || lookalike('context', entry.command)) {
|
|
503
|
+
conflicts.push(`${where} ${LOOKALIKE}`
|
|
504
|
+
+ ` ${visibleLine(entry.command)}`);
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
for (const index of drop.reverse())
|
|
508
|
+
list.splice(index, 1);
|
|
509
|
+
if (drop.length > 0 && list.length === 0)
|
|
510
|
+
dropGroups.push(groupIndex);
|
|
511
|
+
});
|
|
512
|
+
for (const index of dropGroups.reverse())
|
|
513
|
+
groups.splice(index, 1);
|
|
514
|
+
if (dropGroups.length > 0 && groups.length === 0) {
|
|
515
|
+
delete hooks[event];
|
|
516
|
+
emptiedEvent = true;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (emptiedEvent && Object.keys(hooks).length === 0)
|
|
520
|
+
delete next['hooks'];
|
|
521
|
+
}
|
|
522
|
+
/** `remove` na `statusLine`: łańcuch Raroga wraca do komendy X (inne pola zostają), sama komenda Raroga usuwa klucz. */
|
|
523
|
+
function removeStatusLine(next, home, conflicts) {
|
|
524
|
+
const value = next['statusLine'];
|
|
525
|
+
// Rarog pisze wyłącznie obiekt z komendą-napisem; inny kształt nie jest jego wpisem.
|
|
526
|
+
if (!isRecord(value) || typeof value['command'] !== 'string')
|
|
527
|
+
return;
|
|
528
|
+
const command = value['command'];
|
|
529
|
+
const own = rarogStatuslineChain(command, home);
|
|
530
|
+
const looks = `"statusLine" ${LOOKALIKE} ${visibleLine(command)}`;
|
|
531
|
+
if (own === null) {
|
|
532
|
+
if (isRarogStatuslineCommand(command))
|
|
533
|
+
conflicts.push(looks);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (own.chain === null || own.chain.trim() === '') {
|
|
537
|
+
delete next['statusLine'];
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
// X, który po zdjęciu łańcucha dalej wygląda jak Raroga, zostałby komendą wskazującą usuwaną kopię.
|
|
541
|
+
if (isRarogStatuslineCommand(own.chain)) {
|
|
542
|
+
conflicts.push(looks);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
value['command'] = own.chain;
|
|
546
|
+
}
|
|
547
|
+
/** `remove` na `denyRead`: znikają dokładnie dwa napisy Raroga; tablica i obiekty opróżnione przez to znikają. */
|
|
548
|
+
function removeDenyRead(next, dataDir) {
|
|
549
|
+
const sandbox = next['sandbox'];
|
|
550
|
+
if (!isRecord(sandbox))
|
|
551
|
+
return;
|
|
552
|
+
const filesystem = sandbox['filesystem'];
|
|
553
|
+
if (!isRecord(filesystem))
|
|
554
|
+
return;
|
|
555
|
+
const list = filesystem['denyRead'];
|
|
556
|
+
if (!Array.isArray(list))
|
|
557
|
+
return;
|
|
558
|
+
const ours = new Set(denyReadPaths(dataDir));
|
|
559
|
+
const kept = list.filter((one) => typeof one !== 'string' || !ours.has(one));
|
|
560
|
+
if (kept.length === list.length)
|
|
561
|
+
return;
|
|
562
|
+
if (kept.length > 0) {
|
|
563
|
+
filesystem['denyRead'] = kept;
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
delete filesystem['denyRead'];
|
|
567
|
+
if (Object.keys(filesystem).length > 0)
|
|
568
|
+
return;
|
|
569
|
+
delete sandbox['filesystem'];
|
|
570
|
+
if (Object.keys(sandbox).length === 0)
|
|
571
|
+
delete next['sandbox'];
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* `remove` on the write block: exactly the two Rarog rules leave `permissions.deny`; the array and `permissions` emptied by
|
|
575
|
+
* that go too. A path that gives no rule had none written, so there is nothing to remove.
|
|
576
|
+
*/
|
|
577
|
+
function removeWriteBlock(next, dataDir, home) {
|
|
578
|
+
const built = writeBlockRules(dataDir, home);
|
|
579
|
+
const permissions = next['permissions'];
|
|
580
|
+
if (!built.ok || !isRecord(permissions))
|
|
581
|
+
return;
|
|
582
|
+
const list = permissions['deny'];
|
|
583
|
+
if (!Array.isArray(list))
|
|
584
|
+
return;
|
|
585
|
+
const kept = list.filter((one) => typeof one !== 'string' || !built.rules.includes(one));
|
|
586
|
+
if (kept.length === list.length)
|
|
587
|
+
return;
|
|
588
|
+
if (kept.length > 0) {
|
|
589
|
+
permissions['deny'] = kept;
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
delete permissions['deny'];
|
|
593
|
+
if (Object.keys(permissions).length === 0)
|
|
594
|
+
delete next['permissions'];
|
|
595
|
+
}
|
|
596
|
+
/** `remove` na kopii korzenia: zdjęcie wszystkich wpisów Raroga albo konflikty (bez zapisu czegokolwiek). */
|
|
597
|
+
function planRemove(root, home, dataDir) {
|
|
598
|
+
if (!dataDir.ok) {
|
|
599
|
+
return {
|
|
600
|
+
refused: 'no data directory (backups, the denyRead path <dataDir>/run, the write block rules):'
|
|
601
|
+
+ ` ${dataDir.message}`,
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
const next = copyRoot(root);
|
|
605
|
+
const conflicts = [];
|
|
606
|
+
removeHooks(next, home, conflicts);
|
|
607
|
+
removeStatusLine(next, home, conflicts);
|
|
608
|
+
removeDenyRead(next, dataDir.dir);
|
|
609
|
+
removeWriteBlock(next, dataDir.dir, home);
|
|
610
|
+
return conflicts.length > 0 ? { conflicts } : { next };
|
|
611
|
+
}
|
|
612
|
+
/** Plan operacji na kopii korzenia. */
|
|
613
|
+
function plan(root, operation, options, now) {
|
|
614
|
+
switch (operation) {
|
|
615
|
+
case 'permission':
|
|
616
|
+
case 'context':
|
|
617
|
+
return planHooks(root, operation, options.home);
|
|
618
|
+
case 'statusLine':
|
|
619
|
+
return planStatusLine(root, options.home, now, options.again);
|
|
620
|
+
case 'denyRead':
|
|
621
|
+
return planDenyRead(root, options.dataDir, options.again, options.home);
|
|
622
|
+
case 'writeBlock':
|
|
623
|
+
return planWriteBlock(root, options.dataDir, options.again, options.home);
|
|
624
|
+
case 'remove':
|
|
625
|
+
return planRemove(root, options.home, options.dataDir);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Kopia, którą wskazuje wpis operacji: kopia hooka, kopia skryptu `statusLine`; `denyRead`, `writeBlock`
|
|
630
|
+
* i zdjęcie wpisów żadnej.
|
|
631
|
+
*/
|
|
632
|
+
function copyOf(operation, options) {
|
|
633
|
+
switch (operation) {
|
|
634
|
+
case 'permission':
|
|
635
|
+
case 'context':
|
|
636
|
+
return { report: hookCopyReport(options.home, options.root), what: 'hook copy' };
|
|
637
|
+
case 'statusLine':
|
|
638
|
+
return { report: statuslineCopyReport(options.home, options.root), what: 'statusLine script copy' };
|
|
639
|
+
case 'denyRead':
|
|
640
|
+
case 'writeBlock':
|
|
641
|
+
case 'remove':
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
/** Różnica `before` → `after` (także dla nowego pliku wobec pustej treści) i linia celu. */
|
|
646
|
+
function diffLines(file, read, after) {
|
|
647
|
+
const lines = [
|
|
648
|
+
`--- ${visibleLine(file)}${read.snapshot.exists ? '' : ' (no file yet)'}`, `+++ ${visibleLine(file)} (after the change)`,
|
|
649
|
+
...lineDiff(read.text, after).map(visibleLine),
|
|
650
|
+
];
|
|
651
|
+
if (!read.snapshot.exists)
|
|
652
|
+
lines.push(`target: ${visibleLine(file)} (new file, mode 600)`);
|
|
653
|
+
else if (read.snapshot.link !== null) {
|
|
654
|
+
lines.push(`target: ${visibleLine(read.snapshot.real)} (${visibleLine(file)} is a symlink to it and stays one)`);
|
|
655
|
+
}
|
|
656
|
+
else
|
|
657
|
+
lines.push(`target: ${visibleLine(read.snapshot.real)}`);
|
|
658
|
+
return lines;
|
|
659
|
+
}
|
|
660
|
+
/** Katalog kopii zapasowych tuż przed zapisem: prawdziwy katalog tego użytkownika z prawami 0700. */
|
|
661
|
+
function unsafeBackupDir(dir) {
|
|
662
|
+
let info;
|
|
663
|
+
try {
|
|
664
|
+
info = lstatSync(dir);
|
|
665
|
+
}
|
|
666
|
+
catch (failure) {
|
|
667
|
+
return `cannot check the backup directory ${dir} (${errnoCode(failure)})`;
|
|
668
|
+
}
|
|
669
|
+
if (info.isSymbolicLink() || !info.isDirectory())
|
|
670
|
+
return `the backup directory ${dir} is a symlink or not a directory`;
|
|
671
|
+
if (typeof process.getuid === 'function' && info.uid !== process.getuid()) {
|
|
672
|
+
return `the backup directory ${dir} is owned by another user`;
|
|
673
|
+
}
|
|
674
|
+
if ((info.mode & 0o777) !== BACKUP_DIR_MODE) {
|
|
675
|
+
return `the backup directory ${dir} has mode ${(info.mode & 0o777).toString(8)}, expected 700`;
|
|
676
|
+
}
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
/** Kopia zapasowa bajtów oryginału: `<dataDir>/claude-settings-backup/settings.<czas>.<sufiks>.json`, 0600, `wx`. */
|
|
680
|
+
function backup(options, bytes, fs) {
|
|
681
|
+
if (!options.dataDir.ok)
|
|
682
|
+
return { refused: `no directory for the backup: ${options.dataDir.message}` };
|
|
683
|
+
const dir = path.join(options.dataDir.dir, SETTINGS_BACKUP_DIRNAME);
|
|
684
|
+
try {
|
|
685
|
+
mkdirSync(options.dataDir.dir, { recursive: true, mode: BACKUP_DIR_MODE });
|
|
686
|
+
try {
|
|
687
|
+
mkdirSync(dir, { mode: BACKUP_DIR_MODE });
|
|
688
|
+
}
|
|
689
|
+
catch (failure) {
|
|
690
|
+
if (errnoCode(failure) !== 'EEXIST')
|
|
691
|
+
throw failure;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
catch (failure) {
|
|
695
|
+
return { refused: `cannot create the backup directory ${dir} (${errnoCode(failure)})` };
|
|
696
|
+
}
|
|
697
|
+
const issue = unsafeBackupDir(dir);
|
|
698
|
+
if (issue !== null)
|
|
699
|
+
return { refused: issue };
|
|
700
|
+
const at = (options.now ?? (() => new Date()))().toISOString().replaceAll(':', '-');
|
|
701
|
+
const file = path.join(dir, `settings.${at}.${randomBytes(4).toString('hex')}.json`);
|
|
702
|
+
try {
|
|
703
|
+
fs.writeExclusive(file, bytes, PRIVATE_FILE_MODE);
|
|
704
|
+
}
|
|
705
|
+
catch (failure) {
|
|
706
|
+
return { refused: `cannot write the backup ${file} (${errnoCode(failure)})` };
|
|
707
|
+
}
|
|
708
|
+
return { file };
|
|
709
|
+
}
|
|
710
|
+
/** Zapis treści: plik tymczasowy w katalogu celu i `rename` (istniejący plik) albo `link` (nowy). Napis = odmowa. */
|
|
711
|
+
function replace(snapshot, text, fs, again) {
|
|
712
|
+
const dir = path.dirname(snapshot.real);
|
|
713
|
+
const tmp = path.join(dir, `.${path.basename(snapshot.real)}.${randomBytes(8).toString('hex')}.tmp`);
|
|
714
|
+
try {
|
|
715
|
+
if (!snapshot.exists)
|
|
716
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
717
|
+
fs.writeExclusive(tmp, Buffer.from(text, 'utf8'), snapshot.exists ? snapshot.mode : PRIVATE_FILE_MODE);
|
|
718
|
+
if (snapshot.exists)
|
|
719
|
+
fs.rename(tmp, snapshot.real);
|
|
720
|
+
else
|
|
721
|
+
fs.link(tmp, snapshot.real);
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
catch (failure) {
|
|
725
|
+
if (!snapshot.exists && errnoCode(failure) === 'EEXIST') {
|
|
726
|
+
return `${snapshot.real} appeared meanwhile; nothing written, run ${again} again`;
|
|
727
|
+
}
|
|
728
|
+
return `cannot write ${snapshot.real} (${errnoCode(failure)})`;
|
|
729
|
+
}
|
|
730
|
+
finally {
|
|
731
|
+
unlinkQuiet(tmp);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
/** Po „y”: blokada, ponowny odczyt, kopia zapasowa i zapis; `operations` = te, które zmieniają plik. */
|
|
735
|
+
function commit(options, operations, file, first, after) {
|
|
736
|
+
let lock = null;
|
|
737
|
+
if (options.lock !== 'held') {
|
|
738
|
+
try {
|
|
739
|
+
lock = acquireLock(options.lock.dir, options.lock.what);
|
|
740
|
+
}
|
|
741
|
+
catch (failure) {
|
|
742
|
+
if (failure instanceof Refusal)
|
|
743
|
+
return { kind: 'refused', reason: failure.message };
|
|
744
|
+
throw failure;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
try {
|
|
748
|
+
const now = readSettings(file, options.again);
|
|
749
|
+
if ('refused' in now)
|
|
750
|
+
return { kind: 'refused', reason: now.refused };
|
|
751
|
+
if (!sameSnapshot(first.snapshot, now.snapshot)) {
|
|
752
|
+
return { kind: 'refused', reason: `${file} changed meanwhile; nothing written, run ${options.again} again` };
|
|
753
|
+
}
|
|
754
|
+
// Kopię sprawdzamy drugi raz pod blokadą: mogła zniknąć albo się zmienić w czasie pytania.
|
|
755
|
+
for (const operation of operations) {
|
|
756
|
+
const copy = copyOf(operation, options);
|
|
757
|
+
if (copy !== null && !copy.report.ok) {
|
|
758
|
+
return {
|
|
759
|
+
kind: 'refused',
|
|
760
|
+
reason: `the ${copy.what} in ${copy.report.dir} changed meanwhile; nothing written, run ${options.again} again`,
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const fs = { ...DEFAULT_FS, ...options.fs };
|
|
765
|
+
const saved = now.snapshot.exists ? backup(options, now.snapshot.bytes, fs) : { file: null };
|
|
766
|
+
if ('refused' in saved)
|
|
767
|
+
return { kind: 'refused', reason: `${saved.refused}; settings unchanged` };
|
|
768
|
+
const failed = replace(now.snapshot, after, fs, options.again);
|
|
769
|
+
if (failed !== null)
|
|
770
|
+
return { kind: 'refused', reason: `${failed}; settings unchanged` };
|
|
771
|
+
const target = now.snapshot.real;
|
|
772
|
+
options.print(saved.file === null
|
|
773
|
+
? `written: ${visibleLine(target)} (new file, mode 600; to undo: rm ${visibleLine(shellQuote(target))})`
|
|
774
|
+
: `written: ${visibleLine(target)}; backup: ${visibleLine(saved.file)} (to undo: cp`
|
|
775
|
+
+ ` ${visibleLine(shellQuote(saved.file))} ${visibleLine(shellQuote(target))})`);
|
|
776
|
+
return { kind: 'written', target, backup: saved.file };
|
|
777
|
+
}
|
|
778
|
+
finally {
|
|
779
|
+
lock?.release();
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Ostatnie sprawdzenie przed usunięciem kopii hooka przez `rarog service uninstall` (po drugim „y”, tuż przed
|
|
784
|
+
* `removeHookCopy`): `~/.claude/settings.json` tym samym odczytem co pisarz, bez zapisu, a w nim żaden wpis Raroga,
|
|
785
|
+
* czyli handler hooka zgód albo kontekstu (`rarogHookEntries`, `contextHookEntries`) ani `statusLine` podobny do
|
|
786
|
+
* Raroga (`isRarogStatuslineCommand`). Po `remove` z zapisem albo bez niczego do zdjęcia takich wpisów nie ma (inaczej byłby
|
|
787
|
+
* konflikt), więc znaleziony to wpis dopisany w czasie pytania: po usunięciu wskazywałby brakujący plik. Brak pliku =
|
|
788
|
+
* wolno; odmowa odczytu (błąd, zły JSON, nie plik zwykły) = nie wolno.
|
|
789
|
+
*/
|
|
790
|
+
export function copyRemovalCheck(home, again) {
|
|
791
|
+
const file = userSettingsPath(home);
|
|
792
|
+
const read = readSettings(file, again);
|
|
793
|
+
if ('refused' in read)
|
|
794
|
+
return { ok: false, reason: read.refused, entries: [] };
|
|
795
|
+
if (read.root === null)
|
|
796
|
+
return { ok: true };
|
|
797
|
+
const entries = [...rarogHookEntries(read.root), ...contextHookEntries(read.root)]
|
|
798
|
+
.map((entry) => `"hooks.${visibleLine(entry.event)}": ${visibleLine(entry.command)}`);
|
|
799
|
+
const status = read.root['statusLine'];
|
|
800
|
+
if (isRecord(status) && typeof status['command'] === 'string' && isRarogStatuslineCommand(status['command'])) {
|
|
801
|
+
entries.push(`"statusLine": ${visibleLine(status['command'])}`);
|
|
802
|
+
}
|
|
803
|
+
return entries.length === 0 ? { ok: true } : { ok: false, reason: `${file} has Rarog entries again`, entries };
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Operacja `operation` na `~/.claude/settings.json`: plan, różnica, pytanie i zapis. Wypisuje różnicę z celem przed
|
|
807
|
+
* pytaniem (`printDiff`) i linię z kopią zapasową po zapisie; konflikty, odmowy i blok do wklejenia wypisuje wołający.
|
|
808
|
+
* One batch of one operation ({@link writeClaudeSettingsBatch}), its outcome or the write as one result.
|
|
809
|
+
*/
|
|
810
|
+
export async function writeClaudeSettings(options) {
|
|
811
|
+
const { operation, ...base } = options;
|
|
812
|
+
const result = await writeClaudeSettingsBatch({ ...base, operations: [operation] });
|
|
813
|
+
const outcome = result.outcomes.get(operation);
|
|
814
|
+
if (outcome !== undefined && outcome.kind !== 'change' && outcome.kind !== 'unchanged')
|
|
815
|
+
return outcome;
|
|
816
|
+
return result.write;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Operations on `~/.claude/settings.json` with one read, one diff, one question and one write with one backup.
|
|
820
|
+
* An operation in conflict, refused or waiting for its copy drops out with its
|
|
821
|
+
* own outcome; the rest go on.
|
|
822
|
+
*/
|
|
823
|
+
export async function writeClaudeSettingsBatch(options) {
|
|
824
|
+
const file = userSettingsPath(options.home);
|
|
825
|
+
const first = readSettings(file, options.again);
|
|
826
|
+
if ('refused' in first)
|
|
827
|
+
return { outcomes: new Map(), write: { kind: 'refused', reason: first.refused } };
|
|
828
|
+
const { outcomes, changes, chains, current } = planBatch(options, first);
|
|
829
|
+
const done = (write) => ({ outcomes, write });
|
|
830
|
+
if (changes.length === 0)
|
|
831
|
+
return done({ kind: 'unchanged' });
|
|
832
|
+
if (first.snapshot.exists && !options.dataDir.ok) {
|
|
833
|
+
return done({ kind: 'refused', reason: `no directory for the backup: ${options.dataDir.message}` });
|
|
834
|
+
}
|
|
835
|
+
const layout = first.root === null ? NEW_FILE_LAYOUT : layoutOf(first.text);
|
|
836
|
+
const after = render(current, layout);
|
|
837
|
+
const diff = diffLines(file, first, after);
|
|
838
|
+
const print = options.printDiff ?? options.print;
|
|
839
|
+
for (const one of diff)
|
|
840
|
+
print(one);
|
|
841
|
+
if (options.confirm === null)
|
|
842
|
+
return done({ kind: 'no-terminal' });
|
|
843
|
+
const reformatted = first.root !== null && render(first.root, layout) !== first.text;
|
|
844
|
+
if (!(await options.confirm({ changes, chains, reformatted, newFile: !first.snapshot.exists, diff })))
|
|
845
|
+
return done({ kind: 'declined' });
|
|
846
|
+
return done(commit(options, changes, file, first, after));
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Each operation's outcome on the settings file as it is now, without a diff, a question or a write: `rarog setup`
|
|
850
|
+
* offers the missing `statusLine` script only when its operation waits for that copy. `null` = the file cannot be read
|
|
851
|
+
* (the write would say why).
|
|
852
|
+
*/
|
|
853
|
+
export function plannedOutcomes(options) {
|
|
854
|
+
const first = readSettings(userSettingsPath(options.home), options.again);
|
|
855
|
+
return 'refused' in first ? null : planBatch(options, first).outcomes;
|
|
856
|
+
}
|
|
857
|
+
/** The operations planned in order, each on the result of those before it. */
|
|
858
|
+
function planBatch(options, first) {
|
|
859
|
+
const outcomes = new Map();
|
|
860
|
+
const now = (options.now ?? (() => new Date()))().getTime();
|
|
861
|
+
let current = first.root ?? {};
|
|
862
|
+
const changes = [];
|
|
863
|
+
let chains = false;
|
|
864
|
+
for (const operation of options.operations) {
|
|
865
|
+
// Zdjęcie wpisów bez pliku: nie ma czego zdjąć, a pliku nie zakładamy.
|
|
866
|
+
if (first.root === null && operation === 'remove') {
|
|
867
|
+
outcomes.set(operation, { kind: 'unchanged' });
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
const planned = plan(current, operation, options, now);
|
|
871
|
+
if ('refused' in planned) {
|
|
872
|
+
outcomes.set(operation, { kind: 'refused', reason: planned.refused });
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
if ('conflicts' in planned) {
|
|
876
|
+
outcomes.set(operation, { kind: 'conflict', reasons: planned.conflicts });
|
|
877
|
+
continue;
|
|
878
|
+
}
|
|
879
|
+
if (first.root !== null && JSON.stringify(planned.next) === JSON.stringify(current)) {
|
|
880
|
+
outcomes.set(operation, { kind: 'unchanged' });
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
const copy = copyOf(operation, options);
|
|
884
|
+
if (copy !== null && !copy.report.ok) {
|
|
885
|
+
outcomes.set(operation, {
|
|
886
|
+
kind: 'copy-not-ready',
|
|
887
|
+
reason: `the ${copy.what} in ${copy.report.dir} is missing or differs from the source, so the`
|
|
888
|
+
+ ` ${operation === 'statusLine' ? 'command' : 'entries'} would point at a missing or old file`,
|
|
889
|
+
});
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
const chained = operation === 'statusLine' && chainsUserCommand(current, options.home);
|
|
893
|
+
chains ||= chained;
|
|
894
|
+
outcomes.set(operation, { kind: 'change', chains: chained });
|
|
895
|
+
changes.push(operation);
|
|
896
|
+
current = planned.next;
|
|
897
|
+
}
|
|
898
|
+
return { outcomes, changes, chains, current };
|
|
899
|
+
}
|
|
900
|
+
/** The `statusLine` command before the operation is the user's own (neither missing nor one Rarog wrote). */
|
|
901
|
+
function chainsUserCommand(root, home) {
|
|
902
|
+
const value = root['statusLine'];
|
|
903
|
+
const command = isRecord(value) ? value['command'] : undefined;
|
|
904
|
+
return typeof command === 'string' && command.trim() !== '' && rarogStatuslineChain(command, home) === null;
|
|
905
|
+
}
|