@entrydesk/cli 1.18.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.
- package/dist/{agents-7XASAILN.js → agents-6IGSCA3S.js} +1 -1
- package/dist/billing-SNTQDK4M.js +24 -0
- package/dist/{budget-E4MIKV33.js → budget-7A4HH6LK.js} +1 -1
- package/dist/{chunk-GQWF4JEC.js → chunk-UXJD5BRR.js} +2 -2
- package/dist/{config-JRJVFRT3.js → config-7SMTGR4C.js} +1 -1
- package/dist/{config-MAO5TQEB.js → config-ZQUW7BQS.js} +1 -1
- package/dist/{config-help-ZWR52H55.js → config-help-IJ6BGCBY.js} +1 -1
- package/dist/{connectors-KHWU2ZWF.js → connectors-C35PPZM3.js} +1 -1
- package/dist/help-UAGSVZIZ.js +4 -0
- package/dist/index.js +1 -1
- package/dist/{login-GGUSZBMP.js → login-NL4DUGVI.js} +1 -1
- package/dist/{logout-DDKAWMZ4.js → logout-FVV6V2UU.js} +1 -1
- package/dist/{mcp-VIM4EXHV.js → mcp-6JQHRC5J.js} +1 -1
- package/dist/{meeting-DWJABQ3Q.js → meeting-I5NQ2V3L.js} +1 -1
- package/dist/{models-LBT6N52A.js → models-YG7XKIZ2.js} +1 -1
- package/dist/{notifications-XQVFALKW.js → notifications-NVWXUDN6.js} +1 -1
- package/dist/{profile-QNR7NAEU.js → profile-SYH6PEBO.js} +1 -1
- package/dist/{schedules-JPOOWXID.js → schedules-GPV52YWB.js} +1 -1
- package/dist/skills-E2JJSSGW.js +25 -0
- package/dist/{status-Y4MUTFMJ.js → status-JGVG5T6F.js} +1 -1
- package/dist/{task-C3ITCXH4.js → task-O7MFJEU2.js} +60 -35
- package/dist/tasks-VQ4SIVJG.js +41 -0
- package/dist/{tool-HOWJ4M6M.js → tool-RZPDCROT.js} +6 -6
- package/dist/usage-LVG7HRCR.js +29 -0
- package/dist/{version-OVZYDUUX.js → version-4P4L2T22.js} +1 -1
- package/dist/{workflow-TXNP3Z53.js → workflow-KHE2MKD5.js} +1 -1
- package/dist/{workspaces-ENEOI2LZ.js → workspaces-ARL2DBCW.js} +1 -1
- package/package.json +3 -3
- package/dist/help-CJZSDNUL.js +0 -215
- package/dist/skills-QIEVXMWP.js +0 -25
- package/dist/tasks-LJHCATKL.js +0 -21
- package/dist/usage-R366J6YU.js +0 -18
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as I,q as A,r as O,t as v}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";var h="\x1B[2m",c="\x1B[0m",p="\x1B[36m",T="\x1B[33m",b="\x1B[32m",R="stream-json";function f(t,n){let r=n===void 0?{event:t}:{event:t,data:n};process.stdout.write(`${JSON.stringify(r)}
|
|
3
|
+
`)}function S(t){let n=new Date(t),e=new Date().getTime()-n.getTime(),o=Math.floor(e/(1e3*60*60*24));return o===0?n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):o===1?"Yesterday":o<7?`${o} days ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}var M="\x1B[1m";function j(t){return t.replace(/<mark>/g,M).replace(/<\/mark>/g,c).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function w(t,n){if(n)return t;let r=t.split(`
|
|
4
|
+
`);if(r.length<=15)return t;let e=r.slice(0,6),o=r.slice(-4),i=r.length-10;return[...e,`... (${i} lines omitted, use --full-output to see all) ...`,...o].join(`
|
|
5
|
+
`)}function N(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(N);let n={};for(let[r,e]of Object.entries(t))typeof e=="string"&&e.length>200?n[r]=e.slice(0,150)+"... (truncated)":typeof e=="object"&&e!==null?n[r]=N(e):n[r]=e;return n}function J(t){if(!t||typeof t!="object")return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function E(t,n){if(!t)return"(no result)";if(typeof t!="object")return w(String(t),n);let r=n?t:N(t);if("structuredContent"in r&&r.structuredContent){let e=r.structuredContent,o=[];if(e.stdout&&typeof e.stdout=="string"&&e.stdout.trim()&&o.push(e.stdout.trim()),e.stderr&&typeof e.stderr=="string"&&e.stderr.trim()&&o.push(`${T}[stderr]${c} ${e.stderr.trim()}`),e.urls&&Array.isArray(e.urls)){let i=e.urls;for(let s of i)s.path&&s.url&&o.push(`${s.path}: ${s.url}`)}return o.length===0&&o.push(JSON.stringify(e,null,2)),w(o.join(`
|
|
6
|
+
`),n)}if("content"in r&&Array.isArray(r.content)){let o=r.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
|
|
7
|
+
`);return w(o||JSON.stringify(t,null,2),n)}return w(JSON.stringify(t,null,2),n)}function D(t){if(typeof t.title=="string")return t.title;if(typeof t.toolName=="string")return t.toolName;let n=t.type;return n.startsWith("tool-")?n.slice(5).replace(/__/g," ").replace(/_/g," "):n}function L(t,n){let r=[];for(let e of t)if(e.type==="reasoning"&&e.text)r.push(`${h}${e.text}${c}`);else if(e.type==="text"&&e.text)r.push(e.text);else if(e.type==="tool-call"&&e.toolName){let o=[];if(o.push(`${p}\u250C\u2500 Tool Call: ${e.toolName}${c}`),e.args){o.push(`${T}\u2502 Arguments:${c}`);let i=J(e.args);for(let s of i.split(`
|
|
8
|
+
`))o.push(`${h}\u2502 ${s}${c}`)}if(e.result!==void 0){o.push(`${b}\u2502 Result:${c}`);let i=E(e.result,n);for(let s of i.split(`
|
|
9
|
+
`))o.push(`${h}\u2502 ${s}${c}`);o.push(`${p}\u2514\u2500 ${e.toolName} completed${c}`)}else e.state==="call"?o.push(`${p}\u2514\u2500 (awaiting result)${c}`):o.push(`${p}\u2514\u2500${c}`);r.push(o.join(`
|
|
10
|
+
`))}else if(e.type.startsWith("tool-")&&e.type!=="tool-call"){let o=D(e),i=[];if(i.push(`${p}\u250C\u2500 Tool: ${o}${c}`),e.input){i.push(`${T}\u2502 Input:${c}`);let s=J(e.input);for(let l of s.split(`
|
|
11
|
+
`))i.push(`${h}\u2502 ${l}${c}`)}if(e.output!==void 0&&e.state==="output-available"){i.push(`${b}\u2502 Output:${c}`);let s=E(e.output,n);for(let l of s.split(`
|
|
12
|
+
`))i.push(`${h}\u2502 ${l}${c}`);i.push(`${p}\u2514\u2500 completed${c}`)}else e.state==="call"||e.state==="partial-call"?i.push(`${p}\u2514\u2500 (in progress)${c}`):i.push(`${p}\u2514\u2500${c}`);r.push(i.join(`
|
|
13
|
+
`))}return r.join(`
|
|
14
|
+
|
|
15
|
+
`).trim()}function U(){console.log(`
|
|
16
|
+
Usage: entrydesk tasks [taskId] [options]
|
|
17
|
+
|
|
18
|
+
List your tasks, search them, or view a single task's messages.
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
-q, --search <query> Filter tasks by a search query
|
|
22
|
+
--limit <n> Max tasks to return (1-50)
|
|
23
|
+
--next-key <key> Pagination cursor from a previous page
|
|
24
|
+
-s, --share <shareId> View a shared task's messages (no login needed)
|
|
25
|
+
--output stream-json Stream a task's messages as JSON events
|
|
26
|
+
--full-output Show full tool outputs when viewing a task
|
|
27
|
+
--json Output JSON
|
|
28
|
+
|
|
29
|
+
Examples:
|
|
30
|
+
entrydesk tasks # List recent tasks
|
|
31
|
+
entrydesk tasks -q "deploy" --limit 20 # Search tasks
|
|
32
|
+
entrydesk tasks <taskId> # View a task's messages
|
|
33
|
+
entrydesk tasks <taskId> --full-output # ...with full tool outputs
|
|
34
|
+
entrydesk tasks -s <shareId> # View a shared task
|
|
35
|
+
`)}async function q(t){if(t.help){U();return}let n=t.output===R;t.output&&!n&&(console.error(`Invalid --output value. Supported: ${R}`),process.exit(1));let r=new I;if(t.shareId){let s;try{s=await A()}catch{}try{let l=await r.getSharedTask(t.shareId,s),{messages:a}=await r.getSharedMessages(t.shareId,50,s);if(t.json){console.log(JSON.stringify({task:l,messages:a}));return}if(n){if(f("task",l),a.length===0)f("info","No messages in this shared task.");else for(let u of a.toReversed())f("message",u);f("done");return}if(console.log(`Shared Task: ${l.title||"Untitled"}`),console.log(`Visibility: ${l.visibility}`),l.agent&&console.log(`Agent: ${l.agent.name}`),console.log(`${a.length} messages
|
|
36
|
+
`),a.length===0){console.log("No messages in this shared task.");return}let d=a.toReversed(),$=t.fullOutput??!1;for(let u of d){let y=L(u.parts,$);if(!y)continue;let x=u.role==="user"?"You":"Assistant";console.log(`[${x}] ${S(u.createdAt)}`),console.log(y),console.log("")}return}catch(l){if(l instanceof Error){let a=l.message.toLowerCase();a.includes("401")||a.includes("unauthorized")?console.error("Access denied. This shared task requires authentication or is not accessible to you."):a.includes("404")||a.includes("not found")?console.error("Shared task not found. The share ID may be invalid or the task was deleted."):console.error(`Failed to fetch shared task: ${l.message}`)}else console.error("Failed to fetch shared task");process.exit(1)}}let e,o;try{let s=await O();e=s.accessToken,o=s.workspaceId}catch(s){v(s)}if(t.taskId){let s=t.taskId,l=!1,a=null,d=parseInt(t.taskId,10);if(!isNaN(d)&&d>=0&&/^\d+$/.test(t.taskId)){let g=d===0?1:d,{tasks:k}=await r.getTasks(e,o,20);g>k.length&&(console.error(`Task number ${g} not found. You have ${k.length} recent tasks.`),process.exit(1));let m=k[g-1];s=m.id,l=!0,a=m,n||console.log(`Task: ${m.title||"Untitled"}
|
|
37
|
+
`)}let{messages:u}=await r.getMessages(e,o,s,50);if(t.json){console.log(JSON.stringify(u));return}if(n){if(a&&f("task",a),u.length===0)f("info","No messages in this task.");else for(let g of u.toReversed())f("message",g);f("done");return}if(u.length===0){console.log("No messages in this task.");return}let y=u.toReversed(),x=t.fullOutput??!1;l||console.log(`Task: ${t.taskId.slice(0,8)}...`),console.log(`${u.length} messages
|
|
38
|
+
`);for(let g of y){let k=L(g.parts,x);if(!k)continue;let m=g.role==="user"?"You":"Assistant";console.log(`[${m}] ${S(g.createdAt)}`),console.log(k),console.log("")}return}if(t.search){let{results:s,nextKey:l}=await r.searchTasks(e,o,t.search,{limit:t.limit,nextKey:t.nextKey});if(n){for(let a of s)f("task",a);f("done");return}if(t.json){console.log(JSON.stringify({results:s,nextKey:l}));return}if(s.length===0){console.log(`No tasks match "${t.search}".`);return}console.log(`Search results for "${t.search}" (${s.length}):
|
|
39
|
+
`),s.forEach((a,d)=>{let $=(d+1).toString().padStart(2," "),u=a.titleHighlight?j(a.titleHighlight):a.title||"Untitled";console.log(` ${$}. ${h}${S(a.createdAt)}${c} ${u}`),a.contentSnippet&&console.log(` ${j(a.contentSnippet)}`),console.log(` ${h}ID: ${a.id}${c}`)}),l&&console.log(`
|
|
40
|
+
Next page: --next-key ${l}`);return}let{tasks:i}=await r.getTasks(e,o,20);if(n){for(let s of i)f("task",s);f("done");return}if(t.json){console.log(JSON.stringify(i));return}if(i.length===0){console.log("No tasks found.");return}console.log(`Recent Tasks (${i.length}):
|
|
41
|
+
`),i.forEach((s,l)=>{let a=(l+1).toString().padStart(2," ");console.log(` ${a}. ${S(s.createdAt).padEnd(12)} ${s.title||"Untitled"}`)}),console.log(""),console.log("Use `entrydesk tasks 1` to view the most recent task"),console.log('Use `entrydesk task -c 1 -m "message"` to continue it')}export{U as printTasksHelp,j as renderHighlight,q as runTasks};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as S,
|
|
2
|
+
import{c as S,r as _}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";import R from"fs";import{Client as L}from"@modelcontextprotocol/sdk/client/index.js";import{StreamableHTTPClientTransport as v}from"@modelcontextprotocol/sdk/client/streamableHttp.js";async function A(e={}){let t=e.apiUrl,n=e.accessToken,o=e.workspaceId;if(!n||!o){let l=await _();n=n||l.accessToken,o=o||l.workspaceId}t||(t=S().apiUrl);let i=new L({name:"entrydesk-cli",version:"1.0.0"}),s=new URL(`${t}/v1/workspaces/${o}/mcp`),r=new v(s,{requestInit:{headers:{Authorization:`Bearer ${n}`}}});return await i.connect(r),i}async function T(){return A()}import h from"fs/promises";import D from"os";import d from"path";var y=!process.env.NO_COLOR&&!!process.stdout.isTTY,p={green:y?"\x1B[32m":"",yellow:y?"\x1B[33m":"",reset:y?"\x1B[0m":""},P=10*1024,O=8*1024,I=2*1024,b=100,M=100;function U(){return d.join(D.homedir(),".entrydesk","tool-results")}function F(e){let t=e.trim().replace(/[/\\:*?"<>|\s]/g,"_").replace(/_+/g,"_").replace(/^[._]+|[._]+$/g,"").slice(0,b);return!t||t==="."||t===".."?"unnamed_tool":t}function J(e){try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}n`:typeof n=="function"?"[Function]":typeof n=="symbol"?n.toString():n,2)}catch{return String(e)}}function B(e){let t=new Date,n=[t.getFullYear(),String(t.getMonth()+1).padStart(2,"0"),String(t.getDate()).padStart(2,"0")].join("-")+"_"+[String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0")].join("-"),o=F(e);return`${n}_${o}.json`}async function N(e,t){try{return await h.writeFile(e,t,{encoding:"utf8",flag:"wx"}),!0}catch(n){if(n instanceof Error&&"code"in n&&n.code==="EEXIST")return!1;throw n}}async function C(e,t){try{let n=U();await h.mkdir(n,{recursive:!0});let o=B(e),i=d.extname(o),s=o.slice(0,-i.length),r=J(t),l=d.join(n,o);if(await N(l,r))return l;for(let c=1;c<=M;c++){let w=d.join(n,`${s}-${c}${i}`);if(await N(w,r))return w}let u=Math.random().toString(36).slice(2,10),a=d.join(n,`${s}-${u}${i}`);return await h.writeFile(a,r,{encoding:"utf8",flag:"wx"}),a}catch(n){let o=n instanceof Error?n.message:"unknown error";return console.error(`${p.yellow}Warning: Could not save result to file: ${o}${p.reset}`),null}}function k(e,t){let n=Buffer.byteLength(e,"utf8");if(n<=P)return e;let o=e.slice(0,O),i=e.slice(-I),r=((n-O-I)/1024).toFixed(1),l=(n/1024).toFixed(1),u=` ... (skipped ${r}KB of ${l}KB) ...`;return t&&(u+=`
|
|
3
3
|
Tip: jq -r '.structuredContent.field' <file> | grep/head/tail`),`${o}
|
|
4
4
|
|
|
5
5
|
${u}
|
|
6
6
|
|
|
7
|
-
${i}`}function $(e){console.log(`${p.green}Tool execution result saved to: ${e}${p.reset}`),console.log()}function E(){console.log(`${p.green}Tool execution result:${p.reset}`)}function
|
|
8
|
-
`)}function
|
|
9
|
-
`)}async function
|
|
10
|
-
`);for(let r of i)console.log(
|
|
7
|
+
${i}`}function $(e){console.log(`${p.green}Tool execution result saved to: ${e}${p.reset}`),console.log()}function E(){console.log(`${p.green}Tool execution result:${p.reset}`)}function H(e){return e.split("__")[0]??e}function f(e,t,n){console.error(n?JSON.stringify({error:{code:e,message:t}}):`Error [${e}]: ${t}`),process.exit(1)}function g(e,t,n="CONNECTION_FAILED"){let o=e instanceof Error?e.message:"Unknown error";o.includes("Not logged in")||o.includes("not-logged-in")?f("AUTH_MISSING",o,t):f(n,o,t)}async function Y(){return process.stdin.isTTY?null:new Promise(e=>{let t=[],n=!1,o=!1,i,s,r,l,u=()=>{clearTimeout(i),process.stdin.removeListener("data",s),process.stdin.removeListener("end",r),process.stdin.removeListener("error",l)},a=c=>{o||(o=!0,u(),e(c))};s=c=>{n=!0,clearTimeout(i),t.push(c)},r=()=>{t.length===0?a(null):a(Buffer.concat(t).toString("utf-8").trim())},l=()=>{a(null)},i=setTimeout(()=>{n||a(null)},100),process.stdin.on("data",s),process.stdin.on("end",r),process.stdin.on("error",l),process.stdin.resume()})}var m=class extends Error{constructor(t){super(t),this.name="InputError"}};async function V(e,t){if(e)return e;if(t)try{return R.readFileSync(t,"utf-8").trim()}catch(o){let i=o instanceof Error?o.message:"Failed to read input file";throw new m(`Failed to read input file: ${i}`)}let n=await Y();if(n)return n;throw new m("Input JSON is required. Use --input, --input-file, or pipe via stdin")}function q(e){let t=[];return t.push(`Tool: ${e.name}`),e.description&&t.push(` Description: ${e.description}`),t.join(`
|
|
8
|
+
`)}function X(e){let t=[];return t.push(`Tool: ${e.name}`),e.description&&(t.push("Description:"),t.push(` ${e.description}`)),t.push("Input Schema:"),t.push(JSON.stringify(e.inputSchema,null,2)),t.join(`
|
|
9
|
+
`)}async function z(e,t){let n=await T().catch(o=>{g(o,e)});try{let i=(await n.listTools()).tools;if(t){let s=t.toLowerCase();i=i.filter(r=>H(r.name).toLowerCase().startsWith(s))}if(e)console.log(JSON.stringify(i,null,2));else{let s=t?` (prefix: ${t})`:"";console.log(`Available Tools (${i.length})${s}:
|
|
10
|
+
`);for(let r of i)console.log(q(r)),console.log()}}catch(o){g(o,e)}finally{await n.close().catch(()=>{})}}async function G(e,t){let n=await T().catch(o=>{g(o,t)});try{let i=(await n.listTools()).tools.find(s=>s.name===e);i||f("TOOL_NOT_FOUND",`Tool not found: ${e}`,t),console.log(t?JSON.stringify(i,null,2):X(i))}catch(o){g(o,t)}finally{await n.close().catch(()=>{})}}async function K(e,t,n){let o;try{o=JSON.parse(t)}catch(r){let l=r instanceof Error?`Invalid JSON input: ${r.message}`:"Invalid JSON input";f("INVALID_INPUT",l,n)}let i=await T().catch(r=>{g(r,n,"TOOL_CALL_FAILED")}),s=!1;try{let r=await i.callTool({name:e,arguments:o});if(n)console.log(JSON.stringify(r,null,2));else{let l=await C(e,r);l&&$(l),E();let u=r.content;for(let a of u)a.type==="text"?console.log(a.text):a.type==="image"?console.log(`[Image: ${a.mimeType}]`):a.type==="resource"?console.log(`[Resource: ${a.resource?.uri??"unknown"}]`):console.log(JSON.stringify(a,null,2));if(r.structuredContent){let a=JSON.stringify(r.structuredContent,null,2),c=k(a,l);console.log(c)}}r.isError&&(s=!0)}catch(r){g(r,n,"TOOL_CALL_FAILED")}finally{await i.close().catch(()=>{})}s&&process.exit(1)}function x(){console.log(`Usage: entrydesk tool <action> [options]
|
|
11
11
|
|
|
12
12
|
Actions:
|
|
13
13
|
list List all available tools
|
|
@@ -32,4 +32,4 @@ Examples:
|
|
|
32
32
|
entrydesk tool call agent__search_agents --input '{"limit": 5}'
|
|
33
33
|
entrydesk tool call agent__search_agents --input-file input.json
|
|
34
34
|
echo '{"limit": 5}' | entrydesk tool call agent__search_agents
|
|
35
|
-
`);break}}export{m as InputError,
|
|
35
|
+
`)}async function at(e){let t=e.json??!1;if(e.help){x();return}switch(e.action){case"list":await z(t,e.prefix);break;case"get":e.name||f("INVALID_INPUT","Tool name is required",t),await G(e.name,t);break;case"call":{e.name||f("INVALID_INPUT","Tool name is required",t);let n;try{n=await V(e.input,e.inputFile)}catch(o){throw o instanceof m&&f("INVALID_INPUT",o.message,t),o}await K(e.name,n,t);break}default:x();break}}export{m as InputError,V as getInputJson,x as printToolUsage,Y as readStdin,at as runTool};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as d,r as y,t as U}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";import{writeFileSync as S}from"fs";function $(){console.log(`
|
|
3
|
+
Usage: entrydesk usage [balance|me|consumptions|export] [options]
|
|
4
|
+
|
|
5
|
+
Commands:
|
|
6
|
+
(default) Per-user monthly cost/operations summary
|
|
7
|
+
balance Workspace USD balance, spend, and limits
|
|
8
|
+
me Your own usage and availability
|
|
9
|
+
consumptions Per-user extra-usage breakdown (--limit/--offset)
|
|
10
|
+
export Export per-user usage as CSV (-o <file>, else stdout)
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
--limit <number> Limit rows (default: all for summary; 20 for consumptions)
|
|
14
|
+
--sort-by cost|operations Sort the summary by cost or operations (default: cost)
|
|
15
|
+
--offset <number> Offset for consumptions pagination
|
|
16
|
+
--period-start <ISO> Period start for consumptions/export
|
|
17
|
+
-o, --output <file> Write export CSV to a file (default: stdout)
|
|
18
|
+
--json Output JSON
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
entrydesk usage balance
|
|
22
|
+
entrydesk usage me
|
|
23
|
+
entrydesk usage consumptions --limit 20
|
|
24
|
+
entrydesk usage export -o usage.csv
|
|
25
|
+
`)}function s(o){return`$${o.toFixed(2)}`}function C(o){console.log(`Extra-usage balance: ${s(o.balanceUsd)}`);let n=o.currentSpentUsedPercent!=null?` (${o.currentSpentUsedPercent}% of limit)`:"";console.log(`Spent this period: ${s(o.currentSpentUsd)}${n}`),o.monthlyExtraUsageLimitUsd!=null&&console.log(`Workspace limit: ${s(o.monthlyExtraUsageLimitUsd)} / month`),o.memberMonthlyExtraUsageLimitUsd!=null&&console.log(`Per-member limit: ${s(o.memberMonthlyExtraUsageLimitUsd)} / month`),o.nextExpiry&&console.log(`Next expiry: ${s(o.nextExpiry.amountUsd)} at ${new Date(o.nextExpiry.expiresAt).toLocaleString()}`),console.log(`Period: ${new Date(o.period.startAt).toLocaleDateString()} \u2013 ${new Date(o.period.endAt).toLocaleDateString()}`)}function b(o){console.log(`Seat type: ${o.seatType}`),o.hourly&&console.log(`Hourly used: ${o.hourly.usedPercent}%`),console.log(`Weekly used: ${o.weekly.usedPercent}%`),console.log(`Extra spent: ${s(o.extraUsage.spentUsd)}`),console.log(`Available: ${o.availability.allowed?"yes":`no (${o.availability.reason??"unknown"})`}`),o.trial&&console.log(`Trial: ${o.trial.remainingDays} days remaining`)}function k(o){console.log(`Consumptions (${o.items.length} of ${o.total}):
|
|
26
|
+
`);for(let n of o.items)console.log(` ${n.user.name} (${n.user.email})`),console.log(` Seat: ${n.seatType} \xB7 Extra usage: ${s(n.extraUsage)}`),console.log(` User ID: ${n.user.id}`),console.log("")}async function P(o){if(o.help){$();return}let n,i;try{let e=await y();n=e.accessToken,i=e.workspaceId}catch(e){let a=e instanceof Error?e.message:"Authentication failed";console.error(a),process.exit(1)}let r=new d;try{if(o.action==="balance"){let t=await r.getUsageOverview(n,i);if(o.json){console.log(JSON.stringify(t));return}C(t);return}if(o.action==="me"){let t=await r.getUsageMe(n,i);if(o.json){console.log(JSON.stringify(t));return}b(t);return}if(o.action==="consumptions"){let t=await r.getUsageConsumptions(n,i,{limit:o.limit,offset:o.offset,periodStart:o.periodStart});if(o.json){console.log(JSON.stringify(t));return}if(t.items.length===0){console.log("No consumptions for this period.");return}k(t);return}if(o.action==="export"){let t=await r.exportUsageCsv(n,i,o.periodStart);o.output?(S(o.output,t),console.log(`Wrote usage CSV to ${o.output}`)):process.stdout.write(t);return}o.action&&(console.error(`Unknown usage command: ${o.action}`),$(),process.exit(1));let e=[],a,u=0,h=100;do{let t=await r.getMonthlyUsages(n,i,{nextKey:a,limit:100});if(e.push(...t.monthlyUsages),a=t.nextKey,u++,u>=h){console.error(`Warning: Showing first ${e.length} entries (pagination limit reached)`);break}}while(a);if(o.json){console.log(JSON.stringify(e));return}if(e.length===0){console.log("No usage data found for this workspace.");return}console.log(`Current Month Usage:
|
|
27
|
+
`);let g=0,p=0;for(let t of e)g+=parseFloat(t.totalCost),p+=t.operationCount;console.log(`Total Cost: $${g.toFixed(2)}`),console.log(`Total Operations: ${p.toLocaleString()}`),console.log(`Users: ${e.length}
|
|
28
|
+
`);let m=o.sortBy||"cost",f=[...e].toSorted((t,c)=>m==="cost"?parseFloat(c.totalCost)-parseFloat(t.totalCost):c.operationCount-t.operationCount),x=o.limit&&o.limit>0?o.limit:f.length,l=f.slice(0,x);console.log(`Usage by User (sorted by ${m}, showing ${l.length} of ${e.length}):
|
|
29
|
+
`);for(let t of l){let c=parseFloat(t.totalCost);console.log(` ${t.user.name} (${t.user.email})`),console.log(` Cost: $${c.toFixed(2)}`),console.log(` Operations: ${t.operationCount.toLocaleString()}`),console.log("")}l.length<e.length&&console.log(`... and ${e.length-l.length} more users`)}catch(e){U(e)}}export{P as runUsage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-KURQCTT3.js";function n(){console.log("entrydesk 1.
|
|
2
|
+
import"./chunk-KURQCTT3.js";function n(){console.log("entrydesk 1.19.0")}export{n as printVersion};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as u,
|
|
2
|
+
import{h as u,r as p,t as g}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";import{readFileSync as $}from"fs";var k=262144,x=new Set(["completed","failed","cancelled"]);function f(){console.log(`
|
|
3
3
|
Usage: entrydesk workflow [list|get|create|update|run|runs|run-get|share] [options]
|
|
4
4
|
|
|
5
5
|
Commands:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{g as a,h as w,
|
|
2
|
+
import{g as a,h as w,q as k}from"./chunk-UXJD5BRR.js";import"./chunk-KURQCTT3.js";function l(){console.log(`
|
|
3
3
|
Usage: entrydesk workspaces [list|switch|use] [options]
|
|
4
4
|
|
|
5
5
|
Commands:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entrydesk/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "EntryDesk CLI - Interact with EntryDesk from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"typescript": "^6.0.3",
|
|
38
38
|
"vitest": "^4.1.6",
|
|
39
39
|
"@entrydesk/ci": "^0.0.0",
|
|
40
|
-
"@entrydesk/
|
|
41
|
-
"@entrydesk/
|
|
40
|
+
"@entrydesk/shared": "^0.0.0",
|
|
41
|
+
"@entrydesk/utils": "^0.0.0"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"keytar": "^7.9.0"
|
package/dist/help-CJZSDNUL.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-KURQCTT3.js";function e(){console.log(`
|
|
3
|
-
EntryDesk CLI - Interact with EntryDesk from your terminal
|
|
4
|
-
|
|
5
|
-
Usage: entrydesk <command> [options]
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
login Authenticate with EntryDesk
|
|
9
|
-
logout Sign out and clear credentials
|
|
10
|
-
status Show current authentication status
|
|
11
|
-
workspaces List or switch workspaces
|
|
12
|
-
models List available models
|
|
13
|
-
agents List available agents
|
|
14
|
-
meeting List, view, or manage meetings and recordings
|
|
15
|
-
workflow List, create, run, or manage workflows
|
|
16
|
-
notifications List, count, or mark notifications read
|
|
17
|
-
skills List or upload skills
|
|
18
|
-
schedules List or manage scheduled tasks
|
|
19
|
-
connectors List connected connectors
|
|
20
|
-
tool List, get, or call MCP tools
|
|
21
|
-
profile Manage profiles
|
|
22
|
-
tasks List recent tasks or view messages
|
|
23
|
-
task Send a message or start interactive task
|
|
24
|
-
budget View or manage workspace budget
|
|
25
|
-
usage View current month usage statistics
|
|
26
|
-
mcp-server Start MCP server (stdio or HTTP)
|
|
27
|
-
config Manage CLI configuration
|
|
28
|
-
help Show this help message
|
|
29
|
-
version Show version number
|
|
30
|
-
|
|
31
|
-
Global Options:
|
|
32
|
-
--json Output in JSON format (for scripting)
|
|
33
|
-
-i Interactive mode (for task)
|
|
34
|
-
--profile Use a specific profile for this command
|
|
35
|
-
|
|
36
|
-
Login:
|
|
37
|
-
entrydesk login # Open browser login (OAuth Device Flow)
|
|
38
|
-
|
|
39
|
-
Task:
|
|
40
|
-
entrydesk task -m "Hello" --model <model> # Send with model
|
|
41
|
-
entrydesk task -m "Hello" -a <agent> # Send with agent
|
|
42
|
-
entrydesk task -c 1 -m "Follow up" # Continue recent task
|
|
43
|
-
entrydesk task -i # Interactive mode
|
|
44
|
-
echo "Hello" | entrydesk task --model <m> # Pipe input from stdin
|
|
45
|
-
entrydesk task -m "Hi" --model <m> --plain # Plain text output
|
|
46
|
-
entrydesk task -m "Hi" --model <m> --output stream-json # Stream JSON
|
|
47
|
-
entrydesk task -i --no-file-system # Disable local file operations
|
|
48
|
-
entrydesk task -i --connectors id1,id2 # Use specific connectors
|
|
49
|
-
|
|
50
|
-
MCP Server:
|
|
51
|
-
entrydesk mcp-server # Start stdio server
|
|
52
|
-
entrydesk mcp-server --http --port 3100 # Start HTTP server
|
|
53
|
-
|
|
54
|
-
Tool Operations:
|
|
55
|
-
entrydesk tool list # List all available tools
|
|
56
|
-
entrydesk tool list --prefix sandbox # Filter by prefix
|
|
57
|
-
entrydesk tool get <name> # Get tool details
|
|
58
|
-
entrydesk tool call <name> --input {} # Execute a tool
|
|
59
|
-
|
|
60
|
-
Workspaces:
|
|
61
|
-
entrydesk workspaces # List all workspaces
|
|
62
|
-
entrydesk workspaces switch <id> # Switch to a workspace
|
|
63
|
-
entrydesk workspaces use <id> # Alias for switch
|
|
64
|
-
|
|
65
|
-
Budget:
|
|
66
|
-
entrydesk budget # Show current budget
|
|
67
|
-
entrydesk budget get # Show current budget
|
|
68
|
-
entrydesk budget set 100.00 # Set budget to $100.00
|
|
69
|
-
entrydesk budget clear # Remove budget
|
|
70
|
-
|
|
71
|
-
Usage:
|
|
72
|
-
entrydesk usage # Show current month usage (top users by cost)
|
|
73
|
-
entrydesk usage --limit 20 # Show top 20 users
|
|
74
|
-
entrydesk usage --sort-by operations # Sort by operations instead of cost
|
|
75
|
-
entrydesk usage --limit 10 --sort-by cost # Top 10 by cost
|
|
76
|
-
entrydesk usage --json # Get usage as JSON
|
|
77
|
-
|
|
78
|
-
Tasks:
|
|
79
|
-
entrydesk tasks # List recent tasks
|
|
80
|
-
entrydesk tasks --search "bug fix" # Search tasks (title + content)
|
|
81
|
-
entrydesk tasks -q "\u5831\u8868" --limit 10 # Search, short flag + page size
|
|
82
|
-
entrydesk tasks 1 # View task #1 messages
|
|
83
|
-
entrydesk tasks <uuid> # View task by ID
|
|
84
|
-
entrydesk tasks --share <shareId> # View shared task by share ID
|
|
85
|
-
entrydesk tasks -s <shareId> # Short form for --share
|
|
86
|
-
entrydesk tasks --share <id> --json # Get shared task as JSON
|
|
87
|
-
|
|
88
|
-
Examples:
|
|
89
|
-
$ entrydesk login
|
|
90
|
-
$ entrydesk status
|
|
91
|
-
$ entrydesk workspaces # List workspaces
|
|
92
|
-
$ entrydesk workspaces switch <workspaceId> # Switch workspace
|
|
93
|
-
$ entrydesk budget # View budget
|
|
94
|
-
$ entrydesk budget set 100.00 # Set budget
|
|
95
|
-
$ entrydesk budget clear # Clear budget
|
|
96
|
-
$ entrydesk usage # View usage (all users, sorted by cost)
|
|
97
|
-
$ entrydesk usage --limit 10 # Show top 10 users
|
|
98
|
-
$ entrydesk usage --sort-by operations # Sort by operation count
|
|
99
|
-
$ entrydesk models --json
|
|
100
|
-
$ entrydesk agents --json
|
|
101
|
-
$ entrydesk agents create --name "My Agent" --description "..." --system-prompt "..." --model-id <modelId>
|
|
102
|
-
$ entrydesk agents update <agentId> --name "New Name" --description "..." --system-prompt "..." --model-id <modelId>
|
|
103
|
-
$ entrydesk agents delete <agentId>
|
|
104
|
-
$ entrydesk skills
|
|
105
|
-
$ entrydesk skills upload ./my-skill.zip
|
|
106
|
-
$ entrydesk skills upload ./my-skill-folder
|
|
107
|
-
$ entrydesk task -m "Hello" --model gemini-2.5-flash-lite
|
|
108
|
-
$ entrydesk tasks # List recent tasks
|
|
109
|
-
$ entrydesk tasks 1 # View task #1 messages
|
|
110
|
-
$ entrydesk task -c 1 -m "Tell me more" # Continue task #1
|
|
111
|
-
$ entrydesk tasks 0 --output stream-json # Stream recent task as JSON
|
|
112
|
-
$ entrydesk tasks --share <shareId> # View shared task
|
|
113
|
-
|
|
114
|
-
Piping:
|
|
115
|
-
$ echo "Explain this code" | entrydesk task --model gemini-2.5-flash-lite
|
|
116
|
-
$ cat file.txt | entrydesk task -c 1 # Pipe file content
|
|
117
|
-
$ entrydesk task -m "Hi" --model <m> > out.txt # Save to file
|
|
118
|
-
|
|
119
|
-
Usage Examples:
|
|
120
|
-
$ entrydesk usage # Show all users, sorted by cost
|
|
121
|
-
$ entrydesk usage --limit 10 # Show top 10 users
|
|
122
|
-
$ entrydesk usage --sort-by operations # Sort by operation count
|
|
123
|
-
|
|
124
|
-
Configuration:
|
|
125
|
-
entrydesk config # Show current config
|
|
126
|
-
entrydesk config set <key> <value> # Set a config value
|
|
127
|
-
entrydesk config unset <key> # Remove a config value
|
|
128
|
-
|
|
129
|
-
Profiles:
|
|
130
|
-
entrydesk profile # List profiles
|
|
131
|
-
entrydesk profile create <name> # Create a profile
|
|
132
|
-
entrydesk profile use <name> # Switch active profile
|
|
133
|
-
entrydesk profile delete <name> # Delete a profile
|
|
134
|
-
entrydesk profile rename <from> <to> # Rename a profile
|
|
135
|
-
entrydesk profile clone <from> <to> # Clone config defaults (no credentials)
|
|
136
|
-
|
|
137
|
-
Skills:
|
|
138
|
-
entrydesk skills # List skills
|
|
139
|
-
entrydesk skills list --me # List my skills
|
|
140
|
-
entrydesk skills toggle <id> --disable # Turn a skill off for yourself
|
|
141
|
-
entrydesk skills versions <id> # Version history
|
|
142
|
-
entrydesk skills share <id> --add-user <userId> --role editor
|
|
143
|
-
entrydesk skills upload <file.zip> # Upload a skill zip
|
|
144
|
-
entrydesk skills upload <folder> # Upload a skill folder
|
|
145
|
-
entrydesk skills upload <file.zip> --force
|
|
146
|
-
entrydesk skills delete <skillId>
|
|
147
|
-
|
|
148
|
-
Agents:
|
|
149
|
-
entrydesk agents # List agents
|
|
150
|
-
entrydesk agents --mine # List your own agents (with publish state)
|
|
151
|
-
entrydesk agents show <agentId> # Show one agent's full details
|
|
152
|
-
entrydesk agents create --name "My Agent" --description "..." --system-prompt "..." --model-id <modelId>
|
|
153
|
-
entrydesk agents update <agentId> --name "New Name" --description "..." --system-prompt "..." --model-id <modelId>
|
|
154
|
-
entrydesk agents publish <agentId> # Publish to the workspace
|
|
155
|
-
entrydesk agents share <agentId> --add-user <userId> --role editor
|
|
156
|
-
entrydesk agents delete <agentId>
|
|
157
|
-
|
|
158
|
-
Meetings:
|
|
159
|
-
entrydesk meeting # List meetings
|
|
160
|
-
entrydesk meeting list --filter mine # Only my meetings
|
|
161
|
-
entrydesk meeting list --search "sprint" # Search meetings
|
|
162
|
-
entrydesk meeting get <meetingId> # Meeting details + recordings
|
|
163
|
-
entrydesk meeting create --title "Sprint Planning" --start 2026-06-20T09:00:00Z
|
|
164
|
-
entrydesk meeting update <meetingId> --status completed
|
|
165
|
-
entrydesk meeting delete <meetingId>
|
|
166
|
-
entrydesk meeting summary <meetingId> # Print summary to stdout
|
|
167
|
-
entrydesk meeting transcript <recordingId> # Print transcript (--raw for timestamps)
|
|
168
|
-
entrydesk meeting previous <meetingId> # Previous meeting brief
|
|
169
|
-
entrydesk meeting share <meetingId> # Show sharing (visibility + grants)
|
|
170
|
-
entrydesk meeting share <meetingId> --visibility workspace
|
|
171
|
-
entrydesk meeting share <meetingId> --add-user <userId> --role editor
|
|
172
|
-
entrydesk meeting transcript <recordingId> | entrydesk task -m "List action items"
|
|
173
|
-
|
|
174
|
-
Workflows:
|
|
175
|
-
entrydesk workflow # List workflows
|
|
176
|
-
entrydesk workflow list --search report
|
|
177
|
-
entrydesk workflow get <workflowId> # Details (--show-source for script)
|
|
178
|
-
entrydesk workflow create --name "Nightly" --file ./flow.js
|
|
179
|
-
entrydesk workflow update <workflowId> --deactivate
|
|
180
|
-
entrydesk workflow run <workflowId> --args '{"date":"2026-06-20"}' --wait
|
|
181
|
-
entrydesk workflow runs <workflowId> # List runs
|
|
182
|
-
entrydesk workflow run-get <workflowId> <runId>
|
|
183
|
-
entrydesk workflow share <workflowId> --add-user <userId> --role editor
|
|
184
|
-
|
|
185
|
-
Notifications:
|
|
186
|
-
entrydesk notifications # List notifications
|
|
187
|
-
entrydesk notifications --tab action # Only actionable ones
|
|
188
|
-
entrydesk notifications unread # Unread count
|
|
189
|
-
entrydesk notifications read <id> # Mark one read
|
|
190
|
-
entrydesk notifications read-all # Mark all read
|
|
191
|
-
|
|
192
|
-
Schedules:
|
|
193
|
-
entrydesk schedules # List schedules
|
|
194
|
-
entrydesk schedules get <id> # Show schedule details
|
|
195
|
-
entrydesk schedules edit <id> --prompt "New prompt" # Update fields
|
|
196
|
-
entrydesk schedules pause <id> # Pause / activate <id> to resume
|
|
197
|
-
entrydesk schedules run <id> # Run now (prints taskId)
|
|
198
|
-
entrydesk schedules runs <id> # Run history
|
|
199
|
-
entrydesk schedules create \\
|
|
200
|
-
--name "Daily Report" \\
|
|
201
|
-
--agent-id <agentId> \\
|
|
202
|
-
--prompt "Generate report" \\
|
|
203
|
-
--starts-at "2025-01-01T09:00:00Z" \\
|
|
204
|
-
--repeat-type days --every 1 --time 09:00 \\
|
|
205
|
-
--utc-offset "+08:00"
|
|
206
|
-
entrydesk schedules delete <id> # Delete a schedule
|
|
207
|
-
|
|
208
|
-
Available keys: apiUrl, hubUrl
|
|
209
|
-
|
|
210
|
-
Local Development:
|
|
211
|
-
$ entrydesk config set apiUrl http://localhost:3200
|
|
212
|
-
$ entrydesk config set hubUrl http://localhost:3000
|
|
213
|
-
|
|
214
|
-
For more information, visit https://entrydesk.com/docs/cli
|
|
215
|
-
`)}export{e as printHelp};
|
package/dist/skills-QIEVXMWP.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as D,j as I,q as U,s as z}from"./chunk-GQWF4JEC.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 w(){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){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."),w(),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 g;try{g=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(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{y&&await c.rm(y,{recursive:!0,force:!0})}}if(p==="toggle"){let o=e.configKey;o||(console.error("Missing skill ID."),w(),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."),w(),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."),w(),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."),w(),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."),w(),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 g=v.createWriteStream($);await E(N.fromWeb(m.body),g);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}`),w(),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{oe as runSkills};
|
package/dist/tasks-LJHCATKL.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as A,p as I,q as b,s as O}from"./chunk-GQWF4JEC.js";import"./chunk-KURQCTT3.js";var h="\x1B[2m",a="\x1B[0m",p="\x1B[36m",w="\x1B[33m",R="\x1B[32m",v="stream-json";function f(t,n){let r=n===void 0?{event:t}:{event:t,data:n};process.stdout.write(`${JSON.stringify(r)}
|
|
3
|
-
`)}function S(t){let n=new Date(t),e=new Date().getTime()-n.getTime(),o=Math.floor(e/(1e3*60*60*24));return o===0?n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):o===1?"Yesterday":o<7?`${o} days ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}var D="\x1B[1m";function j(t){return t.replace(/<mark>/g,D).replace(/<\/mark>/g,a).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function T(t,n){if(n)return t;let r=t.split(`
|
|
4
|
-
`);if(r.length<=15)return t;let e=r.slice(0,6),o=r.slice(-4),i=r.length-10;return[...e,`... (${i} lines omitted, use --full-output to see all) ...`,...o].join(`
|
|
5
|
-
`)}function N(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(N);let n={};for(let[r,e]of Object.entries(t))typeof e=="string"&&e.length>200?n[r]=e.slice(0,150)+"... (truncated)":typeof e=="object"&&e!==null?n[r]=N(e):n[r]=e;return n}function E(t){if(!t||typeof t!="object")return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function J(t,n){if(!t)return"(no result)";if(typeof t!="object")return T(String(t),n);let r=n?t:N(t);if("structuredContent"in r&&r.structuredContent){let e=r.structuredContent,o=[];if(e.stdout&&typeof e.stdout=="string"&&e.stdout.trim()&&o.push(e.stdout.trim()),e.stderr&&typeof e.stderr=="string"&&e.stderr.trim()&&o.push(`${w}[stderr]${a} ${e.stderr.trim()}`),e.urls&&Array.isArray(e.urls)){let i=e.urls;for(let s of i)s.path&&s.url&&o.push(`${s.path}: ${s.url}`)}return o.length===0&&o.push(JSON.stringify(e,null,2)),T(o.join(`
|
|
6
|
-
`),n)}if("content"in r&&Array.isArray(r.content)){let o=r.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
|
|
7
|
-
`);return T(o||JSON.stringify(t,null,2),n)}return T(JSON.stringify(t,null,2),n)}function M(t){if(typeof t.title=="string")return t.title;if(typeof t.toolName=="string")return t.toolName;let n=t.type;return n.startsWith("tool-")?n.slice(5).replace(/__/g," ").replace(/_/g," "):n}function L(t,n){let r=[];for(let e of t)if(e.type==="reasoning"&&e.text)r.push(`${h}${e.text}${a}`);else if(e.type==="text"&&e.text)r.push(e.text);else if(e.type==="tool-call"&&e.toolName){let o=[];if(o.push(`${p}\u250C\u2500 Tool Call: ${e.toolName}${a}`),e.args){o.push(`${w}\u2502 Arguments:${a}`);let i=E(e.args);for(let s of i.split(`
|
|
8
|
-
`))o.push(`${h}\u2502 ${s}${a}`)}if(e.result!==void 0){o.push(`${R}\u2502 Result:${a}`);let i=J(e.result,n);for(let s of i.split(`
|
|
9
|
-
`))o.push(`${h}\u2502 ${s}${a}`);o.push(`${p}\u2514\u2500 ${e.toolName} completed${a}`)}else e.state==="call"?o.push(`${p}\u2514\u2500 (awaiting result)${a}`):o.push(`${p}\u2514\u2500${a}`);r.push(o.join(`
|
|
10
|
-
`))}else if(e.type.startsWith("tool-")&&e.type!=="tool-call"){let o=M(e),i=[];if(i.push(`${p}\u250C\u2500 Tool: ${o}${a}`),e.input){i.push(`${w}\u2502 Input:${a}`);let s=E(e.input);for(let c of s.split(`
|
|
11
|
-
`))i.push(`${h}\u2502 ${c}${a}`)}if(e.output!==void 0&&e.state==="output-available"){i.push(`${R}\u2502 Output:${a}`);let s=J(e.output,n);for(let c of s.split(`
|
|
12
|
-
`))i.push(`${h}\u2502 ${c}${a}`);i.push(`${p}\u2514\u2500 completed${a}`)}else e.state==="call"||e.state==="partial-call"?i.push(`${p}\u2514\u2500 (in progress)${a}`):i.push(`${p}\u2514\u2500${a}`);r.push(i.join(`
|
|
13
|
-
`))}return r.join(`
|
|
14
|
-
|
|
15
|
-
`).trim()}async function Y(t){let n=t.output===v;t.output&&!n&&(console.error(`Invalid --output value. Supported: ${v}`),process.exit(1));let r=new A;if(t.shareId){let s;try{s=await I()}catch{}try{let c=await r.getSharedTask(t.shareId,s),{messages:l}=await r.getSharedMessages(t.shareId,50,s);if(t.json){console.log(JSON.stringify({task:c,messages:l}));return}if(n){if(f("task",c),l.length===0)f("info","No messages in this shared task.");else for(let u of l.toReversed())f("message",u);f("done");return}if(console.log(`Shared Task: ${c.title||"Untitled"}`),console.log(`Visibility: ${c.visibility}`),c.agent&&console.log(`Agent: ${c.agent.name}`),console.log(`${l.length} messages
|
|
16
|
-
`),l.length===0){console.log("No messages in this shared task.");return}let d=l.toReversed(),k=t.fullOutput??!1;for(let u of d){let y=L(u.parts,k);if(!y)continue;let x=u.role==="user"?"You":"Assistant";console.log(`[${x}] ${S(u.createdAt)}`),console.log(y),console.log("")}return}catch(c){if(c instanceof Error){let l=c.message.toLowerCase();l.includes("401")||l.includes("unauthorized")?console.error("Access denied. This shared task requires authentication or is not accessible to you."):l.includes("404")||l.includes("not found")?console.error("Shared task not found. The share ID may be invalid or the task was deleted."):console.error(`Failed to fetch shared task: ${c.message}`)}else console.error("Failed to fetch shared task");process.exit(1)}}let e,o;try{let s=await b();e=s.accessToken,o=s.workspaceId}catch(s){O(s)}if(t.taskId){let s=t.taskId,c=!1,l=null,d=parseInt(t.taskId,10);if(!isNaN(d)&&d>=0&&/^\d+$/.test(t.taskId)){let g=d===0?1:d,{tasks:$}=await r.getTasks(e,o,20);g>$.length&&(console.error(`Task number ${g} not found. You have ${$.length} recent tasks.`),process.exit(1));let m=$[g-1];s=m.id,c=!0,l=m,n||console.log(`Task: ${m.title||"Untitled"}
|
|
17
|
-
`)}let{messages:u}=await r.getMessages(e,o,s,50);if(t.json){console.log(JSON.stringify(u));return}if(n){if(l&&f("task",l),u.length===0)f("info","No messages in this task.");else for(let g of u.toReversed())f("message",g);f("done");return}if(u.length===0){console.log("No messages in this task.");return}let y=u.toReversed(),x=t.fullOutput??!1;c||console.log(`Task: ${t.taskId.slice(0,8)}...`),console.log(`${u.length} messages
|
|
18
|
-
`);for(let g of y){let $=L(g.parts,x);if(!$)continue;let m=g.role==="user"?"You":"Assistant";console.log(`[${m}] ${S(g.createdAt)}`),console.log($),console.log("")}return}if(t.search){let{results:s,nextKey:c}=await r.searchTasks(e,o,t.search,{limit:t.limit,nextKey:t.nextKey});if(n){for(let l of s)f("task",l);f("done");return}if(t.json){console.log(JSON.stringify({results:s,nextKey:c}));return}if(s.length===0){console.log(`No tasks match "${t.search}".`);return}console.log(`Search results for "${t.search}" (${s.length}):
|
|
19
|
-
`),s.forEach((l,d)=>{let k=(d+1).toString().padStart(2," "),u=l.titleHighlight?j(l.titleHighlight):l.title||"Untitled";console.log(` ${k}. ${h}${S(l.createdAt)}${a} ${u}`),l.contentSnippet&&console.log(` ${j(l.contentSnippet)}`),console.log(` ${h}ID: ${l.id}${a}`)}),c&&console.log(`
|
|
20
|
-
Next page: --next-key ${c}`);return}let{tasks:i}=await r.getTasks(e,o,20);if(n){for(let s of i)f("task",s);f("done");return}if(t.json){console.log(JSON.stringify(i));return}if(i.length===0){console.log("No tasks found.");return}console.log(`Recent Tasks (${i.length}):
|
|
21
|
-
`),i.forEach((s,c)=>{let l=(c+1).toString().padStart(2," ");console.log(` ${l}. ${S(s.createdAt).padEnd(12)} ${s.title||"Untitled"}`)}),console.log(""),console.log("Use `entrydesk tasks 1` to view the most recent task"),console.log('Use `entrydesk task -c 1 -m "message"` to continue it')}export{j as renderHighlight,Y as runTasks};
|
package/dist/usage-R366J6YU.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as d,q as f}from"./chunk-GQWF4JEC.js";import"./chunk-KURQCTT3.js";function U(){console.log(`
|
|
3
|
-
Usage: entrydesk usage [options]
|
|
4
|
-
|
|
5
|
-
Options:
|
|
6
|
-
--limit <number> Limit number of users shown (default: all)
|
|
7
|
-
--sort-by cost|operations Sort by cost or operations (default: cost)
|
|
8
|
-
--json Output JSON
|
|
9
|
-
|
|
10
|
-
Examples:
|
|
11
|
-
entrydesk usage # Show all users, sorted by cost
|
|
12
|
-
entrydesk usage --limit 10 # Show top 10 users
|
|
13
|
-
entrydesk usage --sort-by operations # Sort by operation count
|
|
14
|
-
entrydesk usage --json # JSON output
|
|
15
|
-
`)}async function k(e){if(e.help){U();return}let l,a;try{let o=await f();l=o.accessToken,a=o.workspaceId}catch(o){let s=o instanceof Error?o.message:"Authentication failed";console.error(s),process.exit(1)}let h=new d,t=[],r,i=0,m=100;do{let o=await h.getMonthlyUsages(l,a,{nextKey:r,limit:100});if(t.push(...o.monthlyUsages),r=o.nextKey,i++,i>=m){console.error(`Warning: Showing first ${t.length} entries (pagination limit reached)`);break}}while(r);if(e.json){console.log(JSON.stringify(t));return}if(t.length===0){console.log("No usage data found for this workspace.");return}console.log(`Current Month Usage:
|
|
16
|
-
`);let c=0,g=0;for(let o of t)c+=parseFloat(o.totalCost),g+=o.operationCount;console.log(`Total Cost: $${c.toFixed(2)}`),console.log(`Total Operations: ${g.toLocaleString()}`),console.log(`Users: ${t.length}
|
|
17
|
-
`);let u=e.sortBy||"cost",p=[...t].toSorted((o,s)=>u==="cost"?parseFloat(s.totalCost)-parseFloat(o.totalCost):s.operationCount-o.operationCount),y=e.limit&&e.limit>0?e.limit:p.length,n=p.slice(0,y);console.log(`Usage by User (sorted by ${u}, showing ${n.length} of ${t.length}):
|
|
18
|
-
`);for(let o of n){let s=parseFloat(o.totalCost);console.log(` ${o.user.name} (${o.user.email})`),console.log(` Cost: $${s.toFixed(2)}`),console.log(` Operations: ${o.operationCount.toLocaleString()}`),console.log("")}n.length<t.length&&console.log(`... and ${t.length-n.length} more users`)}export{k as runUsage};
|