bailian-cli-core 2.8.0 → 2.8.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 CHANGED
@@ -5368,7 +5368,7 @@ export declare function createTrackingEvent(opts: {
5368
5368
  *
5369
5369
  * 1. 先调用 `_sendAll` 排空 tracker 内部的去抖队列,把还卡在 500ms 合并窗口里
5370
5370
  * 的事件立刻推上网络。
5371
- * 2. 然后用硬超时 race 所有已追踪的 fetch promise。
5371
+ * 2. 在预算内等待发送,预算耗尽时真正取消 DNS/HTTP/body 工作。
5372
5372
  *
5373
5373
  * 埋点永远不应阻塞 CLI:调用方应传入较短的超时(例如 1000ms),并始终与超时
5374
5374
  * race。错误与超时一律静默吞掉。
package/dist/index.mjs CHANGED
@@ -89,9 +89,9 @@ plan=ptu 必须提供 --charge-type,且只能为 pre_paid 或 post_paid。`:e.
89
89
  --service-tier 只能为 ptu_fast 或 ptu_default。`:e.serviceTier===`ptu_default`&&e.chargeType===PS.POST_PAID?`ptu_default only supports pre_paid.
90
90
  ptu_default 仅支持 pre_paid。`:e.chargeType===PS.POST_PAID&&LS(e)?`Prepaid flags are not allowed with --charge-type post_paid.
91
91
  --charge-type post_paid 不允许提供预付费参数。`:FS(e,!0)??RS(e,e.chargeType===PS.PRE_PAID):`--thinking-output-tpm is not supported by current reservation models.
92
- 当前吞吐预留模型不支持 --thinking-output-tpm。`},async resolve(e){let t={charge_type:e.flags.chargeType,ptu_capacity:IS(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=zS(e.flags);return n!==void 0&&(t.pre_paid_info=n),{body:t}}},HS={name:kS.MU,validateFlags(){},async resolve(e){let t=e.flags.billingMethod||NS,n=e.flags.deploySpec,r=e.flags.capacity;if(!e.dryRun&&!n){let i=()=>new O(`No mu-plan template found for model "${e.model}". `+(e.modelUnavailableHint??`Pass --deploy-spec explicitly.`),D.USAGE);try{let a=await ES(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===kS.MU)?.templates??[];if(o.length===0)throw i();let s=t===MS.POST_PAY?PS.POST_PAID:PS.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 O?e:new O(`Failed to auto-pick template for plan=mu: ${e.message}. Pass --deploy-spec explicitly.`,D.USAGE)}}let i={capacity:r??1,billing_method:t};return n&&(i.deploy_spec=n),{body:i}}},US={[kS.LORA]:BS,[kS.PTU]:VS,[kS.MU]:HS};function WS(e){let t=US[e];if(!t)throw new O(`Unsupported plan "${e}". Supported plans: ${Object.keys(US).join(`, `)}.`,D.USAGE);return t}const GS=`zeldaEasy.broadscope-platform.modelInstance.startModelService`,KS=`zeldaEasy.broadscope-platform.modelInstance.stopModelService`,qS=`zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel`;async function JS(e,t){return Rv(await e.console(GS,{input:{modelServiceId:t}}))}async function YS(e,t){return Rv(await e.console(KS,{input:{modelServiceId:t}}))}async function XS(e){let t=[],n=1;for(;;){let r=Rv(await e.console(qS,{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 ZS(e,t){return e.find(e=>e.modelServiceId===t||e.deployedModel===t||e.deployed_model===t)}async function QS(e,t,n){return e.requestJson({path:Kg(),method:`POST`,body:t,signal:n})}async function $S(e,t={}){let n=new URLSearchParams;t.pageNo!==void 0&&n.set(`page_no`,String(t.pageNo)),t.pageSize!==void 0&&n.set(`page_size`,String(t.pageSize)),t.status&&n.set(`status`,t.status),t.modelName&&n.set(`model_name`,t.modelName);let r=Kg(),i=n.toString()?`${r}?${n.toString()}`:r;return e.requestJson({path:i,method:`GET`,signal:t.signal})}async function eC(e,t,n){return e.requestJson({path:qg(t),method:`GET`,signal:n})}async function tC(e,t,n){return e.requestJson({path:qg(t),method:`DELETE`,signal:n})}const nC=`zeldaEasy.broadscope-platform.customModel.listSupportImportModels`;async function rC(e){let t=Rv(await e.console(nC,{}));return{total:t.total,pageNo:t.pageNo,pageSize:t.pageSize,list:t.list??[]}}function iC(e,t){let n=t.trim().toLowerCase();return e.find(e=>String(e.model??``).toLowerCase()===n)}function aC(e){return e===`lora`?`efficient_sft`:`sft`}const oC=`speech-biasing`;function sC(e,t){return{model:oC,input:{action:e,...t}}}async function cC(e,t,n,r){return e.requestJson({path:wg(),method:`POST`,body:sC(t,n),signal:r})}function lC(e,t,n){return cC(e,`create_vocabulary`,{target_model:t.targetModel,prefix:t.prefix,vocabulary:t.vocabulary},n)}function uC(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),cC(e,`list_vocabulary`,r,n)}function dC(e,t,n){return cC(e,`query_vocabulary`,{vocabulary_id:t},n)}function fC(e,t,n,r){return cC(e,`update_vocabulary`,{vocabulary_id:t,vocabulary:n},r)}function pC(e,t,n){return cC(e,`delete_vocabulary`,{vocabulary_id:t},n)}function mC(e,t){try{return JSON.parse(e)}catch(e){throw new rt(`${t} is not valid JSON — ${e.message}`)}}function hC(e){let t=mC(e,`--vocabulary`);if(!t||typeof t!=`object`||Array.isArray(t))throw new rt(`--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 rt(`--vocabulary weight for "${e}" must be a number.`);return t}function gC(e,t){let n=`--words`,r=mC(e,n),i;if(Array.isArray(r))i=r.map((e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw new rt(`${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 rt(`${n} entry #${t} must have a string "text" and a number "weight".`);if(!Number.isFinite(r.weight))throw new rt(`${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 rt(`${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 rt(`${n} weight for "${e}" must be a number.`);i.push({text:e,weight:a,...t?{lang:t}:{}})}}if(i.length===0)throw new rt(`${n} must contain at least one hot word.`);return i}const _C={introspect:{type:`switch`,description:{"en-US":`Print the machine-readable command schema (JSON) and exit`,"zh-CN":`输出机器可读的命令说明(JSON)并退出`}},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":`显示版本信息`}}},vC={concurrent:{type:`number`,valueHint:`<n>`,description:{"en-US":`Run N parallel requests (default: 1)`,"zh-CN":`并行发送 N 个请求(默认:1)`}}},yC={async:{type:`switch`,description:{"en-US":`Return async task id without waiting`,"zh-CN":`直接返回异步任务 ID,不等待任务完成`}}},bC={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`}}},xC={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)`}}},SC={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 CC(e){return e.auth===`apiKey`?e.optionalConsole?{...bC,...xC}:bC:e.auth===`console`?xC:e.auth===`openapi`?SC:{}}function wC(e){return e}const TC=1;function EC(e,t){return e.normalize(`NFKC`).replace(/[\\/:*?"<>|]/g,`_`).replace(/\s+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}function DC(e,t){return`${EC(e||`image`,`image`)}_${EC((t||``).substring(0,20),`untitled`)}_${Date.now()}`}function OC(e=f()){let t=process.env.HERMES_HOME?.trim();if(t)return kC(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 kC(e){return e===`~`?f():e.startsWith(`~/`)||e.startsWith(`~\\`)?g(f(),e.slice(2)):e}const AC=()=>g(f(),`bailian-output`);function jC(e,t){let n=t?.flagDir||e.outputDir||AC(),r=t?.subDir?g(n,t.subDir):n;return i(r)||a(r,{recursive:!0}),r}function MC(e){return e.length>8?`${e.slice(0,4)}...${e.slice(-4)}`:`***`}function NC(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function PC(e){return o(e===`-`?0:e,`utf-8`)}async function FC(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 IC(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 O(`Invalid ${t} value "${String(e)}". Use true or false.`,D.USAGE)}function LC(e,t=`boolean`){if(e!=null)return IC(e,t)}function RC(e,t,n=`boolean`){let r=LC(e,n);return r===void 0?t:r}function zC(e,t){return LC(e,`watermark`)??t??!0}const BC=/^[a-z0-9][a-z0-9.-]{0,63}$/,VC=/^bailian-[a-z0-9-]{1,64}$/,HC=/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]{1,20})?$/;function UC(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function WC(e){if(!e)return`unknown`;let t=e.toLowerCase().replace(/[\s_]+/g,`-`);return BC.test(t)?t:`unknown`}function GC(e){let t=UC(e,`BAILIAN_CALLER_TYPE`)?.toLowerCase();if(t!==`agent`&&t!==`ai_agent`)return{callerType:`unknown`};let n=UC(e,`BAILIAN_SKILL_NAME`)?.toLowerCase(),r=n!==void 0&&VC.test(n)?n:void 0,i=UC(e,`BAILIAN_SKILL_VERSION`),a=r!==void 0&&i!==void 0&&HC.test(i)?i:void 0;return{callerType:`agent`,callerName:WC(UC(e,`BAILIAN_CALLER_NAME`)),...r===void 0?{}:{skillName:r},...a===void 0?{}:{skillVersion:a}}}function KC(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,callerType:e.caller.callerType};return e.caller.callerType===`agent`&&(t.callerName=e.caller.callerName,e.caller.skillName!==void 0&&(t.skillName=e.caller.skillName),e.caller.skillVersion!==void 0&&(t.skillVersion=e.caller.skillVersion)),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 qC(e){if(e==null)return;let t=typeof e==`string`?e:JSON.stringify(e);return t.length<=500?t:t.slice(0,500)}function JC(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=qC(e.errorMessage)),e.requestId&&(i.c5=e.requestId),i}let YC;function XC(){return YC||(process.env.NODE_ENV===`development`?(YC=`dev`,YC):process.env.BAILIAN_COMPILED===`1`?(YC=`prod`,YC):(YC=import.meta.url.includes(`/node_modules/`)?`prod`:`dev`,YC))}var ZC=/* @__PURE__ */ E(((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=et(`os`)},function(e,t){e.exports=(...e)=>(process.versions.bun?globalThis.fetch:et(`undici`).fetch)(...e)},function(e,t,n){e.exports=n(6)},function(e,t){e.exports=et(`dns`)},function(e,t){e.exports=et(`util`)},function(e,t){e.exports=et(`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`},x=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},ee=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},te=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},ne=(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`},ie=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},ae=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},oe=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},se=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},ce=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},le=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},ue=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},de=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},fe=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},S=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},pe=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},me=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},he=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},ge=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},_e=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},ve=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},C=/* @__PURE__ */ new Map,w=/* @__PURE__ */ new Map;C.set(`Baiduspider-render`,i),C.set(`Baiduspider+`,i),C.set(`Baiduspider-image+`,i),C.set(`360Spider`,a),C.set(`360Spider-Image`,a),C.set(`bingbot`,o),C.set(`Googlebot`,s),C.set(`YandexRenderResourcesBot`,c),C.set(`spider`,l),C.set(`Dataprovider.com`,u),C.set(`AhrefsBot`,d),C.set(`BitSightBot`,f),C.set(`oBot`,p),C.set(`Cincraw`,m),C.set(`DingTalkBot-LinkService`,h),C.set(`YisouSpider`,g),C.set(`Bytespider`,_),C.set(`ev-crawler`,v),C.set(`bitdiscovery`,y),C.set(`Spider`,b),C.set(`Ai2Bot-Dolma`,x),C.set(`dianjing_ad_spider`,ee),w.set(`Baiduspider-render`,te),w.set(`Baiduspider+`,te),w.set(`Baiduspider-image+`,te),w.set(`360Spider`,ne),w.set(`360Spider-Image`,ne),w.set(`bingbot`,re),w.set(`Googlebot`,ie),w.set(`YandexRenderResourcesBot`,ae),w.set(`spider`,oe),w.set(`Dataprovider.com`,se),w.set(`AhrefsBot`,ce),w.set(`BitSightBot`,le),w.set(`oBot`,ue),w.set(`Cincraw`,de),w.set(`DingTalkBot-LinkService`,fe),w.set(`YisouSpider`,S),w.set(`Bytespider`,pe),w.set(`ev-crawler`,me),w.set(`bitdiscovery`,he),w.set(`Spider`,ge),w.set(`Ai2Bot-Dolma`,_e),w.set(`dianjing_ad_spider`,ve);let ye={productHandlerMap:C,commentHandlerMap:w,getSpecialProductHandler:()=>null,getSpecialCommentHandler:()=>null,getDefaultModelHandler:()=>null};t.isBot=function(e){let t=r.createUAInfo();return r.runTask(e,t,ye),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,x=n(3),ee=n.n(x),te=n(4),ne=n(5),re=n.n(ne);function ie(e){return(ie=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 ae(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 oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ae(Object(n),!0).forEach(function(t){se(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function se(e,t,n){return(t=(function(e){var t=(function(e,t){if(ie(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ie(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)})(e,`string`);return ie(t)==`symbol`?t:t+``})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=ue(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.
93
- 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 le(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)||ue(e,t)||(function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
94
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ue(e,t){if(e){if(typeof e==`string`)return de(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)?de(e,t):void 0}}function de(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 fe(){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=le(r[n],2),o=(a[0],a[1]);if(o){var s,c=ce(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 S,pe,me=(S=process.version,{os:i.a.type(),os_version:i.a.release(),app_name:`node`,app_version:S,device_id:re.a.createHash(`md5`).update(fe()).digest(`hex`),platform:`node`}),he=(0,te.promisify)(ee.a.resolve);function ge(e){this._offlineQueue=[],e.endpoint=e.endpoint||`gm.mmstat.com`,b.call(this,oe(oe({},me),e)),this._config.endpoint_url=`https://${this._config.endpoint}/aes.1.1`}ge.prototype=((pe=function(){}).prototype=b.prototype,new pe),ge.prototype.constructor=ge,ge.prototype.send=function(e){var t,n=this;return(t=this._config.endpoint,he(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=ge}]).default})),QC=/* @__PURE__ */ E(((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})),$C=/* @__PURE__ */ $e(ZC(),1),ew=/* @__PURE__ */ $e(QC(),1);const tw=()=>g(Ft(),`telemetry.jsonl`);let nw;const rw=/* @__PURE__ */ new Set;let iw;try{let e=new $C.default({pid:`bailian-cli-node`,env:XC()}),t=e.send.bind(e);e.send=function(e){let n=t(e);if(n&&typeof n.then==`function`){let e=n;rw.add(e),e.finally(()=>rw.delete(e))}return n},iw=e,nw=e.use(ew.default)}catch{}async function aw(e=1e3){try{if(iw)try{typeof iw._sendAll==`function`&&iw._sendAll()}catch{}if(rw.size===0)return;let t=[...rw].map(e=>e.catch(()=>void 0));await Promise.race([Promise.allSettled(t),new Promise(t=>setTimeout(t,e).unref?.())])}catch{}}async function ow(e){try{await Rt();let n=tw();try{l(n).size>5242880&&u(n)}catch{}t(n,JSON.stringify(e)+`
92
+ 当前吞吐预留模型不支持 --thinking-output-tpm。`},async resolve(e){let t={charge_type:e.flags.chargeType,ptu_capacity:IS(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=zS(e.flags);return n!==void 0&&(t.pre_paid_info=n),{body:t}}},HS={name:kS.MU,validateFlags(){},async resolve(e){let t=e.flags.billingMethod||NS,n=e.flags.deploySpec,r=e.flags.capacity;if(!e.dryRun&&!n){let i=()=>new O(`No mu-plan template found for model "${e.model}". `+(e.modelUnavailableHint??`Pass --deploy-spec explicitly.`),D.USAGE);try{let a=await ES(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===kS.MU)?.templates??[];if(o.length===0)throw i();let s=t===MS.POST_PAY?PS.POST_PAID:PS.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 O?e:new O(`Failed to auto-pick template for plan=mu: ${e.message}. Pass --deploy-spec explicitly.`,D.USAGE)}}let i={capacity:r??1,billing_method:t};return n&&(i.deploy_spec=n),{body:i}}},US={[kS.LORA]:BS,[kS.PTU]:VS,[kS.MU]:HS};function WS(e){let t=US[e];if(!t)throw new O(`Unsupported plan "${e}". Supported plans: ${Object.keys(US).join(`, `)}.`,D.USAGE);return t}const GS=`zeldaEasy.broadscope-platform.modelInstance.startModelService`,KS=`zeldaEasy.broadscope-platform.modelInstance.stopModelService`,qS=`zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel`;async function JS(e,t){return Rv(await e.console(GS,{input:{modelServiceId:t}}))}async function YS(e,t){return Rv(await e.console(KS,{input:{modelServiceId:t}}))}async function XS(e){let t=[],n=1;for(;;){let r=Rv(await e.console(qS,{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 ZS(e,t){return e.find(e=>e.modelServiceId===t||e.deployedModel===t||e.deployed_model===t)}async function QS(e,t,n){return e.requestJson({path:Kg(),method:`POST`,body:t,signal:n})}async function $S(e,t={}){let n=new URLSearchParams;t.pageNo!==void 0&&n.set(`page_no`,String(t.pageNo)),t.pageSize!==void 0&&n.set(`page_size`,String(t.pageSize)),t.status&&n.set(`status`,t.status),t.modelName&&n.set(`model_name`,t.modelName);let r=Kg(),i=n.toString()?`${r}?${n.toString()}`:r;return e.requestJson({path:i,method:`GET`,signal:t.signal})}async function eC(e,t,n){return e.requestJson({path:qg(t),method:`GET`,signal:n})}async function tC(e,t,n){return e.requestJson({path:qg(t),method:`DELETE`,signal:n})}const nC=`zeldaEasy.broadscope-platform.customModel.listSupportImportModels`;async function rC(e){let t=Rv(await e.console(nC,{}));return{total:t.total,pageNo:t.pageNo,pageSize:t.pageSize,list:t.list??[]}}function iC(e,t){let n=t.trim().toLowerCase();return e.find(e=>String(e.model??``).toLowerCase()===n)}function aC(e){return e===`lora`?`efficient_sft`:`sft`}const oC=`speech-biasing`;function sC(e,t){return{model:oC,input:{action:e,...t}}}async function cC(e,t,n,r){return e.requestJson({path:wg(),method:`POST`,body:sC(t,n),signal:r})}function lC(e,t,n){return cC(e,`create_vocabulary`,{target_model:t.targetModel,prefix:t.prefix,vocabulary:t.vocabulary},n)}function uC(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),cC(e,`list_vocabulary`,r,n)}function dC(e,t,n){return cC(e,`query_vocabulary`,{vocabulary_id:t},n)}function fC(e,t,n,r){return cC(e,`update_vocabulary`,{vocabulary_id:t,vocabulary:n},r)}function pC(e,t,n){return cC(e,`delete_vocabulary`,{vocabulary_id:t},n)}function mC(e,t){try{return JSON.parse(e)}catch(e){throw new rt(`${t} is not valid JSON — ${e.message}`)}}function hC(e){let t=mC(e,`--vocabulary`);if(!t||typeof t!=`object`||Array.isArray(t))throw new rt(`--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 rt(`--vocabulary weight for "${e}" must be a number.`);return t}function gC(e,t){let n=`--words`,r=mC(e,n),i;if(Array.isArray(r))i=r.map((e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw new rt(`${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 rt(`${n} entry #${t} must have a string "text" and a number "weight".`);if(!Number.isFinite(r.weight))throw new rt(`${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 rt(`${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 rt(`${n} weight for "${e}" must be a number.`);i.push({text:e,weight:a,...t?{lang:t}:{}})}}if(i.length===0)throw new rt(`${n} must contain at least one hot word.`);return i}const _C={introspect:{type:`switch`,description:{"en-US":`Print the machine-readable command schema (JSON) and exit`,"zh-CN":`输出机器可读的命令说明(JSON)并退出`}},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":`显示版本信息`}}},vC={concurrent:{type:`number`,valueHint:`<n>`,description:{"en-US":`Run N parallel requests (default: 1)`,"zh-CN":`并行发送 N 个请求(默认:1)`}}},yC={async:{type:`switch`,description:{"en-US":`Return async task id without waiting`,"zh-CN":`直接返回异步任务 ID,不等待任务完成`}}},bC={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`}}},xC={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)`}}},SC={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 CC(e){return e.auth===`apiKey`?e.optionalConsole?{...bC,...xC}:bC:e.auth===`console`?xC:e.auth===`openapi`?SC:{}}function wC(e){return e}const TC=1;function EC(e,t){return e.normalize(`NFKC`).replace(/[\\/:*?"<>|]/g,`_`).replace(/\s+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}function DC(e,t){return`${EC(e||`image`,`image`)}_${EC((t||``).substring(0,20),`untitled`)}_${Date.now()}`}function OC(e=f()){let t=process.env.HERMES_HOME?.trim();if(t)return kC(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 kC(e){return e===`~`?f():e.startsWith(`~/`)||e.startsWith(`~\\`)?g(f(),e.slice(2)):e}const AC=()=>g(f(),`bailian-output`);function jC(e,t){let n=t?.flagDir||e.outputDir||AC(),r=t?.subDir?g(n,t.subDir):n;return i(r)||a(r,{recursive:!0}),r}function MC(e){return e.length>8?`${e.slice(0,4)}...${e.slice(-4)}`:`***`}function NC(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function PC(e){return o(e===`-`?0:e,`utf-8`)}async function FC(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 IC(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 O(`Invalid ${t} value "${String(e)}". Use true or false.`,D.USAGE)}function LC(e,t=`boolean`){if(e!=null)return IC(e,t)}function RC(e,t,n=`boolean`){let r=LC(e,n);return r===void 0?t:r}function zC(e,t){return LC(e,`watermark`)??t??!0}const BC=/^[a-z0-9][a-z0-9.-]{0,63}$/,VC=/^bailian-[a-z0-9-]{1,64}$/,HC=/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]{1,20})?$/;function UC(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function WC(e){if(!e)return`unknown`;let t=e.toLowerCase().replace(/[\s_]+/g,`-`);return BC.test(t)?t:`unknown`}function GC(e){let t=UC(e,`BAILIAN_CALLER_TYPE`)?.toLowerCase();if(t!==`agent`&&t!==`ai_agent`)return{callerType:`unknown`};let n=UC(e,`BAILIAN_SKILL_NAME`)?.toLowerCase(),r=n!==void 0&&VC.test(n)?n:void 0,i=UC(e,`BAILIAN_SKILL_VERSION`),a=r!==void 0&&i!==void 0&&HC.test(i)?i:void 0;return{callerType:`agent`,callerName:WC(UC(e,`BAILIAN_CALLER_NAME`)),...r===void 0?{}:{skillName:r},...a===void 0?{}:{skillVersion:a}}}function KC(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,callerType:e.caller.callerType};return e.caller.callerType===`agent`&&(t.callerName=e.caller.callerName,e.caller.skillName!==void 0&&(t.skillName=e.caller.skillName),e.caller.skillVersion!==void 0&&(t.skillVersion=e.caller.skillVersion)),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 qC(e){if(e==null)return;let t=typeof e==`string`?e:JSON.stringify(e);return t.length<=500?t:t.slice(0,500)}function JC(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=qC(e.errorMessage)),e.requestId&&(i.c5=e.requestId),i}let YC;function XC(){return YC||(process.env.NODE_ENV===`development`?(YC=`dev`,YC):process.env.BAILIAN_COMPILED===`1`?(YC=`prod`,YC):(YC=import.meta.url.includes(`/node_modules/`)?`prod`:`dev`,YC))}var ZC=/* @__PURE__ */ E(((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=et(`os`)},function(e,t){e.exports=(...e)=>(process.versions.bun?globalThis.fetch:et(`undici`).fetch)(...e)},function(e,t,n){e.exports=n(6)},function(e,t){e.exports=et(`dns`)},function(e,t){e.exports=et(`util`)},function(e,t){e.exports=et(`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`},x=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},ee=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},te=(e,t)=>{t.appName=`BaiduSpider`,t.appVersion=e.value,t.deviceBrand=`Baidu`,t.deviceType=`bot`,t.platform=`other`},ne=(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`},ie=(e,t)=>{t.appName=`Googlebot`,t.appVersion=e.value,t.deviceBrand=`Google`,t.deviceType=`bot`,t.platform=`other`},ae=(e,t)=>{t.appName=`YandexBot`,t.appVersion=e.value,t.deviceBrand=`Yandex`,t.deviceType=`bot`,t.platform=`other`},oe=(e,t)=>{e.getPreviousNTokens(3)===`Sogou web spider`&&(t.deviceBrand=`Sogou.com`,t.appName=`SogouSpider`),t.appVersion=e.value,t.deviceType=`bot`},se=(e,t)=>{t.appName=`DataproviderBot`,t.appVersion=e.value,t.deviceBrand=`Dataprovider.com`,t.deviceType=`bot`,t.platform=`other`},ce=(e,t)=>{t.appName=`AhrefsBot`,t.appVersion=e.value,t.deviceBrand=`Ahrefs`,t.deviceType=`bot`,t.platform=`other`},le=(e,t)=>{t.appName=`BitSightBot`,t.appVersion=e.value,t.deviceBrand=`Bitsight`,t.deviceType=`bot`,t.platform=`other`},ue=(e,t)=>{t.appName=`oBot`,t.appVersion=e.value,t.deviceBrand=`IBM`,t.deviceType=`bot`,t.platform=`other`},de=(e,t)=>{t.appName=`Cincraw`,t.appVersion=e.value,t.deviceBrand=`CINC`,t.deviceType=`bot`,t.platform=`other`},fe=(e,t)=>{t.appName=`DingTalkBot`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},S=(e,t)=>{t.appName=`YisouSpider`,t.appVersion=e.value,t.deviceBrand=`Alibaba`,t.deviceType=`bot`,t.platform=`other`},pe=(e,t)=>{t.appName=`ByteSpider`,t.appVersion=e.value,t.deviceBrand=`ByteDance`,t.deviceType=`bot`,t.platform=`other`},me=(e,t)=>{t.appName=`HeadlineCrawler`,t.appVersion=e.value,t.deviceBrand=`Headline.com`,t.deviceType=`bot`,t.platform=`other`},he=(e,t)=>{t.appName=`BitDiscoveryBot`,t.appVersion=e.value,t.deviceBrand=`Tenable`,t.deviceType=`bot`,t.platform=`other`},ge=(e,t)=>{e.getPreviousNTokens(4)===`Screaming Frog SEO Spider`&&(t.deviceBrand=`Screaming Frog`,t.appName=`Screaming Frog`),t.appVersion=e.value,t.deviceType=`bot`},_e=(e,t)=>{t.appName=`Ai2Bot`,t.appVersion=e.value,t.deviceBrand=`Ai2`,t.deviceType=`bot`,t.platform=`other`},ve=(e,t)=>{t.appName=`DianjingAdSpider`,t.appVersion=e.value,t.deviceBrand=`Dianjing`,t.deviceType=`bot`,t.platform=`other`},C=/* @__PURE__ */ new Map,w=/* @__PURE__ */ new Map;C.set(`Baiduspider-render`,i),C.set(`Baiduspider+`,i),C.set(`Baiduspider-image+`,i),C.set(`360Spider`,a),C.set(`360Spider-Image`,a),C.set(`bingbot`,o),C.set(`Googlebot`,s),C.set(`YandexRenderResourcesBot`,c),C.set(`spider`,l),C.set(`Dataprovider.com`,u),C.set(`AhrefsBot`,d),C.set(`BitSightBot`,f),C.set(`oBot`,p),C.set(`Cincraw`,m),C.set(`DingTalkBot-LinkService`,h),C.set(`YisouSpider`,g),C.set(`Bytespider`,_),C.set(`ev-crawler`,v),C.set(`bitdiscovery`,y),C.set(`Spider`,b),C.set(`Ai2Bot-Dolma`,x),C.set(`dianjing_ad_spider`,ee),w.set(`Baiduspider-render`,te),w.set(`Baiduspider+`,te),w.set(`Baiduspider-image+`,te),w.set(`360Spider`,ne),w.set(`360Spider-Image`,ne),w.set(`bingbot`,re),w.set(`Googlebot`,ie),w.set(`YandexRenderResourcesBot`,ae),w.set(`spider`,oe),w.set(`Dataprovider.com`,se),w.set(`AhrefsBot`,ce),w.set(`BitSightBot`,le),w.set(`oBot`,ue),w.set(`Cincraw`,de),w.set(`DingTalkBot-LinkService`,fe),w.set(`YisouSpider`,S),w.set(`Bytespider`,pe),w.set(`ev-crawler`,me),w.set(`bitdiscovery`,he),w.set(`Spider`,ge),w.set(`Ai2Bot-Dolma`,_e),w.set(`dianjing_ad_spider`,ve);let ye={productHandlerMap:C,commentHandlerMap:w,getSpecialProductHandler:()=>null,getSpecialCommentHandler:()=>null,getDefaultModelHandler:()=>null};t.isBot=function(e){let t=r.createUAInfo();return r.runTask(e,t,ye),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,x=n(5),ee=n.n(x);function te(e){return(te=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 ne(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 re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ne(Object(n),!0).forEach(function(t){ie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ie(e,t,n){return(t=(function(e){var t=(function(e,t){if(te(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(te(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)})(e,`string`);return te(t)==`symbol`?t:t+``})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=se(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.
93
+ 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 oe(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)||se(e,t)||(function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
94
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function se(e,t){if(e){if(typeof e==`string`)return ce(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)?ce(e,t):void 0}}function ce(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 le(){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=oe(r[n],2),o=(a[0],a[1]);if(o){var s,c=ae(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 ue,de,fe=(ue=process.version,{os:i.a.type(),os_version:i.a.release(),app_name:`node`,app_version:ue,device_id:ee.a.createHash(`md5`).update(le()).digest(`hex`),platform:`node`});function S(e){this._offlineQueue=[],e.endpoint=e.endpoint||`gm.mmstat.com`,b.call(this,re(re({},fe),e)),this._config.endpoint_url=`https://${this._config.endpoint}/aes.1.1`}S.prototype=((de=function(){}).prototype=b.prototype,new de),S.prototype.constructor=S,S.prototype.send=async function(e,t={}){let n=t.signal;if(n?.aborted)return;let r;if(!process.versions.bun){let{Agent:e,EnvHttpProxyAgent:t}=et(`undici`),i={signal:n,timeout:1e3},a=process.env.HTTP_PROXY?.trim()||void 0,o=process.env.HTTPS_PROXY?.trim()||void 0;r=a||o?new t({httpProxy:a,httpsProxy:o,noProxy:process.env.NO_PROXY?.trim()||void 0,connect:i,requestTls:i,proxyTls:i}):new e({connect:i})}let i=[...this._offlineQueue.splice(0),e];try{await Promise.all(i.map(async e=>{if(!n?.aborted)try{this._print(`send`,e),await(await o()(this._config.endpoint_url,{method:`POST`,keepalive:!0,signal:n,...r?{dispatcher:r}:{},body:JSON.stringify({gokey:encodeURIComponent(e),gmkey:`EXP`})})).body?.cancel().catch(()=>{})}catch{n?.aborted||(this._offlineQueue.length>500&&this._offlineQueue.shift(),this._offlineQueue.push(e))}}))}finally{await r?.destroy().catch(()=>{})}},t.default=S}]).default})),QC=/* @__PURE__ */ E(((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})),$C=/* @__PURE__ */ $e(ZC(),1),ew=/* @__PURE__ */ $e(QC(),1);const tw=()=>g(Ft(),`telemetry.jsonl`);let nw;const rw=/* @__PURE__ */ new Set;let iw;try{let e=new $C.default({pid:`bailian-cli-node`,env:XC()}),t=e.send.bind(e);e.send=function(e){let n=new AbortController,r=setTimeout(()=>n.abort(),1e3);r.unref?.();let i={controller:n,promise:Promise.resolve().then(()=>t(e,{signal:n.signal})).catch(()=>{}).finally(()=>{n.abort(),clearTimeout(r),rw.delete(i)})};return rw.add(i),i.promise},iw=e,nw=e.use(ew.default)}catch{}async function aw(e=1e3){let t;try{if(iw)try{typeof iw._sendAll==`function`&&iw._sendAll()}catch{}if(rw.size===0)return;await Promise.race([Promise.allSettled([...rw].map(e=>e.promise)),new Promise(n=>{t=setTimeout(()=>{for(let e of rw)e.controller.abort();n()},e),t.unref?.()})])}catch{}finally{clearTimeout(t)}}async function ow(e){try{await Rt();let n=tw();try{l(n).size>5242880&&u(n)}catch{}t(n,JSON.stringify(e)+`
95
95
  `,{mode:384})}catch{}}async function sw(e){try{if(!nw)return;nw(e.command,JC(e))}catch{}}const cw=/* @__PURE__ */ new Set([`apiKey`,`baseUrl`,`output`,`quiet`,`verbose`,`timeout`,`dryRun`,`help`,`console`]),lw=/* @__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 uw(e){let t={};for(let[n,r]of Object.entries(e))n.startsWith(`_`)||cw.has(n)||lw.has(n)&&r!==void 0&&r!==!1&&(n!==`page`||typeof r==`number`&&Number.isFinite(r))&&(t[n]=r);return t}async function dw(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 O?(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=KC({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:uw(n),caller:e.caller});ow(u).catch(()=>{}),sw(u).catch(()=>{})}}const fw=/* @__PURE__ */ `代码生成.创意写作.客服对话.知识问答.文档理解.数据分析.数学推理.翻译.图像生成.图像编辑.视频生成.视频编辑.语音合成.语音识别.实时对话.Agent编排.深度研究.教育辅导.电商营销.角色扮演.3D生成.向量检索.数字人.音乐生成.人脸人像.虚拟试穿.OCR文字识别.情感分析.意图识别.图像修复.语义重排.播客.有声书`.split(`.`),pw=`You are an intent analyzer for an AI model recommendation system. Given the user's requirement, understand the scenario first, then extract structured information.
96
96
 
97
97
  CRITICAL: Respond with ONLY a valid JSON object. taskSummary must be in English; segments[].step is a short Simplified Chinese label (e.g. "剧本创作", "图生视频").
@@ -282,4 +282,4 @@ ${e?e+`
282
282
  `))if(n.trim())try{t.push(JSON.parse(n))}catch{}return t}function nD(e){let t=new Set(e.map(({model:e})=>e));return e.filter(({model:e})=>{let n=e.replace(QE,``);return n===e||!t.has(n)})}async function rD(e=ZE()){if($E)return $E;let t=tD(T(e,`models.jsonl`));if(t.length===0)throw Error(`No model catalog found at ${T(e,`models.jsonl`)}. Run any bl advisor/agent command once to sync wiki data.`);return $E=nD(t),$E}async function iD(e=ZE()){if(eD)return eD;let t=tD(T(e,`families.jsonl`));return eD=new Map(t.map(e=>[e.slug,e])),eD}function aD(){$E=null,eD=null}function oD(){return{async ask({question:e,options:t,defaultIfSkip:n,signal:r}){$(r);let i=Ve({input:process.stdin,output:process.stderr});try{for(process.stderr.write(`\n${e}\n`),t.forEach((e,t)=>{let r=e===n;process.stderr.write(` ${t+1}. ${e}${r?` (default)`:``}\n`)}),process.stderr.write(` 输入序号选择,回车使用默认,或直接输入文字描述你的需求
283
283
  `);;){let e=(await i.question(`Select: `,{signal:r})).trim();if($(r),!e)return n;if(/^\d+$/.test(e)){let n=Number.parseInt(e,10)-1;if(n>=0&&n<t.length)return t[n];process.stderr.write(` 请输入 1-${t.length} 之间的序号,或直接输入文字描述\n`);continue}return e}}finally{i.close()}}}}function sD(){return{async ask({question:e,defaultIfSkip:t,signal:n}){return $(n),process.stderr.write(`[recommend] non-interactive, "${e}" → default: ${t}\n`),t}}}function cD(){return T(Ft(),`skills`)}function lD(){return T(cD(),`skill-lock.json`)}function uD(){return{version:1,skills:{}}}function dD(){let e=lD();if(!S(e))return uD();try{let t=JSON.parse(he(e,`utf-8`));return t?.version!==1||typeof t.skills!=`object`||t.skills===null?uD():t}catch{return uD()}}function fD(e){me(cD(),{recursive:!0}),xe(lD(),JSON.stringify(e,null,2)+`
284
284
  `)}function pD(e,t){let n=dD();n.skills[e]={...n.skills[e],...t},fD(n)}const mD=`BL_SKIP_HOST_AGENTS`,hD=[`CLAUDE_CONFIG_DIR`,`CODEX_HOME`,`VIBE_HOME`,`HERMES_HOME`,`AUTOHAND_HOME`,`GROK_HOME`,`DSH_HOME`,`OPENCLAW_CONFIG_PATH`,`ZCODE_HOME`,`APPDATA`,`LOCALAPPDATA`,`FLATPAK_XDG_CONFIG_HOME`,`PI_CODING_AGENT_DIR`];function gD(){let e=He(),t=process.cwd(),n=process.env.XDG_CONFIG_HOME||T(e,`.config`),r=(t,n,r)=>({id:t,displayName:n,skillsDir:T(e,r,`skills`),detectDirs:[T(e,r)]}),i=(t,n)=>t?.trim()||T(e,n),a=(e,t,n)=>({id:e,displayName:t,skillsDir:T(n,`skills`),detectDirs:[n]}),o=[`.openclaw`,`.clawdbot`,`.moltbot`].map(t=>T(e,t)),s=o.find(e=>S(e))??o[0],c=[T(n,`zed`)],l=process.env.APPDATA?.trim();l&&c.push(T(l,`Zed`));let u=process.env.FLATPAK_XDG_CONFIG_HOME?.trim();u&&c.push(T(u,`zed`));let d=i(process.env.CODEX_HOME,`.codex`);return[{id:`universal`,displayName:`Universal (~/.agents/skills)`,skillsDir:T(e,`.agents`,`skills`),detectDirs:[T(e,`.agents`),T(e,`.cline`),T(e,`.dexto`),T(e,`.firebender`),T(e,`.kimi-code`),T(e,`.kimi`),T(e,`.loaf`),T(e,`.warp`),...c]},{id:`universal-xdg`,displayName:`Universal (XDG agents/skills)`,skillsDir:T(n,`agents`,`skills`),detectDirs:[T(n,`agents`),T(n,`amp`),T(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:T(e,`.astrbot`,`data`,`skills`),detectDirs:[T(t,`data`,`skills`),T(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:T(e,`.codebuddy`,`skills`),detectDirs:[T(t,`.codebuddy`),T(e,`.codebuddy`)]},r(`codemaker`,`Codemaker`,`.codemaker`),r(`codestudio`,`Code Studio`,`.codestudio`),{id:`codex`,displayName:`Codex`,skillsDir:T(d,`skills`),detectDirs:[d,`/etc/codex`]},r(`command-code`,`Command Code`,`.commandcode`),{id:`continue`,displayName:`Continue`,skillsDir:T(e,`.continue`,`skills`),detectDirs:[T(t,`.continue`),T(e,`.continue`)]},r(`cortex`,`Cortex Code`,`.snowflake/cortex`),r(`crush`,`Crush`,`.config/crush`),r(`cursor`,`Cursor`,`.cursor`),{id:`deepagents`,displayName:`Deep Agents`,skillsDir:T(e,`.deepagents`,`agent`,`skills`),detectDirs:[T(e,`.deepagents`)]},{id:`devin`,displayName:`Devin for Terminal`,skillsDir:T(n,`devin`,`skills`),detectDirs:[T(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:T(n,`goose`,`skills`),detectDirs:[T(n,`goose`)]},a(`grok`,`Grok Build`,i(process.env.GROK_HOME,`.grok`)),a(`hermes`,`Hermes Agent`,OC(e)),r(`iflow-cli`,`iFlow CLI`,`.iflow`),r(`inference-sh`,`inference.sh`,`.inferencesh`),{id:`jazz`,displayName:`Jazz`,skillsDir:T(e,`.jazz`,`skills`),detectDirs:[T(e,`.jazz`),T(t,`.jazz`)]},r(`junie`,`Junie`,`.junie`),r(`kilo`,`Kilo Code`,`.kilocode`),{id:`kimchi`,displayName:`Kimchi`,skillsDir:T(e,`.config`,`kimchi`,`harness`,`skills`),detectDirs:[T(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:T(e,`.minimax`,`skills`),detectDirs:[T(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:T(n,`opencode`,`skills`),detectDirs:[T(n,`opencode`)]},{id:`openclaw`,displayName:`OpenClaw`,skillsDir:T(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:T(e,`.tabnine`,`agent`,`skills`),detectDirs:[T(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:T(e,`.zcode`,`skills`),detectDirs:[T(e,`.zcode`),`/Applications/ZCode.app`]},r(`zencoder`,`Zencoder`,`.zencoder`)]}function _D(e){let t=Oe(e);try{return ve(t)}catch{let e=[],n=t;for(;n!==Te(n);){if(S(n))try{return T(ve(n),...e.reverse())}catch{break}e.push(we(n)),n=Te(n)}return t}}function vD(e,t){let n=_D(e),r=_D(t);return n===r||n.startsWith(r+ke)}function yD(e){if(!Ee(e)||vD(e,He()))return!1;let t=process.env.XDG_CONFIG_HOME?.trim();return!(t&&vD(e,t))}function bD(e){return process.env.BL_SKIP_HOST_AGENTS!==`1`||!yD(e)}function xD(){return gD().filter(e=>e.detectDirs.some(e=>bD(e)&&S(e)))}function SD(e,t){return process.platform===`win32`?e.toLowerCase()===t.toLowerCase():e===t}function CD(e){let t=cD();if(process.platform===`win32`){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(r+ke)}return e===t||e.startsWith(t+ke)}function wD(e){try{if(!pe(e).isSymbolicLink())return!1;let t=_e(e);return CD(Ee(t)?t:Oe(Te(e),t))}catch{return!1}}function TD(e,t){if(!t.some(t=>SD(t,e)))return!1;try{return pe(e).isDirectory()}catch{return!1}}function ED(e){try{return pe(e).isDirectory()?S(T(e,`SKILL.md`)):!1}catch{return!1}}const DD=`existing file/dir not managed by bl skill`;function OD(e,t=xD(),n=[]){let r=T(cD(),e),i=[];for(let a of t){let t=T(a.skillsDir,e);try{let e=!1;try{pe(t),e=!0}catch{}if(e){if(wD(t))w(t);else if(TD(t,n))w(t,{recursive:!0,force:!0});else if(ED(t))w(t,{recursive:!0,force:!0});else{i.push({agent:a.id,path:t,mode:`skipped`,reason:DD});continue}}me(a.skillsDir,{recursive:!0});try{be(r,t,process.platform===`win32`?`junction`:`dir`),i.push({agent:a.id,path:t,mode:`symlink`})}catch{ue(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 kD(e,t=xD(),n=[]){let r=OD(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===DD).map(e=>e.path),s=n.filter(e=>!a.some(t=>SD(t,e))&&!o.some(t=>SD(t,e)));return{results:r,linkedAgents:i.map(e=>e.agent),links:[...a,...s]}}function AD(e,t=[]){let n=[],r=new Set(t);for(let t of gD())r.add(T(t.skillsDir,e));for(let e of r)try{let r;try{r=pe(e)}catch{continue}r.isSymbolicLink()?wD(e)&&n.push(e):t.some(t=>SD(t,e))&&n.push(e)}catch{}return n}function jD(e,t=[]){let n=[];for(let r of AD(e,t))try{if(wD(r))w(r);else if(!pe(r).isSymbolicLink()&&t.some(e=>SD(e,r)))w(r,{recursive:!0,force:!0});else continue;n.push(r)}catch{}return n}function MD(e){return e.includes(`\\`)||e.includes(`\0`)||e.startsWith(`/`)||/^[a-zA-Z]:[\\/]/.test(e)?!1:!e.split(`/`).includes(`..`)}async function ND(e,t){let n=Ge.extract();n.on(`entry`,(e,r,i)=>{if(!MD(e.name)){r.on(`error`,()=>{}),r.resume(),n.destroy(/* @__PURE__ */ Error(`unsafe tar entry: ${e.name}`));return}let a=T(t,e.name);if(e.type===`directory`){me(a,{recursive:!0}),r.resume(),r.on(`end`,i);return}me(Te(a),{recursive:!0});let o=fe(a);r.pipe(o),o.on(`finish`,i),o.on(`error`,i)}),await Ue(Ce.from(e),We(),n)}function PD(e){let t=[],n=r=>{for(let i of ge(r?T(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=Re(`sha256`);for(let n of t)r.update(n),r.update(he(T(e,n)));return`sha256:${r.digest(`hex`)}`}function FD(e,t,n=259){let r,i=a=>{for(let o of ge(a,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let s=T(a,o.name),c=De(e,s);for(let e of t){let t=T(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 ID(e){let t=[],n=r=>{for(let i of ge(r,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){let a=T(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 LD(e,t){let n=ID(e),r=new Set(n.map(e=>e.relativePath));me(t,{recursive:!0});for(let r of n){let n=T(e,r.relativePath),i=T(t,r.relativePath);if(S(i)){let e=pe(i);(!(r.type===`directory`?e.isDirectory():e.isFile())||e.isSymbolicLink())&&w(i,{recursive:!0,force:!0})}r.type===`directory`?me(i,{recursive:!0}):(me(Te(i),{recursive:!0}),le(n,i))}let i=ID(t).filter(e=>!r.has(e.relativePath)).sort((e,t)=>t.relativePath.length-e.relativePath.length);for(let e of i)w(T(t,e.relativePath),{recursive:!0,force:!0})}function RD(e){let t=e?.code;return t===`EPERM`||t===`EBUSY`}function zD(e){try{S(e)&&w(e,{recursive:!0,force:!0})}catch{}}function BD(e,t,n={}){me(Te(t),{recursive:!0});let r=`${t}.old-${Date.now()}`;if(S(t))try{C(t,r)}catch(i){if(!(n.allowInPlaceFallback??process.platform===`win32`)||!RD(i))throw i;try{LD(t,r),LD(e,t),zD(r);return}catch(e){try{S(r)&&LD(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{C(e,t)}catch(e){throw S(r)&&!S(t)&&C(r,t),e}zD(r)}function VD(e){if(e instanceof O){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 HD(e){return e instanceof O&&e.api?.httpStatus===429}function UD(e,t){return Math.min(t*2**(e-1),1e4)}function WD(e){return new Promise(t=>setTimeout(t,e))}async function GD(e,t=3){let n=typeof t==`number`?{attempts:t}:t,r=n.attempts??3,i=n.shouldRetry??VD,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;HD(e)&&await WD(UD(t,a))}throw o}function KD(){return(process.env.BAILIAN_SKILL_REGISTRY_URL?.trim()||`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/skills`).replace(/\/+$/,``)}async function qD(e=3e4,t=3){return GD(async()=>{let t=`${KD()}/index.json`,n;try{n=await Sn.fetch(t,{signal:AbortSignal.timeout(e)})}catch(e){throw new O(`Cannot access skill registry: ${t}`,D.NETWORK,`Check network connectivity; if using a private mirror, verify BAILIAN_SKILL_REGISTRY_URL configuration`,{cause:e})}if(!n.ok)throw new O(`Skill registry returned HTTP ${n.status}: ${t}`,D.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 O(`Skill index index.json is not valid JSON`,D.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 O(`Skill index index.json has invalid structure`,D.GENERAL,`Retry later or contact the publisher`);return i},{attempts:t})}const JD=/^sha256-[0-9a-f]{64}\.tar\.br$/;function YD(e){let t=e?.object;return t&&JD.test(t)?t:`skill.tar.br`}async function XD(e,t,n=3){return GD(async()=>{let n=`${KD()}/${e}/${YD(t)}`,r;try{r=await Sn.fetch(n,{signal:AbortSignal.timeout(12e4)})}catch(t){throw new O(`Failed to download skill ${e}: ${n}`,D.NETWORK,`Network error, retryable`,{cause:t})}if(!r.ok)throw new O(`Failed to download skill ${e}: HTTP ${r.status}`,D.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 ZD(e){return e.replace(/[\\/:*?"<>|\s]+/g,`-`).replace(/\.\.+/g,`-`).replace(/^[-.]+|[-.]+$/g,``)||`unnamed-skill`}function QD(e){return e.length>0&&ZD(e)===e}function $D(e,t){throw new O(`Skill ${e} validation failed: ${t}`,D.GENERAL,`This skill package does not conform to the SKILL.md spec; contact the skill publisher to fix and republish`)}function eO(e){if(!e.startsWith(`---`))return null;let t=/^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/.exec(e);return t?t[1]:null}function tO(e,t){let n=T(e,`SKILL.md`),r;try{ye(n).isFile()||$D(t,`SKILL.md is not a regular file`),r=he(n,`utf-8`)}catch(e){if(e instanceof O)throw e;$D(t,`missing SKILL.md`)}let i=eO(r);i===null&&$D(t,`SKILL.md is missing frontmatter (--- delimited YAML header)`);let a;try{a=_(i)}catch{$D(t,`frontmatter is not valid YAML`)}(typeof a!=`object`||!a)&&$D(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)&&$D(t,`frontmatter is missing non-empty name / description fields`),{name:s,description:c}}function nO(e){if(!QD(e))throw new O(`Invalid skill name: ${e}`,D.GENERAL,`Skill name contains path separators, traversal sequences, or other illegal characters; refusing to write to disk`)}async function rO(e,t,n,r){nO(e);let i=cD(),a=T(i,e),o=T(i,`.tmp-${e}-${process.pid}-${Date.now()}`);try{me(o,{recursive:!0}),await ND(t,o);let i=FD(o,r??(process.platform===`win32`?[a]:[]));if(i)throw new O(`Skill ${e} contains a Windows-incompatible path (${i.pathLength} characters): ${i.relativePath}`,D.GENERAL,`The skill package must shorten this path before it can be installed safely on Windows. / Skill 包必须缩短该路径后才能在 Windows 上安全安装。`);if(n?.startsWith(`sha256:`)){let t=PD(o);if(t!==n)throw new O(`Skill ${e} failed integrity check: index says ${n}, archive is ${t}`,D.GENERAL,`Downloaded archive does not match the index fingerprint (registry may be mid-publish); retry later`)}let s=tO(o,e);return BD(o,a),{name:e,path:a,meta:s}}finally{try{S(o)&&w(o,{recursive:!0,force:!0})}catch{}}}async function iO(e,t,n,r){if(t.compression&&t.compression!==`tar.br`)throw new O(`Skill ${e} uses unsupported compression format: ${t.compression}`,D.GENERAL,`Upgrade bailian-cli to the latest version and retry`);return rO(e,await XD(e,t,n),t.contentHash,r)}function aO(e){nO(e);let t=T(cD(),e);return S(t)?(w(t,{recursive:!0,force:!0}),!0):!1}function oO(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 sO(e,t,n=xD(),r=[],i){await iO(e,t,i,process.platform===`win32`?[T(cD(),e),...n.map(t=>T(t.skillsDir,e))]:void 0);let a=kD(e,n,r);return{lockEntry:oO(t,a.links),linkedAgents:a.linkedAgents}}const cO=`bailian-docs-llm-wiki`;function lO(){return T(Ft(),`skills/bailian-docs-llm-wiki`)}function uO(){return S(T(lO(),`models`,`models.jsonl`))}function dO(){return T(Ft(),`wiki-sync-state.json`)}function fO(){try{return JSON.parse(he(dO(),`utf-8`))}catch{return null}}function pO(e){try{xe(dO(),JSON.stringify(e))}catch{}}function mO(e){try{pD(cO,e)}catch{}}function hO(e){try{let t=dD().skills[cO];return t?.contentHash!==e||!Array.isArray(t.links)}catch{return!0}}async function gO(){try{return(await qD(3e3,1)).skills[cO]??null}catch{return null}}async function _O(){let e=fO(),t=Date.now();if(e&&t-e.lastChecked<432e5&&uO())return!1;let n=await gO();if(!n?.contentHash)return!1;if(uO()&&(!e||e.contentHash===n.contentHash)){if(pO({lastChecked:t,contentHash:n.contentHash}),hO(n.contentHash)){let e=dD().skills[cO]?.links??[];mO(oO(n,kD(cO,xD(),e).links))}return!1}try{let e=dD().skills[cO]?.links??[];mO((await sO(cO,n,xD(),e,1)).lockEntry)}catch{return!1}return pO({lastChecked:t,contentHash:n.contentHash}),!0}const vO={Text:`Text`,Image:`Image`,Video:`Video`,Audio:`Audio`},yO={Single:`single`,Pipeline:`pipeline`},bO={Low:`low`,Medium:`medium`,High:`high`},xO={Standard:`standard`,Large:`large`,ExtraLarge:`extra-large`},SO={Flagship:`flagship`,Balanced:`balanced`,CostOptimized:`cost-optimized`},CO={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`},wO={FunctionCalling:`function-calling`,WebSearch:`web-search`,StructuredOutputs:`structured-outputs`,PrefixCompletion:`prefix-completion`},TO={Flagship:`Flagship`,CostOptimized:`Cost-optimized`},EO=`bailian-cli`,DO=`install-method`,OO=/* @__PURE__ */ new Set([`binary`,`npm`,`brew`,`winget`,`unknown`]);function kO(e){return e?T(Ft(),`${DO}.${e}`):T(Ft(),DO)}function AO(){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 jO(e){if(!e)return null;let t=e.trim().toLowerCase();return OO.has(t)?t:null}function MO(e){try{return jO(he(e,`utf-8`).split(`
285
- `)[0])}catch{return null}}function NO(){let e=jO(process.env.BAILIAN_INSTALL_METHOD);if(e)return e;if(AO()){let e=process.execPath.replaceAll(`\\`,`/`);return e.includes(`/Cellar/`)||e.includes(`/homebrew/`)?`brew`:`binary`}return`npm`}function PO(e){let t=jO(process.env.BAILIAN_INSTALL_METHOD);if(t)return t;if(e?.clientName){let t=MO(kO(e.clientName));if(t)return t;if(e.clientName===`bailian-cli`){let e=MO(kO());if(e)return e}return NO()}return MO(kO())||NO()}function FO(e){let t=PO(e);return t===`binary`&&e.npmPackage!==`bailian-cli`?`npm`:t}function IO(e,t={clientName:EO}){try{let n=Ft();S(n)||me(n,{recursive:!0,mode:448}),xe(kO(t.clientName),`${e}\n`,{mode:384}),t.clientName===`bailian-cli`&&xe(kO(),`${e}\n`,{mode:384})}catch{}}const LO=`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release`,RO=`https://github.com/modelstudioai/cli/releases`,zO=`https://bailian.aliyun.com/cli/install.sh`,BO=`https://bailian.aliyun.com/cli/install.ps1`;function VO(){let e=process.env.BAILIAN_CLI_CDN?.trim();return e?e.replace(/\/$/,``):LO}function HO(e=`latest`){let t=e.trim();return!t||t===`latest`||t===`stable`?`${VO()}/manifest.json`:`${VO()}/${t}.json`}function UO(e,t){let n=e.startsWith(`v`)?e:`v${e}`;return`${VO()}/${n}/${t}`}function WO(){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 GO(e,t,n,r=!1){return`bl-${e}-${t}-${n}.zip`}function KO(e,t,n){if(t!==`windows`)return`bl-${e}-${t}-${n}.tar.gz`}function qO(e,t,n,r=!1){return`bl-${e}-${t}-${n}${r?`.exe`:``}`}function JO(e){return new Promise((t,n)=>{ce.open(e,{lazyEntries:!0},(r,i)=>{if(r||!i){n(r??/* @__PURE__ */ Error(`Failed to open zip: ${e}`));return}t(i)})})}function YO(e){let t=e.replace(/\\/g,`/`);return t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t}async function XO(e,t,n){let r=await JO(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=YO(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 Ne(Te(t),{recursive:!0}),await Ue(r,fe(t)),c(a)}catch(e){s(e)}})()})}),r.readEntry()})}function ZO(e,t){let n=(e??(t?`all`:``)).trim();if(!n)throw new rt(`--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 rt(`--name all cannot be mixed with specific skill names`,`Use either all or a comma-separated list of names`);return`all`}return r}function QO(){let e=cD();return S(e)?ge(e).filter(t=>{if(t.startsWith(`.`)||t.includes(`.tmp-`)||t.includes(`.old-`))return!1;try{return ye(T(e,t)).isDirectory()}catch{return!1}}):[]}function $O(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{hD as AGENT_ENV_KEYS,pv as AIGC_MCP_SERVER,mv as AIGC_MCP_TOOL,_t as API_KEY_CAPABILITY_PATTERN,yC as ASYNC_FLAG,dt as BAILIAN_HOST,ix as BATCH_CSV_COLUMNS,Fb as BATCH_ENDPOINTS,Ib as BATCH_STATUSES,Lb as BATCH_TERMINAL,MS as BILLING_METHOD,EO as BINARY_PRODUCT_CLIENT_NAME,O as BailianError,qb as BatchValidator,bO as Budgets,cS as CALC_DATASETS_TOKENS_API,kn as CHANNEL,PS as CHARGE_TYPE,TC as COMMAND_PACK_API_VERSION,vC as CONCURRENT_FLAG,mt as CONFIG_FILE_KEYS,xC as CONSOLE_AUTH_FLAGS,CO as Capabilities,Vh as Client,yO as Complexities,xO as ContextNeeds,at as CredentialError,Mn as DASHSCOPE_SERVICE_HEADER,Ty as DECISION_QUESTION_TYPES,px as DECISION_REGIONS,NS as DEFAULT_BILLING_METHOD,LO as DEFAULT_CLI_CDN_BASE,fx as DEFAULT_DECISION_MODEL,mx as DEFAULT_DECISION_REGION,AS as DEFAULT_DEPLOY_PLAN,BO as DEFAULT_INSTALL_PS1_URL,zO as DEFAULT_INSTALL_SCRIPT_URL,pt as DEFAULT_LANGUAGE,GE as DEFAULT_LLM_MODEL,zx as DEFAULT_TRAINING_TYPE,qS as DEPLOY_LIST_INDEPENDENT_API,kS as DEPLOY_PLAN,GS as DEPLOY_START_API,KS as DEPLOY_STOP_API,ut as DOCS_HOSTS,lS as ESTIMATE_FINETUNE_TOKENS_API,D as ExitCode,wO as Features,RO as GITHUB_RELEASES_BASE,_C as GLOBAL_FLAGS,Gx as INSUFFICIENT_SAMPLES_CODE,nC as LIST_SUPPORT_IMPORT_MODELS_API,mw as LLMError,Rb as MAX_BATCH_BYTES,zb as MAX_BATCH_LINE_BYTES,Bb as MAX_BATCH_RECORDS,oy as MAX_CPT_BYTES,ay as MAX_DATASET_BYTES,Ey as MAX_DECISION_CHOICE_OPTIONS,sy as MAX_DECISION_DATASET_BYTES,Oy as MAX_DECISION_SCORE_LEVELS,cy as MAX_MEDIA_ZIP_BYTES,An as MCP_CALL_SERVICE,Cv as MCP_IMAGE_GEN_RATIO_SIZES,Tv as MCP_TTS_VOICES,Dy as MIN_DECISION_SCORE_LEVELS,bC as MODEL_AUTH_FLAGS,Iv as MODEL_LIST_API,kh as McpClient,vO as Modalities,TO as ModelCategories,SC as OPENAPI_AUTH_FLAGS,jn as OPEN_API_SOURCE,Lv as PREDICT_CONFIG_API,SO as QualityPreferences,x_ as RAG_PATHS,VE as RECOMMEND_TOOLS,lt as REGIONS,g_ as SANDBOX_PATHS,mD as SKIP_HOST_AGENTS_ENV,oC as SPEECH_BIASING_MODEL,US as STRATEGIES,ft as SUPPORTED_LANGUAGES,sS as TRAINING_MODEL_PRICE_API,Rx as TRAINING_TYPES_CLI,Lx as TRAINING_TYPE_MAP,rt as UsageError,on as activateConfigProfile,WE as agentLoop,f_ as agentStudioFilesPath,Mg as agentStudioHost,Dw as analyzeEngineIntent,En as anonymousConsoleCall,mg as appCompletionPath,BD as atomicSwap,rr as audioFileToDataUri,Fh as bailianMcpPath,Ih as bailianMcpSsePath,Wb as batchChunks,dx as batchDataNotes,ux as batchExamples,Vb as batchIoError,Gb as batchLines,Hb as batchObject,Q as batchUsage,GO as binaryAssetFileName,qO as binaryInnerFileName,KO as binaryTarFileName,Hn as buildAcsCanonicalQuery,G_ as buildAsrContextMessages,q_ as buildAsrFlashRequest,K_ as buildAsyncAsrLanguageFields,Zv as buildCommandInvocation,BE as buildEngineInput,_v as buildImageEditArgs,gv as buildImageGenArgs,yv as buildImageToVideoArgs,un as buildOutputSettings,zS as buildPrepaidInfo,IS as buildReservationCapacity,dn as buildSettings,oO as buildSkillLockEntry,ln as buildSources,Sv as buildSpeechToTextArgs,vv as buildTextToVideoArgs,xv as buildTtsArgs,bv as buildVideoFetchArgs,sC as buildVocabularyRequest,On as callConsoleGateway,Qb as cancelBatch,Fx as cancelCompressJob,wx as cancelFineTune,HO as channelManifestUrl,Zh as chatPath,Y_ as collectAsrTranscriptionItems,$v as commandRef,PD as computeDirContentHash,$O as computeSkillStatuses,zh as connectBailianMcpWithFallback,uv as createBailianControlUser,Xb as createBatch,bS as createCapacityInstance,jx as createCompressJob,QS as createCustomModelImport,mS as createDeployment,xx as createFineTune,ov as createInstrumentedFetch,KE as createLLMClient,sD as createNonInteractive,oD as createReadlineInteraction,zE as createSession,KC as createTrackingEvent,lC as createVocabulary,CC as credentialFlagDefs,ig as decisionPath,jS as defaultDeployPlan,wC as defineCommand,CS as deleteCapacityInstance,Ix as deleteCompressJob,sn as deleteConfigProfile,tC as deleteCustomModelImport,iy as deleteDataset,TS as deleteDeployment,Tx as deleteFineTune,pC as deleteVocabulary,r_ as deploymentCapacityInstancePath,a_ as deploymentCapacityInstanceRenewPath,i_ as deploymentCapacityInstanceScalePath,n_ as deploymentCapacityInstancesPath,s_ as deploymentCapacityOperationPath,o_ as deploymentOverflowPath,Pt as describeAuthState,WO as detectBinaryPlatform,NO as detectInstallMethod,xD as detectInstalledAgents,Cb as detectModality,Ht as detectOutputFormat,HE as dispatchTool,XD as downloadSkillAsset,Tn as effectiveConsoleGatewayConfig,uD as emptySkillLock,Rt as ensureConfigDir,fS as estimateCptTokens,dS as estimateSftDpoTokens,lx as exportBatchCsv,Ox as exportCheckpoint,J_ as extractAsrFlashText,ND as extractTarBr,XO as extractZipEntryToFile,kD as fanOutSkillToAgents,Wx as fetchModelCapability,Gv as fetchModelDetail,Hv as fetchModelGroups,Wv as fetchModelGroupsAll,zv as fetchModelList,Bv as fetchModelListAll,Jv as fetchPredictConfig,qD as fetchSkillsIndex,uS as fetchTrainingModelPrice,ZS as findDeploymentEntry,Vv as findModelByName,iC as findSupportImportModel,Uv as flattenModelGroups,aw as flushTelemetry,bx as followParsexResult,Qv as formatCommand,_w as formatDegradation,Vt as formatErrorJson,Pb as formatIssue,Bt as formatJson,Ut as formatOutput,zt as formatText,Gh as generateCLIAccessToken,DC as generateFilename,gD as getAgentTargets,mn as getApiKeyLoginKind,Zb as getBatch,ex as getBatchFileContent,vS as getCapacityInstance,yS as getCapacityOperation,VO as getCliCdnBase,Nx as getCompressJob,Px as getCompressJobLogs,Ft as getConfigDir,It as getConfigPath,Lt as getCredentialsPath,eC as getCustomModelImport,ry as getDataset,gS as getDeployment,Cx as getFineTune,Ex as getFineTuneLogs,OC as getHermesHome,PO as getInstallMethod,pn as getModelProfilePreset,yx as getParsexResult,aS as getProfile,lD as getSkillLockPath,KD as getSkillRegistryBaseUrl,cD as getSkillsDir,FO as getUpdateInstallMethod,LS as hasPrepaidFlags,Sn as httpTransport,cg as image2ImagePath,ug as image2videoPath,nr as imageFileToDataUri,ag as imagePath,og as imageSyncPath,sg as imageText2ImagePath,W_ as inferAudioFormatHint,Ly as inspectDecisionQuestion,zy as inspectDecisionQuestionId,Ry as inspectDecisionQuestionTable,By as inspectDecisionQuestions,Ny as inspectDecisionState,iO as installSkill,rO as installSkillFromBuffer,sO as installSkillWithFanout,vt as isApiKeyCapability,AO as isCompiledBinary,Q_ as isDashScopeGateway,Ay as isDecisionObject,yD as isHostSystemDetectDir,A_ as isLegacyImage2ImageModel,k_ as isLegacyText2ImageModel,or as isLocalFile,Ev as isMcpTtsVoice,Tt as isModelConnectionSourceMismatch,MD as isSafeEntryName,QD as isSafeSkillName,Lh as isStreamableHttpUnsupported,T_ as isSyncMultimodalImageModel,Bx as isTrainingTypeCli,Rh as isUrlOverrideSseFallbackCandidate,j_ as isWanxFunctionImageEditModel,jg as knowledgeChatEndpoint,Ag as knowledgeSearchEndpoint,OD as linkSkillToAgents,dv as listBailianControlWorkspaces,$b as listBatches,_S as listCapacityInstances,Dx as listCheckpoints,Mx as listCompressJobs,Ax as listCompressTemplates,$S as listCustomModelImports,ny as listDatasets,ES as listDeployableModels,hS as listDeployments,Sx as listFineTunes,XS as listIndependentDeployedModels,QO as listSkillDirsOnDisk,rC as listSupportImportModels,Nb as listSupportedFormats,Ux as listSupportedTrainingTypes,oS as listTrainingTypes,uC as listVocabularies,rD as loadCatalog,iD as loadFamilies,ow as localSink,_n as makeAuthStore,Yv as makeConfigStore,ot as mapApiError,MC as maskToken,_O as maybeSyncWikiData,Ig as mcpWebSearchPath,gg as memoryAddAsyncPath,hg as memoryEndpoint,_g as memoryEventPath,yg as memoryListPath,bg as memoryNodePath,vg as memorySearchPath,xg as memorySkillExportPath,Hx as modelSupportsTrainingType,fg as modelsLimitsPath,pg as modelsPermissionsPath,yt as normalizeApiKeyCapabilities,Yt as normalizeConfigName,st as normalizeModelBaseUrl,Mv as parseAigcAsrTexts,Ov as parseAigcImageResults,hv as parseAigcToolResult,kv as parseAigcTtsResult,Av as parseAigcVideoTaskId,jv as parseAigcVideoTaskResult,Ub as parseBatchEndpoint,IC as parseBooleanValue,xt as parseConfigFile,uy as parseDatasetSchemaFlag,hC as parseInstantVocabulary,LC as parseOptionalBooleanValue,Fv as parseSSE,nv as parseSecurityBody,ZO as parseSkillNames,gC as parseVocabularyEntries,Yh as parsexBaseUrl,Xh as parsexEndpoint,WS as pickPlanStrategy,Ab as pickValidator,AD as planUnlinkSkillFromAgents,Kx as preflightBatchSizeGate,rx as prepareBatch,Eg as profileSchemaItemPath,Tg as profileSchemaPath,cx as projectBatchCsv,dC as queryVocabulary,d_ as ragEndpoint,Yb as readBatchBlob,GC as readCaller,$t as readConfigFile,nn as readConfigProfiles,dD as readSkillLock,PC as readTextFromPathOrStdin,EE as recommendEngine,ir as redactDataUri,Kh as refreshAccessToken,jb as registerValidator,UO as releaseAssetUrl,sw as remoteSink,aO as removeSkillDir,ey as renderCommandText,SS as renewCapacityInstance,Ln as request,Vn as requestJson,aC as requiredTrainTypeForWeightType,fv as resetBailianControlPolicies4Agent,aD as resetCatalogCache,Ot as resolveApiKey,St as resolveApiKeySource,U_ as resolveAsrApi,YD as resolveAssetFileName,tx as resolveBatchChatEndpoint,RC as resolveBooleanFlag,Uh as resolveCLIAccessTokenTarget,kt as resolveConsole,sr as resolveFileUrl,I_ as resolveImageEditApi,F_ as resolveImageGenerateApi,M_ as resolveImageSizeProfile,wv as resolveMcpImageSize,Dt as resolveModelBaseUrl,Ct as resolveModelBaseUrlSource,Et as resolveModelBaseUrlState,wt as resolveModelConnectionProvenance,At as resolveOpenApi,jC as resolveOutputDir,N_ as resolvePromptExtendDefault,zC as resolveWatermark,rg as responsesPath,iT as routeEngine,FC as runWithConcurrency,m_ as sandboxApiPath,p_ as sandboxBaseUrl,h_ as sandboxEndpoint,v_ as sandboxInstanceActionPath,__ as sandboxInstancePath,b_ as sandboxTemplateBuildStatusPath,y_ as sandboxTemplatePath,nt as sanitizeDiagnosticDetails,ZD as sanitizeSkillName,xS as scaleCapacityInstance,DS as scaleDeployment,Fg as securityAgentLogsEndpoint,rv as securityGet,Pg as securityOverviewEndpoint,cn as selectApiKeyResolutionSources,Un as signAcsRequest,Nn as sourceConfig,Cg as speechRecognizePath,Sg as speechSynthesizePath,wg as speechVocabularyPath,JS as startModelService,YS as stopModelService,_x as stripDecisionTrainingFields,NC as stripUndefined,vx as submitParsexTask,dg as taskPath,dw as trackCommandExecution,Pn as trackingHeaders,Vx as trainingTypeMethodVariant,jD as unlinkSkillFromAgents,gx as unwrapDecisionQuestions,Rv as unwrapResponse,OS as updateDeployment,wS as updateDeploymentOverflow,fC as updateVocabulary,ty as uploadDataset,ar as uploadFile,pD as upsertSkillLockEntry,Dg as userProfilePath,Og as userProfileValuesPath,Jb as validateBatch,an as validateConfigProfileActivation,Wh as validateConsoleAccessToken,Mb as validateDataset,RS as validatePrepaidFlags,FS as validateReservationCapacity,tO as validateSkillDir,Gt as validateTimeout,lg as videoGeneratePath,kg as workspaceMaaSBaseUrl,nx as writeBatchFile,en as writeConfigFile,IO as writeInstallMethodSync,fD as writeSkillLock};
285
+ `)[0])}catch{return null}}function NO(){let e=jO(process.env.BAILIAN_INSTALL_METHOD);if(e)return e;if(AO()){let e=process.execPath.replaceAll(`\\`,`/`);return e.includes(`/Cellar/`)||e.includes(`/homebrew/`)?`brew`:`binary`}return`npm`}function PO(e){let t=jO(process.env.BAILIAN_INSTALL_METHOD);if(t)return t;if(e?.clientName){let t=MO(kO(e.clientName));if(t)return t;if(e.clientName===`bailian-cli`){let e=MO(kO());if(e)return e}return NO()}return MO(kO())||NO()}function FO(e){let t=PO(e);return t===`binary`&&e.npmPackage!==`bailian-cli`?`npm`:t}function IO(e,t={clientName:EO}){try{let n=Ft();S(n)||me(n,{recursive:!0,mode:448}),xe(kO(t.clientName),`${e}\n`,{mode:384}),t.clientName===`bailian-cli`&&xe(kO(),`${e}\n`,{mode:384})}catch{}}const LO=`https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release`,RO=`https://github.com/modelstudioai/cli/releases`,zO=`https://bailian.aliyun.com/cli/install.sh`,BO=`https://bailian.aliyun.com/cli/install.ps1`;function VO(){let e=process.env.BAILIAN_CLI_CDN?.trim();return e?e.replace(/\/$/,``):LO}function HO(e=`latest`){let t=e.trim();return!t||t===`latest`||t===`stable`?`${VO()}/manifest.json`:`${VO()}/${t}.json`}function UO(e,t){let n=e.startsWith(`v`)?e:`v${e}`;return`${VO()}/${n}/${t}`}function WO(){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===`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 GO(e,t,n,r=!1){return`bl-${e}-${t}-${n}.zip`}function KO(e,t,n){if(t!==`windows`)return`bl-${e}-${t}-${n}.tar.gz`}function qO(e,t,n,r=!1){return`bl-${e}-${t}-${n}${r?`.exe`:``}`}function JO(e){return new Promise((t,n)=>{ce.open(e,{lazyEntries:!0},(r,i)=>{if(r||!i){n(r??/* @__PURE__ */ Error(`Failed to open zip: ${e}`));return}t(i)})})}function YO(e){let t=e.replace(/\\/g,`/`);return t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t}async function XO(e,t,n){let r=await JO(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=YO(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 Ne(Te(t),{recursive:!0}),await Ue(r,fe(t)),c(a)}catch(e){s(e)}})()})}),r.readEntry()})}function ZO(e,t){let n=(e??(t?`all`:``)).trim();if(!n)throw new rt(`--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 rt(`--name all cannot be mixed with specific skill names`,`Use either all or a comma-separated list of names`);return`all`}return r}function QO(){let e=cD();return S(e)?ge(e).filter(t=>{if(t.startsWith(`.`)||t.includes(`.tmp-`)||t.includes(`.old-`))return!1;try{return ye(T(e,t)).isDirectory()}catch{return!1}}):[]}function $O(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{hD as AGENT_ENV_KEYS,pv as AIGC_MCP_SERVER,mv as AIGC_MCP_TOOL,_t as API_KEY_CAPABILITY_PATTERN,yC as ASYNC_FLAG,dt as BAILIAN_HOST,ix as BATCH_CSV_COLUMNS,Fb as BATCH_ENDPOINTS,Ib as BATCH_STATUSES,Lb as BATCH_TERMINAL,MS as BILLING_METHOD,EO as BINARY_PRODUCT_CLIENT_NAME,O as BailianError,qb as BatchValidator,bO as Budgets,cS as CALC_DATASETS_TOKENS_API,kn as CHANNEL,PS as CHARGE_TYPE,TC as COMMAND_PACK_API_VERSION,vC as CONCURRENT_FLAG,mt as CONFIG_FILE_KEYS,xC as CONSOLE_AUTH_FLAGS,CO as Capabilities,Vh as Client,yO as Complexities,xO as ContextNeeds,at as CredentialError,Mn as DASHSCOPE_SERVICE_HEADER,Ty as DECISION_QUESTION_TYPES,px as DECISION_REGIONS,NS as DEFAULT_BILLING_METHOD,LO as DEFAULT_CLI_CDN_BASE,fx as DEFAULT_DECISION_MODEL,mx as DEFAULT_DECISION_REGION,AS as DEFAULT_DEPLOY_PLAN,BO as DEFAULT_INSTALL_PS1_URL,zO as DEFAULT_INSTALL_SCRIPT_URL,pt as DEFAULT_LANGUAGE,GE as DEFAULT_LLM_MODEL,zx as DEFAULT_TRAINING_TYPE,qS as DEPLOY_LIST_INDEPENDENT_API,kS as DEPLOY_PLAN,GS as DEPLOY_START_API,KS as DEPLOY_STOP_API,ut as DOCS_HOSTS,lS as ESTIMATE_FINETUNE_TOKENS_API,D as ExitCode,wO as Features,RO as GITHUB_RELEASES_BASE,_C as GLOBAL_FLAGS,Gx as INSUFFICIENT_SAMPLES_CODE,nC as LIST_SUPPORT_IMPORT_MODELS_API,mw as LLMError,Rb as MAX_BATCH_BYTES,zb as MAX_BATCH_LINE_BYTES,Bb as MAX_BATCH_RECORDS,oy as MAX_CPT_BYTES,ay as MAX_DATASET_BYTES,Ey as MAX_DECISION_CHOICE_OPTIONS,sy as MAX_DECISION_DATASET_BYTES,Oy as MAX_DECISION_SCORE_LEVELS,cy as MAX_MEDIA_ZIP_BYTES,An as MCP_CALL_SERVICE,Cv as MCP_IMAGE_GEN_RATIO_SIZES,Tv as MCP_TTS_VOICES,Dy as MIN_DECISION_SCORE_LEVELS,bC as MODEL_AUTH_FLAGS,Iv as MODEL_LIST_API,kh as McpClient,vO as Modalities,TO as ModelCategories,SC as OPENAPI_AUTH_FLAGS,jn as OPEN_API_SOURCE,Lv as PREDICT_CONFIG_API,SO as QualityPreferences,x_ as RAG_PATHS,VE as RECOMMEND_TOOLS,lt as REGIONS,g_ as SANDBOX_PATHS,mD as SKIP_HOST_AGENTS_ENV,oC as SPEECH_BIASING_MODEL,US as STRATEGIES,ft as SUPPORTED_LANGUAGES,sS as TRAINING_MODEL_PRICE_API,Rx as TRAINING_TYPES_CLI,Lx as TRAINING_TYPE_MAP,rt as UsageError,on as activateConfigProfile,WE as agentLoop,f_ as agentStudioFilesPath,Mg as agentStudioHost,Dw as analyzeEngineIntent,En as anonymousConsoleCall,mg as appCompletionPath,BD as atomicSwap,rr as audioFileToDataUri,Fh as bailianMcpPath,Ih as bailianMcpSsePath,Wb as batchChunks,dx as batchDataNotes,ux as batchExamples,Vb as batchIoError,Gb as batchLines,Hb as batchObject,Q as batchUsage,GO as binaryAssetFileName,qO as binaryInnerFileName,KO as binaryTarFileName,Hn as buildAcsCanonicalQuery,G_ as buildAsrContextMessages,q_ as buildAsrFlashRequest,K_ as buildAsyncAsrLanguageFields,Zv as buildCommandInvocation,BE as buildEngineInput,_v as buildImageEditArgs,gv as buildImageGenArgs,yv as buildImageToVideoArgs,un as buildOutputSettings,zS as buildPrepaidInfo,IS as buildReservationCapacity,dn as buildSettings,oO as buildSkillLockEntry,ln as buildSources,Sv as buildSpeechToTextArgs,vv as buildTextToVideoArgs,xv as buildTtsArgs,bv as buildVideoFetchArgs,sC as buildVocabularyRequest,On as callConsoleGateway,Qb as cancelBatch,Fx as cancelCompressJob,wx as cancelFineTune,HO as channelManifestUrl,Zh as chatPath,Y_ as collectAsrTranscriptionItems,$v as commandRef,PD as computeDirContentHash,$O as computeSkillStatuses,zh as connectBailianMcpWithFallback,uv as createBailianControlUser,Xb as createBatch,bS as createCapacityInstance,jx as createCompressJob,QS as createCustomModelImport,mS as createDeployment,xx as createFineTune,ov as createInstrumentedFetch,KE as createLLMClient,sD as createNonInteractive,oD as createReadlineInteraction,zE as createSession,KC as createTrackingEvent,lC as createVocabulary,CC as credentialFlagDefs,ig as decisionPath,jS as defaultDeployPlan,wC as defineCommand,CS as deleteCapacityInstance,Ix as deleteCompressJob,sn as deleteConfigProfile,tC as deleteCustomModelImport,iy as deleteDataset,TS as deleteDeployment,Tx as deleteFineTune,pC as deleteVocabulary,r_ as deploymentCapacityInstancePath,a_ as deploymentCapacityInstanceRenewPath,i_ as deploymentCapacityInstanceScalePath,n_ as deploymentCapacityInstancesPath,s_ as deploymentCapacityOperationPath,o_ as deploymentOverflowPath,Pt as describeAuthState,WO as detectBinaryPlatform,NO as detectInstallMethod,xD as detectInstalledAgents,Cb as detectModality,Ht as detectOutputFormat,HE as dispatchTool,XD as downloadSkillAsset,Tn as effectiveConsoleGatewayConfig,uD as emptySkillLock,Rt as ensureConfigDir,fS as estimateCptTokens,dS as estimateSftDpoTokens,lx as exportBatchCsv,Ox as exportCheckpoint,J_ as extractAsrFlashText,ND as extractTarBr,XO as extractZipEntryToFile,kD as fanOutSkillToAgents,Wx as fetchModelCapability,Gv as fetchModelDetail,Hv as fetchModelGroups,Wv as fetchModelGroupsAll,zv as fetchModelList,Bv as fetchModelListAll,Jv as fetchPredictConfig,qD as fetchSkillsIndex,uS as fetchTrainingModelPrice,ZS as findDeploymentEntry,Vv as findModelByName,iC as findSupportImportModel,Uv as flattenModelGroups,aw as flushTelemetry,bx as followParsexResult,Qv as formatCommand,_w as formatDegradation,Vt as formatErrorJson,Pb as formatIssue,Bt as formatJson,Ut as formatOutput,zt as formatText,Gh as generateCLIAccessToken,DC as generateFilename,gD as getAgentTargets,mn as getApiKeyLoginKind,Zb as getBatch,ex as getBatchFileContent,vS as getCapacityInstance,yS as getCapacityOperation,VO as getCliCdnBase,Nx as getCompressJob,Px as getCompressJobLogs,Ft as getConfigDir,It as getConfigPath,Lt as getCredentialsPath,eC as getCustomModelImport,ry as getDataset,gS as getDeployment,Cx as getFineTune,Ex as getFineTuneLogs,OC as getHermesHome,PO as getInstallMethod,pn as getModelProfilePreset,yx as getParsexResult,aS as getProfile,lD as getSkillLockPath,KD as getSkillRegistryBaseUrl,cD as getSkillsDir,FO as getUpdateInstallMethod,LS as hasPrepaidFlags,Sn as httpTransport,cg as image2ImagePath,ug as image2videoPath,nr as imageFileToDataUri,ag as imagePath,og as imageSyncPath,sg as imageText2ImagePath,W_ as inferAudioFormatHint,Ly as inspectDecisionQuestion,zy as inspectDecisionQuestionId,Ry as inspectDecisionQuestionTable,By as inspectDecisionQuestions,Ny as inspectDecisionState,iO as installSkill,rO as installSkillFromBuffer,sO as installSkillWithFanout,vt as isApiKeyCapability,AO as isCompiledBinary,Q_ as isDashScopeGateway,Ay as isDecisionObject,yD as isHostSystemDetectDir,A_ as isLegacyImage2ImageModel,k_ as isLegacyText2ImageModel,or as isLocalFile,Ev as isMcpTtsVoice,Tt as isModelConnectionSourceMismatch,MD as isSafeEntryName,QD as isSafeSkillName,Lh as isStreamableHttpUnsupported,T_ as isSyncMultimodalImageModel,Bx as isTrainingTypeCli,Rh as isUrlOverrideSseFallbackCandidate,j_ as isWanxFunctionImageEditModel,jg as knowledgeChatEndpoint,Ag as knowledgeSearchEndpoint,OD as linkSkillToAgents,dv as listBailianControlWorkspaces,$b as listBatches,_S as listCapacityInstances,Dx as listCheckpoints,Mx as listCompressJobs,Ax as listCompressTemplates,$S as listCustomModelImports,ny as listDatasets,ES as listDeployableModels,hS as listDeployments,Sx as listFineTunes,XS as listIndependentDeployedModels,QO as listSkillDirsOnDisk,rC as listSupportImportModels,Nb as listSupportedFormats,Ux as listSupportedTrainingTypes,oS as listTrainingTypes,uC as listVocabularies,rD as loadCatalog,iD as loadFamilies,ow as localSink,_n as makeAuthStore,Yv as makeConfigStore,ot as mapApiError,MC as maskToken,_O as maybeSyncWikiData,Ig as mcpWebSearchPath,gg as memoryAddAsyncPath,hg as memoryEndpoint,_g as memoryEventPath,yg as memoryListPath,bg as memoryNodePath,vg as memorySearchPath,xg as memorySkillExportPath,Hx as modelSupportsTrainingType,fg as modelsLimitsPath,pg as modelsPermissionsPath,yt as normalizeApiKeyCapabilities,Yt as normalizeConfigName,st as normalizeModelBaseUrl,Mv as parseAigcAsrTexts,Ov as parseAigcImageResults,hv as parseAigcToolResult,kv as parseAigcTtsResult,Av as parseAigcVideoTaskId,jv as parseAigcVideoTaskResult,Ub as parseBatchEndpoint,IC as parseBooleanValue,xt as parseConfigFile,uy as parseDatasetSchemaFlag,hC as parseInstantVocabulary,LC as parseOptionalBooleanValue,Fv as parseSSE,nv as parseSecurityBody,ZO as parseSkillNames,gC as parseVocabularyEntries,Yh as parsexBaseUrl,Xh as parsexEndpoint,WS as pickPlanStrategy,Ab as pickValidator,AD as planUnlinkSkillFromAgents,Kx as preflightBatchSizeGate,rx as prepareBatch,Eg as profileSchemaItemPath,Tg as profileSchemaPath,cx as projectBatchCsv,dC as queryVocabulary,d_ as ragEndpoint,Yb as readBatchBlob,GC as readCaller,$t as readConfigFile,nn as readConfigProfiles,dD as readSkillLock,PC as readTextFromPathOrStdin,EE as recommendEngine,ir as redactDataUri,Kh as refreshAccessToken,jb as registerValidator,UO as releaseAssetUrl,sw as remoteSink,aO as removeSkillDir,ey as renderCommandText,SS as renewCapacityInstance,Ln as request,Vn as requestJson,aC as requiredTrainTypeForWeightType,fv as resetBailianControlPolicies4Agent,aD as resetCatalogCache,Ot as resolveApiKey,St as resolveApiKeySource,U_ as resolveAsrApi,YD as resolveAssetFileName,tx as resolveBatchChatEndpoint,RC as resolveBooleanFlag,Uh as resolveCLIAccessTokenTarget,kt as resolveConsole,sr as resolveFileUrl,I_ as resolveImageEditApi,F_ as resolveImageGenerateApi,M_ as resolveImageSizeProfile,wv as resolveMcpImageSize,Dt as resolveModelBaseUrl,Ct as resolveModelBaseUrlSource,Et as resolveModelBaseUrlState,wt as resolveModelConnectionProvenance,At as resolveOpenApi,jC as resolveOutputDir,N_ as resolvePromptExtendDefault,zC as resolveWatermark,rg as responsesPath,iT as routeEngine,FC as runWithConcurrency,m_ as sandboxApiPath,p_ as sandboxBaseUrl,h_ as sandboxEndpoint,v_ as sandboxInstanceActionPath,__ as sandboxInstancePath,b_ as sandboxTemplateBuildStatusPath,y_ as sandboxTemplatePath,nt as sanitizeDiagnosticDetails,ZD as sanitizeSkillName,xS as scaleCapacityInstance,DS as scaleDeployment,Fg as securityAgentLogsEndpoint,rv as securityGet,Pg as securityOverviewEndpoint,cn as selectApiKeyResolutionSources,Un as signAcsRequest,Nn as sourceConfig,Cg as speechRecognizePath,Sg as speechSynthesizePath,wg as speechVocabularyPath,JS as startModelService,YS as stopModelService,_x as stripDecisionTrainingFields,NC as stripUndefined,vx as submitParsexTask,dg as taskPath,dw as trackCommandExecution,Pn as trackingHeaders,Vx as trainingTypeMethodVariant,jD as unlinkSkillFromAgents,gx as unwrapDecisionQuestions,Rv as unwrapResponse,OS as updateDeployment,wS as updateDeploymentOverflow,fC as updateVocabulary,ty as uploadDataset,ar as uploadFile,pD as upsertSkillLockEntry,Dg as userProfilePath,Og as userProfileValuesPath,Jb as validateBatch,an as validateConfigProfileActivation,Wh as validateConsoleAccessToken,Mb as validateDataset,RS as validatePrepaidFlags,FS as validateReservationCapacity,tO as validateSkillDir,Gt as validateTimeout,lg as videoGeneratePath,kg as workspaceMaaSBaseUrl,nx as writeBatchFile,en as writeConfigFile,IO as writeInstallMethodSync,fD as writeSkillLock};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bailian-cli-core",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Core SDK for bailian-cli. See https://www.npmjs.com/package/bailian-cli for usage.",
5
5
  "homepage": "https://bailian.console.aliyun.com/cli",
6
6
  "bugs": {