@entrydesk/cli 2.2.0-beta.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/{add-QRCNes33.js → add-CliIFCt0.js} +1 -1
- package/dist/{agents-C6_4nYx3.js → agents-DZ5MMNgm.js} +1 -1
- package/dist/{billing-B52QpxBo.js → billing-BVg9kb_L.js} +1 -1
- package/dist/{budget-CCZUSzQX.js → budget-BA_V5uWx.js} +1 -1
- package/dist/{build-task-request-config-D1BoTQ_r.js → build-task-request-config-DpENRUKp.js} +1 -1
- package/dist/{commands-DT40svYr.js → commands-Be9x6Mn2.js} +1 -1
- package/dist/{commands-OQF1wQ6Z.js → commands-D7DwcYwS.js} +1 -1
- package/dist/{config-DRasb4uc.js → config-BhMlE1Tn.js} +1 -1
- package/dist/{connectors-CGdm_hGV.js → connectors-Cvzw7qlZ.js} +1 -1
- package/dist/{file-upload-DuXlHqyj.js → file-upload-CdLxxBH8.js} +1 -1
- package/dist/{format-C0MI0rzh.js → format-C0gQh0-a.js} +1 -1
- package/dist/index.js +18 -18
- package/dist/{instruction-OdStaJMu.js → instruction-b-Qrs68S.js} +1 -1
- package/dist/{login-BJK-C-yF.js → login-BZ-nQu3d.js} +1 -1
- package/dist/{logout-b335WkA6.js → logout-BWkZBnD-.js} +1 -1
- package/dist/{marketplace-B5HXnl23.js → marketplace-DgwQPDeN.js} +1 -1
- package/dist/{mcp-hLbWIery.js → mcp-C_O_23sO.js} +1 -1
- package/dist/{mcp-client-mMhJPPZN.js → mcp-client-B8MmdXBG.js} +1 -1
- package/dist/{meeting-2Z2c7Ppj.js → meeting-DzVRhcfg.js} +1 -1
- package/dist/{message-utils-BHtHL44l.js → message-utils-CcBgWZ5t.js} +1 -1
- package/dist/{models-Cd725_l2.js → models-BxuwtAxX.js} +1 -1
- package/dist/{notifications-D1-iA_h8.js → notifications-DqQYkVSS.js} +1 -1
- package/dist/{paginate-y3CJuqRW.js → paginate-cPRCZh55.js} +1 -1
- package/dist/{paths-CIj_zxDF.js → paths-C8hkD2dC.js} +1 -1
- package/dist/{profile-B1Jui2gr.js → profile-B8nE-j1O.js} +1 -1
- package/dist/{profile-storage-BPBUFvA6.js → profile-storage-Cr7deOY9.js} +1 -1
- package/dist/{project-DwR8Pf3y.js → project-BxVdJtOP.js} +1 -1
- package/dist/{project-context-CiI3hHaT.js → project-context-BqEcMdlw.js} +1 -1
- package/dist/{project-governance-OVpv9LXv.js → project-governance-QB_gZDCX.js} +1 -1
- package/dist/{project-sources-CtSvnInR.js → project-sources-Blt3VJJN.js} +1 -1
- package/dist/{project-sources-write-BaWV2jtH.js → project-sources-write-CVrDTztH.js} +1 -1
- package/dist/{project-tasks-BKdZe3qu.js → project-tasks-BfkQKohb.js} +1 -1
- package/dist/{push-CMRb7H6f.js → push-vRsxRNBH.js} +1 -1
- package/dist/{recordings-Bz6wVqBM.js → recordings-zh5XEAev.js} +1 -1
- package/dist/{remove-B7p4PV6f.js → remove-Nz6GWS0F.js} +1 -1
- package/dist/{resolve-DdZsf3QT.js → resolve-KMh83zHX.js} +1 -1
- package/dist/{resource-grants-HDU2bPhQ.js → resource-grants-fNkgsqvv.js} +1 -1
- package/dist/{schedules-DrzGEvSR.js → schedules-CQuymYZT.js} +1 -1
- package/dist/{skills-CdcBhRxn.js → skills-D09C16xt.js} +1 -1
- package/dist/{status-wTfceoHq.js → status-BXYEKkJH.js} +1 -1
- package/dist/{status-p4tJRN-I.js → status-CUeNgSAa.js} +1 -1
- package/dist/{task-CyuwUFin.js → task-rOOgtJCU.js} +1 -1
- package/dist/{tasks-B0x5P4UU.js → tasks-EFh2RjvH.js} +1 -1
- package/dist/{tasks-BpqBNtta.js → tasks-Z1gITmPI.js} +1 -1
- package/dist/{team-R67MPRfp.js → team-CMQsRjEv.js} +1 -1
- package/dist/{teams-DvACXgpt.js → teams-CmycEyf1.js} +1 -1
- package/dist/{token-Diy_e8pF.js → token-h7XXxssb.js} +1 -1
- package/dist/{tool-CFaX5Q8e.js → tool-xATD3WTo.js} +1 -1
- package/dist/update-DApkxaRa.js +10 -0
- package/dist/{usage-audit-D65sU87J.js → usage-audit-Ds7ucnal.js} +1 -1
- package/dist/{usage-Bv04bmPn.js → usage-k9CiuTSU.js} +1 -1
- package/dist/{version-BFfQldMJ.js → version-DLXK4Ntd.js} +1 -1
- package/dist/{webhook-h1JuRyJf.js → webhook-WYUHbChD.js} +1 -1
- package/dist/{workflow-CrOwbORs.js → workflow-B0QZjfU5.js} +1 -1
- package/dist/{workspaces-CJP3Q8wV.js → workspaces-DBEB_gl6.js} +1 -1
- package/package.json +1 -1
- package/dist/update-CvHLQuTu.js +0 -10
|
@@ -7,7 +7,7 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{G as e,Ht as t,K as n,W as r,fn as i,ht as a,jn as o,un as s}from"./profile-storage-
|
|
10
|
+
import{G as e,Ht as t,K as n,W as r,fn as i,ht as a,jn as o,un as s}from"./profile-storage-Cr7deOY9.js";import{n as c,r as l}from"./terminal-text-cBPBiP3x.js";import{a as u,r as d,t as f}from"./format-C0gQh0-a.js";import p from"node:os";import m from"node:path";import h from"node:fs/promises";function g(e){return e.status===`failed`&&(e.errorMessage?.startsWith(`The sandbox restarted while the command was running`)??!1)}function _(e){return o(e)&&e.type===`data-tool-run-start`}function v(e,t,n){return e?Math.max(0,((t?Date.parse(t):n)-Date.parse(e))/1e3):null}function y(e,t){switch(e){case`running`:return t===`—`?`running`:`running · ${t}`;case`unknown`:return`status unknown`;default:return e}}function b(e,t=`—`){if(e.status===`completed`){if(e.timedOut)return`timed out`;if(e.outputLimitExceeded)return`output limit exceeded`;if(e.exitCode!==null&&e.exitCode!==0)return`exit ${e.exitCode}`}return g(e)?`interrupted`:y(e.status,t)}function x(e){switch(e.status){case`queued`:return`Starting soon.`;case`completed`:return e.timedOut?`The command ran past its time limit and was stopped.`:e.outputLimitExceeded?`The output exceeded the size limit and the command was stopped.`:e.exitCode!==null&&e.exitCode!==0?`The command finished but returned a non-zero exit code.`:void 0;case`failed`:return g(e)?`Interrupted: the sandbox restarted while the command was running. It may have run only partly; check its effects before running it again.`:e.errorMessage??void 0;case`cancelled`:return`Stopped as requested.`;case`unknown`:return`Could not confirm whether the command ran or stopped; the sandbox may need checking.`;default:return}}function S(e,t){if(e.kind!==`tool`)return`${e.kind} · ${e.status}`;let n=f(v(e.startedAt,null,t));return`tool · ${y(e.status,n)}`}function C(e,t){let n=f(e.status===`running`||e.completedAt?v(e.startedAt,e.completedAt,t):null),r=b(e,n);return e.status===`running`||n===`—`?r:`${r} · ${n}`}function w(e,t,n){let r=new Set(e.map(e=>e.runId));return[...e.map(e=>({runId:e.runId,kind:e.kind,label:e.label,status:S(e,n)})),...t.filter(e=>!r.has(e.runId)).map(e=>({runId:e.runId,kind:e.kind,label:e.description??e.toolName,status:`tool · ${C(e,n)}`}))]}function T(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function E(e){return e?l(e.replace(/\n$/,``)).split(`
|
|
11
11
|
`).map(e=>` ${e}`):[` (empty)`]}function D(e,t){let n=[`Tool run ${c(e.runId)}`,`$ ${c(e.description??e.toolName)}`,`Status: ${C(e,t)}`];e.startedAt&&n.push(`Started: ${d(e.startedAt)}`);let r=x(e);if(r&&n.push(c(r)),e.status===`running`)e.liveTail?(n.push(``,`stdout (live):`,...E(e.liveTail.stdout)),n.push(`stderr (live):`,...E(e.liveTail.stderr))):n.push(``,`Output is temporarily unavailable.`),n.push(``,`Live output: press i on this run in /runs to refresh.`);else{for(let[t,r]of[[`stdout`,e.stdout],[`stderr`,e.stderr]])r&&n.push(``,`${t} (${T(r.bytes)}, last part):`,...E(r.tail));e.fullOutputAvailable&&n.push(``,`Full output: press o on this run in /runs.`)}return(e.status===`queued`||e.status===`running`)&&n.push(`Stop: press Enter on this run in /runs.`),n.join(`
|
|
12
12
|
`)}async function O(e){try{await h.mkdir(e,{mode:448})}catch(e){if(!o(e)||e.code!==`EEXIST`)throw e}let t=await h.lstat(e),n=process.getuid?.();if(!t.isDirectory()||n!==void 0&&t.uid!==n)throw Error(`${e} is not a directory owned by you`);t.mode&63&&await h.chmod(e,448)}async function k(e,t,n){let r=m.join(p.tmpdir(),`entrydesk`),i=m.join(r,`tool-runs`);await O(r),await O(i);let a=m.join(i,`${m.basename(e)}.${t}.txt`);return await h.writeFile(a,n,{mode:384}),await h.chmod(a,384),a}function A(e,t){let n={stdout:t.stdout?Buffer.byteLength(t.stdout.text):0,stderr:t.stderr?Buffer.byteLength(t.stderr.text):0},r=r=>t[r]!==null&&n[r]<(e[r]?.bytes??0),i=[`${[`stdout`,`stderr`].every(n=>!e[n]?.bytes||t[n]!==null&&!r(n))?`Full output`:`Output`} of ${c(e.runId)}`,`$ ${c(e.description??e.toolName)}`];for(let a of[`stdout`,`stderr`]){let o=t[a];if(o){let t=o.text.replace(/\n$/,``).split(`
|
|
13
13
|
`),s=t.slice(-50);i.push(``,r(a)?`${a} saved to ${c(o.path)}, showing the last ${T(n[a])} of ${T(e[a]?.bytes??0)}`:`${a} saved to ${c(o.path)}`,t.length>s.length?`last ${s.length} of ${t.length} lines:`:`${u(t.length,`line`)}:`,...E(s.join(`
|
|
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{C as e,p as t}from"./profile-storage-
|
|
10
|
+
import{C as e,p as t}from"./profile-storage-Cr7deOY9.js";import{t as n}from"./terminal-text-cBPBiP3x.js";function r(e){return e===`saas`?{resolvesFrom:`model tiers`,note:`A task picks a tier (lite / pro / max) and the platform-default tier row decides the concrete model — but not always: a workspace with additional models enabled, or one on a subscription-pool model, can pin a concrete model id that resolves from its own rows and bypasses the tier mapping entirely.`}:{resolvesFrom:`this workspace's own rows`,note:`A task picks either a tier slug or a concrete model id. Tier rows are read per workspace and never fall back to the platform defaults, so changing a platform tier does not reach this workspace.`}}async function i(e){try{return await e()}catch(e){return{error:e instanceof Error?e.message:String(e)}}}function a(e){return` ${e.tier.padEnd(14)} → ${e.model?.id??`(no row)`}`}function o(e){if(`notExposed`in e){console.log(` Tier mappings: not exposed on SaaS — the public tier API strips the backing model id.`);return}if(`error`in e){console.log(` Tier mappings: unavailable (${e.error})`);return}if(e.tiers.length===0){console.log(` Tier mappings: none`);return}console.log(` Tier mappings (${e.tiers.length}):`);for(let t of e.tiers)console.log(a(t))}async function s(a){let{accessToken:s,workspaceId:c}=await t(),l=new e,{deploymentMode:u}=await l.getRuntimeConfig(),{resolvesFrom:d,note:f}=r(u),p=u===`saas`?Promise.resolve({notExposed:!0}):i(()=>l.getModelTierMappings(s,c)),[m,h]=await Promise.all([p,i(()=>l.getModels(s,c))]);if(a.json){console.log(n({deploymentMode:u,resolvesFrom:d,mappings:m,concrete:h}));return}console.log(`Model configuration
|
|
11
11
|
`),console.log(` Deployment mode: ${u}`),console.log(` Selection resolves from: ${d}`),console.log(` ${f}\n`),o(m),console.log(`error`in h?` Concrete models: unavailable (${h.error})`:` Concrete models available: ${h.models.length}`)}async function c(r){if(r.config){await s(r);return}let{accessToken:i,workspaceId:a}=await t(),{models:o}=await new e().listSelectableModels(i,a);if(r.json){console.log(n(o));return}if(o.length===0){console.log(`No models available in this workspace.`);return}console.log(`Available models (${o.length}):\n`);for(let e of o)console.log(` ${e.name}`),e.description&&console.log(` ${e.description.slice(0,80)}`),console.log(` ID: ${e.id}`),console.log(``)}export{c as runModels};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{C as e,p as t}from"./profile-storage-
|
|
10
|
+
import{C as e,p as t}from"./profile-storage-Cr7deOY9.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import{r}from"./format-C0gQh0-a.js";import{t as i}from"./paginate-cPRCZh55.js";function a(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function o(e){console.log(`Notifications (${e.length}):\n`);for(let t of e){let e=t.readAt?` `:`●`;console.log(` ${e} [${t.category}] ${t.rendered.title}`),t.rendered.body&&console.log(` ${a(t.rendered.body,100)}`);let n=r(t.createdAt);console.log(` ${n} · ${t.eventType} · ID: ${t.id}`),console.log(``)}}async function s(r){let{accessToken:a,workspaceId:s}=await t(),c=new e,l={tab:r.tab,eventType:r.eventType};if(r.all){let e=await i(async e=>{let t=await c.getNotifications(a,s,{...l,limit:r.limit??20,cursor:e});return{items:t.items,nextKey:t.nextKey}});if(r.json){console.log(n({items:e}));return}if(e.length===0){console.log(`No notifications.`);return}o(e);return}let{items:u,nextKey:d}=await c.getNotifications(a,s,{...l,limit:r.limit,cursor:r.nextKey});if(r.json){console.log(n({items:u,nextKey:d}));return}if(u.length===0){console.log(`No notifications.`);return}o(u),d&&console.log(`Next page: --next-key ${d}`)}async function c(r){let{accessToken:i,workspaceId:a}=await t(),{count:o,capped:s}=await new e().getNotificationUnreadCount(i,a);if(r.json){console.log(n({count:o,capped:s??!1}));return}console.log(`${s?`${o}+`:o} unread`)}async function l(r,i){let{accessToken:a,workspaceId:o}=await t();if(await new e().markNotificationRead(a,o,r),i.json){console.log(n({id:r,read:!0}));return}console.log(`Marked notification read: ${r}`)}async function u(r){let{accessToken:i,workspaceId:a}=await t();if(await new e().markAllNotificationsRead(i,a),r.json){console.log(n({readAll:!0}));return}console.log(`Marked all notifications read.`)}export{s as listNotifications,u as markAllNotificationsRead,l as markNotificationRead,c as showUnreadCount};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{r as e}from"./profile-storage-
|
|
10
|
+
import{r as e}from"./profile-storage-Cr7deOY9.js";async function t(t){let n=[],r;for(let i=0;;i++){if(i>=100)throw new e(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`);let a=await t(r);if(n.push(...a.items),r=a.nextKey,!r)return n}}export{t};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{L as e}from"./profile-storage-
|
|
10
|
+
import{L as e}from"./profile-storage-Cr7deOY9.js";import t from"node:fs";import n from"node:os";import r from"node:path";import{windowsReservedNameRegex as i}from"filename-reserved-regex";const a=`.entrydesk`;function o(){return{version:1,skills:{}}}function s(e){return r.join(e,a,`skills-lock.json`)}function c(e){try{let n=JSON.parse(t.readFileSync(s(e),`utf8`));return n.version!==1||typeof n.skills!=`object`||n.skills===null?o():n}catch{return o()}}function l(e,n){let i={};for(let e of Object.keys(n.skills).toSorted()){let t=n.skills[e];t&&(i[e]=t)}let a={version:1,...n.workspaceId?{workspaceId:n.workspaceId}:{},skills:i},o=s(e);t.mkdirSync(r.dirname(o),{recursive:!0}),t.writeFileSync(o,`${JSON.stringify(a,null,2)}\n`,`utf8`)}function u(e,t){return c(e).skills[t]}function d(e,t,n){let r=c(e);r.skills[t]=n,l(e,r)}function f(e,t){let n=c(e);if(!(t in n.skills))return!1;let{[t]:r,...i}=n.skills;return l(e,{...n,skills:i}),!0}function p(e){try{let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.workspaceId!=`string`||n.workspaceId===``?void 0:n}catch{return}}function m(e,n){t.mkdirSync(r.dirname(e),{recursive:!0}),t.writeFileSync(e,`${JSON.stringify(n,null,2)}\n`,`utf8`)}function h(e){return t.existsSync(e)?(t.rmSync(e),!0):!1}function g(e){return r.join(e,a,`project.json`)}function _(){return r.join(n.homedir(),a,`global-link.json`)}function v(){return p(_())}function y(e){m(_(),e)}function b(){return h(_())}function x(e=process.cwd()){let n=r.resolve(e);for(;;){if(t.existsSync(g(n)))return n;let e=r.dirname(n);if(e===n)return;n=e}}function S(e){return p(g(e))}function C(e,t){m(g(e),t)}function w(e){return h(g(e))}function T(e=process.cwd()){let t=x(e);if(!t)return;let n=S(t);return n?{rootDir:t,link:n}:void 0}async function E(t){let n=await e();if(t&&n&&t!==n)throw Error(`This directory is linked to a workspace on ${t}, but the active profile points at ${n}. Re-run 'entrydesk skills link' or switch profile.`)}function D(){process.env.ENTRYDESK_API_URL&&console.error(`Note: the recorded apiUrl comes from the ENTRYDESK_API_URL environment variable. This link pins the directory to that API — if the override was temporary, re-run the link without it.`)}async function O(e,t){if(e){let e=n.homedir(),r=v();return r?(await E(r.apiUrl),{rootDir:e,workspaceId:r.workspaceId,linked:!0}):{rootDir:e,workspaceId:t,linked:!1}}let r=T(process.cwd());return r?(await E(r.link.apiUrl),{rootDir:r.rootDir,workspaceId:r.link.workspaceId,linked:!0}):{rootDir:process.cwd(),workspaceId:t,linked:!1}}const k=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function A(e){if(!k.test(e))throw Error(`Invalid skill name "${e}": must be lowercase letters, digits and single hyphens (e.g. "my-skill").`)}function j(e,t){A(t);let n=r.resolve(e,`.entrydesk`,`skills`),i=r.resolve(n,t);if(i!==r.join(n,t)||!i.startsWith(n+r.sep))throw Error(`Refusing unsafe skill path for "${t}".`);return i}function M(e,t){let n=j(e,t);if(i().test(t))throw Error(`Invalid skill name "${t}": reserved as a device name on Windows.`);return n}function N(e,t){return process.platform!==`win32`&&u(e,t)!==void 0?j(e,t):M(e,t)}export{D as a,g as c,y as d,C as f,d as g,f as h,O as i,b as l,c as m,j as n,x as o,u as p,N as r,_ as s,A as t,w as u};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{B as e,D as t,V as n,r,t as i}from"./profile-storage-
|
|
10
|
+
import{B as e,D as t,V as n,r,t as i}from"./profile-storage-Cr7deOY9.js";import{t as a}from"./terminal-text-cBPBiP3x.js";function o(e,t){let n=e??t.profile;if(n)return n;let a=i.getProfileNames(),[o]=a;if(a.length===1&&o!==void 0)return o;throw new r(`Profile name is required when multiple profiles exist.`)}function s(e,t){let r=n(e,t);r&&console.error(r)}function c(e){let t=i.getCurrentProfileName(),n=i.getProfileNames();if(e.json){console.log(a({currentProfile:t,profiles:n.map(e=>({name:e,isCurrent:e===t}))}));return}console.log(`Profiles (${n.length}):`);for(let e of n)console.log(` ${e}${e===t?` (current)`:``}`)}function l(e){let t=i.getCurrentProfileName();if(e.json){console.log(a({name:t,isCurrent:!0}));return}console.log(`Current profile: ${t}`)}async function u(n,r){let s=o(n,r),c=e.getAll(s),l=await t.getAll(s),u=!!l?.accessToken,d=s===i.getCurrentProfileName();if(r.json){console.log(a({name:s,isCurrent:d,config:c,auth:u?{loggedIn:!0,email:l?.email??null,workspaceId:l?.workspaceId??null}:{loggedIn:!1}}));return}console.log(`Profile: ${s}${d?` (current)`:``}`),console.log(` API URL: ${c.apiUrl??`default`}`),console.log(` Hub URL: ${c.hubUrl??`default`}`),console.log(` Model: ${c.model?.default??`unset`}`);let f=c.connectors?.defaults&&c.connectors.defaults.length>0?c.connectors.defaults.join(`, `):`unset`;console.log(` Connectors: ${f}`),console.log(u?` Logged in as: ${l?.email??`unknown`}`:` Not logged in`),u&&l?.workspaceId&&console.log(` Workspace ID: ${l.workspaceId}`)}async function d(t,n){let r=t??n.profile??i.DEFAULT_PROFILE,o=n.use??!0,c={...n.apiUrl&&{apiUrl:n.apiUrl},...n.hubUrl&&{hubUrl:n.hubUrl}};i.createProfile(r),e.setAll(c,r),c.apiUrl&&s(`apiUrl`,c.apiUrl),o&&i.setCurrentProfile(r);let l={name:r,created:!0,current:o,config:c};if(n.json||(console.log(`Profile created: ${r}${o?` (current)`:``}`),c.apiUrl&&console.log(` API URL: ${c.apiUrl}`),c.hubUrl&&console.log(` Hub URL: ${c.hubUrl}`)),!n.login){n.json&&console.log(a(l));return}i.setOverrideProfile(r);let{performLogin:u,printLoginResult:d}=await import(`./login-BZ-nQu3d.js`),f=await u(n);n.json?console.log(a({...l,login:f})):d(f,n)}function f(e,t){let n=o(e,t);if(i.setCurrentProfile(n),t.json){console.log(a({name:n,current:!0}));return}console.log(`Switched to profile: ${n}`)}async function p(e,n){let r=o(e,n),s=i.deleteProfile(r);if(await t.deleteProfileCredentials(r),n.json){console.log(a({deleted:r,currentProfile:s.currentProfile}));return}console.log(`Profile deleted: ${r}`),console.log(`Current profile: ${s.currentProfile}`)}async function m(e,n,r){let o=i.renameProfile(e,n);if(await t.moveProfileCredentials(e,n),r.json){console.log(a({renamed:e,name:n,currentProfile:o.currentProfile}));return}console.log(`Profile renamed: ${e} -> ${n}`),console.log(`Current profile: ${o.currentProfile}`)}async function h(n,r,o){let s=e.getAll(n);if(i.createProfile(r),e.setAll(s,r),await t.clear(r),o.json){console.log(a({source:n,name:r,cloned:!0}));return}console.log(`Profile cloned: ${n} -> ${r}`)}function g(t,n){let r=i.getEffectiveProfileName(n.profile),o=e.get(t,r);if(n.json){console.log(a({profile:r,[t]:o??null}));return}console.log(o||`Not set`)}function _(t,n,r){let a=i.getEffectiveProfileName(r.profile);e.set(t,n,a),console.log(`Set ${t}=${n}`),console.error(`(profile: ${a})`),s(t,n)}function v(t,n){let r=i.getEffectiveProfileName(n.profile);e.unset(t,r),console.log(`Unset ${t}`),console.error(`(profile: ${r})`)}export{h as cloneProfile,d as createProfile,p as deleteProfile,g as getProfileValue,c as listProfiles,m as renameProfile,_ as setProfileValue,l as showCurrentProfile,u as showProfile,v as unsetProfileValue,f as useProfile};
|