@entrydesk/cli 1.17.0 → 1.19.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 (34) hide show
  1. package/dist/agents-6IGSCA3S.js +43 -0
  2. package/dist/billing-SNTQDK4M.js +24 -0
  3. package/dist/{budget-LQAN6HWT.js → budget-7A4HH6LK.js} +1 -1
  4. package/dist/chunk-UXJD5BRR.js +4 -0
  5. package/dist/{config-SVZI7HKX.js → config-7SMTGR4C.js} +1 -1
  6. package/dist/{config-LOYERDQU.js → config-ZQUW7BQS.js} +1 -1
  7. package/dist/{config-help-BMF2KHCT.js → config-help-IJ6BGCBY.js} +1 -1
  8. package/dist/{connectors-JI4O4W5F.js → connectors-C35PPZM3.js} +1 -1
  9. package/dist/help-UAGSVZIZ.js +4 -0
  10. package/dist/index.js +1 -1
  11. package/dist/{login-WSBUXCFD.js → login-NL4DUGVI.js} +1 -1
  12. package/dist/{logout-ZBRMMAYT.js → logout-FVV6V2UU.js} +1 -1
  13. package/dist/{mcp-6V3TZE3Z.js → mcp-6JQHRC5J.js} +1 -1
  14. package/dist/{meeting-D6ASCE4N.js → meeting-I5NQ2V3L.js} +1 -1
  15. package/dist/{models-AFZZB3R5.js → models-YG7XKIZ2.js} +1 -1
  16. package/dist/{notifications-FAAD725V.js → notifications-NVWXUDN6.js} +1 -1
  17. package/dist/{profile-5AAPR2N6.js → profile-SYH6PEBO.js} +1 -1
  18. package/dist/{schedules-6OO7OBSJ.js → schedules-GPV52YWB.js} +1 -1
  19. package/dist/skills-E2JJSSGW.js +25 -0
  20. package/dist/{status-2WFXKYPI.js → status-JGVG5T6F.js} +1 -1
  21. package/dist/{task-5MMTKTBE.js → task-O7MFJEU2.js} +60 -35
  22. package/dist/tasks-VQ4SIVJG.js +41 -0
  23. package/dist/{tool-JW7GNF2H.js → tool-RZPDCROT.js} +6 -6
  24. package/dist/usage-LVG7HRCR.js +29 -0
  25. package/dist/{version-CU6Z4ZZC.js → version-4P4L2T22.js} +1 -1
  26. package/dist/{workflow-ZJTX5RAR.js → workflow-KHE2MKD5.js} +1 -1
  27. package/dist/{workspaces-PKE6XTQW.js → workspaces-ARL2DBCW.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/agents-PAPYAU3I.js +0 -30
  30. package/dist/chunk-TFQLXDTE.js +0 -4
  31. package/dist/help-B56RNLOB.js +0 -208
  32. package/dist/skills-GFCCO6ZE.js +0 -17
  33. package/dist/tasks-L7WU3FMX.js +0 -21
  34. package/dist/usage-AJA4SOXY.js +0 -18
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import{h as D,k as I,r as U,t as z}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";import j from"crypto";import v from"fs";import c from"fs/promises";import x from"os";import s from"path";import{Readable as N}from"stream";import{pipeline as E}from"stream/promises";import O from"adm-zip";import A from"archiver";import{isHTTPError as R}from"ky";function g(){console.log(`
3
+ Usage: entrydesk skills [list|upload|delete|download|toggle|versions|share] [options]
4
+
5
+ Commands:
6
+ list List available skills (default)
7
+ upload <file.zip> Upload a skill zip file
8
+ upload <folder> Upload a skill folder (auto-zipped)
9
+ delete <skillId> Delete a skill you own
10
+ download <skillId> Download and extract a skill to ./<skill-name>/
11
+ toggle <skillId> Enable/disable a skill for yourself (--enable/--disable)
12
+ versions <skillId> List a skill's version history
13
+ share <skillId> Show or manage sharing (user grants)
14
+
15
+ Options:
16
+ --me Only list skills created by me
17
+ --force Overwrite an existing skill with the same name
18
+ --enable / --disable For toggle: turn the skill on/off for yourself
19
+ --add-user <userId> For share: grant a user access (use with --role)
20
+ --remove-user <userId> For share: revoke a user's access
21
+ --role owner|editor|viewer Role for --add-user (default: viewer)
22
+ --json Output JSON (for list/upload)
23
+ `)}function F(e,r){let i=s.relative(e,r);return i===""||!i.startsWith("..")&&!s.isAbsolute(i)}async function J(e){let r=await c.realpath(e),i=[process.cwd(),x.homedir()];if(!(await Promise.all(i.map(async f=>{try{return await c.realpath(f)}catch{return s.resolve(f)}}))).some(f=>F(f,r)))throw new Error("Invalid upload path: must be within the current directory or your home directory.")}async function T(e){let r=await c.mkdtemp(s.join(x.tmpdir(),"entrydesk-skill-")),i=s.join(r,`${s.basename(e)}.zip`);return await new Promise((p,u)=>{let f=v.createWriteStream(i),k=A("zip",{zlib:{level:9}});f.on("close",()=>p()),f.on("error",u),k.on("error",u),k.pipe(f),k.directory(e,!1),k.finalize()}),{zipPath:i,cleanupDir:r}}function K(e){console.log(`Versions (${e.length}):
24
+ `);for(let r of e){let i=new Date(r.createdAt).toLocaleString();if(console.log(` v${r.versionNumber} \xB7 ${i}`),r.description){let p=r.description.length>100?`${r.description.slice(0,100)}...`:r.description;console.log(` ${p}`)}console.log(` Version ID: ${r.id}`),console.log("")}}function V(e){if(console.log(`User grants (${e.grants.length}):`),e.grants.length===0){console.log(" (none)");return}for(let r of e.grants)console.log(` - ${r.user.name} <${r.user.email}> \xB7 ${r.role}`),console.log(` ID: ${r.userId}`)}async function oe(e){if(e.help){g();return}let r,i;try{let o=await U();r=o.accessToken,i=o.workspaceId}catch(o){z(o)}let p=e.action||"list",u=new D;if(p==="upload"){let o=e.configKey;o||(console.error("Missing file path."),g(),process.exit(1));let n=s.resolve(o),t;try{t=await c.stat(n)}catch{console.error(`File not found: ${n}`),process.exit(1)}let a=n,y=null;try{try{await J(n)}catch(d){let l=d instanceof Error?d.message:"Invalid upload path.";console.error(l),process.exit(1)}if(t.isDirectory()){let d=await T(n);a=d.zipPath,y=d.cleanupDir}else t.isFile()||(console.error(`Not a file or directory: ${n}`),process.exit(1));s.extname(a).toLowerCase()!==".zip"&&(console.error("Only .zip files are supported for upload."),process.exit(1));let $=await c.readFile(a),m=new FormData;m.append("file",new Blob([$],{type:"application/zip"}),s.basename(a)),e.force&&m.append("force","true");let w;try{w=await u.uploadSkill(r,i,m)}catch(d){if(R(d)&&d.response.status===409){let{code:l}=I(d.data);l==="skill_name_conflict"?console.error("Upload failed: A skill with this name is owned by another user."):(console.error("Upload failed: A skill with this name already exists."),console.error("Use --force to overwrite the existing skill.")),process.exit(1)}throw d}if(e.json){console.log(JSON.stringify(w));return}console.log(`Uploaded skill: ${w.name}`),console.log(` ID: ${w.id}`),console.log(` Version ID: ${w.versionId}`),console.log(` Description: ${w.description}`);return}finally{y&&await c.rm(y,{recursive:!0,force:!0})}}if(p==="toggle"){let o=e.configKey;o||(console.error("Missing skill ID."),g(),process.exit(1)),e.enable===e.disable&&(console.error("Pass exactly one of --enable or --disable."),process.exit(1));let n=!!e.enable,t=await u.updateSkillPreference(r,i,o,n);if(e.json){console.log(JSON.stringify(t));return}console.log(`${t.isEnabled?"Enabled":"Disabled"} skill for you: ${o}`);return}if(p==="versions"){let o=e.configKey;o||(console.error("Missing skill ID."),g(),process.exit(1));let n=await u.getSkillVersions(r,i,o);if(e.json){console.log(JSON.stringify(n));return}if(n.versions.length===0){console.log("No versions for this skill.");return}K(n.versions);return}if(p==="share"){let o=e.configKey;o||(console.error("Missing skill ID."),g(),process.exit(1));let n=e.role??"viewer";if(e.addUser){let a=await u.upsertSkillGrant(r,i,o,e.addUser,n);if(e.json){console.log(JSON.stringify(a));return}console.log(`Granted ${n} to user ${e.addUser}`);return}if(e.removeUser){if(await u.removeSkillGrant(r,i,o,e.removeUser),e.json){console.log(JSON.stringify({userId:e.removeUser,removed:!0}));return}console.log(`Revoked access for user ${e.removeUser}`);return}let t=await u.getSkillGrants(r,i,o);if(e.json){console.log(JSON.stringify(t));return}V(t);return}if(p==="delete"){let o=e.configKey;o||(console.error("Missing skill ID."),g(),process.exit(1)),await u.deleteSkill(r,i,o),console.log(`Deleted skill: ${o}`);return}if(p==="download"){let o=e.configKey;o||(console.error("Missing skill ID."),g(),process.exit(1));let{url:n,name:t}=await u.downloadSkillCurrent(r,i,o);(t.includes("/")||t.includes(s.sep)||t==="."||t===".."||!t)&&(console.error(`Invalid skill name for output directory: ${t}`),process.exit(1));let a=s.resolve(t),y=await c.mkdtemp(s.join(x.tmpdir(),"entrydesk-skill-download-")),$=s.join(y,`${t}.zip`);try{let m=await fetch(n);if(!m.ok)throw new Error(`Failed to download skill zip: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("Response body is empty");let w=v.createWriteStream($);await E(N.fromWeb(m.body),w);let d=await c.mkdtemp(s.join(s.dirname(a),".entrydesk-skill-extract-")),l=null;try{e.json||console.log("Extracting...");let b=new O($),P=s.resolve(d)+s.sep;for(let h of b.getEntries()){if(h.isDirectory)continue;let S=s.resolve(d,h.entryName);if(!S.startsWith(P))throw new Error(`Zip entry contains path traversal: ${h.entryName}`);await c.mkdir(s.dirname(S),{recursive:!0}),await c.writeFile(S,h.getData())}v.existsSync(a)&&(l=s.join(s.dirname(a),`.entrydesk-backup-${j.randomUUID()}`),e.json||console.log(`Replacing existing directory: ${a}`),await c.rename(a,l));try{await c.rename(d,a),l&&v.existsSync(l)&&(await c.rm(l,{recursive:!0,force:!0}),l=null)}catch(h){throw l&&v.existsSync(l)&&(await c.rename(l,a),l=null),h}}catch(b){if(await c.rm(d,{recursive:!0,force:!0}),l&&v.existsSync(l))try{await c.rename(l,a)}catch{console.error(`Warning: Could not restore backup. Your original files are at: ${l}`)}throw b}if(e.json){console.log(JSON.stringify({skillId:o,skillName:t,outputDir:a}));return}console.log(`Downloaded skill "${t}" to ${a}`)}finally{await c.rm(y,{recursive:!0,force:!0})}return}p!=="list"&&(console.error(`Unknown skills command: ${p}`),g(),process.exit(1));let f=[],k;do{let o=await u.listAvailableSkills(r,i,{createdBy:e.createdBy,nextKey:k,limit:100});f.push(...o.skills),k=o.nextKey}while(k);if(e.json){console.log(JSON.stringify(f));return}if(f.length===0){console.log("No skills found in this workspace.");return}console.log(`Available Skills (${f.length}):
25
+ `);for(let o of f)console.log(` ${o.name} (${o.provider})`),console.log(` ${o.description.slice(0,120)}`),console.log(` ID: ${o.id}`),console.log(` Author: ${o.author.name}`),console.log("")}export{g as printSkillsUsage,oe as runSkills};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as c,b as i,g as a,h as g,i as f,m as p,p as d,s as u}from"./chunk-TFQLXDTE.js";import"./chunk-KURQCTT3.js";async function W(t){try{let o=c.getEffectiveProfileName(),n={model:i.getDefaultModel(),connectors:i.getDefaultConnectorIds()},r=f();if(r){t.json?console.log(JSON.stringify({loggedIn:!0,authSource:r.authSource,profile:o,workspaceId:r.workspaceId,defaults:n})):(console.log(`Profile: ${o}`),console.log(`Authenticated via ${r.label} (no login required)`),console.log(`Workspace ID: ${r.workspaceId}`));return}let e=await a.getAll();if(!e){t.json?console.log(JSON.stringify({loggedIn:!1,profile:o,defaults:n})):(console.log(`Profile: ${o}`),console.log("Not logged in"),console.log("Run `entrydesk login` to authenticate"));return}let l;if(e.workspaceId)try{let s=new g,m=await d(),{workspaces:k}=await s.getWorkspaces(m);l=k.find(I=>I.id===e.workspaceId)?.name}catch(s){if(s instanceof p){t.json?console.log(JSON.stringify({loggedIn:!1,profile:o,defaults:n})):(console.log(`Profile: ${o}`),console.log("Not logged in"),console.log("Run `entrydesk login` to authenticate"));return}}t.json?console.log(JSON.stringify({loggedIn:!0,authSource:"file",profile:o,email:e.email,workspaceId:e.workspaceId,workspaceName:l,defaults:n})):(console.log(`Profile: ${o}`),console.log(`Logged in as ${e.email}`),l&&console.log(`Workspace: ${l}`),e.workspaceId&&console.log(`Workspace ID: ${e.workspaceId}`))}catch(o){u(o)}}export{W as runStatus};
2
+ import{a as c,b as i,g as a,h as g,j as f,n as p,q as d,t as u}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";async function W(t){try{let o=c.getEffectiveProfileName(),n={model:i.getDefaultModel(),connectors:i.getDefaultConnectorIds()},r=f();if(r){t.json?console.log(JSON.stringify({loggedIn:!0,authSource:r.authSource,profile:o,workspaceId:r.workspaceId,defaults:n})):(console.log(`Profile: ${o}`),console.log(`Authenticated via ${r.label} (no login required)`),console.log(`Workspace ID: ${r.workspaceId}`));return}let e=await a.getAll();if(!e){t.json?console.log(JSON.stringify({loggedIn:!1,profile:o,defaults:n})):(console.log(`Profile: ${o}`),console.log("Not logged in"),console.log("Run `entrydesk login` to authenticate"));return}let l;if(e.workspaceId)try{let s=new g,m=await d(),{workspaces:k}=await s.getWorkspaces(m);l=k.find(I=>I.id===e.workspaceId)?.name}catch(s){if(s instanceof p){t.json?console.log(JSON.stringify({loggedIn:!1,profile:o,defaults:n})):(console.log(`Profile: ${o}`),console.log("Not logged in"),console.log("Run `entrydesk login` to authenticate"));return}}t.json?console.log(JSON.stringify({loggedIn:!0,authSource:"file",profile:o,email:e.email,workspaceId:e.workspaceId,workspaceName:l,defaults:n})):(console.log(`Profile: ${o}`),console.log(`Logged in as ${e.email}`),l&&console.log(`Workspace: ${l}`),e.workspaceId&&console.log(`Workspace ID: ${e.workspaceId}`))}catch(o){u(o)}}export{W as runStatus};