@uipath/cli 1.200.0 → 1.200.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.
@@ -3104,7 +3104,7 @@ ${n.issues.map(o=>` - [${o.severity}] [${o.path}] ${o.message}`).join(`
3104
3104
  ${i.map(o=>` - [${o.path}] ${o.message}`).join(`
3105
3105
  `)}`}}})}async validateFile(t){let r=this.fs.path.resolve(t);if(!await this.fs.exists(r))throw new Error(`File not found: ${r}`);if((await this.fs.stat(r))?.isDirectory())throw new Error(`Expected a workflow file but got a directory: ${r}`);this.verbose&&Re.info(`
3106
3106
  Validating: ${r}
3107
- `);let i=await this.fs.readFile(r,"utf-8");if(i===null)throw new Error(`Unable to read file: ${r}`);let o=[],[u,l]=$(()=>WYh(i,r));return u?{success:!1,filePath:r,issues:[{path:"(root)",message:"File is not valid JSON or YAML",severity:"error"}]}:(Xkp(l)||o.push(...jYh(Xkp.errors)),o.push(...ZYh(l)),{success:o.filter(m=>m.severity==="error").length===0,filePath:r,issues:o})}}});var aey,iNp,oNp=w(()=>{"use strict";nt();nNp();aey=[{Description:"Validate an API Workflow JSON file",Command:"uip api-workflow validate ./workflow.json",Output:{Code:"ApiwfValidate",Data:{File:"/abs/path/to/workflow.json",Status:"Valid"}}},{Description:"Validate with verbose logging for detailed diagnostics",Command:"uip api-workflow validate ./workflow.json --verbose",Output:{Code:"ApiwfValidate",Data:{File:"/abs/path/to/workflow.json",Status:"Valid"}}}],iNp=e=>{e.command("validate").description("Validate an API Workflow file").argument("<file>","Path to the API Workflow file to validate").option("--verbose","Enable verbose logging").examples(aey).trackedAction(R,async(t,r)=>{await new vir(r.verbose,R).execute(t)})}});var oci={};bn(oci,{metadata:()=>sey,registerCommands:()=>uey});var sey,uey,aNp=w(()=>{"use strict";DCp();$Cp();DDp();ADp();IDp();PDp();fkp();oNp();sey={name:"api-workflow-tool",version:wCp.version,description:"Run UiPath API Workflows locally.",commandPrefix:"api-workflow"},uey=async e=>{wDp(e),ODp(e),xDp(e),mkp(e),RDp(e),VCp(e),iNp(e)}});var sNp={};bn(sNp,{browserTools:()=>ley});var ley,uNp=w(()=>{"use strict";Rhn();cAu();GOu();rIu();rLu();pLu();f7u();f8u();FKu();SHu();VGn();KWd();Arp();gnp();Rnp();Lap();Wmp();ifp();Ofp();Yfp();BSp();oEp();xCp();aNp();ley=[{name:"case-tool",module:Y4t},{name:"conversational-tool",module:X_n},{name:"docsai-tool",module:vbn},{name:"tasks-tool",module:Tbn},{name:"platform-tool",module:NEn},{name:"traces-tool",module:BEn},{name:"agenthub-tool",module:dCn},{name:"orchestrator-tool",module:UCn},{name:"aops-tool",module:fxn},{name:"data-fabric-tool",module:Txn},{name:"flow-tool",module:XKt},{name:"integrationservice-tool",module:uWn},{name:"solution-tool",module:vYn},{name:"ixp-tool",module:nei},{name:"insights-tool",module:sei},{name:"agent-tool",module:Jei},{name:"test-manager-tool",module:Tri},{name:"admin/guardrails-tool",module:xri},{name:"admin/model-hub-tool",module:Ari},{name:"admin/llmgw-tool",module:Rri},{name:"admin/admin-tool",module:koi},{name:"vertical-solutions-tool",module:Uoi},{name:"maestro-tool",module:Zoi},{name:"api-workflow-tool",module:oci}]});nt();Ln();nt();nt();hs();var XG={name:"@uipath/cli",license:"MIT",version:"1.200.0",description:"Cross platform CLI for UiPath",repository:{type:"git",url:"https://github.com/UiPath/cli.git",directory:"packages/cli"},publishConfig:{registry:"https://npm.pkg.github.com/@uipath"},type:"module",main:"./dist/index.js",exports:{".":{browser:"./dist/index.browser.js",default:"./dist/index.js"},"./browser":"./dist/index.browser.js","./services/markdown-to-jira-wiki":"./dist/services.markdown.browser.js","./services/feedback/browser":"./dist/services.feedback.browser.js"},files:["dist/index.js","dist/index.js.map","dist/index.browser.js","dist/services.markdown.browser.js","dist/services.feedback.browser.js"],bin:{uip:"./dist/index.js"},private:!1,maintainers:["aoltean16","mihaigirleanu","vlad-uipath"],scripts:{build:"bun ./build.ts && bun run build-browser.ts",typecheck:"tsc --noEmit","browser:build":"bun run build-browser.ts",test:"vitest run","test:coverage":"vitest run --coverage",lint:"biome check ."},devDependencies:{"@inquirer/prompts":"^8.3.2","@modelcontextprotocol/sdk":"^1.26.0","@playwright/test":"^1.60.0","@types/bun":"^1.3.11","@types/node":"^25.5.2","@uipath/auth":"workspace:*","@uipath/common":"workspace:*","@uipath/filesystem":"workspace:*","@uipath/robot-client":"26.0.193-alpha22964",applicationinsights:"^2.9.8",commander:"^14.0.3",esbuild:"^0.28.1","js-yaml":"^4.3.1",ora:"^9.3.0","path-browserify":"^1.0.1",typescript:"^7.0.2",zod:"^4.3.6"}};f3();nt();ti();var ZJe=["stable","preview","dev"],LZi=new Set(ZJe),jfm=["dev"],qZi=ZJe.filter(e=>!jfm.includes(e)),i4y=`<${qZi.join("|")}>`;nt();var Wfm=/^(\d+)\.(\d+)(?:\.(\d+))?$/,f4y=C.object({core:C.object({output:C.enum(["table","json","yaml","plain"]).optional(),logLevel:C.enum(["error","warn","info","debug"]).optional(),interactive:C.enum(["never","auto","always"]).optional(),updateChannel:C.enum(ZJe).optional(),version:C.string().regex(Wfm,"must be major.minor or major.minor.patch (e.g. 1.2 or 1.2.3)").optional()}).optional(),auth:C.object({clientId:C.string().min(1).optional(),clientSecret:C.string().min(1).optional(),scopes:C.array(C.string().min(1)).optional(),authority:C.string().url().optional()}).optional(),tools:C.object({registryUrl:C.string().url().optional(),localToolPaths:C.array(C.string().min(1)).optional()}).optional()});var g4y=`${Kre}/${GKi}`;function zZi(e=XG.version){return Zfm(e)!==void 0}function Zfm(e){let t=e.indexOf("-");if(t!==-1)return e.slice(t+1).split(".")[0]}Ln();var yFr=class{_initPromise;async init(){if(this._initPromise)return this._initPromise;let t=hwr().then(()=>{});return this._initPromise=t,t.catch(()=>{this._initPromise=void 0}),t}get fs(){return Ye()}async read(t){let r=await this.fs.readFile(t);return r===null?null:typeof r=="string"?new TextEncoder().encode(r):r}async readText(t){return this.fs.readFile(t,"utf-8")}async write(t,r){await this.fs.writeFile(t,r)}async exists(t){return this.fs.exists(t)}async readdir(t){return this.fs.readdir(t)}async remove(t){await this.fs.exists(t)&&await this.fs.rm(t)}async mkdir(t){await this.fs.mkdir(t)}},JZi=new yFr;Ga();var PFr=["table","json","yaml","plain"],xQi={debug:0,info:1,warn:2,error:3},o$={consumed:!1,advance:0};function Lgm(e,t,r){return t[r]==="--output-filter"&&r+1<t.length?(e.filter=t[r+1],{consumed:!0,advance:1}):t[r]?.startsWith("--output-filter=")?(e.filter=t[r].substring(16),{consumed:!0,advance:0}):o$}function qgm(e,t,r){return t[r]!=="--json"?o$:(e.sawJsonAlias=!0,e.format="json",e.formatWasExplicit=!0,e.sawOutputOption&&(e.outputConflict=!0),{consumed:!0,advance:0})}function wQi(e,t){e.sawJsonAlias||(e.format=t),e.formatWasExplicit=!0}function zgm(e,t,r){if(t[r]!=="--output")return o$;if(e.sawOutputOption=!0,e.sawJsonAlias&&(e.outputConflict=!0),r+1<t.length){let n=t[r+1];if(PFr.includes(n))return wQi(e,n),{consumed:!0,advance:1};if(e.sawJsonAlias)return{consumed:!0,advance:1}}return e.sawJsonAlias?{consumed:!0,advance:0}:o$}function Jgm(e,t,r){if(!t[r]?.startsWith("--output="))return o$;e.sawOutputOption=!0,e.sawJsonAlias&&(e.outputConflict=!0);let n=t[r].substring(9);return PFr.includes(n)?(wQi(e,n),{consumed:!0,advance:0}):e.sawJsonAlias?{consumed:!0,advance:0}:o$}function Kgm(e,t,r){if(t[r]==="--log-level"&&r+1<t.length){let n=xQi[t[r+1].toLowerCase()];return n!==void 0&&(e.logLevel=n),{consumed:!0,advance:1}}if(t[r]?.startsWith("--log-level=")){let n=xQi[t[r].substring(12).toLowerCase()];return n!==void 0&&(e.logLevel=n),{consumed:!0,advance:0}}return o$}function Hgm(e,t,r){return t[r]==="--log-file"&&r+1<t.length?(e.logFile=t[r+1],{consumed:!0,advance:1}):t[r]?.startsWith("--log-file=")?(e.logFile=t[r].substring(11),{consumed:!0,advance:0}):o$}function DQi(e,t){let r;try{r=Lwe(t)}catch(n){if(!(n instanceof Xme))throw n;e.profile=void 0,e.profileError??=n.message;return}e.profileError===void 0&&(e.profile=r)}function Ggm(e,t,r){return t[r]==="--profile"?r+1>=t.length?(e.profile=void 0,e.profileError??="error: option '--profile <name>' argument missing",{consumed:!0,advance:0}):(DQi(e,t[r+1]),{consumed:!0,advance:1}):t[r]?.startsWith("--profile=")?(DQi(e,t[r].substring(10)),{consumed:!0,advance:0}):o$}function jgm(e,t,r){return t[r]==="--interactive"?(e.interactive="always",{consumed:!0,advance:0}):t[r]==="--no-interactive"?(e.interactive="never",{consumed:!0,advance:0}):o$}var Wgm=[Lgm,qgm,zgm,Jgm,Kgm,Hgm,Ggm,jgm];function AQi(e){let t={cleaned:[],format:void 0,formatWasExplicit:!1,sawJsonAlias:!1,sawOutputOption:!1,outputConflict:!1,filter:void 0,logLevel:void 0,logFile:void 0,profile:void 0,profileError:void 0,interactive:void 0};for(let i=0;i<e.length;i++){let o=!1;for(let u of Wgm){let l=u(t,e,i);if(l.consumed){i+=l.advance,o=!0;break}}o||t.cleaned.push(e[i])}let r=process.env?.UIP_DEFAULT_OUTPUT,n=t.format??(r&&PFr.includes(r)?r:"json");return{args:t.cleaned,format:n,formatWasExplicit:t.formatWasExplicit,outputConflict:t.outputConflict,filter:t.filter,logLevel:t.logLevel,logFile:t.logFile,profile:t.profile,profileError:t.profileError,interactive:t.interactive}}nt();var RQi=[{Flags:"--output <table|json|yaml|plain>",Description:"Output format (default: json)"},{Flags:"--output-filter <expression>",Description:"JMESPath expression applied to the Data field of the response envelope"},{Flags:"--log-level <debug|info|warn|error>",Description:"Log level threshold (default: info)"},{Flags:"--log-file <path>",Description:"Write logs to file instead of stderr"},{Flags:"--profile <name>",Description:"Use a named login profile"}],YAt=["login","logout","config","tools","skills","mcp","feedback","help"],PQi=[{Label:"uip login",Description:"Authenticate against the UiPath Platform"},{Label:"uip <command> --help",Description:"Show help for any command"},{Label:"uip skills install",Description:"Install AI-agent skills for this CLI"}];function FQi(e){let t=[],r=e;for(;r;){let n=r.name();n&&t.unshift(n),r=r.parent??null}return t.join(" ")}function i8e(e){return!e.parent}function kQi(){let e=Kf().capabilities.outputWidth;return!Number.isFinite(e)||e<=0?80:e<56?e:Math.min(e,120)}function FFr(e,t){if(e.length>=t)return e;let r=Math.floor((t-e.length)/2),n=t-e.length-r;return`${" ".repeat(r)}${e}${" ".repeat(n)}`}function kFr(e,t){if(t<=0)return[e];let r=e.trim();if(r.length===0)return[""];let n=r.split(/\s+/),i=[],o="";for(let u of n){if(o.length===0){if(u.length<=t){o=u;continue}for(let l=0;l<u.length;l+=t)i.push(u.slice(l,l+t));continue}if(o.length+u.length+1<=t){o=`${o} ${u}`;continue}if(i.push(o),o="",u.length<=t){o=u;continue}for(let l=0;l<u.length;l+=t){let d=u.slice(l,l+t);d.length===t||l+t<u.length?i.push(d):o=d}}return o.length>0&&i.push(o),i.length>0?i:[""]}function Zgm(e){let[t=""]=e.split(/\r?\n/).map(r=>r.trim()).filter(Boolean);return t||"No description"}function Gwe(e,t){if(e.length===0)return[];let r=Math.max(...e.map(l=>l.Label.length)),n=Math.max(t-3-12,1),i=Math.min(r,Math.max(18,Math.floor(t*.38)),n),o=Math.max(t-i-3,1),u=[];for(let l of e){let d=kFr(l.Label,i),m=kFr(l.Description,o),g=Math.max(d.length,m.length);for(let y=0;y<g;y++){let T=(d[y]??"").padEnd(i),E=m[y]??"";u.push(`${T} ${E}`)}}return u}function Qgm(e,t){let r=Math.max(t-4,16),n=` ${e.Title} `,i=Math.max(t-n.length-3,0),o=`\u250C\u2500${n}${"\u2500".repeat(i)}\u2510`,u=e.Lines.map(d=>`\u2502 ${d.padEnd(r)} \u2502`),l=`\u2514${"\u2500".repeat(t-2)}\u2518`;return[o,...u,l].join(`
3107
+ `);let i=await this.fs.readFile(r,"utf-8");if(i===null)throw new Error(`Unable to read file: ${r}`);let o=[],[u,l]=$(()=>WYh(i,r));return u?{success:!1,filePath:r,issues:[{path:"(root)",message:"File is not valid JSON or YAML",severity:"error"}]}:(Xkp(l)||o.push(...jYh(Xkp.errors)),o.push(...ZYh(l)),{success:o.filter(m=>m.severity==="error").length===0,filePath:r,issues:o})}}});var aey,iNp,oNp=w(()=>{"use strict";nt();nNp();aey=[{Description:"Validate an API Workflow JSON file",Command:"uip api-workflow validate ./workflow.json",Output:{Code:"ApiwfValidate",Data:{File:"/abs/path/to/workflow.json",Status:"Valid"}}},{Description:"Validate with verbose logging for detailed diagnostics",Command:"uip api-workflow validate ./workflow.json --verbose",Output:{Code:"ApiwfValidate",Data:{File:"/abs/path/to/workflow.json",Status:"Valid"}}}],iNp=e=>{e.command("validate").description("Validate an API Workflow file").argument("<file>","Path to the API Workflow file to validate").option("--verbose","Enable verbose logging").examples(aey).trackedAction(R,async(t,r)=>{await new vir(r.verbose,R).execute(t)})}});var oci={};bn(oci,{metadata:()=>sey,registerCommands:()=>uey});var sey,uey,aNp=w(()=>{"use strict";DCp();$Cp();DDp();ADp();IDp();PDp();fkp();oNp();sey={name:"api-workflow-tool",version:wCp.version,description:"Run UiPath API Workflows locally.",commandPrefix:"api-workflow"},uey=async e=>{wDp(e),ODp(e),xDp(e),mkp(e),RDp(e),VCp(e),iNp(e)}});var sNp={};bn(sNp,{browserTools:()=>ley});var ley,uNp=w(()=>{"use strict";Rhn();cAu();GOu();rIu();rLu();pLu();f7u();f8u();FKu();SHu();VGn();KWd();Arp();gnp();Rnp();Lap();Wmp();ifp();Ofp();Yfp();BSp();oEp();xCp();aNp();ley=[{name:"case-tool",module:Y4t},{name:"conversational-tool",module:X_n},{name:"docsai-tool",module:vbn},{name:"tasks-tool",module:Tbn},{name:"platform-tool",module:NEn},{name:"traces-tool",module:BEn},{name:"agenthub-tool",module:dCn},{name:"orchestrator-tool",module:UCn},{name:"aops-tool",module:fxn},{name:"data-fabric-tool",module:Txn},{name:"flow-tool",module:XKt},{name:"integrationservice-tool",module:uWn},{name:"solution-tool",module:vYn},{name:"ixp-tool",module:nei},{name:"insights-tool",module:sei},{name:"agent-tool",module:Jei},{name:"test-manager-tool",module:Tri},{name:"admin/guardrails-tool",module:xri},{name:"admin/model-hub-tool",module:Ari},{name:"admin/llmgw-tool",module:Rri},{name:"admin/admin-tool",module:koi},{name:"vertical-solutions-tool",module:Uoi},{name:"maestro-tool",module:Zoi},{name:"api-workflow-tool",module:oci}]});nt();Ln();nt();nt();hs();var XG={name:"@uipath/cli",license:"MIT",version:"1.200.1",description:"Cross platform CLI for UiPath",repository:{type:"git",url:"https://github.com/UiPath/cli.git",directory:"packages/cli"},publishConfig:{registry:"https://npm.pkg.github.com/@uipath"},type:"module",main:"./dist/index.js",exports:{".":{browser:"./dist/index.browser.js",default:"./dist/index.js"},"./browser":"./dist/index.browser.js","./services/markdown-to-jira-wiki":"./dist/services.markdown.browser.js","./services/feedback/browser":"./dist/services.feedback.browser.js"},files:["dist/index.js","dist/index.js.map","dist/index.browser.js","dist/services.markdown.browser.js","dist/services.feedback.browser.js"],bin:{uip:"./dist/index.js"},private:!1,maintainers:["aoltean16","mihaigirleanu","vlad-uipath"],scripts:{build:"bun ./build.ts && bun run build-browser.ts",typecheck:"tsc --noEmit","browser:build":"bun run build-browser.ts",test:"vitest run","test:coverage":"vitest run --coverage",lint:"biome check ."},devDependencies:{"@inquirer/prompts":"^8.3.2","@modelcontextprotocol/sdk":"^1.26.0","@playwright/test":"^1.60.0","@types/bun":"^1.3.11","@types/node":"^25.5.2","@uipath/auth":"workspace:*","@uipath/common":"workspace:*","@uipath/filesystem":"workspace:*","@uipath/robot-client":"26.0.193-alpha22964",applicationinsights:"^2.9.8",commander:"^14.0.3",esbuild:"^0.28.1","js-yaml":"^4.3.1",ora:"^9.3.0","path-browserify":"^1.0.1",typescript:"^7.0.2",zod:"^4.3.6"}};f3();nt();ti();var ZJe=["stable","preview","dev"],LZi=new Set(ZJe),jfm=["dev"],qZi=ZJe.filter(e=>!jfm.includes(e)),i4y=`<${qZi.join("|")}>`;nt();var Wfm=/^(\d+)\.(\d+)(?:\.(\d+))?$/,f4y=C.object({core:C.object({output:C.enum(["table","json","yaml","plain"]).optional(),logLevel:C.enum(["error","warn","info","debug"]).optional(),interactive:C.enum(["never","auto","always"]).optional(),updateChannel:C.enum(ZJe).optional(),version:C.string().regex(Wfm,"must be major.minor or major.minor.patch (e.g. 1.2 or 1.2.3)").optional()}).optional(),auth:C.object({clientId:C.string().min(1).optional(),clientSecret:C.string().min(1).optional(),scopes:C.array(C.string().min(1)).optional(),authority:C.string().url().optional()}).optional(),tools:C.object({registryUrl:C.string().url().optional(),localToolPaths:C.array(C.string().min(1)).optional()}).optional()});var g4y=`${Kre}/${GKi}`;function zZi(e=XG.version){return Zfm(e)!==void 0}function Zfm(e){let t=e.indexOf("-");if(t!==-1)return e.slice(t+1).split(".")[0]}Ln();var yFr=class{_initPromise;async init(){if(this._initPromise)return this._initPromise;let t=hwr().then(()=>{});return this._initPromise=t,t.catch(()=>{this._initPromise=void 0}),t}get fs(){return Ye()}async read(t){let r=await this.fs.readFile(t);return r===null?null:typeof r=="string"?new TextEncoder().encode(r):r}async readText(t){return this.fs.readFile(t,"utf-8")}async write(t,r){await this.fs.writeFile(t,r)}async exists(t){return this.fs.exists(t)}async readdir(t){return this.fs.readdir(t)}async remove(t){await this.fs.exists(t)&&await this.fs.rm(t)}async mkdir(t){await this.fs.mkdir(t)}},JZi=new yFr;Ga();var PFr=["table","json","yaml","plain"],xQi={debug:0,info:1,warn:2,error:3},o$={consumed:!1,advance:0};function Lgm(e,t,r){return t[r]==="--output-filter"&&r+1<t.length?(e.filter=t[r+1],{consumed:!0,advance:1}):t[r]?.startsWith("--output-filter=")?(e.filter=t[r].substring(16),{consumed:!0,advance:0}):o$}function qgm(e,t,r){return t[r]!=="--json"?o$:(e.sawJsonAlias=!0,e.format="json",e.formatWasExplicit=!0,e.sawOutputOption&&(e.outputConflict=!0),{consumed:!0,advance:0})}function wQi(e,t){e.sawJsonAlias||(e.format=t),e.formatWasExplicit=!0}function zgm(e,t,r){if(t[r]!=="--output")return o$;if(e.sawOutputOption=!0,e.sawJsonAlias&&(e.outputConflict=!0),r+1<t.length){let n=t[r+1];if(PFr.includes(n))return wQi(e,n),{consumed:!0,advance:1};if(e.sawJsonAlias)return{consumed:!0,advance:1}}return e.sawJsonAlias?{consumed:!0,advance:0}:o$}function Jgm(e,t,r){if(!t[r]?.startsWith("--output="))return o$;e.sawOutputOption=!0,e.sawJsonAlias&&(e.outputConflict=!0);let n=t[r].substring(9);return PFr.includes(n)?(wQi(e,n),{consumed:!0,advance:0}):e.sawJsonAlias?{consumed:!0,advance:0}:o$}function Kgm(e,t,r){if(t[r]==="--log-level"&&r+1<t.length){let n=xQi[t[r+1].toLowerCase()];return n!==void 0&&(e.logLevel=n),{consumed:!0,advance:1}}if(t[r]?.startsWith("--log-level=")){let n=xQi[t[r].substring(12).toLowerCase()];return n!==void 0&&(e.logLevel=n),{consumed:!0,advance:0}}return o$}function Hgm(e,t,r){return t[r]==="--log-file"&&r+1<t.length?(e.logFile=t[r+1],{consumed:!0,advance:1}):t[r]?.startsWith("--log-file=")?(e.logFile=t[r].substring(11),{consumed:!0,advance:0}):o$}function DQi(e,t){let r;try{r=Lwe(t)}catch(n){if(!(n instanceof Xme))throw n;e.profile=void 0,e.profileError??=n.message;return}e.profileError===void 0&&(e.profile=r)}function Ggm(e,t,r){return t[r]==="--profile"?r+1>=t.length?(e.profile=void 0,e.profileError??="error: option '--profile <name>' argument missing",{consumed:!0,advance:0}):(DQi(e,t[r+1]),{consumed:!0,advance:1}):t[r]?.startsWith("--profile=")?(DQi(e,t[r].substring(10)),{consumed:!0,advance:0}):o$}function jgm(e,t,r){return t[r]==="--interactive"?(e.interactive="always",{consumed:!0,advance:0}):t[r]==="--no-interactive"?(e.interactive="never",{consumed:!0,advance:0}):o$}var Wgm=[Lgm,qgm,zgm,Jgm,Kgm,Hgm,Ggm,jgm];function AQi(e){let t={cleaned:[],format:void 0,formatWasExplicit:!1,sawJsonAlias:!1,sawOutputOption:!1,outputConflict:!1,filter:void 0,logLevel:void 0,logFile:void 0,profile:void 0,profileError:void 0,interactive:void 0};for(let i=0;i<e.length;i++){let o=!1;for(let u of Wgm){let l=u(t,e,i);if(l.consumed){i+=l.advance,o=!0;break}}o||t.cleaned.push(e[i])}let r=process.env?.UIP_DEFAULT_OUTPUT,n=t.format??(r&&PFr.includes(r)?r:"json");return{args:t.cleaned,format:n,formatWasExplicit:t.formatWasExplicit,outputConflict:t.outputConflict,filter:t.filter,logLevel:t.logLevel,logFile:t.logFile,profile:t.profile,profileError:t.profileError,interactive:t.interactive}}nt();var RQi=[{Flags:"--output <table|json|yaml|plain>",Description:"Output format (default: json)"},{Flags:"--output-filter <expression>",Description:"JMESPath expression applied to the Data field of the response envelope"},{Flags:"--log-level <debug|info|warn|error>",Description:"Log level threshold (default: info)"},{Flags:"--log-file <path>",Description:"Write logs to file instead of stderr"},{Flags:"--profile <name>",Description:"Use a named login profile"}],YAt=["login","logout","config","tools","skills","mcp","feedback","help"],PQi=[{Label:"uip login",Description:"Authenticate against the UiPath Platform"},{Label:"uip <command> --help",Description:"Show help for any command"},{Label:"uip skills install",Description:"Install AI-agent skills for this CLI"}];function FQi(e){let t=[],r=e;for(;r;){let n=r.name();n&&t.unshift(n),r=r.parent??null}return t.join(" ")}function i8e(e){return!e.parent}function kQi(){let e=Kf().capabilities.outputWidth;return!Number.isFinite(e)||e<=0?80:e<56?e:Math.min(e,120)}function FFr(e,t){if(e.length>=t)return e;let r=Math.floor((t-e.length)/2),n=t-e.length-r;return`${" ".repeat(r)}${e}${" ".repeat(n)}`}function kFr(e,t){if(t<=0)return[e];let r=e.trim();if(r.length===0)return[""];let n=r.split(/\s+/),i=[],o="";for(let u of n){if(o.length===0){if(u.length<=t){o=u;continue}for(let l=0;l<u.length;l+=t)i.push(u.slice(l,l+t));continue}if(o.length+u.length+1<=t){o=`${o} ${u}`;continue}if(i.push(o),o="",u.length<=t){o=u;continue}for(let l=0;l<u.length;l+=t){let d=u.slice(l,l+t);d.length===t||l+t<u.length?i.push(d):o=d}}return o.length>0&&i.push(o),i.length>0?i:[""]}function Zgm(e){let[t=""]=e.split(/\r?\n/).map(r=>r.trim()).filter(Boolean);return t||"No description"}function Gwe(e,t){if(e.length===0)return[];let r=Math.max(...e.map(l=>l.Label.length)),n=Math.max(t-3-12,1),i=Math.min(r,Math.max(18,Math.floor(t*.38)),n),o=Math.max(t-i-3,1),u=[];for(let l of e){let d=kFr(l.Label,i),m=kFr(l.Description,o),g=Math.max(d.length,m.length);for(let y=0;y<g;y++){let T=(d[y]??"").padEnd(i),E=m[y]??"";u.push(`${T} ${E}`)}}return u}function Qgm(e,t){let r=Math.max(t-4,16),n=` ${e.Title} `,i=Math.max(t-n.length-3,0),o=`\u250C\u2500${n}${"\u2500".repeat(i)}\u2510`,u=e.Lines.map(d=>`\u2502 ${d.padEnd(r)} \u2502`),l=`\u2514${"\u2500".repeat(t-2)}\u2518`;return[o,...u,l].join(`
3108
3108
  `)}function Xgm(e,t){let r=e||"UiPath CLI",n="Build automations, agents, and orchestrations from your terminal.",i=FQi(t),o=[`${i} <command> [options]`,`${i} <tool> <command> [options]`];return[` ${r}`,` ${n}`,"",` Usage: ${o[0]}`,` ${o[1]}`].join(`
3109
3109
  `)}function Ygm(e,t,r){let n=[FFr(e,r)];return t&&n.push(FFr(t,r)),n.push(FFr("Use --help with nested commands for more detail.",r)),n.join(`
3110
3110
  `)}function ehm(e,t){return[t.commandUsage(e)]}function OQi(e){return[...e].sort((t,r)=>t.Label.localeCompare(r.Label))}function IQi(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function eOt(e){return e==null?"":typeof e=="object"?JSON.stringify(e):String(e)}function NQi(e,t){if(e.length===0)return[];let r=Object.keys(e[0]),n=" ",i=r.map(m=>Math.max(m.length,...e.map(g=>eOt(g[m]).length))),o=n.length*Math.max(r.length-1,0);if(i.reduce((m,g)=>m+g,0)+o>t&&r.length>1){let g=Math.max(t-o,r.length*4)/i.reduce((T,E)=>T+E,0);for(let T=0;T<i.length;T++)i[T]=Math.max(Math.floor(i[T]*g),4);let y=i.reduce((T,E)=>T+E,0)+o;for(;y>t;){let T=0;for(let E=1;E<i.length;E++)i[E]>i[T]&&(T=E);if(i[T]<=4)break;i[T]--,y--}}let l=(m,g)=>m.length>g?`${m.substring(0,g-1)}\u2026`:m.padEnd(g),d=[];d.push(r.map((m,g)=>l(m,i[g])).join(n)),d.push(r.map((m,g)=>"\u2500".repeat(i[g])).join(n));for(let m of e){let g=r.map((y,T)=>l(eOt(m[y]),i[T])).join(n);d.push(g)}return d}function BQi(e,t){let r=Object.keys(e);if(r.length===0)return[];let n=" ",i=Math.max(t-n.length,1),o=[],u=r.filter(d=>typeof e[d]!="object"||e[d]===null),l=u.length>0?Math.max(...u.map(d=>d.length)):0;for(let d of r){let m=e[d];if(Array.isArray(m)&&m.length>0&&m.every(IQi)){o.push(`${d}:`);for(let T of NQi(m,i))o.push(`${n}${T}`);continue}if(IQi(m)){o.push(`${d}:`);for(let T of BQi(m,i))o.push(`${n}${T}`);continue}let g=Array.isArray(m)?m.map(T=>eOt(T)).join(", "):eOt(m),y=`${d.padEnd(l)} ${g}`;o.push(y.length>t?`${y.substring(0,t-1)}\u2026`:y)}return o}function thm(e,t){let n=t-2,i=[];for(let o=0;o<e.length;o++){let u=e[o];if(u.Description){for(let m of kFr(u.Description,t))i.push(m);i.push("")}i.push(` $ ${u.Command}`),i.push("");let l=u.Output.Data,d=Array.isArray(l)?NQi(l,n):BQi(l,n);for(let m of d)i.push(` ${m}`);o<e.length-1&&i.push("")}return i}function rhm(e,t){let r=Math.max(kQi()-4,16),n=Qwr(e,t),i=[];i8e(e)||i.push({Title:"Usage",Lines:ehm(e,t)}),n.Arguments.length>0&&i.push({Title:"Arguments",Lines:Gwe(n.Arguments.map(l=>({Label:l.Name,Description:l.Description||"No description"})),r)});let o=t.visibleCommands(e).map(l=>({Key:l.name(),Label:l.name(),Description:Zgm(t.subcommandDescription(l)||"")}));if(i8e(e)){let l=o.filter(m=>YAt.includes(m.Key)&&m.Key!=="help"),d=o.filter(m=>!YAt.includes(m.Key));l.length>0&&(l.sort((m,g)=>YAt.indexOf(m.Key)-YAt.indexOf(g.Key)),i.push({Title:"Commands",Lines:Gwe(l.map(({Label:m,Description:g})=>({Label:m,Description:g})),r)})),d.length>0&&i.push({Title:"Installed Tools",Lines:Gwe(OQi(d.map(({Label:m,Description:g})=>({Label:m,Description:g}))),r)})}else o.length>0&&i.push({Title:"Commands",Lines:Gwe(OQi(o.map(({Label:l,Description:d})=>({Label:l,Description:d}))),r)});let u=[...n.Options.map(l=>({Label:l.Flags,Description:l.Description||"No description"})),...RQi.map(l=>({Label:l.Flags,Description:l.Description}))];return u.length>0&&i.push({Title:"Options",Lines:Gwe(u,r)}),n.Examples&&n.Examples.length>0&&i.push({Title:"Examples",Lines:thm(n.Examples,r)}),i8e(e)&&i.push({Title:"Getting started",Lines:Gwe(PQi,r)}),i}function nhm(e,t){let r=kQi(),n=t.commandDescription(e),i=[];i8e(e)?i.push(Xgm(n,e)):i.push(Ygm(FQi(e),n,r));for(let o of rhm(e,t))i.push(Qgm(o,r));return`${i.join(`
package/dist/index.js CHANGED
@@ -92769,7 +92769,7 @@ var init_package = __esm(() => {
92769
92769
  package_default = {
92770
92770
  name: "@uipath/cli",
92771
92771
  license: "MIT",
92772
- version: "1.200.0",
92772
+ version: "1.200.1",
92773
92773
  description: "Cross platform CLI for UiPath",
92774
92774
  repository: {
92775
92775
  type: "git",
@@ -114049,25 +114049,6 @@ var init_tools_whitelist = __esm(() => {
114049
114049
  });
114050
114050
 
114051
114051
  // src/services/toolService.ts
114052
- var exports_toolService = {};
114053
- __export(exports_toolService, {
114054
- validateVersionString: () => validateVersionString,
114055
- validatePackageSpec: () => validatePackageSpec,
114056
- truncateVersionsForDisplay: () => truncateVersionsForDisplay,
114057
- toolService: () => toolService,
114058
- resolveToolPackageName: () => resolveToolPackageName,
114059
- resetBunOnPathCacheForTests: () => resetBunOnPathCacheForTests,
114060
- parsePackageSpec: () => parsePackageSpec,
114061
- isValidSemver: () => isValidSemver,
114062
- isPermissionError: () => isPermissionError,
114063
- isDevMode: () => isDevMode,
114064
- isBunOnPath: () => isBunOnPath,
114065
- getEffectiveRegistry: () => getEffectiveRegistry,
114066
- compareSemver: () => compareSemver,
114067
- WHITELIST_BY_SHORT_NAME: () => WHITELIST_BY_SHORT_NAME,
114068
- WHITELIST_BY_COMMAND: () => WHITELIST_BY_COMMAND,
114069
- TOOLS_WHITELIST: () => TOOLS_WHITELIST
114070
- });
114071
114052
  function isValidSemver(v) {
114072
114053
  return SEMVER_RE.test(v);
114073
114054
  }
@@ -114139,22 +114120,73 @@ async function isBunOnPath() {
114139
114120
  cachedBunOnPath = !error51 && result === true;
114140
114121
  return cachedBunOnPath;
114141
114122
  }
114142
- function resetBunOnPathCacheForTests() {
114143
- cachedBunOnPath = undefined;
114144
- }
114145
114123
  function validatePackageSpec(spec) {
114146
114124
  if (!SAFE_PACKAGE_SPEC.test(spec)) {
114147
114125
  throw new Error(`Invalid package specifier: '${spec}'. Only alphanumeric characters, dots, hyphens, underscores, slashes, and @ are allowed.`);
114148
114126
  }
114149
114127
  }
114150
- function validateVersionString(version2) {
114151
- if (!SAFE_VERSION.test(version2)) {
114152
- throw new Error(`Invalid version string: '${version2}'. Only alphanumeric characters, dots, hyphens, underscores, and semver operators are allowed.`);
114153
- }
114128
+ function isNpmViewMetadataError(error51) {
114129
+ return error51 instanceof NpmViewMetadataError || error51.name === "NpmViewMetadataError";
114154
114130
  }
114155
114131
  function resolveToolPackageName(arg) {
114156
114132
  return WHITELIST_BY_COMMAND.get(arg) ?? WHITELIST_BY_SHORT_NAME.get(arg) ?? arg;
114157
114133
  }
114134
+ function asNpmViewMetadata(value) {
114135
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
114136
+ return;
114137
+ }
114138
+ return value;
114139
+ }
114140
+ function pickHighestNpmViewMetadata(values) {
114141
+ const candidates = values.map(asNpmViewMetadata).filter((candidate) => typeof candidate?.version === "string" && isValidSemver(candidate.version));
114142
+ if (candidates.length === 0)
114143
+ return;
114144
+ candidates.sort((a, b) => compareSemver(b.version ?? "", a.version ?? ""));
114145
+ const selected = candidates[0];
114146
+ const selectedVersion = selected?.version;
114147
+ if (!selected || !selectedVersion)
114148
+ return;
114149
+ const availableVersions = collectNpmViewMetadataVersions(candidates);
114150
+ return {
114151
+ ...selected,
114152
+ "dist-tags": {
114153
+ ...selected["dist-tags"],
114154
+ latest: selectedVersion
114155
+ },
114156
+ versions: availableVersions
114157
+ };
114158
+ }
114159
+ function collectNpmViewMetadataVersions(values) {
114160
+ const versions2 = new Set;
114161
+ for (const value of values) {
114162
+ const rawVersions = Array.isArray(value.versions) ? value.versions : typeof value.versions === "string" ? [value.versions] : [];
114163
+ for (const version2 of rawVersions) {
114164
+ if (isValidSemver(version2))
114165
+ versions2.add(version2);
114166
+ }
114167
+ if (value.version && isValidSemver(value.version)) {
114168
+ versions2.add(value.version);
114169
+ }
114170
+ }
114171
+ return [...versions2].sort((a, b) => compareSemver(b, a));
114172
+ }
114173
+ function normalizeNpmViewMetadata(parsed, packageName) {
114174
+ let unwrapped = parsed;
114175
+ while (Array.isArray(unwrapped) && unwrapped.length === 1) {
114176
+ unwrapped = unwrapped[0];
114177
+ }
114178
+ if (Array.isArray(unwrapped)) {
114179
+ const selected = pickHighestNpmViewMetadata(unwrapped);
114180
+ if (selected)
114181
+ return selected;
114182
+ throw new NpmViewMetadataError(`npm view ${packageName} returned no versioned package metadata`);
114183
+ }
114184
+ const metadata = asNpmViewMetadata(unwrapped);
114185
+ if (!metadata) {
114186
+ throw new NpmViewMetadataError(`npm view ${packageName} returned unsupported metadata shape`);
114187
+ }
114188
+ return metadata;
114189
+ }
114158
114190
  function parsePackageSpec(spec) {
114159
114191
  const versionSeparator = spec.startsWith("@") ? spec.indexOf("@", 1) : spec.indexOf("@");
114160
114192
  if (versionSeparator === -1) {
@@ -114358,41 +114390,6 @@ async function runPackageManagerWithBun(args, cwd, extraEnv) {
114358
114390
  logger.debug(`Running package manager: bun ${pmArgs.join(" ")}${cwd ? ` (cwd: ${cwd})` : ""}`);
114359
114391
  await spawnPackageManager("bun", pmArgs, cwd, `bun ${pmArgs[0]}`, extraEnv);
114360
114392
  }
114361
- function validateTarballUrl(tarballUrl, registryUrl) {
114362
- const [err, parsed] = catchError(() => {
114363
- const url2 = new URL(tarballUrl);
114364
- const registry3 = new URL(registryUrl);
114365
- if (url2.hostname !== registry3.hostname || url2.protocol !== registry3.protocol) {
114366
- throw new Error(`refusing tarball from '${url2.protocol}//${url2.hostname}'; expected '${registry3.protocol}//${registry3.hostname}'`);
114367
- }
114368
- return url2;
114369
- });
114370
- if (err || !parsed) {
114371
- throw new Error(`Invalid tarball URL '${tarballUrl}': ${err ? err.message : "unparseable"}`);
114372
- }
114373
- return parsed;
114374
- }
114375
- function extractTarEntry(tar, entryName) {
114376
- const decoder3 = new TextDecoder;
114377
- let offset = 0;
114378
- while (offset + 512 <= tar.length) {
114379
- const header = tar.subarray(offset, offset + 512);
114380
- if (header.every((b) => b === 0))
114381
- break;
114382
- const name = decoder3.decode(header.subarray(0, 100)).split("\x00", 1)[0];
114383
- const sizeField = decoder3.decode(header.subarray(124, 136)).split("\x00", 1)[0].trim();
114384
- const size = Number.parseInt(sizeField, 8);
114385
- if (Number.isNaN(size) || size < 0) {
114386
- throw new Error(`Corrupt tar header at offset ${offset}`);
114387
- }
114388
- const typeflag = header[156];
114389
- if ((typeflag === 0 || typeflag === 48) && name === entryName) {
114390
- return decoder3.decode(tar.subarray(offset + 512, offset + 512 + size));
114391
- }
114392
- offset += 512 + Math.ceil(size / 512) * 512;
114393
- }
114394
- return null;
114395
- }
114396
114393
 
114397
114394
  class NodeToolService {
114398
114395
  async npmView(packageName, timeoutMs = NPM_VIEW_TIMEOUT_MS, registry3) {
@@ -114461,13 +114458,9 @@ class NodeToolService {
114461
114458
  });
114462
114459
  const [parseError, parsed] = catchError(() => JSON.parse(stdout));
114463
114460
  if (parseError) {
114464
- throw new Error(`Unexpected npm view output for ${packageName}`);
114465
- }
114466
- let unwrapped = parsed;
114467
- while (Array.isArray(unwrapped) && unwrapped.length === 1) {
114468
- unwrapped = unwrapped[0];
114461
+ throw new NpmViewMetadataError(`npm view ${packageName} returned invalid JSON`);
114469
114462
  }
114470
- const data = unwrapped;
114463
+ const data = normalizeNpmViewMetadata(parsed, packageName);
114471
114464
  const latestVersion = data["dist-tags"]?.latest ?? data.version;
114472
114465
  const rawVersions = Array.isArray(data.versions) ? data.versions : data.versions ? [data.versions] : [];
114473
114466
  const availableVersions = rawVersions.filter(isValidSemver).sort((a, b) => compareSemver(b, a));
@@ -114496,20 +114489,6 @@ class NodeToolService {
114496
114489
  const detail = stderr.trim() || (codeOrError instanceof Error ? codeOrError.message : `exit ${codeOrError}`);
114497
114490
  return new Error(`npm view ${packageName} failed: ${detail}`);
114498
114491
  }
114499
- async fetchPublicPackument(packageName, timeoutMs = DEFAULT_FETCH_TIMEOUT_MS) {
114500
- validatePackageSpec(packageName);
114501
- const encodedName = packageName.replaceAll("/", "%2f");
114502
- const url2 = `${NPMJS_REGISTRY}/${encodedName}`;
114503
- logger.debug(`Fetching package info: ${url2}`);
114504
- const response = await fetch(url2, {
114505
- headers: { Accept: "application/json" },
114506
- signal: AbortSignal.timeout(timeoutMs)
114507
- });
114508
- if (!response.ok) {
114509
- throw new Error(`Registry ${NPMJS_REGISTRY} returned ${response.status} ${response.statusText} for ${packageName}`);
114510
- }
114511
- return await response.json();
114512
- }
114513
114492
  async search(query) {
114514
114493
  const packages = [...TOOLS_WHITELIST.keys()];
114515
114494
  const settled = await Promise.allSettled(packages.map((name) => this.npmView(name)));
@@ -114575,31 +114554,6 @@ ${errors7.map((e) => ` - ${e}`).join(`
114575
114554
  }
114576
114555
  return null;
114577
114556
  }
114578
- async downloadPackageFile(packageName, fileName, options) {
114579
- validatePackageSpec(packageName);
114580
- const timeoutMs = options?.timeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS;
114581
- const packument = await this.fetchPublicPackument(packageName, timeoutMs);
114582
- const latest = packument["dist-tags"]?.latest;
114583
- const tarballUrl = latest ? packument.versions?.[latest]?.dist?.tarball : undefined;
114584
- if (!tarballUrl) {
114585
- throw new Error(`No tarball URL for ${packageName}@${latest ?? "latest"} on ${NPMJS_REGISTRY}`);
114586
- }
114587
- const tarball = validateTarballUrl(tarballUrl, NPMJS_REGISTRY);
114588
- logger.debug(`Downloading tarball: ${tarball.href}`);
114589
- const response = await fetch(tarball, {
114590
- signal: AbortSignal.timeout(timeoutMs)
114591
- });
114592
- if (!response.ok) {
114593
- throw new Error(`Tarball download for ${packageName} returned ${response.status} ${response.statusText}`);
114594
- }
114595
- const { gunzipSync } = await import("node:zlib");
114596
- const tar = gunzipSync(new Uint8Array(await response.arrayBuffer()));
114597
- const content = extractTarEntry(tar, `package/${fileName}`);
114598
- if (content === null) {
114599
- throw new Error(`File '${fileName}' not found in ${packageName}@${latest} tarball`);
114600
- }
114601
- return content;
114602
- }
114603
114557
  async install(packageName, destination, options) {
114604
114558
  validatePackageSpec(packageName);
114605
114559
  await refuseIfBundledDistribution(destination, "install", packageName);
@@ -114699,7 +114653,7 @@ function truncateVersionsForDisplay(versions2) {
114699
114653
  }
114700
114654
  return result;
114701
114655
  }
114702
- var SEMVER_RE, SAFE_PACKAGE_SPEC, SAFE_VERSION, SHELL_SAFE_ARG, SHELL_SAFE_COMMAND_LINE, NPM_TIMEOUT_MS = 180000, NPM_VIEW_TIMEOUT_MS = 30000, NPM_MAX_RETRIES = 2, TRANSIENT_NPM_ERRORS, UNSUPPORTED_PROTOCOL_MARKER = "EUNSUPPORTEDPROTOCOL", cachedBunOnPath, childProcessModulePromise, NPMJS_REGISTRY = "https://registry.npmjs.org", GITHUB_REGISTRY = "https://npm.pkg.github.com", REGISTRY_PREFERENCE, effectiveNpmConfigPromise = null, PERMISSION_ERROR_MARKERS, toolService;
114656
+ var SEMVER_RE, SAFE_PACKAGE_SPEC, SHELL_SAFE_ARG, SHELL_SAFE_COMMAND_LINE, NPM_TIMEOUT_MS = 180000, NPM_VIEW_TIMEOUT_MS = 30000, NPM_MAX_RETRIES = 2, TRANSIENT_NPM_ERRORS, UNSUPPORTED_PROTOCOL_MARKER = "EUNSUPPORTEDPROTOCOL", cachedBunOnPath, childProcessModulePromise, NpmViewMetadataError, NPMJS_REGISTRY = "https://registry.npmjs.org", GITHUB_REGISTRY = "https://npm.pkg.github.com", REGISTRY_PREFERENCE, effectiveNpmConfigPromise = null, PERMISSION_ERROR_MARKERS, toolService;
114703
114657
  var init_toolService = __esm(() => {
114704
114658
  init_src2();
114705
114659
  init_src();
@@ -114709,10 +114663,15 @@ var init_toolService = __esm(() => {
114709
114663
  init_tools_whitelist();
114710
114664
  SEMVER_RE = /^\d+\.\d+\.\d+(-[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?(\+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?$/;
114711
114665
  SAFE_PACKAGE_SPEC = /^@?[a-zA-Z0-9._/-]+(@[a-zA-Z0-9._+:~^<>=| -]+)?$/;
114712
- SAFE_VERSION = /^[a-zA-Z0-9._+:~^<>=| -]+$/;
114713
114666
  SHELL_SAFE_ARG = /^[a-zA-Z0-9@/._-]+$/;
114714
114667
  SHELL_SAFE_COMMAND_LINE = /^[a-zA-Z0-9@/._\- ]+$/;
114715
114668
  TRANSIENT_NPM_ERRORS = ["ENOTEMPTY", "EBUSY"];
114669
+ NpmViewMetadataError = class NpmViewMetadataError extends Error {
114670
+ constructor(message) {
114671
+ super(message);
114672
+ this.name = "NpmViewMetadataError";
114673
+ }
114674
+ };
114716
114675
  REGISTRY_PREFERENCE = [
114717
114676
  NPMJS_REGISTRY,
114718
114677
  GITHUB_REGISTRY
@@ -115833,12 +115792,11 @@ function parseVersionPin(raw) {
115833
115792
  pin.patch = Number(match[3]);
115834
115793
  return pin;
115835
115794
  }
115836
- function majorMinorPinOf(version2) {
115837
- const [rawMajor, rawMinor] = version2.trim().split(/[.\-+]/);
115838
- if (rawMajor === undefined || rawMinor === undefined || !/^\d+$/.test(rawMajor) || !/^\d+$/.test(rawMinor)) {
115795
+ function majorOf(version2) {
115796
+ const [rawMajor] = version2.trim().split(/[.\-+]/);
115797
+ if (rawMajor === undefined || !/^\d+$/.test(rawMajor))
115839
115798
  return null;
115840
- }
115841
- return { major: Number(rawMajor), minor: Number(rawMinor) };
115799
+ return Number(rawMajor);
115842
115800
  }
115843
115801
  function resolvePinnedVersion() {
115844
115802
  return parseVersionPin(getCachedConfig().core?.version);
@@ -116196,7 +116154,7 @@ var init_config2 = __esm(() => {
116196
116154
  normalize: (v) => v.trim(),
116197
116155
  validate: (v) => isValidVersionPin(v),
116198
116156
  valueHint: "Use major.minor or major.minor.patch (e.g. 1.2 or 1.2.3).",
116199
- description: "Version policy: exact (1.2.3) freezes auto-update, float (1.2) " + "tracks that line, unset follows your environment or the latest"
116157
+ description: "Version policy: exact (1.2.3) freezes auto-update, float (1.2) " + "tracks that line, unset follows the latest release"
116200
116158
  },
116201
116159
  clientSecret: {
116202
116160
  path: ["auth", "clientSecret"],
@@ -116208,7 +116166,7 @@ var init_config2 = __esm(() => {
116208
116166
  WRITABLE_KEY_NAMES = VALID_KEY_NAMES.filter((key) => CONFIG_KEYS[key].writable !== false);
116209
116167
  REMOVED_KEYS = {
116210
116168
  autoVersionSync: "`autoVersionSync` was removed. To stop auto-updates, freeze on an " + "exact version: `uip config set version <major.minor.patch>` " + "(undo with `uip config clear version`).",
116211
- versionSource: "`versionSource` was removed. Version policy now lives entirely in " + "`version`: set a pin with `uip config set version <major.minor[.patch]>`, " + "or clear it with `uip config clear version` to follow your " + "environment or the latest release."
116169
+ versionSource: "`versionSource` was removed. Version policy now lives entirely in " + "`version`: set a pin with `uip config set version <major.minor[.patch]>`, " + "or clear it with `uip config clear version` to follow the latest " + "release."
116212
116170
  };
116213
116171
  CONFIG_GET_EXAMPLES = [
116214
116172
  {
@@ -116295,7 +116253,7 @@ var init_config2 = __esm(() => {
116295
116253
  ];
116296
116254
  CONFIG_CLEAR_EXAMPLES = [
116297
116255
  {
116298
- Description: "Clear the version pin so the CLI follows the environment / latest again",
116256
+ Description: "Clear the version pin so the CLI follows the latest release again",
116299
116257
  Command: "uip config clear version",
116300
116258
  Output: {
116301
116259
  Code: "ConfigClear",
@@ -116362,11 +116320,6 @@ var init_promptSelect = __esm(() => {
116362
116320
  });
116363
116321
 
116364
116322
  // src/services/auth.ts
116365
- var exports_auth = {};
116366
- __export(exports_auth, {
116367
- auth: () => auth
116368
- });
116369
-
116370
116323
  class NodeAuth {
116371
116324
  async interactiveLogin(options) {
116372
116325
  const { interactiveLogin: interactiveLogin2 } = await Promise.resolve().then(() => (init_src3(), exports_src2));
@@ -133905,6 +133858,12 @@ function loadChildProcess2() {
133905
133858
  childProcessModulePromise2 ??= import("node:child_process");
133906
133859
  return childProcessModulePromise2;
133907
133860
  }
133861
+ function isSkillsPackageMetadataError(error51) {
133862
+ return error51 instanceof SkillsPackageMetadataError || error51.name === "SkillsPackageMetadataError";
133863
+ }
133864
+ function isSkillsPackOutputError(error51) {
133865
+ return error51 instanceof SkillsPackOutputError || error51.name === "SkillsPackOutputError";
133866
+ }
133908
133867
  function parseGitHub(input) {
133909
133868
  const https = input.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/i);
133910
133869
  if (https)
@@ -134246,6 +134205,35 @@ async function getContentStore(rootDir, source = DEFAULT_SOURCE, targetVersion)
134246
134205
  await fetchSkillsTo(storePath, rootDir, source, targetVersion);
134247
134206
  return storePath;
134248
134207
  }
134208
+ async function getContentStoreForRead(rootDir, source = DEFAULT_SOURCE, targetVersion) {
134209
+ const fs7 = getFileSystem();
134210
+ const storePath = fs7.path.join(rootDir, source.storeName);
134211
+ if (source.isDefault && await storeMatchesVersionLine(fs7, storePath, targetVersion)) {
134212
+ logger.debug(`Reading skills from the existing store at ${storePath} (no fetch).`);
134213
+ return storePath;
134214
+ }
134215
+ await fetchSkillsTo(storePath, rootDir, source, targetVersion);
134216
+ return storePath;
134217
+ }
134218
+ async function storeMatchesVersionLine(fs7, storePath, targetVersion) {
134219
+ const line = parseSemver(targetVersion ?? package_default.version) ?? parseVersionLine(targetVersion ?? package_default.version);
134220
+ if (!line)
134221
+ return false;
134222
+ const skillsDir = fs7.path.join(storePath, "skills");
134223
+ const [entriesErr, entries] = await catchError(fs7.readdir(skillsDir));
134224
+ if (entriesErr || !entries?.length)
134225
+ return false;
134226
+ const [markerErr, markerText] = await catchError(fs7.readFile(fs7.path.join(storePath, SOURCE_MARKER_NAME), {
134227
+ encoding: "utf-8"
134228
+ }));
134229
+ if (markerErr || !markerText)
134230
+ return false;
134231
+ const [parseErr, marker] = catchError(() => JSON.parse(markerText));
134232
+ if (parseErr)
134233
+ return false;
134234
+ const version2 = asRecord(marker)?.version;
134235
+ return typeof version2 === "string" && matchesCliVersionLine(version2, line);
134236
+ }
134249
134237
  async function readSkillDescription(fs7, skillMdPath) {
134250
134238
  const [err, content] = await catchError(fs7.readFile(skillMdPath, { encoding: "utf-8" }));
134251
134239
  if (err || !content)
@@ -134637,7 +134625,11 @@ function mapPmError(pm, label, stderr, codeOrError) {
134637
134625
  function parsePmJson(pm, stdout, label) {
134638
134626
  const [parseError, parsed] = catchError(() => JSON.parse(stdout));
134639
134627
  if (parseError) {
134640
- throw new Error(`Unexpected ${pm} ${label} output`);
134628
+ const message = `Unexpected ${pm} ${label} output`;
134629
+ if (label.startsWith(`view ${SKILLS_PACKAGE_NAME}`)) {
134630
+ throw new SkillsPackageMetadataError(message);
134631
+ }
134632
+ throw new Error(message);
134641
134633
  }
134642
134634
  return parsed;
134643
134635
  }
@@ -134646,13 +134638,13 @@ async function pmViewJson(pm, args) {
134646
134638
  const pmArgs = pm === "bun" ? ["info", ...args, "--json"] : ["view", ...args, "--json"];
134647
134639
  return await withTempProject(async (dir) => {
134648
134640
  const stdout = await runPmCommand(pm, pmArgs, label, NPM_VIEW_TIMEOUT_MS2, dir);
134649
- return parseViewOutput(pm, stdout);
134641
+ return parseViewOutput(pm, stdout, label);
134650
134642
  });
134651
134643
  }
134652
- function parseViewOutput(pm, stdout) {
134644
+ function parseViewOutput(pm, stdout, label) {
134653
134645
  if (!stdout.trim())
134654
134646
  return;
134655
- return parsePmJson(pm, stdout, "view");
134647
+ return parsePmJson(pm, stdout, label);
134656
134648
  }
134657
134649
  async function yarnInfo(args) {
134658
134650
  const label = `info ${args.join(" ")}`;
@@ -134710,18 +134702,72 @@ function normalizeVersionList(value) {
134710
134702
  walk(value);
134711
134703
  return [...collected];
134712
134704
  }
134713
- function requireString(value, message) {
134714
- if (typeof value !== "string" || value.length === 0) {
134715
- throw new Error(message);
134705
+ function recordVersion(record3) {
134706
+ const version2 = record3.version;
134707
+ return typeof version2 === "string" && parseSemver(version2) ? version2 : undefined;
134708
+ }
134709
+ function recordDistTarball(record3) {
134710
+ const dist = asRecord(record3.dist);
134711
+ const tarball = dist?.tarball;
134712
+ return typeof tarball === "string" && tarball.length > 0 ? tarball : undefined;
134713
+ }
134714
+ function versionFromTarballText(value) {
134715
+ const [urlError, parsedUrl] = catchError(() => new URL(value));
134716
+ const pathText = urlError ? value : parsedUrl.pathname;
134717
+ const segments = pathText.split("/").map((segment) => decodeURIComponent(segment)).filter((segment) => segment.length > 0);
134718
+ for (const segment of segments) {
134719
+ if (parseSemver(segment))
134720
+ return segment;
134721
+ }
134722
+ const fileName = segments.at(-1);
134723
+ if (!fileName)
134724
+ return;
134725
+ const stem = fileName.endsWith(".tgz") ? fileName.slice(0, -".tgz".length) : fileName;
134726
+ for (let i = 0;i < stem.length - 1; i++) {
134727
+ if (stem[i] !== "-")
134728
+ continue;
134729
+ const version2 = stem.slice(i + 1);
134730
+ if (startsWithDigit(version2) && parseSemver(version2)) {
134731
+ return version2;
134732
+ }
134716
134733
  }
134717
- return value;
134734
+ return;
134735
+ }
134736
+ function startsWithDigit(value) {
134737
+ const first = value.charCodeAt(0);
134738
+ return first >= 48 && first <= 57;
134739
+ }
134740
+ function pickHighestVersionedString(values) {
134741
+ const candidates = values.filter((value) => typeof value === "string" && value.length > 0).map((value) => ({
134742
+ value,
134743
+ version: versionFromTarballText(value)
134744
+ })).filter((candidate) => candidate.version !== undefined);
134745
+ candidates.sort((a, b) => compareSemver2(b.version, a.version));
134746
+ return candidates[0]?.value;
134747
+ }
134748
+ function pickHighestVersionedRecordTarball(values) {
134749
+ const candidates = values.map(asRecord).filter((record3) => record3 !== undefined).map((record3) => ({
134750
+ version: recordVersion(record3),
134751
+ tarball: recordDistTarball(record3)
134752
+ })).filter((candidate) => candidate.version !== undefined && candidate.tarball !== undefined);
134753
+ candidates.sort((a, b) => compareSemver2(b.version, a.version));
134754
+ return candidates[0]?.tarball;
134718
134755
  }
134719
134756
  function coerceViewString(value) {
134720
134757
  let node2 = value;
134721
134758
  while (Array.isArray(node2) && node2.length === 1) {
134722
134759
  node2 = node2[0];
134723
134760
  }
134724
- return typeof node2 === "string" && node2.length > 0 ? node2 : undefined;
134761
+ if (typeof node2 === "string" && node2.length > 0)
134762
+ return node2;
134763
+ const record3 = asRecord(node2);
134764
+ const recordTarball = record3 ? recordDistTarball(record3) : undefined;
134765
+ if (recordTarball)
134766
+ return recordTarball;
134767
+ if (Array.isArray(node2)) {
134768
+ return pickHighestVersionedRecordTarball(node2) ?? pickHighestVersionedString(node2);
134769
+ }
134770
+ return;
134725
134771
  }
134726
134772
  function registryFromTarball(tarballUrl) {
134727
134773
  const [urlError, parsedUrl] = catchError(() => new URL(tarballUrl));
@@ -134734,16 +134780,21 @@ async function fetchMatchingSkillsPackageInfo(pm, targetVersion) {
134734
134780
  }
134735
134781
  const versions2 = await pmListVersions(pm, cliVersion);
134736
134782
  const selectedVersion = pickMatchingSkillsVersion(versions2, cliVersion);
134737
- const tarballUrl = pm === "npm" || pm === "pnpm" ? requireString(coerceViewString(await pmViewJson(pm, [
134783
+ const tarballUrl = pm === "npm" || pm === "pnpm" ? requireSkillsTarballUrl(selectedVersion, coerceViewString(await pmViewJson(pm, [
134738
134784
  `${SKILLS_PACKAGE_NAME}@${selectedVersion}`,
134739
134785
  "dist.tarball"
134740
- ])), `${SKILLS_PACKAGE_NAME}@${selectedVersion} does not declare dist.tarball`) : await pmResolveTarball(pm, selectedVersion);
134786
+ ]))) : await pmResolveTarball(pm, selectedVersion);
134741
134787
  return {
134742
134788
  version: selectedVersion,
134743
134789
  tarballUrl: tarballUrl ?? "",
134744
134790
  registryUrl: tarballUrl ? registryFromTarball(tarballUrl) : SKILLS_REGISTRY_URL
134745
134791
  };
134746
134792
  }
134793
+ function requireSkillsTarballUrl(selectedVersion, tarballUrl) {
134794
+ if (tarballUrl)
134795
+ return tarballUrl;
134796
+ throw new SkillsPackageMetadataError(`npm view ${SKILLS_PACKAGE_NAME}@${selectedVersion} dist.tarball returned no usable tarball URL`);
134797
+ }
134747
134798
  function parseVersionLine(version2) {
134748
134799
  const match = /^(\d+)\.(\d+)$/.exec(version2.trim());
134749
134800
  if (!match)
@@ -134816,19 +134867,23 @@ async function addAndCopyPackage(pm, packageInfo, destinationPath) {
134816
134867
  });
134817
134868
  }
134818
134869
  function readPackedFileName(packOutput) {
134819
- if (!Array.isArray(packOutput)) {
134820
- throw new TypeError(`Unexpected npm pack output for ${SKILLS_PACKAGE_NAME}`);
134821
- }
134822
- const firstEntry = asRecord(packOutput[0]);
134823
- const filename = typeof firstEntry?.filename === "string" ? firstEntry.filename : undefined;
134870
+ const entries = Array.isArray(packOutput) ? packOutput : packOutputObjectEntries(packOutput);
134871
+ const filename = entries.map((entry) => asRecord(entry)?.filename).find((value) => typeof value === "string" && value.length > 0);
134824
134872
  if (!filename) {
134825
- throw new TypeError(`Unexpected npm pack output for ${SKILLS_PACKAGE_NAME}`);
134873
+ throw new SkillsPackOutputError(`Unexpected npm pack output for ${SKILLS_PACKAGE_NAME}`);
134826
134874
  }
134827
134875
  if (filename.includes("/") || filename.includes("\\")) {
134828
134876
  throw new Error(`Unsafe npm pack filename for ${SKILLS_PACKAGE_NAME}`);
134829
134877
  }
134830
134878
  return filename;
134831
134879
  }
134880
+ function packOutputObjectEntries(packOutput) {
134881
+ const record3 = asRecord(packOutput);
134882
+ if (!record3)
134883
+ return [];
134884
+ const named = record3[SKILLS_PACKAGE_NAME];
134885
+ return named === undefined ? Object.values(record3) : [named];
134886
+ }
134832
134887
  async function writeSourceMarker(storePath, packageInfo) {
134833
134888
  const fs7 = getFileSystem();
134834
134889
  const marker = {
@@ -134956,7 +135011,7 @@ function isTarDirectoryEntry(typeFlag, entryName) {
134956
135011
  function isTarRegularFileEntry(typeFlag) {
134957
135012
  return typeFlag === "0" || typeFlag === "\x00";
134958
135013
  }
134959
- async function extractTarEntry2(fs7, destinationDir, entryName, entry) {
135014
+ async function extractTarEntry(fs7, destinationDir, entryName, entry) {
134960
135015
  if (isTarDirectoryEntry(entry.typeFlag, entryName)) {
134961
135016
  await fs7.mkdir(resolveTarEntryPath(fs7, destinationDir, entryName));
134962
135017
  return;
@@ -134990,10 +135045,10 @@ async function extractNpmTarballToDir(tarData, destinationDir) {
134990
135045
  const entryName = stripNpmPackageRoot(rawPath);
134991
135046
  if (!entryName)
134992
135047
  continue;
134993
- await extractTarEntry2(fs7, destinationDir, entryName, entry);
135048
+ await extractTarEntry(fs7, destinationDir, entryName, entry);
134994
135049
  }
134995
135050
  }
134996
- var SKILLS_PACKAGE_NAME = "@uipath/skills", SKILLS_REGISTRY_URL = "https://registry.npmjs.org", REPO_URL = "https://www.npmjs.com/package/@uipath/skills", SOURCE_MARKER_NAME = ".uipath-skills-source.json", STORE_NAME, TAR_BLOCK_SIZE = 512, NPM_VIEW_TIMEOUT_MS2 = 30000, NPM_PACK_TIMEOUT_MS = 60000, SHELL_SAFE_ARG2, SHELL_SAFE_COMMAND_LINE2, PM_PREFERENCE, PM_OVERRIDE_ENV = "UIP_SKILLS_PM", childProcessModulePromise2, SkillSourceError, SkillsRegistryAuthError, DEFAULT_SOURCE, MAX_SKILL_SCAN_DEPTH = 16, MANIFEST_NAME = "manifest.json", cachedPackageManager = null, REGISTRY_AUTH_HINT = "The package manager could not authenticate to the registry. If you are installing an alpha/internal build from GitHub Packages, add to your .npmrc: '@uipath:registry=https://npm.pkg.github.com/' and '//npm.pkg.github.com/:_authToken=<token>', where <token> is a GitHub PAT with the 'read:packages' scope, authorized for the UiPath org via 'Configure SSO'. This is a different credential from your 'uip login' token.";
135051
+ var SKILLS_PACKAGE_NAME = "@uipath/skills", SKILLS_REGISTRY_URL = "https://registry.npmjs.org", REPO_URL = "https://www.npmjs.com/package/@uipath/skills", SOURCE_MARKER_NAME = ".uipath-skills-source.json", STORE_NAME, TAR_BLOCK_SIZE = 512, NPM_VIEW_TIMEOUT_MS2 = 30000, NPM_PACK_TIMEOUT_MS = 60000, SHELL_SAFE_ARG2, SHELL_SAFE_COMMAND_LINE2, PM_PREFERENCE, PM_OVERRIDE_ENV = "UIP_SKILLS_PM", childProcessModulePromise2, SkillSourceError, SkillsRegistryAuthError, SkillsPackageMetadataError, SkillsPackOutputError, DEFAULT_SOURCE, MAX_SKILL_SCAN_DEPTH = 16, MANIFEST_NAME = "manifest.json", cachedPackageManager = null, REGISTRY_AUTH_HINT = "The package manager could not authenticate to the registry. If you are installing an alpha/internal build from GitHub Packages, add to your .npmrc: '@uipath:registry=https://npm.pkg.github.com/' and '//npm.pkg.github.com/:_authToken=<token>', where <token> is a GitHub PAT with the 'read:packages' scope, authorized for the UiPath org via 'Configure SSO'. This is a different credential from your 'uip login' token.";
134997
135052
  var init_contentStore = __esm(() => {
134998
135053
  init_src2();
134999
135054
  init_src();
@@ -135019,6 +135074,18 @@ var init_contentStore = __esm(() => {
135019
135074
  this.name = "SkillsRegistryAuthError";
135020
135075
  }
135021
135076
  };
135077
+ SkillsPackageMetadataError = class SkillsPackageMetadataError extends Error {
135078
+ constructor(message) {
135079
+ super(message);
135080
+ this.name = "SkillsPackageMetadataError";
135081
+ }
135082
+ };
135083
+ SkillsPackOutputError = class SkillsPackOutputError extends Error {
135084
+ constructor(message) {
135085
+ super(message);
135086
+ this.name = "SkillsPackOutputError";
135087
+ }
135088
+ };
135022
135089
  DEFAULT_SOURCE = {
135023
135090
  repoUrl: REPO_URL,
135024
135091
  branch: null,
@@ -135562,6 +135629,36 @@ var init_agents = __esm(() => {
135562
135629
  };
135563
135630
  });
135564
135631
 
135632
+ // src/commands/skills/errorMessages.ts
135633
+ function getSkillsSourceFailureDetails(error51) {
135634
+ if (isPermissionError(error51)) {
135635
+ return {
135636
+ instructions: "Fix write access to the path in the error message (commonly the skills store under ~/.uipath/.skills, or the target project's .uipath/.skills when using --local or --path), then re-run the command.",
135637
+ retry: "RetryWillNotFix"
135638
+ };
135639
+ }
135640
+ if (isSkillsPackageMetadataError(error51)) {
135641
+ return {
135642
+ instructions: "The registry lookup succeeded, but @uipath/skills metadata could not be read or did not include a usable tarball URL for the selected version. Check the package metadata in the configured npm registry, then retry.",
135643
+ retry: "RetryWillNotFix"
135644
+ };
135645
+ }
135646
+ if (isSkillsPackOutputError(error51)) {
135647
+ return {
135648
+ instructions: "Your npm version prints a `pack --json` shape this CLI cannot read. Update the CLI (`uip update`), or set UIP_SKILLS_PM=pnpm (or bun/yarn) to fetch skills with another package manager, which skips npm pack entirely.",
135649
+ retry: "RetryWillNotFix"
135650
+ };
135651
+ }
135652
+ return {
135653
+ instructions: "Check network connectivity and try again. Ensure the @uipath/skills package is available from the configured npm registry.",
135654
+ retry: "RetryLater"
135655
+ };
135656
+ }
135657
+ var init_errorMessages = __esm(() => {
135658
+ init_toolService();
135659
+ init_contentStore();
135660
+ });
135661
+
135565
135662
  // src/commands/skills/skillCatalog.ts
135566
135663
  function asRecord2(value) {
135567
135664
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -135829,7 +135926,7 @@ function getRootDir(options) {
135829
135926
  async function resolveCatalog(options) {
135830
135927
  const rootDir = getRootDir(options);
135831
135928
  const source = resolveSkillSource(options.repo, options.branch);
135832
- const storePath = await getContentStore(rootDir, source);
135929
+ const storePath = await getContentStoreForRead(rootDir, source);
135833
135930
  const shadowed = [];
135834
135931
  const skills = await getAvailableSkills(storePath, shadowed);
135835
135932
  const catalog = await buildSkillCatalog(skills, {
@@ -135865,10 +135962,12 @@ async function loadCatalogOrReport(options) {
135865
135962
  if (error51) {
135866
135963
  if (error51 instanceof SkillSourceError)
135867
135964
  throw error51;
135965
+ const details = getSkillsSourceFailureDetails(error51);
135868
135966
  OutputFormatter.error({
135869
135967
  Result: RESULTS.Failure,
135870
135968
  Message: `Failed to load skills catalog: ${error51.message}`,
135871
- Instructions: "Check network connectivity and try again. Ensure the @uipath/skills package is available from the configured npm registry."
135969
+ Instructions: details.instructions,
135970
+ Retry: details.retry
135872
135971
  });
135873
135972
  processContext.exit(1);
135874
135973
  return null;
@@ -135957,6 +136056,7 @@ var init_catalogCommands = __esm(() => {
135957
136056
  init_src2();
135958
136057
  init_src();
135959
136058
  init_contentStore();
136059
+ init_errorMessages();
135960
136060
  init_skillCatalog();
135961
136061
  SKILLS_LIST_EXAMPLES = [
135962
136062
  {
@@ -136032,23 +136132,6 @@ var init_catalogCommands = __esm(() => {
136032
136132
  ];
136033
136133
  });
136034
136134
 
136035
- // src/commands/skills/errorMessages.ts
136036
- function getSkillsSourceFailureDetails(error51) {
136037
- if (isPermissionError(error51)) {
136038
- return {
136039
- instructions: "Fix write access to the path in the error message (commonly the skills store under ~/.uipath/.skills, or the target project's .uipath/.skills when using --local or --path), then re-run the command.",
136040
- retry: "RetryWillNotFix"
136041
- };
136042
- }
136043
- return {
136044
- instructions: "Check network connectivity and try again. Ensure the @uipath/skills package is available from the configured npm registry.",
136045
- retry: "RetryLater"
136046
- };
136047
- }
136048
- var init_errorMessages = __esm(() => {
136049
- init_toolService();
136050
- });
136051
-
136052
136135
  // src/commands/skills/prompt.ts
136053
136136
  async function promptAgentSelection(operation, isLocal, preselected = [], isDefaultSource = true) {
136054
136137
  const visible = ALL_AGENTS.filter((a) => !(isLocal && isDefaultSource && AGENT_DEFS[a].globalOnly));
@@ -140812,14 +140895,12 @@ var init_ora = __esm(() => {
140812
140895
 
140813
140896
  // src/services/updateFailureFormat.ts
140814
140897
  function pinnedLineRemediation(origin) {
140815
- if (origin === "environment")
140816
- return ENVIRONMENT_LINE_REMEDIATION;
140817
140898
  if (origin === "latest")
140818
140899
  return LATEST_LINE_REMEDIATION;
140819
140900
  return PINNED_LINE_REMEDIATION;
140820
140901
  }
140821
140902
  function toolFailureRemediation(origin) {
140822
- const changeTarget = origin === "environment" ? "pin a version line with `uip config set version <major.minor>` to override your environment" : origin === "latest" ? "pin a version line with `uip config set version <major.minor>`" : "adjust the pinned `core.version`";
140903
+ const changeTarget = origin === "latest" ? "pin a version line with `uip config set version <major.minor>`" : "adjust the pinned `core.version`";
140823
140904
  return `Check tool compatibility with the current CLI version, ${changeTarget}, ` + `or run \`uip config set updateChannel ${CHANNEL_PLACEHOLDER}\` to switch release channels.`;
140824
140905
  }
140825
140906
  function isPinnedLineMissing(error52) {
@@ -140831,17 +140912,12 @@ function describeSearchedRegistry(registry3) {
140831
140912
  function describeMissingLine(opts) {
140832
140913
  const { pin, origin, targetLine, searched } = opts;
140833
140914
  const suffix = describeSearchedRegistry(searched);
140834
- if (origin === "environment") {
140835
- return `No version found matching your environment's version line ${formatVersionPin(pin)} in the ${targetLine} line${suffix}`;
140836
- }
140837
140915
  if (origin === "latest") {
140838
140916
  return `No version found in the latest ${targetLine} line${suffix}`;
140839
140917
  }
140840
140918
  return `No version found matching pinned ${formatVersionPin(pin)} in the ${targetLine} line${suffix}`;
140841
140919
  }
140842
140920
  function describeDowngradeReason(origin) {
140843
- if (origin === "environment")
140844
- return "your environment's version line";
140845
140921
  if (origin === "latest")
140846
140922
  return "the latest version line";
140847
140923
  return "the pinned version";
@@ -140860,9 +140936,6 @@ function describePinnedLine(target) {
140860
140936
  if (!target?.pin)
140861
140937
  return "the pinned version line";
140862
140938
  const line = `${target.pin.major}.${target.pin.minor}`;
140863
- if (target.origin === "environment") {
140864
- return `your environment's version line ${line}`;
140865
- }
140866
140939
  if (target.origin === "latest") {
140867
140940
  return `the latest version line ${line}`;
140868
140941
  }
@@ -140879,12 +140952,11 @@ function collapsePinnedLineErrors(report, target) {
140879
140952
  individual: report.Errors.filter((e) => !isPinnedLineMissing(e))
140880
140953
  };
140881
140954
  }
140882
- var PINNED_LINE_REMEDIATION, ENVIRONMENT_LINE_REMEDIATION, LATEST_LINE_REMEDIATION;
140955
+ var PINNED_LINE_REMEDIATION, LATEST_LINE_REMEDIATION;
140883
140956
  var init_updateFailureFormat = __esm(() => {
140884
140957
  init_channels();
140885
140958
  init_versionPin();
140886
- PINNED_LINE_REMEDIATION = "Pin a published version line with `uip config set version <major.minor>`, " + `switch channels with \`uip config set updateChannel ${CHANNEL_PLACEHOLDER}\`, ` + "or clear the pin with `uip config clear version` to track your " + "environment or the latest release, then re-run `uip update`.";
140887
- ENVIRONMENT_LINE_REMEDIATION = "This line comes from your environment, not a config pin — " + "`uip config clear version` will not change it. Pin a published version " + "line with `uip config set version <major.minor>` to override the " + "environment, or switch channels with " + `\`uip config set updateChannel ${CHANNEL_PLACEHOLDER}\`, then re-run \`uip update\`.`;
140959
+ PINNED_LINE_REMEDIATION = "Pin a published version line with `uip config set version <major.minor>`, " + `switch channels with \`uip config set updateChannel ${CHANNEL_PLACEHOLDER}\`, ` + "or clear the pin with `uip config clear version` to track the latest " + "release, then re-run `uip update`.";
140888
140960
  LATEST_LINE_REMEDIATION = "Pin a published version line with `uip config set version <major.minor>`, " + `or switch channels with \`uip config set updateChannel ${CHANNEL_PLACEHOLDER}\`, ` + "then re-run `uip update`.";
140889
140961
  });
140890
140962
 
@@ -140898,13 +140970,6 @@ function buildToolUpdatePolicy(opts, cliVersionPrefix) {
140898
140970
  if (pin) {
140899
140971
  const targetLine2 = formatTargetLine(pinnedPrefix(pin));
140900
140972
  const renderedPin = formatVersionPin(pin);
140901
- if (opts.pinOrigin === "environment") {
140902
- return {
140903
- resolvedBy: "environment",
140904
- targetLine: targetLine2,
140905
- reason: `Using your environment's version line ${renderedPin}; tools resolve within ${targetLine2}.`
140906
- };
140907
- }
140908
140973
  return {
140909
140974
  resolvedBy: "core.version",
140910
140975
  targetLine: targetLine2,
@@ -141143,230 +141208,22 @@ var init_updateService_tools = __esm(() => {
141143
141208
  };
141144
141209
  });
141145
141210
 
141146
- // src/services/versionSyncState.ts
141147
- import { randomUUID as randomUUID7 } from "node:crypto";
141148
- function todayLocal() {
141149
- const d = new Date;
141150
- const month = String(d.getMonth() + 1).padStart(2, "0");
141151
- const day = String(d.getDate()).padStart(2, "0");
141152
- return `${d.getFullYear()}-${month}-${day}`;
141153
- }
141154
- function stateFilePath(fs7) {
141155
- return fs7.path.join(fs7.env.homedir(), UIPATH_HOME_DIR, STATE_FILENAME);
141156
- }
141157
- async function readState(fs7 = getFileSystem()) {
141158
- const [readErr, raw] = await catchError(fs7.readFile(stateFilePath(fs7), "utf-8"));
141159
- if (readErr || !raw)
141160
- return {};
141161
- const [parseErr, parsed] = catchError(() => JSON.parse(raw));
141162
- if (parseErr || parsed === null || typeof parsed !== "object") {
141163
- return {};
141164
- }
141165
- const state = {};
141166
- if (typeof parsed.lastUpdateDate === "string") {
141167
- state.lastUpdateDate = parsed.lastUpdateDate;
141168
- }
141169
- if (typeof parsed.envLine === "string")
141170
- state.envLine = parsed.envLine;
141171
- if (typeof parsed.envLineDate === "string") {
141172
- state.envLineDate = parsed.envLineDate;
141173
- }
141174
- if (typeof parsed.envLineAttemptDate === "string") {
141175
- state.envLineAttemptDate = parsed.envLineAttemptDate;
141176
- }
141177
- if (typeof parsed.envKey === "string")
141178
- state.envKey = parsed.envKey;
141179
- return state;
141180
- }
141181
- async function mergeState(patch, fs7 = getFileSystem()) {
141182
- const current = await readState(fs7);
141183
- const next = { ...current, ...patch };
141184
- const target = stateFilePath(fs7);
141185
- await catchError(fs7.mkdir(fs7.path.dirname(target)));
141186
- const tempPath = `${target}.${randomUUID7()}.tmp`;
141187
- const [err] = await catchError((async () => {
141188
- await fs7.writeFile(tempPath, JSON.stringify(next, null, 2));
141189
- await fs7.rename(tempPath, target);
141190
- })());
141191
- if (err) {
141192
- await catchError(fs7.rm(tempPath));
141193
- return false;
141194
- }
141195
- return true;
141196
- }
141197
- async function invalidateSyncState(fs7 = getFileSystem()) {
141198
- await catchError(fs7.rm(stateFilePath(fs7)));
141199
- }
141200
- var STATE_FILENAME = "version-sync.json";
141201
- var init_versionSyncState = __esm(() => {
141202
- init_src2();
141203
- init_src();
141204
- });
141205
-
141206
141211
  // src/services/versionTarget.ts
141207
- function mapAuthorityToEnvironment(baseUrl) {
141208
- const [err, host] = catchError(() => new URL(baseUrl).hostname.toLowerCase());
141209
- if (err || !host)
141210
- return "unknown";
141211
- if (host === "alpha.uipath.com")
141212
- return "alpha";
141213
- if (host === "staging.uipath.com")
141214
- return "staging";
141215
- if (host === "cloud.uipath.com")
141216
- return "cloud";
141217
- return "unknown";
141218
- }
141219
- async function currentKnownEnvironment() {
141220
- const { auth: auth2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
141221
- const [statusErr, status] = await catchError(auth2.getLoginStatus());
141222
- if (statusErr || status.loginStatus !== "Logged in" || !status.baseUrl) {
141223
- return null;
141224
- }
141225
- const env2 = mapAuthorityToEnvironment(status.baseUrl);
141226
- return env2 === "unknown" ? null : env2;
141227
- }
141228
- async function downloadVersions() {
141229
- const { toolService: toolService2 } = await Promise.resolve().then(() => (init_toolService(), exports_toolService));
141230
- const [dlErr, raw] = await catchError(toolService2.downloadPackageFile(VERSIONS_PACKAGE, VERSIONS_FILENAME, {
141231
- timeoutMs: DOWNLOAD_TIMEOUT_MS
141232
- }));
141233
- if (dlErr) {
141234
- logger.debug(`Failed to download ${VERSIONS_FILENAME} from ${VERSIONS_PACKAGE}: ${dlErr.message}`);
141235
- return null;
141236
- }
141237
- const [jsonErr, json3] = catchError(() => JSON.parse(raw));
141238
- if (jsonErr) {
141239
- logger.debug(`Failed to parse ${VERSIONS_FILENAME}: ${jsonErr.message}`);
141240
- return null;
141241
- }
141242
- return json3;
141243
- }
141244
- async function fetchEnvLine(env2) {
141245
- const versions2 = await downloadVersions();
141246
- if (!versions2)
141247
- return null;
141248
- const parsed = VersionsSchema.safeParse(versions2);
141249
- if (!parsed.success) {
141250
- logger.debug("cli-versions.json failed schema validation; skipping");
141251
- return null;
141252
- }
141253
- if (parsed.data.schemaVersion !== undefined && parsed.data.schemaVersion > SUPPORTED_SCHEMA_VERSION) {
141254
- logger.debug(`cli-versions.json schemaVersion ${parsed.data.schemaVersion} is newer than supported ${SUPPORTED_SCHEMA_VERSION}; skipping`);
141255
- return null;
141256
- }
141257
- const line = parsed.data.environments[env2]?.cliVersion;
141258
- if (!line || !majorMinorPinOf(line)) {
141259
- logger.debug(`No usable cliVersion for '${env2}'; skipping`);
141260
- return null;
141261
- }
141262
- return line;
141263
- }
141264
- function cacheFresh(state, env2) {
141265
- return state.envKey === env2 && state.envLineDate === todayLocal();
141266
- }
141267
- async function refreshEnvCacheIfStale() {
141268
- const state = await readState();
141269
- const today = todayLocal();
141270
- if (state.envLineAttemptDate === today) {
141271
- logger.debug("Env refresh skipped: already attempted today (backoff after a failed fetch)");
141272
- return state.envLine ?? null;
141273
- }
141274
- const env2 = await currentKnownEnvironment();
141275
- if (!env2) {
141276
- logger.debug("Env refresh skipped: not logged into a known environment");
141277
- return null;
141278
- }
141279
- if (cacheFresh(state, env2) && state.envLine) {
141280
- logger.debug(`Env line cache fresh (${env2}=${state.envLine}); skipping`);
141281
- return state.envLine;
141282
- }
141283
- if (!await mergeState({ envLineAttemptDate: today })) {
141284
- logger.debug("Env refresh skipped: could not persist the attempt claim (state dir unwritable)");
141285
- return state.envLine ?? null;
141286
- }
141287
- const line = await fetchEnvLine(env2);
141288
- if (!line)
141289
- return null;
141290
- await mergeState({ envLine: line, envLineDate: today, envKey: env2 });
141291
- logger.debug(`Env line cached: ${env2}=${line}`);
141292
- return line;
141293
- }
141294
- async function getEnvLine(env2, allowFetch) {
141295
- const state = await readState();
141296
- if (cacheFresh(state, env2) && state.envLine)
141297
- return state.envLine;
141298
- if (state.envKey === env2 && state.envLine && !allowFetch) {
141299
- return state.envLine;
141300
- }
141301
- if (!allowFetch)
141302
- return null;
141303
- const line = await fetchEnvLine(env2);
141304
- if (!line)
141305
- return state.envKey === env2 ? state.envLine ?? null : null;
141306
- await mergeState({ envLine: line, envLineDate: todayLocal(), envKey: env2 });
141307
- return line;
141308
- }
141309
- async function resolveEffectiveTarget(allowFetch = true) {
141212
+ function resolveEffectiveTarget() {
141310
141213
  const pin = resolvePinnedVersion();
141311
141214
  if (pin) {
141312
141215
  return { pin, frozen: isExactPin(pin), origin: "config" };
141313
141216
  }
141314
- const env2 = await currentKnownEnvironment();
141315
- if (env2) {
141316
- const line = await getEnvLine(env2, allowFetch);
141317
- const envPin = line ? majorMinorPinOf(line) : null;
141318
- if (envPin) {
141319
- return {
141320
- pin: envPin,
141321
- frozen: false,
141322
- origin: "environment",
141323
- envKey: env2
141324
- };
141325
- }
141326
- return {
141327
- pin: null,
141328
- frozen: false,
141329
- origin: "environment",
141330
- envKey: env2,
141331
- envUnresolved: true
141332
- };
141333
- }
141334
141217
  return { pin: null, frozen: false, origin: "latest" };
141335
141218
  }
141336
- var VERSIONS_PACKAGE = "@uipath/cli-meta", VERSIONS_FILENAME = "cli-versions.json", SUPPORTED_SCHEMA_VERSION = 1, DOWNLOAD_TIMEOUT_MS = 8000, VersionsSchema;
141337
141219
  var init_versionTarget = __esm(() => {
141338
- init_src2();
141339
- init_zod();
141340
141220
  init_versionPin();
141341
- init_versionSyncState();
141342
- VersionsSchema = exports_external.object({
141343
- schemaVersion: exports_external.number().optional(),
141344
- environments: exports_external.record(exports_external.string(), exports_external.object({ cliVersion: exports_external.string().min(1) }).passthrough())
141345
- }).passthrough();
141346
141221
  });
141347
141222
 
141348
141223
  // src/commands/tools/update.ts
141349
141224
  function registerUpdateCommand2(toolsCommand, _context, state) {
141350
141225
  toolsCommand.command("update").description("Update installed tools within the active version line").option("--name <scoped-tool-name>", "scoped package name").examples(TOOLS_UPDATE_EXAMPLES).trackedAction(processContext, async (options) => {
141351
- const [targetErr, target] = await catchError(resolveEffectiveTarget(true));
141352
- if (targetErr) {
141353
- OutputFormatter.error({
141354
- Result: RESULTS.Failure,
141355
- Message: `Could not determine the update target: ${targetErr.message}`,
141356
- Instructions: "Re-run `uip tools update`; if it persists, check the log file, or pin a line with `uip config set version <major.minor>` to bypass environment resolution."
141357
- });
141358
- processContext.exit(EXIT_CODES.Failure);
141359
- return;
141360
- }
141361
- if (target.envUnresolved) {
141362
- OutputFormatter.error({
141363
- Result: RESULTS.Failure,
141364
- Message: "Could not resolve your environment's version line.",
141365
- Instructions: "Check your connection and re-run `uip tools update`, or pin a line with `uip config set version <major.minor>` to override the environment."
141366
- });
141367
- processContext.exit(EXIT_CODES.Failure);
141368
- return;
141369
- }
141226
+ const target = resolveEffectiveTarget();
141370
141227
  if (target.frozen && target.pin) {
141371
141228
  const exact = formatVersionPin(target.pin);
141372
141229
  const line = `${target.pin.major}.${target.pin.minor}`;
@@ -141822,16 +141679,13 @@ async function checkCliVersion(opts) {
141822
141679
  return skipped(opts.cliPkgVersion, "dev mode");
141823
141680
  }
141824
141681
  const pin = opts.pin ?? null;
141825
- const [err, latest] = await catchError(pin ? toolService.searchLatestVersion("@uipath/cli", pinnedPrefix(pin), {
141826
- channel: opts.channel,
141827
- timeoutMs: CLI_VERSION_PROBE_TIMEOUT_MS
141828
- }) : toolService.searchLatestVersion("@uipath/cli", undefined, {
141682
+ const [err, latest] = await catchError(toolService.searchLatestVersion("@uipath/cli", pin ? pinnedPrefix(pin) : undefined, {
141829
141683
  channel: opts.channel,
141830
141684
  timeoutMs: CLI_VERSION_PROBE_TIMEOUT_MS
141831
141685
  }));
141832
141686
  if (err) {
141833
141687
  logger.debug(`CLI version probe failed: ${err.message}`);
141834
- return skipped(opts.cliPkgVersion, "network error");
141688
+ return skipped(opts.cliPkgVersion, isNpmViewMetadataError(err) ? err.message : "network error");
141835
141689
  }
141836
141690
  if (!latest) {
141837
141691
  if (pin) {
@@ -141851,6 +141705,15 @@ async function checkCliVersion(opts) {
141851
141705
  }
141852
141706
  return skipped(opts.cliPkgVersion, `no ${opts.channel} version found`);
141853
141707
  }
141708
+ if (!pin && exceedsMajorCeiling(latest, opts.maxMajor)) {
141709
+ return {
141710
+ current: opts.cliPkgVersion,
141711
+ available: latest,
141712
+ action: "none",
141713
+ reason: null,
141714
+ heldBackVersion: latest
141715
+ };
141716
+ }
141854
141717
  const differs = pin ? compareSemver(latest, opts.cliPkgVersion) !== 0 : compareSemver(latest, opts.cliPkgVersion) > 0;
141855
141718
  if (differs) {
141856
141719
  return {
@@ -141867,6 +141730,12 @@ async function checkCliVersion(opts) {
141867
141730
  reason: null
141868
141731
  };
141869
141732
  }
141733
+ function exceedsMajorCeiling(version2, maxMajor) {
141734
+ if (maxMajor === undefined)
141735
+ return false;
141736
+ const major = majorOf(version2);
141737
+ return major !== null && major > maxMajor;
141738
+ }
141870
141739
  function skipped(current, reason) {
141871
141740
  return { current, available: null, action: "skipped", reason };
141872
141741
  }
@@ -141923,7 +141792,8 @@ async function runUpdate(options, state, cliEnv) {
141923
141792
  cliPkgVersion: cliEnv.cliPkgVersion,
141924
141793
  isDev: cliEnv.isDev,
141925
141794
  pin: options.versionPin ?? null,
141926
- pinOrigin: options.versionPinOrigin
141795
+ pinOrigin: options.versionPinOrigin,
141796
+ maxMajor: options.maxMajor
141927
141797
  }) : null;
141928
141798
  let detectedInstallCtx = null;
141929
141799
  const getDetectedInstallCtx = () => {
@@ -142095,25 +141965,7 @@ function registerUpdateCommand3(program2, _context, state) {
142095
141965
  processContext.exit(EXIT_CODES.ValidationError);
142096
141966
  return;
142097
141967
  }
142098
- const [targetErr, target] = await catchError(resolveEffectiveTarget(true));
142099
- if (targetErr) {
142100
- OutputFormatter.error({
142101
- Result: RESULTS.Failure,
142102
- Message: `Could not determine the update target: ${targetErr.message}`,
142103
- Instructions: "Re-run `uip update`; if it persists, check the log file, or pin a line with `uip config set version <major.minor>` to bypass environment resolution."
142104
- });
142105
- processContext.exit(EXIT_CODES.Failure);
142106
- return;
142107
- }
142108
- if (target.envUnresolved) {
142109
- OutputFormatter.error({
142110
- Result: RESULTS.Failure,
142111
- Message: "Could not resolve your environment's version line.",
142112
- Instructions: "Check your connection and re-run `uip update`, or pin a line with `uip config set version <major.minor>` to override the environment."
142113
- });
142114
- processContext.exit(EXIT_CODES.Failure);
142115
- return;
142116
- }
141968
+ const target = resolveEffectiveTarget();
142117
141969
  if (target.frozen && target.pin) {
142118
141970
  const exact = formatVersionPin(target.pin);
142119
141971
  const line = `${target.pin.major}.${target.pin.minor}`;
@@ -142622,6 +142474,53 @@ var init_tool_manager = __esm(() => {
142622
142474
  init_versionPin();
142623
142475
  });
142624
142476
 
142477
+ // src/services/versionSyncState.ts
142478
+ import { randomUUID as randomUUID7 } from "node:crypto";
142479
+ function todayLocal() {
142480
+ const d = new Date;
142481
+ const month = String(d.getMonth() + 1).padStart(2, "0");
142482
+ const day = String(d.getDate()).padStart(2, "0");
142483
+ return `${d.getFullYear()}-${month}-${day}`;
142484
+ }
142485
+ function stateFilePath(fs7) {
142486
+ return fs7.path.join(fs7.env.homedir(), UIPATH_HOME_DIR, STATE_FILENAME);
142487
+ }
142488
+ async function readState(fs7 = getFileSystem()) {
142489
+ const [readErr, raw] = await catchError(fs7.readFile(stateFilePath(fs7), "utf-8"));
142490
+ if (readErr || !raw)
142491
+ return {};
142492
+ const [parseErr, parsed] = catchError(() => JSON.parse(raw));
142493
+ if (parseErr || parsed === null || typeof parsed !== "object") {
142494
+ return {};
142495
+ }
142496
+ const state = {};
142497
+ if (typeof parsed.lastUpdateDate === "string") {
142498
+ state.lastUpdateDate = parsed.lastUpdateDate;
142499
+ }
142500
+ return state;
142501
+ }
142502
+ async function mergeState(patch, fs7 = getFileSystem()) {
142503
+ const current = await readState(fs7);
142504
+ const next = { ...current, ...patch };
142505
+ const target = stateFilePath(fs7);
142506
+ await catchError(fs7.mkdir(fs7.path.dirname(target)));
142507
+ const tempPath = `${target}.${randomUUID7()}.tmp`;
142508
+ const [err] = await catchError((async () => {
142509
+ await fs7.writeFile(tempPath, JSON.stringify(next, null, 2));
142510
+ await fs7.rename(tempPath, target);
142511
+ })());
142512
+ if (err) {
142513
+ await catchError(fs7.rm(tempPath));
142514
+ return false;
142515
+ }
142516
+ return true;
142517
+ }
142518
+ var STATE_FILENAME = "version-sync.json";
142519
+ var init_versionSyncState = __esm(() => {
142520
+ init_src2();
142521
+ init_src();
142522
+ });
142523
+
142625
142524
  // src/services/versionSync.ts
142626
142525
  async function maybeRunDailyVersionSync(context, state) {
142627
142526
  const [err, reexeced] = await catchError(runStartupSync(context, state));
@@ -142631,33 +142530,6 @@ async function maybeRunDailyVersionSync(context, state) {
142631
142530
  }
142632
142531
  return reexeced;
142633
142532
  }
142634
- async function runPostLoginVersionSync(context) {
142635
- if (context.capabilities.isBrowser) {
142636
- logger.debug("Post-login sync skipped: browser environment");
142637
- return;
142638
- }
142639
- if (isTruthyEnv(process.env[DISABLE_ENV])) {
142640
- logger.debug(`Post-login sync skipped: ${DISABLE_ENV} is set`);
142641
- return;
142642
- }
142643
- const verb = extractVerb(context.args);
142644
- if (verb !== "login") {
142645
- logger.debug(`Post-login sync: not a login command (verb=${verb})`);
142646
- return;
142647
- }
142648
- if (extractVerb(context.args, 1) === "status") {
142649
- logger.debug("Post-login sync: read-only `login status`; skipping");
142650
- return;
142651
- }
142652
- if (process.exitCode) {
142653
- logger.debug(`Post-login sync: login failed (exitCode=${String(process.exitCode)}); skipping`);
142654
- return;
142655
- }
142656
- logger.debug("Post-login sync: invalidating sync state for re-check");
142657
- const [err] = await catchError(invalidateSyncState());
142658
- if (err)
142659
- logger.debug(`Post-login state invalidation failed: ${err.message}`);
142660
- }
142661
142533
  async function runStartupSync(context, state) {
142662
142534
  logger.debug("Version sync evaluating (trigger=startup)");
142663
142535
  if (context.capabilities.isBrowser) {
@@ -142695,16 +142567,8 @@ async function runStartupSync(context, state) {
142695
142567
  logger.debug("Version sync skipped: Studio-bundled CLI distribution");
142696
142568
  return false;
142697
142569
  }
142698
- await maybeRefreshEnvCache();
142699
142570
  return runDailyAutoUpdate(state, context);
142700
142571
  }
142701
- async function maybeRefreshEnvCache() {
142702
- if (resolvePinnedVersion()) {
142703
- logger.debug("Env refresh skipped: core.version is pinned");
142704
- return;
142705
- }
142706
- await catchError(refreshEnvCacheIfStale());
142707
- }
142708
142572
  async function runDailyAutoUpdate(state, context) {
142709
142573
  const today = todayLocal();
142710
142574
  const prev = await readState();
@@ -142712,17 +142576,12 @@ async function runDailyAutoUpdate(state, context) {
142712
142576
  logger.debug("Daily auto-update already ran today; skipping");
142713
142577
  return false;
142714
142578
  }
142715
- const target = await resolveEffectiveTarget(false);
142579
+ const target = resolveEffectiveTarget();
142716
142580
  if (target.frozen) {
142717
142581
  await mergeState({ lastUpdateDate: today });
142718
142582
  logger.debug("Daily auto-update skipped: exact pin (frozen)");
142719
142583
  return false;
142720
142584
  }
142721
- if (target.envUnresolved) {
142722
- await mergeState({ lastUpdateDate: today });
142723
- logger.debug("Daily auto-update skipped: environment line unresolved today");
142724
- return false;
142725
- }
142726
142585
  if (!await mergeState({ lastUpdateDate: today })) {
142727
142586
  logger.debug("Daily auto-update skipped: could not persist the day claim (state dir unwritable)");
142728
142587
  return false;
@@ -142730,9 +142589,18 @@ async function runDailyAutoUpdate(state, context) {
142730
142589
  writeSyncStatus(context, "Checking for updates.");
142731
142590
  return applyUpdate(state, context, {
142732
142591
  pin: target.pin,
142733
- origin: target.origin
142592
+ origin: target.origin,
142593
+ ...target.pin ? {} : runningMajorCeiling()
142734
142594
  });
142735
142595
  }
142596
+ function runningMajorCeiling() {
142597
+ const major = majorOf(package_default.version);
142598
+ if (major === null) {
142599
+ logger.debug(`Daily auto-update: no major ceiling (unparseable CLI version '${package_default.version}')`);
142600
+ return {};
142601
+ }
142602
+ return { maxMajor: major };
142603
+ }
142736
142604
  async function applyUpdate(state, context, target) {
142737
142605
  const location = await resolveUpdateLocation(state, context);
142738
142606
  if (!location)
@@ -142753,7 +142621,7 @@ async function resolveUpdateLocation(state, context) {
142753
142621
  }
142754
142622
  async function runUpdateEngine(state, location, context, target) {
142755
142623
  const { runUpdate: runUpdate2 } = await Promise.resolve().then(() => (init_updateService(), exports_updateService));
142756
- writeSyncStatus(context, formatUpdateStartMessage(target.pin));
142624
+ writeSyncStatus(context, formatUpdateStartMessage(target));
142757
142625
  const [updErr, report] = await catchError(runUpdate2({
142758
142626
  dryRun: false,
142759
142627
  channel: resolveChannel(),
@@ -142762,7 +142630,8 @@ async function runUpdateEngine(state, location, context, target) {
142762
142630
  skills: { agent: undefined, local: undefined },
142763
142631
  cli: { self: true },
142764
142632
  versionPin: target.pin,
142765
- versionPinOrigin: target.origin
142633
+ versionPinOrigin: target.origin,
142634
+ maxMajor: target.maxMajor
142766
142635
  }, state, {
142767
142636
  cliPkgVersion: package_default.version,
142768
142637
  isLocal: !location.global,
@@ -142786,6 +142655,10 @@ function finishUpdate(report, context, target) {
142786
142655
  for (const e of report.Errors) {
142787
142656
  logger.debug(`[${e.Subsystem}] ${e.Message} ${e.Instructions}`);
142788
142657
  }
142658
+ const heldBack = report.Cli?.heldBackVersion;
142659
+ if (heldBack) {
142660
+ writeSyncStatus(context, `@uipath/cli ${heldBack} is available but was not installed: the daily update does not cross major versions. Run \`uip update\` to move to it, or \`uip config set version <major.minor>\` to hold a line.`);
142661
+ }
142789
142662
  const cliUpdated = report.Cli?.action === "updated";
142790
142663
  const toolsUpdated = !!report.Tools?.some((t) => t.status === "updated");
142791
142664
  const skillsUpdated = countRefreshedSkills(report) > 0;
@@ -142809,9 +142682,10 @@ function formatInstallLocationFailure(error52) {
142809
142682
  const suffix = error52 ? `: ${error52.message}` : ".";
142810
142683
  return `Update failed: could not resolve the CLI install location${suffix}`;
142811
142684
  }
142812
- function formatUpdateStartMessage(effectivePin) {
142685
+ function formatUpdateStartMessage(target) {
142686
+ const effectivePin = target.pin;
142813
142687
  if (!effectivePin) {
142814
- return "Updating UiPath CLI, tools, and skills.";
142688
+ return target.maxMajor === undefined ? "Updating UiPath CLI, tools, and skills." : `Updating UiPath CLI, tools, and skills within version ${target.maxMajor}.x.`;
142815
142689
  }
142816
142690
  const version2 = effectivePin.patch === undefined ? `${formatVersionPin(effectivePin)}.x` : formatVersionPin(effectivePin);
142817
142691
  return `Updating UiPath CLI, tools, and skills to version ${version2}.`;
@@ -142886,14 +142760,10 @@ function runChild(spawnFn, command, args, env2) {
142886
142760
  child.on("close", (code) => resolve2(code));
142887
142761
  });
142888
142762
  }
142889
- function extractVerb(args, index = 0) {
142890
- let bare = 0;
142763
+ function extractVerb(args) {
142891
142764
  for (const a of stripGlobalOptions(args.slice(2)).args) {
142892
- if (a.startsWith("-"))
142893
- continue;
142894
- if (bare === index)
142765
+ if (!a.startsWith("-"))
142895
142766
  return a;
142896
- bare += 1;
142897
142767
  }
142898
142768
  return;
142899
142769
  }
@@ -143168,7 +143038,6 @@ async function runNode(context) {
143168
143038
  return;
143169
143039
  }
143170
143040
  await parseAndExit(built.program, built.cleanedArgs, context);
143171
- await runPostLoginVersionSync(context);
143172
143041
  }
143173
143042
  var init_cli_node = __esm(() => {
143174
143043
  init_src2();
@@ -143415,4 +143284,4 @@ export {
143415
143284
  ready
143416
143285
  };
143417
143286
 
143418
- //# debugId=696CBF7BE294388A64756E2164756E21
143287
+ //# debugId=2D5871E1AA3D483264756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/cli",
3
3
  "license": "MIT",
4
- "version": "1.200.0",
4
+ "version": "1.200.1",
5
5
  "description": "Cross platform CLI for UiPath",
6
6
  "repository": {
7
7
  "type": "git",
@@ -38,5 +38,5 @@
38
38
  "mihaigirleanu",
39
39
  "vlad-uipath"
40
40
  ],
41
- "gitHead": "173ad4b4930bd3e17a493b32e9f1c3c616ea1c10"
41
+ "gitHead": "0d1695ec4c5fc5ebe38a4bd0f92d61e7884fcfb1"
42
42
  }