@entrydesk/cli 2.2.0-beta.1 → 2.2.0-beta.2

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 (64) hide show
  1. package/README.md +2 -2
  2. package/dist/{add-BJv6tPO-.js → add-BYupRwo_.js} +1 -1
  3. package/dist/{agents-fP3hIH7X.js → agents-CeXkI4US.js} +1 -1
  4. package/dist/billing-BeaQvLSK.js +10 -0
  5. package/dist/{budget-MVbF8WbS.js → budget-B4SKcu-1.js} +1 -1
  6. package/dist/build-task-request-config-eOeyGAfk.js +10 -0
  7. package/dist/{commands-CfDSEDKI.js → commands-Bisc9IY0.js} +1 -1
  8. package/dist/{commands-DU48SG8W.js → commands-Drf0_Uu8.js} +1 -1
  9. package/dist/{config-Cl-c7scx.js → config-ROg2C1qz.js} +1 -1
  10. package/dist/{connectors-DVzXDbUU.js → connectors-jktsuWlk.js} +2 -2
  11. package/dist/{file-upload-Dq6B0x4m.js → file-upload-ClVCUJp1.js} +1 -1
  12. package/dist/{format-CIj0qQba.js → format-B6a10P86.js} +1 -1
  13. package/dist/index.js +19 -19
  14. package/dist/{instruction-6ZWRQh4G.js → instruction-D0Sy5WJu.js} +1 -1
  15. package/dist/{login-CO1aBG6c.js → login-7nuzjqqL.js} +1 -1
  16. package/dist/{logout-WKIZVWJ7.js → logout-O7uVmxmK.js} +1 -1
  17. package/dist/{marketplace-C0C2JpYf.js → marketplace-8V1DNOld.js} +1 -1
  18. package/dist/{mcp-CqMrd5AI.js → mcp-DwMCTWU-.js} +1 -1
  19. package/dist/{mcp-client-CEH9X7Vs.js → mcp-client-DpDabxv9.js} +1 -1
  20. package/dist/{meeting-C5vHfcTw.js → meeting-DCMyPA59.js} +1 -1
  21. package/dist/{message-utils-D48Yqd9T.js → message-utils-C6JS91tT.js} +5 -5
  22. package/dist/{models-BENTHton.js → models-BdxCIBZD.js} +1 -1
  23. package/dist/{notifications-DdadH0Wc.js → notifications-BZxmGqEM.js} +1 -1
  24. package/dist/{paginate-Cbe4RaEq.js → paginate-B-nHzQ0j.js} +1 -1
  25. package/dist/{paths-BiowKnkz.js → paths-ZPsPG0IC.js} +1 -1
  26. package/dist/{profile-hhU_G-Ea.js → profile-D4jP-vQE.js} +1 -1
  27. package/dist/profile-storage--QCh_u_Q.js +73 -0
  28. package/dist/{project-xiz3Jopl.js → project-Ba5LBPMF.js} +1 -1
  29. package/dist/project-context-8lb14kaU.js +10 -0
  30. package/dist/{project-governance-R__UPIhr.js → project-governance-B66BEQxO.js} +1 -1
  31. package/dist/{project-sources-C-MXx6j-.js → project-sources-D4m1oEvu.js} +1 -1
  32. package/dist/{project-sources-write-ygvHaDUu.js → project-sources-write-CCICd6f8.js} +1 -1
  33. package/dist/{project-tasks-B0STK_8Q.js → project-tasks-ylwpld2n.js} +1 -1
  34. package/dist/push-CNZNGP6D.js +10 -0
  35. package/dist/{recordings-68Oe1Kvd.js → recordings-DpDUq0iw.js} +1 -1
  36. package/dist/{remove-C7BCBdoq.js → remove-CbGljmXk.js} +1 -1
  37. package/dist/{resolve-IOW00hfy.js → resolve-Di6ohyyF.js} +2 -2
  38. package/dist/{resource-grants-Bb4evqsH.js → resource-grants-DojPWFs8.js} +1 -1
  39. package/dist/{schedules-wopieg4D.js → schedules-CTFIi2SL.js} +2 -2
  40. package/dist/{skills-Drr0gw-l.js → skills-DbFd9oBS.js} +1 -1
  41. package/dist/{status-Bw2E5bfa.js → status-Br8KI96N.js} +1 -1
  42. package/dist/{status-DX6A6ugk.js → status-DLI2OgMv.js} +1 -1
  43. package/dist/task-CRwWxEOf.js +116 -0
  44. package/dist/{tasks-lK8PTMnE.js → tasks-CNUJbs7w.js} +1 -1
  45. package/dist/tasks-VEfTbXVT.js +22 -0
  46. package/dist/{team-8-enl9cj.js → team-BfBb-uk2.js} +1 -1
  47. package/dist/{teams-ByeuT2Ks.js → teams-47YS8wYw.js} +1 -1
  48. package/dist/{token-DrAF7BWj.js → token-CvjOXFDB.js} +1 -1
  49. package/dist/{tool-82NKBr29.js → tool-D_n28XK0.js} +7 -7
  50. package/dist/{update-DfOBWme1.js → update-B8gxXkSO.js} +1 -1
  51. package/dist/{usage-BS_didkP.js → usage-BPyHU-GL.js} +1 -1
  52. package/dist/{usage-audit-DOuyWGaq.js → usage-audit-STxCfVta.js} +1 -1
  53. package/dist/{version-D7DOD1ug.js → version-Ca4arzgb.js} +1 -1
  54. package/dist/{webhook-Da2l-gv6.js → webhook-B0E0M2EK.js} +1 -1
  55. package/dist/{workflow-oudE3gsp.js → workflow-B-iN8d5R.js} +1 -1
  56. package/dist/{workspaces-9SRfDSh3.js → workspaces-DmqtYNX1.js} +1 -1
  57. package/package.json +5 -5
  58. package/dist/billing-Cy0BYngu.js +0 -10
  59. package/dist/build-task-request-config-BzI-dDZP.js +0 -10
  60. package/dist/profile-storage-CKrZ-xsd.js +0 -73
  61. package/dist/project-context-DeYepfN2.js +0 -10
  62. package/dist/push-BxQQWCZ2.js +0 -10
  63. package/dist/task-bZNZ_yxV.js +0 -116
  64. package/dist/tasks-ZC9uSdkB.js +0 -22
package/README.md CHANGED
@@ -84,7 +84,7 @@ entrydesk task -c 1 -m "Follow up"
84
84
  entrydesk task -i
85
85
  entrydesk task -i --full-output # Show full tool outputs
86
86
  entrydesk task -i --no-file-system # Disable local file operations
87
- entrydesk task -i --connectors id1,id2 # Use specific connectors
87
+ entrydesk task -i --connectors id1,id2 # Preload tools from specific connectors
88
88
  ```
89
89
 
90
90
  Piping input and output:
@@ -495,7 +495,7 @@ without treating the search as complete. JSON stdout contains no help text.
495
495
  The CLI in a sandbox comes from its image, independently of the API release.
496
496
  After publishing a CLI version containing these commands, update the exact
497
497
  `@entrydesk/cli` pin in both `apps/entrydesk/sandbox/Dockerfile` and
498
- `apps/entrydesk/sandbox/Dockerfile.gke`, then rebuild and release the affected
498
+ `apps/entrydesk/sandbox/Dockerfile.kubernetes`, then rebuild and release the affected
499
499
  sandbox images. If an environment still uses E2B, update its separate template
500
500
  as well. Do not pin an unpublished version.
501
501
 
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{I as e}from"./profile-storage-CKrZ-xsd.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-BiowKnkz.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{I as e}from"./profile-storage--QCh_u_Q.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-ZPsPG0IC.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{C as e,D as t,O as n,an as r,bt as i,cn as a,in as o,ln as s,p as c,r as l,tn as u,yt as d}from"./profile-storage-CKrZ-xsd.js";import{n as f,t as p}from"./file-upload-Dq6B0x4m.js";import{n as m,t as h}from"./terminal-text-cBPBiP3x.js";import{t as g}from"./resource-grants-Bb4evqsH.js";import{HTTPError as _}from"ky";const v=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function y(e){return e?s([...new Set(e)]):r}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=a(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(t){let{accessToken:n,workspaceId:r}=await c(),i=new e;if(t.mine){let e=[],a=t.all?void 0:t.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:t.limit,nextKey:a});if(e.push(...s.agents),a=s.nextKey,!t.all||!a)break}if(t.json){console.log(h({agents:e,nextKey:a}));return}if(e.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(e),!t.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(t.all){let e=[],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:t.limit??100,nextKey:a});if(e.push(...s.agents),a=s.nextKey,!a)break}if(t.json){console.log(h({agents:e}));return}if(e.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(e);return}let{agents:a,nextKey:o}=await i.getAgents(n,r,{limit:t.limit,nextKey:t.nextKey});if(t.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(t,n){let{accessToken:r,workspaceId:i}=await c(),a=await new e().getAgent(r,i,t);if(n.json){console.log(h(a));return}S(a)}async function T(t){let{accessToken:n,workspaceId:r}=await c(),i=await new e().createAgent(n,r,{name:t.name,description:t.description,systemPrompt:t.systemPrompt,modelId:t.modelId,connectorIds:t.connectorIds??[],capabilities:y(t.capabilities),conversationStarters:t.conversationStarters??[],tools:t.tools,iconId:t.iconId});if(t.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(t,n){let{accessToken:r,workspaceId:i}=await c(),a=new e,o=await a.getAgent(r,i,t);await a.updateAgent(r,i,t,E(o,n)),console.log(`Updated agent: ${t}`)}async function O(e){let t=n(e),r;try{r=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(r.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 r}async function k(t){let{accessToken:n,workspaceId:r}=await c(),i=new e;return{client:i,accessToken:n,workspaceId:r,agent:t?await i.getAgent(n,r,t):void 0}}async function A({client:e,accessToken:n,workspaceId:r},i,a){let o=await e.getAgentHeadVersionId(n,r,i),s=await e.getAgent(n,r,i);try{await e.updateAgent(n,r,i,{...E(s,{iconId:a}),expectedHeadVersionId:o})}catch(e){throw e instanceof _&&t(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(t){let{accessToken:n,workspaceId:r}=await c();await new e().deleteAgent(n,r,t),console.log(`Deleted agent: ${t}`)}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:o.AGENT,findEditable:(t,n,r)=>F(t,n,r,e)}}async function L(e,t){await g(I(e),{...t,addWorkspace:!0,role:u.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,D as n,Gt as r,Jt as i,O as a,Qt as o,Yt as s,bt as c,p as l,r as u,yt as d}from"./profile-storage--QCh_u_Q.js";import{n as f,t as p}from"./file-upload-ClVCUJp1.js";import{n as m,t as h}from"./terminal-text-cBPBiP3x.js";import{t as g}from"./resource-grants-DojPWFs8.js";import{HTTPError as _}from"ky";const v=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function y(t){return t?e([...new Set(t)]):s}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=o(e.capabilities).map(e=>c(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 l(),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 l(),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 l(),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 l(),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=a(e),n;try{n=await f(e,{maxBytes:d})}catch(e){if(!(e instanceof p))throw e;switch(e.problem){case`missing`:throw new u(`No file at ${t}.`);case`not_a_file`:throw new u(`${t} is not a regular file.`);case`too_large`:throw new u(`${t} is larger than ${d/1024/1024}MB, the agent icon limit.`);case`unreadable`:throw new u(`Could not read ${t}. Check its permissions.`)}}if(!v.has(n.mimeType))throw new u(`${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 l(),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 u(`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 u(`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 u(`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 l();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:i.AGENT,findEditable:(t,n,r)=>F(t,n,r,e)}}async function L(e,t){await g(I(e),{...t,addWorkspace:!0,role:r.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};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ var __entrydeskNodeFloor = 24;
3
+ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
4
+ process.stderr.write(
5
+ 'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
6
+ 'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
7
+ );
8
+ process.exit(1);
9
+ }
10
+ import{C as e,p as t,x as n}from"./profile-storage--QCh_u_Q.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i,n as a}from"./format-B6a10P86.js";import{t as o}from"./paginate-B-nHzQ0j.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-CKrZ-xsd.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--QCh_u_Q.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};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ var __entrydeskNodeFloor = 24;
3
+ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
4
+ process.stderr.write(
5
+ 'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
6
+ 'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
7
+ );
8
+ process.exit(1);
9
+ }
10
+ import{Ct as e,Ht as t,St as n,Ut as r}from"./profile-storage--QCh_u_Q.js";function i({allowedTools:t,disallowedTools:r}){if(!(!t?.length&&!r?.length))return[...e(t?.map(e=>({toolName:e,policy:n.ALWAYS_ALLOW})),r?.map(e=>({toolName:e,policy:n.BLOCK})))].map(([e,t])=>({toolName:e,policy:t}))}function a(t,r){let i=[...r].map(e=>({toolName:e,policy:n.ALWAYS_ALLOW}));return i.length===0?t:[...e(t,i)].map(([e,t])=>({toolName:e,policy:t}))}function o({agentId:e,model:n,projectId:i,pinnedConnectorIds:a,clientTools:o,clientToolSystemPrompt:s,toolApprovalMode:c,toolPolicies:l}){return{...i?{projectId:i}:{},...e?{agentId:e}:{...n?{model:n}:{},...a?.length?{pinnedConnectorIds:a}:{}},...o?{clientTools:r(o,t.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{I as e}from"./profile-storage-CKrZ-xsd.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-BiowKnkz.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{I as e}from"./profile-storage--QCh_u_Q.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-ZPsPG0IC.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-CfDSEDKI.js";export{e as runSkillsUnlink};
10
+ import{r as e}from"./commands-Bisc9IY0.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{R as e,t,z as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";function i(i){let a=n.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: ${e.join(`, `)}`);return}console.log(`Configuration:
10
+ import{R as e,t,z as n}from"./profile-storage--QCh_u_Q.js";import{t as r}from"./terminal-text-cBPBiP3x.js";function i(i){let a=n.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: ${e.join(`, `)}`);return}console.log(`Configuration:
11
11
  `);for(let[e,t]of o)console.log(` ${e}=${t}`);console.log(`\nAvailable keys: ${e.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{C as e,Gt as t,Kt as n,Vt as r,p as i,qt as a,zt as o}from"./profile-storage-CKrZ-xsd.js";import{t as s}from"./terminal-text-cBPBiP3x.js";import{t as c}from"./confirm-Ct432t3K.js";function l(e,n){return n?t(n)?`Next: entrydesk connectors connect ${e} --oauth`:n===`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(t){let{accessToken:n,workspaceId:r}=await i(),{connectors:a,nextKey:o}=await new e().getConnectors(n,r,{connectionStatus:t.all?`all`:`connected`,search:t.search,limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(s({connectors:a,nextKey:o}));return}if(a.length===0){console.log(t.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let c=t.all?`Connectors`:`Connected connectors`;console.log(`${c} (${a.length}):\n`);for(let e of a){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(t,n){let{accessToken:r,workspaceId:a}=await i(),{tools:o}=await new e().getConnectorTools(r,a,t);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(t,n){let{accessToken:r,workspaceId:a}=await i();await new e().syncConnectorTools(r,a,t),console.log(n.json?s({id:t,synced:!0}):`Synced tools for connector ${t}.`)}async function p(t,n){let{accessToken:r,workspaceId:a}=await i(),o=new e;if(n.oauth){let{url:e}=await o.getConnectorAuthUrl(r,a,t);if(n.json){console.log(s({url:e}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${e}`),console.log(`
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,a,t,c),console.log(n.json?s({id:t,connected:!0}):`Connected connector ${t}.`)}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(t){let c=m(t),u=t.toolNamespace??t.toolPrefix,d=u??n(t.name),f=r(d);if(f){let e=o[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 i(),g=await new e().createCustomConnector(p,h,{type:a.CUSTOM_REMOTE_URL,name:t.name,description:t.description,transport:t.transport,url:t.url,toolNamespace:d,...c?{authorization:c}:{}});if(t.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,t.auth)}`)}function g(e,t){return t===void 0?e:t===null||t.type!==e?.type?t:{...e,...t}}async function _(t,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 i(),l=new e,u=await l.getCustomConnector(o,c,t),d=await l.updateCustomConnector(o,c,t,{type:a.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(t,n){let{accessToken:r,workspaceId:a}=await i();if(!n.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${t} needs confirmation. Re-run with --yes.`),process.exit(1)),!await c(`Disconnect connector ${t}?`))){console.log(`Aborted.`);return}await new e().disconnectConnector(r,a,t),console.log(n.json?s({id:t,disconnected:!0}):`Disconnected connector ${t}.`)}export{p as connectConnector,h as createConnector,v as disconnectConnector,d as listConnectorTools,u as listConnectors,f as syncConnectorTools,_ as updateConnector};
10
+ import{C as e,Ft as t,It as n,Lt as r,jt as i,kt as a,p as o}from"./profile-storage--QCh_u_Q.js";import{t as s}from"./terminal-text-cBPBiP3x.js";import{t as c}from"./confirm-Ct432t3K.js";function l(e,n){return n?t(n)?`Next: entrydesk connectors connect ${e} --oauth`:n===`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(t){let{accessToken:n,workspaceId:r}=await o(),{connectors:i,nextKey:a}=await new e().getConnectors(n,r,{connectionStatus:t.all?`all`:`connected`,search:t.search,limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(s({connectors:i,nextKey:a}));return}if(i.length===0){console.log(t.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let c=t.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(``)}a&&console.log(`More results: --next-key ${a}`)}async function d(t,n){let{accessToken:r,workspaceId:i}=await o(),{tools:a}=await new e().getConnectorTools(r,i,t);if(n.json){console.log(s({tools:a}));return}if(a.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${a.length}):\n`);for(let e of a)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function f(t,n){let{accessToken:r,workspaceId:i}=await o();await new e().syncConnectorTools(r,i,t),console.log(n.json?s({id:t,synced:!0}):`Synced tools for connector ${t}.`)}async function p(t,n){let{accessToken:r,workspaceId:i}=await o(),a=new e;if(n.oauth){let{url:e}=await a.getConnectorAuthUrl(r,i,t);if(n.json){console.log(s({url:e}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${e}`),console.log(`
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 a.connectConnectorToken(r,i,t,c),console.log(n.json?s({id:t,connected:!0}):`Connected connector ${t}.`)}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(t){let c=m(t),u=t.toolNamespace??t.toolPrefix,d=u??n(t.name),f=i(d);if(f){let e=a[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 o(),g=await new e().createCustomConnector(p,h,{type:r.CUSTOM_REMOTE_URL,name:t.name,description:t.description,transport:t.transport,url:t.url,toolNamespace:d,...c?{authorization:c}:{}});if(t.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,t.auth)}`)}function g(e,t){return t===void 0?e:t===null||t.type!==e?.type?t:{...e,...t}}async function _(t,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 i=m(n),{accessToken:a,workspaceId:c}=await o(),l=new e,u=await l.getCustomConnector(a,c,t),d=await l.updateCustomConnector(a,c,t,{type:r.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,i)});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(t,n){let{accessToken:r,workspaceId:i}=await o();if(!n.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${t} needs confirmation. Re-run with --yes.`),process.exit(1)),!await c(`Disconnect connector ${t}?`))){console.log(`Aborted.`);return}await new e().disconnectConnector(r,i,t),console.log(n.json?s({id:t,disconnected:!0}):`Disconnected connector ${t}.`)}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-CKrZ-xsd.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--QCh_u_Q.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{Q as e}from"./profile-storage-CKrZ-xsd.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{Q as e}from"./profile-storage--QCh_u_Q.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};