@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.
Files changed (58) hide show
  1. package/README.md +9 -0
  2. package/dist/{add-QRCNes33.js → add-CliIFCt0.js} +1 -1
  3. package/dist/{agents-C6_4nYx3.js → agents-DZ5MMNgm.js} +1 -1
  4. package/dist/{billing-B52QpxBo.js → billing-BVg9kb_L.js} +1 -1
  5. package/dist/{budget-CCZUSzQX.js → budget-BA_V5uWx.js} +1 -1
  6. package/dist/{build-task-request-config-D1BoTQ_r.js → build-task-request-config-DpENRUKp.js} +1 -1
  7. package/dist/{commands-DT40svYr.js → commands-Be9x6Mn2.js} +1 -1
  8. package/dist/{commands-OQF1wQ6Z.js → commands-D7DwcYwS.js} +1 -1
  9. package/dist/{config-DRasb4uc.js → config-BhMlE1Tn.js} +1 -1
  10. package/dist/{connectors-CGdm_hGV.js → connectors-Cvzw7qlZ.js} +1 -1
  11. package/dist/{file-upload-DuXlHqyj.js → file-upload-CdLxxBH8.js} +1 -1
  12. package/dist/{format-C0MI0rzh.js → format-C0gQh0-a.js} +1 -1
  13. package/dist/index.js +18 -18
  14. package/dist/{instruction-OdStaJMu.js → instruction-b-Qrs68S.js} +1 -1
  15. package/dist/{login-BJK-C-yF.js → login-BZ-nQu3d.js} +1 -1
  16. package/dist/{logout-b335WkA6.js → logout-BWkZBnD-.js} +1 -1
  17. package/dist/{marketplace-B5HXnl23.js → marketplace-DgwQPDeN.js} +1 -1
  18. package/dist/{mcp-hLbWIery.js → mcp-C_O_23sO.js} +1 -1
  19. package/dist/{mcp-client-mMhJPPZN.js → mcp-client-B8MmdXBG.js} +1 -1
  20. package/dist/{meeting-2Z2c7Ppj.js → meeting-DzVRhcfg.js} +1 -1
  21. package/dist/{message-utils-BHtHL44l.js → message-utils-CcBgWZ5t.js} +1 -1
  22. package/dist/{models-Cd725_l2.js → models-BxuwtAxX.js} +1 -1
  23. package/dist/{notifications-D1-iA_h8.js → notifications-DqQYkVSS.js} +1 -1
  24. package/dist/{paginate-y3CJuqRW.js → paginate-cPRCZh55.js} +1 -1
  25. package/dist/{paths-CIj_zxDF.js → paths-C8hkD2dC.js} +1 -1
  26. package/dist/{profile-B1Jui2gr.js → profile-B8nE-j1O.js} +1 -1
  27. package/dist/{profile-storage-BPBUFvA6.js → profile-storage-Cr7deOY9.js} +1 -1
  28. package/dist/{project-DwR8Pf3y.js → project-BxVdJtOP.js} +1 -1
  29. package/dist/{project-context-CiI3hHaT.js → project-context-BqEcMdlw.js} +1 -1
  30. package/dist/{project-governance-OVpv9LXv.js → project-governance-QB_gZDCX.js} +1 -1
  31. package/dist/{project-sources-CtSvnInR.js → project-sources-Blt3VJJN.js} +1 -1
  32. package/dist/{project-sources-write-BaWV2jtH.js → project-sources-write-CVrDTztH.js} +1 -1
  33. package/dist/{project-tasks-BKdZe3qu.js → project-tasks-BfkQKohb.js} +1 -1
  34. package/dist/{push-CMRb7H6f.js → push-vRsxRNBH.js} +1 -1
  35. package/dist/{recordings-Bz6wVqBM.js → recordings-zh5XEAev.js} +1 -1
  36. package/dist/{remove-B7p4PV6f.js → remove-Nz6GWS0F.js} +1 -1
  37. package/dist/{resolve-DdZsf3QT.js → resolve-KMh83zHX.js} +1 -1
  38. package/dist/{resource-grants-HDU2bPhQ.js → resource-grants-fNkgsqvv.js} +1 -1
  39. package/dist/{schedules-DrzGEvSR.js → schedules-CQuymYZT.js} +1 -1
  40. package/dist/{skills-CdcBhRxn.js → skills-D09C16xt.js} +1 -1
  41. package/dist/{status-wTfceoHq.js → status-BXYEKkJH.js} +1 -1
  42. package/dist/{status-p4tJRN-I.js → status-CUeNgSAa.js} +1 -1
  43. package/dist/{task-CyuwUFin.js → task-rOOgtJCU.js} +1 -1
  44. package/dist/{tasks-B0x5P4UU.js → tasks-EFh2RjvH.js} +1 -1
  45. package/dist/{tasks-BpqBNtta.js → tasks-Z1gITmPI.js} +1 -1
  46. package/dist/{team-R67MPRfp.js → team-CMQsRjEv.js} +1 -1
  47. package/dist/{teams-DvACXgpt.js → teams-CmycEyf1.js} +1 -1
  48. package/dist/{token-Diy_e8pF.js → token-h7XXxssb.js} +1 -1
  49. package/dist/{tool-CFaX5Q8e.js → tool-xATD3WTo.js} +1 -1
  50. package/dist/update-DApkxaRa.js +10 -0
  51. package/dist/{usage-audit-D65sU87J.js → usage-audit-Ds7ucnal.js} +1 -1
  52. package/dist/{usage-Bv04bmPn.js → usage-k9CiuTSU.js} +1 -1
  53. package/dist/{version-BFfQldMJ.js → version-DLXK4Ntd.js} +1 -1
  54. package/dist/{webhook-h1JuRyJf.js → webhook-WYUHbChD.js} +1 -1
  55. package/dist/{workflow-CrOwbORs.js → workflow-B0QZjfU5.js} +1 -1
  56. package/dist/{workspaces-CJP3Q8wV.js → workspaces-DBEB_gl6.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/update-CvHLQuTu.js +0 -10
package/README.md CHANGED
@@ -22,6 +22,15 @@ entrydesk update --check # only check, don't install
22
22
  entrydesk update --json # machine-readable result
23
23
  ```
24
24
 
25
+ A stable install compares itself with the `latest` dist-tag. A beta install
26
+ (`npm install -g @entrydesk/cli@beta`, any prerelease version) compares itself
27
+ with both `beta` and `latest` and installs whichever is newer, so it moves to
28
+ the stable release once that overtakes the beta. `update` never installs a
29
+ version older than the one you have. `--check` and `--json` show the channel
30
+ (`latest` or `beta`) and the version each dist-tag points to: in `--json`,
31
+ `candidates` holds the dist-tags and `latest` is the newest of them, the version
32
+ `update` installs.
33
+
25
34
  ## Quick Start
26
35
 
27
36
  Build and run from the repo:
@@ -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-BPBUFvA6.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,d as r,f as i,g as a,i as o,r as s}from"./paths-CIj_zxDF.js";import{t as c}from"./hash-92fWniGT.js";import{r as l}from"./installer-CKB3jBE-.js";import{t as u}from"./remote-D3JMUBbh.js";import d from"node:fs";import f from"node:os";import p from"node:path";import m from"cross-spawn";function h(e,t){let n=p.dirname(e);d.mkdirSync(n,{recursive:!0});let r=d.mkdtempSync(p.join(n,`.${p.basename(e)}.tmp-`)),i=p.join(r,`next`),a=p.join(r,`prev`);d.mkdirSync(i,{recursive:!0});let o=!1;try{t(i),d.existsSync(e)&&(d.renameSync(e,a),o=!0),d.renameSync(i,e)}catch(t){throw o&&!d.existsSync(e)&&d.renameSync(a,e),t}finally{d.rmSync(r,{recursive:!0,force:!0})}}const g=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,_=/^([\w.-]+)\/([\w.-]+)(?:\/(.+))?$/u;function v(e){return e===`~`?f.homedir():e.startsWith(`~/`)||e.startsWith(`~\\`)?p.join(f.homedir(),e.slice(2)):e}function y(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||e.startsWith(`~`)||e.startsWith(`.\\`)||/^[a-zA-Z]:[\\/]/u.test(e)}function b(e){let[,t,n,r,i]=/^https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/tree\/([^/]+)(?:\/(.+))?)?\/?$/u.exec(e)??[];return t===void 0||n===void 0?null:{type:`github`,owner:t,repo:n,gitRef:r,subpath:i,url:`https://github.com/${t}/${n}`}}function x(e){let t=e.trim();if(y(t))return{type:`local`,path:p.resolve(v(t))};if(t.startsWith(`ed:`)){let e=t.slice(3);return{type:`entrydesk`,ref:e,isId:g.test(e)}}if(g.test(t))return{type:`entrydesk`,ref:t,isId:!0};if(t.startsWith(`git@`)||t.endsWith(`.git`))return{type:`git`,url:t};let n=b(t);if(n)return n;if(/^https?:\/\//u.test(t))return{type:`git`,url:t};let[,r,i,a]=_.exec(t)??[];return r!==void 0&&i!==void 0?{type:`github`,owner:r,repo:i,subpath:a,url:`https://github.com/${r}/${i}`}:{type:`entrydesk`,ref:t,isId:!1}}function S(e){return e.type===`github`?`github`:e.type}const C=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`.entrydesk`]);function w(e,t){if(!d.existsSync(p.join(e,`SKILL.md`)))throw Error(`No SKILL.md found at ${e}`);let n=d.realpathSync(e);if(n===(d.existsSync(t)?d.realpathSync(t):p.resolve(t)))return;let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-local-skill-`)),i=p.join(r,`skill`);try{d.cpSync(n,i,{recursive:!0,filter:e=>!C.has(p.basename(e))}),h(t,e=>{d.cpSync(i,e,{recursive:!0})})}finally{d.rmSync(r,{recursive:!0,force:!0})}}function T(e){try{let t=d.readFileSync(p.join(e,`SKILL.md`),`utf8`),n=/^name:\s*(.+?)\s*$/mu.exec(t.split(/^---\s*$/mu)[1]??``);if(n?.[1])return n[1].replace(/^['"]|['"]$/gu,``)}catch{}return p.basename(e)}async function E(e,t){let{default:n}=await import(`adm-zip`),r=new n(e);h(t,e=>{let t=p.resolve(e)+p.sep;for(let n of r.getEntries()){if(n.isDirectory)continue;let r=p.resolve(e,n.entryName);if(!r.startsWith(t))throw Error(`Zip entry contains path traversal: ${n.entryName}`);d.mkdirSync(p.dirname(r),{recursive:!0}),d.writeFileSync(r,n.getData())}})}async function D(e,t){if(t.isId)return t.ref;let n=(await u(e.client,e.accessToken,e.workspaceId)).find(e=>e.name===t.ref||e.id===t.ref);if(!n)throw Error(`Skill not found in workspace: ${t.ref}`);return n.id}function O(e,t,n){let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-npx-skills-`)),i=[`-y`,`skills@1.5.12`,`add`,e,`--copy`,`--yes`];try{let e=m.sync(`npx`,i,{cwd:r,stdio:n?[`ignore`,`pipe`,`pipe`]:`inherit`});if(e.error)throw e.error;if(e.status!==0){let t=e.stderr?.toString().trim();throw Error(`npx exited with code ${e.status??`null`}${t?`: ${t}`:``}`)}}catch(t){throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills failed for ${e}. Ensure npx + network are available. (${t instanceof Error?t.message:String(t)})`,{cause:t})}let a=p.join(r,`.agents`,`skills`);if(!d.existsSync(a))throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills produced no skills under ${a}`);let o=d.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()),[s]=o;if(s===void 0)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed no skill directory`);let c=s;if(o.length>1){let e=t.type===`github`&&t.subpath?p.basename(t.subpath):void 0,n=e?o.find(t=>t.name===e):void 0;if(!n)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed [${o.map(e=>e.name).join(`, `)}]; ${e?`none matched the subpath "${e}"`:`specify a subpath to pick one`}.`);c=n}return{dir:p.join(a,c.name),tmpRoot:r}}async function k(u,f,p){let m=x(u),h=!!f.global,g=await o(h,p.workspaceId),_=g.rootDir,v={...p,workspaceId:g.workspaceId};if(!g.linked){let t={workspaceId:p.workspaceId,apiUrl:await e()};n(),h?r(t):i(process.cwd(),t)}let y,b,C;if(m.type===`entrydesk`){b=await D(v,m);let e=await v.client.downloadSkillCurrent(v.accessToken,v.workspaceId,b);y=e.name,C=s(_,y);let t=await fetch(e.url);if(!t.ok)throw Error(`Failed to download ${y}: ${t.status}`);await E(Buffer.from(await t.arrayBuffer()),C)}else if(m.type===`local`)y=T(m.path),C=s(_,y),w(m.path,C);else{let{dir:e,tmpRoot:t}=O(u,m,!!f.json);try{y=T(e),C=s(_,y),w(e,C)}finally{d.rmSync(t,{recursive:!0,force:!0})}}let k=c(C),A={source:u,sourceType:S(m),skillId:b,localHash:k,lastPulledHash:m.type===`entrydesk`?k:``,mode:`symlink`,...m.type===`github`?{sourceUrl:m.url,ref:m.gitRef,subpath:m.subpath}:{},...m.type===`git`?{sourceUrl:m.url}:{}};a(_,y,A);let j=l(C,y,_,`symlink`,f.agent);f.json?console.info(t({name:y,sourceType:S(m),hash:k},2)):console.info(`✓ added ${y} (${m.type}, ${k.slice(0,12)}) → agents: ${j.map(e=>e.agentId).join(`, `)}`)}export{k as runSkillsAdd};
10
+ import{L as e}from"./profile-storage-Cr7deOY9.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,d as r,f as i,g as a,i as o,r as s}from"./paths-C8hkD2dC.js";import{t as c}from"./hash-92fWniGT.js";import{r as l}from"./installer-CKB3jBE-.js";import{t as u}from"./remote-D3JMUBbh.js";import d from"node:fs";import f from"node:os";import p from"node:path";import m from"cross-spawn";function h(e,t){let n=p.dirname(e);d.mkdirSync(n,{recursive:!0});let r=d.mkdtempSync(p.join(n,`.${p.basename(e)}.tmp-`)),i=p.join(r,`next`),a=p.join(r,`prev`);d.mkdirSync(i,{recursive:!0});let o=!1;try{t(i),d.existsSync(e)&&(d.renameSync(e,a),o=!0),d.renameSync(i,e)}catch(t){throw o&&!d.existsSync(e)&&d.renameSync(a,e),t}finally{d.rmSync(r,{recursive:!0,force:!0})}}const g=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,_=/^([\w.-]+)\/([\w.-]+)(?:\/(.+))?$/u;function v(e){return e===`~`?f.homedir():e.startsWith(`~/`)||e.startsWith(`~\\`)?p.join(f.homedir(),e.slice(2)):e}function y(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||e.startsWith(`~`)||e.startsWith(`.\\`)||/^[a-zA-Z]:[\\/]/u.test(e)}function b(e){let[,t,n,r,i]=/^https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/tree\/([^/]+)(?:\/(.+))?)?\/?$/u.exec(e)??[];return t===void 0||n===void 0?null:{type:`github`,owner:t,repo:n,gitRef:r,subpath:i,url:`https://github.com/${t}/${n}`}}function x(e){let t=e.trim();if(y(t))return{type:`local`,path:p.resolve(v(t))};if(t.startsWith(`ed:`)){let e=t.slice(3);return{type:`entrydesk`,ref:e,isId:g.test(e)}}if(g.test(t))return{type:`entrydesk`,ref:t,isId:!0};if(t.startsWith(`git@`)||t.endsWith(`.git`))return{type:`git`,url:t};let n=b(t);if(n)return n;if(/^https?:\/\//u.test(t))return{type:`git`,url:t};let[,r,i,a]=_.exec(t)??[];return r!==void 0&&i!==void 0?{type:`github`,owner:r,repo:i,subpath:a,url:`https://github.com/${r}/${i}`}:{type:`entrydesk`,ref:t,isId:!1}}function S(e){return e.type===`github`?`github`:e.type}const C=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`.entrydesk`]);function w(e,t){if(!d.existsSync(p.join(e,`SKILL.md`)))throw Error(`No SKILL.md found at ${e}`);let n=d.realpathSync(e);if(n===(d.existsSync(t)?d.realpathSync(t):p.resolve(t)))return;let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-local-skill-`)),i=p.join(r,`skill`);try{d.cpSync(n,i,{recursive:!0,filter:e=>!C.has(p.basename(e))}),h(t,e=>{d.cpSync(i,e,{recursive:!0})})}finally{d.rmSync(r,{recursive:!0,force:!0})}}function T(e){try{let t=d.readFileSync(p.join(e,`SKILL.md`),`utf8`),n=/^name:\s*(.+?)\s*$/mu.exec(t.split(/^---\s*$/mu)[1]??``);if(n?.[1])return n[1].replace(/^['"]|['"]$/gu,``)}catch{}return p.basename(e)}async function E(e,t){let{default:n}=await import(`adm-zip`),r=new n(e);h(t,e=>{let t=p.resolve(e)+p.sep;for(let n of r.getEntries()){if(n.isDirectory)continue;let r=p.resolve(e,n.entryName);if(!r.startsWith(t))throw Error(`Zip entry contains path traversal: ${n.entryName}`);d.mkdirSync(p.dirname(r),{recursive:!0}),d.writeFileSync(r,n.getData())}})}async function D(e,t){if(t.isId)return t.ref;let n=(await u(e.client,e.accessToken,e.workspaceId)).find(e=>e.name===t.ref||e.id===t.ref);if(!n)throw Error(`Skill not found in workspace: ${t.ref}`);return n.id}function O(e,t,n){let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-npx-skills-`)),i=[`-y`,`skills@1.5.12`,`add`,e,`--copy`,`--yes`];try{let e=m.sync(`npx`,i,{cwd:r,stdio:n?[`ignore`,`pipe`,`pipe`]:`inherit`});if(e.error)throw e.error;if(e.status!==0){let t=e.stderr?.toString().trim();throw Error(`npx exited with code ${e.status??`null`}${t?`: ${t}`:``}`)}}catch(t){throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills failed for ${e}. Ensure npx + network are available. (${t instanceof Error?t.message:String(t)})`,{cause:t})}let a=p.join(r,`.agents`,`skills`);if(!d.existsSync(a))throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills produced no skills under ${a}`);let o=d.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()),[s]=o;if(s===void 0)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed no skill directory`);let c=s;if(o.length>1){let e=t.type===`github`&&t.subpath?p.basename(t.subpath):void 0,n=e?o.find(t=>t.name===e):void 0;if(!n)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed [${o.map(e=>e.name).join(`, `)}]; ${e?`none matched the subpath "${e}"`:`specify a subpath to pick one`}.`);c=n}return{dir:p.join(a,c.name),tmpRoot:r}}async function k(u,f,p){let m=x(u),h=!!f.global,g=await o(h,p.workspaceId),_=g.rootDir,v={...p,workspaceId:g.workspaceId};if(!g.linked){let t={workspaceId:p.workspaceId,apiUrl:await e()};n(),h?r(t):i(process.cwd(),t)}let y,b,C;if(m.type===`entrydesk`){b=await D(v,m);let e=await v.client.downloadSkillCurrent(v.accessToken,v.workspaceId,b);y=e.name,C=s(_,y);let t=await fetch(e.url);if(!t.ok)throw Error(`Failed to download ${y}: ${t.status}`);await E(Buffer.from(await t.arrayBuffer()),C)}else if(m.type===`local`)y=T(m.path),C=s(_,y),w(m.path,C);else{let{dir:e,tmpRoot:t}=O(u,m,!!f.json);try{y=T(e),C=s(_,y),w(e,C)}finally{d.rmSync(t,{recursive:!0,force:!0})}}let k=c(C),A={source:u,sourceType:S(m),skillId:b,localHash:k,lastPulledHash:m.type===`entrydesk`?k:``,mode:`symlink`,...m.type===`github`?{sourceUrl:m.url,ref:m.gitRef,subpath:m.subpath}:{},...m.type===`git`?{sourceUrl:m.url}:{}};a(_,y,A);let j=l(C,y,_,`symlink`,f.agent);f.json?console.info(t({name:y,sourceType:S(m),hash:k},2)):console.info(`✓ added ${y} (${m.type}, ${k.slice(0,12)}) → agents: ${j.map(e=>e.agentId).join(`, `)}`)}export{k as runSkillsAdd};
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{$t as e,C as t,O as n,Qt as r,St as i,Yt as a,k as o,nn as s,p as c,r as l,rn as u,xt as d}from"./profile-storage-BPBUFvA6.js";import{n as f,t as p}from"./file-upload-DuXlHqyj.js";import{n as m,t as h}from"./terminal-text-cBPBiP3x.js";import{t as g}from"./resource-grants-HDU2bPhQ.js";import{HTTPError as _}from"ky";const v=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function y(t){return t?u([...new Set(t)]):e}function b(e){console.log(`Available agents (${e.length}):\n`);for(let t of e){if(console.log(` ${t.name} (${t.visibility})`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ID: ${t.id}`),console.log(``)}}function x(e){console.log(`My agents (${e.length}):\n`);for(let t of e){let e=[];t.latestVersionNumber!=null&&e.push(`v${t.latestVersionNumber}`),t.hasUnpublishedChanges&&e.push(`unpublished changes`);let n=e.length>0?` (${e.join(` · `)})`:``;if(console.log(` ${t.name}${n}`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ${t.myRole??`no-role`} · ID: ${t.id}`),console.log(``)}}function S(e){if(console.log(`${e.name}\n`),console.log(` ID: ${e.id}`),e.visibility&&console.log(` Visibility: ${e.visibility}`),e.model&&console.log(` Model: ${e.model.name}`),e.author&&console.log(` Author: ${e.author.name}${e.author.isMe?` (you)`:``}`),e.description&&console.log(` Description: ${e.description}`),e.capabilities){let t=s(e.capabilities).map(e=>i(e));t.length>0&&console.log(` Capabilities: ${t.join(`, `)}`)}e.connectors&&e.connectors.length>0&&console.log(` Connectors: ${e.connectors.map(e=>e.name).join(`, `)}`),e.tools&&e.tools.length>0&&console.log(` Tools: ${e.tools.length}`),e.conversationStarters&&e.conversationStarters.length>0&&console.log(` Starters: ${e.conversationStarters.length}`),e.systemPrompt&&console.log(`\n System prompt:\n${e.systemPrompt}`)}async function C(e){let{accessToken:n,workspaceId:r}=await c(),i=new t;if(e.mine){let t=[],a=e.all?void 0:e.nextKey;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getMyAgents(n,r,{limit:e.limit,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!e.all||!a)break}if(e.json){console.log(h({agents:t,nextKey:a}));return}if(t.length===0){console.log("You own no agents in this workspace. Create one with `entrydesk agents create --name <name> …`, or browse `entrydesk marketplace`.");return}x(t),!e.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(e.all){let t=[],a;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getAgents(n,r,{limit:e.limit??100,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!a)break}if(e.json){console.log(h({agents:t}));return}if(t.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(t);return}let{agents:a,nextKey:o}=await i.getAgents(n,r,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(h({agents:a,nextKey:o}));return}if(a.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(a),o&&console.log(`Next page: --next-key ${o}`)}async function w(e,n){let{accessToken:r,workspaceId:i}=await c(),a=await new t().getAgent(r,i,e);if(n.json){console.log(h(a));return}S(a)}async function T(e){let{accessToken:n,workspaceId:r}=await c(),i=await new t().createAgent(n,r,{name:e.name,description:e.description,systemPrompt:e.systemPrompt,modelId:e.modelId,connectorIds:e.connectorIds??[],capabilities:y(e.capabilities),conversationStarters:e.conversationStarters??[],tools:e.tools,iconId:e.iconId});if(e.json){console.log(h(i));return}console.log(`Created agent: ${i.name}`),console.log(` ID: ${i.id}`)}function E(e,t){return{name:t.name??e.name,description:t.description??e.description,systemPrompt:t.systemPrompt??e.systemPrompt??``,modelId:t.modelId??e.model?.id??``,connectorIds:t.connectorIds??e.connectors?.map(e=>e.id)??[],capabilities:t.capabilities?y(t.capabilities):e.capabilities??{},conversationStarters:t.conversationStarters??e.conversationStarters??[],tools:t.tools??e.tools??[],iconId:t.iconId??e.iconId}}async function D(e,n){let{accessToken:r,workspaceId:i}=await c(),a=new t,o=await a.getAgent(r,i,e);await a.updateAgent(r,i,e,E(o,n)),console.log(`Updated agent: ${e}`)}async function O(e){let t=o(e),n;try{n=await f(e,{maxBytes:d})}catch(e){if(!(e instanceof p))throw e;switch(e.problem){case`missing`:throw new l(`No file at ${t}.`);case`not_a_file`:throw new l(`${t} is not a regular file.`);case`too_large`:throw new l(`${t} is larger than ${d/1024/1024}MB, the agent icon limit.`);case`unreadable`:throw new l(`Could not read ${t}. Check its permissions.`)}}if(!v.has(n.mimeType))throw new l(`${t} is not a supported icon image. Use a PNG, JPEG, GIF, or WebP file (.png, .jpg, .jpeg, .gif, .webp).`);return n}async function k(e){let{accessToken:n,workspaceId:r}=await c(),i=new t;return{client:i,accessToken:n,workspaceId:r,agent:e?await i.getAgent(n,r,e):void 0}}async function A({client:e,accessToken:t,workspaceId:r},i,a){let o=await e.getAgentHeadVersionId(t,r,i),s=await e.getAgent(t,r,i);try{await e.updateAgent(t,r,i,{...E(s,{iconId:a}),expectedHeadVersionId:o})}catch(e){throw e instanceof _&&n(e.data)===`agent_version_conflict`?new l(`Agent ${i} was changed by someone else while the icon was being made, so it was not applied. Apply it with \`entrydesk agents update ${i} --icon-id ${a}\`.`):e}}async function j(e,t,n){let{agent:r}=e;if(r&&await A(e,r.id,t.iconId),n.json){console.log(h({...t,agentId:r?.id}));return}if(console.log(`Icon ID: ${t.iconId}`),console.log(`URL: ${m(t.url)}`),r){console.log(`\nApplied the icon to agent: ${m(r.name)} (${r.id})`);return}console.log(`\nApply it with \`entrydesk agents update <agentId> --icon-id ${t.iconId}\`.`)}async function M(e,t){if(!e&&(!t.name?.trim()||!t.description?.trim()))throw new l(`Pass --name and --description, or an agentId to generate the icon from that agent.`);let n=await k(e),r=t.name??n.agent?.name??``,i=t.description??(n.agent?.description.trim()?n.agent.description:n.agent?.systemPrompt??``);if(!r.trim()||!i.trim())throw new l(`Agent ${e} has no ${r.trim()?`description or system prompt`:`name`} to generate an icon from. Pass --name and --description.`);await j(n,await n.client.generateAgentIcon(n.accessToken,n.workspaceId,{name:r,description:i}),t)}async function N(e,t,n){let r=await O(e),i=await k(t);await j(i,await i.client.uploadAgentIcon(i.accessToken,i.workspaceId,r),n)}async function P(e){let{accessToken:n,workspaceId:r}=await c();await new t().deleteAgent(n,r,e),console.log(`Deleted agent: ${e}`)}async function F(e,t,n,r){let i;do{let a=await e.getMyAgents(t,n,{nextKey:i}),o=a.agents.find(e=>e.id===r);if(o)return o;i=a.nextKey}while(i)}function I(e){return{resource:{collection:`agents`,id:e},label:`agent`,publishResourceType:r.AGENT,findEditable:(t,n,r)=>F(t,n,r,e)}}async function L(e,t){await g(I(e),{...t,addWorkspace:!0,role:a.VIEWER})}async function R(e,t){await g(I(e),t)}export{T as createAgent,P as deleteAgent,M as generateAgentIcon,C as listAgents,L as publishAgent,R as shareAgent,w as showAgent,D as updateAgent,N as uploadAgentIcon};
10
+ import{$t as e,C as t,O as n,Qt as r,St as i,Yt as a,k as o,nn as s,p as c,r as l,rn as u,xt as d}from"./profile-storage-Cr7deOY9.js";import{n as f,t as p}from"./file-upload-CdLxxBH8.js";import{n as m,t as h}from"./terminal-text-cBPBiP3x.js";import{t as g}from"./resource-grants-fNkgsqvv.js";import{HTTPError as _}from"ky";const v=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function y(t){return t?u([...new Set(t)]):e}function b(e){console.log(`Available agents (${e.length}):\n`);for(let t of e){if(console.log(` ${t.name} (${t.visibility})`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ID: ${t.id}`),console.log(``)}}function x(e){console.log(`My agents (${e.length}):\n`);for(let t of e){let e=[];t.latestVersionNumber!=null&&e.push(`v${t.latestVersionNumber}`),t.hasUnpublishedChanges&&e.push(`unpublished changes`);let n=e.length>0?` (${e.join(` · `)})`:``;if(console.log(` ${t.name}${n}`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ${t.myRole??`no-role`} · ID: ${t.id}`),console.log(``)}}function S(e){if(console.log(`${e.name}\n`),console.log(` ID: ${e.id}`),e.visibility&&console.log(` Visibility: ${e.visibility}`),e.model&&console.log(` Model: ${e.model.name}`),e.author&&console.log(` Author: ${e.author.name}${e.author.isMe?` (you)`:``}`),e.description&&console.log(` Description: ${e.description}`),e.capabilities){let t=s(e.capabilities).map(e=>i(e));t.length>0&&console.log(` Capabilities: ${t.join(`, `)}`)}e.connectors&&e.connectors.length>0&&console.log(` Connectors: ${e.connectors.map(e=>e.name).join(`, `)}`),e.tools&&e.tools.length>0&&console.log(` Tools: ${e.tools.length}`),e.conversationStarters&&e.conversationStarters.length>0&&console.log(` Starters: ${e.conversationStarters.length}`),e.systemPrompt&&console.log(`\n System prompt:\n${e.systemPrompt}`)}async function C(e){let{accessToken:n,workspaceId:r}=await c(),i=new t;if(e.mine){let t=[],a=e.all?void 0:e.nextKey;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getMyAgents(n,r,{limit:e.limit,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!e.all||!a)break}if(e.json){console.log(h({agents:t,nextKey:a}));return}if(t.length===0){console.log("You own no agents in this workspace. Create one with `entrydesk agents create --name <name> …`, or browse `entrydesk marketplace`.");return}x(t),!e.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(e.all){let t=[],a;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getAgents(n,r,{limit:e.limit??100,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!a)break}if(e.json){console.log(h({agents:t}));return}if(t.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(t);return}let{agents:a,nextKey:o}=await i.getAgents(n,r,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(h({agents:a,nextKey:o}));return}if(a.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(a),o&&console.log(`Next page: --next-key ${o}`)}async function w(e,n){let{accessToken:r,workspaceId:i}=await c(),a=await new t().getAgent(r,i,e);if(n.json){console.log(h(a));return}S(a)}async function T(e){let{accessToken:n,workspaceId:r}=await c(),i=await new t().createAgent(n,r,{name:e.name,description:e.description,systemPrompt:e.systemPrompt,modelId:e.modelId,connectorIds:e.connectorIds??[],capabilities:y(e.capabilities),conversationStarters:e.conversationStarters??[],tools:e.tools,iconId:e.iconId});if(e.json){console.log(h(i));return}console.log(`Created agent: ${i.name}`),console.log(` ID: ${i.id}`)}function E(e,t){return{name:t.name??e.name,description:t.description??e.description,systemPrompt:t.systemPrompt??e.systemPrompt??``,modelId:t.modelId??e.model?.id??``,connectorIds:t.connectorIds??e.connectors?.map(e=>e.id)??[],capabilities:t.capabilities?y(t.capabilities):e.capabilities??{},conversationStarters:t.conversationStarters??e.conversationStarters??[],tools:t.tools??e.tools??[],iconId:t.iconId??e.iconId}}async function D(e,n){let{accessToken:r,workspaceId:i}=await c(),a=new t,o=await a.getAgent(r,i,e);await a.updateAgent(r,i,e,E(o,n)),console.log(`Updated agent: ${e}`)}async function O(e){let t=o(e),n;try{n=await f(e,{maxBytes:d})}catch(e){if(!(e instanceof p))throw e;switch(e.problem){case`missing`:throw new l(`No file at ${t}.`);case`not_a_file`:throw new l(`${t} is not a regular file.`);case`too_large`:throw new l(`${t} is larger than ${d/1024/1024}MB, the agent icon limit.`);case`unreadable`:throw new l(`Could not read ${t}. Check its permissions.`)}}if(!v.has(n.mimeType))throw new l(`${t} is not a supported icon image. Use a PNG, JPEG, GIF, or WebP file (.png, .jpg, .jpeg, .gif, .webp).`);return n}async function k(e){let{accessToken:n,workspaceId:r}=await c(),i=new t;return{client:i,accessToken:n,workspaceId:r,agent:e?await i.getAgent(n,r,e):void 0}}async function A({client:e,accessToken:t,workspaceId:r},i,a){let o=await e.getAgentHeadVersionId(t,r,i),s=await e.getAgent(t,r,i);try{await e.updateAgent(t,r,i,{...E(s,{iconId:a}),expectedHeadVersionId:o})}catch(e){throw e instanceof _&&n(e.data)===`agent_version_conflict`?new l(`Agent ${i} was changed by someone else while the icon was being made, so it was not applied. Apply it with \`entrydesk agents update ${i} --icon-id ${a}\`.`):e}}async function j(e,t,n){let{agent:r}=e;if(r&&await A(e,r.id,t.iconId),n.json){console.log(h({...t,agentId:r?.id}));return}if(console.log(`Icon ID: ${t.iconId}`),console.log(`URL: ${m(t.url)}`),r){console.log(`\nApplied the icon to agent: ${m(r.name)} (${r.id})`);return}console.log(`\nApply it with \`entrydesk agents update <agentId> --icon-id ${t.iconId}\`.`)}async function M(e,t){if(!e&&(!t.name?.trim()||!t.description?.trim()))throw new l(`Pass --name and --description, or an agentId to generate the icon from that agent.`);let n=await k(e),r=t.name??n.agent?.name??``,i=t.description??(n.agent?.description.trim()?n.agent.description:n.agent?.systemPrompt??``);if(!r.trim()||!i.trim())throw new l(`Agent ${e} has no ${r.trim()?`description or system prompt`:`name`} to generate an icon from. Pass --name and --description.`);await j(n,await n.client.generateAgentIcon(n.accessToken,n.workspaceId,{name:r,description:i}),t)}async function N(e,t,n){let r=await O(e),i=await k(t);await j(i,await i.client.uploadAgentIcon(i.accessToken,i.workspaceId,r),n)}async function P(e){let{accessToken:n,workspaceId:r}=await c();await new t().deleteAgent(n,r,e),console.log(`Deleted agent: ${e}`)}async function F(e,t,n,r){let i;do{let a=await e.getMyAgents(t,n,{nextKey:i}),o=a.agents.find(e=>e.id===r);if(o)return o;i=a.nextKey}while(i)}function I(e){return{resource:{collection:`agents`,id:e},label:`agent`,publishResourceType:r.AGENT,findEditable:(t,n,r)=>F(t,n,r,e)}}async function L(e,t){await g(I(e),{...t,addWorkspace:!0,role:a.VIEWER})}async function R(e,t){await g(I(e),t)}export{T as createAgent,P as deleteAgent,M as generateAgentIcon,C as listAgents,L as publishAgent,R as shareAgent,w as showAgent,D as updateAgent,N as uploadAgentIcon};
@@ -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,x as n}from"./profile-storage-BPBUFvA6.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i,n as a}from"./format-C0MI0rzh.js";import{t as o}from"./paginate-y3CJuqRW.js";function s(e,t){let n=e.purchased[t]+e.granted[t];return`${t} ${e.assigned[t]}/${n}`}function c(e){if(console.log(`Billing status: ${e.lifecycle.kind}`),e.subscription){let t=e.subscription,n=t.nextInvoiceDueAt?` · next invoice ${new Date(t.nextInvoiceDueAt).toLocaleDateString()}`:``;console.log(` Plan: ${t.planName} · ~${i(t.estimatedMonthlyChargeUsd)}/month${n}`)}else console.log(` Plan: (no active subscription)`);let t=e.seats;console.log(` Seats: ${s(t,`pro`)}, ${s(t,`premium`)} (assigned/capacity)`),t.totalGranted>0&&console.log(` Granted: pro ${t.granted.pro}, premium ${t.granted.premium} (not billed)`);let n=e.extraUsage;console.log(` Balance: ${i(n.balanceUsd)} extra usage`),console.log(` Spent: ${a(n.currentSpentUsd)} this period`),n.monthlyExtraUsageLimitUsd!=null&&console.log(` Limit: ${i(n.monthlyExtraUsageLimitUsd)} / month`)}function l(e){console.log(`Invoices (${e.length}):\n`);for(let t of e){let e=new Date(t.billingDate).toLocaleDateString();console.log(` ${e} · ${t.type} · ${t.status} · ${i(t.totalUsd)}`),t.hostedInvoiceUrl&&console.log(` ${t.hostedInvoiceUrl}`),console.log(` ID: ${t.id}`),console.log(``)}}async function u(){return n()&&(console.error("Billing requires an interactive login. A workspace PAT (ENTRYDESK_TOKEN) cannot read billing — run `entrydesk login`."),process.exit(1)),t()}async function d(t){let{accessToken:n,workspaceId:i}=await u(),a=await new e().getBillingOverview(n,i);if(t.json){console.log(r(a));return}c(a)}async function f(t){let{accessToken:n,workspaceId:i}=await u(),a=new e;if(t.all){let e=await o(async e=>{let r=await a.getBillingInvoices(n,i,{limit:t.limit??20,nextKey:e});return{items:r.invoices,nextKey:r.nextKey}});if(t.json){console.log(r({invoices:e}));return}if(e.length===0){console.log(`No invoices.`);return}l(e);return}let{invoices:s,nextKey:c}=await a.getBillingInvoices(n,i,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(r({invoices:s,nextKey:c}));return}if(s.length===0){console.log(`No invoices.`);return}l(s),c&&console.log(`Next page: --next-key ${c}`)}export{f as listInvoices,d as showBillingStatus};
10
+ import{C as e,p as t,x as n}from"./profile-storage-Cr7deOY9.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i,n as a}from"./format-C0gQh0-a.js";import{t as o}from"./paginate-cPRCZh55.js";function s(e,t){let n=e.purchased[t]+e.granted[t];return`${t} ${e.assigned[t]}/${n}`}function c(e){if(console.log(`Billing status: ${e.lifecycle.kind}`),e.subscription){let t=e.subscription,n=t.nextInvoiceDueAt?` · next invoice ${new Date(t.nextInvoiceDueAt).toLocaleDateString()}`:``;console.log(` Plan: ${t.planName} · ~${i(t.estimatedMonthlyChargeUsd)}/month${n}`)}else console.log(` Plan: (no active subscription)`);let t=e.seats;console.log(` Seats: ${s(t,`pro`)}, ${s(t,`premium`)} (assigned/capacity)`),t.totalGranted>0&&console.log(` Granted: pro ${t.granted.pro}, premium ${t.granted.premium} (not billed)`);let n=e.extraUsage;console.log(` Balance: ${i(n.balanceUsd)} extra usage`),console.log(` Spent: ${a(n.currentSpentUsd)} this period`),n.monthlyExtraUsageLimitUsd!=null&&console.log(` Limit: ${i(n.monthlyExtraUsageLimitUsd)} / month`)}function l(e){console.log(`Invoices (${e.length}):\n`);for(let t of e){let e=new Date(t.billingDate).toLocaleDateString();console.log(` ${e} · ${t.type} · ${t.status} · ${i(t.totalUsd)}`),t.hostedInvoiceUrl&&console.log(` ${t.hostedInvoiceUrl}`),console.log(` ID: ${t.id}`),console.log(``)}}async function u(){return n()&&(console.error("Billing requires an interactive login. A workspace PAT (ENTRYDESK_TOKEN) cannot read billing — run `entrydesk login`."),process.exit(1)),t()}async function d(t){let{accessToken:n,workspaceId:i}=await u(),a=await new e().getBillingOverview(n,i);if(t.json){console.log(r(a));return}c(a)}async function f(t){let{accessToken:n,workspaceId:i}=await u(),a=new e;if(t.all){let e=await o(async e=>{let r=await a.getBillingInvoices(n,i,{limit:t.limit??20,nextKey:e});return{items:r.invoices,nextKey:r.nextKey}});if(t.json){console.log(r({invoices:e}));return}if(e.length===0){console.log(`No invoices.`);return}l(e);return}let{invoices:s,nextKey:c}=await a.getBillingInvoices(n,i,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(r({invoices:s,nextKey:c}));return}if(s.length===0){console.log(`No invoices.`);return}l(s),c&&console.log(`Next page: --next-key ${c}`)}export{f as listInvoices,d as showBillingStatus};
@@ -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-BPBUFvA6.js";import{t as n}from"./terminal-text-cBPBiP3x.js";async function r(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().getBudget(i,a);if(r.json){console.log(n(o));return}if(o.budget===null){console.log(`No budget set for this workspace.`);return}console.log(`Current workspace budget: $${o.budget}`)}async function i(r,i){let{accessToken:a,workspaceId:o}=await t(),s=new e;if(await s.updateBudget(a,o,r),i.json){console.log(n(await s.getBudget(a,o)));return}console.log(`Budget updated: $${r}`)}async function a(r){let{accessToken:i,workspaceId:a}=await t(),o=new e;if(await o.updateBudget(i,a,null),r.json){console.log(n(await o.getBudget(i,a)));return}console.log(`Budget cleared.`)}export{a as clearBudget,i as setBudget,r as showBudget};
10
+ import{C as e,p as t}from"./profile-storage-Cr7deOY9.js";import{t as n}from"./terminal-text-cBPBiP3x.js";async function r(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().getBudget(i,a);if(r.json){console.log(n(o));return}if(o.budget===null){console.log(`No budget set for this workspace.`);return}console.log(`Current workspace budget: $${o.budget}`)}async function i(r,i){let{accessToken:a,workspaceId:o}=await t(),s=new e;if(await s.updateBudget(a,o,r),i.json){console.log(n(await s.getBudget(a,o)));return}console.log(`Budget updated: $${r}`)}async function a(r){let{accessToken:i,workspaceId:a}=await t(),o=new e;if(await o.updateBudget(i,a,null),r.json){console.log(n(await o.getBudget(i,a)));return}console.log(`Budget cleared.`)}export{a as clearBudget,i as setBudget,r as showBudget};
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{Kt as e,Tt as t,qt as n,wt as r}from"./profile-storage-BPBUFvA6.js";function i({allowedTools:e,disallowedTools:n}){if(!(!e?.length&&!n?.length))return[...t(e?.map(e=>({toolName:e,policy:r.ALWAYS_ALLOW})),n?.map(e=>({toolName:e,policy:r.BLOCK})))].map(([e,t])=>({toolName:e,policy:t}))}function a(e,n){let i=[...n].map(e=>({toolName:e,policy:r.ALWAYS_ALLOW}));return i.length===0?e:[...t(e,i)].map(([e,t])=>({toolName:e,policy:t}))}function o({agentId:t,model:r,projectId:i,pinnedConnectorIds:a,clientTools:o,clientToolSystemPrompt:s,toolApprovalMode:c,toolPolicies:l}){return{...i?{projectId:i}:{},...t?{agentId:t}:{...r?{model:r}:{},...a?.length?{pinnedConnectorIds:a}:{}},...o?{clientTools:n(o,e.DIRECT)}:{},...s?{clientToolSystemPrompt:s}:{},...c?{toolApprovalMode:c}:{},...l?.length?{toolPolicies:l}:{}}}export{i as n,a as r,o as t};
10
+ import{Kt as e,Tt as t,qt as n,wt as r}from"./profile-storage-Cr7deOY9.js";function i({allowedTools:e,disallowedTools:n}){if(!(!e?.length&&!n?.length))return[...t(e?.map(e=>({toolName:e,policy:r.ALWAYS_ALLOW})),n?.map(e=>({toolName:e,policy:r.BLOCK})))].map(([e,t])=>({toolName:e,policy:t}))}function a(e,n){let i=[...n].map(e=>({toolName:e,policy:r.ALWAYS_ALLOW}));return i.length===0?e:[...t(e,i)].map(([e,t])=>({toolName:e,policy:t}))}function o({agentId:t,model:r,projectId:i,pinnedConnectorIds:a,clientTools:o,clientToolSystemPrompt:s,toolApprovalMode:c,toolPolicies:l}){return{...i?{projectId:i}:{},...t?{agentId:t}:{...r?{model:r}:{},...a?.length?{pinnedConnectorIds:a}:{}},...o?{clientTools:n(o,e.DIRECT)}:{},...s?{clientToolSystemPrompt:s}:{},...c?{toolApprovalMode:c}:{},...l?.length?{toolPolicies:l}:{}}}export{i as n,a as r,o as 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-BPBUFvA6.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,o as u,r as d,s as f,u as p}from"./paths-CIj_zxDF.js";import{t as m}from"./hash-92fWniGT.js";import{r as h}from"./installer-CKB3jBE-.js";import g from"node:path";import _ from"node:fs/promises";const v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;async function y(t,o,s){let c=t&&v.test(t)?t:s.workspaceId,l={workspaceId:c,apiUrl:await e()};if(n(),o.global)i(l),console.info(`Linked ${f()} → workspace ${c}`);else{let e=process.cwd();a(e,l),console.info(`Linked ${r(e)} → workspace ${c}`)}}function b(e){if(e.global){c()?console.info(`Unlinked ${f()}`):console.info(`No global link found.`);return}let t=u(process.cwd());t&&p(t)?console.info(`Unlinked ${r(t)}`):console.info(`No project link found.`)}async function x(e,t,n,r,i){let a=n.skillId;if(!a){let{skills:t}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),r=t.find(e=>e.name===n.name);if(!r)throw Error(`Skill not found in workspace: ${n.name}`);a=r.id}let{url:s,name:c}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,a),l=await fetch(s);if(!l.ok)throw Error(`Failed to download ${c}: ${l.status}`);let u=Buffer.from(await l.arrayBuffer()),f=d(t,c);await _.rm(f,{recursive:!0,force:!0}),await _.mkdir(f,{recursive:!0});let{default:p}=await import(`adm-zip`),v=g.resolve(f)+g.sep;for(let e of new p(u).getEntries()){if(e.isDirectory)continue;let t=g.resolve(f,e.entryName);if(!t.startsWith(v))throw Error(`Zip entry contains path traversal: ${e.entryName}`);await _.mkdir(g.dirname(t),{recursive:!0}),await _.writeFile(t,e.getData())}let y=m(f);o(t,c,{source:a,sourceType:`entrydesk`,skillId:a,localHash:y,lastPulledHash:y,mode:`symlink`});let b=h(f,c,t,`symlink`,i);return r||console.info(`✓ pulled ${c} (${y.slice(0,12)}) → agents: ${b.map(e=>e.agentId).join(`, `)}`),{name:c,hash:y}}async function S(e,n,r){let{rootDir:i,workspaceId:a}=await s(!!n.global,r.workspaceId),o={...r,workspaceId:a},c=!!n.json,u=[];if(e)u.push(v.test(e)?{skillId:e}:{name:e});else{let e=l(i).skills;for(let[t,n]of Object.entries(e))u.push({skillId:n.skillId,name:t});if(u.length===0){console.info(`Nothing to pull — no tracked skills. Try: entrydesk skills pull <name>`);return}}let d=[];for(let e of u)d.push(await x(o,i,e,c,n.agent));c&&console.info(t(d,2))}export{S as n,b as r,y as t};
10
+ import{L as e}from"./profile-storage-Cr7deOY9.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,o as u,r as d,s as f,u as p}from"./paths-C8hkD2dC.js";import{t as m}from"./hash-92fWniGT.js";import{r as h}from"./installer-CKB3jBE-.js";import g from"node:path";import _ from"node:fs/promises";const v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;async function y(t,o,s){let c=t&&v.test(t)?t:s.workspaceId,l={workspaceId:c,apiUrl:await e()};if(n(),o.global)i(l),console.info(`Linked ${f()} → workspace ${c}`);else{let e=process.cwd();a(e,l),console.info(`Linked ${r(e)} → workspace ${c}`)}}function b(e){if(e.global){c()?console.info(`Unlinked ${f()}`):console.info(`No global link found.`);return}let t=u(process.cwd());t&&p(t)?console.info(`Unlinked ${r(t)}`):console.info(`No project link found.`)}async function x(e,t,n,r,i){let a=n.skillId;if(!a){let{skills:t}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),r=t.find(e=>e.name===n.name);if(!r)throw Error(`Skill not found in workspace: ${n.name}`);a=r.id}let{url:s,name:c}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,a),l=await fetch(s);if(!l.ok)throw Error(`Failed to download ${c}: ${l.status}`);let u=Buffer.from(await l.arrayBuffer()),f=d(t,c);await _.rm(f,{recursive:!0,force:!0}),await _.mkdir(f,{recursive:!0});let{default:p}=await import(`adm-zip`),v=g.resolve(f)+g.sep;for(let e of new p(u).getEntries()){if(e.isDirectory)continue;let t=g.resolve(f,e.entryName);if(!t.startsWith(v))throw Error(`Zip entry contains path traversal: ${e.entryName}`);await _.mkdir(g.dirname(t),{recursive:!0}),await _.writeFile(t,e.getData())}let y=m(f);o(t,c,{source:a,sourceType:`entrydesk`,skillId:a,localHash:y,lastPulledHash:y,mode:`symlink`});let b=h(f,c,t,`symlink`,i);return r||console.info(`✓ pulled ${c} (${y.slice(0,12)}) → agents: ${b.map(e=>e.agentId).join(`, `)}`),{name:c,hash:y}}async function S(e,n,r){let{rootDir:i,workspaceId:a}=await s(!!n.global,r.workspaceId),o={...r,workspaceId:a},c=!!n.json,u=[];if(e)u.push(v.test(e)?{skillId:e}:{name:e});else{let e=l(i).skills;for(let[t,n]of Object.entries(e))u.push({skillId:n.skillId,name:t});if(u.length===0){console.info(`Nothing to pull — no tracked skills. Try: entrydesk skills pull <name>`);return}}let d=[];for(let e of u)d.push(await x(o,i,e,c,n.agent));c&&console.info(t(d,2))}export{S as n,b as r,y as t};
@@ -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"./commands-DT40svYr.js";export{e as runSkillsUnlink};
10
+ import{r as e}from"./commands-Be9x6Mn2.js";export{e as runSkillsUnlink};
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{B as e,t,z as n}from"./profile-storage-BPBUFvA6.js";import{t as r}from"./terminal-text-cBPBiP3x.js";function i(i){let a=e.getAll();if(i.json){console.log(r(a));return}let o=Object.entries(a);if(console.log(`Profile: ${t.getEffectiveProfileName()}`),o.length===0){console.log(`No configuration set.`),console.log(`Available keys: ${n.join(`, `)}`);return}console.log(`Configuration:
10
+ import{B as e,t,z as n}from"./profile-storage-Cr7deOY9.js";import{t as r}from"./terminal-text-cBPBiP3x.js";function i(i){let a=e.getAll();if(i.json){console.log(r(a));return}let o=Object.entries(a);if(console.log(`Profile: ${t.getEffectiveProfileName()}`),o.length===0){console.log(`No configuration set.`),console.log(`Available keys: ${n.join(`, `)}`);return}console.log(`Configuration:
11
11
  `);for(let[e,t]of o)console.log(` ${e}=${t}`);console.log(`\nAvailable keys: ${n.join(`, `)}`)}export{i as listConfig};
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{Bt as e,C as t,Ft as n,Nt as r,Vt as i,p as a,zt as o}from"./profile-storage-BPBUFvA6.js";import{t as s}from"./terminal-text-cBPBiP3x.js";import{t as c}from"./confirm-Ct432t3K.js";function l(e,t){return t?o(t)?`Next: entrydesk connectors connect ${e} --oauth`:t===`credentials`?`Next: entrydesk connectors connect ${e} --username <username> --password <password>`:`Next: entrydesk connectors connect ${e} --token <token>`:`This connector needs no authorization — there is no connect step.`}async function u(e){let{accessToken:n,workspaceId:r}=await a(),{connectors:i,nextKey:o}=await new t().getConnectors(n,r,{connectionStatus:e.all?`all`:`connected`,search:e.search,limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(s({connectors:i,nextKey:o}));return}if(i.length===0){console.log(e.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let c=e.all?`Connectors`:`Connected connectors`;console.log(`${c} (${i.length}):\n`);for(let e of i){let t=e.connected?`connected`:`not connected`;console.log(` ${e.name} (${t})`),console.log(` Provider: ${e.provider}`),console.log(` ID: ${e.id}`),e.authorization?.type&&console.log(` Auth: ${e.authorization.type}`),console.log(``)}o&&console.log(`More results: --next-key ${o}`)}async function d(e,n){let{accessToken:r,workspaceId:i}=await a(),{tools:o}=await new t().getConnectorTools(r,i,e);if(n.json){console.log(s({tools:o}));return}if(o.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${o.length}):\n`);for(let e of o)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function f(e,n){let{accessToken:r,workspaceId:i}=await a();await new t().syncConnectorTools(r,i,e),console.log(n.json?s({id:e,synced:!0}):`Synced tools for connector ${e}.`)}async function p(e,n){let{accessToken:r,workspaceId:i}=await a(),o=new t;if(n.oauth){let{url:t}=await o.getConnectorAuthUrl(r,i,e);if(n.json){console.log(s({url:t}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${t}`),console.log(`
10
+ import{Bt as e,C as t,Ft as n,Nt as r,Vt as i,p as a,zt as o}from"./profile-storage-Cr7deOY9.js";import{t as s}from"./terminal-text-cBPBiP3x.js";import{t as c}from"./confirm-Ct432t3K.js";function l(e,t){return t?o(t)?`Next: entrydesk connectors connect ${e} --oauth`:t===`credentials`?`Next: entrydesk connectors connect ${e} --username <username> --password <password>`:`Next: entrydesk connectors connect ${e} --token <token>`:`This connector needs no authorization — there is no connect step.`}async function u(e){let{accessToken:n,workspaceId:r}=await a(),{connectors:i,nextKey:o}=await new t().getConnectors(n,r,{connectionStatus:e.all?`all`:`connected`,search:e.search,limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(s({connectors:i,nextKey:o}));return}if(i.length===0){console.log(e.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let c=e.all?`Connectors`:`Connected connectors`;console.log(`${c} (${i.length}):\n`);for(let e of i){let t=e.connected?`connected`:`not connected`;console.log(` ${e.name} (${t})`),console.log(` Provider: ${e.provider}`),console.log(` ID: ${e.id}`),e.authorization?.type&&console.log(` Auth: ${e.authorization.type}`),console.log(``)}o&&console.log(`More results: --next-key ${o}`)}async function d(e,n){let{accessToken:r,workspaceId:i}=await a(),{tools:o}=await new t().getConnectorTools(r,i,e);if(n.json){console.log(s({tools:o}));return}if(o.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${o.length}):\n`);for(let e of o)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function f(e,n){let{accessToken:r,workspaceId:i}=await a();await new t().syncConnectorTools(r,i,e),console.log(n.json?s({id:e,synced:!0}):`Synced tools for connector ${e}.`)}async function p(e,n){let{accessToken:r,workspaceId:i}=await a(),o=new t;if(n.oauth){let{url:t}=await o.getConnectorAuthUrl(r,i,e);if(n.json){console.log(s({url:t}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${t}`),console.log(`
11
11
  After you approve, the connection is saved automatically — re-run`),console.log("`entrydesk connectors` to confirm it shows as connected.");return}let c;n.token?c={token:n.token}:n.username&&n.password?c={username:n.username,password:n.password}:(console.error(`Provide --token, or --username and --password, or --oauth to connect.`),process.exit(1)),await o.connectConnectorToken(r,i,e,c),console.log(n.json?s({id:e,connected:!0}):`Connected connector ${e}.`)}function m(e){let t=e.auth===`oauth`||e.auth===`google-iap`;if(t&&(!e.provider||!e.scope?.length)&&(console.error(`--auth ${e.auth} needs --provider and at least one --scope.`),process.exit(1)),!t&&(e.provider||e.scope?.length)&&(console.error(e.auth?`--provider and --scope apply only to --auth oauth and --auth google-iap, not --auth ${e.auth}.`:`--provider and --scope need --auth oauth or --auth google-iap.`),process.exit(1)),e.auth!==void 0)return e.auth===!1?null:{type:e.auth,...e.provider?{provider:e.provider}:{},...e.scope?.length?{scopes:e.scope}:{}}}async function h(o){let c=m(o),u=o.toolNamespace??o.toolPrefix,d=u??e(o.name),f=n(d);if(f){let e=r[f];console.error(u?`--tool-namespace ${e}.`:`The tool namespace derived from --name ("${d}") ${e}. Pass --tool-namespace explicitly.`),process.exit(1)}let{accessToken:p,workspaceId:h}=await a(),g=await new t().createCustomConnector(p,h,{type:i.CUSTOM_REMOTE_URL,name:o.name,description:o.description,transport:o.transport,url:o.url,toolNamespace:d,...c?{authorization:c}:{}});if(o.json){console.log(s(g));return}console.log(`Created connector ${g.name}.`),console.log(` ID: ${g.id}`),console.log(` URL: ${g.url}`),console.log(` Tool namespace: ${g.toolNamespace}`),console.log(`\n${l(g.id,o.auth)}`)}function g(e,t){return t===void 0?e:t===null||t.type!==e?.type?t:{...e,...t}}async function _(e,n){[n.name,n.url,n.description,n.transport,n.toolNamespace,n.auth,n.provider,n.scope].every(e=>e===void 0)&&(console.error(`Nothing to update. Pass at least one of --name, --url, --description, --transport, --tool-namespace, --auth or --no-auth.`),process.exit(1));let r=m(n),{accessToken:o,workspaceId:c}=await a(),l=new t,u=await l.getCustomConnector(o,c,e),d=await l.updateCustomConnector(o,c,e,{type:i.CUSTOM_REMOTE_URL,name:n.name??u.name,description:n.description??u.description,transport:n.transport??u.transport,url:n.url??u.url,toolNamespace:n.toolNamespace??u.toolNamespace,authorization:g(u.authorization,r)});if(n.json){console.log(s(d));return}console.log(`Updated connector ${d.name}.`),console.log(` ID: ${d.id}`),console.log(` URL: ${d.url}`),console.log(` Tool namespace: ${d.toolNamespace}`)}async function v(e,n){let{accessToken:r,workspaceId:i}=await a();if(!n.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${e} needs confirmation. Re-run with --yes.`),process.exit(1)),!await c(`Disconnect connector ${e}?`))){console.log(`Aborted.`);return}await new t().disconnectConnector(r,i,e),console.log(n.json?s({id:e,disconnected:!0}):`Disconnected connector ${e}.`)}export{p as connectConnector,h as createConnector,v as disconnectConnector,d as listConnectorTools,u as listConnectors,f as syncConnectorTools,_ as updateConnector};
@@ -7,7 +7,7 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import"./profile-storage-BPBUFvA6.js";import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:path";import{execFile as i}from"node:child_process";import a from"node:fs/promises";import{promisify as o}from"node:util";function s(e){return e instanceof Error&&`code`in e}const c=o(i);async function l(){let t=r.join(n.tmpdir(),`entrydesk-clipboard-${Date.now()}.png`);try{let e=`
10
+ import"./profile-storage-Cr7deOY9.js";import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:path";import{execFile as i}from"node:child_process";import a from"node:fs/promises";import{promisify as o}from"node:util";function s(e){return e instanceof Error&&`code`in e}const c=o(i);async function l(){let t=r.join(n.tmpdir(),`entrydesk-clipboard-${Date.now()}.png`);try{let e=`
11
11
  set imageData to the clipboard as "PNGf"
12
12
  set fileRef to open for access POSIX file "${t}" with write permission
13
13
  set eof fileRef to 0
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{$ as e}from"./profile-storage-BPBUFvA6.js";function t(e){return`$${e.toFixed(2)}`}function n(t){return`$${e(t)}`}function r(e){if(e==null)return`—`;let t=Math.round(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${r}:${o}`}function i(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function a(e,t){return`${e} ${t}${e===1?``:`s`}`}export{a,t as i,n,i as r,r as t};
10
+ import{$ as e}from"./profile-storage-Cr7deOY9.js";function t(e){return`$${e.toFixed(2)}`}function n(t){return`$${e(t)}`}function r(e){if(e==null)return`—`;let t=Math.round(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${r}:${o}`}function i(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function a(e,t){return`${e} ${t}${e===1?``:`s`}`}export{a,t as i,n,i as r,r as t};