@prismer/sdk 2.0.8 → 2.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/dist/chunk-R7POPVJR.mjs +35 -0
- package/dist/cli.js +59653 -8452
- package/dist/index.d.mts +716 -229
- package/dist/index.d.ts +716 -229
- package/dist/index.js +307 -23
- package/dist/index.mjs +306 -23
- package/dist/katex-OIP2Q473.mjs +14515 -0
- package/dist/pkf-schema.json +35 -0
- package/dist/pkf.d.mts +1 -0
- package/dist/pkf.d.ts +1 -0
- package/dist/pkf.js +48370 -0
- package/dist/pkf.mjs +33683 -0
- package/node_modules/@clack/core/CHANGELOG.md +249 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.cjs +15 -0
- package/node_modules/@clack/core/dist/index.cjs.map +1 -0
- package/node_modules/@clack/core/dist/index.d.cts +209 -0
- package/node_modules/@clack/core/dist/index.d.mts +209 -0
- package/node_modules/@clack/core/dist/index.d.ts +209 -0
- package/node_modules/@clack/core/dist/index.mjs +15 -0
- package/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/@clack/core/package.json +62 -0
- package/node_modules/@clack/prompts/CHANGELOG.md +374 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +191 -0
- package/node_modules/@clack/prompts/dist/index.cjs +80 -0
- package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
- package/node_modules/@clack/prompts/dist/index.d.cts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.ts +151 -0
- package/node_modules/@clack/prompts/dist/index.mjs +80 -0
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/@clack/prompts/package.json +61 -0
- package/node_modules/@iarna/toml/LICENSE +14 -0
- package/node_modules/@iarna/toml/README.md +301 -0
- package/node_modules/@iarna/toml/index.d.ts +57 -0
- package/node_modules/@iarna/toml/lib/create-date.js +23 -0
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
- package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
- package/node_modules/@iarna/toml/lib/create-time.js +22 -0
- package/node_modules/@iarna/toml/lib/format-num.js +6 -0
- package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
- package/node_modules/@iarna/toml/lib/parser.js +127 -0
- package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
- package/node_modules/@iarna/toml/package.json +82 -0
- package/node_modules/@iarna/toml/parse-async.js +30 -0
- package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
- package/node_modules/@iarna/toml/parse-stream.js +80 -0
- package/node_modules/@iarna/toml/parse-string.js +18 -0
- package/node_modules/@iarna/toml/parse.js +5 -0
- package/node_modules/@iarna/toml/stringify.js +296 -0
- package/node_modules/@iarna/toml/toml.js +3 -0
- package/node_modules/@prismer/aip-sdk/README.md +36 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-LIJDUCHB.js +104 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-QUQXZ2LD.js +99 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/credentials-5GGZEJFG.js +56 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/delegation-3J35VGBZ.js +64 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/identity-LXVWKSVB.js +7 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/index.js +259 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/resolver-TGOPKW52.js +26 -0
- package/node_modules/@prismer/aip-sdk/dist/index.cjs +368 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.cts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.ts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.js +322 -0
- package/node_modules/@prismer/aip-sdk/package.json +53 -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/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/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1157 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +520 -0
- package/node_modules/commander/lib/option.js +330 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +84 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +969 -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-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/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-locate/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-locate/node_modules/p-limit/license +9 -0
- package/node_modules/p-locate/node_modules/p-limit/package.json +52 -0
- package/node_modules/p-locate/node_modules/p-limit/readme.md +101 -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/picocolors/LICENSE +15 -0
- package/node_modules/picocolors/README.md +21 -0
- package/node_modules/picocolors/package.json +25 -0
- package/node_modules/picocolors/picocolors.browser.js +4 -0
- package/node_modules/picocolors/picocolors.d.ts +5 -0
- package/node_modules/picocolors/picocolors.js +75 -0
- package/node_modules/picocolors/types.d.ts +51 -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/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -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/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/license +9 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/wrap-ansi/package.json +61 -0
- package/node_modules/wrap-ansi/readme.md +97 -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/package.json +28 -5
package/dist/index.mjs
CHANGED
|
@@ -490,6 +490,8 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
490
490
|
this._isOnline = true;
|
|
491
491
|
this._syncState = "idle";
|
|
492
492
|
this.sseSource = null;
|
|
493
|
+
/** release203/12 — unified single-WS realtime transport (preferred over SSE). */
|
|
494
|
+
this.wsSource = null;
|
|
493
495
|
this.sseReconnectTimer = null;
|
|
494
496
|
this.sseReconnectAttempts = 0;
|
|
495
497
|
/** Presence cache for realtime presence events */
|
|
@@ -508,6 +510,8 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
508
510
|
warningThreshold: options.quota.warningThreshold ?? 0.9
|
|
509
511
|
} : void 0
|
|
510
512
|
};
|
|
513
|
+
this.WS = options.WebSocket ?? (typeof WebSocket !== "undefined" ? WebSocket : void 0);
|
|
514
|
+
this.unifiedWs = options.unifiedWs ?? true;
|
|
511
515
|
}
|
|
512
516
|
get isOnline() {
|
|
513
517
|
return this._isOnline;
|
|
@@ -984,14 +988,17 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
984
988
|
* Replaces polling with real-time push when syncMode is 'push'.
|
|
985
989
|
*/
|
|
986
990
|
async startContinuousSync() {
|
|
987
|
-
if (this.sseSource) return;
|
|
988
|
-
if (typeof EventSource === "undefined") {
|
|
989
|
-
return this.sync();
|
|
990
|
-
}
|
|
991
|
+
if (this.sseSource || this.wsSource) return;
|
|
991
992
|
const token = this.tokenProvider?.();
|
|
992
993
|
if (!token) {
|
|
993
994
|
return this.sync();
|
|
994
995
|
}
|
|
996
|
+
if (this.unifiedWs && this.WS) {
|
|
997
|
+
return this.startContinuousSyncWs(token);
|
|
998
|
+
}
|
|
999
|
+
if (typeof EventSource === "undefined") {
|
|
1000
|
+
return this.sync();
|
|
1001
|
+
}
|
|
995
1002
|
const cursor = await this.storage.getCursor("global_sync") ?? "0";
|
|
996
1003
|
const baseUrl = this.getBaseUrl();
|
|
997
1004
|
const url = `${baseUrl}/api/im/sync/stream?token=${encodeURIComponent(token)}&since=${cursor}`;
|
|
@@ -1044,9 +1051,103 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
1044
1051
|
}
|
|
1045
1052
|
}
|
|
1046
1053
|
/**
|
|
1047
|
-
*
|
|
1054
|
+
* release203/12 — continuous sync over the unified single WebSocket.
|
|
1055
|
+
* Consumes the `{ch:'sync',name:'sync',data}` frames (the same per-user
|
|
1056
|
+
* fan-out the SSE endpoint served) and ignores the `tasks` channel + control
|
|
1057
|
+
* frames. Behaviour-preserving vs the SSE path: same applySyncEvent, same
|
|
1058
|
+
* cursor, same emitted events — only the transport differs (2 sockets → 1).
|
|
1059
|
+
*/
|
|
1060
|
+
async startContinuousSyncWs(token) {
|
|
1061
|
+
if (!this.WS) return this.sync();
|
|
1062
|
+
const cursor = await this.storage.getCursor("global_sync") ?? "0";
|
|
1063
|
+
const httpBase = this.getBaseUrl();
|
|
1064
|
+
const wsBase = httpBase.replace(/^http/, "ws").replace(/\/$/, "");
|
|
1065
|
+
const url = `${wsBase}/ws/realtime?token=${encodeURIComponent(token)}&since=${cursor}`;
|
|
1066
|
+
this._syncState = "syncing";
|
|
1067
|
+
this.emit("sync.start", void 0);
|
|
1068
|
+
this.sseReconnectAttempts = 0;
|
|
1069
|
+
let totalNew = 0;
|
|
1070
|
+
let totalUpdated = 0;
|
|
1071
|
+
try {
|
|
1072
|
+
const ws = new this.WS(url);
|
|
1073
|
+
this.wsSource = ws;
|
|
1074
|
+
ws.onopen = () => {
|
|
1075
|
+
this.sseReconnectAttempts = 0;
|
|
1076
|
+
};
|
|
1077
|
+
ws.onmessage = async (ev) => {
|
|
1078
|
+
let frame;
|
|
1079
|
+
try {
|
|
1080
|
+
frame = JSON.parse(typeof ev.data === "string" ? ev.data : String(ev.data));
|
|
1081
|
+
} catch {
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
const name = frame.name;
|
|
1085
|
+
if (name === "heartbeat") return;
|
|
1086
|
+
if (name === "caught_up") {
|
|
1087
|
+
this._syncState = "idle";
|
|
1088
|
+
this.sseReconnectAttempts = 0;
|
|
1089
|
+
this.emit("sync.complete", { newMessages: totalNew, updatedConversations: totalUpdated });
|
|
1090
|
+
totalNew = 0;
|
|
1091
|
+
totalUpdated = 0;
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (name === "error") {
|
|
1095
|
+
this._syncState = "error";
|
|
1096
|
+
this.emit("sync.error", { error: "WS stream error", willRetry: true });
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
if (frame.ch !== "sync" || name !== "sync") return;
|
|
1100
|
+
const data = frame.data;
|
|
1101
|
+
if (!data || typeof data !== "object") return;
|
|
1102
|
+
if (data.type === "sync.backfill.truncated") {
|
|
1103
|
+
if (typeof data.newestSeq === "number") await this.storage.setCursor("global_sync", String(data.newestSeq));
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (data.type === "sync.backfill.done") {
|
|
1107
|
+
if (typeof data.seq === "number") await this.storage.setCursor("global_sync", String(data.seq));
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
try {
|
|
1111
|
+
const event = data;
|
|
1112
|
+
await this.applySyncEvent(event);
|
|
1113
|
+
if (typeof event.seq === "number") await this.storage.setCursor("global_sync", String(event.seq));
|
|
1114
|
+
if (event.type === "message.new") totalNew++;
|
|
1115
|
+
if (event.type?.startsWith("conversation.")) totalUpdated++;
|
|
1116
|
+
this.emit("sync.progress", { synced: 1, total: 1 });
|
|
1117
|
+
if (this.options.quota) await this.checkQuota();
|
|
1118
|
+
} catch {
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
ws.onerror = () => {
|
|
1122
|
+
this._syncState = "error";
|
|
1123
|
+
this.emit("sync.error", { error: "WS connection error", willRetry: true });
|
|
1124
|
+
};
|
|
1125
|
+
ws.onclose = () => {
|
|
1126
|
+
this.wsSource = null;
|
|
1127
|
+
if (this._syncState !== "idle") this._syncState = "error";
|
|
1128
|
+
this.scheduleSseReconnect();
|
|
1129
|
+
};
|
|
1130
|
+
} catch (err) {
|
|
1131
|
+
this.wsSource = null;
|
|
1132
|
+
this._syncState = "error";
|
|
1133
|
+
this.emit("sync.error", {
|
|
1134
|
+
error: err instanceof Error ? err.message : "WS init failed",
|
|
1135
|
+
willRetry: true
|
|
1136
|
+
});
|
|
1137
|
+
this.scheduleSseReconnect();
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Stop the continuous sync connection (WS or SSE).
|
|
1048
1142
|
*/
|
|
1049
1143
|
stopContinuousSync() {
|
|
1144
|
+
if (this.wsSource) {
|
|
1145
|
+
try {
|
|
1146
|
+
this.wsSource.close();
|
|
1147
|
+
} catch {
|
|
1148
|
+
}
|
|
1149
|
+
this.wsSource = null;
|
|
1150
|
+
}
|
|
1050
1151
|
if (this.sseSource) {
|
|
1051
1152
|
this.sseSource.close();
|
|
1052
1153
|
this.sseSource = null;
|
|
@@ -1495,7 +1596,7 @@ import { AIPIdentity as AIPIdentity2 } from "@prismer/aip-sdk";
|
|
|
1495
1596
|
|
|
1496
1597
|
// src/types.ts
|
|
1497
1598
|
var ENVIRONMENTS = {
|
|
1498
|
-
production: "https://
|
|
1599
|
+
production: "https://prod.docbrew.cn"
|
|
1499
1600
|
};
|
|
1500
1601
|
|
|
1501
1602
|
// src/im/workspace/tasks.ts
|
|
@@ -3768,9 +3869,10 @@ var WorkspaceClient = class {
|
|
|
3768
3869
|
async initGroup(options) {
|
|
3769
3870
|
return this._r("POST", "/api/im/workspace/init-group", options);
|
|
3770
3871
|
}
|
|
3771
|
-
/**
|
|
3772
|
-
async addAgent(workspaceId,
|
|
3773
|
-
|
|
3872
|
+
/** Create a low-level agent identity in a workspace. Role workflows use the role-builder harness. */
|
|
3873
|
+
async addAgent(workspaceId, options) {
|
|
3874
|
+
const body = typeof options === "string" ? { agentName: options, agentDisplayName: options } : options;
|
|
3875
|
+
return this._r("POST", `/api/im/workspace/${workspaceId}/agents`, body);
|
|
3774
3876
|
}
|
|
3775
3877
|
/** List agents in a workspace */
|
|
3776
3878
|
async listAgents(workspaceId) {
|
|
@@ -3896,6 +3998,17 @@ var TasksClient = class {
|
|
|
3896
3998
|
async approve(taskId) {
|
|
3897
3999
|
return this._r("POST", `/api/im/tasks/${taskId}/approve`);
|
|
3898
4000
|
}
|
|
4001
|
+
/**
|
|
4002
|
+
* apc P-6 — post an auditable task event (`POST /tasks/:id/event`).
|
|
4003
|
+
*
|
|
4004
|
+
* Lands one `im_task_logs` row: `action = code.toLowerCase()`, `payload`
|
|
4005
|
+
* serialised into metadata. Server-side authorization: only the task
|
|
4006
|
+
* assignee may post. Used by `cloud skill ack` for skill invocation
|
|
4007
|
+
* receipts (code `SKILL_ACK` → action `skill_ack`).
|
|
4008
|
+
*/
|
|
4009
|
+
async postEvent(taskId, options) {
|
|
4010
|
+
return this._r("POST", `/api/im/tasks/${taskId}/event`, options);
|
|
4011
|
+
}
|
|
3899
4012
|
/** Reject a task with reason */
|
|
3900
4013
|
async reject(taskId, reason) {
|
|
3901
4014
|
return this._r("POST", `/api/im/tasks/${taskId}/reject`, { reason });
|
|
@@ -4060,6 +4173,40 @@ var MetricsClient = class {
|
|
|
4060
4173
|
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4061
4174
|
return this._r("GET", "/api/im/metrics/aggregate", void 0, query);
|
|
4062
4175
|
}
|
|
4176
|
+
/**
|
|
4177
|
+
* B-P1d — raw event rows behind an aggregate (runtime210/06 W12b
|
|
4178
|
+
* provenance read). workspaceId is mandatory on the filter — same
|
|
4179
|
+
* cross-workspace rule as aggregate(); the server rejects without it.
|
|
4180
|
+
*/
|
|
4181
|
+
async events(opts) {
|
|
4182
|
+
const query = {
|
|
4183
|
+
namespace: opts.namespace,
|
|
4184
|
+
name: opts.name
|
|
4185
|
+
};
|
|
4186
|
+
if (opts.range) query.range = opts.range;
|
|
4187
|
+
if (opts.from) query.from = opts.from;
|
|
4188
|
+
if (opts.to) query.to = opts.to;
|
|
4189
|
+
if (opts.limit !== void 0) query.limit = String(opts.limit);
|
|
4190
|
+
const filterPairs = Object.entries(opts.filter).map(([k, v]) => `${k}:${v}`);
|
|
4191
|
+
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4192
|
+
return this._r("GET", "/api/im/metrics/events", void 0, query);
|
|
4193
|
+
}
|
|
4194
|
+
/**
|
|
4195
|
+
* B-P1d — conversation / task / agent scoped turn summary over the turn.*
|
|
4196
|
+
* family. The response `data` shape is the frozen TurnMetricsSummary
|
|
4197
|
+
* contract above.
|
|
4198
|
+
*/
|
|
4199
|
+
async turnSummary(opts) {
|
|
4200
|
+
const query = {
|
|
4201
|
+
scope: opts.scope,
|
|
4202
|
+
id: opts.id,
|
|
4203
|
+
workspaceId: opts.workspaceId
|
|
4204
|
+
};
|
|
4205
|
+
if (opts.range) query.range = opts.range;
|
|
4206
|
+
if (opts.from) query.from = opts.from;
|
|
4207
|
+
if (opts.to) query.to = opts.to;
|
|
4208
|
+
return this._r("GET", "/api/im/metrics/turns", void 0, query);
|
|
4209
|
+
}
|
|
4063
4210
|
};
|
|
4064
4211
|
var IdentityClient = class {
|
|
4065
4212
|
constructor(_r) {
|
|
@@ -4271,6 +4418,14 @@ var AgentsClient = class {
|
|
|
4271
4418
|
this._r = _r;
|
|
4272
4419
|
this.skills = new AgentSkillsClient(_r);
|
|
4273
4420
|
}
|
|
4421
|
+
/** Discover AgentCard-backed agents in a workspace the caller belongs to. */
|
|
4422
|
+
async discover(options) {
|
|
4423
|
+
const query = { workspaceId: options.workspaceId };
|
|
4424
|
+
if (options.agentType) query.agentType = options.agentType;
|
|
4425
|
+
if (options.capability) query.capability = options.capability;
|
|
4426
|
+
if (options.onlineOnly) query.onlineOnly = "true";
|
|
4427
|
+
return this._r("GET", "/api/im/agents", void 0, query);
|
|
4428
|
+
}
|
|
4274
4429
|
async spec(agentId, workspaceId) {
|
|
4275
4430
|
const query = workspaceId ? { workspaceId } : void 0;
|
|
4276
4431
|
return this._r("GET", `/api/im/agents/${encodeURIComponent(agentId)}/spec`, void 0, query);
|
|
@@ -4911,17 +5066,18 @@ var WorkspacesClient = class {
|
|
|
4911
5066
|
return this._r("GET", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
4912
5067
|
}
|
|
4913
5068
|
/**
|
|
4914
|
-
* Appoint an agent as the workspace's orchestrator. Owner-only.
|
|
4915
|
-
*
|
|
4916
|
-
*
|
|
5069
|
+
* Appoint an agent as the workspace's orchestrator. Owner-only.
|
|
5070
|
+
*
|
|
5071
|
+
* ⚠️ FIRST appointment only. The orchestrator is a node of the platform
|
|
5072
|
+
* network — it holds a globally-unique AIP identity (DID) and system contact
|
|
5073
|
+
* edges to the platform official agents — so the appointment is PERMANENT:
|
|
5074
|
+
* appointing a different agent while one is already in place fails with
|
|
5075
|
+
* 409 `ORCHESTRATOR_IMMUTABLE`. Re-appointing the same agent is a no-op.
|
|
5076
|
+
* Revocation does not exist (`revokeOrchestrator` was removed in 2.1.0).
|
|
4917
5077
|
*/
|
|
4918
5078
|
async appointOrchestrator(workspaceId, agentImUserId) {
|
|
4919
5079
|
return this._r("POST", `/api/im/workspaces/${workspaceId}/orchestrator`, { agentImUserId });
|
|
4920
5080
|
}
|
|
4921
|
-
/** Revoke the workspace's current orchestrator. Owner-only. Idempotent. */
|
|
4922
|
-
async revokeOrchestrator(workspaceId) {
|
|
4923
|
-
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
4924
|
-
}
|
|
4925
5081
|
// Sub-clients `members` / `invites` are declared at the top of the class and
|
|
4926
5082
|
// wired up inside the constructor body — see `AgentsClient` for the same
|
|
4927
5083
|
// pattern. Declaring them as field initializers that reference `this._r`
|
|
@@ -5637,6 +5793,11 @@ var IMRealtimeClient = class {
|
|
|
5637
5793
|
* sub.disconnect();
|
|
5638
5794
|
*/
|
|
5639
5795
|
async subscribeTaskEvents(token, onEvent, options) {
|
|
5796
|
+
const wantWs = options?.unifiedWs ?? true;
|
|
5797
|
+
const WS = options?.WebSocket ?? (typeof WebSocket !== "undefined" ? WebSocket : void 0);
|
|
5798
|
+
if (wantWs && WS) {
|
|
5799
|
+
return this.subscribeTaskEventsWs(token, onEvent, WS, options?.signal);
|
|
5800
|
+
}
|
|
5640
5801
|
const controller = new AbortController();
|
|
5641
5802
|
const onAbort = () => controller.abort();
|
|
5642
5803
|
options?.signal?.addEventListener("abort", onAbort);
|
|
@@ -5717,6 +5878,45 @@ var IMRealtimeClient = class {
|
|
|
5717
5878
|
}
|
|
5718
5879
|
};
|
|
5719
5880
|
}
|
|
5881
|
+
/**
|
|
5882
|
+
* release203/12 — task events over the unified single WebSocket.
|
|
5883
|
+
* Connects to `WS /ws/realtime`, filters the `ch:'tasks'` frames, and emits
|
|
5884
|
+
* the SAME `{ type, payload }` envelopes `subscribeTaskEvents` did over SSE
|
|
5885
|
+
* (the WS carries no per-event `id`; cursor resume is handled by the sync
|
|
5886
|
+
* channel). The `ch:'sync'` frames + control frames are ignored here.
|
|
5887
|
+
*/
|
|
5888
|
+
subscribeTaskEventsWs(token, onEvent, WS, signal) {
|
|
5889
|
+
const wsBase = this._wsBase.replace(/^http/, "ws").replace(/\/$/, "");
|
|
5890
|
+
const url = `${wsBase}/ws/realtime?token=${encodeURIComponent(token)}&since=0`;
|
|
5891
|
+
const ws = new WS(url);
|
|
5892
|
+
const disconnect = () => {
|
|
5893
|
+
try {
|
|
5894
|
+
ws.close();
|
|
5895
|
+
} catch {
|
|
5896
|
+
}
|
|
5897
|
+
};
|
|
5898
|
+
if (signal) {
|
|
5899
|
+
if (signal.aborted) disconnect();
|
|
5900
|
+
else signal.addEventListener("abort", disconnect, { once: true });
|
|
5901
|
+
}
|
|
5902
|
+
ws.onmessage = (ev) => {
|
|
5903
|
+
let frame;
|
|
5904
|
+
try {
|
|
5905
|
+
frame = JSON.parse(typeof ev.data === "string" ? ev.data : String(ev.data));
|
|
5906
|
+
} catch {
|
|
5907
|
+
return;
|
|
5908
|
+
}
|
|
5909
|
+
if (frame.ch !== "tasks" || !frame.name) return;
|
|
5910
|
+
try {
|
|
5911
|
+
onEvent({
|
|
5912
|
+
type: frame.name,
|
|
5913
|
+
payload: frame.data ?? {}
|
|
5914
|
+
});
|
|
5915
|
+
} catch {
|
|
5916
|
+
}
|
|
5917
|
+
};
|
|
5918
|
+
return { disconnect };
|
|
5919
|
+
}
|
|
5720
5920
|
};
|
|
5721
5921
|
var SkillsDraftClient = class {
|
|
5722
5922
|
constructor(_r) {
|
|
@@ -5748,6 +5948,81 @@ var SkillsClient = class {
|
|
|
5748
5948
|
this.draft = new SkillsDraftClient(_r);
|
|
5749
5949
|
}
|
|
5750
5950
|
};
|
|
5951
|
+
var PkfClient = class {
|
|
5952
|
+
constructor(_r, _fetchAuthed) {
|
|
5953
|
+
this._r = _r;
|
|
5954
|
+
this._fetchAuthed = _fetchAuthed;
|
|
5955
|
+
}
|
|
5956
|
+
async materialize(input) {
|
|
5957
|
+
return this._r("POST", "/api/pkf/materializations", input);
|
|
5958
|
+
}
|
|
5959
|
+
async getMaterialization(query) {
|
|
5960
|
+
return this._r("GET", "/api/pkf/materializations", void 0, {
|
|
5961
|
+
workspaceId: query.workspaceId,
|
|
5962
|
+
idempotencyKey: query.idempotencyKey,
|
|
5963
|
+
targetKind: query.targetKind
|
|
5964
|
+
});
|
|
5965
|
+
}
|
|
5966
|
+
async discoverMaterialization(query) {
|
|
5967
|
+
return this._r("GET", "/api/pkf/materializations", void 0, {
|
|
5968
|
+
workspaceId: query.workspaceId,
|
|
5969
|
+
messageId: query.source.messageId,
|
|
5970
|
+
blockId: query.source.blockId,
|
|
5971
|
+
blockRevision: String(query.source.blockRevision),
|
|
5972
|
+
sourceHash: query.source.sourceHash,
|
|
5973
|
+
targetKind: query.targetKind
|
|
5974
|
+
});
|
|
5975
|
+
}
|
|
5976
|
+
/** Atomically commit a PKF root plus its exact root-bound dependency graph. */
|
|
5977
|
+
async commitBundle(input) {
|
|
5978
|
+
return this._r("POST", "/api/pkf/bundles/commit", input);
|
|
5979
|
+
}
|
|
5980
|
+
/** Restore the caller-scoped durable bundle receipt after process restart. */
|
|
5981
|
+
async getBundle(query) {
|
|
5982
|
+
return this._r("GET", "/api/pkf/bundles/commit", void 0, {
|
|
5983
|
+
workspaceId: query.workspaceId,
|
|
5984
|
+
idempotencyKey: query.idempotencyKey
|
|
5985
|
+
});
|
|
5986
|
+
}
|
|
5987
|
+
async getArtifactRelations(query) {
|
|
5988
|
+
const rootKind = encodeURIComponent(query.rootKind);
|
|
5989
|
+
const rootId = encodeURIComponent(query.rootId);
|
|
5990
|
+
return this._r(
|
|
5991
|
+
"GET",
|
|
5992
|
+
`/api/pkf/artifacts/${rootKind}/${rootId}/relations`,
|
|
5993
|
+
void 0,
|
|
5994
|
+
{ workspaceId: query.workspaceId, revision: String(query.revision) }
|
|
5995
|
+
);
|
|
5996
|
+
}
|
|
5997
|
+
async getResourceDetail(query) {
|
|
5998
|
+
return this._r("GET", "/api/pkf/resources/detail", void 0, pkfResourceReadParams(query));
|
|
5999
|
+
}
|
|
6000
|
+
/**
|
|
6001
|
+
* Read root-authorized dependency bytes. This intentionally returns the raw
|
|
6002
|
+
* Response so callers can stream the body and verify `X-Asset-Hash`.
|
|
6003
|
+
*/
|
|
6004
|
+
async getResourceBytes(query) {
|
|
6005
|
+
const params = new URLSearchParams(pkfResourceReadParams(query));
|
|
6006
|
+
return this._fetchAuthed(`/api/pkf/resources/bytes?${params.toString()}`);
|
|
6007
|
+
}
|
|
6008
|
+
/** Low-level canonical request seam used by the Cloud CLI. */
|
|
6009
|
+
async request(method, path, body, query) {
|
|
6010
|
+
return this._r(method, path, body, query);
|
|
6011
|
+
}
|
|
6012
|
+
};
|
|
6013
|
+
function pkfResourceReadParams(query) {
|
|
6014
|
+
const params = {
|
|
6015
|
+
workspaceId: query.workspaceId,
|
|
6016
|
+
rootKind: query.rootKind,
|
|
6017
|
+
rootId: query.rootId,
|
|
6018
|
+
rootRevision: String(query.rootRevision),
|
|
6019
|
+
rootHash: query.rootHash
|
|
6020
|
+
};
|
|
6021
|
+
if (typeof query.targetAssetId === "string") params.targetAssetId = query.targetAssetId;
|
|
6022
|
+
else if (typeof query.targetHash === "string") params.targetHash = query.targetHash;
|
|
6023
|
+
else throw new TypeError("PKF resource read requires exactly one target locator");
|
|
6024
|
+
return params;
|
|
6025
|
+
}
|
|
5751
6026
|
var IMClient = class {
|
|
5752
6027
|
constructor(request, wsBase, fetchFn, getAuthHeaders, offlineManager, communityHubConfig) {
|
|
5753
6028
|
this._request = request;
|
|
@@ -5884,6 +6159,10 @@ var PrismerClient = class {
|
|
|
5884
6159
|
this._offlineManager,
|
|
5885
6160
|
config.community ?? null
|
|
5886
6161
|
);
|
|
6162
|
+
this.pkf = new PkfClient(
|
|
6163
|
+
(method, path, body, query, opts) => this._request(method, path, body, query, opts),
|
|
6164
|
+
(path, init) => this.fetchAuthed(path, init)
|
|
6165
|
+
);
|
|
5887
6166
|
this.workspaces = this.im.workspaces;
|
|
5888
6167
|
this.invites = this.im.invites;
|
|
5889
6168
|
this.projects = this.im.projects;
|
|
@@ -5919,10 +6198,12 @@ var PrismerClient = class {
|
|
|
5919
6198
|
}, query, opts);
|
|
5920
6199
|
}
|
|
5921
6200
|
/** Build auth headers for raw HTTP requests (used by file upload) */
|
|
5922
|
-
_getAuthHeaders() {
|
|
6201
|
+
_getAuthHeaders(authority = "im") {
|
|
5923
6202
|
const headers = {};
|
|
5924
6203
|
if (this.apiKey) headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
5925
|
-
if (this.imAgent)
|
|
6204
|
+
if (this.imAgent) {
|
|
6205
|
+
headers[authority === "pkf" ? "X-Prismer-Agent" : "X-IM-Agent"] = this.imAgent;
|
|
6206
|
+
}
|
|
5926
6207
|
if (this.imWorkspace) headers["X-IM-Workspace"] = this.imWorkspace;
|
|
5927
6208
|
return headers;
|
|
5928
6209
|
}
|
|
@@ -5946,16 +6227,17 @@ var PrismerClient = class {
|
|
|
5946
6227
|
*
|
|
5947
6228
|
* The path may be absolute (`/api/...`) or a full URL — full URLs are used
|
|
5948
6229
|
* verbatim (useful for following 302 redirects), otherwise the path is
|
|
5949
|
-
* appended to the client's configured `baseUrl`. Authorization
|
|
5950
|
-
*
|
|
5951
|
-
*
|
|
6230
|
+
* appended to the client's configured `baseUrl`. Authorization plus the
|
|
6231
|
+
* authority-specific agent header are added automatically: canonical PKF
|
|
6232
|
+
* requests use `X-Prismer-Agent`, while legacy `/api/im/*` keeps
|
|
6233
|
+
* `X-IM-Agent`. Caller-supplied headers override them on collision.
|
|
5952
6234
|
*
|
|
5953
6235
|
* Use this for binary downloads / partial fetches; for normal JSON-envelope
|
|
5954
6236
|
* IM requests use `client.im.request()` (typed) or the typed sub-clients.
|
|
5955
6237
|
*/
|
|
5956
6238
|
async fetchAuthed(url, init) {
|
|
5957
6239
|
const fullUrl = /^https?:\/\//i.test(url) ? url : `${this.baseUrl}${url}`;
|
|
5958
|
-
const authHeaders = this._getAuthHeaders();
|
|
6240
|
+
const authHeaders = this._getAuthHeaders(/\/api\/pkf\//.test(url) ? "pkf" : "im");
|
|
5959
6241
|
const callerHeaders = {};
|
|
5960
6242
|
if (init?.headers) {
|
|
5961
6243
|
const h = init.headers;
|
|
@@ -5988,7 +6270,7 @@ var PrismerClient = class {
|
|
|
5988
6270
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
5989
6271
|
}
|
|
5990
6272
|
if (this.imAgent) {
|
|
5991
|
-
headers["X-IM-Agent"] = this.imAgent;
|
|
6273
|
+
headers[path.startsWith("/api/pkf/") ? "X-Prismer-Agent" : "X-IM-Agent"] = this.imAgent;
|
|
5992
6274
|
}
|
|
5993
6275
|
if (this.imWorkspace) {
|
|
5994
6276
|
headers["X-IM-Workspace"] = this.imWorkspace;
|
|
@@ -6131,6 +6413,7 @@ export {
|
|
|
6131
6413
|
MessagesClient,
|
|
6132
6414
|
MetricsClient,
|
|
6133
6415
|
OfflineManager,
|
|
6416
|
+
PkfClient,
|
|
6134
6417
|
PrismerClient,
|
|
6135
6418
|
ProjectMembersClient,
|
|
6136
6419
|
ProjectsClient,
|