"use strict";exports.id=2376,exports.ids=[2376],exports.modules={"./src/commands/cloud-get.ts"(t,n,e){e.a(t,(async(t,o)=>{try{e.r(n),e.d(n,{handleCloudGet:()=>m});var s=e("../proto/dist/generated/aiserver/v1/background_composer_pb.js"),a=e("./src/api-command-auth.ts"),r=e("./src/client.ts"),i=e("./src/console-io.ts"),c=e("./src/commands/cloud-list.ts"),d=e("./src/commands/format-utils.ts"),u=t([a,c]);[a,c]=u.then?(await u)():u;var l=function(t,n,e,o){return new(e||(e=Promise))((function(s,a){function r(t){try{c(o.next(t))}catch(t){a(t)}}function i(t){try{c(o.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?s(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(r,i)}c((o=o.apply(t,n||[])).next())}))};function m(t,n){return l(this,void 0,void 0,(function*(){var e,o;const u=t.trim();0===u.length&&(0,i.uQ)(1,"Cloud agent id must be a non-empty string.");try{const{backendUrl:t}=yield(0,a.E)(n.credentialManager,{endpoint:n.endpoint,apiKey:n.apiKey,authToken:n.authToken}),l=yield(0,r.BK)(n.credentialManager,t,n.configProvider)(),m=yield l.listBackgroundComposers(new s.ListBackgroundComposersRequest({n:1,bcId:u,includeStatus:!0,includeArchived:!0})),p=m.composers[0];p||(0,i.uQ)(1,`Cloud agent not found: ${u}`);const f=(0,c.toJsonComposer)(p);if("UNSPECIFIED"===f.status||p.isArchived||m.didLoadStatus||(0,i.uQ)(1,"Cloud agent status is unavailable in this environment (did_load_status=false)."),"json"===(null!==(e=n.format)&&void 0!==e?e:"json"))return void(0,i.OT)(JSON.stringify(f));const h=[`ID: ${f.bcId}`,`STATUS: ${f.status}`,`NAME: ${f.name||"-"}`,`REPO: ${f.repoUrl||"-"}`,`BRANCH: ${f.branchName||"-"}`,`PR: ${f.prUrl||"-"}`,`CREATED: ${(0,d.fw)(f.createdAtMs)}`,`UPDATED: ${(0,d.fw)(f.updatedAtMs)}`,`SOURCE: ${f.source}`,"ARCHIVED: "+(f.isArchived?"yes":"no"),"KILLED: "+(f.isKilled?"yes":"no"),`MODEL: ${null!==(o=f.modelName)&&void 0!==o?o:"-"}`,`CHANGES: ${(0,c.formatComposerStats)(p)}`];(0,i.OT)(h.join("\n"))}catch(n){(0,i.uQ)(1,`Failed to fetch cloud agent "${t}": ${n instanceof Error?n.message:String(n)}`)}}))}o()}catch(p){o(p)}}))}};