@prismer/sdk 2.0.7 → 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 +59723 -8280
- package/dist/index.d.mts +724 -229
- package/dist/index.d.ts +724 -229
- package/dist/index.js +325 -23
- package/dist/index.mjs +324 -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.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(index_exports, {
|
|
|
62
62
|
MessagesClient: () => MessagesClient,
|
|
63
63
|
MetricsClient: () => MetricsClient,
|
|
64
64
|
OfflineManager: () => OfflineManager,
|
|
65
|
+
PkfClient: () => PkfClient,
|
|
65
66
|
PrismerClient: () => PrismerClient,
|
|
66
67
|
ProjectMembersClient: () => ProjectMembersClient,
|
|
67
68
|
ProjectsClient: () => ProjectsClient,
|
|
@@ -588,6 +589,8 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
588
589
|
this._isOnline = true;
|
|
589
590
|
this._syncState = "idle";
|
|
590
591
|
this.sseSource = null;
|
|
592
|
+
/** release203/12 — unified single-WS realtime transport (preferred over SSE). */
|
|
593
|
+
this.wsSource = null;
|
|
591
594
|
this.sseReconnectTimer = null;
|
|
592
595
|
this.sseReconnectAttempts = 0;
|
|
593
596
|
/** Presence cache for realtime presence events */
|
|
@@ -606,6 +609,8 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
606
609
|
warningThreshold: options.quota.warningThreshold ?? 0.9
|
|
607
610
|
} : void 0
|
|
608
611
|
};
|
|
612
|
+
this.WS = options.WebSocket ?? (typeof WebSocket !== "undefined" ? WebSocket : void 0);
|
|
613
|
+
this.unifiedWs = options.unifiedWs ?? true;
|
|
609
614
|
}
|
|
610
615
|
get isOnline() {
|
|
611
616
|
return this._isOnline;
|
|
@@ -1082,14 +1087,17 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
1082
1087
|
* Replaces polling with real-time push when syncMode is 'push'.
|
|
1083
1088
|
*/
|
|
1084
1089
|
async startContinuousSync() {
|
|
1085
|
-
if (this.sseSource) return;
|
|
1086
|
-
if (typeof EventSource === "undefined") {
|
|
1087
|
-
return this.sync();
|
|
1088
|
-
}
|
|
1090
|
+
if (this.sseSource || this.wsSource) return;
|
|
1089
1091
|
const token = this.tokenProvider?.();
|
|
1090
1092
|
if (!token) {
|
|
1091
1093
|
return this.sync();
|
|
1092
1094
|
}
|
|
1095
|
+
if (this.unifiedWs && this.WS) {
|
|
1096
|
+
return this.startContinuousSyncWs(token);
|
|
1097
|
+
}
|
|
1098
|
+
if (typeof EventSource === "undefined") {
|
|
1099
|
+
return this.sync();
|
|
1100
|
+
}
|
|
1093
1101
|
const cursor = await this.storage.getCursor("global_sync") ?? "0";
|
|
1094
1102
|
const baseUrl = this.getBaseUrl();
|
|
1095
1103
|
const url = `${baseUrl}/api/im/sync/stream?token=${encodeURIComponent(token)}&since=${cursor}`;
|
|
@@ -1142,9 +1150,103 @@ var OfflineManager = class extends OfflineEmitter {
|
|
|
1142
1150
|
}
|
|
1143
1151
|
}
|
|
1144
1152
|
/**
|
|
1145
|
-
*
|
|
1153
|
+
* release203/12 — continuous sync over the unified single WebSocket.
|
|
1154
|
+
* Consumes the `{ch:'sync',name:'sync',data}` frames (the same per-user
|
|
1155
|
+
* fan-out the SSE endpoint served) and ignores the `tasks` channel + control
|
|
1156
|
+
* frames. Behaviour-preserving vs the SSE path: same applySyncEvent, same
|
|
1157
|
+
* cursor, same emitted events — only the transport differs (2 sockets → 1).
|
|
1158
|
+
*/
|
|
1159
|
+
async startContinuousSyncWs(token) {
|
|
1160
|
+
if (!this.WS) return this.sync();
|
|
1161
|
+
const cursor = await this.storage.getCursor("global_sync") ?? "0";
|
|
1162
|
+
const httpBase = this.getBaseUrl();
|
|
1163
|
+
const wsBase = httpBase.replace(/^http/, "ws").replace(/\/$/, "");
|
|
1164
|
+
const url = `${wsBase}/ws/realtime?token=${encodeURIComponent(token)}&since=${cursor}`;
|
|
1165
|
+
this._syncState = "syncing";
|
|
1166
|
+
this.emit("sync.start", void 0);
|
|
1167
|
+
this.sseReconnectAttempts = 0;
|
|
1168
|
+
let totalNew = 0;
|
|
1169
|
+
let totalUpdated = 0;
|
|
1170
|
+
try {
|
|
1171
|
+
const ws = new this.WS(url);
|
|
1172
|
+
this.wsSource = ws;
|
|
1173
|
+
ws.onopen = () => {
|
|
1174
|
+
this.sseReconnectAttempts = 0;
|
|
1175
|
+
};
|
|
1176
|
+
ws.onmessage = async (ev) => {
|
|
1177
|
+
let frame;
|
|
1178
|
+
try {
|
|
1179
|
+
frame = JSON.parse(typeof ev.data === "string" ? ev.data : String(ev.data));
|
|
1180
|
+
} catch {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
const name = frame.name;
|
|
1184
|
+
if (name === "heartbeat") return;
|
|
1185
|
+
if (name === "caught_up") {
|
|
1186
|
+
this._syncState = "idle";
|
|
1187
|
+
this.sseReconnectAttempts = 0;
|
|
1188
|
+
this.emit("sync.complete", { newMessages: totalNew, updatedConversations: totalUpdated });
|
|
1189
|
+
totalNew = 0;
|
|
1190
|
+
totalUpdated = 0;
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
if (name === "error") {
|
|
1194
|
+
this._syncState = "error";
|
|
1195
|
+
this.emit("sync.error", { error: "WS stream error", willRetry: true });
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
if (frame.ch !== "sync" || name !== "sync") return;
|
|
1199
|
+
const data = frame.data;
|
|
1200
|
+
if (!data || typeof data !== "object") return;
|
|
1201
|
+
if (data.type === "sync.backfill.truncated") {
|
|
1202
|
+
if (typeof data.newestSeq === "number") await this.storage.setCursor("global_sync", String(data.newestSeq));
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
if (data.type === "sync.backfill.done") {
|
|
1206
|
+
if (typeof data.seq === "number") await this.storage.setCursor("global_sync", String(data.seq));
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
try {
|
|
1210
|
+
const event = data;
|
|
1211
|
+
await this.applySyncEvent(event);
|
|
1212
|
+
if (typeof event.seq === "number") await this.storage.setCursor("global_sync", String(event.seq));
|
|
1213
|
+
if (event.type === "message.new") totalNew++;
|
|
1214
|
+
if (event.type?.startsWith("conversation.")) totalUpdated++;
|
|
1215
|
+
this.emit("sync.progress", { synced: 1, total: 1 });
|
|
1216
|
+
if (this.options.quota) await this.checkQuota();
|
|
1217
|
+
} catch {
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
ws.onerror = () => {
|
|
1221
|
+
this._syncState = "error";
|
|
1222
|
+
this.emit("sync.error", { error: "WS connection error", willRetry: true });
|
|
1223
|
+
};
|
|
1224
|
+
ws.onclose = () => {
|
|
1225
|
+
this.wsSource = null;
|
|
1226
|
+
if (this._syncState !== "idle") this._syncState = "error";
|
|
1227
|
+
this.scheduleSseReconnect();
|
|
1228
|
+
};
|
|
1229
|
+
} catch (err) {
|
|
1230
|
+
this.wsSource = null;
|
|
1231
|
+
this._syncState = "error";
|
|
1232
|
+
this.emit("sync.error", {
|
|
1233
|
+
error: err instanceof Error ? err.message : "WS init failed",
|
|
1234
|
+
willRetry: true
|
|
1235
|
+
});
|
|
1236
|
+
this.scheduleSseReconnect();
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Stop the continuous sync connection (WS or SSE).
|
|
1146
1241
|
*/
|
|
1147
1242
|
stopContinuousSync() {
|
|
1243
|
+
if (this.wsSource) {
|
|
1244
|
+
try {
|
|
1245
|
+
this.wsSource.close();
|
|
1246
|
+
} catch {
|
|
1247
|
+
}
|
|
1248
|
+
this.wsSource = null;
|
|
1249
|
+
}
|
|
1148
1250
|
if (this.sseSource) {
|
|
1149
1251
|
this.sseSource.close();
|
|
1150
1252
|
this.sseSource = null;
|
|
@@ -1577,7 +1679,7 @@ var import_aip_sdk5 = require("@prismer/aip-sdk");
|
|
|
1577
1679
|
|
|
1578
1680
|
// src/types.ts
|
|
1579
1681
|
var ENVIRONMENTS = {
|
|
1580
|
-
production: "https://
|
|
1682
|
+
production: "https://prod.docbrew.cn"
|
|
1581
1683
|
};
|
|
1582
1684
|
|
|
1583
1685
|
// src/im/workspace/tasks.ts
|
|
@@ -3850,9 +3952,10 @@ var WorkspaceClient = class {
|
|
|
3850
3952
|
async initGroup(options) {
|
|
3851
3953
|
return this._r("POST", "/api/im/workspace/init-group", options);
|
|
3852
3954
|
}
|
|
3853
|
-
/**
|
|
3854
|
-
async addAgent(workspaceId,
|
|
3855
|
-
|
|
3955
|
+
/** Create a low-level agent identity in a workspace. Role workflows use the role-builder harness. */
|
|
3956
|
+
async addAgent(workspaceId, options) {
|
|
3957
|
+
const body = typeof options === "string" ? { agentName: options, agentDisplayName: options } : options;
|
|
3958
|
+
return this._r("POST", `/api/im/workspace/${workspaceId}/agents`, body);
|
|
3856
3959
|
}
|
|
3857
3960
|
/** List agents in a workspace */
|
|
3858
3961
|
async listAgents(workspaceId) {
|
|
@@ -3978,6 +4081,17 @@ var TasksClient = class {
|
|
|
3978
4081
|
async approve(taskId) {
|
|
3979
4082
|
return this._r("POST", `/api/im/tasks/${taskId}/approve`);
|
|
3980
4083
|
}
|
|
4084
|
+
/**
|
|
4085
|
+
* apc P-6 — post an auditable task event (`POST /tasks/:id/event`).
|
|
4086
|
+
*
|
|
4087
|
+
* Lands one `im_task_logs` row: `action = code.toLowerCase()`, `payload`
|
|
4088
|
+
* serialised into metadata. Server-side authorization: only the task
|
|
4089
|
+
* assignee may post. Used by `cloud skill ack` for skill invocation
|
|
4090
|
+
* receipts (code `SKILL_ACK` → action `skill_ack`).
|
|
4091
|
+
*/
|
|
4092
|
+
async postEvent(taskId, options) {
|
|
4093
|
+
return this._r("POST", `/api/im/tasks/${taskId}/event`, options);
|
|
4094
|
+
}
|
|
3981
4095
|
/** Reject a task with reason */
|
|
3982
4096
|
async reject(taskId, reason) {
|
|
3983
4097
|
return this._r("POST", `/api/im/tasks/${taskId}/reject`, { reason });
|
|
@@ -4142,6 +4256,40 @@ var MetricsClient = class {
|
|
|
4142
4256
|
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4143
4257
|
return this._r("GET", "/api/im/metrics/aggregate", void 0, query);
|
|
4144
4258
|
}
|
|
4259
|
+
/**
|
|
4260
|
+
* B-P1d — raw event rows behind an aggregate (runtime210/06 W12b
|
|
4261
|
+
* provenance read). workspaceId is mandatory on the filter — same
|
|
4262
|
+
* cross-workspace rule as aggregate(); the server rejects without it.
|
|
4263
|
+
*/
|
|
4264
|
+
async events(opts) {
|
|
4265
|
+
const query = {
|
|
4266
|
+
namespace: opts.namespace,
|
|
4267
|
+
name: opts.name
|
|
4268
|
+
};
|
|
4269
|
+
if (opts.range) query.range = opts.range;
|
|
4270
|
+
if (opts.from) query.from = opts.from;
|
|
4271
|
+
if (opts.to) query.to = opts.to;
|
|
4272
|
+
if (opts.limit !== void 0) query.limit = String(opts.limit);
|
|
4273
|
+
const filterPairs = Object.entries(opts.filter).map(([k, v]) => `${k}:${v}`);
|
|
4274
|
+
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4275
|
+
return this._r("GET", "/api/im/metrics/events", void 0, query);
|
|
4276
|
+
}
|
|
4277
|
+
/**
|
|
4278
|
+
* B-P1d — conversation / task / agent scoped turn summary over the turn.*
|
|
4279
|
+
* family. The response `data` shape is the frozen TurnMetricsSummary
|
|
4280
|
+
* contract above.
|
|
4281
|
+
*/
|
|
4282
|
+
async turnSummary(opts) {
|
|
4283
|
+
const query = {
|
|
4284
|
+
scope: opts.scope,
|
|
4285
|
+
id: opts.id,
|
|
4286
|
+
workspaceId: opts.workspaceId
|
|
4287
|
+
};
|
|
4288
|
+
if (opts.range) query.range = opts.range;
|
|
4289
|
+
if (opts.from) query.from = opts.from;
|
|
4290
|
+
if (opts.to) query.to = opts.to;
|
|
4291
|
+
return this._r("GET", "/api/im/metrics/turns", void 0, query);
|
|
4292
|
+
}
|
|
4145
4293
|
};
|
|
4146
4294
|
var IdentityClient = class {
|
|
4147
4295
|
constructor(_r) {
|
|
@@ -4353,6 +4501,14 @@ var AgentsClient = class {
|
|
|
4353
4501
|
this._r = _r;
|
|
4354
4502
|
this.skills = new AgentSkillsClient(_r);
|
|
4355
4503
|
}
|
|
4504
|
+
/** Discover AgentCard-backed agents in a workspace the caller belongs to. */
|
|
4505
|
+
async discover(options) {
|
|
4506
|
+
const query = { workspaceId: options.workspaceId };
|
|
4507
|
+
if (options.agentType) query.agentType = options.agentType;
|
|
4508
|
+
if (options.capability) query.capability = options.capability;
|
|
4509
|
+
if (options.onlineOnly) query.onlineOnly = "true";
|
|
4510
|
+
return this._r("GET", "/api/im/agents", void 0, query);
|
|
4511
|
+
}
|
|
4356
4512
|
async spec(agentId, workspaceId) {
|
|
4357
4513
|
const query = workspaceId ? { workspaceId } : void 0;
|
|
4358
4514
|
return this._r("GET", `/api/im/agents/${encodeURIComponent(agentId)}/spec`, void 0, query);
|
|
@@ -4993,17 +5149,18 @@ var WorkspacesClient = class {
|
|
|
4993
5149
|
return this._r("GET", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
4994
5150
|
}
|
|
4995
5151
|
/**
|
|
4996
|
-
* Appoint an agent as the workspace's orchestrator. Owner-only.
|
|
4997
|
-
*
|
|
4998
|
-
*
|
|
5152
|
+
* Appoint an agent as the workspace's orchestrator. Owner-only.
|
|
5153
|
+
*
|
|
5154
|
+
* ⚠️ FIRST appointment only. The orchestrator is a node of the platform
|
|
5155
|
+
* network — it holds a globally-unique AIP identity (DID) and system contact
|
|
5156
|
+
* edges to the platform official agents — so the appointment is PERMANENT:
|
|
5157
|
+
* appointing a different agent while one is already in place fails with
|
|
5158
|
+
* 409 `ORCHESTRATOR_IMMUTABLE`. Re-appointing the same agent is a no-op.
|
|
5159
|
+
* Revocation does not exist (`revokeOrchestrator` was removed in 2.1.0).
|
|
4999
5160
|
*/
|
|
5000
5161
|
async appointOrchestrator(workspaceId, agentImUserId) {
|
|
5001
5162
|
return this._r("POST", `/api/im/workspaces/${workspaceId}/orchestrator`, { agentImUserId });
|
|
5002
5163
|
}
|
|
5003
|
-
/** Revoke the workspace's current orchestrator. Owner-only. Idempotent. */
|
|
5004
|
-
async revokeOrchestrator(workspaceId) {
|
|
5005
|
-
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
5006
|
-
}
|
|
5007
5164
|
// Sub-clients `members` / `invites` are declared at the top of the class and
|
|
5008
5165
|
// wired up inside the constructor body — see `AgentsClient` for the same
|
|
5009
5166
|
// pattern. Declaring them as field initializers that reference `this._r`
|
|
@@ -5579,6 +5736,19 @@ var FilesClient = class {
|
|
|
5579
5736
|
*/
|
|
5580
5737
|
async sendFile(conversationId, input, opts) {
|
|
5581
5738
|
const uploaded = await this.upload(input, opts);
|
|
5739
|
+
const outboxDir = process.env.PRISMER_OUTBOX_DIR;
|
|
5740
|
+
if (outboxDir) {
|
|
5741
|
+
try {
|
|
5742
|
+
const fsMod = await import("fs");
|
|
5743
|
+
const pathMod = await import("path");
|
|
5744
|
+
const srcPath = typeof input === "string" ? input : input.path;
|
|
5745
|
+
if (srcPath && typeof srcPath === "string") {
|
|
5746
|
+
await fsMod.promises.mkdir(outboxDir, { recursive: true });
|
|
5747
|
+
fsMod.cpSync(srcPath, pathMod.join(outboxDir, pathMod.basename(srcPath)));
|
|
5748
|
+
}
|
|
5749
|
+
} catch {
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5582
5752
|
const msgRes = await this._r("POST", `/api/im/messages/${conversationId}`, {
|
|
5583
5753
|
content: opts?.content || uploaded.fileName,
|
|
5584
5754
|
type: "file",
|
|
@@ -5706,6 +5876,11 @@ var IMRealtimeClient = class {
|
|
|
5706
5876
|
* sub.disconnect();
|
|
5707
5877
|
*/
|
|
5708
5878
|
async subscribeTaskEvents(token, onEvent, options) {
|
|
5879
|
+
const wantWs = options?.unifiedWs ?? true;
|
|
5880
|
+
const WS = options?.WebSocket ?? (typeof WebSocket !== "undefined" ? WebSocket : void 0);
|
|
5881
|
+
if (wantWs && WS) {
|
|
5882
|
+
return this.subscribeTaskEventsWs(token, onEvent, WS, options?.signal);
|
|
5883
|
+
}
|
|
5709
5884
|
const controller = new AbortController();
|
|
5710
5885
|
const onAbort = () => controller.abort();
|
|
5711
5886
|
options?.signal?.addEventListener("abort", onAbort);
|
|
@@ -5786,6 +5961,45 @@ var IMRealtimeClient = class {
|
|
|
5786
5961
|
}
|
|
5787
5962
|
};
|
|
5788
5963
|
}
|
|
5964
|
+
/**
|
|
5965
|
+
* release203/12 — task events over the unified single WebSocket.
|
|
5966
|
+
* Connects to `WS /ws/realtime`, filters the `ch:'tasks'` frames, and emits
|
|
5967
|
+
* the SAME `{ type, payload }` envelopes `subscribeTaskEvents` did over SSE
|
|
5968
|
+
* (the WS carries no per-event `id`; cursor resume is handled by the sync
|
|
5969
|
+
* channel). The `ch:'sync'` frames + control frames are ignored here.
|
|
5970
|
+
*/
|
|
5971
|
+
subscribeTaskEventsWs(token, onEvent, WS, signal) {
|
|
5972
|
+
const wsBase = this._wsBase.replace(/^http/, "ws").replace(/\/$/, "");
|
|
5973
|
+
const url = `${wsBase}/ws/realtime?token=${encodeURIComponent(token)}&since=0`;
|
|
5974
|
+
const ws = new WS(url);
|
|
5975
|
+
const disconnect = () => {
|
|
5976
|
+
try {
|
|
5977
|
+
ws.close();
|
|
5978
|
+
} catch {
|
|
5979
|
+
}
|
|
5980
|
+
};
|
|
5981
|
+
if (signal) {
|
|
5982
|
+
if (signal.aborted) disconnect();
|
|
5983
|
+
else signal.addEventListener("abort", disconnect, { once: true });
|
|
5984
|
+
}
|
|
5985
|
+
ws.onmessage = (ev) => {
|
|
5986
|
+
let frame;
|
|
5987
|
+
try {
|
|
5988
|
+
frame = JSON.parse(typeof ev.data === "string" ? ev.data : String(ev.data));
|
|
5989
|
+
} catch {
|
|
5990
|
+
return;
|
|
5991
|
+
}
|
|
5992
|
+
if (frame.ch !== "tasks" || !frame.name) return;
|
|
5993
|
+
try {
|
|
5994
|
+
onEvent({
|
|
5995
|
+
type: frame.name,
|
|
5996
|
+
payload: frame.data ?? {}
|
|
5997
|
+
});
|
|
5998
|
+
} catch {
|
|
5999
|
+
}
|
|
6000
|
+
};
|
|
6001
|
+
return { disconnect };
|
|
6002
|
+
}
|
|
5789
6003
|
};
|
|
5790
6004
|
var SkillsDraftClient = class {
|
|
5791
6005
|
constructor(_r) {
|
|
@@ -5817,6 +6031,81 @@ var SkillsClient = class {
|
|
|
5817
6031
|
this.draft = new SkillsDraftClient(_r);
|
|
5818
6032
|
}
|
|
5819
6033
|
};
|
|
6034
|
+
var PkfClient = class {
|
|
6035
|
+
constructor(_r, _fetchAuthed) {
|
|
6036
|
+
this._r = _r;
|
|
6037
|
+
this._fetchAuthed = _fetchAuthed;
|
|
6038
|
+
}
|
|
6039
|
+
async materialize(input) {
|
|
6040
|
+
return this._r("POST", "/api/pkf/materializations", input);
|
|
6041
|
+
}
|
|
6042
|
+
async getMaterialization(query) {
|
|
6043
|
+
return this._r("GET", "/api/pkf/materializations", void 0, {
|
|
6044
|
+
workspaceId: query.workspaceId,
|
|
6045
|
+
idempotencyKey: query.idempotencyKey,
|
|
6046
|
+
targetKind: query.targetKind
|
|
6047
|
+
});
|
|
6048
|
+
}
|
|
6049
|
+
async discoverMaterialization(query) {
|
|
6050
|
+
return this._r("GET", "/api/pkf/materializations", void 0, {
|
|
6051
|
+
workspaceId: query.workspaceId,
|
|
6052
|
+
messageId: query.source.messageId,
|
|
6053
|
+
blockId: query.source.blockId,
|
|
6054
|
+
blockRevision: String(query.source.blockRevision),
|
|
6055
|
+
sourceHash: query.source.sourceHash,
|
|
6056
|
+
targetKind: query.targetKind
|
|
6057
|
+
});
|
|
6058
|
+
}
|
|
6059
|
+
/** Atomically commit a PKF root plus its exact root-bound dependency graph. */
|
|
6060
|
+
async commitBundle(input) {
|
|
6061
|
+
return this._r("POST", "/api/pkf/bundles/commit", input);
|
|
6062
|
+
}
|
|
6063
|
+
/** Restore the caller-scoped durable bundle receipt after process restart. */
|
|
6064
|
+
async getBundle(query) {
|
|
6065
|
+
return this._r("GET", "/api/pkf/bundles/commit", void 0, {
|
|
6066
|
+
workspaceId: query.workspaceId,
|
|
6067
|
+
idempotencyKey: query.idempotencyKey
|
|
6068
|
+
});
|
|
6069
|
+
}
|
|
6070
|
+
async getArtifactRelations(query) {
|
|
6071
|
+
const rootKind = encodeURIComponent(query.rootKind);
|
|
6072
|
+
const rootId = encodeURIComponent(query.rootId);
|
|
6073
|
+
return this._r(
|
|
6074
|
+
"GET",
|
|
6075
|
+
`/api/pkf/artifacts/${rootKind}/${rootId}/relations`,
|
|
6076
|
+
void 0,
|
|
6077
|
+
{ workspaceId: query.workspaceId, revision: String(query.revision) }
|
|
6078
|
+
);
|
|
6079
|
+
}
|
|
6080
|
+
async getResourceDetail(query) {
|
|
6081
|
+
return this._r("GET", "/api/pkf/resources/detail", void 0, pkfResourceReadParams(query));
|
|
6082
|
+
}
|
|
6083
|
+
/**
|
|
6084
|
+
* Read root-authorized dependency bytes. This intentionally returns the raw
|
|
6085
|
+
* Response so callers can stream the body and verify `X-Asset-Hash`.
|
|
6086
|
+
*/
|
|
6087
|
+
async getResourceBytes(query) {
|
|
6088
|
+
const params = new URLSearchParams(pkfResourceReadParams(query));
|
|
6089
|
+
return this._fetchAuthed(`/api/pkf/resources/bytes?${params.toString()}`);
|
|
6090
|
+
}
|
|
6091
|
+
/** Low-level canonical request seam used by the Cloud CLI. */
|
|
6092
|
+
async request(method, path, body, query) {
|
|
6093
|
+
return this._r(method, path, body, query);
|
|
6094
|
+
}
|
|
6095
|
+
};
|
|
6096
|
+
function pkfResourceReadParams(query) {
|
|
6097
|
+
const params = {
|
|
6098
|
+
workspaceId: query.workspaceId,
|
|
6099
|
+
rootKind: query.rootKind,
|
|
6100
|
+
rootId: query.rootId,
|
|
6101
|
+
rootRevision: String(query.rootRevision),
|
|
6102
|
+
rootHash: query.rootHash
|
|
6103
|
+
};
|
|
6104
|
+
if (typeof query.targetAssetId === "string") params.targetAssetId = query.targetAssetId;
|
|
6105
|
+
else if (typeof query.targetHash === "string") params.targetHash = query.targetHash;
|
|
6106
|
+
else throw new TypeError("PKF resource read requires exactly one target locator");
|
|
6107
|
+
return params;
|
|
6108
|
+
}
|
|
5820
6109
|
var IMClient = class {
|
|
5821
6110
|
constructor(request, wsBase, fetchFn, getAuthHeaders, offlineManager, communityHubConfig) {
|
|
5822
6111
|
this._request = request;
|
|
@@ -5895,6 +6184,7 @@ var PrismerClient = class {
|
|
|
5895
6184
|
this.timeout = config.timeout || 3e4;
|
|
5896
6185
|
this.fetchFn = config.fetch || fetch;
|
|
5897
6186
|
this.imAgent = config.imAgent;
|
|
6187
|
+
this.imWorkspace = config.imWorkspace;
|
|
5898
6188
|
if (config.identity) {
|
|
5899
6189
|
if (config.identity === "auto" && this.apiKey) {
|
|
5900
6190
|
this._identityReady = import_aip_sdk.AIPIdentity.fromApiKey(this.apiKey).then((id) => {
|
|
@@ -5952,6 +6242,10 @@ var PrismerClient = class {
|
|
|
5952
6242
|
this._offlineManager,
|
|
5953
6243
|
config.community ?? null
|
|
5954
6244
|
);
|
|
6245
|
+
this.pkf = new PkfClient(
|
|
6246
|
+
(method, path, body, query, opts) => this._request(method, path, body, query, opts),
|
|
6247
|
+
(path, init) => this.fetchAuthed(path, init)
|
|
6248
|
+
);
|
|
5955
6249
|
this.workspaces = this.im.workspaces;
|
|
5956
6250
|
this.invites = this.im.invites;
|
|
5957
6251
|
this.projects = this.im.projects;
|
|
@@ -5987,10 +6281,13 @@ var PrismerClient = class {
|
|
|
5987
6281
|
}, query, opts);
|
|
5988
6282
|
}
|
|
5989
6283
|
/** Build auth headers for raw HTTP requests (used by file upload) */
|
|
5990
|
-
_getAuthHeaders() {
|
|
6284
|
+
_getAuthHeaders(authority = "im") {
|
|
5991
6285
|
const headers = {};
|
|
5992
6286
|
if (this.apiKey) headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
5993
|
-
if (this.imAgent)
|
|
6287
|
+
if (this.imAgent) {
|
|
6288
|
+
headers[authority === "pkf" ? "X-Prismer-Agent" : "X-IM-Agent"] = this.imAgent;
|
|
6289
|
+
}
|
|
6290
|
+
if (this.imWorkspace) headers["X-IM-Workspace"] = this.imWorkspace;
|
|
5994
6291
|
return headers;
|
|
5995
6292
|
}
|
|
5996
6293
|
/**
|
|
@@ -6013,16 +6310,17 @@ var PrismerClient = class {
|
|
|
6013
6310
|
*
|
|
6014
6311
|
* The path may be absolute (`/api/...`) or a full URL — full URLs are used
|
|
6015
6312
|
* verbatim (useful for following 302 redirects), otherwise the path is
|
|
6016
|
-
* appended to the client's configured `baseUrl`. Authorization
|
|
6017
|
-
*
|
|
6018
|
-
*
|
|
6313
|
+
* appended to the client's configured `baseUrl`. Authorization plus the
|
|
6314
|
+
* authority-specific agent header are added automatically: canonical PKF
|
|
6315
|
+
* requests use `X-Prismer-Agent`, while legacy `/api/im/*` keeps
|
|
6316
|
+
* `X-IM-Agent`. Caller-supplied headers override them on collision.
|
|
6019
6317
|
*
|
|
6020
6318
|
* Use this for binary downloads / partial fetches; for normal JSON-envelope
|
|
6021
6319
|
* IM requests use `client.im.request()` (typed) or the typed sub-clients.
|
|
6022
6320
|
*/
|
|
6023
6321
|
async fetchAuthed(url, init) {
|
|
6024
6322
|
const fullUrl = /^https?:\/\//i.test(url) ? url : `${this.baseUrl}${url}`;
|
|
6025
|
-
const authHeaders = this._getAuthHeaders();
|
|
6323
|
+
const authHeaders = this._getAuthHeaders(/\/api\/pkf\//.test(url) ? "pkf" : "im");
|
|
6026
6324
|
const callerHeaders = {};
|
|
6027
6325
|
if (init?.headers) {
|
|
6028
6326
|
const h = init.headers;
|
|
@@ -6055,7 +6353,10 @@ var PrismerClient = class {
|
|
|
6055
6353
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
6056
6354
|
}
|
|
6057
6355
|
if (this.imAgent) {
|
|
6058
|
-
headers["X-IM-Agent"] = this.imAgent;
|
|
6356
|
+
headers[path.startsWith("/api/pkf/") ? "X-Prismer-Agent" : "X-IM-Agent"] = this.imAgent;
|
|
6357
|
+
}
|
|
6358
|
+
if (this.imWorkspace) {
|
|
6359
|
+
headers["X-IM-Workspace"] = this.imWorkspace;
|
|
6059
6360
|
}
|
|
6060
6361
|
if (opts?.headers) {
|
|
6061
6362
|
for (const [k, v] of Object.entries(opts.headers)) headers[k] = v;
|
|
@@ -6196,6 +6497,7 @@ function createClient(config) {
|
|
|
6196
6497
|
MessagesClient,
|
|
6197
6498
|
MetricsClient,
|
|
6198
6499
|
OfflineManager,
|
|
6500
|
+
PkfClient,
|
|
6199
6501
|
PrismerClient,
|
|
6200
6502
|
ProjectMembersClient,
|
|
6201
6503
|
ProjectsClient,
|