bailian-cli-core 2.1.0 → 2.2.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/dist/index.d.mts +21 -0
- package/dist/index.mjs +12 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4005,6 +4005,27 @@ interface SecurityAlertList {
|
|
|
4005
4005
|
//#region src/utils/filename.d.ts
|
|
4006
4006
|
export declare function generateFilename(prefix: string, prompt: string): string;
|
|
4007
4007
|
//#endregion
|
|
4008
|
+
//#region src/utils/agent-home.d.ts
|
|
4009
|
+
/**
|
|
4010
|
+
* Resolve the Hermes Agent home directory the same way Hermes itself does
|
|
4011
|
+
* (hermes-agent `hermes_constants.get_hermes_home` → `get_process_hermes_home`):
|
|
4012
|
+
*
|
|
4013
|
+
* 1. `HERMES_HOME` env var (trimmed, leading `~` expanded), when set;
|
|
4014
|
+
* 2. otherwise the platform-native default:
|
|
4015
|
+
* - Windows: `%LOCALAPPDATA%\hermes` (falling back to `~/AppData/Local/hermes`);
|
|
4016
|
+
* - Linux/macOS: `~/.hermes`.
|
|
4017
|
+
*
|
|
4018
|
+
* Every code path that touches Hermes config — the writer, the inventory probe,
|
|
4019
|
+
* detail extraction and skill roots — must resolve through this helper.
|
|
4020
|
+
* Hard-coding `~/.hermes` silently writes config to a place Hermes never reads
|
|
4021
|
+
* when `HERMES_HOME` is customized or on native Windows, so the command reports
|
|
4022
|
+
* success while the model/provider change never takes effect.
|
|
4023
|
+
*
|
|
4024
|
+
* `home` overrides the user home used for the platform fallback (defaults to
|
|
4025
|
+
* `homedir()`), so callers and tests can inject a temporary home.
|
|
4026
|
+
*/
|
|
4027
|
+
export declare function getHermesHome(home?: string): string;
|
|
4028
|
+
//#endregion
|
|
4008
4029
|
//#region src/utils/output-dir.d.ts
|
|
4009
4030
|
/**
|
|
4010
4031
|
* Resolve the output directory for generated files.
|
package/dist/index.mjs
CHANGED
|
@@ -23,11 +23,11 @@ plan=ptu 必须提供 --charge-type,且只能为 pre_paid 或 post_paid。`:e.
|
|
|
23
23
|
--service-tier 只能为 ptu_fast 或 ptu_default。`:e.serviceTier===`ptu_default`&&e.chargeType===q.POST_PAID?`ptu_default only supports pre_paid.
|
|
24
24
|
ptu_default 仅支持 pre_paid。`:e.chargeType===q.POST_PAID&&es(e)?`Prepaid flags are not allowed with --charge-type post_paid.
|
|
25
25
|
--charge-type post_paid 不允许提供预付费参数。`:Qo(e,!0)??ts(e,e.chargeType===q.PRE_PAID):`--thinking-output-tpm is not supported by current reservation models.
|
|
26
|
-
当前吞吐预留模型不支持 --thinking-output-tpm。`},async resolve(e){let t={charge_type:e.flags.chargeType,ptu_capacity:$o(e.flags)};e.flags.serviceTier!==void 0&&(t.service_tier=e.flags.serviceTier),e.flags.suffix!==void 0&&(t.suffix=e.flags.suffix);let n=ns(e.flags);return n!==void 0&&(t.pre_paid_info=n),{body:t}}},as={name:K.MU,validateFlags(){},async resolve(e){let t=e.flags.billingMethod||Zo,n=e.flags.deploySpec,r=e.flags.capacity;if(!e.dryRun&&!n){let i=()=>new P(`No mu-plan template found for model "${e.model}". Run \`${e.binName} deploy models --source base\` to inspect available models, or pass --deploy-spec explicitly.`,N.USAGE);try{let a=await Go(e.client,{modelSource:`base`,pageSize:100,version:`v1.0`}),o=((a.output??a.data)?.models??[]).find(t=>t.model_name===e.model)?.plans?.find(({plan:e})=>e===K.MU)?.templates??[];if(o.length===0)throw i();let s=t===Xo.POST_PAY?q.POST_PAID:q.PRE_PAID,c=o.find(e=>e.charge_type===s)??o[0];if(!c?.deploy_spec&&!c?.template_id)throw i();n=c.deploy_spec??c.template_id,r===void 0&&(r=c.roles?.unified?.capacity_unit_per_instance??1)}catch(e){throw e instanceof P?e:new P(`Failed to auto-pick template for plan=mu: ${e.message}. Pass --deploy-spec explicitly.`,N.USAGE)}}let i={capacity:r??1,billing_method:t};return n&&(i.deploy_spec=n),{body:i}}},os={[K.LORA]:rs,[K.PTU]:is,[K.MU]:as};function ss(e){let t=os[e];if(!t)throw new P(`Unsupported plan "${e}". Supported plans: ${Object.keys(os).join(`, `)}.`,N.USAGE);return t}const cs=`zeldaEasy.broadscope-platform.modelInstance.startModelService`,ls=`zeldaEasy.broadscope-platform.modelInstance.stopModelService`,us=`zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel`;async function ds(e,t){return U(await e.console(cs,{input:{modelServiceId:t}}))}async function fs(e,t){return U(await e.console(ls,{input:{modelServiceId:t}}))}async function ps(e){let t=[],n=1;for(;;){let r=U(await e.console(us,{input:{pageNo:n,pageSize:50}})),i=r.records??[];t.push(...i);let a=r.pageCount??1;if(n>=a||i.length===0)break;n++}return t}function ms(e,t){return e.find(e=>e.modelServiceId===t||e.deployedModel===t||e.deployed_model===t)}const hs=`speech-biasing`;function gs(e,t){return{model:hs,input:{action:e,...t}}}async function _s(e,t,n,r){return e.requestJson({path:qn(),method:`POST`,body:gs(t,n),signal:r})}function vs(e,t,n){return _s(e,`create_vocabulary`,{target_model:t.targetModel,prefix:t.prefix,vocabulary:t.vocabulary},n)}function ys(e,t={},n){let r={};return t.prefix!==void 0&&(r.prefix=t.prefix),t.pageIndex!==void 0&&(r.page_index=t.pageIndex),t.pageSize!==void 0&&(r.page_size=t.pageSize),_s(e,`list_vocabulary`,r,n)}function bs(e,t,n){return _s(e,`query_vocabulary`,{vocabulary_id:t},n)}function xs(e,t,n,r){return _s(e,`update_vocabulary`,{vocabulary_id:t,vocabulary:n},r)}function Ss(e,t,n){return _s(e,`delete_vocabulary`,{vocabulary_id:t},n)}function Cs(e,t){try{return JSON.parse(e)}catch(e){throw new F(`${t} is not valid JSON — ${e.message}`)}}function ws(e){let t=Cs(e,`--vocabulary`);if(!t||typeof t!=`object`||Array.isArray(t))throw new F(`--vocabulary must decode to a JSON object of word→weight.`);for(let[e,n]of Object.entries(t))if(typeof n!=`number`||!Number.isFinite(n))throw new F(`--vocabulary weight for "${e}" must be a number.`);return t}function Ts(e,t){let n=`--words`,r=Cs(e,n),i;if(Array.isArray(r))i=r.map((e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw new F(`${n} entry #${t} must be an object with string "text" and number "weight".`);let r=e;if(typeof r.text!=`string`||typeof r.weight!=`number`)throw new F(`${n} entry #${t} must have a string "text" and a number "weight".`);if(!Number.isFinite(r.weight))throw new F(`${n} entry #${t} weight must be a finite number.`);return{text:r.text,weight:r.weight,...typeof r.lang==`string`?{lang:r.lang}:{}}});else if(!r||typeof r!=`object`)throw new F(`${n} must decode to a JSON object or array.`);else{i=[];for(let[e,a]of Object.entries(r)){if(typeof a!=`number`||!Number.isFinite(a))throw new F(`${n} weight for "${e}" must be a number.`);i.push({text:e,weight:a,...t?{lang:t}:{}})}}if(i.length===0)throw new F(`${n} must contain at least one hot word.`);return i}const Es={output:{type:`string`,valueHint:`<format>`,description:{"en-US":`Output format: text, json`,"zh-CN":`输出格式:text、json`}},timeout:{type:`number`,valueHint:`<seconds>`,description:{"en-US":`Request timeout`,"zh-CN":`请求超时时间`}},quiet:{type:`switch`,description:{"en-US":`Suppress non-essential output`,"zh-CN":`隐藏非必要输出`}},verbose:{type:`switch`,description:{"en-US":`Print HTTP request/response details`,"zh-CN":`打印 HTTP 请求和响应详情`}},dryRun:{type:`switch`,description:{"en-US":`Dry run mode`,"zh-CN":`仅预览,不实际执行`}},config:{type:`string`,valueHint:`<name>`,description:{"en-US":`Use a config profile for this command`,"zh-CN":`为当前命令使用指定配置 Profile`}},help:{type:`switch`,description:{"en-US":`Show help`,"zh-CN":`显示帮助信息`}},version:{type:`switch`,description:{"en-US":`Print version`,"zh-CN":`显示版本信息`}}},Ds={concurrent:{type:`number`,valueHint:`<n>`,description:{"en-US":`Run N parallel requests (default: 1)`,"zh-CN":`并行发送 N 个请求(默认:1)`}}},Os={async:{type:`switch`,description:{"en-US":`Return async task id without waiting`,"zh-CN":`直接返回异步任务 ID,不等待任务完成`}}},ks={apiKey:{type:`string`,valueHint:`<key>`,description:{"en-US":`API key`,"zh-CN":`API Key`}},baseUrl:{type:`string`,valueHint:`<url>`,description:{"en-US":`API base URL`,"zh-CN":`API Base URL`}}},As={consoleRegion:{type:`string`,valueHint:`<region>`,description:{"en-US":`Console gateway region (e.g. cn-beijing, ap-southeast-1)`,"zh-CN":`控制台网关地域(例如 cn-beijing、ap-southeast-1)`}},consoleSite:{type:`string`,valueHint:`<site>`,description:{"en-US":`Console site: domestic, international`,"zh-CN":`控制台站点:domestic、international`}},consoleSwitchAgent:{type:`number`,valueHint:`<uid>`,description:{"en-US":`Switch agent UID for delegated access`,"zh-CN":`切换代理访问的 UID`}},workspaceId:{type:`string`,valueHint:`<id>`,description:{"en-US":`Workspace ID (env: BAILIAN_WORKSPACE_ID)`,"zh-CN":`Workspace ID(环境变量:BAILIAN_WORKSPACE_ID)`}}},js={accessKeyId:{type:`string`,valueHint:`<key>`,description:{"en-US":`Alibaba Cloud Access Key ID (env: ALIBABA_CLOUD_ACCESS_KEY_ID)`,"zh-CN":`阿里云 Access Key ID(环境变量:ALIBABA_CLOUD_ACCESS_KEY_ID)`}},accessKeySecret:{type:`string`,valueHint:`<key>`,description:{"en-US":`Alibaba Cloud Access Key Secret (env: ALIBABA_CLOUD_ACCESS_KEY_SECRET)`,"zh-CN":`阿里云 Access Key Secret(环境变量:ALIBABA_CLOUD_ACCESS_KEY_SECRET)`}},securityToken:{type:`string`,valueHint:`<token>`,description:{"en-US":`Alibaba Cloud STS Security Token (env: ALIBABA_CLOUD_SECURITY_TOKEN)`,"zh-CN":`阿里云 STS Security Token(环境变量:ALIBABA_CLOUD_SECURITY_TOKEN)`}}};function Ms(e){return e.auth===`apiKey`?ks:e.auth===`console`?As:e.auth===`openapi`?js:{}}function Ns(e){return e}const Ps=1;function Fs(e,t){return e.normalize(`NFKC`).replace(/[\\/:*?"<>|]/g,`_`).replace(/\s+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}function Is(e,t){return`${Fs(e||`image`,`image`)}_${Fs((t||``).substring(0,20),`untitled`)}_${Date.now()}`}const Ls=()=>g(f(),`bailian-output`);function Rs(e,t){let n=t?.flagDir||e.outputDir||Ls(),r=t?.subDir?g(n,t.subDir):n;return i(r)||a(r,{recursive:!0}),r}function zs(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function Bs(e){return o(e===`-`?0:e,`utf-8`)}async function Vs(e,t){let n=[],r=0;async function i(){for(;r<e.length;){let t=r++;n[t]=await e[t]()}}let a=Array.from({length:Math.min(t,e.length)},()=>i());return await Promise.all(a),n}function Hs(e,t=`boolean`){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}throw new P(`Invalid ${t} value "${String(e)}". Use true or false.`,N.USAGE)}function Us(e,t=`boolean`){if(e!=null)return Hs(e,t)}function Ws(e,t,n=`boolean`){let r=Us(e,n);return r===void 0?t:r}function Gs(e,t){return Us(e,`watermark`)??t??!0}function Ks(e){let t={command:e.command,timestamp:(/* @__PURE__ */ new Date()).toISOString(),durationMs:e.durationMs,success:e.success,cliVersion:e.cliVersion,nodeVersion:process.version,os:process.platform};return e.authMethod&&(t.authMethod=e.authMethod),!e.success&&e.error&&(e.error.message&&(t.errorMessage=e.error.message),e.error.exitCode!==void 0&&(t.exitCode=e.error.exitCode),e.error.httpStatus!==void 0&&(t.httpStatus=e.error.httpStatus),e.error.requestId&&(t.requestId=e.error.requestId)),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),t}function qs(e){if(e==null)return;let t=typeof e==`string`?e:JSON.stringify(e);return t.length<=500?t:t.slice(0,500)}function Js(e){let{command:t,params:n,...r}=e,i={et:`EXP`,ext:r,c1:n,c2:e.success?`success`:`failure`};return e.httpStatus!==void 0&&(i.c3=String(e.httpStatus)),e.errorMessage&&(i.c4=qs(e.errorMessage)),e.requestId&&(i.c5=e.requestId),i}let J;function Ys(){return J||(process.env.NODE_ENV===`development`?(J=`dev`,J):process.env.BAILIAN_COMPILED===`1`?(J=`prod`,J):(J=import.meta.url.includes(`/node_modules/`)?`prod`:`dev`,J))}var Xs=/* @__PURE__ */ De(((e,t)=>{t.exports=(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=8)})([function(e,t){e.exports=Ae(`os`)},function(e,t){e.exports=globalThis.fetch},function(e,t,n){e.exports=n(6)},function(e,t){e.exports=Ae(`dns`)},function(e,t){e.exports=Ae(`util`)},function(e,t){e.exports=Ae(`crypto`)},function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=n(7),i=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},a=(e,t)=>{t.appName=`360 Spider`,t.appVersion=e.value,t.deviceBrand=`360`,t.deviceType=`bot`,t.platform=`other`},o=(e,t)=>{t.appName=`BingBot`,t.appVersion=e.value,t.deviceBrand=`Microsoft`,t.deviceType=`bot`,t.platform=`other`},s=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},c=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},l=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},u=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},d=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},f=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},p=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},m=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},h=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},g=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},_=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},v=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},y=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},b=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},ee=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},te=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},ne=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},x=(e,t)=>{t.appName=`360 Spider`,t.appVersion=e.value,t.deviceBrand=`360`,t.deviceType=`bot`,t.platform=`other`},re=(e,t)=>{t.appName=`BingBot`,t.appVersion=e.value,t.deviceBrand=`Microsoft`,t.deviceType=`bot`,t.platform=`other`},S=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},ie=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},ae=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},oe=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},C=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},w=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},T=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},E=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},D=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},se=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},ce=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},O=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},le=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},k=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},ue=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},A=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},j=/* @__PURE__ */ new Map,M=/* @__PURE__ */ new Map;j.set(`Baiduspider-render`,i),j.set(`Baiduspider+`,i),j.set(`Baiduspider-image+`,i),j.set(`360Spider`,a),j.set(`360Spider-Image`,a),j.set(`bingbot`,o),j.set(`Googlebot`,s),j.set(`YandexRenderResourcesBot`,c),j.set(`spider`,l),j.set(`Dataprovider.com`,u),j.set(`AhrefsBot`,d),j.set(`BitSightBot`,f),j.set(`oBot`,p),j.set(`Cincraw`,m),j.set(`DingTalkBot-LinkService`,h),j.set(`YisouSpider`,g),j.set(`Bytespider`,_),j.set(`ev-crawler`,v),j.set(`bitdiscovery`,y),j.set(`Spider`,b),j.set(`Ai2Bot-Dolma`,ee),j.set(`dianjing_ad_spider`,te),M.set(`Baiduspider-render`,ne),M.set(`Baiduspider+`,ne),M.set(`Baiduspider-image+`,ne),M.set(`360Spider`,x),M.set(`360Spider-Image`,x),M.set(`bingbot`,re),M.set(`Googlebot`,S),M.set(`YandexRenderResourcesBot`,ie),M.set(`spider`,ae),M.set(`Dataprovider.com`,oe),M.set(`AhrefsBot`,C),M.set(`BitSightBot`,w),M.set(`oBot`,T),M.set(`Cincraw`,E),M.set(`DingTalkBot-LinkService`,D),M.set(`YisouSpider`,se),M.set(`Bytespider`,ce),M.set(`ev-crawler`,O),M.set(`bitdiscovery`,le),M.set(`Spider`,k),M.set(`Ai2Bot-Dolma`,ue),M.set(`dianjing_ad_spider`,A);let de={productHandlerMap:j,commentHandlerMap:M,getSpecialProductHandler:()=>null,getSpecialCommentHandler:()=>null,getDefaultModelHandler:()=>null};t.isBot=function(e){let t=r.createUAInfo();return r.runTask(e,t,de),t.deviceType===`bot`}},function(e,t){function n(e){let t=[],n={parent:e,tokens:t,get firstToken(){return t.length===0?null:t[0]},getNewToken(r){let i=(function(){let e=[],t=[],n=[],r=null,i=null,a=null,o=!0,s=!0,c=!0,l=null,u={get key(){return o&&=(r=e.join(``),!1),r},get value(){return s&&=(i=t.join(``),!1),i},get originValue(){return c&&=(a=n.join(``),!1),a},previousToken:null,properties:null,appendKey(t){e.push(t),o=!0},appendValue(e){t.push(e===`_`?`.`:e),n.push(e),s=!0,c=!0,l=null},getSplitValue(e){if(l===null){let e=u.value;l=e===``?[]:e.split(`/`)}return e>=0&&e<l.length?l[e]:null},getPreviousNTokens(e){let t=[],n=u;for(let r=0;r<e;r++){if(n==null)return null;t.unshift(n.key),n=n.previousToken}return t.join(` `)}};return u})();return t.push(i),i.previousToken=r===void 0?t.length>1?t[t.length-2]:null:r,e&&(e.properties=n),i},getLastToken:()=>t.length===0?null:t[t.length-1],getFirstToken:()=>t.length===0?null:t[0],isEmpty:()=>t.length===0};return n}function r(){return{appName:null,appVersion:null,browserName:null,browserVersion:null,engineName:null,engineVersion:null,deviceBrand:null,deviceModel:null,deviceType:`mobile`,osName:null,osVersion:null,platform:`web`,tokenGroup:n(null)}}let i=new Set(` ;,"'`.split(``)),a=new Set(`/=:`.split(``)),o=/* @__PURE__ */ new Set([`Mozilla`,`AppleWebKit`,`Safari`,`Opera`,`Dalvik`,`com.ss.android.ugc.aweme`]);function s(e){return e.length===1&&i.has(e)}function c(e){return e.length===1&&a.has(e)}function l(e,t,n,r){if(e==null)return;let i=t.parent,a=e.key,s=null;if(i!=null){let e=i.key;o.has(e)?(s=r.commentHandlerMap.get(a)??null,s??=r.getSpecialCommentHandler(a),s==null&&a.endsWith(` Build`)&&(s=r.getDefaultModelHandler())):s=r.productHandlerMap.get(a)??r.getSpecialProductHandler(a)}else s=r.productHandlerMap.get(a)??r.getSpecialProductHandler(a);if(s!=null)try{s(e,n)}catch{}}function u(e,t,r){if(e==null)throw Error(`input can not be null`);return(function e(t,r,i,a,o){let u,d=null,f=null,p=!1,m=t.length,h=r>0?t[r-1]:`\0`;for(u=r;u<m;u++){let g=t[u];if(s(g)){let e=h!==`\0`&&s(h);if(!p&&r>0&&g===` `&&!e){let e=u+1;if(e<m){let n=t[e];/\d/.test(n)||n===`-`?p=!0:f?.appendKey(g)}else f?.appendKey(g)}else f!=null&&(d=f,f=null);h=g}else if(g===`(`){if(h===`(`){h=g;continue}let r=u;u=e(t,u+1,n(i.getLastToken()),a,o),f!=null&&(d=f,f=null),h=t[r]}else{if(g===`)`){if(r===0){h=g;continue}break}f??(l(i.getLastToken(),i,a,o),f=i.getNewToken(d),p=!1),c(g)?(p&&f.appendValue(g),p=!0):p?f.appendValue(g):f.appendKey(g),h=g}}return l(i.getLastToken(),i,a,o),u})(e,0,t.tokenGroup,t,r),t}Object.defineProperty(t,"DEFAULT_MODEL_HANDLER_KEY",{enumerable:!0,get:function(){return`DEFAULT_MODEL_HANDLER`}}),Object.defineProperty(t,"createUAInfo",{enumerable:!0,get:function(){return r}}),Object.defineProperty(t,"runTask",{enumerable:!0,get:function(){return u}})},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),a=n(1),o=n.n(a);n(2);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,t=arguments.length>1?arguments[1]:void 0;return t||=``,e?s(--e,`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`.charAt(Math.floor(60*Math.random()))+t):t}function c(e,t){for(var n in t)e[n]=t[n];return e}function l(e){return Object.prototype.toString.call(e)===`[object Object]`}function u(e){return typeof Promise<`u`&&e instanceof Promise}var d=Object.freeze({__aesBeforeSkip:1}),f=function(e){var t=Object.prototype.toString.call(e);if(t===`[object String]`&&e||t===`[object Number]`||t===`[object Boolean]`)return e;if(t===`[object Object]`||t===`[object Array]`)try{return JSON.stringify(e)}catch{}},p=function(e){var t={};for(var n in e){var r=e[n];r!==void 0&&(t[n]=f(r))}return t},m=function(e){var t=[];for(var n in e){var r=f(e[n]);r!==void 0&&t.push(`${n}=${encodeURIComponent(r)}`)}return t.join(`&`)};function h(e){return(e.requiredFields||[]).concat([`pid`]).some(function(t){return e[t]===void 0})}function g(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1?arguments[1]:void 0;typeof console<`u`&&console.warn(`日志解析报错,埋点将被丢弃 => ${e}`,t)}var _=`AEM_TRACKER_UNIQUE_PVID`,v=typeof globalThis<`u`&&globalThis?globalThis:typeof window<`u`&&window?window:typeof global<`u`&&global?global:typeof self<`u`&&self?self:(console.error(`Unable to locate global object in current environment`),{});function y(e){this._queue=[],this._reqQueue=[],this._plugins={},this._subscribers={onConfigUpdated:[]},this._timeout=0,this._config={sdk_version:`3.3.18`,set pv_id(e){v[_]=e},get pv_id(){return v[_]||(v[_]=s()),v[_]},timezone_offset:(/* @__PURE__ */ new Date()).getTimezoneOffset()},e&&(this._config=c(this._config,e))}y.prototype={constructor:y,_sendAll:function(){if(this._timeout&&=(clearTimeout(this._timeout),0),this._queue.length){var e,t=this._config.maxUrlLength||3e4,n=this._getSendConfig();try{e=this._processData(this._queue,n)}catch{}if(e&&e.length<t)return this._queue=[],void this.send(e);for(var r,i=[];this._queue.length;){i.push(this._queue.shift());try{r=this._processData(i,n)}catch(e){var a=i.pop();g(e.message,a);continue}if(r.length>t){i.length>1&&(this._queue.unshift(i.pop()),r=this._processData(i,n));break}}r&&this.send(r),this._queue.length&&this._sendAll()}},_send:function(e,t){var n=this;if(!1===t){var r;try{r=this._processData([e])}catch(t){g(t.message,e)}r&&this.send(r)}else{this._queue.push(e);var i=this._config.mergeRequestInterval||500;this._timeout||=setTimeout(function(){n._sendAll()},i)}},_getSendConfig:function(){var e={},t=this._config;for(var n in t)n!==`requiredFields`&&n!==`maxUrlLength`&&n!==`queueGlobalName`&&n!==`debug`&&n!==`excludeCrawlers`&&n!==`collectClientHints`&&n.indexOf(`plugin`)!==0&&t[n]!==``&&t[n]!==null&&t[n]!==void 0&&(e[n]=f(t[n]));return e},_processData:function(e,t){t||=this._getSendConfig();var n=m(t);return n+=`&msg=`+encodeURIComponent(e.map(function(e){return m(e)}).join(`|`))},setConfig:function(e,t){var n=this,r={};t===void 0?r=e:r[e]=t;var i=!(function e(t,n){if(t===void 0||n===void 0||!l(t)||!l(n))return!1;for(var r in t)if(l(t[r])){if(!e(t[r],n[r]))return!1}else if(t[r]!==n[r])return!1;return!0})(r,this._config),a=function(){if(i){for(var e in r)l(r[e])?n._config[e]=c(n._config[e]||{},r[e]):n._config[e]=r[e];n._execSubscribe(`onConfigUpdated`,[r,n._config])}};this._reqQueue.length?(a(),h(this._config)||(this._reqQueue.forEach(function(e){n._send.apply(n,e)}),this._reqQueue=[])):(i&&this._sendAll(),a())},getConfig:function(e){return e?this._config[e]:this._config},updatePVID:(function(e,t){if(typeof e!=`function`)throw TypeError(`Expected a function`);t=typeof t==`number`&&t>=0?t:100;var n=null;return function(){if(n===null){var r=this,i=Array.prototype.slice.call(arguments);n=setTimeout(function(){n=null},t),e.apply(r,i)}}})(function(){v[_]=s()},200),log:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e&&(t.ts=t.ts||(/* @__PURE__ */ new Date()).getTime(),t.type=e,this._print(`log`,e,t),t=p(t),h(this._config)?this._reqQueue.length<1e3&&this._reqQueue.push([t,n.combo]):this._send(t,n.combo))},before:function(e,t){var n=this;return function(){var r=arguments,i=t.apply(n,r);i!==d&&(u(i)?i.then(function(t){t!==d&&e.apply(n,t||r)}):e.apply(n,i||r))}},after:function(e,t){var n=this;return function(){var r=arguments;e.apply(n,r),t.apply(n,r)}},use:function(e,t){var n=this;return Object.prototype.toString.call(e)===`[object Array]`?e.map(function(e){if(Object.prototype.toString.call(e)===`[object Array]`){var t=e[0],r=e[1];return n._plugins[t]||(n._plugins[t]=new t(n,r))}return n._plugins[e]||(n._plugins[e]=new e(n))}):this._plugins[e]||(this._plugins[e]=new e(this,t))},_print:function(){this._config.debug&&typeof console<`u`&&console.log.apply(console,arguments)},onConfigUpdated:function(e){this._subscribers.onConfigUpdated&&this._subscribers.onConfigUpdated.push(e)},_execSubscribe:function(e,t){this._subscribers[e]&&this._subscribers[e].forEach(function(e){e.apply(this,t)})}};var b=y,ee=n(3),te=n.n(ee),ne=n(4),x=n(5),re=n.n(x);function S(e){return(S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e})(e)}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ie(Object(n),!0).forEach(function(t){oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oe(e,t,n){return(t=(function(e){var t=(function(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)})(e,`string`);return S(t)==`symbol`?t:t+``})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=T(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
当前吞吐预留模型不支持 --thinking-output-tpm。`},async resolve(e){let t={charge_type:e.flags.chargeType,ptu_capacity:$o(e.flags)};e.flags.serviceTier!==void 0&&(t.service_tier=e.flags.serviceTier),e.flags.suffix!==void 0&&(t.suffix=e.flags.suffix);let n=ns(e.flags);return n!==void 0&&(t.pre_paid_info=n),{body:t}}},as={name:K.MU,validateFlags(){},async resolve(e){let t=e.flags.billingMethod||Zo,n=e.flags.deploySpec,r=e.flags.capacity;if(!e.dryRun&&!n){let i=()=>new P(`No mu-plan template found for model "${e.model}". Run \`${e.binName} deploy models --source base\` to inspect available models, or pass --deploy-spec explicitly.`,N.USAGE);try{let a=await Go(e.client,{modelSource:`base`,pageSize:100,version:`v1.0`}),o=((a.output??a.data)?.models??[]).find(t=>t.model_name===e.model)?.plans?.find(({plan:e})=>e===K.MU)?.templates??[];if(o.length===0)throw i();let s=t===Xo.POST_PAY?q.POST_PAID:q.PRE_PAID,c=o.find(e=>e.charge_type===s)??o[0];if(!c?.deploy_spec&&!c?.template_id)throw i();n=c.deploy_spec??c.template_id,r===void 0&&(r=c.roles?.unified?.capacity_unit_per_instance??1)}catch(e){throw e instanceof P?e:new P(`Failed to auto-pick template for plan=mu: ${e.message}. Pass --deploy-spec explicitly.`,N.USAGE)}}let i={capacity:r??1,billing_method:t};return n&&(i.deploy_spec=n),{body:i}}},os={[K.LORA]:rs,[K.PTU]:is,[K.MU]:as};function ss(e){let t=os[e];if(!t)throw new P(`Unsupported plan "${e}". Supported plans: ${Object.keys(os).join(`, `)}.`,N.USAGE);return t}const cs=`zeldaEasy.broadscope-platform.modelInstance.startModelService`,ls=`zeldaEasy.broadscope-platform.modelInstance.stopModelService`,us=`zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel`;async function ds(e,t){return U(await e.console(cs,{input:{modelServiceId:t}}))}async function fs(e,t){return U(await e.console(ls,{input:{modelServiceId:t}}))}async function ps(e){let t=[],n=1;for(;;){let r=U(await e.console(us,{input:{pageNo:n,pageSize:50}})),i=r.records??[];t.push(...i);let a=r.pageCount??1;if(n>=a||i.length===0)break;n++}return t}function ms(e,t){return e.find(e=>e.modelServiceId===t||e.deployedModel===t||e.deployed_model===t)}const hs=`speech-biasing`;function gs(e,t){return{model:hs,input:{action:e,...t}}}async function _s(e,t,n,r){return e.requestJson({path:qn(),method:`POST`,body:gs(t,n),signal:r})}function vs(e,t,n){return _s(e,`create_vocabulary`,{target_model:t.targetModel,prefix:t.prefix,vocabulary:t.vocabulary},n)}function ys(e,t={},n){let r={};return t.prefix!==void 0&&(r.prefix=t.prefix),t.pageIndex!==void 0&&(r.page_index=t.pageIndex),t.pageSize!==void 0&&(r.page_size=t.pageSize),_s(e,`list_vocabulary`,r,n)}function bs(e,t,n){return _s(e,`query_vocabulary`,{vocabulary_id:t},n)}function xs(e,t,n,r){return _s(e,`update_vocabulary`,{vocabulary_id:t,vocabulary:n},r)}function Ss(e,t,n){return _s(e,`delete_vocabulary`,{vocabulary_id:t},n)}function Cs(e,t){try{return JSON.parse(e)}catch(e){throw new F(`${t} is not valid JSON — ${e.message}`)}}function ws(e){let t=Cs(e,`--vocabulary`);if(!t||typeof t!=`object`||Array.isArray(t))throw new F(`--vocabulary must decode to a JSON object of word→weight.`);for(let[e,n]of Object.entries(t))if(typeof n!=`number`||!Number.isFinite(n))throw new F(`--vocabulary weight for "${e}" must be a number.`);return t}function Ts(e,t){let n=`--words`,r=Cs(e,n),i;if(Array.isArray(r))i=r.map((e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw new F(`${n} entry #${t} must be an object with string "text" and number "weight".`);let r=e;if(typeof r.text!=`string`||typeof r.weight!=`number`)throw new F(`${n} entry #${t} must have a string "text" and a number "weight".`);if(!Number.isFinite(r.weight))throw new F(`${n} entry #${t} weight must be a finite number.`);return{text:r.text,weight:r.weight,...typeof r.lang==`string`?{lang:r.lang}:{}}});else if(!r||typeof r!=`object`)throw new F(`${n} must decode to a JSON object or array.`);else{i=[];for(let[e,a]of Object.entries(r)){if(typeof a!=`number`||!Number.isFinite(a))throw new F(`${n} weight for "${e}" must be a number.`);i.push({text:e,weight:a,...t?{lang:t}:{}})}}if(i.length===0)throw new F(`${n} must contain at least one hot word.`);return i}const Es={output:{type:`string`,valueHint:`<format>`,description:{"en-US":`Output format: text, json`,"zh-CN":`输出格式:text、json`}},timeout:{type:`number`,valueHint:`<seconds>`,description:{"en-US":`Request timeout`,"zh-CN":`请求超时时间`}},quiet:{type:`switch`,description:{"en-US":`Suppress non-essential output`,"zh-CN":`隐藏非必要输出`}},verbose:{type:`switch`,description:{"en-US":`Print HTTP request/response details`,"zh-CN":`打印 HTTP 请求和响应详情`}},dryRun:{type:`switch`,description:{"en-US":`Dry run mode`,"zh-CN":`仅预览,不实际执行`}},config:{type:`string`,valueHint:`<name>`,description:{"en-US":`Use a config profile for this command`,"zh-CN":`为当前命令使用指定配置 Profile`}},help:{type:`switch`,description:{"en-US":`Show help`,"zh-CN":`显示帮助信息`}},version:{type:`switch`,description:{"en-US":`Print version`,"zh-CN":`显示版本信息`}}},Ds={concurrent:{type:`number`,valueHint:`<n>`,description:{"en-US":`Run N parallel requests (default: 1)`,"zh-CN":`并行发送 N 个请求(默认:1)`}}},Os={async:{type:`switch`,description:{"en-US":`Return async task id without waiting`,"zh-CN":`直接返回异步任务 ID,不等待任务完成`}}},ks={apiKey:{type:`string`,valueHint:`<key>`,description:{"en-US":`API key`,"zh-CN":`API Key`}},baseUrl:{type:`string`,valueHint:`<url>`,description:{"en-US":`API base URL`,"zh-CN":`API Base URL`}}},As={consoleRegion:{type:`string`,valueHint:`<region>`,description:{"en-US":`Console gateway region (e.g. cn-beijing, ap-southeast-1)`,"zh-CN":`控制台网关地域(例如 cn-beijing、ap-southeast-1)`}},consoleSite:{type:`string`,valueHint:`<site>`,description:{"en-US":`Console site: domestic, international`,"zh-CN":`控制台站点:domestic、international`}},consoleSwitchAgent:{type:`number`,valueHint:`<uid>`,description:{"en-US":`Switch agent UID for delegated access`,"zh-CN":`切换代理访问的 UID`}},workspaceId:{type:`string`,valueHint:`<id>`,description:{"en-US":`Workspace ID (env: BAILIAN_WORKSPACE_ID)`,"zh-CN":`Workspace ID(环境变量:BAILIAN_WORKSPACE_ID)`}}},js={accessKeyId:{type:`string`,valueHint:`<key>`,description:{"en-US":`Alibaba Cloud Access Key ID (env: ALIBABA_CLOUD_ACCESS_KEY_ID)`,"zh-CN":`阿里云 Access Key ID(环境变量:ALIBABA_CLOUD_ACCESS_KEY_ID)`}},accessKeySecret:{type:`string`,valueHint:`<key>`,description:{"en-US":`Alibaba Cloud Access Key Secret (env: ALIBABA_CLOUD_ACCESS_KEY_SECRET)`,"zh-CN":`阿里云 Access Key Secret(环境变量:ALIBABA_CLOUD_ACCESS_KEY_SECRET)`}},securityToken:{type:`string`,valueHint:`<token>`,description:{"en-US":`Alibaba Cloud STS Security Token (env: ALIBABA_CLOUD_SECURITY_TOKEN)`,"zh-CN":`阿里云 STS Security Token(环境变量:ALIBABA_CLOUD_SECURITY_TOKEN)`}}};function Ms(e){return e.auth===`apiKey`?ks:e.auth===`console`?As:e.auth===`openapi`?js:{}}function Ns(e){return e}const Ps=1;function Fs(e,t){return e.normalize(`NFKC`).replace(/[\\/:*?"<>|]/g,`_`).replace(/\s+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}function Is(e,t){return`${Fs(e||`image`,`image`)}_${Fs((t||``).substring(0,20),`untitled`)}_${Date.now()}`}function Ls(e=f()){let t=process.env.HERMES_HOME?.trim();if(t)return Rs(t);if(process.platform===`win32`){let t=process.env.LOCALAPPDATA?.trim();return t?g(t,`hermes`):g(e,`AppData`,`Local`,`hermes`)}return g(e,`.hermes`)}function Rs(e){return e===`~`?f():e.startsWith(`~/`)||e.startsWith(`~\\`)?g(f(),e.slice(2)):e}const zs=()=>g(f(),`bailian-output`);function Bs(e,t){let n=t?.flagDir||e.outputDir||zs(),r=t?.subDir?g(n,t.subDir):n;return i(r)||a(r,{recursive:!0}),r}function Vs(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function Hs(e){return o(e===`-`?0:e,`utf-8`)}async function Us(e,t){let n=[],r=0;async function i(){for(;r<e.length;){let t=r++;n[t]=await e[t]()}}let a=Array.from({length:Math.min(t,e.length)},()=>i());return await Promise.all(a),n}function Ws(e,t=`boolean`){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}throw new P(`Invalid ${t} value "${String(e)}". Use true or false.`,N.USAGE)}function Gs(e,t=`boolean`){if(e!=null)return Ws(e,t)}function Ks(e,t,n=`boolean`){let r=Gs(e,n);return r===void 0?t:r}function qs(e,t){return Gs(e,`watermark`)??t??!0}function Js(e){let t={command:e.command,timestamp:(/* @__PURE__ */ new Date()).toISOString(),durationMs:e.durationMs,success:e.success,cliVersion:e.cliVersion,nodeVersion:process.version,os:process.platform};return e.authMethod&&(t.authMethod=e.authMethod),!e.success&&e.error&&(e.error.message&&(t.errorMessage=e.error.message),e.error.exitCode!==void 0&&(t.exitCode=e.error.exitCode),e.error.httpStatus!==void 0&&(t.httpStatus=e.error.httpStatus),e.error.requestId&&(t.requestId=e.error.requestId)),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),t}function Ys(e){if(e==null)return;let t=typeof e==`string`?e:JSON.stringify(e);return t.length<=500?t:t.slice(0,500)}function Xs(e){let{command:t,params:n,...r}=e,i={et:`EXP`,ext:r,c1:n,c2:e.success?`success`:`failure`};return e.httpStatus!==void 0&&(i.c3=String(e.httpStatus)),e.errorMessage&&(i.c4=Ys(e.errorMessage)),e.requestId&&(i.c5=e.requestId),i}let J;function Zs(){return J||(process.env.NODE_ENV===`development`?(J=`dev`,J):process.env.BAILIAN_COMPILED===`1`?(J=`prod`,J):(J=import.meta.url.includes(`/node_modules/`)?`prod`:`dev`,J))}var Qs=/* @__PURE__ */ De(((e,t)=>{t.exports=(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=8)})([function(e,t){e.exports=Ae(`os`)},function(e,t){e.exports=globalThis.fetch},function(e,t,n){e.exports=n(6)},function(e,t){e.exports=Ae(`dns`)},function(e,t){e.exports=Ae(`util`)},function(e,t){e.exports=Ae(`crypto`)},function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=n(7),i=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},a=(e,t)=>{t.appName=`360 Spider`,t.appVersion=e.value,t.deviceBrand=`360`,t.deviceType=`bot`,t.platform=`other`},o=(e,t)=>{t.appName=`BingBot`,t.appVersion=e.value,t.deviceBrand=`Microsoft`,t.deviceType=`bot`,t.platform=`other`},s=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},c=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},l=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},u=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},d=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},f=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},p=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},m=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},h=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},g=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},_=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},v=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},y=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},b=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},ee=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},te=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},ne=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},x=(e,t)=>{t.appName=`360 Spider`,t.appVersion=e.value,t.deviceBrand=`360`,t.deviceType=`bot`,t.platform=`other`},re=(e,t)=>{t.appName=`BingBot`,t.appVersion=e.value,t.deviceBrand=`Microsoft`,t.deviceType=`bot`,t.platform=`other`},S=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},ie=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},ae=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},oe=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},C=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},w=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},T=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},E=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},D=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},se=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},ce=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},O=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},le=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},k=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},ue=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},A=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},j=/* @__PURE__ */ new Map,M=/* @__PURE__ */ new Map;j.set(`Baiduspider-render`,i),j.set(`Baiduspider+`,i),j.set(`Baiduspider-image+`,i),j.set(`360Spider`,a),j.set(`360Spider-Image`,a),j.set(`bingbot`,o),j.set(`Googlebot`,s),j.set(`YandexRenderResourcesBot`,c),j.set(`spider`,l),j.set(`Dataprovider.com`,u),j.set(`AhrefsBot`,d),j.set(`BitSightBot`,f),j.set(`oBot`,p),j.set(`Cincraw`,m),j.set(`DingTalkBot-LinkService`,h),j.set(`YisouSpider`,g),j.set(`Bytespider`,_),j.set(`ev-crawler`,v),j.set(`bitdiscovery`,y),j.set(`Spider`,b),j.set(`Ai2Bot-Dolma`,ee),j.set(`dianjing_ad_spider`,te),M.set(`Baiduspider-render`,ne),M.set(`Baiduspider+`,ne),M.set(`Baiduspider-image+`,ne),M.set(`360Spider`,x),M.set(`360Spider-Image`,x),M.set(`bingbot`,re),M.set(`Googlebot`,S),M.set(`YandexRenderResourcesBot`,ie),M.set(`spider`,ae),M.set(`Dataprovider.com`,oe),M.set(`AhrefsBot`,C),M.set(`BitSightBot`,w),M.set(`oBot`,T),M.set(`Cincraw`,E),M.set(`DingTalkBot-LinkService`,D),M.set(`YisouSpider`,se),M.set(`Bytespider`,ce),M.set(`ev-crawler`,O),M.set(`bitdiscovery`,le),M.set(`Spider`,k),M.set(`Ai2Bot-Dolma`,ue),M.set(`dianjing_ad_spider`,A);let de={productHandlerMap:j,commentHandlerMap:M,getSpecialProductHandler:()=>null,getSpecialCommentHandler:()=>null,getDefaultModelHandler:()=>null};t.isBot=function(e){let t=r.createUAInfo();return r.runTask(e,t,de),t.deviceType===`bot`}},function(e,t){function n(e){let t=[],n={parent:e,tokens:t,get firstToken(){return t.length===0?null:t[0]},getNewToken(r){let i=(function(){let e=[],t=[],n=[],r=null,i=null,a=null,o=!0,s=!0,c=!0,l=null,u={get key(){return o&&=(r=e.join(``),!1),r},get value(){return s&&=(i=t.join(``),!1),i},get originValue(){return c&&=(a=n.join(``),!1),a},previousToken:null,properties:null,appendKey(t){e.push(t),o=!0},appendValue(e){t.push(e===`_`?`.`:e),n.push(e),s=!0,c=!0,l=null},getSplitValue(e){if(l===null){let e=u.value;l=e===``?[]:e.split(`/`)}return e>=0&&e<l.length?l[e]:null},getPreviousNTokens(e){let t=[],n=u;for(let r=0;r<e;r++){if(n==null)return null;t.unshift(n.key),n=n.previousToken}return t.join(` `)}};return u})();return t.push(i),i.previousToken=r===void 0?t.length>1?t[t.length-2]:null:r,e&&(e.properties=n),i},getLastToken:()=>t.length===0?null:t[t.length-1],getFirstToken:()=>t.length===0?null:t[0],isEmpty:()=>t.length===0};return n}function r(){return{appName:null,appVersion:null,browserName:null,browserVersion:null,engineName:null,engineVersion:null,deviceBrand:null,deviceModel:null,deviceType:`mobile`,osName:null,osVersion:null,platform:`web`,tokenGroup:n(null)}}let i=new Set(` ;,"'`.split(``)),a=new Set(`/=:`.split(``)),o=/* @__PURE__ */ new Set([`Mozilla`,`AppleWebKit`,`Safari`,`Opera`,`Dalvik`,`com.ss.android.ugc.aweme`]);function s(e){return e.length===1&&i.has(e)}function c(e){return e.length===1&&a.has(e)}function l(e,t,n,r){if(e==null)return;let i=t.parent,a=e.key,s=null;if(i!=null){let e=i.key;o.has(e)?(s=r.commentHandlerMap.get(a)??null,s??=r.getSpecialCommentHandler(a),s==null&&a.endsWith(` Build`)&&(s=r.getDefaultModelHandler())):s=r.productHandlerMap.get(a)??r.getSpecialProductHandler(a)}else s=r.productHandlerMap.get(a)??r.getSpecialProductHandler(a);if(s!=null)try{s(e,n)}catch{}}function u(e,t,r){if(e==null)throw Error(`input can not be null`);return(function e(t,r,i,a,o){let u,d=null,f=null,p=!1,m=t.length,h=r>0?t[r-1]:`\0`;for(u=r;u<m;u++){let g=t[u];if(s(g)){let e=h!==`\0`&&s(h);if(!p&&r>0&&g===` `&&!e){let e=u+1;if(e<m){let n=t[e];/\d/.test(n)||n===`-`?p=!0:f?.appendKey(g)}else f?.appendKey(g)}else f!=null&&(d=f,f=null);h=g}else if(g===`(`){if(h===`(`){h=g;continue}let r=u;u=e(t,u+1,n(i.getLastToken()),a,o),f!=null&&(d=f,f=null),h=t[r]}else{if(g===`)`){if(r===0){h=g;continue}break}f??(l(i.getLastToken(),i,a,o),f=i.getNewToken(d),p=!1),c(g)?(p&&f.appendValue(g),p=!0):p?f.appendValue(g):f.appendKey(g),h=g}}return l(i.getLastToken(),i,a,o),u})(e,0,t.tokenGroup,t,r),t}Object.defineProperty(t,"DEFAULT_MODEL_HANDLER_KEY",{enumerable:!0,get:function(){return`DEFAULT_MODEL_HANDLER`}}),Object.defineProperty(t,"createUAInfo",{enumerable:!0,get:function(){return r}}),Object.defineProperty(t,"runTask",{enumerable:!0,get:function(){return u}})},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),a=n(1),o=n.n(a);n(2);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,t=arguments.length>1?arguments[1]:void 0;return t||=``,e?s(--e,`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`.charAt(Math.floor(60*Math.random()))+t):t}function c(e,t){for(var n in t)e[n]=t[n];return e}function l(e){return Object.prototype.toString.call(e)===`[object Object]`}function u(e){return typeof Promise<`u`&&e instanceof Promise}var d=Object.freeze({__aesBeforeSkip:1}),f=function(e){var t=Object.prototype.toString.call(e);if(t===`[object String]`&&e||t===`[object Number]`||t===`[object Boolean]`)return e;if(t===`[object Object]`||t===`[object Array]`)try{return JSON.stringify(e)}catch{}},p=function(e){var t={};for(var n in e){var r=e[n];r!==void 0&&(t[n]=f(r))}return t},m=function(e){var t=[];for(var n in e){var r=f(e[n]);r!==void 0&&t.push(`${n}=${encodeURIComponent(r)}`)}return t.join(`&`)};function h(e){return(e.requiredFields||[]).concat([`pid`]).some(function(t){return e[t]===void 0})}function g(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1?arguments[1]:void 0;typeof console<`u`&&console.warn(`日志解析报错,埋点将被丢弃 => ${e}`,t)}var _=`AEM_TRACKER_UNIQUE_PVID`,v=typeof globalThis<`u`&&globalThis?globalThis:typeof window<`u`&&window?window:typeof global<`u`&&global?global:typeof self<`u`&&self?self:(console.error(`Unable to locate global object in current environment`),{});function y(e){this._queue=[],this._reqQueue=[],this._plugins={},this._subscribers={onConfigUpdated:[]},this._timeout=0,this._config={sdk_version:`3.3.18`,set pv_id(e){v[_]=e},get pv_id(){return v[_]||(v[_]=s()),v[_]},timezone_offset:(/* @__PURE__ */ new Date()).getTimezoneOffset()},e&&(this._config=c(this._config,e))}y.prototype={constructor:y,_sendAll:function(){if(this._timeout&&=(clearTimeout(this._timeout),0),this._queue.length){var e,t=this._config.maxUrlLength||3e4,n=this._getSendConfig();try{e=this._processData(this._queue,n)}catch{}if(e&&e.length<t)return this._queue=[],void this.send(e);for(var r,i=[];this._queue.length;){i.push(this._queue.shift());try{r=this._processData(i,n)}catch(e){var a=i.pop();g(e.message,a);continue}if(r.length>t){i.length>1&&(this._queue.unshift(i.pop()),r=this._processData(i,n));break}}r&&this.send(r),this._queue.length&&this._sendAll()}},_send:function(e,t){var n=this;if(!1===t){var r;try{r=this._processData([e])}catch(t){g(t.message,e)}r&&this.send(r)}else{this._queue.push(e);var i=this._config.mergeRequestInterval||500;this._timeout||=setTimeout(function(){n._sendAll()},i)}},_getSendConfig:function(){var e={},t=this._config;for(var n in t)n!==`requiredFields`&&n!==`maxUrlLength`&&n!==`queueGlobalName`&&n!==`debug`&&n!==`excludeCrawlers`&&n!==`collectClientHints`&&n.indexOf(`plugin`)!==0&&t[n]!==``&&t[n]!==null&&t[n]!==void 0&&(e[n]=f(t[n]));return e},_processData:function(e,t){t||=this._getSendConfig();var n=m(t);return n+=`&msg=`+encodeURIComponent(e.map(function(e){return m(e)}).join(`|`))},setConfig:function(e,t){var n=this,r={};t===void 0?r=e:r[e]=t;var i=!(function e(t,n){if(t===void 0||n===void 0||!l(t)||!l(n))return!1;for(var r in t)if(l(t[r])){if(!e(t[r],n[r]))return!1}else if(t[r]!==n[r])return!1;return!0})(r,this._config),a=function(){if(i){for(var e in r)l(r[e])?n._config[e]=c(n._config[e]||{},r[e]):n._config[e]=r[e];n._execSubscribe(`onConfigUpdated`,[r,n._config])}};this._reqQueue.length?(a(),h(this._config)||(this._reqQueue.forEach(function(e){n._send.apply(n,e)}),this._reqQueue=[])):(i&&this._sendAll(),a())},getConfig:function(e){return e?this._config[e]:this._config},updatePVID:(function(e,t){if(typeof e!=`function`)throw TypeError(`Expected a function`);t=typeof t==`number`&&t>=0?t:100;var n=null;return function(){if(n===null){var r=this,i=Array.prototype.slice.call(arguments);n=setTimeout(function(){n=null},t),e.apply(r,i)}}})(function(){v[_]=s()},200),log:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e&&(t.ts=t.ts||(/* @__PURE__ */ new Date()).getTime(),t.type=e,this._print(`log`,e,t),t=p(t),h(this._config)?this._reqQueue.length<1e3&&this._reqQueue.push([t,n.combo]):this._send(t,n.combo))},before:function(e,t){var n=this;return function(){var r=arguments,i=t.apply(n,r);i!==d&&(u(i)?i.then(function(t){t!==d&&e.apply(n,t||r)}):e.apply(n,i||r))}},after:function(e,t){var n=this;return function(){var r=arguments;e.apply(n,r),t.apply(n,r)}},use:function(e,t){var n=this;return Object.prototype.toString.call(e)===`[object Array]`?e.map(function(e){if(Object.prototype.toString.call(e)===`[object Array]`){var t=e[0],r=e[1];return n._plugins[t]||(n._plugins[t]=new t(n,r))}return n._plugins[e]||(n._plugins[e]=new e(n))}):this._plugins[e]||(this._plugins[e]=new e(this,t))},_print:function(){this._config.debug&&typeof console<`u`&&console.log.apply(console,arguments)},onConfigUpdated:function(e){this._subscribers.onConfigUpdated&&this._subscribers.onConfigUpdated.push(e)},_execSubscribe:function(e,t){this._subscribers[e]&&this._subscribers[e].forEach(function(e){e.apply(this,t)})}};var b=y,ee=n(3),te=n.n(ee),ne=n(4),x=n(5),re=n.n(x);function S(e){return(S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e})(e)}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ie(Object(n),!0).forEach(function(t){oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oe(e,t,n){return(t=(function(e){var t=(function(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)})(e,`string`);return S(t)==`symbol`?t:t+``})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=T(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
27
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function w(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}})(e,t)||T(e,t)||(function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
28
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function T(e,t){if(e){if(typeof e==`string`)return E(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function E(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(){for(var e=/(?:[0]{1,2}[:-]){5}[0]{1,2}/,t=i.a.networkInterfaces(),n=0,r=Object.entries(t);n<r.length;n++){var a=w(r[n],2),o=(a[0],a[1]);if(o){var s,c=C(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(!1===e.test(l.mac))return l.mac}}catch(e){c.e(e)}finally{c.f()}}}return`00:00:00:00:00:00`}var se,ce,O=(se=process.version,{os:i.a.type(),os_version:i.a.release(),app_name:`node`,app_version:se,device_id:re.a.createHash(`md5`).update(D()).digest(`hex`),platform:`node`}),le=(0,ne.promisify)(te.a.resolve);function k(e){this._offlineQueue=[],e.endpoint=e.endpoint||`gm.mmstat.com`,b.call(this,ae(ae({},O),e)),this._config.endpoint_url=`https://${this._config.endpoint}/aes.1.1`}k.prototype=((ce=function(){}).prototype=b.prototype,new ce),k.prototype.constructor=k,k.prototype.send=function(e){var t,n=this;return(t=this._config.endpoint,le(t)).then(function(t){return n._offlineQueue.forEach(function(e){n.send(e)}),n._offlineQueue=[],n._print(`send`,e),o()(n._config.endpoint_url,{method:`POST`,keepalive:!0,body:JSON.stringify({gokey:encodeURIComponent(e),gmkey:`EXP`})}).catch(function(){})}).catch(function(t){n._offlineQueue.length>500&&n._offlineQueue.shift(),n._offlineQueue.push(e)})},t.default=k}]).default}))
|
|
29
|
-
`,{mode:384})}catch{}}async function
|
|
30
|
-
`).filter(Boolean),n=[];for(let e of t)try{let t=
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function T(e,t){if(e){if(typeof e==`string`)return E(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function E(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(){for(var e=/(?:[0]{1,2}[:-]){5}[0]{1,2}/,t=i.a.networkInterfaces(),n=0,r=Object.entries(t);n<r.length;n++){var a=w(r[n],2),o=(a[0],a[1]);if(o){var s,c=C(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(!1===e.test(l.mac))return l.mac}}catch(e){c.e(e)}finally{c.f()}}}return`00:00:00:00:00:00`}var se,ce,O=(se=process.version,{os:i.a.type(),os_version:i.a.release(),app_name:`node`,app_version:se,device_id:re.a.createHash(`md5`).update(D()).digest(`hex`),platform:`node`}),le=(0,ne.promisify)(te.a.resolve);function k(e){this._offlineQueue=[],e.endpoint=e.endpoint||`gm.mmstat.com`,b.call(this,ae(ae({},O),e)),this._config.endpoint_url=`https://${this._config.endpoint}/aes.1.1`}k.prototype=((ce=function(){}).prototype=b.prototype,new ce),k.prototype.constructor=k,k.prototype.send=function(e){var t,n=this;return(t=this._config.endpoint,le(t)).then(function(t){return n._offlineQueue.forEach(function(e){n.send(e)}),n._offlineQueue=[],n._print(`send`,e),o()(n._config.endpoint_url,{method:`POST`,keepalive:!0,body:JSON.stringify({gokey:encodeURIComponent(e),gmkey:`EXP`})}).catch(function(){})}).catch(function(t){n._offlineQueue.length>500&&n._offlineQueue.shift(),n._offlineQueue.push(e)})},t.default=k}]).default})),$s=/* @__PURE__ */ De(((e,t)=>{t.exports=(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=0)})([function(e,t,n){n.r(t);var r=[`ec`,`ea`,`el`,`et`],i=function(e,t){var n=function(e){var n=e.ec,r=e.ea,i=e.el,a=e.et,o=a===void 0?`CLK`:a,s=e.xpath;delete e.ec,delete e.ea,delete e.el,delete e.et,delete e.xpath,e.p1=n,e.p2=r,e.p3=i,e.p4=o,e.p5=s;try{t.log(`event`,e)}catch{}};return function(){var t=arguments,i={};if(t.length!==0){for(var a=0;a<t.length;a++){var o,s,c=t[a];if(a!==0&&typeof c==`object`&&a!==t.length-1)return void(e==null||(o=e.console)==null||(s=o.warn)==null||s.call(o,`Only the last argument can be object type`));if(typeof c==`string`||typeof c==`number`)i[r[a]]=c;else if(typeof c==`object`&&a===t.length-1)for(var l in c)c.hasOwnProperty(l)&&(i[l]=c[l])}n(i)}else{var u,d;(u=e.console)==null||(d=u.warn)==null||d.call(u,`At lease one augument`)}}};t.default=function(e,t){return i(global,e)}}]).default})),ec=/* @__PURE__ */ ke(Qs(),1),tc=/* @__PURE__ */ ke($s(),1);const nc=()=>g(L(),`telemetry.jsonl`);let rc;const ic=/* @__PURE__ */ new Set;let ac;try{let e=new ec.default({pid:`bailian-cli-node`,env:Zs()}),t=e.send.bind(e);e.send=function(e){let n=t(e);if(n&&typeof n.then==`function`){let e=n;ic.add(e),e.finally(()=>ic.delete(e))}return n},ac=e,rc=e.use(tc.default)}catch{}async function oc(e=1e3){try{if(ac)try{typeof ac._sendAll==`function`&&ac._sendAll()}catch{}if(ic.size===0)return;let t=[...ic].map(e=>e.catch(()=>void 0));await Promise.race([Promise.allSettled(t),new Promise(t=>setTimeout(t,e).unref?.())])}catch{}}async function sc(e){try{await rt();let n=nc();try{l(n).size>5242880&&u(n)}catch{}t(n,JSON.stringify(e)+`
|
|
29
|
+
`,{mode:384})}catch{}}async function cc(e){try{if(!rc)return;rc(e.command,Xs(e))}catch{}}const lc=/* @__PURE__ */ new Set([`apiKey`,`baseUrl`,`output`,`quiet`,`verbose`,`timeout`,`dryRun`,`help`,`console`]),uc=/* @__PURE__ */ new Set(/* @__PURE__ */ `page.pageSize.n.count.model.voice.language.provider.capability.temperature.topP.topK.maxTokens.seed.stream.size.resolution.ratio.duration.format.audioFormat.sampleRate.pitch.rate.volume.api.mode.download.textOnly.promptExtend.enableSsml.watermark.hasThoughts.listTools.rerank.rerankTopN.diarization`.split(`.`));function dc(e){let t={};for(let[n,r]of Object.entries(e))n.startsWith(`_`)||lc.has(n)||uc.has(n)&&r!==void 0&&r!==!1&&(t[n]=r);return t}async function fc(e,t,n,r){if(!e.settings.telemetry){await r();return}let i=performance.now(),a=!0,o,s,c,l;try{await r()}catch(e){throw a=!1,e instanceof P?(o=e.message,s=e.exitCode,c=e.api?.httpStatus,l=e.api?.requestId):e instanceof Error&&(o=e.message),e}finally{let r=Math.round(performance.now()-i),u=Js({command:t.join(` `),durationMs:r,success:a,error:a?void 0:{message:o,exitCode:s,httpStatus:c,requestId:l},cliVersion:e.identity.version,authMethod:e.authMethod,params:dc(n)});sc(u).catch(()=>{}),cc(u).catch(()=>{})}}function pc(e){if(!e.model)return null;let t=e.inferenceMetadata;return{model:e.model,name:e.name??e.model,description:e.description??e.shortDescription??``,shortDescription:e.shortDescription,provider:e.provider??``,capabilities:e.capabilities??[],features:e.features??[],category:e.category,contextWindow:e.contextWindow??void 0,maxOutputTokens:e.maxOutputTokens??void 0,maxInputTokens:e.maxInputTokens??void 0,docUrl:e.docUrl,collectionTag:e.collectionTag,inferenceMetadata:t,prices:e.prices,qpmInfo:e.qpmInfo,versionTag:e.versionTag,openSource:e.openSource}}var mc=class{settings;name=`api`;constructor(e){this.settings=e}available(){return!0}async load(){return(await ki(bn(this.settings))).map(pc).filter(e=>e!==null)}};function hc(){return M(L(),`skills/bailian-docs-llm-wiki`)}function gc(){return M(hc(),`models`,`models.jsonl`)}function _c(e){return!e.model||typeof e.model!=`string`?null:{model:e.model,name:e.name??e.model,description:e.description??``,provider:e.provider??``,capabilities:e.capabilities??[],features:e.features??[],contextWindow:e.contextWindow,maxOutputTokens:e.maxOutputTokens,docUrl:e.docUrl,inferenceMetadata:e.inferenceMetadata,shortDescription:e.shortDescription,category:e.category,collectionTag:e.collectionTag,maxInputTokens:e.maxInputTokens,prices:e.prices,qpmInfo:e.qpmInfo,versionTag:e.versionTag,openSource:e.openSource,family:e.family,familyName:e.familyName}}function vc(e){let t=E(e,`utf-8`).split(`
|
|
30
|
+
`).filter(Boolean),n=[];for(let e of t)try{let t=_c(JSON.parse(e));t&&n.push(t)}catch{}return n}var yc=class{name=`catalog`;constructor(e){}available(){return C(gc())}async load(){return this.available()?vc(gc()):[]}};async function bc(e,t){let n=[new yc({onPrepareStart:t?.onPrepareStart}),new mc(e)];for(let e of n)if(e.available()){let t=await e.load();if(t.length>0)return t}let r=await n[0].load();if(r.length>0)return r;throw new P(`No model data available.`,N.GENERAL)}const xc={Text:`Text`,Image:`Image`,Video:`Video`,Audio:`Audio`},Y={Single:`single`,Pipeline:`pipeline`},Sc={Low:`low`,Medium:`medium`,High:`high`},Cc={Standard:`standard`,Large:`large`,ExtraLarge:`extra-large`},X={Flagship:`flagship`,Balanced:`balanced`,CostOptimized:`cost-optimized`},Z={TG:`TG`,Reasoning:`Reasoning`,VU:`VU`,IG:`IG`,VG:`VG`,TTS:`TTS`,ASR:`ASR`,RealtimeASR:`Realtime-ASR`,RealtimeTTS:`Realtime-Text-to-Speech`,RealtimeAudioTranslate:`Realtime-Audio-Translate`,RealtimeOmni:`Realtime-Omni`,MultimodalOmni:`Multimodal-Omni`,ME:`ME`,TR:`TR`,ThreeDGeneration:`3D-generation`},wc={FunctionCalling:`function-calling`,WebSearch:`web-search`,StructuredOutputs:`structured-outputs`,PrefixCompletion:`prefix-completion`},Tc={Flagship:`Flagship`,CostOptimized:`Cost-optimized`},Ec=20,Dc=/-\d{4}-\d{2}-\d{2}$/,Oc=/* @__PURE__ */ new Set([Z.IG,Z.VG,Z.TTS,Z.RealtimeTTS,Z.ThreeDGeneration]),kc=/* @__PURE__ */ new Set([Z.TG,Z.Reasoning,Z.ASR,Z.RealtimeASR,Z.RealtimeAudioTranslate,Z.TR,Z.ME]),Ac={standard:0,large:32e3,"extra-large":128e3};console.assert(!0,`FUSION_HARD_WEIGHT + FUSION_SOFT_WEIGHT must sum to 1`),console.assert(!0,`HARD_WEIGHT_* sub-weights must sum to 1`);const jc=`You are a model recommendation advisor for Alibaba Cloud Model Studio. From the candidate models below, select the best recommendations.
|
|
31
31
|
|
|
32
32
|
CRITICAL: You MUST respond entirely in English. Do not use any Chinese characters anywhere in your response. Every field — reason, highlights, step, summary — must be written in English.
|
|
33
33
|
|
|
@@ -68,7 +68,7 @@ Single task:
|
|
|
68
68
|
{"type":"single","recommendations":[{"model":"model ID","reason":"recommendation reason","highlights":["key highlights"]}]}
|
|
69
69
|
|
|
70
70
|
Pipeline (only when confident multi-model is needed):
|
|
71
|
-
{"type":"pipeline","summary":"one-line solution description","steps":[{"step":"step description","recommendations":[{"model":"model ID","reason":"reason for choosing","highlights":["highlights"]}]}]}`,
|
|
71
|
+
{"type":"pipeline","summary":"one-line solution description","steps":[{"step":"step description","recommendations":[{"model":"model ID","reason":"reason for choosing","highlights":["highlights"]}]}]}`,Mc=`You are a model recommendation advisor for Alibaba Cloud Model Studio. The user's need has been decomposed into multi-step pipeline. Select the best model for each step.
|
|
72
72
|
|
|
73
73
|
CRITICAL: You MUST respond entirely in English. Do not use any Chinese characters anywhere in your response. Every field — reason, highlights, step, summary — must be written in English.
|
|
74
74
|
|
|
@@ -107,7 +107,7 @@ Key principles:
|
|
|
107
107
|
|
|
108
108
|
Or (if single model suffices):
|
|
109
109
|
{"type":"single","recommendations":[{"model":"model ID","reason":"recommendation reason","highlights":
|
|
110
|
-
["key highlights"]}]}`,
|
|
110
|
+
["key highlights"]}]}`,Nc={complexity:Y.Single,taskSummary:``,scenarioHints:[],semanticQuery:``,inputModality:[],outputModality:[],requiredCapabilities:[Z.TG],requiredFeatures:[],budget:Sc.Medium,contextNeed:Cc.Standard,qualityPreference:X.Balanced,confidence:0},Pc=[`unconstrained`,`scoped`,`comparison`,`alternative`];function Fc(e){if(!e||typeof e!=`object`)return;let t=typeof e.mode==`string`&&Pc.includes(e.mode)?e.mode:`unconstrained`,n=Array.isArray(e.targets)?e.targets.filter(e=>typeof e==`string`):[],r=Array.isArray(e.excludes)?e.excludes.filter(e=>typeof e==`string`):[];return{mode:t,targets:n.length>0?n:void 0,excludes:r.length>0?r:void 0}}async function Ic(e,t){let n=kn(),r={model:`qwen3.6-flash`,messages:[{role:`system`,content:`You are an intent analyzer. Given the user's requirement, understand the scenario first, then extract structured information.
|
|
111
111
|
|
|
112
112
|
CRITICAL: You MUST respond entirely in English. Do not use any Chinese characters anywhere in your response. All text fields (taskSummary, scenarioHints) must be in English.
|
|
113
113
|
|
|
@@ -154,9 +154,9 @@ Analyze whether the user mentioned specific models, model families, or vendors:
|
|
|
154
154
|
- semanticQuery: a self-contained English phrase (15-30 words) describing the need in a form optimized for semantic matching against model descriptions — fold in scenario, modalities, and key constraints; do not just copy the user's wording
|
|
155
155
|
- modelPreference: { mode, targets?, excludes? }
|
|
156
156
|
|
|
157
|
-
Output only JSON, no other text.`},{role:`user`,content:t}],max_tokens:1024,temperature:0},i;try{i=await e.requestJson({path:n,method:`POST`,body:r,timeout:30})}catch{return{...jc}}let a=(i.choices?.[0]?.message?.content??``).match(/\{[\s\S]*\}/);if(!a)return{...jc};let o=JSON.parse(a[0]),s=o.modelPreference,c=Nc(s);return{complexity:o.complexity===Y.Pipeline?Y.Pipeline:Y.Single,taskSummary:typeof o.taskSummary==`string`?o.taskSummary:``,scenarioHints:Array.isArray(o.scenarioHints)?o.scenarioHints:[],semanticQuery:typeof o.semanticQuery==`string`?o.semanticQuery:``,segments:Array.isArray(o.segments)?o.segments.map(e=>({step:e.step??``,inputModality:Array.isArray(e.inputModality)?e.inputModality:[],outputModality:Array.isArray(e.outputModality)?e.outputModality:[],requiredCapabilities:Array.isArray(e.requiredCapabilities)?e.requiredCapabilities:[]})):void 0,inputModality:Array.isArray(o.inputModality)?o.inputModality:[],outputModality:Array.isArray(o.outputModality)?o.outputModality:[],requiredCapabilities:Array.isArray(o.requiredCapabilities)?o.requiredCapabilities:[],requiredFeatures:Array.isArray(o.requiredFeatures)?o.requiredFeatures:[],budget:o.budget??jc.budget,contextNeed:o.contextNeed??jc.contextNeed,qualityPreference:o.qualityPreference??jc.qualityPreference,confidence:1,modelPreference:c}}function Fc(e){let t=!1,n=!1;for(let r of e)Ec.has(r)&&(t=!0),Dc.has(r)&&(n=!0);return t&&n}function Ic(e){let t=new Set(e.map(({model:e})=>e));return e.filter(({model:e})=>{let n=e.replace(Tc,``);return n===e||!t.has(n)})}function Lc(e,t,n){let r=e.inferenceMetadata?.request_modality??[],i=e.inferenceMetadata?.response_modality??[];return!(t.length>0&&!t.some(e=>r.includes(e))||n.length>0&&!n.some(e=>i.includes(e)))}function Rc(e,t){if(t.length===0)return!0;let n=e.inferenceMetadata?.request_modality??[];return t.some(e=>n.includes(e))}function zc(e,t){let{requiredCapabilities:n,requiredFeatures:r,contextNeed:i,qualityPreference:a}=t,{capabilities:o,features:s,contextWindow:c,category:l}=e,u=0;for(let e of n)o.includes(e)&&(u+=10);for(let e of r)s.includes(e)&&(u+=5);let d=Oc[i];return d>0&&(c??0)>=d&&(u+=8),a===X.Flagship&&l===Cc.Flagship||a===X.CostOptimized&&l===Cc.CostOptimized?u+=15:a===X.Balanced&&l===Cc.Flagship&&(u+=5),u}function Bc(e,t,n){return e.map(e=>({model:e,score:zc(e,t)})).sort((e,t)=>t.score-e.score).slice(0,n)}function Vc(e){return new Set(e.map(({model:e})=>e.model))}function Hc(e,t){let n=/* @__PURE__ */ new Map,r=[],i=[];for(let a of e){let e=a.model.family;if(!e){r.push(a);continue}let o=n.get(e)??0;o<t?(r.push(a),n.set(e,o+1)):i.push(a)}return r.length>=10?r:[...r,...i.slice(0,10-r.length)]}function Uc(e,t){let n=new Set(t);return e.filter(e=>!n.has(e.model.model)&&(n.add(e.model.model),!0))}function Wc(e,t,n){return n.size>=10?[]:Bc(e.filter(({model:e})=>!n.has(e)),t,10-n.size)}function Gc(e,t,n,r,i){let{inputModality:a,outputModality:o,requiredCapabilities:s}=t,c={complexity:Y.Single,taskSummary:``,scenarioHints:[],semanticQuery:``,inputModality:a,outputModality:o,requiredCapabilities:s,requiredFeatures:[],budget:r,contextNeed:xc.Standard,qualityPreference:i,confidence:1},l=e.filter(e=>Lc(e,a,o)&&Rc(e,n));return l.length<5&&(l=e.filter(e=>Lc(e,a,o))),l.length<5&&(l=e),Bc(l,c,5)}function Kc(e,t){e=Ic(e);let n;if(t.complexity===Y.Pipeline&&t.segments?.length){let r=[];for(let[n,i]of t.segments.entries()){let a=n===0?[]:t.segments[n-1].outputModality,o=Uc(Gc(e,i,a,t.budget,t.qualityPreference),Vc(r));r=[...r,...o]}let i=Wc(e,t,Vc(r));n=[...r,...i]}else if(Fc(t.requiredCapabilities))n=qc(e,t);else{let r=e.filter(e=>Lc(e,t.inputModality,t.outputModality));r.length<5&&(r=e),n=Bc(r,t,50)}return Hc(n,3)}function qc(e,t){let n=t.requiredCapabilities.filter(e=>Ec.has(e)),r=t.requiredCapabilities.filter(e=>Dc.has(e)),i=[];if(n.length>0&&(i=Bc(e.filter(e=>n.some(t=>e.capabilities.includes(t))),t,25)),r.length>0){let n=Vc(i),a={...t,requiredCapabilities:r},o=e.filter(e=>!n.has(e.model)&&r.some(t=>e.capabilities.includes(t)));i=[...i,...Bc(o,a,25)]}let a=Wc(e,t,Vc(i));return[...i,...a]}const Jc=`text-embedding-v4`;function Yc(){return M(L(),`skills/bailian-docs-llm-wiki`)}function Xc(){return M(Yc(),`models-embeddings.json`)}function Zc(){let e=Xc();if(!C(e))return null;try{return JSON.parse(E(e,`utf-8`)).items}catch{return null}}async function Qc(e,t){let n={model:Jc,input:[t],dimensions:512,encoding_format:`float`};return(await e.requestJson({path:`/compatible-mode/v1/embeddings`,method:`POST`,body:n,timeout:1e4})).data[0].embedding}async function $c(e,t){let n={model:Jc,input:t,dimensions:512,encoding_format:`float`};return(await e.requestJson({path:`/compatible-mode/v1/embeddings`,method:`POST`,body:n,timeout:3e4})).data.sort((e,t)=>e.index-t.index).map(e=>e.embedding)}const el={TG:`Text Generation`,Reasoning:`Reasoning`,VU:`Vision Understanding`,IG:`Image Generation`,VG:`Video Generation`,TTS:`Text-to-Speech`,ASR:`Speech-to-Text`},tl={Text:`Text`,Image:`Image`,Video:`Video`,Audio:`Audio`};function nl(){let e=M(Yc(),`groups`),t=/* @__PURE__ */ new Map;if(!C(e))return t;for(let n of D(e).filter(e=>e.endsWith(`.json`)))try{let r=JSON.parse(E(M(e,n),`utf-8`)),i=r.description??``;if(r.items)for(let e of r.items)t.set(e.model,e.description||i)}catch{}return t}function rl(e,t){let n=(e.capabilities??[]).map(e=>el[e]??e).join(`, `),r=t.get(e.model)||e.shortDescription||e.description||``,i=(e.inferenceMetadata?.request_modality??[]).map(e=>tl[e]??e).join(`, `),a=(e.inferenceMetadata?.response_modality??[]).map(e=>tl[e]??e).join(`, `);return[e.name,e.model,r,n?`Capabilities: ${n}`:``,i?`Input: ${i}`:``,a?`Output: ${a}`:``,e.features?.length?`Features: ${e.features.join(`, `)}`:``,e.familyName||``,e.category?`Category: ${e.category}`:``].filter(Boolean).join(` | `)}async function il(e,t){let n=nl(),r=t.map(e=>rl(e,n)),i=[];for(let t=0;t<r.length;t+=10){let n=await $c(e,r.slice(t,t+10));i.push(...n)}let a=t.map((e,t)=>({id:e.model,vector:i[t]})),o={model:Jc,dimensions:512,count:a.length,items:a},s=Xc();return T(A(s),{recursive:!0}),ue(s,JSON.stringify(o)),a}function al(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];let a=Math.sqrt(r)*Math.sqrt(i);return a===0?0:n/a}let ol=null;function sl(){return ol===null&&(ol=Zc()),ol}function cl(){return sl()!==null}function ll(e){return(e??``).toLowerCase().replace(Tc,``).replace(/[\s_-]+/g,``).trim()}function ul(e,t){let n=ll(t);if(!n)return!1;if(ll(e.model)===n||ll(e.name)===n)return!0;let r=e.model,i=r.lastIndexOf(`/`);return i>=0&&ll(r.slice(i+1))===n||[e.family,e.familyName].some(e=>{if(!e)return!1;let t=ll(e);return t.length>0&&n.includes(t)})}function dl(e,t){return t.some(t=>ul(e,t))}function fl(e,t){return t.length===0?[]:e.filter(e=>dl(e,t))}function pl(e,t){return t.length===0?e:e.filter(({model:e})=>!dl(e,t))}function ml(e,t,n,r){let i=e.inferenceMetadata?.request_modality??[],a=e.inferenceMetadata?.response_modality??[];return!(t.length>0&&!t.some(e=>i.includes(e))||n.length>0&&!n.some(e=>a.includes(e))||r.length>0&&!r.some(t=>e.capabilities.includes(t)))}function hl(e,t){return ml(e,t.inputModality,t.outputModality,t.requiredCapabilities)}function gl(e,t){let{requiredCapabilities:n,requiredFeatures:r,contextNeed:i,qualityPreference:a}=t,o=1;n.length>0&&(o=n.filter(t=>e.capabilities.includes(t)).length/n.length);let s=1;r.length>0&&(s=r.filter(t=>e.features.includes(t)).length/r.length);let c=1,l=Oc[i]??0;if(l>0){let t=e.contextWindow??0;c=t>=l?1:t/l}let u=1;return a===X.Flagship?u=e.category===Cc.Flagship?1:.5:a===X.CostOptimized&&(u=e.category===Cc.CostOptimized?1:.5),.4*o+.2*s+.2*c+.2*u}function _l(e,t){if(!t)return new Set(e.map(e=>e.model));let n=e.filter(e=>hl(e,t)),r=n.length>=5?n:e;return new Set(r.map(e=>e.model))}function vl(e,t){return ml(e,t.inputModality,t.outputModality,t.requiredCapabilities)}function yl(e,t,n,r,i,a){let o=e.filter(e=>n.has(e.id)).flatMap(e=>{let n=i.get(e.id);if(!n)return[];let r=al(t,e.vector),o=a?gl(n,a):0;return[{model:n,score:a?.4*o+.6*r:r,hardScore:a?o:void 0,softScore:r}]}),s=o.filter(e=>(e.softScore??0)>=.3);return(s.length>=10?s:o).sort((e,t)=>t.score-e.score).slice(0,Math.max(0,r))}function bl(e){return{model:e,score:1,hardScore:1,softScore:1}}function xl(e,t,n,r,i,a,o){let s=r.targets??[],c=s.length>0?fl(e,s):e,l=[];if(c.length<5&&s.length>0){for(let e of c)l.push(bl(e));let r=new Set(l.map(({model:e})=>e.model)),s=yl(t,n,_l(e,o),i,a,o);for(let e of s)if(!r.has(e.model.model)&&(l.push(e),l.length>=i))break;return l}return yl(t,n,_l(c,o),i,a,o)}function Sl(e,t,n,r,i,a,o){let s=r.targets??[],c=[],l=/* @__PURE__ */ new Set;for(let t of e)dl(t,s)&&!l.has(t.model)&&(c.push(bl(t)),l.add(t.model));return c}function Cl(e,t,n,r,i,a,o){let s=fl(e,r.targets??[]),c=new Set(s.map(e=>e.family).filter(Boolean)),l=[],u=/* @__PURE__ */ new Set;for(let e of s)l.push(bl(e)),u.add(e.model);let d=Math.max(0,i-l.length);if(d>0){let r=yl(t,n,_l(e.filter(e=>!u.has(e.model)&&(!e.family||!c.has(e.family))),o),d,a,o);for(let e of r)l.push(e)}return l}async function wl(e,t,n,r,i){let a=sl();if(!a)a=await il(e,t),ol=a;else{let n=new Set(a.map(e=>e.id)),r=new Set(t.map(e=>e.model)),i=n.size!==r.size;if(!i){for(let e of n)if(!r.has(e)){i=!0;break}}i&&(a=await il(e,t),ol=a)}let o=await Qc(e,i?.semanticQuery?.trim()||n),s=new Map(t.map(e=>[e.model,e])),c=i?.modelPreference,l=c?.excludes??[];if(c&&c.mode!==`unconstrained`){let e;switch(c.mode){case`scoped`:e=xl(t,a,o,c,r,s,i);break;case`comparison`:e=Sl(t,a,o,c,r,s,i);break;case`alternative`:e=Cl(t,a,o,c,r,s,i);break;default:e=[]}return pl(e,l)}if(i?.complexity===Y.Pipeline&&i.segments?.length){let e=/* @__PURE__ */ new Set,n=[],c=Math.max(5,Math.ceil(r/i.segments.length));for(let r of i.segments){let l=t.filter(e=>vl(e,r)),u=new Set(l.filter(t=>!e.has(t.model)).map(e=>e.model));if(u.size===0)continue;let d=yl(a,o,u,c,s,i);for(let t of d)e.has(t.model.model)||(n.push(t),e.add(t.model.model))}return pl(n,l)}let u=_l(t,i);return pl(yl(a,o,u,r,s,i),l)}function Tl(e){if(e.prices?.length)return e.prices.map(e=>`${e.type}:${e.price}/${e.unit}`).join(`, `)}function El(e){return e.map(({model:e})=>{let t=[`ID: ${e.model}`,`Name: ${e.name}`,`Description: ${e.shortDescription||e.description}`,`Capabilities: ${e.capabilities.join(`, `)}`,`Features: ${e.features.join(`, `)}`];e.contextWindow&&t.push(`Context Window: ${e.contextWindow}`),e.maxOutputTokens&&t.push(`Max Output: ${e.maxOutputTokens}`),e.category&&t.push(`Category: ${e.category}`);let n=e.inferenceMetadata;n?.request_modality?.length&&t.push(`Input Modality: ${n.request_modality.join(`, `)}`),n?.response_modality?.length&&t.push(`Output Modality: ${n.response_modality.join(`, `)}`);let r=Tl(e);return r&&t.push(`Pricing: ${r}`),e.family&&t.push(`Family: ${e.family}`),t.join(` | `)}).join(`
|
|
158
|
-
`)}function
|
|
159
|
-
`)}function
|
|
157
|
+
Output only JSON, no other text.`},{role:`user`,content:t}],max_tokens:1024,temperature:0},i;try{i=await e.requestJson({path:n,method:`POST`,body:r,timeout:30})}catch{return{...Nc}}let a=(i.choices?.[0]?.message?.content??``).match(/\{[\s\S]*\}/);if(!a)return{...Nc};let o=JSON.parse(a[0]),s=o.modelPreference,c=Fc(s);return{complexity:o.complexity===Y.Pipeline?Y.Pipeline:Y.Single,taskSummary:typeof o.taskSummary==`string`?o.taskSummary:``,scenarioHints:Array.isArray(o.scenarioHints)?o.scenarioHints:[],semanticQuery:typeof o.semanticQuery==`string`?o.semanticQuery:``,segments:Array.isArray(o.segments)?o.segments.map(e=>({step:e.step??``,inputModality:Array.isArray(e.inputModality)?e.inputModality:[],outputModality:Array.isArray(e.outputModality)?e.outputModality:[],requiredCapabilities:Array.isArray(e.requiredCapabilities)?e.requiredCapabilities:[]})):void 0,inputModality:Array.isArray(o.inputModality)?o.inputModality:[],outputModality:Array.isArray(o.outputModality)?o.outputModality:[],requiredCapabilities:Array.isArray(o.requiredCapabilities)?o.requiredCapabilities:[],requiredFeatures:Array.isArray(o.requiredFeatures)?o.requiredFeatures:[],budget:o.budget??Nc.budget,contextNeed:o.contextNeed??Nc.contextNeed,qualityPreference:o.qualityPreference??Nc.qualityPreference,confidence:1,modelPreference:c}}function Lc(e){let t=!1,n=!1;for(let r of e)Oc.has(r)&&(t=!0),kc.has(r)&&(n=!0);return t&&n}function Rc(e){let t=new Set(e.map(({model:e})=>e));return e.filter(({model:e})=>{let n=e.replace(Dc,``);return n===e||!t.has(n)})}function zc(e,t,n){let r=e.inferenceMetadata?.request_modality??[],i=e.inferenceMetadata?.response_modality??[];return!(t.length>0&&!t.some(e=>r.includes(e))||n.length>0&&!n.some(e=>i.includes(e)))}function Bc(e,t){if(t.length===0)return!0;let n=e.inferenceMetadata?.request_modality??[];return t.some(e=>n.includes(e))}function Vc(e,t){let{requiredCapabilities:n,requiredFeatures:r,contextNeed:i,qualityPreference:a}=t,{capabilities:o,features:s,contextWindow:c,category:l}=e,u=0;for(let e of n)o.includes(e)&&(u+=10);for(let e of r)s.includes(e)&&(u+=5);let d=Ac[i];return d>0&&(c??0)>=d&&(u+=8),a===X.Flagship&&l===Tc.Flagship||a===X.CostOptimized&&l===Tc.CostOptimized?u+=15:a===X.Balanced&&l===Tc.Flagship&&(u+=5),u}function Hc(e,t,n){return e.map(e=>({model:e,score:Vc(e,t)})).sort((e,t)=>t.score-e.score).slice(0,n)}function Uc(e){return new Set(e.map(({model:e})=>e.model))}function Wc(e,t){let n=/* @__PURE__ */ new Map,r=[],i=[];for(let a of e){let e=a.model.family;if(!e){r.push(a);continue}let o=n.get(e)??0;o<t?(r.push(a),n.set(e,o+1)):i.push(a)}return r.length>=10?r:[...r,...i.slice(0,10-r.length)]}function Gc(e,t){let n=new Set(t);return e.filter(e=>!n.has(e.model.model)&&(n.add(e.model.model),!0))}function Kc(e,t,n){return n.size>=10?[]:Hc(e.filter(({model:e})=>!n.has(e)),t,10-n.size)}function qc(e,t,n,r,i){let{inputModality:a,outputModality:o,requiredCapabilities:s}=t,c={complexity:Y.Single,taskSummary:``,scenarioHints:[],semanticQuery:``,inputModality:a,outputModality:o,requiredCapabilities:s,requiredFeatures:[],budget:r,contextNeed:Cc.Standard,qualityPreference:i,confidence:1},l=e.filter(e=>zc(e,a,o)&&Bc(e,n));return l.length<5&&(l=e.filter(e=>zc(e,a,o))),l.length<5&&(l=e),Hc(l,c,5)}function Jc(e,t){e=Rc(e);let n;if(t.complexity===Y.Pipeline&&t.segments?.length){let r=[];for(let[n,i]of t.segments.entries()){let a=n===0?[]:t.segments[n-1].outputModality,o=Gc(qc(e,i,a,t.budget,t.qualityPreference),Uc(r));r=[...r,...o]}let i=Kc(e,t,Uc(r));n=[...r,...i]}else if(Lc(t.requiredCapabilities))n=Yc(e,t);else{let r=e.filter(e=>zc(e,t.inputModality,t.outputModality));r.length<5&&(r=e),n=Hc(r,t,50)}return Wc(n,3)}function Yc(e,t){let n=t.requiredCapabilities.filter(e=>Oc.has(e)),r=t.requiredCapabilities.filter(e=>kc.has(e)),i=[];if(n.length>0&&(i=Hc(e.filter(e=>n.some(t=>e.capabilities.includes(t))),t,25)),r.length>0){let n=Uc(i),a={...t,requiredCapabilities:r},o=e.filter(e=>!n.has(e.model)&&r.some(t=>e.capabilities.includes(t)));i=[...i,...Hc(o,a,25)]}let a=Kc(e,t,Uc(i));return[...i,...a]}const Xc=`text-embedding-v4`;function Zc(){return M(L(),`skills/bailian-docs-llm-wiki`)}function Qc(){return M(Zc(),`models-embeddings.json`)}function $c(){let e=Qc();if(!C(e))return null;try{return JSON.parse(E(e,`utf-8`)).items}catch{return null}}async function el(e,t){let n={model:Xc,input:[t],dimensions:512,encoding_format:`float`};return(await e.requestJson({path:`/compatible-mode/v1/embeddings`,method:`POST`,body:n,timeout:1e4})).data[0].embedding}async function tl(e,t){let n={model:Xc,input:t,dimensions:512,encoding_format:`float`};return(await e.requestJson({path:`/compatible-mode/v1/embeddings`,method:`POST`,body:n,timeout:3e4})).data.sort((e,t)=>e.index-t.index).map(e=>e.embedding)}const nl={TG:`Text Generation`,Reasoning:`Reasoning`,VU:`Vision Understanding`,IG:`Image Generation`,VG:`Video Generation`,TTS:`Text-to-Speech`,ASR:`Speech-to-Text`},rl={Text:`Text`,Image:`Image`,Video:`Video`,Audio:`Audio`};function il(){let e=M(Zc(),`groups`),t=/* @__PURE__ */ new Map;if(!C(e))return t;for(let n of D(e).filter(e=>e.endsWith(`.json`)))try{let r=JSON.parse(E(M(e,n),`utf-8`)),i=r.description??``;if(r.items)for(let e of r.items)t.set(e.model,e.description||i)}catch{}return t}function al(e,t){let n=(e.capabilities??[]).map(e=>nl[e]??e).join(`, `),r=t.get(e.model)||e.shortDescription||e.description||``,i=(e.inferenceMetadata?.request_modality??[]).map(e=>rl[e]??e).join(`, `),a=(e.inferenceMetadata?.response_modality??[]).map(e=>rl[e]??e).join(`, `);return[e.name,e.model,r,n?`Capabilities: ${n}`:``,i?`Input: ${i}`:``,a?`Output: ${a}`:``,e.features?.length?`Features: ${e.features.join(`, `)}`:``,e.familyName||``,e.category?`Category: ${e.category}`:``].filter(Boolean).join(` | `)}async function ol(e,t){let n=il(),r=t.map(e=>al(e,n)),i=[];for(let t=0;t<r.length;t+=10){let n=await tl(e,r.slice(t,t+10));i.push(...n)}let a=t.map((e,t)=>({id:e.model,vector:i[t]})),o={model:Xc,dimensions:512,count:a.length,items:a},s=Qc();return T(A(s),{recursive:!0}),ue(s,JSON.stringify(o)),a}function sl(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];let a=Math.sqrt(r)*Math.sqrt(i);return a===0?0:n/a}let cl=null;function ll(){return cl===null&&(cl=$c()),cl}function ul(){return ll()!==null}function dl(e){return(e??``).toLowerCase().replace(Dc,``).replace(/[\s_-]+/g,``).trim()}function fl(e,t){let n=dl(t);if(!n)return!1;if(dl(e.model)===n||dl(e.name)===n)return!0;let r=e.model,i=r.lastIndexOf(`/`);return i>=0&&dl(r.slice(i+1))===n||[e.family,e.familyName].some(e=>{if(!e)return!1;let t=dl(e);return t.length>0&&n.includes(t)})}function pl(e,t){return t.some(t=>fl(e,t))}function ml(e,t){return t.length===0?[]:e.filter(e=>pl(e,t))}function hl(e,t){return t.length===0?e:e.filter(({model:e})=>!pl(e,t))}function gl(e,t,n,r){let i=e.inferenceMetadata?.request_modality??[],a=e.inferenceMetadata?.response_modality??[];return!(t.length>0&&!t.some(e=>i.includes(e))||n.length>0&&!n.some(e=>a.includes(e))||r.length>0&&!r.some(t=>e.capabilities.includes(t)))}function _l(e,t){return gl(e,t.inputModality,t.outputModality,t.requiredCapabilities)}function vl(e,t){let{requiredCapabilities:n,requiredFeatures:r,contextNeed:i,qualityPreference:a}=t,o=1;n.length>0&&(o=n.filter(t=>e.capabilities.includes(t)).length/n.length);let s=1;r.length>0&&(s=r.filter(t=>e.features.includes(t)).length/r.length);let c=1,l=Ac[i]??0;if(l>0){let t=e.contextWindow??0;c=t>=l?1:t/l}let u=1;return a===X.Flagship?u=e.category===Tc.Flagship?1:.5:a===X.CostOptimized&&(u=e.category===Tc.CostOptimized?1:.5),.4*o+.2*s+.2*c+.2*u}function yl(e,t){if(!t)return new Set(e.map(e=>e.model));let n=e.filter(e=>_l(e,t)),r=n.length>=5?n:e;return new Set(r.map(e=>e.model))}function bl(e,t){return gl(e,t.inputModality,t.outputModality,t.requiredCapabilities)}function xl(e,t,n,r,i,a){let o=e.filter(e=>n.has(e.id)).flatMap(e=>{let n=i.get(e.id);if(!n)return[];let r=sl(t,e.vector),o=a?vl(n,a):0;return[{model:n,score:a?.4*o+.6*r:r,hardScore:a?o:void 0,softScore:r}]}),s=o.filter(e=>(e.softScore??0)>=.3);return(s.length>=10?s:o).sort((e,t)=>t.score-e.score).slice(0,Math.max(0,r))}function Sl(e){return{model:e,score:1,hardScore:1,softScore:1}}function Cl(e,t,n,r,i,a,o){let s=r.targets??[],c=s.length>0?ml(e,s):e,l=[];if(c.length<5&&s.length>0){for(let e of c)l.push(Sl(e));let r=new Set(l.map(({model:e})=>e.model)),s=xl(t,n,yl(e,o),i,a,o);for(let e of s)if(!r.has(e.model.model)&&(l.push(e),l.length>=i))break;return l}return xl(t,n,yl(c,o),i,a,o)}function wl(e,t,n,r,i,a,o){let s=r.targets??[],c=[],l=/* @__PURE__ */ new Set;for(let t of e)pl(t,s)&&!l.has(t.model)&&(c.push(Sl(t)),l.add(t.model));return c}function Tl(e,t,n,r,i,a,o){let s=ml(e,r.targets??[]),c=new Set(s.map(e=>e.family).filter(Boolean)),l=[],u=/* @__PURE__ */ new Set;for(let e of s)l.push(Sl(e)),u.add(e.model);let d=Math.max(0,i-l.length);if(d>0){let r=xl(t,n,yl(e.filter(e=>!u.has(e.model)&&(!e.family||!c.has(e.family))),o),d,a,o);for(let e of r)l.push(e)}return l}async function El(e,t,n,r,i){let a=ll();if(!a)a=await ol(e,t),cl=a;else{let n=new Set(a.map(e=>e.id)),r=new Set(t.map(e=>e.model)),i=n.size!==r.size;if(!i){for(let e of n)if(!r.has(e)){i=!0;break}}i&&(a=await ol(e,t),cl=a)}let o=await el(e,i?.semanticQuery?.trim()||n),s=new Map(t.map(e=>[e.model,e])),c=i?.modelPreference,l=c?.excludes??[];if(c&&c.mode!==`unconstrained`){let e;switch(c.mode){case`scoped`:e=Cl(t,a,o,c,r,s,i);break;case`comparison`:e=wl(t,a,o,c,r,s,i);break;case`alternative`:e=Tl(t,a,o,c,r,s,i);break;default:e=[]}return hl(e,l)}if(i?.complexity===Y.Pipeline&&i.segments?.length){let e=/* @__PURE__ */ new Set,n=[],c=Math.max(5,Math.ceil(r/i.segments.length));for(let r of i.segments){let l=t.filter(e=>bl(e,r)),u=new Set(l.filter(t=>!e.has(t.model)).map(e=>e.model));if(u.size===0)continue;let d=xl(a,o,u,c,s,i);for(let t of d)e.has(t.model.model)||(n.push(t),e.add(t.model.model))}return hl(n,l)}let u=yl(t,i);return hl(xl(a,o,u,r,s,i),l)}function Dl(e){if(e.prices?.length)return e.prices.map(e=>`${e.type}:${e.price}/${e.unit}`).join(`, `)}function Ol(e){return e.map(({model:e})=>{let t=[`ID: ${e.model}`,`Name: ${e.name}`,`Description: ${e.shortDescription||e.description}`,`Capabilities: ${e.capabilities.join(`, `)}`,`Features: ${e.features.join(`, `)}`];e.contextWindow&&t.push(`Context Window: ${e.contextWindow}`),e.maxOutputTokens&&t.push(`Max Output: ${e.maxOutputTokens}`),e.category&&t.push(`Category: ${e.category}`);let n=e.inferenceMetadata;n?.request_modality?.length&&t.push(`Input Modality: ${n.request_modality.join(`, `)}`),n?.response_modality?.length&&t.push(`Output Modality: ${n.response_modality.join(`, `)}`);let r=Dl(e);return r&&t.push(`Pricing: ${r}`),e.family&&t.push(`Family: ${e.family}`),t.join(` | `)}).join(`
|
|
158
|
+
`)}function kl(e){let{taskSummary:t,scenarioHints:n,inputModality:r,outputModality:i,requiredCapabilities:a,requiredFeatures:o,budget:s,qualityPreference:c,contextNeed:l,segments:u,modelPreference:d}=e,f=[];if(t&&f.push(`Task: ${t}`),n.length&&f.push(`Scenario: ${n.join(`, `)}`),r.length&&f.push(`Input: ${r.join(`, `)}`),i.length&&f.push(`Output: ${i.join(`, `)}`),a.length&&f.push(`Capabilities: ${a.join(`, `)}`),o.length&&f.push(`Features: ${o.join(`, `)}`),f.push(`Budget: ${s}`),f.push(`Quality: ${c}`),l!==Cc.Standard&&f.push(`Context: ${l}`),d&&d.mode!==`unconstrained`&&(f.push(`Mode: ${d.mode}`),d.targets?.length&&f.push(`Targets: ${d.targets.join(`, `)}`),d.excludes?.length&&f.push(`Excludes: ${d.excludes.join(`, `)}`)),u?.length){f.push(`Pipeline Steps:`);for(let e of u){let t=e.inputModality.join(`,`)||`none`,n=e.outputModality.join(`,`)||`none`,r=e.requiredCapabilities.join(`,`)||`none`;f.push(` - ${e.step} (Input: ${t} → Output: ${n}, Capabilities: ${r})`)}}return f.join(`
|
|
159
|
+
`)}function Al(e){if(!e)return;let t=e.match(/\/(\d+)\.html/);if(t)return`https://bailian.console.aliyun.com/cn-beijing?tab=doc#/doc/?type=model&url=${t[1]}`}function jl(e,t,n){let r=Array.isArray(e)?e:[],i=[],a=/* @__PURE__ */ new Set;for(let e of r){let r=t.get(e.model);if(!r||r.family&&a.has(r.family))continue;r.family&&a.add(r.family);let{model:o,name:s,category:c,contextWindow:l,maxOutputTokens:u,docUrl:d}=r;if(i.push({model:o,name:s,reason:e.reason??``,highlights:e.highlights??[],category:c,contextWindow:l,maxOutputTokens:u,docUrl:d}),i.length>=n)break}return i}function Ml(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n],a=new Set(r.recommendations.flatMap(e=>t.get(e.model)?.inferenceMetadata?.response_modality??[]));if(a.size===0)continue;let o=[];for(let e of i.recommendations){let n=t.get(e.model)?.inferenceMetadata?.request_modality??[];!n.some(e=>a.has(e))&&n.length>0&&o.push(`${e.name}'s input modalities [${n.join(`, `)}] may not be compatible with the previous step's output modalities [${[...a].join(`, `)}]`)}o.length>0&&(i.warnings=o)}}async function Nl(e,t,n,r,i,a){let o=Ol(t),s=kl(n),c=n.modelPreference?.mode,l;if(c===`comparison`)l=`You are a model comparison advisor for Alibaba Cloud Model Studio. The user wants to compare specific models — analyze them against the use case.
|
|
160
160
|
|
|
161
161
|
CRITICAL: You MUST respond entirely in English. Do not use any Chinese characters anywhere in your response. Every field — reason, highlights — must be written in English.
|
|
162
162
|
|
|
@@ -198,6 +198,6 @@ The intent's modelPreference.targets is the reference model.
|
|
|
198
198
|
- Output strict JSON
|
|
199
199
|
|
|
200
200
|
## Output Format
|
|
201
|
-
{"type":"single","recommendations":[{"model":"model ID","reason":"alternative analysis","highlights":["differentiators"]}]}`;else if(c===`scoped`){let e=n.modelPreference?.targets?.length?`\n\n## Scope Restriction\nThe user explicitly requested recommendations from: ${n.modelPreference.targets.join(`, `)}. Prioritize models within this scope.`:``;l=(n.complexity===Y.Pipeline?
|
|
202
|
-
`)}function Il(e,t){let n=Pl();n.skills[e]={...n.skills[e],...t},Fl(n)}function Ll(){let e=me(),t=process.cwd(),n=process.env.XDG_CONFIG_HOME||M(e,`.config`),r=(t,n,r)=>({id:t,displayName:n,skillsDir:M(e,r,`skills`),detectDirs:[M(e,r)]}),i=(t,n)=>t?.trim()||M(e,n),a=(e,t,n)=>({id:e,displayName:t,skillsDir:M(n,`skills`),detectDirs:[n]}),o=[`.openclaw`,`.clawdbot`,`.moltbot`].map(t=>M(e,t)),s=o.find(e=>C(e))??o[0],c=[M(n,`zed`)],l=process.env.APPDATA?.trim();l&&c.push(M(l,`Zed`));let u=process.env.FLATPAK_XDG_CONFIG_HOME?.trim();u&&c.push(M(u,`zed`));let d=i(process.env.CODEX_HOME,`.codex`);return[{id:`universal`,displayName:`Universal (~/.agents/skills)`,skillsDir:M(e,`.agents`,`skills`),detectDirs:[M(e,`.agents`),M(e,`.cline`),M(e,`.dexto`),M(e,`.firebender`),M(e,`.kimi-code`),M(e,`.kimi`),M(e,`.loaf`),M(e,`.warp`),...c]},{id:`universal-xdg`,displayName:`Universal (XDG agents/skills)`,skillsDir:M(n,`agents`,`skills`),detectDirs:[M(n,`agents`),M(n,`amp`),M(t,`.replit`)]},r(`adal`,`AdaL`,`.adal`),r(`aider-desk`,`AiderDesk`,`.aider-desk`),r(`antigravity`,`Antigravity`,`.gemini/antigravity`),r(`antigravity-cli`,`Antigravity CLI`,`.gemini/antigravity-cli`),{id:`astrbot`,displayName:`AstrBot`,skillsDir:M(e,`.astrbot`,`data`,`skills`),detectDirs:[M(t,`data`,`skills`),M(e,`.astrbot`)]},a(`autohand-code`,`Autohand Code CLI`,i(process.env.AUTOHAND_HOME,`.autohand`)),r(`augment`,`Augment`,`.augment`),r(`bob`,`IBM Bob`,`.bob`),a(`claude-code`,`Claude Code`,i(process.env.CLAUDE_CONFIG_DIR,`.claude`)),r(`codearts-agent`,`CodeArts Agent`,`.codeartsdoer`),{id:`codebuddy`,displayName:`CodeBuddy`,skillsDir:M(e,`.codebuddy`,`skills`),detectDirs:[M(t,`.codebuddy`),M(e,`.codebuddy`)]},r(`codemaker`,`Codemaker`,`.codemaker`),r(`codestudio`,`Code Studio`,`.codestudio`),{id:`codex`,displayName:`Codex`,skillsDir:M(d,`skills`),detectDirs:[d,`/etc/codex`]},r(`command-code`,`Command Code`,`.commandcode`),{id:`continue`,displayName:`Continue`,skillsDir:M(e,`.continue`,`skills`),detectDirs:[M(t,`.continue`),M(e,`.continue`)]},r(`cortex`,`Cortex Code`,`.snowflake/cortex`),r(`crush`,`Crush`,`.config/crush`),r(`cursor`,`Cursor`,`.cursor`),{id:`deepagents`,displayName:`Deep Agents`,skillsDir:M(e,`.deepagents`,`agent`,`skills`),detectDirs:[M(e,`.deepagents`)]},{id:`devin`,displayName:`Devin for Terminal`,skillsDir:M(n,`devin`,`skills`),detectDirs:[M(n,`devin`)]},r(`droid`,`Droid`,`.factory`),a(`dsh`,`DeepSeek DSH`,i(process.env.DSH_HOME,`.dsh`)),r(`forgecode`,`ForgeCode`,`.forge`),r(`gemini-cli`,`Gemini CLI`,`.gemini`),r(`github-copilot`,`GitHub Copilot`,`.copilot`),{id:`goose`,displayName:`Goose`,skillsDir:M(n,`goose`,`skills`),detectDirs:[M(n,`goose`)]},a(`grok`,`Grok Build`,i(process.env.GROK_HOME,`.grok`)),a(`hermes`,`Hermes Agent`,i(process.env.HERMES_HOME,`.hermes`)),r(`iflow-cli`,`iFlow CLI`,`.iflow`),r(`inference-sh`,`inference.sh`,`.inferencesh`),{id:`jazz`,displayName:`Jazz`,skillsDir:M(e,`.jazz`,`skills`),detectDirs:[M(e,`.jazz`),M(t,`.jazz`)]},r(`junie`,`Junie`,`.junie`),r(`kilo`,`Kilo Code`,`.kilocode`),{id:`kimchi`,displayName:`Kimchi`,skillsDir:M(e,`.config`,`kimchi`,`harness`,`skills`),detectDirs:[M(e,`.config`,`kimchi`)]},r(`kiro-cli`,`Kiro CLI`,`.kiro`),r(`kode`,`Kode`,`.kode`),r(`lingma`,`Lingma`,`.lingma`),r(`mcpjam`,`MCPJam`,`.mcpjam`),{id:`minimax-code`,displayName:`MiniMax Code`,skillsDir:M(e,`.minimax`,`skills`),detectDirs:[M(e,`.minimax`),`/Applications/MiniMax Code.app`]},a(`mistral-vibe`,`Mistral Vibe`,i(process.env.VIBE_HOME,`.vibe`)),r(`moxby`,`Moxby`,`.moxby`),r(`mux`,`Mux`,`.mux`),r(`neovate`,`Neovate`,`.neovate`),{id:`opencode`,displayName:`OpenCode`,skillsDir:M(n,`opencode`,`skills`),detectDirs:[M(n,`opencode`)]},{id:`openclaw`,displayName:`OpenClaw`,skillsDir:M(s,`skills`),detectDirs:o},r(`openhands`,`OpenHands`,`.openhands`),r(`ona`,`Ona`,`.ona`),r(`pi`,`Pi`,`.pi/agent`),r(`pochi`,`Pochi`,`.pochi`),r(`qoder`,`Qoder`,`.qoder`),r(`qoder-cn`,`Qoder CN`,`.qoder-cn`),r(`qwen-code`,`Qwen Code`,`.qwen`),r(`reasonix`,`Reasonix`,`.reasonix`),r(`rovodev`,`Rovo Dev`,`.rovodev`),r(`roo`,`Roo Code`,`.roo`),{id:`tabnine-cli`,displayName:`Tabnine CLI`,skillsDir:M(e,`.tabnine`,`agent`,`skills`),detectDirs:[M(e,`.tabnine`)]},r(`terramind`,`Terramind`,`.terramind`),r(`tinycloud`,`Tinycloud`,`.tinycloud`),r(`trae`,`Trae`,`.trae`),r(`trae-cli`,`Trae CLI`,`.traecli`),r(`trae-cn`,`Trae CN`,`.trae-cn`),r(`windsurf`,`Windsurf`,`.codeium/windsurf`),r(`workbuddy`,`Tencent WorkBuddy`,`.workbuddy`),{id:`zcode`,displayName:`ZCode`,skillsDir:M(e,`.zcode`,`skills`),detectDirs:[M(e,`.zcode`),`/Applications/ZCode.app`]},r(`zencoder`,`Zencoder`,`.zencoder`)]}function Rl(){return Ll().filter(e=>e.detectDirs.some(e=>C(e)))}function zl(e,t){return process.platform===`win32`?e.toLowerCase()===t.toLowerCase():e===t}function Bl(e){let t=Q();if(process.platform===`win32`){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(r+pe)}return e===t||e.startsWith(t+pe)}function Vl(e){try{if(!w(e).isSymbolicLink())return!1;let t=se(e);return Bl(j(t)?t:fe(A(e),t))}catch{return!1}}function Hl(e,t){if(!t.some(t=>zl(t,e)))return!1;try{return w(e).isDirectory()}catch{return!1}}function Ul(e){try{return w(e).isDirectory()?C(M(e,`SKILL.md`)):!1}catch{return!1}}const Wl=`existing file/dir not managed by bl skill`;function Gl(e,t=Rl(),n=[]){let r=M(Q(),e),i=[];for(let a of t){let t=M(a.skillsDir,e);try{let e=!1;try{w(t),e=!0}catch{}if(e){if(Vl(t))O(t);else if(Hl(t,n))O(t,{recursive:!0,force:!0});else if(Ul(t))O(t,{recursive:!0,force:!0});else{i.push({agent:a.id,path:t,mode:`skipped`,reason:Wl});continue}}T(a.skillsDir,{recursive:!0});try{k(r,t,process.platform===`win32`?`junction`:`dir`),i.push({agent:a.id,path:t,mode:`symlink`})}catch{ae(r,t,{recursive:!0}),i.push({agent:a.id,path:t,mode:`copy`})}}catch(e){i.push({agent:a.id,path:t,mode:`skipped`,reason:e instanceof Error?e.message:String(e)})}}return i}function Kl(e,t=Rl(),n=[]){let r=Gl(e,t,n),i=r.filter(e=>e.mode!==`skipped`),a=i.map(e=>e.path),o=r.filter(e=>e.mode===`skipped`&&e.reason===Wl).map(e=>e.path),s=n.filter(e=>!a.some(t=>zl(t,e))&&!o.some(t=>zl(t,e)));return{results:r,linkedAgents:i.map(e=>e.agent),links:[...a,...s]}}function ql(e,t=[]){let n=[],r=new Set(t);for(let t of Ll())r.add(M(t.skillsDir,e));for(let e of r)try{let r;try{r=w(e)}catch{continue}r.isSymbolicLink()?Vl(e)&&n.push(e):t.some(t=>zl(t,e))&&n.push(e)}catch{}return n}function Jl(e,t=[]){let n=[];for(let r of ql(e,t))try{if(Vl(r))O(r);else if(!w(r).isSymbolicLink()&&t.some(e=>zl(e,r)))O(r,{recursive:!0,force:!0});else continue;n.push(r)}catch{}return n}function Yl(e){return e.includes(`\\`)||e.includes(`\0`)||e.startsWith(`/`)||/^[a-zA-Z]:[\\/]/.test(e)?!1:!e.split(`/`).includes(`..`)}async function Xl(e,t){let n=ye.extract();n.on(`entry`,(e,r,i)=>{if(!Yl(e.name)){r.on(`error`,()=>{}),r.resume(),n.destroy(/* @__PURE__ */ Error(`unsafe tar entry: ${e.name}`));return}let a=M(t,e.name);if(e.type===`directory`){T(a,{recursive:!0}),r.resume(),r.on(`end`,i);return}T(A(a),{recursive:!0});let o=oe(a);r.pipe(o),o.on(`finish`,i),o.on(`error`,i)}),await _e(ge.from(e),ve(),n)}function Zl(e){let t=[],n=r=>{for(let i of D(r?M(e,r):e,{withFileTypes:!0})){let e=r?`${r}/${i.name}`:i.name;i.isDirectory()?n(e):i.isFile()&&t.push(e)}};n(``),t.sort((e,t)=>e<t?-1:+(e>t));let r=he(`sha256`);for(let n of t)r.update(n),r.update(E(M(e,n)));return`sha256:${r.digest(`hex`)}`}function Ql(e,t,n=259){let r,i=a=>{for(let o of D(a,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let s=M(a,o.name),c=de(e,s);for(let e of t){let t=M(e,c).length;t>n&&t>(r?.pathLength??0)&&(r={root:e,relativePath:c,pathLength:t})}o.isDirectory()&&i(s)}};for(let e of t)e.length>n&&e.length>(r?.pathLength??0)&&(r={root:e,relativePath:``,pathLength:e.length});return i(e),r}function $l(e){let t=[],n=r=>{for(let i of D(r,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let a=M(r,i.name),o=de(e,a);i.isDirectory()?(t.push({relativePath:o,type:`directory`}),n(a)):i.isFile()&&t.push({relativePath:o,type:`file`})}};return n(e),t}function eu(e,t){let n=$l(e),r=new Set(n.map(e=>e.relativePath));T(t,{recursive:!0});for(let r of n){let n=M(e,r.relativePath),i=M(t,r.relativePath);if(C(i)){let e=w(i);(!(r.type===`directory`?e.isDirectory():e.isFile())||e.isSymbolicLink())&&O(i,{recursive:!0,force:!0})}r.type===`directory`?T(i,{recursive:!0}):(T(A(i),{recursive:!0}),ie(n,i))}let i=$l(t).filter(e=>!r.has(e.relativePath)).sort((e,t)=>t.relativePath.length-e.relativePath.length);for(let e of i)O(M(t,e.relativePath),{recursive:!0,force:!0})}function tu(e){let t=e?.code;return t===`EPERM`||t===`EBUSY`}function nu(e){try{C(e)&&O(e,{recursive:!0,force:!0})}catch{}}function ru(e,t,n={}){T(A(t),{recursive:!0});let r=`${t}.old-${Date.now()}`;if(C(t))try{ce(t,r)}catch(i){if(!(n.allowInPlaceFallback??process.platform===`win32`)||!tu(i))throw i;try{eu(t,r),eu(e,t),nu(r);return}catch(e){try{C(r)&&eu(r,t)}catch{}throw Error(`Skill directory is in use and could not be updated in place. Close running agent hosts and retry. / Skill 目录正被占用,无法原地更新;请关闭正在运行的 Agent 后重试。 ${e instanceof Error?e.message:String(e)}`,{cause:e})}}try{ce(e,t)}catch(e){throw C(r)&&!C(t)&&ce(r,t),e}nu(r)}function iu(e){if(e instanceof P){let t=e.api?.httpStatus;if(t!==void 0){if(t===408||t===429)return!0;if(t>=400&&t<500)return!1}return!0}return!0}function au(e){return e instanceof P&&e.api?.httpStatus===429}function ou(e,t){return Math.min(t*2**(e-1),1e4)}function su(e){return new Promise(t=>setTimeout(t,e))}async function cu(e,t=3){let n=typeof t==`number`?{attempts:t}:t,r=n.attempts??3,i=n.shouldRetry??iu,a=n.backoffBaseMs??500,o;for(let t=1;t<=r;t++)try{return await e(t)}catch(e){if(o=e,t>=r||!i(e,t))break;au(e)&&await su(ou(t,a))}throw o}function lu(){return(process.env.BAILIAN_SKILL_REGISTRY_URL?.trim()||`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/skills`).replace(/\/+$/,``)}async function uu(e=3e4,t=3){return cu(async()=>{let t=`${lu()}/index.json`,n;try{n=await fetch(t,{signal:AbortSignal.timeout(e)})}catch(e){throw new P(`Cannot access skill registry: ${t}`,N.NETWORK,`Check network connectivity; if using a private mirror, verify BAILIAN_SKILL_REGISTRY_URL configuration`,{cause:e})}if(!n.ok)throw new P(`Skill registry returned HTTP ${n.status}: ${t}`,N.NETWORK,n.status===404?`Skill index not yet published or registry URL is incorrect; confirm the publisher has generated index.json`:`Remote error, retry later`);let r;try{r=await n.json()}catch(e){throw new P(`Skill index index.json is not valid JSON`,N.GENERAL,`Remote may be in the middle of publishing, retry later`,{cause:e})}let i=r;if(typeof i!=`object`||!i||typeof i.skills!=`object`||i.skills===null)throw new P(`Skill index index.json has invalid structure`,N.GENERAL,`Retry later or contact the publisher`);return i},{attempts:t})}const du=/^sha256-[0-9a-f]{64}\.tar\.br$/;function fu(e){let t=e?.object;return t&&du.test(t)?t:`skill.tar.br`}async function pu(e,t,n=3){return cu(async()=>{let n=`${lu()}/${e}/${fu(t)}`,r;try{r=await fetch(n,{signal:AbortSignal.timeout(12e4)})}catch(t){throw new P(`Failed to download skill ${e}: ${n}`,N.NETWORK,`Network error, retryable`,{cause:t})}if(!r.ok)throw new P(`Failed to download skill ${e}: HTTP ${r.status}`,N.NETWORK,r.status===404?`index.json and skill object are temporarily inconsistent (publishing in progress), retry later`:`Remote error, retry later`);return Buffer.from(await r.arrayBuffer())},{attempts:n})}function mu(e){return e.replace(/[\\/:*?"<>|\s]+/g,`-`).replace(/\.\.+/g,`-`).replace(/^[-.]+|[-.]+$/g,``)||`unnamed-skill`}function hu(e){return e.length>0&&mu(e)===e}function gu(e,t){throw new P(`Skill ${e} validation failed: ${t}`,N.GENERAL,`This skill package does not conform to the SKILL.md spec; contact the skill publisher to fix and republish`)}function _u(e){if(!e.startsWith(`---`))return null;let t=/^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/.exec(e);return t?t[1]:null}function vu(e,t){let n=M(e,`SKILL.md`),r;try{le(n).isFile()||gu(t,`SKILL.md is not a regular file`),r=E(n,`utf-8`)}catch(e){if(e instanceof P)throw e;gu(t,`missing SKILL.md`)}let i=_u(r);i===null&&gu(t,`SKILL.md is missing frontmatter (--- delimited YAML header)`);let a;try{a=_(i)}catch{gu(t,`frontmatter is not valid YAML`)}(typeof a!=`object`||!a)&&gu(t,`frontmatter is not a key-value structure`);let o=a,s=typeof o.name==`string`?o.name.trim():``,c=typeof o.description==`string`?o.description.trim():``;return(!s||!c)&&gu(t,`frontmatter is missing non-empty name / description fields`),{name:s,description:c}}function yu(e){if(!hu(e))throw new P(`Invalid skill name: ${e}`,N.GENERAL,`Skill name contains path separators, traversal sequences, or other illegal characters; refusing to write to disk`)}async function bu(e,t,n,r){yu(e);let i=Q(),a=M(i,e),o=M(i,`.tmp-${e}-${process.pid}-${Date.now()}`);try{T(o,{recursive:!0}),await Xl(t,o);let i=Ql(o,r??(process.platform===`win32`?[a]:[]));if(i)throw new P(`Skill ${e} contains a Windows-incompatible path (${i.pathLength} characters): ${i.relativePath}`,N.GENERAL,`The skill package must shorten this path before it can be installed safely on Windows. / Skill 包必须缩短该路径后才能在 Windows 上安全安装。`);if(n?.startsWith(`sha256:`)){let t=Zl(o);if(t!==n)throw new P(`Skill ${e} failed integrity check: index says ${n}, archive is ${t}`,N.GENERAL,`Downloaded archive does not match the index fingerprint (registry may be mid-publish); retry later`)}let s=vu(o,e);return ru(o,a),{name:e,path:a,meta:s}}finally{try{C(o)&&O(o,{recursive:!0,force:!0})}catch{}}}async function xu(e,t,n,r){if(t.compression&&t.compression!==`tar.br`)throw new P(`Skill ${e} uses unsupported compression format: ${t.compression}`,N.GENERAL,`Upgrade bailian-cli to the latest version and retry`);return bu(e,await pu(e,t,n),t.contentHash,r)}function Su(e){yu(e);let t=M(Q(),e);return C(t)?(O(t,{recursive:!0,force:!0}),!0):!1}function Cu(e,t){return{...e.contentHash?{contentHash:e.contentHash}:{},...e.publishedAt?{publishedAt:e.publishedAt}:{},installedAt:(/* @__PURE__ */ new Date()).toISOString(),sourceType:`oss`,...e.description?{description:e.description}:{},links:t}}async function wu(e,t,n=Rl(),r=[],i){await xu(e,t,i,process.platform===`win32`?[M(Q(),e),...n.map(t=>M(t.skillsDir,e))]:void 0);let a=Kl(e,n,r);return{lockEntry:Cu(t,a.links),linkedAgents:a.linkedAgents}}const $=`bailian-docs-llm-wiki`;function Tu(){return M(L(),`skills/bailian-docs-llm-wiki`)}function Eu(){return C(M(Tu(),`models`,`models.jsonl`))}function Du(){return M(L(),`wiki-sync-state.json`)}function Ou(){try{return JSON.parse(E(Du(),`utf-8`))}catch{return null}}function ku(e){try{ue(Du(),JSON.stringify(e))}catch{}}function Au(e){try{Il($,e)}catch{}}function ju(e){try{let t=Pl().skills[$];return t?.contentHash!==e||!Array.isArray(t.links)}catch{return!0}}async function Mu(){try{return(await uu(3e3,1)).skills[$]??null}catch{return null}}async function Nu(){let e=Ou(),t=Date.now();if(e&&t-e.lastChecked<432e5&&Eu())return!1;let n=await Mu();if(!n?.contentHash)return!1;if(Eu()&&(!e||e.contentHash===n.contentHash)){if(ku({lastChecked:t,contentHash:n.contentHash}),ju(n.contentHash)){let e=Pl().skills[$]?.links??[];Au(Cu(n,Kl($,Rl(),e).links))}return!1}try{let e=Pl().skills[$]?.links??[];Au((await wu($,n,Rl(),e,1)).lockEntry)}catch{return!1}return ku({lastChecked:t,contentHash:n.contentHash}),!0}const Pu=`bailian-cli`,Fu=`install-method`,Iu=/* @__PURE__ */ new Set([`binary`,`npm`,`brew`,`winget`,`unknown`]);function Lu(e){return e?M(L(),`${Fu}.${e}`):M(L(),Fu)}function Ru(){if(process.env.BAILIAN_COMPILED===`1`)return!0;let e=process.execPath.replaceAll(`\\`,`/`);return/(^|\/)node(\.exe)?$/i.test(e)||e.includes(`/node/`)||/(^|\/)bun(\.exe)?$/i.test(e)||e.includes(`/.bun/`)?!1:/\/(bl|bailian)(\.exe)?$/i.test(e)}function zu(e){if(!e)return null;let t=e.trim().toLowerCase();return Iu.has(t)?t:null}function Bu(e){try{return zu(E(e,`utf-8`).split(`
|
|
203
|
-
`)[0])}catch{return null}}function Vu(){let e=zu(process.env.BAILIAN_INSTALL_METHOD);if(e)return e;if(Ru()){let e=process.execPath.replaceAll(`\\`,`/`);return e.includes(`/Cellar/`)||e.includes(`/homebrew/`)?`brew`:`binary`}return`npm`}function Hu(e){let t=zu(process.env.BAILIAN_INSTALL_METHOD);if(t)return t;if(e?.clientName){let t=Bu(Lu(e.clientName));if(t)return t;if(e.clientName===`bailian-cli`){let e=Bu(Lu());if(e)return e}return Vu()}return Bu(Lu())||Vu()}function Uu(e){let t=Hu(e);return t===`binary`&&e.npmPackage!==`bailian-cli`?`npm`:t}function Wu(e,t={clientName:Pu}){try{let n=L();C(n)||T(n,{recursive:!0,mode:448}),ue(Lu(t.clientName),`${e}\n`,{mode:384}),t.clientName===`bailian-cli`&&ue(Lu(),`${e}\n`,{mode:384})}catch{}}const Gu=`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release`,Ku=`https://github.com/modelstudioai/cli/releases`,qu=`https://bailian.aliyun.com/cli/install.sh`,Ju=`https://bailian.aliyun.com/cli/install.ps1`;function Yu(){let e=process.env.BAILIAN_CLI_CDN?.trim();return e?e.replace(/\/$/,``):Gu}function Xu(e=`latest`){let t=e.trim();return!t||t===`latest`||t===`stable`?`${Yu()}/manifest.json`:`${Yu()}/${t}.json`}function Zu(e,t){let n=e.startsWith(`v`)?e:`v${e}`;return`${Yu()}/${n}/${t}`}function Qu(){let e=process.platform,t=process.arch,n;if(e===`darwin`)n=`darwin`;else if(e===`linux`)n=`linux`;else if(e===`win32`)n=`windows`;else throw Error(`Unsupported platform for binary updates: ${e}`);let r;if(t===`arm64`)r=`arm64`;else if(t===`x64`)r=`x64`;else throw Error(`Unsupported architecture for binary updates: ${t}`);if(n===`linux`&&r===`arm64`)throw Error(`linux arm64 is not supported for binary updates; use: npm install -g bailian-cli`);if(n===`windows`&&r===`arm64`)throw Error(`windows arm64 is not supported for binary updates; use: npm install -g bailian-cli`);return{os:n,arch:r,fileSuffix:e===`win32`?`.exe`:``}}function $u(e,t,n,r=!1){return`bl-${e}-${t}-${n}.zip`}function ed(e,t,n){if(t!==`windows`)return`bl-${e}-${t}-${n}.tar.gz`}function td(e,t,n,r=!1){return`bl-${e}-${t}-${n}${r?`.exe`:``}`}function nd(e){return new Promise((t,n)=>{S.open(e,{lazyEntries:!0},(r,i)=>{if(r||!i){n(r??/* @__PURE__ */ Error(`Failed to open zip: ${e}`));return}t(i)})})}function rd(e){let t=e.replace(/\\/g,`/`);return t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t}async function id(e,t,n){let r=await nd(e);return new Promise((i,a)=>{let o=!1,s=e=>{if(!o){o=!0;try{r.close()}catch{}a(e instanceof Error?e:Error(String(e)))}},c=e=>{if(!o){o=!0;try{r.close()}catch{}i(e)}};r.on(`error`,s),r.on(`end`,()=>{o||s(/* @__PURE__ */ Error(n?`Zip entry not found: ${n} in ${e}`:`Zip has no file entries: ${e}`))}),r.on(`entry`,e=>{if(o)return;let i=e.fileName.replace(/\\/g,`/`);if(i.endsWith(`/`)){r.readEntry();return}let a=rd(i);if(n&&i!==n&&a!==n){r.readEntry();return}r.openReadStream(e,(n,r)=>{if(n||!r){s(n??/* @__PURE__ */ Error(`Failed to read zip entry: ${e.fileName}`));return}(async()=>{try{await be(A(t),{recursive:!0}),await _e(r,oe(t)),c(a)}catch(e){s(e)}})()})}),r.readEntry()})}function ad(e,t){let n=(e??(t?`all`:``)).trim();if(!n)throw new F(`--name cannot be empty`,`Use --name all or --name skill-a,skill-b`);let r=[...new Set(n.split(`,`).map(e=>e.trim()).filter(Boolean))];if(r.includes(`all`)){if(r.length>1)throw new F(`--name all cannot be mixed with specific skill names`,`Use either all or a comma-separated list of names`);return`all`}return r}function od(){let e=Q();return C(e)?D(e).filter(t=>{if(t.startsWith(`.`)||t.includes(`.tmp-`)||t.includes(`.old-`))return!1;try{return le(M(e,t)).isDirectory()}catch{return!1}}):[]}function sd(e,t,n){let r=new Set(n),i=/* @__PURE__ */ new Set,a=[];for(let[n,o]of Object.entries(e.skills)){i.add(n);let e=t.skills[n];if(e){let t=r.has(n)?e.contentHash===o.contentHash?`installed`:`outdated`:`missing`;a.push({name:n,status:t,publishedAt:o.publishedAt,description:o.description})}else r.has(n)?a.push({name:n,status:`untracked`,publishedAt:o.publishedAt,description:o.description}):a.push({name:n,status:`not-installed`,publishedAt:o.publishedAt,description:o.description})}for(let[e,n]of Object.entries(t.skills))i.has(e)||(i.add(e),a.push({name:e,status:r.has(e)?`installed`:`missing`,publishedAt:n.publishedAt,description:n.description}));for(let e of n)i.has(e)||a.push({name:e,status:`untracked`});return a.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name))}export{He as API_KEY_CAPABILITY_PATTERN,Os as ASYNC_FLAG,Ie as BAILIAN_HOST,Xo as BILLING_METHOD,Pu as BINARY_PRODUCT_CLIENT_NAME,P as BailianError,bc as Budgets,Do as CALC_DATASETS_TOKENS_API,Mt as CHANNEL,q as CHARGE_TYPE,Ps as COMMAND_PACK_API_VERSION,Ds as CONCURRENT_FLAG,ze as CONFIG_FILE_KEYS,As as CONSOLE_AUTH_FLAGS,Z as Capabilities,Cn as Client,Y as Complexities,xc as ContextNeeds,Pt as DASHSCOPE_SERVICE_HEADER,Zo as DEFAULT_BILLING_METHOD,Gu as DEFAULT_CLI_CDN_BASE,Jo as DEFAULT_DEPLOY_PLAN,Ju as DEFAULT_INSTALL_PS1_URL,qu as DEFAULT_INSTALL_SCRIPT_URL,Re as DEFAULT_LANGUAGE,ro as DEFAULT_TRAINING_TYPE,us as DEPLOY_LIST_INDEPENDENT_API,K as DEPLOY_PLAN,cs as DEPLOY_START_API,ls as DEPLOY_STOP_API,Fe as DOCS_HOSTS,Oo as ESTIMATE_FINETUNE_TOKENS_API,N as ExitCode,Sc as Features,Ku as GITHUB_RELEASES_BASE,Es as GLOBAL_FLAGS,lo as INSUFFICIENT_SAMPLES_CODE,Wi as MAX_CPT_BYTES,Ui as MAX_DATASET_BYTES,Gi as MAX_MEDIA_ZIP_BYTES,ks as MODEL_AUTH_FLAGS,Ei as MODEL_LIST_API,gn as McpClient,yc as Modalities,Cc as ModelCategories,js as OPENAPI_AUTH_FLAGS,Nt as OPEN_API_SOURCE,Di as PREDICT_CONFIG_API,X as QualityPreferences,Fr as RAG_PATHS,I as REGIONS,Ar as SANDBOX_PATHS,wc as SEMANTIC_TOP_K,hs as SPEECH_BIASING_MODEL,os as STRATEGIES,Le as SUPPORTED_LANGUAGES,Eo as TRAINING_MODEL_PRICE_API,no as TRAINING_TYPES_CLI,to as TRAINING_TYPE_MAP,F as UsageError,bt as activateConfigProfile,Er as agentStudioFilesPath,er as agentStudioHost,Pc as analyzeIntent,bn as anonymousConsoleCall,Bn as appCompletionPath,ru as atomicSwap,dn as bailianMcpPath,fn as bailianMcpSsePath,$u as binaryAssetFileName,td as binaryInnerFileName,ed as binaryTarFileName,Vt as buildAcsCanonicalQuery,ii as buildAsrContextMessages,oi as buildAsrFlashRequest,ai as buildAsyncAsrLanguageFields,Ol as buildDocLink,ns as buildPrepaidInfo,$o as buildReservationCapacity,wt as buildSettings,Cu as buildSkillLockEntry,Ct as buildSources,gs as buildVocabularyRequest,Sn as callConsoleGateway,Xa as cancelFineTune,Xu as channelManifestUrl,kn as chatPath,ci as collectAsrTranscriptionItems,Zl as computeDirContentHash,sd as computeSkillStatuses,hn as connectBailianMcpWithFallback,Ci as createBailianControlUser,zo as createCapacityInstance,No as createDeployment,qa as createFineTune,yi as createInstrumentedFetch,Ks as createTrackingEvent,vs as createVocabulary,Ms as credentialFlagDefs,Yo as defaultDeployPlan,Ns as defineCommand,Ho as deleteCapacityInstance,xt as deleteConfigProfile,Hi as deleteDataset,Wo as deleteDeployment,Za as deleteFineTune,Ss as deleteVocabulary,_r as deploymentCapacityInstancePath,yr as deploymentCapacityInstanceRenewPath,vr as deploymentCapacityInstanceScalePath,gr as deploymentCapacityInstancesPath,xr as deploymentCapacityOperationPath,br as deploymentOverflowPath,tt as describeAuthState,Qu as detectBinaryPlatform,Vu as detectInstallMethod,Rl as detectInstalledAgents,Ia as detectModality,st as detectOutputFormat,pu as downloadSkillAsset,yn as effectiveConsoleGatewayConfig,Nl as emptySkillLock,rt as ensureConfigDir,jo as estimateCptTokens,Ao as estimateSftDpoTokens,eo as exportCheckpoint,si as extractAsrFlashText,Xl as extractTarBr,id as extractZipEntryToFile,Kl as fanOutSkillToAgents,co as fetchModelCapability,Pi as fetchModelDetail,ji as fetchModelGroups,Ni as fetchModelGroupsAll,Oi as fetchModelList,ki as fetchModelListAll,Li as fetchPredictConfig,uu as fetchSkillsIndex,ko as fetchTrainingModelPrice,ms as findDeploymentEntry,Ai as findModelByName,Mi as flattenModelGroups,ic as flushTelemetry,ot as formatErrorJson,Ka as formatIssue,at as formatJson,ct as formatOutput,it as formatText,Dn as generateCLIAccessToken,Is as generateFilename,Ll as getAgentTargets,Dt as getApiKeyLoginKind,Lo as getCapacityInstance,Ro as getCapacityOperation,Yu as getCliCdnBase,L as getConfigDir,R as getConfigPath,nt as getCredentialsPath,Vi as getDataset,Fo as getDeployment,Ya as getFineTune,Qa as getFineTuneLogs,Hu as getInstallMethod,Et as getModelProfilePreset,vc as getModels,wo as getProfile,Ml as getSkillLockPath,lu as getSkillRegistryBaseUrl,Q as getSkillsDir,Uu as getUpdateInstallMethod,es as hasPrepaidFlags,Pn as image2ImagePath,In as image2videoPath,Xt as imageFileToDataUri,jn as imagePath,Mn as imageSyncPath,Nn as imageText2ImagePath,ri as inferAudioFormatHint,xu as installSkill,bu as installSkillFromBuffer,wu as installSkillWithFanout,Ue as isApiKeyCapability,Ru as isCompiledBinary,di as isDashScopeGateway,Wr as isLegacyImage2ImageModel,Ur as isLegacyText2ImageModel,$t as isLocalFile,Yl as isSafeEntryName,hu as isSafeSkillName,cl as isSemanticAvailable,pn as isStreamableHttpUnsupported,zr as isSyncMultimodalImageModel,io as isTrainingTypeCli,mn as isUrlOverrideSseFallbackCandidate,Gr as isWanxFunctionImageEditModel,$n as knowledgeChatEndpoint,Xn as knowledgeRetrievePath,Qn as knowledgeSearchEndpoint,Gl as linkSkillToAgents,wi as listBailianControlWorkspaces,Io as listCapacityInstances,$a as listCheckpoints,Bi as listDatasets,Go as listDeployableModels,Po as listDeployments,Ja as listFineTunes,ps as listIndependentDeployedModels,od as listSkillDirsOnDisk,Ga as listSupportedFormats,so as listSupportedTrainingTypes,To as listTrainingTypes,ys as listVocabularies,ac as localSink,At as makeAuthStore,Ri as makeConfigStore,Me as mapApiError,jt as maskToken,Nu as maybeSyncWikiData,ir as mcpWebSearchPath,Vn as memoryAddPath,Un as memoryListPath,Wn as memoryNodePath,Hn as memorySearchPath,oo as modelSupportsTrainingType,Rn as modelsLimitsPath,zn as modelsPermissionsPath,We as normalizeApiKeyCapabilities,ft as normalizeConfigName,Ne as normalizeModelBaseUrl,Hs as parseBooleanValue,Ke as parseConfigFile,qi as parseDatasetSchemaFlag,ws as parseInstantVocabulary,Us as parseOptionalBooleanValue,an as parseSSE,hi as parseSecurityBody,ad as parseSkillNames,Ts as parseVocabularyEntries,ss as pickPlanStrategy,Ua as pickValidator,ql as planUnlinkSkillFromAgents,uo as preflightBatchSizeGate,Jn as profileSchemaPath,bs as queryVocabulary,Tr as ragEndpoint,jl as rankModels,B as readConfigFile,_t as readConfigProfiles,Pl as readSkillLock,Bs as readTextFromPathOrStdin,Kc as recallCandidates,wl as recallSemantic,Zt as redactDataUri,On as refreshAccessToken,Wa as registerValidator,Zu as releaseAssetUrl,oc as remoteSink,Su as removeSkillDir,Vo as renewCapacityInstance,Lt as request,Bt as requestJson,Ti as resetBailianControlPolicies4Agent,Ye as resolveApiKey,ni as resolveAsrApi,fu as resolveAssetFileName,Ws as resolveBooleanFlag,Xe as resolveConsole,en as resolveFileUrl,Yr as resolveImageEditApi,Jr as resolveImageGenerateApi,Kr as resolveImageSizeProfile,Je as resolveModelBaseUrl,qe as resolveModelBaseUrlState,Ze as resolveOpenApi,Rs as resolveOutputDir,qr as resolvePromptExtendDefault,Gs as resolveWatermark,An as responsesPath,Vs as runWithConcurrency,Or as sandboxApiPath,Dr as sandboxBaseUrl,kr as sandboxEndpoint,Mr as sandboxInstanceActionPath,jr as sandboxInstancePath,Pr as sandboxTemplateBuildStatusPath,Nr as sandboxTemplatePath,mu as sanitizeSkillName,Bo as scaleCapacityInstance,Ko as scaleDeployment,rr as securityAgentLogsEndpoint,gi as securityGet,nr as securityOverviewEndpoint,St as selectApiKeyResolutionSources,Ht as signAcsRequest,Ft as sourceConfig,Kn as speechRecognizePath,Gn as speechSynthesizePath,qn as speechVocabularyPath,ds as startModelService,fs as stopModelService,zs as stripUndefined,Ln as taskPath,uc as trackCommandExecution,V as trackingHeaders,ao as trainingTypeMethodVariant,Jl as unlinkSkillFromAgents,U as unwrapResponse,qo as updateDeployment,Uo as updateDeploymentOverflow,xs as updateVocabulary,zi as uploadDataset,Qt as uploadFile,Il as upsertSkillLockEntry,Yn as userProfilePath,yt as validateConfigProfileActivation,G as validateDataset,ts as validatePrepaidFlags,Qo as validateReservationCapacity,vu as validateSkillDir,Fn as videoGeneratePath,Zn as workspaceMaaSBaseUrl,ht as writeConfigFile,Wu as writeInstallMethodSync,Fl as writeSkillLock};
|
|
201
|
+
{"type":"single","recommendations":[{"model":"model ID","reason":"alternative analysis","highlights":["differentiators"]}]}`;else if(c===`scoped`){let e=n.modelPreference?.targets?.length?`\n\n## Scope Restriction\nThe user explicitly requested recommendations from: ${n.modelPreference.targets.join(`, `)}. Prioritize models within this scope.`:``;l=(n.complexity===Y.Pipeline?Mc:jc)+e}else l=n.complexity===Y.Pipeline?Mc:jc;let u=a?.enableThinking??!1,d=n.complexity===Y.Pipeline?`Intent Analysis:\n${s}\n\nCandidate Models:\n${o}\n\nUser Request: ${r}\n\nRecommend up to ${i} models for each pipeline step. Respond in English only.`:`Intent Analysis:\n${s}\n\nCandidate Models:\n${o}\n\nUser Request: ${r}\n\nRecommend up to ${i} models. Respond in English only.`,f={model:`qwen-flash`,messages:[{role:`system`,content:l},{role:`user`,content:d}],max_tokens:4096,temperature:0};u&&(f.stream=!0,f.enable_thinking=!0);let p=kn(),m;if(u){let t=await e.request({path:p,method:`POST`,body:f,stream:!0}),n=``,r=!1;for await(let e of an(t)){if(e.data===`[DONE]`)break;try{let t=JSON.parse(e.data);for(let e of t.choices){let t=e.delta;t.reasoning_content&&a?.onThinking&&a.onThinking(t.reasoning_content),t.content&&(r||(r=!0,a?.onContentStart?.()),n+=t.content)}}catch{}}m=n||`{}`}else m=(await e.requestJson({path:p,method:`POST`,body:f})).choices?.[0]?.message?.content??`{}`;let h;try{let e=m.match(/\{[\s\S]*\}/);h=JSON.parse(e?.[0]??`{}`)}catch{return{type:Y.Single,recommendations:[]}}let g=new Map(t.map(({model:e})=>[e.model,e]));if(h.type===Y.Pipeline&&Array.isArray(h.steps)){let e=[];for(let t of h.steps){let n=jl(t.recommendations??(t.model?[t]:[]),g,i);n.length>0&&e.push({step:t.step??``,recommendations:n})}return Ml(e,g),{type:Y.Pipeline,summary:h.summary??``,steps:e}}let _=jl(h.recommendations??h??[],g,i);return{type:Y.Single,recommendations:_}}function Q(){return M(L(),`skills`)}function Pl(){return M(Q(),`skill-lock.json`)}function Fl(){return{version:1,skills:{}}}function Il(){let e=Pl();if(!C(e))return Fl();try{let t=JSON.parse(E(e,`utf-8`));return t?.version!==1||typeof t.skills!=`object`||t.skills===null?Fl():t}catch{return Fl()}}function Ll(e){T(Q(),{recursive:!0}),ue(Pl(),JSON.stringify(e,null,2)+`
|
|
202
|
+
`)}function Rl(e,t){let n=Il();n.skills[e]={...n.skills[e],...t},Ll(n)}function zl(){let e=me(),t=process.cwd(),n=process.env.XDG_CONFIG_HOME||M(e,`.config`),r=(t,n,r)=>({id:t,displayName:n,skillsDir:M(e,r,`skills`),detectDirs:[M(e,r)]}),i=(t,n)=>t?.trim()||M(e,n),a=(e,t,n)=>({id:e,displayName:t,skillsDir:M(n,`skills`),detectDirs:[n]}),o=[`.openclaw`,`.clawdbot`,`.moltbot`].map(t=>M(e,t)),s=o.find(e=>C(e))??o[0],c=[M(n,`zed`)],l=process.env.APPDATA?.trim();l&&c.push(M(l,`Zed`));let u=process.env.FLATPAK_XDG_CONFIG_HOME?.trim();u&&c.push(M(u,`zed`));let d=i(process.env.CODEX_HOME,`.codex`);return[{id:`universal`,displayName:`Universal (~/.agents/skills)`,skillsDir:M(e,`.agents`,`skills`),detectDirs:[M(e,`.agents`),M(e,`.cline`),M(e,`.dexto`),M(e,`.firebender`),M(e,`.kimi-code`),M(e,`.kimi`),M(e,`.loaf`),M(e,`.warp`),...c]},{id:`universal-xdg`,displayName:`Universal (XDG agents/skills)`,skillsDir:M(n,`agents`,`skills`),detectDirs:[M(n,`agents`),M(n,`amp`),M(t,`.replit`)]},r(`adal`,`AdaL`,`.adal`),r(`aider-desk`,`AiderDesk`,`.aider-desk`),r(`antigravity`,`Antigravity`,`.gemini/antigravity`),r(`antigravity-cli`,`Antigravity CLI`,`.gemini/antigravity-cli`),{id:`astrbot`,displayName:`AstrBot`,skillsDir:M(e,`.astrbot`,`data`,`skills`),detectDirs:[M(t,`data`,`skills`),M(e,`.astrbot`)]},a(`autohand-code`,`Autohand Code CLI`,i(process.env.AUTOHAND_HOME,`.autohand`)),r(`augment`,`Augment`,`.augment`),r(`bob`,`IBM Bob`,`.bob`),a(`claude-code`,`Claude Code`,i(process.env.CLAUDE_CONFIG_DIR,`.claude`)),r(`codearts-agent`,`CodeArts Agent`,`.codeartsdoer`),{id:`codebuddy`,displayName:`CodeBuddy`,skillsDir:M(e,`.codebuddy`,`skills`),detectDirs:[M(t,`.codebuddy`),M(e,`.codebuddy`)]},r(`codemaker`,`Codemaker`,`.codemaker`),r(`codestudio`,`Code Studio`,`.codestudio`),{id:`codex`,displayName:`Codex`,skillsDir:M(d,`skills`),detectDirs:[d,`/etc/codex`]},r(`command-code`,`Command Code`,`.commandcode`),{id:`continue`,displayName:`Continue`,skillsDir:M(e,`.continue`,`skills`),detectDirs:[M(t,`.continue`),M(e,`.continue`)]},r(`cortex`,`Cortex Code`,`.snowflake/cortex`),r(`crush`,`Crush`,`.config/crush`),r(`cursor`,`Cursor`,`.cursor`),{id:`deepagents`,displayName:`Deep Agents`,skillsDir:M(e,`.deepagents`,`agent`,`skills`),detectDirs:[M(e,`.deepagents`)]},{id:`devin`,displayName:`Devin for Terminal`,skillsDir:M(n,`devin`,`skills`),detectDirs:[M(n,`devin`)]},r(`droid`,`Droid`,`.factory`),a(`dsh`,`DeepSeek DSH`,i(process.env.DSH_HOME,`.dsh`)),r(`forgecode`,`ForgeCode`,`.forge`),r(`gemini-cli`,`Gemini CLI`,`.gemini`),r(`github-copilot`,`GitHub Copilot`,`.copilot`),{id:`goose`,displayName:`Goose`,skillsDir:M(n,`goose`,`skills`),detectDirs:[M(n,`goose`)]},a(`grok`,`Grok Build`,i(process.env.GROK_HOME,`.grok`)),a(`hermes`,`Hermes Agent`,Ls(e)),r(`iflow-cli`,`iFlow CLI`,`.iflow`),r(`inference-sh`,`inference.sh`,`.inferencesh`),{id:`jazz`,displayName:`Jazz`,skillsDir:M(e,`.jazz`,`skills`),detectDirs:[M(e,`.jazz`),M(t,`.jazz`)]},r(`junie`,`Junie`,`.junie`),r(`kilo`,`Kilo Code`,`.kilocode`),{id:`kimchi`,displayName:`Kimchi`,skillsDir:M(e,`.config`,`kimchi`,`harness`,`skills`),detectDirs:[M(e,`.config`,`kimchi`)]},r(`kiro-cli`,`Kiro CLI`,`.kiro`),r(`kode`,`Kode`,`.kode`),r(`lingma`,`Lingma`,`.lingma`),r(`mcpjam`,`MCPJam`,`.mcpjam`),{id:`minimax-code`,displayName:`MiniMax Code`,skillsDir:M(e,`.minimax`,`skills`),detectDirs:[M(e,`.minimax`),`/Applications/MiniMax Code.app`]},a(`mistral-vibe`,`Mistral Vibe`,i(process.env.VIBE_HOME,`.vibe`)),r(`moxby`,`Moxby`,`.moxby`),r(`mux`,`Mux`,`.mux`),r(`neovate`,`Neovate`,`.neovate`),{id:`opencode`,displayName:`OpenCode`,skillsDir:M(n,`opencode`,`skills`),detectDirs:[M(n,`opencode`)]},{id:`openclaw`,displayName:`OpenClaw`,skillsDir:M(s,`skills`),detectDirs:o},r(`openhands`,`OpenHands`,`.openhands`),r(`ona`,`Ona`,`.ona`),r(`pi`,`Pi`,`.pi/agent`),r(`pochi`,`Pochi`,`.pochi`),r(`qoder`,`Qoder`,`.qoder`),r(`qoder-cn`,`Qoder CN`,`.qoder-cn`),r(`qwen-code`,`Qwen Code`,`.qwen`),r(`reasonix`,`Reasonix`,`.reasonix`),r(`rovodev`,`Rovo Dev`,`.rovodev`),r(`roo`,`Roo Code`,`.roo`),{id:`tabnine-cli`,displayName:`Tabnine CLI`,skillsDir:M(e,`.tabnine`,`agent`,`skills`),detectDirs:[M(e,`.tabnine`)]},r(`terramind`,`Terramind`,`.terramind`),r(`tinycloud`,`Tinycloud`,`.tinycloud`),r(`trae`,`Trae`,`.trae`),r(`trae-cli`,`Trae CLI`,`.traecli`),r(`trae-cn`,`Trae CN`,`.trae-cn`),r(`windsurf`,`Windsurf`,`.codeium/windsurf`),r(`workbuddy`,`Tencent WorkBuddy`,`.workbuddy`),{id:`zcode`,displayName:`ZCode`,skillsDir:M(e,`.zcode`,`skills`),detectDirs:[M(e,`.zcode`),`/Applications/ZCode.app`]},r(`zencoder`,`Zencoder`,`.zencoder`)]}function Bl(){return zl().filter(e=>e.detectDirs.some(e=>C(e)))}function Vl(e,t){return process.platform===`win32`?e.toLowerCase()===t.toLowerCase():e===t}function Hl(e){let t=Q();if(process.platform===`win32`){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(r+pe)}return e===t||e.startsWith(t+pe)}function Ul(e){try{if(!w(e).isSymbolicLink())return!1;let t=se(e);return Hl(j(t)?t:fe(A(e),t))}catch{return!1}}function Wl(e,t){if(!t.some(t=>Vl(t,e)))return!1;try{return w(e).isDirectory()}catch{return!1}}function Gl(e){try{return w(e).isDirectory()?C(M(e,`SKILL.md`)):!1}catch{return!1}}const Kl=`existing file/dir not managed by bl skill`;function ql(e,t=Bl(),n=[]){let r=M(Q(),e),i=[];for(let a of t){let t=M(a.skillsDir,e);try{let e=!1;try{w(t),e=!0}catch{}if(e){if(Ul(t))O(t);else if(Wl(t,n))O(t,{recursive:!0,force:!0});else if(Gl(t))O(t,{recursive:!0,force:!0});else{i.push({agent:a.id,path:t,mode:`skipped`,reason:Kl});continue}}T(a.skillsDir,{recursive:!0});try{k(r,t,process.platform===`win32`?`junction`:`dir`),i.push({agent:a.id,path:t,mode:`symlink`})}catch{ae(r,t,{recursive:!0}),i.push({agent:a.id,path:t,mode:`copy`})}}catch(e){i.push({agent:a.id,path:t,mode:`skipped`,reason:e instanceof Error?e.message:String(e)})}}return i}function Jl(e,t=Bl(),n=[]){let r=ql(e,t,n),i=r.filter(e=>e.mode!==`skipped`),a=i.map(e=>e.path),o=r.filter(e=>e.mode===`skipped`&&e.reason===Kl).map(e=>e.path),s=n.filter(e=>!a.some(t=>Vl(t,e))&&!o.some(t=>Vl(t,e)));return{results:r,linkedAgents:i.map(e=>e.agent),links:[...a,...s]}}function Yl(e,t=[]){let n=[],r=new Set(t);for(let t of zl())r.add(M(t.skillsDir,e));for(let e of r)try{let r;try{r=w(e)}catch{continue}r.isSymbolicLink()?Ul(e)&&n.push(e):t.some(t=>Vl(t,e))&&n.push(e)}catch{}return n}function Xl(e,t=[]){let n=[];for(let r of Yl(e,t))try{if(Ul(r))O(r);else if(!w(r).isSymbolicLink()&&t.some(e=>Vl(e,r)))O(r,{recursive:!0,force:!0});else continue;n.push(r)}catch{}return n}function Zl(e){return e.includes(`\\`)||e.includes(`\0`)||e.startsWith(`/`)||/^[a-zA-Z]:[\\/]/.test(e)?!1:!e.split(`/`).includes(`..`)}async function Ql(e,t){let n=ye.extract();n.on(`entry`,(e,r,i)=>{if(!Zl(e.name)){r.on(`error`,()=>{}),r.resume(),n.destroy(/* @__PURE__ */ Error(`unsafe tar entry: ${e.name}`));return}let a=M(t,e.name);if(e.type===`directory`){T(a,{recursive:!0}),r.resume(),r.on(`end`,i);return}T(A(a),{recursive:!0});let o=oe(a);r.pipe(o),o.on(`finish`,i),o.on(`error`,i)}),await _e(ge.from(e),ve(),n)}function $l(e){let t=[],n=r=>{for(let i of D(r?M(e,r):e,{withFileTypes:!0})){let e=r?`${r}/${i.name}`:i.name;i.isDirectory()?n(e):i.isFile()&&t.push(e)}};n(``),t.sort((e,t)=>e<t?-1:+(e>t));let r=he(`sha256`);for(let n of t)r.update(n),r.update(E(M(e,n)));return`sha256:${r.digest(`hex`)}`}function eu(e,t,n=259){let r,i=a=>{for(let o of D(a,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let s=M(a,o.name),c=de(e,s);for(let e of t){let t=M(e,c).length;t>n&&t>(r?.pathLength??0)&&(r={root:e,relativePath:c,pathLength:t})}o.isDirectory()&&i(s)}};for(let e of t)e.length>n&&e.length>(r?.pathLength??0)&&(r={root:e,relativePath:``,pathLength:e.length});return i(e),r}function tu(e){let t=[],n=r=>{for(let i of D(r,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let a=M(r,i.name),o=de(e,a);i.isDirectory()?(t.push({relativePath:o,type:`directory`}),n(a)):i.isFile()&&t.push({relativePath:o,type:`file`})}};return n(e),t}function nu(e,t){let n=tu(e),r=new Set(n.map(e=>e.relativePath));T(t,{recursive:!0});for(let r of n){let n=M(e,r.relativePath),i=M(t,r.relativePath);if(C(i)){let e=w(i);(!(r.type===`directory`?e.isDirectory():e.isFile())||e.isSymbolicLink())&&O(i,{recursive:!0,force:!0})}r.type===`directory`?T(i,{recursive:!0}):(T(A(i),{recursive:!0}),ie(n,i))}let i=tu(t).filter(e=>!r.has(e.relativePath)).sort((e,t)=>t.relativePath.length-e.relativePath.length);for(let e of i)O(M(t,e.relativePath),{recursive:!0,force:!0})}function ru(e){let t=e?.code;return t===`EPERM`||t===`EBUSY`}function iu(e){try{C(e)&&O(e,{recursive:!0,force:!0})}catch{}}function au(e,t,n={}){T(A(t),{recursive:!0});let r=`${t}.old-${Date.now()}`;if(C(t))try{ce(t,r)}catch(i){if(!(n.allowInPlaceFallback??process.platform===`win32`)||!ru(i))throw i;try{nu(t,r),nu(e,t),iu(r);return}catch(e){try{C(r)&&nu(r,t)}catch{}throw Error(`Skill directory is in use and could not be updated in place. Close running agent hosts and retry. / Skill 目录正被占用,无法原地更新;请关闭正在运行的 Agent 后重试。 ${e instanceof Error?e.message:String(e)}`,{cause:e})}}try{ce(e,t)}catch(e){throw C(r)&&!C(t)&&ce(r,t),e}iu(r)}function ou(e){if(e instanceof P){let t=e.api?.httpStatus;if(t!==void 0){if(t===408||t===429)return!0;if(t>=400&&t<500)return!1}return!0}return!0}function su(e){return e instanceof P&&e.api?.httpStatus===429}function cu(e,t){return Math.min(t*2**(e-1),1e4)}function lu(e){return new Promise(t=>setTimeout(t,e))}async function uu(e,t=3){let n=typeof t==`number`?{attempts:t}:t,r=n.attempts??3,i=n.shouldRetry??ou,a=n.backoffBaseMs??500,o;for(let t=1;t<=r;t++)try{return await e(t)}catch(e){if(o=e,t>=r||!i(e,t))break;su(e)&&await lu(cu(t,a))}throw o}function du(){return(process.env.BAILIAN_SKILL_REGISTRY_URL?.trim()||`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/skills`).replace(/\/+$/,``)}async function fu(e=3e4,t=3){return uu(async()=>{let t=`${du()}/index.json`,n;try{n=await fetch(t,{signal:AbortSignal.timeout(e)})}catch(e){throw new P(`Cannot access skill registry: ${t}`,N.NETWORK,`Check network connectivity; if using a private mirror, verify BAILIAN_SKILL_REGISTRY_URL configuration`,{cause:e})}if(!n.ok)throw new P(`Skill registry returned HTTP ${n.status}: ${t}`,N.NETWORK,n.status===404?`Skill index not yet published or registry URL is incorrect; confirm the publisher has generated index.json`:`Remote error, retry later`);let r;try{r=await n.json()}catch(e){throw new P(`Skill index index.json is not valid JSON`,N.GENERAL,`Remote may be in the middle of publishing, retry later`,{cause:e})}let i=r;if(typeof i!=`object`||!i||typeof i.skills!=`object`||i.skills===null)throw new P(`Skill index index.json has invalid structure`,N.GENERAL,`Retry later or contact the publisher`);return i},{attempts:t})}const pu=/^sha256-[0-9a-f]{64}\.tar\.br$/;function mu(e){let t=e?.object;return t&&pu.test(t)?t:`skill.tar.br`}async function hu(e,t,n=3){return uu(async()=>{let n=`${du()}/${e}/${mu(t)}`,r;try{r=await fetch(n,{signal:AbortSignal.timeout(12e4)})}catch(t){throw new P(`Failed to download skill ${e}: ${n}`,N.NETWORK,`Network error, retryable`,{cause:t})}if(!r.ok)throw new P(`Failed to download skill ${e}: HTTP ${r.status}`,N.NETWORK,r.status===404?`index.json and skill object are temporarily inconsistent (publishing in progress), retry later`:`Remote error, retry later`);return Buffer.from(await r.arrayBuffer())},{attempts:n})}function gu(e){return e.replace(/[\\/:*?"<>|\s]+/g,`-`).replace(/\.\.+/g,`-`).replace(/^[-.]+|[-.]+$/g,``)||`unnamed-skill`}function _u(e){return e.length>0&&gu(e)===e}function vu(e,t){throw new P(`Skill ${e} validation failed: ${t}`,N.GENERAL,`This skill package does not conform to the SKILL.md spec; contact the skill publisher to fix and republish`)}function yu(e){if(!e.startsWith(`---`))return null;let t=/^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/.exec(e);return t?t[1]:null}function bu(e,t){let n=M(e,`SKILL.md`),r;try{le(n).isFile()||vu(t,`SKILL.md is not a regular file`),r=E(n,`utf-8`)}catch(e){if(e instanceof P)throw e;vu(t,`missing SKILL.md`)}let i=yu(r);i===null&&vu(t,`SKILL.md is missing frontmatter (--- delimited YAML header)`);let a;try{a=_(i)}catch{vu(t,`frontmatter is not valid YAML`)}(typeof a!=`object`||!a)&&vu(t,`frontmatter is not a key-value structure`);let o=a,s=typeof o.name==`string`?o.name.trim():``,c=typeof o.description==`string`?o.description.trim():``;return(!s||!c)&&vu(t,`frontmatter is missing non-empty name / description fields`),{name:s,description:c}}function xu(e){if(!_u(e))throw new P(`Invalid skill name: ${e}`,N.GENERAL,`Skill name contains path separators, traversal sequences, or other illegal characters; refusing to write to disk`)}async function Su(e,t,n,r){xu(e);let i=Q(),a=M(i,e),o=M(i,`.tmp-${e}-${process.pid}-${Date.now()}`);try{T(o,{recursive:!0}),await Ql(t,o);let i=eu(o,r??(process.platform===`win32`?[a]:[]));if(i)throw new P(`Skill ${e} contains a Windows-incompatible path (${i.pathLength} characters): ${i.relativePath}`,N.GENERAL,`The skill package must shorten this path before it can be installed safely on Windows. / Skill 包必须缩短该路径后才能在 Windows 上安全安装。`);if(n?.startsWith(`sha256:`)){let t=$l(o);if(t!==n)throw new P(`Skill ${e} failed integrity check: index says ${n}, archive is ${t}`,N.GENERAL,`Downloaded archive does not match the index fingerprint (registry may be mid-publish); retry later`)}let s=bu(o,e);return au(o,a),{name:e,path:a,meta:s}}finally{try{C(o)&&O(o,{recursive:!0,force:!0})}catch{}}}async function Cu(e,t,n,r){if(t.compression&&t.compression!==`tar.br`)throw new P(`Skill ${e} uses unsupported compression format: ${t.compression}`,N.GENERAL,`Upgrade bailian-cli to the latest version and retry`);return Su(e,await hu(e,t,n),t.contentHash,r)}function wu(e){xu(e);let t=M(Q(),e);return C(t)?(O(t,{recursive:!0,force:!0}),!0):!1}function Tu(e,t){return{...e.contentHash?{contentHash:e.contentHash}:{},...e.publishedAt?{publishedAt:e.publishedAt}:{},installedAt:(/* @__PURE__ */ new Date()).toISOString(),sourceType:`oss`,...e.description?{description:e.description}:{},links:t}}async function Eu(e,t,n=Bl(),r=[],i){await Cu(e,t,i,process.platform===`win32`?[M(Q(),e),...n.map(t=>M(t.skillsDir,e))]:void 0);let a=Jl(e,n,r);return{lockEntry:Tu(t,a.links),linkedAgents:a.linkedAgents}}const $=`bailian-docs-llm-wiki`;function Du(){return M(L(),`skills/bailian-docs-llm-wiki`)}function Ou(){return C(M(Du(),`models`,`models.jsonl`))}function ku(){return M(L(),`wiki-sync-state.json`)}function Au(){try{return JSON.parse(E(ku(),`utf-8`))}catch{return null}}function ju(e){try{ue(ku(),JSON.stringify(e))}catch{}}function Mu(e){try{Rl($,e)}catch{}}function Nu(e){try{let t=Il().skills[$];return t?.contentHash!==e||!Array.isArray(t.links)}catch{return!0}}async function Pu(){try{return(await fu(3e3,1)).skills[$]??null}catch{return null}}async function Fu(){let e=Au(),t=Date.now();if(e&&t-e.lastChecked<432e5&&Ou())return!1;let n=await Pu();if(!n?.contentHash)return!1;if(Ou()&&(!e||e.contentHash===n.contentHash)){if(ju({lastChecked:t,contentHash:n.contentHash}),Nu(n.contentHash)){let e=Il().skills[$]?.links??[];Mu(Tu(n,Jl($,Bl(),e).links))}return!1}try{let e=Il().skills[$]?.links??[];Mu((await Eu($,n,Bl(),e,1)).lockEntry)}catch{return!1}return ju({lastChecked:t,contentHash:n.contentHash}),!0}const Iu=`bailian-cli`,Lu=`install-method`,Ru=/* @__PURE__ */ new Set([`binary`,`npm`,`brew`,`winget`,`unknown`]);function zu(e){return e?M(L(),`${Lu}.${e}`):M(L(),Lu)}function Bu(){if(process.env.BAILIAN_COMPILED===`1`)return!0;let e=process.execPath.replaceAll(`\\`,`/`);return/(^|\/)node(\.exe)?$/i.test(e)||e.includes(`/node/`)||/(^|\/)bun(\.exe)?$/i.test(e)||e.includes(`/.bun/`)?!1:/\/(bl|bailian)(\.exe)?$/i.test(e)}function Vu(e){if(!e)return null;let t=e.trim().toLowerCase();return Ru.has(t)?t:null}function Hu(e){try{return Vu(E(e,`utf-8`).split(`
|
|
203
|
+
`)[0])}catch{return null}}function Uu(){let e=Vu(process.env.BAILIAN_INSTALL_METHOD);if(e)return e;if(Bu()){let e=process.execPath.replaceAll(`\\`,`/`);return e.includes(`/Cellar/`)||e.includes(`/homebrew/`)?`brew`:`binary`}return`npm`}function Wu(e){let t=Vu(process.env.BAILIAN_INSTALL_METHOD);if(t)return t;if(e?.clientName){let t=Hu(zu(e.clientName));if(t)return t;if(e.clientName===`bailian-cli`){let e=Hu(zu());if(e)return e}return Uu()}return Hu(zu())||Uu()}function Gu(e){let t=Wu(e);return t===`binary`&&e.npmPackage!==`bailian-cli`?`npm`:t}function Ku(e,t={clientName:Iu}){try{let n=L();C(n)||T(n,{recursive:!0,mode:448}),ue(zu(t.clientName),`${e}\n`,{mode:384}),t.clientName===`bailian-cli`&&ue(zu(),`${e}\n`,{mode:384})}catch{}}const qu=`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release`,Ju=`https://github.com/modelstudioai/cli/releases`,Yu=`https://bailian.aliyun.com/cli/install.sh`,Xu=`https://bailian.aliyun.com/cli/install.ps1`;function Zu(){let e=process.env.BAILIAN_CLI_CDN?.trim();return e?e.replace(/\/$/,``):qu}function Qu(e=`latest`){let t=e.trim();return!t||t===`latest`||t===`stable`?`${Zu()}/manifest.json`:`${Zu()}/${t}.json`}function $u(e,t){let n=e.startsWith(`v`)?e:`v${e}`;return`${Zu()}/${n}/${t}`}function ed(){let e=process.platform,t=process.arch,n;if(e===`darwin`)n=`darwin`;else if(e===`linux`)n=`linux`;else if(e===`win32`)n=`windows`;else throw Error(`Unsupported platform for binary updates: ${e}`);let r;if(t===`arm64`)r=`arm64`;else if(t===`x64`)r=`x64`;else throw Error(`Unsupported architecture for binary updates: ${t}`);if(n===`linux`&&r===`arm64`)throw Error(`linux arm64 is not supported for binary updates; use: npm install -g bailian-cli`);if(n===`windows`&&r===`arm64`)throw Error(`windows arm64 is not supported for binary updates; use: npm install -g bailian-cli`);return{os:n,arch:r,fileSuffix:e===`win32`?`.exe`:``}}function td(e,t,n,r=!1){return`bl-${e}-${t}-${n}.zip`}function nd(e,t,n){if(t!==`windows`)return`bl-${e}-${t}-${n}.tar.gz`}function rd(e,t,n,r=!1){return`bl-${e}-${t}-${n}${r?`.exe`:``}`}function id(e){return new Promise((t,n)=>{S.open(e,{lazyEntries:!0},(r,i)=>{if(r||!i){n(r??/* @__PURE__ */ Error(`Failed to open zip: ${e}`));return}t(i)})})}function ad(e){let t=e.replace(/\\/g,`/`);return t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t}async function od(e,t,n){let r=await id(e);return new Promise((i,a)=>{let o=!1,s=e=>{if(!o){o=!0;try{r.close()}catch{}a(e instanceof Error?e:Error(String(e)))}},c=e=>{if(!o){o=!0;try{r.close()}catch{}i(e)}};r.on(`error`,s),r.on(`end`,()=>{o||s(/* @__PURE__ */ Error(n?`Zip entry not found: ${n} in ${e}`:`Zip has no file entries: ${e}`))}),r.on(`entry`,e=>{if(o)return;let i=e.fileName.replace(/\\/g,`/`);if(i.endsWith(`/`)){r.readEntry();return}let a=ad(i);if(n&&i!==n&&a!==n){r.readEntry();return}r.openReadStream(e,(n,r)=>{if(n||!r){s(n??/* @__PURE__ */ Error(`Failed to read zip entry: ${e.fileName}`));return}(async()=>{try{await be(A(t),{recursive:!0}),await _e(r,oe(t)),c(a)}catch(e){s(e)}})()})}),r.readEntry()})}function sd(e,t){let n=(e??(t?`all`:``)).trim();if(!n)throw new F(`--name cannot be empty`,`Use --name all or --name skill-a,skill-b`);let r=[...new Set(n.split(`,`).map(e=>e.trim()).filter(Boolean))];if(r.includes(`all`)){if(r.length>1)throw new F(`--name all cannot be mixed with specific skill names`,`Use either all or a comma-separated list of names`);return`all`}return r}function cd(){let e=Q();return C(e)?D(e).filter(t=>{if(t.startsWith(`.`)||t.includes(`.tmp-`)||t.includes(`.old-`))return!1;try{return le(M(e,t)).isDirectory()}catch{return!1}}):[]}function ld(e,t,n){let r=new Set(n),i=/* @__PURE__ */ new Set,a=[];for(let[n,o]of Object.entries(e.skills)){i.add(n);let e=t.skills[n];if(e){let t=r.has(n)?e.contentHash===o.contentHash?`installed`:`outdated`:`missing`;a.push({name:n,status:t,publishedAt:o.publishedAt,description:o.description})}else r.has(n)?a.push({name:n,status:`untracked`,publishedAt:o.publishedAt,description:o.description}):a.push({name:n,status:`not-installed`,publishedAt:o.publishedAt,description:o.description})}for(let[e,n]of Object.entries(t.skills))i.has(e)||(i.add(e),a.push({name:e,status:r.has(e)?`installed`:`missing`,publishedAt:n.publishedAt,description:n.description}));for(let e of n)i.has(e)||a.push({name:e,status:`untracked`});return a.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name))}export{He as API_KEY_CAPABILITY_PATTERN,Os as ASYNC_FLAG,Ie as BAILIAN_HOST,Xo as BILLING_METHOD,Iu as BINARY_PRODUCT_CLIENT_NAME,P as BailianError,Sc as Budgets,Do as CALC_DATASETS_TOKENS_API,Mt as CHANNEL,q as CHARGE_TYPE,Ps as COMMAND_PACK_API_VERSION,Ds as CONCURRENT_FLAG,ze as CONFIG_FILE_KEYS,As as CONSOLE_AUTH_FLAGS,Z as Capabilities,Cn as Client,Y as Complexities,Cc as ContextNeeds,Pt as DASHSCOPE_SERVICE_HEADER,Zo as DEFAULT_BILLING_METHOD,qu as DEFAULT_CLI_CDN_BASE,Jo as DEFAULT_DEPLOY_PLAN,Xu as DEFAULT_INSTALL_PS1_URL,Yu as DEFAULT_INSTALL_SCRIPT_URL,Re as DEFAULT_LANGUAGE,ro as DEFAULT_TRAINING_TYPE,us as DEPLOY_LIST_INDEPENDENT_API,K as DEPLOY_PLAN,cs as DEPLOY_START_API,ls as DEPLOY_STOP_API,Fe as DOCS_HOSTS,Oo as ESTIMATE_FINETUNE_TOKENS_API,N as ExitCode,wc as Features,Ju as GITHUB_RELEASES_BASE,Es as GLOBAL_FLAGS,lo as INSUFFICIENT_SAMPLES_CODE,Wi as MAX_CPT_BYTES,Ui as MAX_DATASET_BYTES,Gi as MAX_MEDIA_ZIP_BYTES,ks as MODEL_AUTH_FLAGS,Ei as MODEL_LIST_API,gn as McpClient,xc as Modalities,Tc as ModelCategories,js as OPENAPI_AUTH_FLAGS,Nt as OPEN_API_SOURCE,Di as PREDICT_CONFIG_API,X as QualityPreferences,Fr as RAG_PATHS,I as REGIONS,Ar as SANDBOX_PATHS,Ec as SEMANTIC_TOP_K,hs as SPEECH_BIASING_MODEL,os as STRATEGIES,Le as SUPPORTED_LANGUAGES,Eo as TRAINING_MODEL_PRICE_API,no as TRAINING_TYPES_CLI,to as TRAINING_TYPE_MAP,F as UsageError,bt as activateConfigProfile,Er as agentStudioFilesPath,er as agentStudioHost,Ic as analyzeIntent,bn as anonymousConsoleCall,Bn as appCompletionPath,au as atomicSwap,dn as bailianMcpPath,fn as bailianMcpSsePath,td as binaryAssetFileName,rd as binaryInnerFileName,nd as binaryTarFileName,Vt as buildAcsCanonicalQuery,ii as buildAsrContextMessages,oi as buildAsrFlashRequest,ai as buildAsyncAsrLanguageFields,Al as buildDocLink,ns as buildPrepaidInfo,$o as buildReservationCapacity,wt as buildSettings,Tu as buildSkillLockEntry,Ct as buildSources,gs as buildVocabularyRequest,Sn as callConsoleGateway,Xa as cancelFineTune,Qu as channelManifestUrl,kn as chatPath,ci as collectAsrTranscriptionItems,$l as computeDirContentHash,ld as computeSkillStatuses,hn as connectBailianMcpWithFallback,Ci as createBailianControlUser,zo as createCapacityInstance,No as createDeployment,qa as createFineTune,yi as createInstrumentedFetch,Js as createTrackingEvent,vs as createVocabulary,Ms as credentialFlagDefs,Yo as defaultDeployPlan,Ns as defineCommand,Ho as deleteCapacityInstance,xt as deleteConfigProfile,Hi as deleteDataset,Wo as deleteDeployment,Za as deleteFineTune,Ss as deleteVocabulary,_r as deploymentCapacityInstancePath,yr as deploymentCapacityInstanceRenewPath,vr as deploymentCapacityInstanceScalePath,gr as deploymentCapacityInstancesPath,xr as deploymentCapacityOperationPath,br as deploymentOverflowPath,tt as describeAuthState,ed as detectBinaryPlatform,Uu as detectInstallMethod,Bl as detectInstalledAgents,Ia as detectModality,st as detectOutputFormat,hu as downloadSkillAsset,yn as effectiveConsoleGatewayConfig,Fl as emptySkillLock,rt as ensureConfigDir,jo as estimateCptTokens,Ao as estimateSftDpoTokens,eo as exportCheckpoint,si as extractAsrFlashText,Ql as extractTarBr,od as extractZipEntryToFile,Jl as fanOutSkillToAgents,co as fetchModelCapability,Pi as fetchModelDetail,ji as fetchModelGroups,Ni as fetchModelGroupsAll,Oi as fetchModelList,ki as fetchModelListAll,Li as fetchPredictConfig,fu as fetchSkillsIndex,ko as fetchTrainingModelPrice,ms as findDeploymentEntry,Ai as findModelByName,Mi as flattenModelGroups,oc as flushTelemetry,ot as formatErrorJson,Ka as formatIssue,at as formatJson,ct as formatOutput,it as formatText,Dn as generateCLIAccessToken,Is as generateFilename,zl as getAgentTargets,Dt as getApiKeyLoginKind,Lo as getCapacityInstance,Ro as getCapacityOperation,Zu as getCliCdnBase,L as getConfigDir,R as getConfigPath,nt as getCredentialsPath,Vi as getDataset,Fo as getDeployment,Ya as getFineTune,Qa as getFineTuneLogs,Ls as getHermesHome,Wu as getInstallMethod,Et as getModelProfilePreset,bc as getModels,wo as getProfile,Pl as getSkillLockPath,du as getSkillRegistryBaseUrl,Q as getSkillsDir,Gu as getUpdateInstallMethod,es as hasPrepaidFlags,Pn as image2ImagePath,In as image2videoPath,Xt as imageFileToDataUri,jn as imagePath,Mn as imageSyncPath,Nn as imageText2ImagePath,ri as inferAudioFormatHint,Cu as installSkill,Su as installSkillFromBuffer,Eu as installSkillWithFanout,Ue as isApiKeyCapability,Bu as isCompiledBinary,di as isDashScopeGateway,Wr as isLegacyImage2ImageModel,Ur as isLegacyText2ImageModel,$t as isLocalFile,Zl as isSafeEntryName,_u as isSafeSkillName,ul as isSemanticAvailable,pn as isStreamableHttpUnsupported,zr as isSyncMultimodalImageModel,io as isTrainingTypeCli,mn as isUrlOverrideSseFallbackCandidate,Gr as isWanxFunctionImageEditModel,$n as knowledgeChatEndpoint,Xn as knowledgeRetrievePath,Qn as knowledgeSearchEndpoint,ql as linkSkillToAgents,wi as listBailianControlWorkspaces,Io as listCapacityInstances,$a as listCheckpoints,Bi as listDatasets,Go as listDeployableModels,Po as listDeployments,Ja as listFineTunes,ps as listIndependentDeployedModels,cd as listSkillDirsOnDisk,Ga as listSupportedFormats,so as listSupportedTrainingTypes,To as listTrainingTypes,ys as listVocabularies,sc as localSink,At as makeAuthStore,Ri as makeConfigStore,Me as mapApiError,jt as maskToken,Fu as maybeSyncWikiData,ir as mcpWebSearchPath,Vn as memoryAddPath,Un as memoryListPath,Wn as memoryNodePath,Hn as memorySearchPath,oo as modelSupportsTrainingType,Rn as modelsLimitsPath,zn as modelsPermissionsPath,We as normalizeApiKeyCapabilities,ft as normalizeConfigName,Ne as normalizeModelBaseUrl,Ws as parseBooleanValue,Ke as parseConfigFile,qi as parseDatasetSchemaFlag,ws as parseInstantVocabulary,Gs as parseOptionalBooleanValue,an as parseSSE,hi as parseSecurityBody,sd as parseSkillNames,Ts as parseVocabularyEntries,ss as pickPlanStrategy,Ua as pickValidator,Yl as planUnlinkSkillFromAgents,uo as preflightBatchSizeGate,Jn as profileSchemaPath,bs as queryVocabulary,Tr as ragEndpoint,Nl as rankModels,B as readConfigFile,_t as readConfigProfiles,Il as readSkillLock,Hs as readTextFromPathOrStdin,Jc as recallCandidates,El as recallSemantic,Zt as redactDataUri,On as refreshAccessToken,Wa as registerValidator,$u as releaseAssetUrl,cc as remoteSink,wu as removeSkillDir,Vo as renewCapacityInstance,Lt as request,Bt as requestJson,Ti as resetBailianControlPolicies4Agent,Ye as resolveApiKey,ni as resolveAsrApi,mu as resolveAssetFileName,Ks as resolveBooleanFlag,Xe as resolveConsole,en as resolveFileUrl,Yr as resolveImageEditApi,Jr as resolveImageGenerateApi,Kr as resolveImageSizeProfile,Je as resolveModelBaseUrl,qe as resolveModelBaseUrlState,Ze as resolveOpenApi,Bs as resolveOutputDir,qr as resolvePromptExtendDefault,qs as resolveWatermark,An as responsesPath,Us as runWithConcurrency,Or as sandboxApiPath,Dr as sandboxBaseUrl,kr as sandboxEndpoint,Mr as sandboxInstanceActionPath,jr as sandboxInstancePath,Pr as sandboxTemplateBuildStatusPath,Nr as sandboxTemplatePath,gu as sanitizeSkillName,Bo as scaleCapacityInstance,Ko as scaleDeployment,rr as securityAgentLogsEndpoint,gi as securityGet,nr as securityOverviewEndpoint,St as selectApiKeyResolutionSources,Ht as signAcsRequest,Ft as sourceConfig,Kn as speechRecognizePath,Gn as speechSynthesizePath,qn as speechVocabularyPath,ds as startModelService,fs as stopModelService,Vs as stripUndefined,Ln as taskPath,fc as trackCommandExecution,V as trackingHeaders,ao as trainingTypeMethodVariant,Xl as unlinkSkillFromAgents,U as unwrapResponse,qo as updateDeployment,Uo as updateDeploymentOverflow,xs as updateVocabulary,zi as uploadDataset,Qt as uploadFile,Rl as upsertSkillLockEntry,Yn as userProfilePath,yt as validateConfigProfileActivation,G as validateDataset,ts as validatePrepaidFlags,Qo as validateReservationCapacity,bu as validateSkillDir,Fn as videoGeneratePath,Zn as workspaceMaaSBaseUrl,ht as writeConfigFile,Ku as writeInstallMethodSync,Ll as writeSkillLock};
|
package/package.json
CHANGED