"use strict";exports.id=279,exports.ids=[279],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=(0,r.c3)(n.credentialManager,t,n.configProvider),m=yield l.listBackgroundComposers(new s.D3X({n:1,bcId:u,includeStatus:!0,includeArchived:!0})),f=m.composers[0];f||(0,i.uQ)(1,`Cloud agent not found: ${u}`);const p=(0,c.toJsonComposer)(f);if("UNSPECIFIED"===p.status||f.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(p));const h=[`ID: ${p.bcId}`,`STATUS: ${p.status}`,`NAME: ${p.name||"-"}`,`REPO: ${p.repoUrl||"-"}`,`BRANCH: ${p.branchName||"-"}`,`PR: ${p.prUrl||"-"}`,`CREATED: ${(0,d.fw)(p.createdAtMs)}`,`UPDATED: ${(0,d.fw)(p.updatedAtMs)}`,`SOURCE: ${p.source}`,"ARCHIVED: "+(p.isArchived?"yes":"no"),"KILLED: "+(p.isKilled?"yes":"no"),`MODEL: ${null!==(o=p.modelName)&&void 0!==o?o:"-"}`,`CHANGES: ${(0,c.formatComposerStats)(f)}`];(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(f){o(f)}}))}};