@entrydesk/cli 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agents-ILNVMFJT.js → agents-TNNCHSAS.js} +1 -1
- package/dist/{billing-FWDGBFXX.js → billing-DTCTR6NV.js} +1 -1
- package/dist/{budget-HC4RRKBM.js → budget-ZPVOREV3.js} +1 -1
- package/dist/chunk-FC4BDFRE.js +4 -0
- package/dist/{chunk-CECPYYET.js → chunk-PKHRSAM3.js} +3 -3
- package/dist/{config-Y6VAHJFF.js → config-CUXUIZYY.js} +1 -1
- package/dist/{config-BRLPQW3X.js → config-HU4PB2YN.js} +1 -1
- package/dist/{config-help-ZTHSANAW.js → config-help-EAILLXRT.js} +1 -1
- package/dist/{connectors-GWHJEIPL.js → connectors-XGMAKVSA.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/login-WRHU3GNP.js +2 -0
- package/dist/{logout-DUDWGSSH.js → logout-IQ37MWYS.js} +1 -1
- package/dist/{marketplace-I5CPHCMV.js → marketplace-2LHVBAMA.js} +1 -1
- package/dist/{mcp-42I2ILS7.js → mcp-OI3XLDLK.js} +1 -1
- package/dist/{meeting-F55223JK.js → meeting-GTTBPEX6.js} +1 -1
- package/dist/{models-5L2J4PIS.js → models-VB6O4VBV.js} +1 -1
- package/dist/{notifications-GK2XLM5S.js → notifications-2SGUH6B3.js} +1 -1
- package/dist/{profile-SA5GTVBZ.js → profile-4VQ2ELOV.js} +1 -1
- package/dist/{recordings-DQUNZHXK.js → recordings-THV5V2E6.js} +1 -1
- package/dist/{schedules-O25TSYEY.js → schedules-QX6DW6EO.js} +1 -1
- package/dist/skills-ECL7ML6S.js +27 -0
- package/dist/{status-J77PC3PX.js → status-4SIDN6NP.js} +1 -1
- package/dist/{task-UA3BYLVA.js → task-ZRBAVPCC.js} +2 -2
- package/dist/{tasks-KOMITUOV.js → tasks-4CGM57D2.js} +1 -1
- package/dist/{tool-TW2I32SE.js → tool-PIWE3XQR.js} +1 -1
- package/dist/{usage-4ZIO6EC5.js → usage-M5PPQU2W.js} +1 -1
- package/dist/{version-7UBQKXV7.js → version-PZBO24VL.js} +1 -1
- package/dist/{workflow-U5OA6K4T.js → workflow-BL653HYD.js} +1 -1
- package/dist/{workspaces-BWXFSML5.js → workspaces-P5YZFPSP.js} +1 -1
- package/package.json +3 -3
- package/dist/chunk-EIX7AV4F.js +0 -4
- package/dist/login-62SHYTYL.js +0 -2
- package/dist/skills-GMI3HSG6.js +0 -27
package/dist/login-62SHYTYL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{g as l,h as c,j as r,m as a}from"./chunk-EIX7AV4F.js";import"./chunk-KURQCTT3.js";async function h(o){let i=r();if(i?.authSource==="sandbox-env"){o.json?console.log(JSON.stringify({alreadyAuthenticated:!0,authSource:i.authSource,workspaceId:i.workspaceId})):(console.log(`Already authenticated via ${i.label}.`),console.log("No login required \u2014 environment credentials are active."));return}if(process.env.DEBUG){let{getApiUrl:s,getHubUrl:t}=await import("./config-BRLPQW3X.js");console.log(`[DEBUG] Hub URL: ${t()}`),console.log(`[DEBUG] API URL: ${s()}`)}let e=await a({onDeviceCodeReceived:(s,t)=>{o.json||(console.log(""),console.log("To authenticate, please:"),console.log(""),console.log(` 1. Visit: ${t}`),console.log(` 2. Enter code: ${s}`),console.log(""))},onBrowserOpening:()=>{o.json||console.log("Opening browser...")},onWaitingForAuthorization:()=>{o.json||console.log("Waiting for authorization...")},onAuthorized:()=>{o.json||console.log("Authorization successful!")}}),g=new c,{workspaces:u}=await g.getWorkspaces(e.accessToken),n=u[0];await l.saveAll({accessToken:e.accessToken,refreshToken:e.refreshToken,email:e.email,workspaceId:n?.id}),o.json?console.log(JSON.stringify({email:e.email,workspaceId:n?.id,workspaceName:n?.name})):(console.log(`Logged in as ${e.email}`),n&&console.log(`Workspace: ${n.name}`))}export{h as runLogin};
|
package/dist/skills-GMI3HSG6.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{b as K,h as _,k as z,r as J,t as F}from"./chunk-EIX7AV4F.js";import"./chunk-KURQCTT3.js";import be from"crypto";import j from"fs";import k from"fs/promises";import T from"os";import f from"path";import{Readable as je}from"stream";import{pipeline as Le}from"stream/promises";import $e from"adm-zip";import Pe from"archiver";import{isHTTPError as Ee}from"ky";import D from"fs/promises";import P from"path";import{createHash as H}from"crypto";import E from"fs";import $ from"path";var W=new Set([".git","node_modules","__pycache__",".DS_Store","__MACOSX"]),V="SKILL.md";function ce(e){let r=E.readdirSync(e,{withFileTypes:!0}).filter(t=>!W.has(t.name));if(r.some(t=>t.isFile()&&t.name===V))return e;let o=r.filter(t=>t.isDirectory());if(o.length===1){let t=$.join(e,o[0].name);if(E.existsSync($.join(t,V)))return t}return e}function B(e,r,o){for(let t of E.readdirSync(r,{withFileTypes:!0})){if(W.has(t.name))continue;let i=$.join(r,t.name);t.isDirectory()?B(e,i,o):t.isFile()&&o.push({rel:$.relative(e,i).split($.sep).join("/"),abs:i})}}function ae(e){let r=[];B(e,e,r),r.sort((t,i)=>t.rel<i.rel?-1:t.rel>i.rel?1:0);let o=H("sha256");for(let t of r){let i=H("sha256").update(E.readFileSync(t.abs)).digest("hex");o.update(t.rel).update("\0").update(i).update("\0")}return o.digest("hex")}function G(e){return ae(ce(e))}import w from"fs";import y from"path";var Z=[{id:"claude-code",displayName:"Claude Code",skillsSubdir:y.join(".claude","skills"),rootMarker:".claude"},{id:"codex",displayName:"Codex",skillsSubdir:y.join(".codex","skills"),rootMarker:".codex"},{id:"cursor",displayName:"Cursor",skillsSubdir:y.join(".cursor","skills"),rootMarker:".cursor"},{id:"universal",displayName:"Universal (.agents)",skillsSubdir:y.join(".agents","skills"),rootMarker:".agents"}];function de(e,r){return y.join(r,e.skillsSubdir)}function ue(e){let r=Z.filter(o=>o.id==="universal"||w.existsSync(y.join(e,o.rootMarker)));return r.length?r:Z.filter(o=>o.id==="universal")}function fe(e){let r;try{r=w.lstatSync(e)}catch{return}r.isSymbolicLink()?w.unlinkSync(e):r.isDirectory()?w.rmSync(e,{recursive:!0,force:!0}):w.rmSync(e,{force:!0})}function pe(e,r,o,t="symlink"){let i=y.basename(y.dirname(r))||r,s=y.join(r,o);if(w.mkdirSync(r,{recursive:!0}),fe(s),t==="symlink")try{let c=y.relative(r,e);return w.symlinkSync(c,s,process.platform==="win32"?"junction":"dir"),{agentId:i,linkPath:s,mode:"symlink",ok:!0}}catch{}try{return w.cpSync(e,s,{recursive:!0}),{agentId:i,linkPath:s,mode:"copy",ok:!0}}catch(c){return{agentId:i,linkPath:s,mode:"copy",ok:!1,error:c instanceof Error?c.message:String(c)}}}function X(e,r,o,t="symlink"){return ue(o).map(i=>pe(e,de(i,o),r,t))}import b from"fs";import A from"path";import U from"fs";import q from"path";var ke="skills-lock.json",C=".entrydesk",O=1;function Y(){return{version:O,skills:{}}}function Q(e){return q.join(e,C,ke)}function R(e){try{let r=JSON.parse(U.readFileSync(Q(e),"utf8"));return r.version!==O||typeof r.skills!="object"||r.skills===null?Y():r}catch{return Y()}}function me(e,r){let o={};for(let s of Object.keys(r.skills).sort())o[s]=r.skills[s];let t={version:O,...r.workspaceId?{workspaceId:r.workspaceId}:{},skills:o},i=Q(e);U.mkdirSync(q.dirname(i),{recursive:!0}),U.writeFileSync(i,`${JSON.stringify(t,null,2)}
|
|
3
|
-
`,"utf8")}function ee(e,r,o){let t=R(e);t.skills[r]=o,me(e,t)}var ge="project.json";function I(e){return A.join(e,C,ge)}function M(e=process.cwd()){let r=A.resolve(e);for(;;){if(b.existsSync(I(r)))return r;let o=A.dirname(r);if(o===r)return;r=o}}function ye(e){try{let r=JSON.parse(b.readFileSync(I(e),"utf8"));return typeof r.workspaceId!="string"||r.workspaceId===""?void 0:r}catch{return}}function re(e,r){let o=I(e);b.mkdirSync(A.dirname(o),{recursive:!0}),b.writeFileSync(o,`${JSON.stringify(r,null,2)}
|
|
4
|
-
`,"utf8")}function oe(e){let r=I(e);return b.existsSync(r)?(b.rmSync(r),!0):!1}function te(e=process.cwd()){let r=M(e);if(!r)return;let o=ye(r);return o?{rootDir:r,link:o}:void 0}var ie=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;function Se(){return te(process.cwd())?.rootDir??process.cwd()}function he(e,r){return P.join(e,".entrydesk","skills",r)}function we(e,r){let o=process.cwd(),t=e.configKey&&ie.test(e.configKey)?e.configKey:r.workspaceId,i=K.getApiUrl()??void 0;re(o,{workspaceId:t,apiUrl:i}),console.info(`Linked ${I(o)} \u2192 workspace ${t}`)}function ve(){let e=M(process.cwd());e&&oe(e)?console.info(`Unlinked ${I(e)}`):console.info("No project link found.")}async function Ie(e,r,o,t){let i=o.skillId;if(!i){let{skills:d}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),a=d.find(L=>L.name===o.name);if(!a)throw new Error(`Skill not found in workspace: ${o.name}`);i=a.id}let{url:s,name:c}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,i),n=await fetch(s);if(!n.ok)throw new Error(`Failed to download ${c}: ${n.status}`);let u=Buffer.from(await n.arrayBuffer()),l=he(r,c);await D.rm(l,{recursive:!0,force:!0}),await D.mkdir(l,{recursive:!0});let{default:p}=await import("adm-zip"),h=P.resolve(l)+P.sep;for(let d of new p(u).getEntries()){if(d.isDirectory)continue;let a=P.resolve(l,d.entryName);if(!a.startsWith(h))throw new Error(`Zip entry contains path traversal: ${d.entryName}`);await D.mkdir(P.dirname(a),{recursive:!0}),await D.writeFile(a,d.getData())}let S=G(l);ee(r,c,{source:i,sourceType:"entrydesk",skillId:i,localHash:S,lastPulledHash:S,mode:"symlink"});let g=X(l,c,r,"symlink");return t||console.info(`\u2713 pulled ${c} (${S.slice(0,12)}) \u2192 agents: ${g.map(d=>d.agentId).join(", ")}`),{name:c,hash:S}}async function xe(e,r){let o=Se(),t=!!e.json,i=[];if(e.configKey)i.push(ie.test(e.configKey)?{skillId:e.configKey}:{name:e.configKey});else{let c=R(o).skills;for(let[n,u]of Object.entries(c))i.push({skillId:u.skillId,name:n});if(i.length===0){console.info("Nothing to pull \u2014 no tracked skills. Try: entrydesk skills pull <name>");return}}let s=[];for(let c of i)s.push(await Ie(r,o,c,t));t&&console.info(JSON.stringify(s,null,2))}function ne(e){return e==="link"||e==="unlink"||e==="pull"}function se(e,r){return e.action==="pull"?xe(e,r):(e.action==="link"?we(e,r):e.action==="unlink"&&ve(),Promise.resolve())}function v(){console.log(`
|
|
5
|
-
Usage: entrydesk skills [list|upload|delete|download|toggle|versions|share] [options]
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
list List available skills (default)
|
|
9
|
-
upload <file.zip> Upload a skill zip file
|
|
10
|
-
upload <folder> Upload a skill folder (auto-zipped)
|
|
11
|
-
delete <skillId> Delete a skill you own
|
|
12
|
-
download <skillId> Download and extract a skill to ./<skill-name>/
|
|
13
|
-
toggle <skillId> Enable/disable a skill for yourself (--enable/--disable)
|
|
14
|
-
versions <skillId> List a skill's version history
|
|
15
|
-
share <skillId> Show or manage sharing (user grants)
|
|
16
|
-
|
|
17
|
-
Options:
|
|
18
|
-
--me Only list skills created by me
|
|
19
|
-
--force Overwrite an existing skill with the same name
|
|
20
|
-
--enable / --disable For toggle: turn the skill on/off for yourself
|
|
21
|
-
--add-user <userId> For share: grant a user access (use with --role)
|
|
22
|
-
--remove-user <userId> For share: revoke a user's access
|
|
23
|
-
--role owner|editor|viewer Role for --add-user (default: viewer)
|
|
24
|
-
--json Output JSON (for list/upload)
|
|
25
|
-
`)}function Ae(e,r){let o=f.relative(e,r);return o===""||!o.startsWith("..")&&!f.isAbsolute(o)}async function De(e){let r=await k.realpath(e),o=[process.cwd(),T.homedir()];if(!(await Promise.all(o.map(async s=>{try{return await k.realpath(s)}catch{return f.resolve(s)}}))).some(s=>Ae(s,r)))throw new Error("Invalid upload path: must be within the current directory or your home directory.")}async function Ne(e){let r=await k.mkdtemp(f.join(T.tmpdir(),"entrydesk-skill-")),o=f.join(r,`${f.basename(e)}.zip`);return await new Promise((t,i)=>{let s=j.createWriteStream(o),c=Pe("zip",{zlib:{level:9}});s.on("close",()=>t()),s.on("error",i),c.on("error",i),c.pipe(s),c.directory(e,!1),c.finalize()}),{zipPath:o,cleanupDir:r}}function Fe(e){console.log(`Versions (${e.length}):
|
|
26
|
-
`);for(let r of e){let o=new Date(r.createdAt).toLocaleString();if(console.log(` v${r.versionNumber} \xB7 ${o}`),r.description){let t=r.description.length>100?`${r.description.slice(0,100)}...`:r.description;console.log(` ${t}`)}console.log(` Version ID: ${r.id}`),console.log("")}}function Ue(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 Sr(e){if(e.help){v();return}let r,o;try{let n=await J();r=n.accessToken,o=n.workspaceId}catch(n){F(n)}let t=e.action||"list",i=new _;if(ne(t)){try{await se(e,{accessToken:r,workspaceId:o,client:i})}catch(n){F(n)}return}if(t==="upload"){let n=e.configKey;n||(console.error("Missing file path."),v(),process.exit(1));let u=f.resolve(n),l;try{l=await k.stat(u)}catch{console.error(`File not found: ${u}`),process.exit(1)}let p=u,h=null;try{try{await De(u)}catch(d){let a=d instanceof Error?d.message:"Invalid upload path.";console.error(a),process.exit(1)}if(l.isDirectory()){let d=await Ne(u);p=d.zipPath,h=d.cleanupDir}else l.isFile()||(console.error(`Not a file or directory: ${u}`),process.exit(1));f.extname(p).toLowerCase()!==".zip"&&(console.error("Only .zip files are supported for upload."),process.exit(1));let S=await k.readFile(p),m=new FormData;m.append("file",new Blob([S],{type:"application/zip"}),f.basename(p)),e.force&&m.append("force","true");let g;try{g=await i.uploadSkill(r,o,m)}catch(d){if(Ee(d)&&d.response.status===409){let{code:a}=z(d.data);a==="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(g));return}console.log(`Uploaded skill: ${g.name}`),console.log(` ID: ${g.id}`),console.log(` Version ID: ${g.versionId}`),console.log(` Description: ${g.description}`);return}finally{h&&await k.rm(h,{recursive:!0,force:!0})}}if(t==="toggle"){let n=e.configKey;n||(console.error("Missing skill ID."),v(),process.exit(1)),e.enable===e.disable&&(console.error("Pass exactly one of --enable or --disable."),process.exit(1));let u=!!e.enable,l=await i.updateSkillPreference(r,o,n,u);if(e.json){console.log(JSON.stringify(l));return}console.log(`${l.isEnabled?"Enabled":"Disabled"} skill for you: ${n}`);return}if(t==="versions"){let n=e.configKey;n||(console.error("Missing skill ID."),v(),process.exit(1));let u=await i.getSkillVersions(r,o,n);if(e.json){console.log(JSON.stringify(u));return}if(u.versions.length===0){console.log("No versions for this skill.");return}Fe(u.versions);return}if(t==="share"){let n=e.configKey;n||(console.error("Missing skill ID."),v(),process.exit(1));let u=e.role??"viewer";if(e.addUser){let p=await i.upsertSkillGrant(r,o,n,e.addUser,u);if(e.json){console.log(JSON.stringify(p));return}console.log(`Granted ${u} to user ${e.addUser}`);return}if(e.removeUser){if(await i.removeSkillGrant(r,o,n,e.removeUser),e.json){console.log(JSON.stringify({userId:e.removeUser,removed:!0}));return}console.log(`Revoked access for user ${e.removeUser}`);return}let l=await i.getSkillGrants(r,o,n);if(e.json){console.log(JSON.stringify(l));return}Ue(l);return}if(t==="delete"){let n=e.configKey;n||(console.error("Missing skill ID."),v(),process.exit(1)),await i.deleteSkill(r,o,n),console.log(`Deleted skill: ${n}`);return}if(t==="download"){let n=e.configKey;n||(console.error("Missing skill ID."),v(),process.exit(1));let{url:u,name:l}=await i.downloadSkillCurrent(r,o,n);(l.includes("/")||l.includes(f.sep)||l==="."||l===".."||!l)&&(console.error(`Invalid skill name for output directory: ${l}`),process.exit(1));let p=f.resolve(l),h=await k.mkdtemp(f.join(T.tmpdir(),"entrydesk-skill-download-")),S=f.join(h,`${l}.zip`);try{let m=await fetch(u);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 g=j.createWriteStream(S);await Le(je.fromWeb(m.body),g);let d=await k.mkdtemp(f.join(f.dirname(p),".entrydesk-skill-extract-")),a=null;try{e.json||console.log("Extracting...");let L=new $e(S),le=f.resolve(d)+f.sep;for(let x of L.getEntries()){if(x.isDirectory)continue;let N=f.resolve(d,x.entryName);if(!N.startsWith(le))throw new Error(`Zip entry contains path traversal: ${x.entryName}`);await k.mkdir(f.dirname(N),{recursive:!0}),await k.writeFile(N,x.getData())}j.existsSync(p)&&(a=f.join(f.dirname(p),`.entrydesk-backup-${be.randomUUID()}`),e.json||console.log(`Replacing existing directory: ${p}`),await k.rename(p,a));try{await k.rename(d,p),a&&j.existsSync(a)&&(await k.rm(a,{recursive:!0,force:!0}),a=null)}catch(x){throw a&&j.existsSync(a)&&(await k.rename(a,p),a=null),x}}catch(L){if(await k.rm(d,{recursive:!0,force:!0}),a&&j.existsSync(a))try{await k.rename(a,p)}catch{console.error(`Warning: Could not restore backup. Your original files are at: ${a}`)}throw L}if(e.json){console.log(JSON.stringify({skillId:n,skillName:l,outputDir:p}));return}console.log(`Downloaded skill "${l}" to ${p}`)}finally{await k.rm(h,{recursive:!0,force:!0})}return}t!=="list"&&(console.error(`Unknown skills command: ${t}`),v(),process.exit(1));let s=[],c;do{let n=await i.listAvailableSkills(r,o,{createdBy:e.createdBy,nextKey:c,limit:100});s.push(...n.skills),c=n.nextKey}while(c);if(e.json){console.log(JSON.stringify(s));return}if(s.length===0){console.log("No skills found in this workspace.");return}console.log(`Available Skills (${s.length}):
|
|
27
|
-
`);for(let n of s)console.log(` ${n.name} (${n.provider})`),console.log(` ${n.description.slice(0,120)}`),console.log(` ID: ${n.id}`),console.log(` Author: ${n.author.name}`),console.log("")}export{v as printSkillsUsage,Sr as runSkills};
|