@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,1191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rarog setup` — instalacja serwera Rarog krok po kroku na nowym koncie (macOS albo Linux z `systemd --user`).
|
|
3
|
+
*
|
|
4
|
+
* One rule: setup CREATES only what is missing and changes nothing that exists. Rarog's own missing parts
|
|
5
|
+
* (`config.json` with the server key, the clone's hook copy, the herdr agent or unit, the Claude SDK, the service) are
|
|
6
|
+
* listed on the plan screen and covered by one `Continue? [Y/n]` (`setup-plan.ts`; EOF = no, nothing written; on a plan
|
|
7
|
+
* of the herdr item alone it declines just that item); a foreign file or setting keeps its own question. „Brak” to
|
|
8
|
+
* wyłącznie `lstat` = ENOENT; każdy inny stan (zepsuty JSON, brak dostępu, wiszące dowiązanie) jest stanem
|
|
9
|
+
* istniejącym: diagnoza i komenda naprawy, bez zapisu. Zapis „tylko
|
|
10
|
+
* gdy brak” idzie przez plik tymczasowy i `link` na docelową nazwę, więc dwa równoległe `setup` się nie nadpiszą
|
|
11
|
+
* (`EEXIST` = ktoś był pierwszy, stop). Blokady przez pytania setup nie trzyma.
|
|
12
|
+
*
|
|
13
|
+
* Bez terminala (`CliIo.ask` brak) setup nie pyta i niczego nie zapisuje: wypisuje stan kroków i komendy dla
|
|
14
|
+
* brakujących. Kod 0 = wszystkie kroki na miejscu, 1 = braki albo problemy (także po pytaniach w terminalu).
|
|
15
|
+
* The tools check runs once, before the plan screen: a first setup (no `config.json`) in a terminal with a tool
|
|
16
|
+
* missing stops there with one sentence and its fix, nothing written; otherwise the Tools step reports it.
|
|
17
|
+
*
|
|
18
|
+
* Transport (`setup-transport.ts`): with the iroh native module (`irohModuleInfo`, read from the manifests without
|
|
19
|
+
* loading native code) a new `config.json` gets `RAROG_IROH=1` and `RAROG_IROH_RELAY` (the default relay or
|
|
20
|
+
* `--iroh-relay`), and with `tailscale` in PATH also `RAROG_ORIGINS` from `tailscale status` on the first free port
|
|
21
|
+
* of the pool for `tailscale serve` (step 4 maps it). No free port or a failing `tailscale status` leaves iroh only.
|
|
22
|
+
* An Intel Mac has no module, so Tailscale only, and no free port there means no transport and no `config.json`. The server key `RAROG_IROH_KEY` is
|
|
23
|
+
* written BEFORE `config.json`, both under one Rarog lock of the config directory (`secrets-file.ts`), so an
|
|
24
|
+
* interrupted setup leaves at most the key without a config, and a retry takes that key. Exception to "changes
|
|
25
|
+
* nothing that exists": a secrets file without the key gets the key line (the rest byte for byte, the atomic write
|
|
26
|
+
* of `rarog dictation set-key`); an existing key is never changed. The key's value is never printed.
|
|
27
|
+
*
|
|
28
|
+
* W paczce npm setup pobiera też SDK Claude listy sesji (krok „Claude SDK”, `install/sdk.ts`) do katalogu danych
|
|
29
|
+
* usługi (`install/data-dir.ts`, flaga `--data-dir`), a uruchomiony z cache `npx` albo przez `pnpm dlx` odmawia na
|
|
30
|
+
* samym początku: usługa z takiej ścieżki znika przy czyszczeniu cache. Na końcu paczka dostaje zdanie
|
|
31
|
+
* o aktualizacji: komenda menedżera, który ją położył, potem `rarog restart`.
|
|
32
|
+
*
|
|
33
|
+
* Kopię hooka i skryptu `statusLine` pisze tylko wtedy, gdy usługi nie ma albo startuje tę instalację: cel usługi
|
|
34
|
+
* czyta przed pierwszym zapisem (`copyTargetRefusal` z `hooks.ts`), a usługa innej instalacji albo nieczytelny cel
|
|
35
|
+
* to odmowa w obu krokach kopii, bez pytania.
|
|
36
|
+
*
|
|
37
|
+
* Wyjątek od „niczego istniejącego nie zmienia”: kopia hooka różna od źródła (po `npm update` albo nowym commicie
|
|
38
|
+
* w `scripts/hooks/`). Krok 5 robi wtedy to, co `rarog hooks install`, z tymi samymi bramami
|
|
39
|
+
* (`installHookCopy`): w klonie drukuje `git log <commit>..HEAD -- scripts/hooks` i pyta przed bramą stanu z commita,
|
|
40
|
+
* w paczce pytanie stoi po różnicy kopii. Kopia zmieniona po instalacji (skrót różny od manifestu) to ostrzeżenie
|
|
41
|
+
* doctora bez pytania i bez zapisu.
|
|
42
|
+
*
|
|
43
|
+
* Exception to "changes nothing that exists": `--tailscale` adds the Tailscale address (`RAROG_ORIGINS`) to an existing
|
|
44
|
+
* `config.json` without one, as an item of the plan screen (`setup-tailscale-add.ts`); nothing else in the file changes.
|
|
45
|
+
*
|
|
46
|
+
* Exception to "changes nothing that exists": Rarog's own entries in `~/.claude/settings.json`. The Claude
|
|
47
|
+
* settings step (`setup-settings.ts`) asks one `[y/N/d]` question for the five entries (permission and context
|
|
48
|
+
* hooks, `statusLine`, `denyRead`, the write block) and herdr's session hook, writes Rarog's entries in one write with
|
|
49
|
+
* one backup, then
|
|
50
|
+
* runs `herdr integration install claude` (herdr writes its own entry). Without a terminal it writes nothing.
|
|
51
|
+
*
|
|
52
|
+
* Usługi nie instaluje, gdy jest JAKIKOLWIEK ślad usługi (plik albo załadowana etykieta) — wtedy tylko diagnoza
|
|
53
|
+
* i komenda; instalacja wyłącznie przy braku obu i żywym gnieździe herdr. Platforma i ścieżki przychodzą z `CliIo`
|
|
54
|
+
* (`platform`, `env.HOME`), więc gałęzie Linuksa testują się na macOS na atrapach.
|
|
55
|
+
*
|
|
56
|
+
* Steps 2 (`config.json`), 3 (the secrets file), 4 (`tailscale serve`) and 7 (`herdr.service` on Linux, the herdr
|
|
57
|
+
* agent on macOS) live in their own modules (`setup-config.ts`, `setup-secrets.ts`, `setup-transport.ts`,
|
|
58
|
+
* `setup-herdr-unit.ts`, `setup-herdr-agent.ts`), the context and the file helpers they share in `setup-context.ts`;
|
|
59
|
+
* this file runs the steps in order and holds the remaining ones.
|
|
60
|
+
*/
|
|
61
|
+
import { lstatSync, readlinkSync } from 'node:fs';
|
|
62
|
+
import path from 'node:path';
|
|
63
|
+
import { irohRelayUrl } from '@rarog/shared/pairing-link';
|
|
64
|
+
import { HERDR_SOCKET_ENV } from '../config-env.js';
|
|
65
|
+
import { gitReadEnv, spawnGitArgs } from '../git-status.js';
|
|
66
|
+
import { HEALTH_PROBE_TTL_MS } from '../health.js';
|
|
67
|
+
import { hookCopyReport, hookInstallDir, hookOriginText, installHookCopy, installMissingHookCopy, installStatuslineCopy, renderHookCopyReview, statuslineCopyReport, } from '../herdr/hook-config.js';
|
|
68
|
+
import { installDataDir } from '../install/data-dir.js';
|
|
69
|
+
import { INSTALL_MODE, INSTALL_ROOT } from '../install/mode.js';
|
|
70
|
+
import { PACKAGE_INSTALL, REPAIR, packageCommands, packageManagerOf, rarogCli, repairCommands, shellQuote, } from '../install/repair.js';
|
|
71
|
+
import { SDK_PACKAGE, installSdk, probeSdkDir, readSdkPin, sdkDirIssue, sdkRoot, sdkTempDirs, sdkVersionDir, } from '../install/sdk.js';
|
|
72
|
+
import { RAROG_BIN, transientInstall } from '../install/service-target.js';
|
|
73
|
+
import { trackChild } from './child-output.js';
|
|
74
|
+
import { changedAfterInstall, changedAfterInstallWarning, copyTargetRefusal, copyTargetRefusalOf, herdrClaudeIntegration, herdrIntegrationLine, sourceMovedLines, } from './hooks.js';
|
|
75
|
+
import { EXIT_INTERRUPTED, EXIT_OK, EXIT_REFUSED, Usage, homeOf, out, platformOf } from './io.js';
|
|
76
|
+
import { SERVICE_LABEL, accepts, installedServiceDataDir, loadState, nodeRequirement, onPath, serviceNodeVersionOk, servicePlistPath, } from './restart.js';
|
|
77
|
+
import { CONFIG_FILENAME, rarogConfigDir, readRarogConfig } from './serve.js';
|
|
78
|
+
import { launchdEnv, rarogLinkPath, serviceInstallIfAbsent } from './service.js';
|
|
79
|
+
import { closingCheck, packageVersion, setupCliTarget } from './setup-check.js';
|
|
80
|
+
import { stepConfig } from './setup-config.js';
|
|
81
|
+
import { confirmPlan, sdkPlanEntry, tilde } from './setup-plan.js';
|
|
82
|
+
import { SetupView } from './setup-screen.js';
|
|
83
|
+
import { statusLineScriptOutOfDate, statusLineWaitsForScript, stepClaudeSettings } from './setup-settings.js';
|
|
84
|
+
import { SCREEN_TITLE, SERVICE_UNDETERMINED, SetupInterrupted, configPort, configuredHerdrSocket, confirm, copyDirEmpty, declinedStep, entry, errnoCode, herdrSocket, isRecord, line, onShellPath, serviceStateFix, waitingStep, } from './setup-context.js';
|
|
85
|
+
import { herdrAgentOffer, herdrAgentStart, stepHerdrAgent } from './setup-herdr-agent.js';
|
|
86
|
+
import { HERDR_UNIT_NAME, herdrUnitOffer, stepHerdrUnit } from './setup-herdr-unit.js';
|
|
87
|
+
import { stepSecrets } from './setup-secrets.js';
|
|
88
|
+
import { tailscaleAddress } from './setup-tailscale-add.js';
|
|
89
|
+
import { TAILSCALE_ONLY_FLAG, TAILSCALE_ONLY_PLAN_ITEM, tailscaleOnlyBeforePlan } from './setup-tailscale-only.js';
|
|
90
|
+
import { stepTailscale, transportTools } from './setup-transport.js';
|
|
91
|
+
import { UNIT_NAME, managerEnvironment, showUnit, unitFilePath, userUnitDir } from './systemd-unit.js';
|
|
92
|
+
import { usageFor } from './screen/prose.js';
|
|
93
|
+
import { wrapWords } from './screen/style.js';
|
|
94
|
+
export { SetupInterrupted } from './setup-context.js';
|
|
95
|
+
export const SETUP_USAGE = ` rarog setup [--tailscale] [--tailscale-only] [--iroh-relay <https url>] [--data-dir <dir>] [--verbose]
|
|
96
|
+
Step-by-step installation: checks the tools and creates only what is missing (config.json with the iroh
|
|
97
|
+
server key and your home folder as the work area, the hook copy and the statusLine script, the herdr agent
|
|
98
|
+
on macOS or the herdr.service unit on Linux, with the npm package the Claude SDK for the sessions list, the
|
|
99
|
+
service), after one Continue? [Y/n] for the plan shown first; answer n to stop with nothing changed (on a plan
|
|
100
|
+
of the herdr item alone, n skips just that item). Of what exists it changes only a hook copy that differs from
|
|
101
|
+
the source (after its diff, in a clone the git log of the hook changes) and the secrets file, to which it
|
|
102
|
+
adds a missing iroh server key and the voice keys, each after a question, and the Rarog entries in
|
|
103
|
+
~/.claude/settings.json
|
|
104
|
+
(hooks, statusLine, sandbox.filesystem.denyRead, the permissions.deny rules that keep Claude Code sessions
|
|
105
|
+
from writing the data directory and ~/.config/rarog; one backup in the data directory) after one [y/N/d]
|
|
106
|
+
question, where d shows the full diff; without herdr's Claude integration the same answer then runs herdr
|
|
107
|
+
integration install claude (herdr writes its own entry). On Linux, with herdr not running and no herdr.service
|
|
108
|
+
unit, the plan lists that unit; setup writes it to ~/.config/systemd/user and does not enable it. On macOS,
|
|
109
|
+
without the herdr agent ai.rarog.herdr, the plan lists that LaunchAgent; setup writes it to
|
|
110
|
+
~/Library/LaunchAgents, which starts herdr at each login, and with herdr not running it also loads it, which
|
|
111
|
+
starts herdr now. Transport of a new config.json: iroh when this machine has the iroh native module (RAROG_IROH=1,
|
|
112
|
+
the default relay, a new server key RAROG_IROH_KEY in the secrets file, never printed), and the HTTPS
|
|
113
|
+
address from tailscale status on the first free port of 8931-8960 for tailscale serve when tailscale is in
|
|
114
|
+
PATH (no free port leaves iroh only); an Intel Mac has no iroh module, so Tailscale only. With both, a first
|
|
115
|
+
setup in a terminal first asks whether the app connects only through Tailscale; "y" writes RAROG_IROH=0 with
|
|
116
|
+
the relay, the Tailscale address and no server key, and writes nothing before Continue?. Before a new
|
|
117
|
+
config.json it asks about dictation with Soniox and, with a Soniox key, about the voice agent (an OpenAI
|
|
118
|
+
key, paid); each key at a hidden prompt, never printed, and with both keys RAROG_COMPANION=1. Without a
|
|
119
|
+
terminal it asks nothing and writes nothing; code 1 when something is missing.
|
|
120
|
+
--tailscale: an existing config.json without an address (iroh only) gets the HTTPS address from tailscale
|
|
121
|
+
status on the first free port of 8931-8960 in RAROG_ORIGINS, as an item of the plan; this is the one change
|
|
122
|
+
setup makes to an existing config.json. Then tailscale serve maps it after its own question. The server reads
|
|
123
|
+
the address after rarog restart; devices paired before get it from a new pairing:
|
|
124
|
+
rarog devices revoke --all, then rarog pair.
|
|
125
|
+
--tailscale-only: the "y" of that question without asking it, for a new config.json only (it stops before
|
|
126
|
+
the plan when Tailscale is missing, logged out or stopped; with --tailscale it is --tailscale-only alone).
|
|
127
|
+
With an existing config.json it changes nothing; docs/server-config.md, "Tailscale only", says how to switch
|
|
128
|
+
by hand.
|
|
129
|
+
--iroh-relay: your own iroh relay instead of the default one.
|
|
130
|
+
--data-dir: the installation's data directory from rarog serve --data-dir.
|
|
131
|
+
--verbose: every detail line on the screen, and the summary at the end (otherwise one line per step; the
|
|
132
|
+
details go to the log <data directory>/logs/setup-<time>.log, written from the first yes on).`;
|
|
133
|
+
/** The production iroh relay (`relay-vps/`) as the `RAROG_IROH_RELAY` value, in the canonical `irohRelayUrl` form. */
|
|
134
|
+
export const DEFAULT_IROH_RELAY = 'https://relay.rarog.ai/';
|
|
135
|
+
/** Ile setup czeka na `/health` usługi, która już jest. */
|
|
136
|
+
const HEALTH_TIMEOUT_MS = 3000;
|
|
137
|
+
/** `/health` answered, but its herdr ping failed: the server runs, herdr does not. */
|
|
138
|
+
const HERDR_DOWN = 'herdr: false';
|
|
139
|
+
const DEFAULT_DEPS = {
|
|
140
|
+
serviceInstall: (io, precheck, output) => serviceInstallIfAbsent(io, precheck, undefined, output === undefined ? {} : { output }),
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Pierwszy plik wykonywalny o tej nazwie w `PATH`, potem w `~/.local/bin`; `null` = brak. Plik znaleziony tylko
|
|
144
|
+
* w `~/.local/bin` leży poza `PATH` tej powłoki ({@link onShellPath}), więc panel herdr może go nie widzieć.
|
|
145
|
+
*/
|
|
146
|
+
function findExecutable(name, ctx) {
|
|
147
|
+
const dirs = [...(ctx.io.env['PATH'] ?? '').split(':'), path.join(ctx.home, '.local', 'bin')];
|
|
148
|
+
for (const dir of dirs) {
|
|
149
|
+
if (!path.isAbsolute(dir))
|
|
150
|
+
continue;
|
|
151
|
+
const candidate = path.join(dir, name);
|
|
152
|
+
if (onPath(name, { PATH: dir }))
|
|
153
|
+
return candidate;
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
function parseFlags(argv) {
|
|
158
|
+
let irohRelay = null;
|
|
159
|
+
let dataDir = null;
|
|
160
|
+
let verbose = false;
|
|
161
|
+
let tailscale = false;
|
|
162
|
+
let tailscaleOnly = false;
|
|
163
|
+
for (let i = 1; i < argv.length; i += 1) {
|
|
164
|
+
const arg = argv[i] ?? '';
|
|
165
|
+
if (arg === '--verbose') {
|
|
166
|
+
verbose = true;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (arg === '--tailscale') {
|
|
170
|
+
tailscale = true;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (arg === TAILSCALE_ONLY_FLAG) {
|
|
174
|
+
tailscaleOnly = true;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (arg === '--iroh-relay') {
|
|
178
|
+
const value = argv[i + 1];
|
|
179
|
+
if (value === undefined || value === '')
|
|
180
|
+
throw new Usage('rarog setup: --iroh-relay needs an address.');
|
|
181
|
+
if (irohRelay !== null)
|
|
182
|
+
throw new Usage('rarog setup: --iroh-relay given twice.');
|
|
183
|
+
// The canonical form of `RAROG_IROH_RELAY` in the server and of the pairing link's `r` field.
|
|
184
|
+
irohRelay = irohRelayUrl(value);
|
|
185
|
+
if (irohRelay === null) {
|
|
186
|
+
throw new Usage(`rarog setup: --iroh-relay "${value}" is not an iroh relay address: https://host[:port]/`
|
|
187
|
+
+ ' without a path.');
|
|
188
|
+
}
|
|
189
|
+
i += 1;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (arg === '--data-dir') {
|
|
193
|
+
const value = argv[i + 1];
|
|
194
|
+
if (value === undefined || value === '')
|
|
195
|
+
throw new Usage('rarog setup: --data-dir needs a directory.');
|
|
196
|
+
if (!path.isAbsolute(value))
|
|
197
|
+
throw new Usage(`rarog setup: --data-dir "${value}" is not an absolute path.`);
|
|
198
|
+
if (dataDir !== null)
|
|
199
|
+
throw new Usage('rarog setup: --data-dir given twice.');
|
|
200
|
+
dataDir = path.resolve(value);
|
|
201
|
+
i += 1;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
throw new Usage(`rarog setup: unknown argument "${arg}".`);
|
|
205
|
+
}
|
|
206
|
+
return { irohRelay, dataDir, verbose, tailscale, tailscaleOnly };
|
|
207
|
+
}
|
|
208
|
+
/** Środowisko usługi: Linux — menedżer `systemd --user` (bez magistrali jak macOS), macOS — jak pod launchd. */
|
|
209
|
+
function serviceEnvOf(io, platform) {
|
|
210
|
+
if (platform === 'linux') {
|
|
211
|
+
const manager = managerEnvironment(io);
|
|
212
|
+
if ('env' in manager)
|
|
213
|
+
return { ...launchdEnv(io.env), ...manager.env };
|
|
214
|
+
}
|
|
215
|
+
return launchdEnv(io.env);
|
|
216
|
+
}
|
|
217
|
+
const missingTool = (name, fix, text = `${name} — ${fix}`) => ({ name, fix, text });
|
|
218
|
+
/**
|
|
219
|
+
* The Tools step's result. The summary keeps the `--verbose` wording, which points at the `MISSING` and `PROBLEM`
|
|
220
|
+
* lines; the screen line names the tools itself, because the step screen hides those lines.
|
|
221
|
+
*/
|
|
222
|
+
function toolsResult(missing) {
|
|
223
|
+
const title = 'tools';
|
|
224
|
+
const count = String(missing.length);
|
|
225
|
+
const names = missing.length === 0 ? '' : `${count} missing: ${missing.map((one) => one.name).join(', ')}`;
|
|
226
|
+
const fixes = [...new Set(missing.map((one) => one.fix))];
|
|
227
|
+
const fix = fixes.length === 0 ? {} : { fix: `${fixes.join('; ')}; then rarog setup` };
|
|
228
|
+
return missing.length === 0
|
|
229
|
+
? { title, state: 'ok', summary: 'tools: all present' }
|
|
230
|
+
: { title, state: 'missing', summary: `tools: ${count} missing (list above)`, result: names, ...fix };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* The tools check, once per run and before the plan screen: what it finds goes to the context (`claude`,
|
|
234
|
+
* `herdr`, the herdr integration, the transport), its detail lines come back for the Tools step to write under its
|
|
235
|
+
* header. It reads only: `PATH`, `herdr integration status`, `systemctl --user` on Linux, the iroh module manifests.
|
|
236
|
+
*/
|
|
237
|
+
function checkTools(ctx) {
|
|
238
|
+
const lines = [];
|
|
239
|
+
const say = (text) => { lines.push(text); };
|
|
240
|
+
const missing = [];
|
|
241
|
+
if (!serviceNodeVersionOk(process.version)) {
|
|
242
|
+
missing.push(missingTool(`Node ${process.version}`, `Node ${nodeRequirement()} (e.g. nvm install --lts)`, `Node ${process.version} — requires ${nodeRequirement()} (e.g. nvm install --lts)`));
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
say(`node ${process.version}`);
|
|
246
|
+
}
|
|
247
|
+
const claude = findExecutable('claude', ctx);
|
|
248
|
+
ctx.claude = claude;
|
|
249
|
+
if (claude === null)
|
|
250
|
+
missing.push(missingTool('claude', 'install Claude Code'));
|
|
251
|
+
else
|
|
252
|
+
say(`claude: ${claude}`);
|
|
253
|
+
const outside = claude === null || onShellPath(path.dirname(claude), ctx) ? null : path.dirname(claude);
|
|
254
|
+
if (outside !== null) {
|
|
255
|
+
say(ctx.platform === 'linux'
|
|
256
|
+
? ` ${outside} is outside this shell's PATH; step 9 checks the PATH of herdr panes`
|
|
257
|
+
: `WARNING: ${outside} is outside this shell's PATH — a herdr pane may not find claude (a session started from`
|
|
258
|
+
+ ' the app will not come up); add this directory to PATH in your shell startup file');
|
|
259
|
+
}
|
|
260
|
+
ctx.herdr = findExecutable('herdr', ctx);
|
|
261
|
+
if (ctx.herdr === null) {
|
|
262
|
+
missing.push(missingTool('herdr', 'install herdr (default ~/.local/bin/herdr)'));
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
say(`herdr: ${ctx.herdr}`);
|
|
266
|
+
// Its installer runs in the Settings step, after the one settings question (it writes the same file).
|
|
267
|
+
ctx.herdrIntegration = herdrClaudeIntegration(ctx.herdr, ctx.io.env);
|
|
268
|
+
if (ctx.herdrIntegration.state === 'current' || ctx.herdrIntegration.state === 'unknown') {
|
|
269
|
+
say(herdrIntegrationLine(ctx.herdrIntegration));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (onPath('curl', ctx.io.env))
|
|
273
|
+
say('curl: found');
|
|
274
|
+
else
|
|
275
|
+
missing.push(missingTool('curl', 'install curl (restart checks /health with it)'));
|
|
276
|
+
if (ctx.platform === 'linux') {
|
|
277
|
+
for (const tool of ['ps', 'pgrep']) {
|
|
278
|
+
if (onPath(tool, ctx.io.env))
|
|
279
|
+
say(`${tool}: found`);
|
|
280
|
+
else
|
|
281
|
+
missing.push(missingTool(tool, 'install procps'));
|
|
282
|
+
}
|
|
283
|
+
const shown = showUnit(ctx.io, ['LoadState']);
|
|
284
|
+
if ('failure' in shown) {
|
|
285
|
+
// Its message stays in the MISSING line (the run log); the fix is one phrase. The service step,
|
|
286
|
+
// which asks the same manager, waits for this step.
|
|
287
|
+
missing.push(missingTool('systemctl --user', 'log in with a systemd user session', `systemctl --user unreachable (${shown.failure}) — the Rarog service is a systemd --user unit`));
|
|
288
|
+
ctx.serviceWaits = SCREEN_TITLE.tools;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
say('systemctl --user: responds');
|
|
292
|
+
}
|
|
293
|
+
if (!onPath('lsof', ctx.io.env) && !onPath('ss', ctx.io.env)) {
|
|
294
|
+
say('hint: neither lsof nor ss — restart cannot find the process on the port (install iproute2)');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
const transport = transportTools(ctx);
|
|
298
|
+
lines.push(...transport.lines);
|
|
299
|
+
if (transport.missing !== null)
|
|
300
|
+
missing.push(transport.missing);
|
|
301
|
+
for (const one of missing)
|
|
302
|
+
say(`MISSING ${one.text}`);
|
|
303
|
+
return { lines, missing };
|
|
304
|
+
}
|
|
305
|
+
/** The Tools step: the lines and the result of the check that ran before the plan ({@link checkTools}). */
|
|
306
|
+
function stepTools(ctx, check) {
|
|
307
|
+
for (const text of check.lines)
|
|
308
|
+
line(ctx, text);
|
|
309
|
+
return toolsResult(check.missing);
|
|
310
|
+
}
|
|
311
|
+
/** ` Fix: ` of the step screen (`screen/steps.ts`): the refusal's fix stands as under a step line. */
|
|
312
|
+
const FIX_LABEL = ' Fix: ';
|
|
313
|
+
/** `a`, `a and b`, `a, b and c`. */
|
|
314
|
+
function namesOf(names) {
|
|
315
|
+
return names.length < 2 ? names.join('') : `${names.slice(0, -1).join(', ')} and ${names.at(-1) ?? ''}`;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* A first setup (no `config.json`) in a terminal with a tool missing stops before the plan screen: one
|
|
319
|
+
* sentence with the missing tools and their `Fix:`, exit 1, nothing written and no run log. Without it the plan would
|
|
320
|
+
* promise a config and a service the run cannot create, and still write the hook copy and the settings entries.
|
|
321
|
+
* `null` = go on: an existing installation, a run without a terminal or nothing missing keep the step report.
|
|
322
|
+
*/
|
|
323
|
+
function refusalBeforePlan(ctx, check) {
|
|
324
|
+
if (ctx.ask === null || check.missing.length === 0)
|
|
325
|
+
return null;
|
|
326
|
+
if (entry(path.join(rarogConfigDir(ctx.io.env), CONFIG_FILENAME)) !== 'missing')
|
|
327
|
+
return null;
|
|
328
|
+
return stopBeforePlan(ctx, {
|
|
329
|
+
lines: check.lines,
|
|
330
|
+
sentence: `Rarog cannot run without ${namesOf(check.missing.map((one) => one.name))}; nothing changed.`,
|
|
331
|
+
fix: toolsResult(check.missing).fix ?? '',
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* A stop before the plan screen: the detail lines, one sentence and its `Fix:` under it, exit 1, nothing written and no
|
|
336
|
+
* run log.
|
|
337
|
+
*/
|
|
338
|
+
function stopBeforePlan(ctx, stop) {
|
|
339
|
+
// `--verbose` shows the detail lines; otherwise they stay in memory, because the log file opens only at a "yes".
|
|
340
|
+
for (const text of stop.lines)
|
|
341
|
+
line(ctx, text);
|
|
342
|
+
const width = ctx.view.screen.layout.width;
|
|
343
|
+
for (const part of wrapWords(stop.sentence, width, width))
|
|
344
|
+
ctx.view.closing(part);
|
|
345
|
+
const [first = '', ...commands] = ctx.view.screenFix(stop.fix).split('\n');
|
|
346
|
+
const room = width - FIX_LABEL.length;
|
|
347
|
+
const sentenceLines = first === '' ? [] : wrapWords(first, room, room);
|
|
348
|
+
ctx.view.closing(`${FIX_LABEL}${sentenceLines[0] ?? ''}`.trimEnd());
|
|
349
|
+
for (const part of sentenceLines.slice(1))
|
|
350
|
+
ctx.view.closing(`${' '.repeat(FIX_LABEL.length)}${part}`);
|
|
351
|
+
for (const command of commands)
|
|
352
|
+
ctx.view.closing(` ${command}`);
|
|
353
|
+
return EXIT_REFUSED;
|
|
354
|
+
}
|
|
355
|
+
// ---------------------------------------------------------------------------
|
|
356
|
+
// Krok 5: hook
|
|
357
|
+
// ---------------------------------------------------------------------------
|
|
358
|
+
function gitRunner(ctx) {
|
|
359
|
+
return spawnGitArgs(gitReadEnv({ PATH: ctx.io.env['PATH'] ?? '', HOME: ctx.home }));
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The `[y/N]` questions about the hook copy in `~/.claude/hooks/rarog` (the hook files and the statusLine script):
|
|
363
|
+
* install a missing copy, update a differing one, or add only the missing script. One line at 60 columns;
|
|
364
|
+
* the review of the files goes to the run log and, with `--verbose`, to the screen.
|
|
365
|
+
*/
|
|
366
|
+
export function copyQuestion(kind, dir) {
|
|
367
|
+
switch (kind) {
|
|
368
|
+
case 'install':
|
|
369
|
+
return `Install the hook copy in ${dir}?`;
|
|
370
|
+
case 'update':
|
|
371
|
+
return `Update the hook copy in ${dir}?`;
|
|
372
|
+
case 'statusLine':
|
|
373
|
+
return `Add the status line script to ${dir}?`;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Kopia po pytaniu `[y/N]` (`install` to instalator: brakującej kopii „tylko gdy brak” albo aktualizacja kopii różnej
|
|
378
|
+
* od źródła, `installHookCopy`). W klonie pytanie stoi przed instalatorem, bo brama stanu z commita nie pyta.
|
|
379
|
+
* W paczce instalator najpierw czyta źródło i pokazuje różnicę wobec kopii, a to samo pytanie stoi po niej;
|
|
380
|
+
* `askFirst` stawia je też przed instalatorem, gdy różnicy plików nie będzie (instalator pisze kopię równą
|
|
381
|
+
* źródłu bez pytania, a usunąłby plik z poprzedniej instalacji). `null` = „nie”, EOF albo brak terminala: nic nie
|
|
382
|
+
* zapisane. Usługa innej instalacji ({@link Ctx.copyRefusal}) = odmowa bez pytania i bez zapisu.
|
|
383
|
+
*/
|
|
384
|
+
async function installAfterQuestion(ctx, question, install, askFirst = false) {
|
|
385
|
+
if (ctx.copyRefusal !== null)
|
|
386
|
+
return { ok: false, reason: ctx.copyRefusal.text };
|
|
387
|
+
const opts = {
|
|
388
|
+
home: ctx.home, root: ctx.installRoot, mode: ctx.mode, git: gitRunner(ctx),
|
|
389
|
+
serviceRefusal: () => copyTargetRefusal(ctx.io, { mode: ctx.mode, root: ctx.installRoot }),
|
|
390
|
+
};
|
|
391
|
+
// `null` = the plan screen covered it ("Continue?"): no question of its own, the review stays a detail line. The
|
|
392
|
+
// update run that has just installed this package writes its copy the same way.
|
|
393
|
+
const ok = async () => (question === null || ctx.copyWithoutQuestion ? ctx.ask !== null
|
|
394
|
+
: confirm(ctx, question));
|
|
395
|
+
if ((ctx.mode !== 'package' || askFirst) && !await ok())
|
|
396
|
+
return null;
|
|
397
|
+
if (ctx.mode !== 'package')
|
|
398
|
+
return install(opts);
|
|
399
|
+
if (ctx.ask === null)
|
|
400
|
+
return null;
|
|
401
|
+
const result = await install({
|
|
402
|
+
...opts,
|
|
403
|
+
review: async (review) => {
|
|
404
|
+
for (const text of renderHookCopyReview(review).trimEnd().split('\n'))
|
|
405
|
+
line(ctx, text);
|
|
406
|
+
return ok();
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
return !result.ok && result.declined === true ? null : result;
|
|
410
|
+
}
|
|
411
|
+
/** Podsumowanie kopii, której setup nie zaktualizował: przegląd w doctorze, potem `rarog hooks install`. */
|
|
412
|
+
const COPY_OUT_OF_DATE = 'hook copy out of date: review rarog hooks doctor, then rarog hooks install';
|
|
413
|
+
/** Pliki kopii różne od źródła i pliki z poprzedniej instalacji do usunięcia, jednym członem zdania. */
|
|
414
|
+
function copyDifferences(report, script) {
|
|
415
|
+
const files = [...report.files, ...script.files].filter((one) => one.state !== 'match').map((one) => {
|
|
416
|
+
if (one.state === 'missing')
|
|
417
|
+
return `${one.name} (missing)`;
|
|
418
|
+
return one.state === 'unreadable' ? `${one.name} (not a regular file)` : one.name;
|
|
419
|
+
});
|
|
420
|
+
return [...files, ...report.leftovers.map((name) => `${name} (from a previous install, to be removed)`)].join(', ');
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Kopia hooka różna od źródła: to, co `rarog hooks install`, z tymi samymi bramami
|
|
424
|
+
* (`installHookCopy`: brama źródła trybu, cel usługi, w paczce różnica i pytanie). Kopia zmieniona po instalacji
|
|
425
|
+
* (skrót pliku różny od manifestu, także skryptu `statusLine`, który instalator też nadpisuje) to ostrzeżenie doctora
|
|
426
|
+
* bez pytania; usługa innej instalacji to odmowa przed `git log` i różnicą. Potem w klonie `git log` od commita kopii
|
|
427
|
+
* i pytanie przed bramą stanu z commita, w paczce pytanie po różnicy. Katalog kopii, który nie jest katalogiem
|
|
428
|
+
* (dowiązanie), zostaje: instalator i tak by odmówił.
|
|
429
|
+
*/
|
|
430
|
+
async function updateCopy(ctx, report) {
|
|
431
|
+
if (report.dirKind !== 'dir') {
|
|
432
|
+
line(ctx, `${report.dir} is a symlink or not a directory — setup does not replace it`);
|
|
433
|
+
return { state: 'problem', summary: COPY_OUT_OF_DATE };
|
|
434
|
+
}
|
|
435
|
+
const script = statuslineCopyReport(ctx.home, ctx.installRoot);
|
|
436
|
+
line(ctx, `hook copy in ${report.dir} differs from ${ctx.mode === 'package' ? 'the package' : 'the repo'}:`
|
|
437
|
+
+ ` ${copyDifferences(report, script)}`);
|
|
438
|
+
const written = [...report.files, ...script.files];
|
|
439
|
+
const changed = changedAfterInstall(written);
|
|
440
|
+
if (changed.length > 0) {
|
|
441
|
+
line(ctx, changedAfterInstallWarning(changed));
|
|
442
|
+
return {
|
|
443
|
+
state: 'problem',
|
|
444
|
+
summary: 'hook copy changed after the install: review rarog hooks doctor, then rarog hooks install',
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
if (ctx.copyRefusal !== null)
|
|
448
|
+
return refusedCopy(ctx, ctx.copyRefusal);
|
|
449
|
+
for (const text of sourceMovedLines(report, { mode: ctx.mode, root: ctx.installRoot }))
|
|
450
|
+
line(ctx, text);
|
|
451
|
+
const result = await installAfterQuestion(ctx, copyQuestion('update', tilde(report.dir, ctx.home)), (opts) => installHookCopy(opts), written.every((one) => one.state === 'match'));
|
|
452
|
+
if (result === null) {
|
|
453
|
+
if (ctx.ask === null) {
|
|
454
|
+
line(ctx, 'without a terminal setup does not update the copy');
|
|
455
|
+
return { state: 'problem', summary: COPY_OUT_OF_DATE };
|
|
456
|
+
}
|
|
457
|
+
line(ctx, 'copy not updated');
|
|
458
|
+
// The user said no: `!` like a declined install, with the command that offers it again.
|
|
459
|
+
return { state: 'missing', summary: COPY_OUT_OF_DATE, ...declined(ctx) };
|
|
460
|
+
}
|
|
461
|
+
if (!result.ok) {
|
|
462
|
+
line(ctx, `refused: ${result.reason}`);
|
|
463
|
+
// An installer that fails after writing code files (the manifest) still changed the copy.
|
|
464
|
+
const after = hookCopyReport(ctx.home, ctx.installRoot);
|
|
465
|
+
const now = [...after.files, ...statuslineCopyReport(ctx.home, ctx.installRoot).files];
|
|
466
|
+
const wrote = now.some((one) => written.some((before) => before.name === one.name && before.copySha !== one.copySha));
|
|
467
|
+
return { state: 'problem', summary: `hook copy: ${result.reason}`, ...wrote ? { changed: true } : {} };
|
|
468
|
+
}
|
|
469
|
+
line(ctx, `copy updated (${hookOriginText(result)})`);
|
|
470
|
+
for (const name of result.removed)
|
|
471
|
+
line(ctx, `${name}: removed (file from a previous install)`);
|
|
472
|
+
for (const warning of result.warnings)
|
|
473
|
+
line(ctx, `WARNING: ${warning}`);
|
|
474
|
+
return { state: 'ok', summary: '', result: 'updated to this version' };
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* The service starts another installation (or its target is unreadable), so the copy is not written: one sentence and
|
|
478
|
+
* the fix on the screen, the whole refusal in the run log.
|
|
479
|
+
*/
|
|
480
|
+
function refusedCopy(ctx, refusal) {
|
|
481
|
+
line(ctx, `refused: ${refusal.text}`);
|
|
482
|
+
return { state: 'problem', summary: `hook copy: ${refusal.text}`, result: refusal.result, fix: refusal.fix };
|
|
483
|
+
}
|
|
484
|
+
/** A hook copy the user said no to: `declined`, with the command that offers it again ({@link declinedStep}). */
|
|
485
|
+
function declined(ctx) {
|
|
486
|
+
return declinedStep(repairCommands(ctx.mode, ctx.installRoot).hooksInstall);
|
|
487
|
+
}
|
|
488
|
+
async function stepHook(ctx) {
|
|
489
|
+
const title = 'hook copy';
|
|
490
|
+
const report = hookCopyReport(ctx.home, ctx.installRoot);
|
|
491
|
+
let copyState = 'ok';
|
|
492
|
+
let copySummary = '';
|
|
493
|
+
/** What the step did, for its screen line; `undefined` = the summary. */
|
|
494
|
+
let shown;
|
|
495
|
+
/** The command after a declined question. */
|
|
496
|
+
let fix;
|
|
497
|
+
if (report.ok) {
|
|
498
|
+
line(ctx, `hook copy: ${report.dir} matches the repo`);
|
|
499
|
+
}
|
|
500
|
+
else if (copyDirEmpty(ctx.home)) {
|
|
501
|
+
line(ctx, `no hook copy in ${report.dir}`);
|
|
502
|
+
copyState = 'missing';
|
|
503
|
+
copySummary = 'hook copy: rarog hooks install';
|
|
504
|
+
// The clone's copy is a plan item; the package's copy asks after its review. A service of another
|
|
505
|
+
// installation refuses here without a question.
|
|
506
|
+
const question = ctx.mode === 'package'
|
|
507
|
+
? copyQuestion('install', tilde(report.dir, ctx.home)) : null;
|
|
508
|
+
const result = question !== null || ctx.accepted.has('hook') || ctx.copyRefusal !== null
|
|
509
|
+
? await installAfterQuestion(ctx, question, (opts) => installMissingHookCopy(opts)) : null;
|
|
510
|
+
if (result?.ok === true) {
|
|
511
|
+
line(ctx, `copy written (${hookOriginText(result)})`);
|
|
512
|
+
for (const warning of result.warnings)
|
|
513
|
+
line(ctx, `WARNING: ${warning}`);
|
|
514
|
+
copyState = 'ok';
|
|
515
|
+
copySummary = '';
|
|
516
|
+
shown = 'installed';
|
|
517
|
+
}
|
|
518
|
+
else if (result === null && question !== null && ctx.ask !== null) {
|
|
519
|
+
({ result: shown, fix } = declined(ctx));
|
|
520
|
+
}
|
|
521
|
+
else if (result !== null && !result.ok && ctx.copyRefusal !== null) {
|
|
522
|
+
({ state: copyState, summary: copySummary, result: shown, fix } = refusedCopy(ctx, ctx.copyRefusal));
|
|
523
|
+
}
|
|
524
|
+
else if (result !== null && !result.ok) {
|
|
525
|
+
line(ctx, `refused: ${result.reason}`);
|
|
526
|
+
copyState = 'problem';
|
|
527
|
+
copySummary = `hook copy: ${result.reason}`;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
const update = await updateCopy(ctx, report);
|
|
532
|
+
copyState = update.state;
|
|
533
|
+
copySummary = update.summary;
|
|
534
|
+
shown = update.result;
|
|
535
|
+
fix = update.fix;
|
|
536
|
+
}
|
|
537
|
+
return {
|
|
538
|
+
title, state: copyState, summary: copyState === 'ok' ? 'hook copy: matches the source' : copySummary,
|
|
539
|
+
...shown === undefined ? {} : { result: shown }, ...fix === undefined ? {} : { fix },
|
|
540
|
+
changed: copyState === 'ok' && shown !== undefined,
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
// ---------------------------------------------------------------------------
|
|
544
|
+
// Krok 6: ustawienia Claude Code (`setup-settings.ts`)
|
|
545
|
+
// ---------------------------------------------------------------------------
|
|
546
|
+
/**
|
|
547
|
+
* Brakujący skrypt `statusLine` w zgodnej kopii hooka (kopia sprzed skryptu) po pytaniu, zanim pisarz wpisze komendę,
|
|
548
|
+
* która go wskazuje. Only when the `statusLine` operation waits for that copy (`statusLineWaitsForScript`): a custom
|
|
549
|
+
* command that writes its own snapshots stays, so the script is not offered and nothing is asked on every run.
|
|
550
|
+
* `true` = skrypt zapisany.
|
|
551
|
+
*/
|
|
552
|
+
async function offerStatuslineCopy(ctx) {
|
|
553
|
+
if (!statusLineWaitsForScript(ctx))
|
|
554
|
+
return false;
|
|
555
|
+
const copy = statuslineCopyReport(ctx.home, ctx.installRoot);
|
|
556
|
+
const scriptState = copy.files[0]?.state ?? 'missing';
|
|
557
|
+
if (scriptState === 'missing' && copy.dirKind !== 'symlink' && copy.dirKind !== 'other'
|
|
558
|
+
&& hookCopyReport(ctx.home, ctx.installRoot).ok) {
|
|
559
|
+
const result = await installAfterQuestion(ctx, copyQuestion('statusLine', tilde(copy.dir, ctx.home)), (opts) => installStatuslineCopy(opts));
|
|
560
|
+
if (result !== null)
|
|
561
|
+
line(ctx, result.ok ? 'script copy written' : `refused: ${result.reason}`);
|
|
562
|
+
return result?.ok === true;
|
|
563
|
+
}
|
|
564
|
+
if (scriptState !== 'match' && scriptState !== 'missing') {
|
|
565
|
+
line(ctx, 'script copy differs from the repo — review rarog hooks doctor, then rarog hooks install');
|
|
566
|
+
}
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
/** The settings step, after the statusLine script copy it points at. */
|
|
570
|
+
async function stepSettings(ctx) {
|
|
571
|
+
const wrote = await offerStatuslineCopy(ctx);
|
|
572
|
+
const step = await stepClaudeSettings(ctx);
|
|
573
|
+
// The script copy written before the settings question is a change of this step, whatever the answer.
|
|
574
|
+
return wrote ? { ...step, changed: true } : step;
|
|
575
|
+
}
|
|
576
|
+
/** Start of every summary of the settings step. */
|
|
577
|
+
const SETTINGS_PREFIX = 'Settings: ';
|
|
578
|
+
/** Fix of a hook copy the update could not finish. */
|
|
579
|
+
const COPY_FIX = 'rarog hooks doctor, then rarog hooks install';
|
|
580
|
+
/**
|
|
581
|
+
* The settings step of `rarog update --finish`: a new version can change only the statusLine script, so a script copy
|
|
582
|
+
* that the settings run and that differs from this installation, next to hook files that match, goes through
|
|
583
|
+
* {@link updateCopy} first (the installer's diff and question; no question for a copy changed after the
|
|
584
|
+
* install). "n" or a refusal leaves the copy, and the settings step reports the script out of date. An installer that
|
|
585
|
+
* fails after writing the code files (the manifest) leaves a script the settings check sees as current, so its
|
|
586
|
+
* problem stays on the step with its fix and the step fails.
|
|
587
|
+
*/
|
|
588
|
+
async function stepFinishSettings(ctx) {
|
|
589
|
+
const report = hookCopyReport(ctx.home, ctx.installRoot);
|
|
590
|
+
const copy = report.ok && statusLineScriptOutOfDate(ctx) ? await updateCopy(ctx, report) : null;
|
|
591
|
+
const settings = await stepSettings(ctx);
|
|
592
|
+
if (copy?.state === 'ok' && (settings.state === 'ok' || settings.state === 'info')) {
|
|
593
|
+
// The script this run wrote is a change of this step: its own line, not the folded checks.
|
|
594
|
+
const own = settings.changed === true && settings.result !== undefined ? `${settings.result}; ` : '';
|
|
595
|
+
return { ...settings, result: `${own}status line script updated`, changed: true };
|
|
596
|
+
}
|
|
597
|
+
if (copy?.state !== 'problem')
|
|
598
|
+
return settings;
|
|
599
|
+
const failed = settings.state === 'problem' || settings.state === 'missing';
|
|
600
|
+
// The settings step already reports a script still out of date, with the same fix.
|
|
601
|
+
if (failed && statusLineScriptOutOfDate(ctx))
|
|
602
|
+
return settings;
|
|
603
|
+
const own = settings.summary.startsWith(SETTINGS_PREFIX)
|
|
604
|
+
? settings.summary.slice(SETTINGS_PREFIX.length) : settings.summary;
|
|
605
|
+
return {
|
|
606
|
+
title: settings.title, state: 'problem',
|
|
607
|
+
summary: `${SETTINGS_PREFIX}${own}; ${copy.summary}`,
|
|
608
|
+
result: `${settings.result ?? own}; ${copy.summary}`,
|
|
609
|
+
fix: [...new Set([...settings.fix === undefined ? [] : [settings.fix], COPY_FIX])].join('; '),
|
|
610
|
+
...settings.changed === true || copy.changed === true ? { changed: true } : {},
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
// ---------------------------------------------------------------------------
|
|
614
|
+
// Krok 10: SDK Claude (paczka npm)
|
|
615
|
+
// ---------------------------------------------------------------------------
|
|
616
|
+
/** `rarog setup` of this installation, with the `--data-dir` given to this run. */
|
|
617
|
+
function setupAgain(ctx) {
|
|
618
|
+
return rarogCli(ctx.dataDirFlag === null ? 'setup' : `setup --data-dir ${shellQuote(ctx.dataDirFlag)}`, ctx.mode);
|
|
619
|
+
}
|
|
620
|
+
/** Rozmiar w MB z jednym miejscem po kropce dziesiętnej. */
|
|
621
|
+
function megabytes(bytes) {
|
|
622
|
+
return `${(bytes / 1_000_000).toFixed(1)} MB`;
|
|
623
|
+
}
|
|
624
|
+
/** Wiek w minutach, godzinach albo dniach. */
|
|
625
|
+
function age(ms) {
|
|
626
|
+
const minutes = Math.floor(ms / 60_000);
|
|
627
|
+
if (minutes < 120)
|
|
628
|
+
return `${String(minutes)} min`;
|
|
629
|
+
const hours = Math.floor(minutes / 60);
|
|
630
|
+
return hours < 48 ? `${String(hours)} h` : `${String(Math.floor(hours / 24))} days`;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* SDK Claude listy sesji (`install/sdk.ts`): w klonie repo z workspace (pnpm), w paczce npm z
|
|
634
|
+
* `<katalog danych usługi>/sdk/<wersja>/`. Brak (ENOENT) = pytanie i pobranie; katalog jest = sonda w osobnym
|
|
635
|
+
* procesie ze środowiskiem usługi. Katalogu istniejącego setup nie zmienia ani nie kasuje.
|
|
636
|
+
*/
|
|
637
|
+
async function stepSdk(ctx) {
|
|
638
|
+
const title = 'Claude SDK';
|
|
639
|
+
if (ctx.mode === 'clone') {
|
|
640
|
+
line(ctx, `${SDK_PACKAGE} from the repo workspace (${REPAIR.dependencies})`);
|
|
641
|
+
ctx.sdkReady = true;
|
|
642
|
+
return { title, state: 'info', summary: 'SDK: from the workspace' };
|
|
643
|
+
}
|
|
644
|
+
if (!ctx.dataDir.ok) {
|
|
645
|
+
line(ctx, ctx.dataDir.message);
|
|
646
|
+
return {
|
|
647
|
+
title, state: 'problem', summary: 'SDK: data directory undetermined (message above)',
|
|
648
|
+
result: `data directory undetermined: ${ctx.dataDir.message}`,
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
const pin = readSdkPin();
|
|
652
|
+
const dataDir = ctx.dataDir.dir;
|
|
653
|
+
const dir = sdkVersionDir(dataDir, pin.version);
|
|
654
|
+
const again = setupAgain(ctx);
|
|
655
|
+
const probe = ctx.deps.sdkProbe ?? ((versionDir, version) => probeSdkDir(versionDir, version, ctx.serviceEnv));
|
|
656
|
+
const state = entry(dir);
|
|
657
|
+
if (state === 'present') {
|
|
658
|
+
const issue = sdkDirIssue(sdkRoot(dataDir)) ?? sdkDirIssue(dir);
|
|
659
|
+
if (issue !== null) {
|
|
660
|
+
line(ctx, issue);
|
|
661
|
+
return { title, state: 'problem', summary: `SDK: ${issue}` };
|
|
662
|
+
}
|
|
663
|
+
if (entry(path.join(dir, 'node_modules', ...SDK_PACKAGE.split('/'), 'package.json')) !== 'present') {
|
|
664
|
+
line(ctx, `${dir} is present, but has no ${SDK_PACKAGE} package.json — setup does not change it; check what it`
|
|
665
|
+
+ ' contains');
|
|
666
|
+
return { title, state: 'problem', summary: `SDK: ${dir} has no package.json for the package` };
|
|
667
|
+
}
|
|
668
|
+
const probed = await probe(dir, pin.version);
|
|
669
|
+
if (!probed.ok) {
|
|
670
|
+
line(ctx, `${dir}: ${probed.reason}`);
|
|
671
|
+
return {
|
|
672
|
+
title, state: 'problem', summary: `SDK ${pin.version}: probe failed (message above)`,
|
|
673
|
+
result: `${pin.version}: probe failed: ${probed.reason}`,
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
line(ctx, `${SDK_PACKAGE} ${pin.version}: ${dir}`);
|
|
677
|
+
ctx.sdkReady = true;
|
|
678
|
+
return { title, state: 'ok', summary: `SDK: ${pin.version}` };
|
|
679
|
+
}
|
|
680
|
+
if (typeof state !== 'string') {
|
|
681
|
+
line(ctx, `${dir}: unreadable (${state.code})`);
|
|
682
|
+
return { title, state: 'problem', summary: `SDK: ${dir} unreadable (${state.code})` };
|
|
683
|
+
}
|
|
684
|
+
line(ctx, `${dir}: missing`);
|
|
685
|
+
for (const temp of sdkTempDirs(dataDir)) {
|
|
686
|
+
line(ctx, `work directory of another or interrupted download: ${temp.dir} (${age(temp.ageMs)}, ${megabytes(temp.bytes)})`);
|
|
687
|
+
}
|
|
688
|
+
const missing = {
|
|
689
|
+
title, state: 'missing', summary: `SDK: ${again} in a terminal downloads ${SDK_PACKAGE} ${pin.version}`,
|
|
690
|
+
};
|
|
691
|
+
// The plan screen named the package, its size and Anthropic's terms (`sdkPlanEntry`).
|
|
692
|
+
if (!ctx.accepted.has('sdk'))
|
|
693
|
+
return missing;
|
|
694
|
+
ctx.view.screen.progress('downloading…');
|
|
695
|
+
const result = await (ctx.deps.sdkInstall ?? installSdk)({ dataDir, env: ctx.io.env, probe, pin, trackChild });
|
|
696
|
+
if (!result.ok && result.interrupted === true)
|
|
697
|
+
throw new SetupInterrupted(result.reason);
|
|
698
|
+
if (!result.ok) {
|
|
699
|
+
line(ctx, `download failed: ${result.reason}`);
|
|
700
|
+
if (result.noNpm === true) {
|
|
701
|
+
// A node without npm next to it (`pnpm env use`) fails the same way again; the network has nothing to do with it.
|
|
702
|
+
line(ctx, 'The sessions list in the app stays empty until the SDK is downloaded; setup downloads it with the npm'
|
|
703
|
+
+ ' that comes with Node.');
|
|
704
|
+
return {
|
|
705
|
+
title, state: 'problem', summary: `SDK: download failed (${result.reason})`, result: 'no npm next to node',
|
|
706
|
+
fix: `install Node with npm (nodejs.org or nvm), then ${again}`,
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
line(ctx, `The sessions list in the app stays empty until the SDK is downloaded; once online, run ${again}.`);
|
|
710
|
+
// One sentence on the screen: npm's error code; the rest of its message stays in the run log.
|
|
711
|
+
const code = /\b(E[A-Z0-9]{3,})\b/u.exec(result.reason)?.[1];
|
|
712
|
+
return {
|
|
713
|
+
title, state: 'problem', summary: `SDK: download failed (${result.reason})`,
|
|
714
|
+
result: code === undefined ? 'download failed' : `download failed (${code})`, fix: `check the network, then ${again}`,
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
line(ctx, result.raced ? `another rarog setup downloaded ${pin.version} first: ${result.dir}`
|
|
718
|
+
: `downloaded: ${result.dir}`);
|
|
719
|
+
ctx.sdkReady = true;
|
|
720
|
+
return { title, state: 'ok', summary: `SDK: ${pin.version} downloaded`, changed: !result.raced };
|
|
721
|
+
}
|
|
722
|
+
// ---------------------------------------------------------------------------
|
|
723
|
+
// Krok 11: usługa
|
|
724
|
+
// ---------------------------------------------------------------------------
|
|
725
|
+
/** `/health` of the running service: healthy or why not, and the version it reports (`undefined` = none read). */
|
|
726
|
+
async function healthOf(port) {
|
|
727
|
+
try {
|
|
728
|
+
const response = await fetch(`http://127.0.0.1:${String(port)}/health`, {
|
|
729
|
+
signal: AbortSignal.timeout(HEALTH_TIMEOUT_MS),
|
|
730
|
+
});
|
|
731
|
+
if (!response.ok)
|
|
732
|
+
return { ok: false, text: `HTTP ${String(response.status)}` };
|
|
733
|
+
const body = await response.json();
|
|
734
|
+
if (!isRecord(body))
|
|
735
|
+
return { ok: false, text: 'the response is not a JSON object' };
|
|
736
|
+
const version = typeof body['version'] === 'string' ? { version: body['version'] } : {};
|
|
737
|
+
return body['herdr'] === true
|
|
738
|
+
? { ok: true, text: 'healthy', ...version } : { ok: false, text: HERDR_DOWN, ...version };
|
|
739
|
+
}
|
|
740
|
+
catch (failure) {
|
|
741
|
+
const cause = isRecord(failure) ? failure['cause'] : undefined;
|
|
742
|
+
return { ok: false, text: `not responding (${errnoCode(cause ?? failure)})` };
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Dowiązanie `~/.local/bin/rarog` do innego checkoutu albo nieczytelne: `service install` klonu przestawiłby je na
|
|
747
|
+
* swoim końcu, a setup niczego istniejącego nie zmienia. `null` = brak dowiązania, nasze, nie-dowiązanie (to
|
|
748
|
+
* `service install` zostawia) albo paczka npm: jej `service install` dowiązania nie zakłada ani nie rusza, a
|
|
749
|
+
* dowiązanie, które przesłania paczkę w `PATH`, pokazuje `rarog doctor`.
|
|
750
|
+
*/
|
|
751
|
+
function foreignRarogLink(home, mode) {
|
|
752
|
+
if (mode === 'package')
|
|
753
|
+
return null;
|
|
754
|
+
const link = rarogLinkPath(home);
|
|
755
|
+
try {
|
|
756
|
+
if (!lstatSync(link).isSymbolicLink())
|
|
757
|
+
return null;
|
|
758
|
+
const target = readlinkSync(link);
|
|
759
|
+
if (target === RAROG_BIN)
|
|
760
|
+
return null;
|
|
761
|
+
return `${link} points to ${target}, but the service would set it to ${RAROG_BIN}; setup does not change it —`
|
|
762
|
+
+ ' repoint or remove it yourself, then rarog setup';
|
|
763
|
+
}
|
|
764
|
+
catch (failure) {
|
|
765
|
+
const code = errnoCode(failure);
|
|
766
|
+
return code === 'ENOENT' ? null : `${link}: unreadable (${code}); check it, then rarog setup`;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
/** Ślad usługi na tej platformie ({@link ServiceTrace}). */
|
|
770
|
+
function serviceTrace(ctx) {
|
|
771
|
+
if (ctx.platform === 'linux') {
|
|
772
|
+
const file = unitFilePath(ctx.home);
|
|
773
|
+
const fileState = entry(file);
|
|
774
|
+
const shown = showUnit(ctx.io, ['LoadState']);
|
|
775
|
+
if ('failure' in shown)
|
|
776
|
+
return { kind: 'unknown', detail: shown.failure };
|
|
777
|
+
const load = shown.values.get('LoadState') ?? '';
|
|
778
|
+
if (fileState === 'missing' && load === 'not-found')
|
|
779
|
+
return { kind: 'absent' };
|
|
780
|
+
return {
|
|
781
|
+
kind: 'present', loaded: load === 'loaded',
|
|
782
|
+
detail: `${file}: ${fileState === 'missing' ? 'missing' : 'present'}, LoadState=${load}`,
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
const plist = entry(servicePlistPath(ctx.home));
|
|
786
|
+
const loaded = loadState(SERVICE_LABEL, ctx.io, ctx.platform);
|
|
787
|
+
if (typeof loaded !== 'string')
|
|
788
|
+
return { kind: 'unknown', detail: `launchctl print ${SERVICE_LABEL}: ${loaded.unknown}` };
|
|
789
|
+
if (plist === 'missing' && loaded === 'absent')
|
|
790
|
+
return { kind: 'absent' };
|
|
791
|
+
return {
|
|
792
|
+
kind: 'present', loaded: loaded === 'loaded',
|
|
793
|
+
detail: `plist ${SERVICE_LABEL}: ${plist === 'missing' ? 'missing' : 'present'}, ${SERVICE_LABEL}: ${loaded}`,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* The herdr step of the platform: the herdr agent on macOS, the herdr unit on Linux. A herdr step with a fix, written
|
|
798
|
+
* in this run or found as it is, carries the one fix; the Service step waits for it while herdr is down.
|
|
799
|
+
*/
|
|
800
|
+
async function stepHerdr(ctx) {
|
|
801
|
+
const step = ctx.platform === 'darwin' ? await stepHerdrAgent(ctx) : await stepHerdrUnit(ctx);
|
|
802
|
+
if (step?.fix !== undefined) {
|
|
803
|
+
ctx.herdrWaits = ctx.platform === 'darwin' ? HERDR_AGENT_TITLE : HERDR_UNIT_TITLE;
|
|
804
|
+
}
|
|
805
|
+
return step;
|
|
806
|
+
}
|
|
807
|
+
async function stepService(ctx) {
|
|
808
|
+
const title = 'service';
|
|
809
|
+
const trace = serviceTrace(ctx);
|
|
810
|
+
if (trace.kind === 'unknown') {
|
|
811
|
+
ctx.service = 'other';
|
|
812
|
+
line(ctx, `service state undetermined (${trace.detail}) — installing nothing`);
|
|
813
|
+
const summary = `service: ${trace.detail}`;
|
|
814
|
+
if (ctx.serviceWaits !== null) {
|
|
815
|
+
ctx.checkWaits = ctx.serviceWaits;
|
|
816
|
+
return waitingStep(title, 'problem', summary, ctx.serviceWaits);
|
|
817
|
+
}
|
|
818
|
+
// One sentence and a fix; the tool's own message stays in the detail line above (the run log).
|
|
819
|
+
return {
|
|
820
|
+
title, state: 'problem', summary, result: SERVICE_UNDETERMINED,
|
|
821
|
+
fix: serviceStateFix(ctx.platform, setupAgain(ctx)),
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
const port = ctx.deps.checkPort ?? configPort(ctx);
|
|
825
|
+
if (trace.kind === 'present') {
|
|
826
|
+
line(ctx, trace.detail);
|
|
827
|
+
ctx.service = trace.loaded ? 'running' : 'other';
|
|
828
|
+
const install = rarogCli('service install', ctx.mode);
|
|
829
|
+
if (!trace.loaded) {
|
|
830
|
+
return {
|
|
831
|
+
title, state: 'problem',
|
|
832
|
+
summary: `service: a trace is present, but our service is not loaded — run ${install} by hand`,
|
|
833
|
+
result: 'installed, but not loaded', fix: install,
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
let health = await healthOf(port);
|
|
837
|
+
line(ctx, `/health 127.0.0.1:${String(port)}: ${health.text}`);
|
|
838
|
+
if (health.text === HERDR_DOWN && await accepts({ path: herdrSocket(ctx) })) {
|
|
839
|
+
// /health keeps its herdr ping for HEALTH_PROBE_TTL_MS: a herdr started moments ago (the herdr agent step of this
|
|
840
|
+
// run) can still read false there. One more read past that window before judging the service.
|
|
841
|
+
await new Promise((resolve) => { setTimeout(resolve, HEALTH_PROBE_TTL_MS + 500); });
|
|
842
|
+
health = await healthOf(port);
|
|
843
|
+
line(ctx, `/health again after the herdr ping window: ${health.text}`);
|
|
844
|
+
}
|
|
845
|
+
if (health.ok)
|
|
846
|
+
return { title, state: 'ok', summary: 'service: running' };
|
|
847
|
+
// The fix stands on this line; the closing Check waits for this step instead of repeating it.
|
|
848
|
+
ctx.service = 'other';
|
|
849
|
+
// `rarog restart` restarts only this installation's service: a service that starts another installation (its
|
|
850
|
+
// target, or the version its /health reports) gets the command that points it here (`afterUpdate`).
|
|
851
|
+
const commands = repairCommands(ctx.mode, ctx.installRoot);
|
|
852
|
+
const other = ctx.copyRefusal !== null || (health.version !== undefined && health.version !== packageVersion());
|
|
853
|
+
// herdr: false with herdr's socket silent: the server reconnects to herdr by itself once herdr runs, and a
|
|
854
|
+
// restart does not start herdr. herdr 0.9.5 has no service of its own; on Linux setup knows `herdr.service`, on
|
|
855
|
+
// macOS a loaded herdr agent.
|
|
856
|
+
// A socket that answers means the server does not see this herdr (a socket path changed after its start, or
|
|
857
|
+
// its herdr runtime failed to load): the restart reloads both.
|
|
858
|
+
const socket = herdrSocket(ctx);
|
|
859
|
+
const herdrDown = !other && health.text === HERDR_DOWN && !await accepts({ path: socket });
|
|
860
|
+
const herdrStart = herdrAgentStart(ctx.io, ctx.home, ctx.platform)
|
|
861
|
+
?? (ctx.platform === 'linux' && entry(path.join(userUnitDir(ctx.home), HERDR_UNIT_NAME)) === 'present'
|
|
862
|
+
? `systemctl --user start ${HERDR_UNIT_NAME}` : 'run herdr in a terminal');
|
|
863
|
+
const fix = other ? commands.afterUpdate : herdrDown ? `${herdrStart}, then ${setupAgain(ctx)}` : commands.restart;
|
|
864
|
+
if (other)
|
|
865
|
+
line(ctx, `the service runs ${health.version ?? 'another installation'}, not this installation`);
|
|
866
|
+
if (herdrDown)
|
|
867
|
+
line(ctx, 'the service runs, herdr does not; it reconnects once herdr starts, without a restart');
|
|
868
|
+
else if (!other && health.text === HERDR_DOWN) {
|
|
869
|
+
line(ctx, `herdr answers on ${socket}, but the service does not reach it; a restart reloads its configuration`);
|
|
870
|
+
}
|
|
871
|
+
if (herdrDown && ctx.herdrWaits !== null) {
|
|
872
|
+
ctx.checkWaits = ctx.herdrWaits;
|
|
873
|
+
return waitingStep(title, 'problem', `service unhealthy (${health.text}): ${fix}`, ctx.herdrWaits);
|
|
874
|
+
}
|
|
875
|
+
return {
|
|
876
|
+
title, state: 'problem', summary: `service unhealthy (${health.text}): ${fix}`, result: health.text, fix,
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
line(ctx, 'no service');
|
|
880
|
+
const missing = { title, state: 'missing', summary: `service: ${rarogCli('service install', ctx.mode)}` };
|
|
881
|
+
// A service that waits for an earlier step names it, without a command: that step carries the fix.
|
|
882
|
+
const waits = (on) => {
|
|
883
|
+
ctx.checkWaits = on;
|
|
884
|
+
return waitingStep(title, 'missing', missing.summary, on);
|
|
885
|
+
};
|
|
886
|
+
if (ctx.config === null) {
|
|
887
|
+
line(ctx, 'config.json and a valid secrets file first (steps above)');
|
|
888
|
+
return waits(ctx.configWaits ?? SCREEN_TITLE.config);
|
|
889
|
+
}
|
|
890
|
+
if (!ctx.secretsOk) {
|
|
891
|
+
line(ctx, 'config.json and a valid secrets file first (steps above)');
|
|
892
|
+
return waits(SCREEN_TITLE.secrets);
|
|
893
|
+
}
|
|
894
|
+
if (!ctx.sdkReady) {
|
|
895
|
+
line(ctx, 'the Claude SDK first (step above): without it rarog serve --check refuses');
|
|
896
|
+
return waits(SCREEN_TITLE.sdk);
|
|
897
|
+
}
|
|
898
|
+
const socket = herdrSocket(ctx);
|
|
899
|
+
if (!await accepts({ path: socket })) {
|
|
900
|
+
line(ctx, `herdr is not running (socket ${socket} does not respond). Start herdr and run rarog setup again.`);
|
|
901
|
+
if (ctx.herdrWaits !== null)
|
|
902
|
+
return waits(ctx.herdrWaits);
|
|
903
|
+
// The socket stays in the detail line above (the run log); the screen says what to do.
|
|
904
|
+
return {
|
|
905
|
+
title, state: 'missing', summary: `service: herdr first (socket ${socket}), then rarog setup`,
|
|
906
|
+
result: 'herdr is not running', fix: `start herdr, then ${setupAgain(ctx)}`,
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
const link = foreignRarogLink(ctx.home, ctx.mode);
|
|
910
|
+
if (link !== null) {
|
|
911
|
+
line(ctx, link);
|
|
912
|
+
return { title, state: 'problem', summary: `service: ${link}` };
|
|
913
|
+
}
|
|
914
|
+
if (!ctx.accepted.has('service'))
|
|
915
|
+
return missing;
|
|
916
|
+
const what = ctx.platform === 'linux' ? `the systemd --user unit ${UNIT_NAME}` : `the launchd service ${SERVICE_LABEL}`;
|
|
917
|
+
line(ctx, `installing ${what} (rarog service install)`);
|
|
918
|
+
// Pod blokadą instalatora jeszcze raz: usługa albo dowiązanie mogły powstać w trakcie pytania.
|
|
919
|
+
const precheck = () => {
|
|
920
|
+
const again = serviceTrace(ctx);
|
|
921
|
+
if (again.kind === 'present')
|
|
922
|
+
return `the service appeared during the question (${again.detail}) — changing nothing`;
|
|
923
|
+
if (again.kind === 'unknown')
|
|
924
|
+
return `service state undetermined (${again.detail}) — changing nothing`;
|
|
925
|
+
return foreignRarogLink(ctx.home, ctx.mode);
|
|
926
|
+
};
|
|
927
|
+
// Its own lines and those of restart.sh are details: the run log, and the screen with --verbose.
|
|
928
|
+
const code = await ctx.deps.serviceInstall(ctx.view.detailIo(), precheck, (text) => { ctx.view.detail(text); });
|
|
929
|
+
if (code === EXIT_INTERRUPTED)
|
|
930
|
+
throw new SetupInterrupted('rarog service install was interrupted (Ctrl-C)');
|
|
931
|
+
ctx.service = code === EXIT_OK ? 'running' : 'other';
|
|
932
|
+
return code === EXIT_OK
|
|
933
|
+
? { title, state: 'ok', summary: 'service: installed', changed: true }
|
|
934
|
+
: {
|
|
935
|
+
title, state: 'problem', summary: `service: rarog service install, code ${String(code)} (message above)`,
|
|
936
|
+
result: `rarog service install failed (code ${String(code)})`, fix: 'rarog service install',
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
// ---------------------------------------------------------------------------
|
|
940
|
+
// Komenda
|
|
941
|
+
// ---------------------------------------------------------------------------
|
|
942
|
+
const MARK = {
|
|
943
|
+
ok: 'ok ', info: 'info ', warn: 'WARNING', missing: 'MISSING', problem: 'PROBLEM',
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* Zdanie o aktualizacji paczki npm: komenda menedżera, który ją położył, potem komenda, po której usługa startuje
|
|
947
|
+
* nową wersję (`afterUpdate` z `install/repair.ts`: restart pod npm, `rarog service install` pod pnpm). Klon repo
|
|
948
|
+
* aktualizuje się własną procedurą, więc `null`.
|
|
949
|
+
*/
|
|
950
|
+
export function updateSentence(mode, root) {
|
|
951
|
+
if (mode !== 'package')
|
|
952
|
+
return null;
|
|
953
|
+
const { update } = packageCommands(packageManagerOf(root), root);
|
|
954
|
+
return `To update Rarog: ${update}, then ${repairCommands(mode, root).afterUpdate}; to go back to an older version,`
|
|
955
|
+
+ ' run the same command with its number instead of latest.';
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Step titles on the screen (at most 14 characters) next to the headers `--verbose` keeps. The seventh step is the
|
|
959
|
+
* herdr unit on Linux and the herdr agent on macOS; elsewhere it has no line on the step screen.
|
|
960
|
+
*/
|
|
961
|
+
function stepTitles(platform) {
|
|
962
|
+
return [
|
|
963
|
+
['tools', SCREEN_TITLE.tools], ['config.json', SCREEN_TITLE.config], ['secrets file', SCREEN_TITLE.secrets],
|
|
964
|
+
['tailscale serve', 'Tailscale'], ['hook copy', 'Hook copy'], ['Settings', 'Settings'],
|
|
965
|
+
platform === 'darwin' ? ['herdr agent (macOS)', HERDR_AGENT_TITLE] : ['herdr.service (Linux)', HERDR_UNIT_TITLE],
|
|
966
|
+
['Claude SDK', SCREEN_TITLE.sdk], ['service', SCREEN_TITLE.service],
|
|
967
|
+
];
|
|
968
|
+
}
|
|
969
|
+
const HERDR_AGENT_TITLE = 'herdr agent';
|
|
970
|
+
const HERDR_UNIT_TITLE = 'herdr unit';
|
|
971
|
+
/** The step has a line on the step screen of `platform` (`--verbose` keeps every header). */
|
|
972
|
+
function onScreen(title, platform) {
|
|
973
|
+
return title !== HERDR_UNIT_TITLE || platform === 'linux';
|
|
974
|
+
}
|
|
975
|
+
/** Lines the step screen counts on `platform`: the steps it shows and the closing Check. */
|
|
976
|
+
function screenTotal(platform) {
|
|
977
|
+
return stepTitles(platform).filter(([, title]) => onScreen(title, platform)).length + 1;
|
|
978
|
+
}
|
|
979
|
+
/** Steps that wait on a child process or the network: their live line has a spinner. */
|
|
980
|
+
const ANIMATED = new Set(['Claude SDK', 'Service', HERDR_AGENT_TITLE]);
|
|
981
|
+
/**
|
|
982
|
+
* The herdr socket of an existing `config.json` for the plan screen, read before the Config step validates the file.
|
|
983
|
+
* A missing or unreadable file gives herdr's default, as the steps use without `config.json`.
|
|
984
|
+
*/
|
|
985
|
+
function planHerdrSocket(ctx) {
|
|
986
|
+
let config = null;
|
|
987
|
+
try {
|
|
988
|
+
config = readRarogConfig(ctx.io.env);
|
|
989
|
+
}
|
|
990
|
+
catch {
|
|
991
|
+
// The Config step reports the file; the plan reads it only for the socket.
|
|
992
|
+
}
|
|
993
|
+
return configuredHerdrSocket(config?.env[HERDR_SOCKET_ENV], ctx.home);
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* What the plan screen offers to create (`setup-plan.ts`), from a read of the disk without writes: a missing
|
|
997
|
+
* `config.json`, a missing hook copy this installation may write, the herdr agent (macOS) or unit (Linux) under the
|
|
998
|
+
* conditions its step writes it, the Claude SDK of the package, the service. In the order of the steps.
|
|
999
|
+
*/
|
|
1000
|
+
async function planEntries(ctx) {
|
|
1001
|
+
const entries = [];
|
|
1002
|
+
const short = (file) => (file.startsWith(`${ctx.home}/`) ? `~/${file.slice(ctx.home.length + 1)}`
|
|
1003
|
+
: file);
|
|
1004
|
+
const dir = rarogConfigDir(ctx.io.env);
|
|
1005
|
+
ctx.configDirAbsent = entry(dir) === 'missing';
|
|
1006
|
+
if (entry(path.join(dir, CONFIG_FILENAME)) === 'missing') {
|
|
1007
|
+
entries.push({
|
|
1008
|
+
item: 'config', what: ctx.tailscaleOnly === null ? 'config and server key' : TAILSCALE_ONLY_PLAN_ITEM,
|
|
1009
|
+
where: short(dir),
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
// In the package the copy keeps its own question after the review of the package files.
|
|
1013
|
+
if (ctx.mode !== 'package' && copyDirEmpty(ctx.home) && ctx.copyRefusal === null) {
|
|
1014
|
+
entries.push({ item: 'hook', what: 'permission hook copy', where: short(hookInstallDir(ctx.home)) });
|
|
1015
|
+
}
|
|
1016
|
+
const socket = planHerdrSocket(ctx);
|
|
1017
|
+
const herdr = ctx.platform === 'darwin' ? herdrAgentOffer(ctx, socket) : await herdrUnitOffer(ctx, socket);
|
|
1018
|
+
if (herdr !== null)
|
|
1019
|
+
entries.push(herdr);
|
|
1020
|
+
if (ctx.mode === 'package' && ctx.dataDir.ok) {
|
|
1021
|
+
const pin = readSdkPin();
|
|
1022
|
+
if (entry(sdkVersionDir(ctx.dataDir.dir, pin.version)) === 'missing') {
|
|
1023
|
+
entries.push(sdkPlanEntry(pin.version));
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
if (serviceTrace(ctx).kind === 'absent') {
|
|
1027
|
+
entries.push({
|
|
1028
|
+
item: 'service', what: 'background service', where: ctx.platform === 'linux' ? UNIT_NAME : SERVICE_LABEL,
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
return entries;
|
|
1032
|
+
}
|
|
1033
|
+
/** `rarog setup` — `argv` zaczyna się od `setup`; `deps` podają testy. */
|
|
1034
|
+
export async function setupCommand(argv, io, deps = DEFAULT_DEPS) {
|
|
1035
|
+
if (argv.includes('--help') || argv.includes('-h')) {
|
|
1036
|
+
out(io, usageFor(io, `Usage:\n${SETUP_USAGE}`));
|
|
1037
|
+
return EXIT_OK;
|
|
1038
|
+
}
|
|
1039
|
+
const flags = parseFlags(argv);
|
|
1040
|
+
const platform = platformOf(io);
|
|
1041
|
+
if (platform !== 'darwin' && platform !== 'linux') {
|
|
1042
|
+
out(io, `rarog setup supports macOS and Linux (systemd --user); this platform is ${platform}.`);
|
|
1043
|
+
return EXIT_REFUSED;
|
|
1044
|
+
}
|
|
1045
|
+
const mode = deps.mode ?? INSTALL_MODE;
|
|
1046
|
+
const transient = transientInstall(mode, deps.installRoot ?? INSTALL_ROOT, io.env);
|
|
1047
|
+
if (transient !== null) {
|
|
1048
|
+
out(io, `rarog setup: started from ${transient}. The service would point to a directory that disappears when the`
|
|
1049
|
+
+ ` package manager cache is cleared. Install it permanently: ${PACKAGE_INSTALL.npm} (or ${PACKAGE_INSTALL.pnpm}),`
|
|
1050
|
+
+ ' then rarog setup.');
|
|
1051
|
+
return EXIT_REFUSED;
|
|
1052
|
+
}
|
|
1053
|
+
const startedAt = Date.now();
|
|
1054
|
+
const home = homeOf(io.env);
|
|
1055
|
+
const installRoot = deps.installRoot ?? INSTALL_ROOT;
|
|
1056
|
+
const { serviceEnv, dataDir } = runDataDir(io, platform, flags.dataDir);
|
|
1057
|
+
// The closing Check is one more step line (none with --verbose, which keeps the old output).
|
|
1058
|
+
const view = new SetupView({
|
|
1059
|
+
io, home, verbose: flags.verbose, dataDir, total: screenTotal(platform),
|
|
1060
|
+
cliTarget: setupCliTarget({ mode, installRoot, home, io }),
|
|
1061
|
+
});
|
|
1062
|
+
const ctx = {
|
|
1063
|
+
io: view.blockIo(), view, platform, home, ask: view.ask, deps,
|
|
1064
|
+
irohRelay: flags.irohRelay ?? DEFAULT_IROH_RELAY, irohRelayGiven: flags.irohRelay !== null,
|
|
1065
|
+
herdr: null, herdrIntegration: null, accepted: new Set(), declined: new Set(), configDirAbsent: false, claude: null,
|
|
1066
|
+
tailscale: false, iroh: { ready: false, text: 'not checked' }, tailscaleOnly: null, originFromTailscale: null,
|
|
1067
|
+
transportNote: null, tailscaleIps: [], tailscaleStatus: null,
|
|
1068
|
+
config: null, secretsOk: false,
|
|
1069
|
+
mode, installRoot, serviceEnv, dataDirFlag: flags.dataDir, sdkReady: false, service: 'skipped', dataDir,
|
|
1070
|
+
configCreated: false, irohKeyCreated: false, configWaits: null, checkWaits: null, serviceWaits: null,
|
|
1071
|
+
herdrWaits: null,
|
|
1072
|
+
// Przed pierwszym zapisem (krok config.json): kopię hooka obok usługi pisze tylko instalacja, którą ona startuje.
|
|
1073
|
+
copyRefusal: copyTargetRefusalOf(io, { mode, root: installRoot }), copyWithoutQuestion: false,
|
|
1074
|
+
};
|
|
1075
|
+
const stopWatching = view.watchInterrupt();
|
|
1076
|
+
try {
|
|
1077
|
+
// `--tailscale-only` with `--tailscale` is `--tailscale-only` alone: it never adds an address to a config.json.
|
|
1078
|
+
const address = flags.tailscale && !flags.tailscaleOnly ? tailscaleAddress(ctx, deps.configWrites) : null;
|
|
1079
|
+
return await runSteps(ctx, view, startedAt, address, flags.tailscaleOnly);
|
|
1080
|
+
}
|
|
1081
|
+
finally {
|
|
1082
|
+
stopWatching();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* The service environment and the data directory of a run: `--data-dir`, otherwise the directory of the installed
|
|
1087
|
+
* service's log, otherwise the rule on the service environment (`install/data-dir.ts`). Setup and `rarog update
|
|
1088
|
+
* --finish` alike.
|
|
1089
|
+
*/
|
|
1090
|
+
export function runDataDir(io, platform, flag) {
|
|
1091
|
+
const home = homeOf(io.env);
|
|
1092
|
+
const serviceEnv = serviceEnvOf(io, platform);
|
|
1093
|
+
return {
|
|
1094
|
+
serviceEnv,
|
|
1095
|
+
dataDir: installDataDir({
|
|
1096
|
+
home, shellEnv: io.env, serviceEnv, flag: flag ?? undefined,
|
|
1097
|
+
serviceDir: installedServiceDataDir(io, platform, home),
|
|
1098
|
+
}),
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
/** {@link FinishSteps} of `rarog update --finish` in `view`, for an existing `config.json`. */
|
|
1102
|
+
export function finishSteps(io, view, run, deps) {
|
|
1103
|
+
const mode = deps.mode ?? INSTALL_MODE;
|
|
1104
|
+
const installRoot = deps.installRoot ?? INSTALL_ROOT;
|
|
1105
|
+
const target = { mode, root: installRoot };
|
|
1106
|
+
const ctx = {
|
|
1107
|
+
io: view.blockIo(), view, platform: run.platform, home: homeOf(io.env), ask: view.ask, deps,
|
|
1108
|
+
irohRelay: DEFAULT_IROH_RELAY, irohRelayGiven: false, herdr: null, herdrIntegration: null,
|
|
1109
|
+
accepted: new Set(['sdk']), declined: new Set(), configDirAbsent: false, claude: null, tailscale: false,
|
|
1110
|
+
iroh: { ready: false, text: 'not checked' }, tailscaleOnly: null, originFromTailscale: null, transportNote: null,
|
|
1111
|
+
tailscaleIps: [], tailscaleStatus: null, config: run.config, secretsOk: true, mode, installRoot,
|
|
1112
|
+
serviceEnv: run.serviceEnv, dataDirFlag: run.dataDirFlag, sdkReady: false, service: 'skipped', dataDir: run.dataDir,
|
|
1113
|
+
configCreated: false, irohKeyCreated: false, configWaits: null, checkWaits: null, serviceWaits: null,
|
|
1114
|
+
herdrWaits: null,
|
|
1115
|
+
copyRefusal: copyTargetRefusalOf(io, target), copyWithoutQuestion: run.copyWithoutQuestion,
|
|
1116
|
+
};
|
|
1117
|
+
return {
|
|
1118
|
+
ctx,
|
|
1119
|
+
sdk: async () => stepSdk(ctx),
|
|
1120
|
+
hook: async () => stepHook(ctx),
|
|
1121
|
+
settings: async () => stepFinishSettings(ctx),
|
|
1122
|
+
service: () => serviceTrace(ctx),
|
|
1123
|
+
serviceMoved: () => { ctx.copyRefusal = copyTargetRefusalOf(io, target); },
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* The steps in order, the summary and the closing check (`setup-check.ts`) with the update sentence; `address` =
|
|
1128
|
+
* `--tailscale` (its plan item, step 4 and its notes), `tailscaleOnly` = `--tailscale-only`.
|
|
1129
|
+
*/
|
|
1130
|
+
async function runSteps(ctx, view, startedAt, address, tailscaleOnly) {
|
|
1131
|
+
view.header(ctx.ask === null
|
|
1132
|
+
? 'rarog setup without a terminal: checks only, no questions and no writes.'
|
|
1133
|
+
: 'rarog setup: creates only what is missing, after one Continue? for the plan; of what exists it changes only'
|
|
1134
|
+
+ ' a hook copy that differs from the source and the Rarog entries in ~/.claude/settings.json (one question,'
|
|
1135
|
+
+ ' then herdr\'s own entry through herdr\'s installer), and adds a missing iroh server key and the voice keys'
|
|
1136
|
+
+ ' to the secrets file after their questions; with --tailscale, the Tailscale address to a config.json without'
|
|
1137
|
+
+ ' one.');
|
|
1138
|
+
const tools = checkTools(ctx);
|
|
1139
|
+
const refused = refusalBeforePlan(ctx, tools);
|
|
1140
|
+
if (refused !== null)
|
|
1141
|
+
return refused;
|
|
1142
|
+
const only = await tailscaleOnlyBeforePlan(ctx, { flag: tailscaleOnly, relay: DEFAULT_IROH_RELAY });
|
|
1143
|
+
if (only !== null)
|
|
1144
|
+
return stopBeforePlan(ctx, only);
|
|
1145
|
+
const entries = [...address === null ? [] : await address.plan(), ...await planEntries(ctx)];
|
|
1146
|
+
if (!await confirmPlan(ctx, entries))
|
|
1147
|
+
return EXIT_REFUSED;
|
|
1148
|
+
const runners = [
|
|
1149
|
+
(c) => stepTools(c, tools), stepConfig, stepSecrets, address === null ? stepTailscale : async () => address.step(),
|
|
1150
|
+
stepHook, stepSettings, stepHerdr, stepSdk, stepService,
|
|
1151
|
+
];
|
|
1152
|
+
const titles = stepTitles(ctx.platform);
|
|
1153
|
+
const steps = [];
|
|
1154
|
+
// The step screen counts the closing Check too, and the log's headers use its total; --verbose keeps its own.
|
|
1155
|
+
const total = view.verbose ? runners.length : screenTotal(ctx.platform);
|
|
1156
|
+
let number = 0;
|
|
1157
|
+
try {
|
|
1158
|
+
for (const [index, run] of runners.entries()) {
|
|
1159
|
+
const [header, title] = titles[index] ?? ['', ''];
|
|
1160
|
+
if (!view.verbose && !onScreen(title, ctx.platform)) {
|
|
1161
|
+
// A step of another platform: one log line, no line on the step screen.
|
|
1162
|
+
view.detail(`${header}: not applicable on this platform`);
|
|
1163
|
+
continue;
|
|
1164
|
+
}
|
|
1165
|
+
number += 1;
|
|
1166
|
+
view.startStep(`[${String(number)}/${String(total)}] ${header}`, title, ANIMATED.has(title));
|
|
1167
|
+
const step = await run(ctx);
|
|
1168
|
+
view.endStep(step, ctx.home);
|
|
1169
|
+
if (step !== null)
|
|
1170
|
+
steps.push(step);
|
|
1171
|
+
// The steps after it that need config.json wait for the step that left the run without it.
|
|
1172
|
+
if (run === stepConfig && ctx.config === null)
|
|
1173
|
+
ctx.configWaits ??= SCREEN_TITLE.config;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
catch (failure) {
|
|
1177
|
+
if (!(failure instanceof SetupInterrupted))
|
|
1178
|
+
throw failure;
|
|
1179
|
+
return view.interrupted();
|
|
1180
|
+
}
|
|
1181
|
+
view.detail('');
|
|
1182
|
+
view.detail('Summary:');
|
|
1183
|
+
for (const step of steps)
|
|
1184
|
+
view.detail(` ${MARK[step.state]} ${step.summary}`);
|
|
1185
|
+
address?.notes();
|
|
1186
|
+
const problems = steps.some((step) => step.state === 'missing' || step.state === 'problem');
|
|
1187
|
+
const check = await closingCheck(ctx, {
|
|
1188
|
+
startedAt, service: ctx.service, update: updateSentence(ctx.mode, ctx.installRoot), stepsOk: !problems,
|
|
1189
|
+
});
|
|
1190
|
+
return problems || check !== EXIT_OK ? EXIT_REFUSED : EXIT_OK;
|
|
1191
|
+
}
|