@entrydesk/cli 1.32.0-beta → 2.0.0-beta
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/README.md +148 -9
- package/dist/add-Cu0kBobt.js +2 -0
- package/dist/agents--2Fw5-et.js +2 -0
- package/dist/billing-B96487c6.js +2 -0
- package/dist/budget-DhX2gt5z.js +2 -0
- package/dist/commands-C1wX8XQY.js +2 -0
- package/dist/commands-DbXuQqse.js +2 -0
- package/dist/config-eCQwQAt1.js +3 -0
- package/dist/confirm-BrJZbaxf.js +2 -0
- package/dist/connectors-DGmZ4zTG.js +3 -0
- package/dist/hash-Ddmw8YE4.js +2 -0
- package/dist/index.js +49 -1
- package/dist/installer-iaoPJQn3.js +2 -0
- package/dist/login-IvudGta0.js +2 -0
- package/dist/logout-Bjmk9YUh.js +2 -0
- package/dist/marketplace-BPY5cD0d.js +4 -0
- package/dist/mcp-client-Cr_sHGPw.js +2 -0
- package/dist/mcp-ydzvH8kz.js +3 -0
- package/dist/meeting-BDhBTbm3.js +3 -0
- package/dist/models-BFnezI1c.js +2 -0
- package/dist/notifications-4bo-vcIW.js +2 -0
- package/dist/paths-BAZ2NsXN.js +2 -0
- package/dist/profile-BZo9STO2.js +2 -0
- package/dist/profile-storage-mtd3aKrx.js +72 -0
- package/dist/push-Mb0Xb42_.js +2 -0
- package/dist/recordings-D9jnWpxs.js +3 -0
- package/dist/remote-nEFOyIM2.js +2 -0
- package/dist/remove-CJiRVixg.js +2 -0
- package/dist/rolldown-runtime-CIdiawuB.js +2 -0
- package/dist/schedules-BFoirR6r.js +21 -0
- package/dist/skills-DYS1EQMn.js +2 -0
- package/dist/status-BgIfKAmr.js +2 -0
- package/dist/status-DzGv21m4.js +2 -0
- package/dist/task-Db4UcJ6G.js +115 -0
- package/dist/tasks-Dd-GdHfu.js +14 -0
- package/dist/tool-B6W8erW6.js +5 -0
- package/dist/update-CYieYkZl.js +2 -0
- package/dist/usage-BLdNvuse.js +3 -0
- package/dist/version-Cos6L15W.js +2 -0
- package/dist/workflow-DlQtL_J-.js +6 -0
- package/dist/workspaces-IAJitqaO.js +3 -0
- package/package.json +15 -10
- package/dist/agents-6VHSTGVU.js +0 -43
- package/dist/billing-WA7WGH7U.js +0 -24
- package/dist/budget-PC4EAZLV.js +0 -12
- package/dist/chunk-5QJUAR4K.js +0 -120
- package/dist/chunk-77D346VR.js +0 -2
- package/dist/chunk-JMYSCKCF.js +0 -2
- package/dist/chunk-YBS4DYFH.js +0 -2
- package/dist/config-ED6PZQ7J.js +0 -4
- package/dist/config-help-CTZHKILN.js +0 -2
- package/dist/connectors-O4K2ZFDM.js +0 -39
- package/dist/help-KDHCFJNF.js +0 -4
- package/dist/login-LX3ISJEI.js +0 -2
- package/dist/logout-YNCDJ5ST.js +0 -2
- package/dist/marketplace-FHSTOAWV.js +0 -38
- package/dist/mcp-2G4B3BVK.js +0 -4
- package/dist/meeting-UBBSEEHT.js +0 -68
- package/dist/models-PGGTDNI4.js +0 -3
- package/dist/notifications-DHPLCJFY.js +0 -28
- package/dist/profile-K4V2Y63H.js +0 -17
- package/dist/recordings-OXG66QN2.js +0 -42
- package/dist/schedules-R4U37II4.js +0 -66
- package/dist/skills-JVSRQSKA.js +0 -30
- package/dist/status-S37SXIYD.js +0 -2
- package/dist/task-H2COR6Z4.js +0 -180
- package/dist/tasks-7NS4UOBP.js +0 -41
- package/dist/tool-VLJFDXQ4.js +0 -35
- package/dist/update-5GLLNVRU.js +0 -4
- package/dist/usage-PAL5KJ5C.js +0 -29
- package/dist/version-ROABNJFL.js +0 -2
- package/dist/workflow-XERZYR3S.js +0 -62
- package/dist/workspaces-PLJMIDJR.js +0 -14
package/dist/tasks-7NS4UOBP.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as I,O as A,P as O,T as v}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.js";var h="\x1B[2m",c="\x1B[0m",p="\x1B[36m",N="\x1B[33m",R="\x1B[32m",b="stream-json";function f(t,n){let o=n===void 0?{event:t}:{event:t,data:n};process.stdout.write(`${JSON.stringify(o)}
|
|
3
|
-
`)}function w(t){let n=new Date(t),e=new Date().getTime()-n.getTime(),r=Math.floor(e/(1e3*60*60*24));return r===0?n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):r===1?"Yesterday":r<7?`${r} 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 $(t,n){if(n)return t;let o=t.split(`
|
|
4
|
-
`);if(o.length<=15)return t;let e=o.slice(0,6),r=o.slice(-4),i=o.length-10;return[...e,`\u2026 (${i} lines omitted, use --full-output to see all) \u2026`,...r].join(`
|
|
5
|
-
`)}function x(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(x);let n={};for(let[o,e]of Object.entries(t))typeof e=="string"&&e.length>200?n[o]=e.slice(0,150)+"\u2026 (truncated)":typeof e=="object"&&e!==null?n[o]=x(e):n[o]=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 $(String(t),n);let o=n?t:x(t);if("structuredContent"in o&&o.structuredContent){let e=o.structuredContent,r=[];if(e.stdout&&typeof e.stdout=="string"&&e.stdout.trim()&&r.push(e.stdout.trim()),e.stderr&&typeof e.stderr=="string"&&e.stderr.trim()&&r.push(`${N}[stderr]${c} ${e.stderr.trim()}`),e.urls&&Array.isArray(e.urls)){let i=e.urls;for(let s of i)s.path&&s.url&&r.push(`${s.path}: ${s.url}`)}return r.length===0&&r.push(JSON.stringify(e,null,2)),$(r.join(`
|
|
6
|
-
`),n)}if("content"in o&&Array.isArray(o.content)){let r=o.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
|
|
7
|
-
`);return $(r||JSON.stringify(t,null,2),n)}return o.type==="text"&&typeof o.content=="string"?$(o.content,n):$(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 o=[];for(let e of t)if(e.type==="reasoning"&&e.text)o.push(`${h}${e.text}${c}`);else if(e.type==="text"&&e.text)o.push(e.text);else if(e.type==="tool-call"&&e.toolName){let r=[`${p}\u250C\u2500 Tool: ${e.toolName}${c}`];if(e.args){r.push(`${N}\u2502 Input:${c}`);let i=J(e.args);for(let s of i.split(`
|
|
8
|
-
`))r.push(`${h}\u2502 ${s}${c}`)}if(e.result!==void 0){r.push(`${R}\u2502 Output:${c}`);let i=E(e.result,n);for(let s of i.split(`
|
|
9
|
-
`))r.push(`${h}\u2502 ${s}${c}`);r.push(`${p}\u2514\u2500 ${e.toolName} completed${c}`)}else e.state==="call"?r.push(`${p}\u2514\u2500 (awaiting result)${c}`):r.push(`${p}\u2514\u2500${c}`);o.push(r.join(`
|
|
10
|
-
`))}else if(e.type.startsWith("tool-")&&e.type!=="tool-call"){let r=D(e),i=[`${p}\u250C\u2500 Tool: ${r}${c}`];if(e.input){i.push(`${N}\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(`${R}\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}`);o.push(i.join(`
|
|
13
|
-
`))}return o.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 # \u2026with full tool outputs
|
|
34
|
-
entrydesk tasks -s <shareId> # View a shared task
|
|
35
|
-
`)}async function V(t){if(t.help){U();return}let n=t.output===b;t.output&&!n&&(console.error(`Invalid --output value. Supported: ${b}`),process.exit(1));let o=new I;if(t.shareId){let s;try{s=await A()}catch{}try{let l=await o.getSharedTask(t.shareId,s),{messages:a}=await o.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(),y=t.fullOutput??!1;for(let u of d){let S=L(u.parts,y);if(!S)continue;let T=u.role==="user"?"You":"Assistant";console.log(`[${T}] ${w(u.createdAt)}`),console.log(S),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,r;try{let s=await O();e=s.accessToken,r=s.workspaceId}catch(s){v(s)}if(t.taskId){let s=t.taskId,l=!1,a=null,d=Number.parseInt(t.taskId,10);if(!Number.isNaN(d)&&d>=0&&/^\d+$/.test(t.taskId)){let g=d===0?1:d,{tasks:k}=await o.getTasks(e,r,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 o.getMessages(e,r,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 S=u.toReversed(),T=t.fullOutput??!1;l||console.log(`Task: ${t.taskId.slice(0,8)}\u2026`),console.log(`${u.length} messages
|
|
38
|
-
`);for(let g of S){let k=L(g.parts,T);if(!k)continue;let m=g.role==="user"?"You":"Assistant";console.log(`[${m}] ${w(g.createdAt)}`),console.log(k),console.log("")}return}if(t.search){let{results:s,nextKey:l}=await o.searchTasks(e,r,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 y=(d+1).toString().padStart(2," "),u=a.titleHighlight?j(a.titleHighlight):a.title||"Untitled";console.log(` ${y}. ${h}${w(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 o.getTasks(e,r,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 yet. Start one with `entrydesk task -m "..."`.');return}console.log(`Recent tasks (${i.length}):
|
|
41
|
-
`),i.forEach((s,l)=>{let a=(l+1).toString().padStart(2," ");console.log(` ${a}. ${w(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,V as runTasks};
|
package/dist/tool-VLJFDXQ4.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as y,b as T}from"./chunk-77D346VR.js";import{Q as O,R as w}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.js";import M from"fs";import _ from"fs/promises";import A from"os";import d from"path";var h=!process.env.NO_COLOR&&!!process.stdout.isTTY,p={green:h?"\x1B[32m":"",yellow:h?"\x1B[33m":"",reset:h?"\x1B[0m":""},C=10*1024,N=8*1024,E=2*1024,D=100,P=100;function b(){return d.join(A.homedir(),".entrydesk","tool-results")}function F(t){let e=t.trim().replace(/[/\\:*?"<>|\s]/g,"_").replace(/_+/g,"_").replace(/^[._]+|[._]+$/g,"").slice(0,D);return!e||e==="."||e===".."?"unnamed_tool":e}function J(t){try{return JSON.stringify(t,(e,o)=>typeof o=="bigint"?`${o}n`:typeof o=="function"?"[Function]":typeof o=="symbol"?o.toString():o,2)}catch{return String(t)}}function B(t){let e=new Date,o=[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")+"_"+[String(e.getHours()).padStart(2,"0"),String(e.getMinutes()).padStart(2,"0"),String(e.getSeconds()).padStart(2,"0")].join("-"),n=F(t);return`${o}_${n}.json`}async function I(t,e){try{return await _.writeFile(t,e,{encoding:"utf8",flag:"wx"}),!0}catch(o){if(o instanceof Error&&"code"in o&&o.code==="EEXIST")return!1;throw o}}async function $(t,e){try{let o=b();await _.mkdir(o,{recursive:!0});let n=B(t),i=d.extname(n),s=n.slice(0,-i.length),r=J(e),a=d.join(o,n);if(await I(a,r))return a;for(let f=1;f<=P;f++){let S=d.join(o,`${s}-${f}${i}`);if(await I(S,r))return S}let l=Math.random().toString(36).slice(2,10),c=d.join(o,`${s}-${l}${i}`);return await _.writeFile(c,r,{encoding:"utf8",flag:"wx"}),c}catch(o){let n=o instanceof Error?o.message:"unknown error";return console.error(`${p.yellow}Warning: Could not save result to file: ${n}${p.reset}`),null}}function L(t,e){let o=Buffer.byteLength(t,"utf8");if(o<=C)return t;let n=t.slice(0,N),i=t.slice(-E),r=((o-N-E)/1024).toFixed(1),a=(o/1024).toFixed(1),l=` \u2026 (skipped ${r}KB of ${a}KB) \u2026`;return e&&(l+=`
|
|
3
|
-
Tip: jq -r '.structuredContent.field' <file> | grep/head/tail`),`${n}
|
|
4
|
-
|
|
5
|
-
${l}
|
|
6
|
-
|
|
7
|
-
${i}`}function x(t){console.log(`${p.green}Tool execution result saved to: ${t}${p.reset}`),console.log()}function k(){console.log(`${p.green}Tool execution result:${p.reset}`)}function R(t){return t.split("__")[0]??t}function u(t,e,o){console.error(o?JSON.stringify({error:{code:t,message:e}}):`Error [${t}]: ${e}`),process.exit(1)}function g(t,e,o="CONNECTION_FAILED"){O(t)&&u(o,w(),e);let n=t instanceof Error?t.message:"Unknown error";n.includes("Not logged in")||n.includes("not-logged-in")?u("AUTH_MISSING",n,e):u(o,n,e)}async function U(){return process.stdin.isTTY?null:new Promise(t=>{let e=[],o=!1,n=!1,i,s,r,a,l=()=>{clearTimeout(i),process.stdin.removeListener("data",s),process.stdin.removeListener("end",r),process.stdin.removeListener("error",a)},c=f=>{n||(n=!0,l(),t(f))};s=f=>{o=!0,clearTimeout(i),e.push(f)},r=()=>{e.length===0?c(null):c(Buffer.concat(e).toString("utf-8").trim())},a=()=>{c(null)},i=setTimeout(()=>{o||c(null)},100),process.stdin.on("data",s),process.stdin.on("end",r),process.stdin.on("error",a),process.stdin.resume()})}var m=class extends Error{constructor(e){super(e),this.name="InputError"}};async function q(t,e){if(t)return t;if(e)try{return M.readFileSync(e,"utf-8").trim()}catch(n){let i=n instanceof Error?n.message:"Failed to read input file";throw new m(`Failed to read input file: ${i}`)}let o=await U();if(o)return o;throw new m("Input JSON is required. Use --input, --input-file, or pipe it via stdin.")}function H(t){let e=[`Tool: ${t.name}`];return t.description&&e.push(` Description: ${t.description}`),e.join(`
|
|
8
|
-
`)}function Y(t){let e=[`Tool: ${t.name}`];return t.description&&(e.push("Description:"),e.push(` ${t.description}`)),e.push("Input Schema:"),e.push(JSON.stringify(t.inputSchema,null,2)),e.join(`
|
|
9
|
-
`)}async function V(t,e){let o=await T().catch(n=>{g(n,t)});try{let i=(await o.listTools({},y())).tools;if(e){let s=e.toLowerCase();i=i.filter(r=>R(r.name).toLowerCase().startsWith(s))}if(t)console.log(JSON.stringify(i,null,2));else{let s=e?` (prefix: ${e})`:"";console.log(`Available tools (${i.length})${s}:
|
|
10
|
-
`);for(let r of i)console.log(H(r)),console.log()}}catch(n){g(n,t)}finally{await o.close().catch(()=>{})}}async function X(t,e){let o=await T().catch(n=>{g(n,e)});try{let i=(await o.listTools({},y())).tools.find(s=>s.name===t);i||u("TOOL_NOT_FOUND",`Tool not found: ${t}`,e),console.log(e?JSON.stringify(i,null,2):Y(i))}catch(n){g(n,e)}finally{await o.close().catch(()=>{})}}async function G(t,e,o){let n;try{n=JSON.parse(e)}catch(r){let a=r instanceof Error?`Invalid JSON input: ${r.message}`:"Invalid JSON input";u("INVALID_INPUT",a,o)}let i=await T().catch(r=>{g(r,o,"TOOL_CALL_FAILED")}),s=!1;try{let r=await i.callTool({name:t,arguments:n},y());if(o)console.log(JSON.stringify(r,null,2));else{let a=await $(t,r);a&&x(a),k();for(let l of r.content)l.type==="text"?console.log(l.text):l.type==="image"?console.log(`[Image: ${l.mimeType}]`):l.type==="resource"?console.log(`[Resource: ${l.resource.uri}]`):console.log(JSON.stringify(l,null,2));if(r.structuredContent){let l=JSON.stringify(r.structuredContent,null,2),c=L(l,a);console.log(c)}}r.isError&&(s=!0)}catch(r){g(r,o,"TOOL_CALL_FAILED")}finally{await i.close().catch(()=>{})}s&&process.exit(1)}function v(){console.log(`Usage: entrydesk tool <action> [options]
|
|
11
|
-
|
|
12
|
-
Actions:
|
|
13
|
-
list List all available tools
|
|
14
|
-
get <name> Get details of a specific tool
|
|
15
|
-
call <name> Call a tool with JSON input
|
|
16
|
-
|
|
17
|
-
Options:
|
|
18
|
-
--json Output in JSON format
|
|
19
|
-
-p, --prefix <name> Filter tools by prefix (for 'list' action)
|
|
20
|
-
-i, --input <json> JSON input for tool call
|
|
21
|
-
-f, --input-file <path> Read JSON input from file
|
|
22
|
-
|
|
23
|
-
Input Priority (for 'call' action):
|
|
24
|
-
1. --input flag (direct JSON string)
|
|
25
|
-
2. --input-file flag (read from file)
|
|
26
|
-
3. stdin (piped input)
|
|
27
|
-
|
|
28
|
-
Examples:
|
|
29
|
-
entrydesk tool list
|
|
30
|
-
entrydesk tool list --prefix agent
|
|
31
|
-
entrydesk tool get agent__search_agents
|
|
32
|
-
entrydesk tool call agent__search_agents --input '{"limit": 5}'
|
|
33
|
-
entrydesk tool call agent__search_agents --input-file input.json
|
|
34
|
-
echo '{"limit": 5}' | entrydesk tool call agent__search_agents
|
|
35
|
-
`)}async function ot(t){let e=t.json??!1;if(t.help){v();return}switch(t.action){case"list":await V(e,t.prefix);break;case"get":t.name||u("INVALID_INPUT","Tool name is required. Usage: entrydesk tool get <name>",e),await X(t.name,e);break;case"call":{t.name||u("INVALID_INPUT","Tool name is required. Usage: entrydesk tool call <name> --input <json>",e);let o;try{o=await q(t.input,t.inputFile)}catch(n){throw n instanceof m&&u("INVALID_INPUT",n.message,e),n}await G(t.name,o,e);break}default:v();break}}export{m as InputError,q as getInputJson,v as printToolUsage,U as readStdin,ot as runTool};
|
package/dist/update-5GLLNVRU.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{S as l}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.js";import{spawn as f}from"child_process";var a="@entrydesk/cli";function g(){return"1.32.0-beta"}function d(n){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/u.exec(n.trim());return e?{nums:[Number(e[1]),Number(e[2]),Number(e[3])],prerelease:e[4]??null}:null}function h(n,e){if(n===e)return 0;if(n===null)return 1;if(e===null)return-1;let t=n.split("."),i=e.split("."),r=Math.min(t.length,i.length);for(let s=0;s<r;s++){let u=t[s],o=i[s];if(u!==o){let c=/^\d+$/u.test(u),p=/^\d+$/u.test(o);return c&&p?Number(u)<Number(o)?-1:1:c?-1:p?1:u<o?-1:1}}return t.length===i.length?0:t.length<i.length?-1:1}function y(n,e){let t=d(n),i=d(e);if(!t||!i)return t?1:i?-1:0;for(let r=0;r<3;r++)if(t.nums[r]!==i.nums[r])return t.nums[r]<i.nums[r]?-1:1;return h(t.prerelease,i.prerelease)}function $(){return process.platform==="win32"?"npm.cmd":"npm"}function m(n,{inheritOutput:e}){return new Promise((t,i)=>{let r=f($(),n,{stdio:e?["ignore","inherit","inherit"]:["ignore","pipe","pipe"]}),s="",u="";r.stdout?.on("data",o=>{s+=String(o)}),r.stderr?.on("data",o=>{u+=String(o)}),r.once("error",i),r.once("close",o=>{t({exitCode:o??1,stdout:s,stderr:u})})})}async function w(){let n;try{n=await m(["view",a,"version"],{inheritOutput:!1})}catch(t){throw new l("Failed to run npm \u2014 is npm installed and on your PATH?",1,t instanceof Error?t:void 0)}let e=n.stdout.trim();if(n.exitCode!==0||!e)throw new l(`Failed to look up the latest ${a} version from the npm registry.${n.stderr?`
|
|
3
|
-
${n.stderr.trim()}`:""}`);if(!d(e))throw new l(`Unexpected version from the npm registry: ${JSON.stringify(e)}`);return e}async function _(n){let e=g(),t=await w(),i=y(e,t),r=i>=0;if(n.check||r){n.json?console.log(JSON.stringify({current:e,latest:t,upToDate:r,updated:!1})):i>0?console.log(`entrydesk ${e} is newer than the latest published version (${t}). Nothing to do.`):console.log(r?`entrydesk ${e} is already the latest version.`:`Update available: ${e} \u2192 ${t}. Run \`entrydesk update\` to install.`);return}n.json||console.log(`Updating entrydesk ${e} \u2192 ${t}\u2026`);let s=await m(["install","-g",`${a}@${t}`],{inheritOutput:!n.json});if(s.exitCode!==0){let u=s.stderr?`
|
|
4
|
-
${s.stderr.trim()}`:"";throw new l(`npm install failed (exit code ${s.exitCode}). You can update manually with \`npm install -g ${a}@latest\`.`+u,s.exitCode)}n.json?console.log(JSON.stringify({current:e,latest:t,upToDate:r,updated:!0})):console.log(`entrydesk updated to ${t}.`)}export{_ as runUpdate};
|
package/dist/usage-PAL5KJ5C.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as d,P as y,T as U}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.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 b(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 C(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 N(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}b(t);return}if(o.action==="me"){let t=await r.getUsageMe(n,i);if(o.json){console.log(JSON.stringify(t));return}C(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+=Number.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"?Number.parseFloat(c.totalCost)-Number.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=Number.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(`\u2026 and ${e.length-l.length} more users`)}catch(e){U(e)}}export{N as runUsage};
|
package/dist/version-ROABNJFL.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as p,P as k,T as g,r as u}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.js";import{readFileSync as $}from"fs";var m=262144,R=new Set(["completed","failed","cancelled"]);function c(){console.log(`
|
|
3
|
-
Usage: entrydesk workflow [list|get|create|update|run|runs|run-get|share] [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List workflows (default)
|
|
7
|
-
get <workflowId> Show workflow details (--show-source for the script)
|
|
8
|
-
create Create a workflow from a local script file
|
|
9
|
-
update <workflowId> Update name/description/script or enable/disable
|
|
10
|
-
run <workflowId> Trigger a run; prints the runId (--wait to follow)
|
|
11
|
-
runs <workflowId> List runs of a workflow
|
|
12
|
-
run-get <workflowId> <runId> Show a run's status, nodes, and logs
|
|
13
|
-
share <workflowId> Show or manage sharing (user grants)
|
|
14
|
-
|
|
15
|
-
List Options:
|
|
16
|
-
--search <text> Search by name
|
|
17
|
-
--limit <number> Max workflows per page (default: 20)
|
|
18
|
-
--next-key <cursor> Fetch next page using cursor
|
|
19
|
-
--all Fetch all workflows (auto-paginate)
|
|
20
|
-
|
|
21
|
-
Create/Update Options:
|
|
22
|
-
--name <text> (required for create)
|
|
23
|
-
--description <text>
|
|
24
|
-
--file <path.js> Script source file (required for create)
|
|
25
|
-
--activate Enable the workflow (update only)
|
|
26
|
-
--deactivate Disable the workflow (update only)
|
|
27
|
-
|
|
28
|
-
Get Options:
|
|
29
|
-
--show-source Print the full script source
|
|
30
|
-
|
|
31
|
-
Run Options:
|
|
32
|
-
--args '<json>' Inline JSON passed to the workflow's args global
|
|
33
|
-
--args-file <path> Read the JSON args from a file
|
|
34
|
-
--wait Poll the run until it finishes, then print the result
|
|
35
|
-
|
|
36
|
-
Share Options:
|
|
37
|
-
--add-user <userId> Grant a user access (use with --role)
|
|
38
|
-
--remove-user <userId> Revoke a user's access
|
|
39
|
-
--role owner|editor|viewer Role for --add-user (default: viewer)
|
|
40
|
-
|
|
41
|
-
Flags:
|
|
42
|
-
--json Output JSON
|
|
43
|
-
|
|
44
|
-
Examples:
|
|
45
|
-
entrydesk workflow list --search report
|
|
46
|
-
entrydesk workflow create --name "Nightly report" --file ./report.js
|
|
47
|
-
entrydesk workflow run <workflowId> --args '{"date":"2026-06-20"}' --wait
|
|
48
|
-
entrydesk workflow runs <workflowId>
|
|
49
|
-
entrydesk workflow run-get <workflowId> <runId>
|
|
50
|
-
entrydesk workflow share <workflowId> --add-user <userId> --role editor
|
|
51
|
-
`)}function w(e){if(!e)return"";let o=new Date(e);return Number.isNaN(o.getTime())?e:o.toLocaleString()}function h(e){let o;try{o=$(e,"utf8")}catch{console.error(`Cannot read script file: ${e}`),process.exit(1)}return o.trim().length===0&&(console.error(`Script file is empty: ${e}`),process.exit(1)),Buffer.byteLength(o,"utf8")>m&&(console.error(`Script file exceeds ${m} bytes.`),process.exit(1)),o}function A(e){e.args!==void 0&&e.argsFile!==void 0&&(console.error("Use only one of --args or --args-file."),process.exit(1));let o;if(e.argsFile===void 0)o=e.args;else try{o=$(e.argsFile,"utf8")}catch{console.error(`Cannot read args file: ${e.argsFile}`),process.exit(1)}if(o!==void 0)try{return JSON.parse(o)}catch{console.error("--args/--args-file must be valid JSON."),process.exit(1)}}function y(e){console.log(`Workflows (${e.length}):
|
|
52
|
-
`);for(let o of e){let r=o.isActive?"active":"inactive";if(console.log(` ${o.name} (${r})`),o.description){let t=o.description.length>80?`${o.description.slice(0,80)}\u2026`:o.description;console.log(` ${t}`)}console.log(` ${o.myRole??"no-role"} \xB7 ID: ${o.id}`),console.log("")}}function v(e,o){console.log(`${e.name}
|
|
53
|
-
`),console.log(` ID: ${e.id}`),console.log(` Active: ${e.isActive}`),console.log(` My role: ${e.myRole??"no-role"}`),e.description&&console.log(` Description: ${e.description}`),console.log(` Updated: ${w(e.updatedAt)}`);let r=e.scriptSource.split(`
|
|
54
|
-
`).length;o?(console.log(`
|
|
55
|
-
Script (${r} lines):
|
|
56
|
-
`),console.log(e.scriptSource)):console.log(` Script: ${r} lines (use --show-source to print)`)}function I(e){console.log(`Runs (${e.length}):
|
|
57
|
-
`);for(let o of e){let r=w(o.startedAt??o.createdAt);console.log(` ${o.status}${r?` \xB7 ${r}`:""}`),console.log(` ID: ${o.id}`)}}function S(e){console.log(`Run ${e.id}`),console.log(` Workflow: ${e.workflowId}`),console.log(` Status: ${e.status}`),e.startedAt&&console.log(` Started: ${w(e.startedAt)}`),e.completedAt&&console.log(` Completed: ${w(e.completedAt)}`),e.error!=null&&console.log(` Error: ${JSON.stringify(e.error)}`);let o=Object.entries(e.context?.nodes??{});if(o.length>0){console.log(`
|
|
58
|
-
Nodes (${o.length}):`);for(let[t,s]of o){let n=[s.kind??"node",s.status];s.durationMs!=null&&n.push(`${s.durationMs}ms`),console.log(` - ${s.label??t} [${n.join(" \xB7 ")}]`)}}let r=e.context?.logs??[];if(r.length>0){console.log(`
|
|
59
|
-
Logs:`);for(let t of r)console.log(` ${t}`)}e.context?.spent!=null&&console.log(`
|
|
60
|
-
Tokens spent: ${e.context.spent}`)}function W(e){let o=u(e);if(console.log(`User grants (${o.length}):`),o.length===0){console.log(" (none)");return}for(let r of o)console.log(` - ${r.user.name} <${r.user.email}> \xB7 ${r.role}`),console.log(` ID: ${r.userId}`)}async function N(e,o,r,t,s){for(let i=0;i<600;i++){let l=await e.getWorkflowRun(o,r,t,s);if(R.has(l.status))return i>0&&process.stderr.write(`
|
|
61
|
-
`),l;let f=i*2;process.stderr.write(`\rWaiting\u2026 ${l.status} (${f}s)`),await new Promise(a=>setTimeout(a,2e3))}throw process.stderr.write(`
|
|
62
|
-
`),new Error(`Run ${s} did not finish within the wait window.`)}async function x(e){let r=[],t;for(let s=0;;s++){s>=100&&(console.error("Reached maximum page limit (100). Use --limit and --next-key for manual pagination."),process.exit(1));let n=await e(t);if(r.push(...n.items),t=n.nextKey,!t)break}return r}async function O(e,o,r,t){if(t.all&&t.nextKey&&(console.error("Cannot use --all and --next-key together."),process.exit(1)),t.all){let i=await x(async l=>{let f=await e.getWorkflows(o,r,{limit:t.limit??20,nextKey:l,search:t.search});return{items:f.workflows,nextKey:f.nextKey}});if(t.json){console.log(JSON.stringify({workflows:i}));return}if(i.length===0){console.log("No workflows in this workspace yet. Create one with `entrydesk workflow create --name <name> --file <path.js>`.");return}y(i);return}let{workflows:s,nextKey:n}=await e.getWorkflows(o,r,{limit:t.limit,nextKey:t.nextKey,search:t.search});if(t.json){console.log(JSON.stringify({workflows:s,nextKey:n}));return}if(s.length===0){console.log("No workflows in this workspace yet. Create one with `entrydesk workflow create --name <name> --file <path.js>`.");return}y(s),n&&console.log(`Next page: --next-key ${n}`)}async function U(e,o,r,t){if(!t.workflowId)throw new Error("Missing workflow ID. Usage: entrydesk workflow share <workflowId>");let s=t.workflowId,n=t.role??"viewer";if(t.addUser){let l=await e.upsertWorkflowGrant(o,r,s,t.addUser,n);if(t.json){console.log(JSON.stringify(l));return}console.log(`Granted ${n} to user ${t.addUser}`);return}if(t.removeUser){if(await e.removeWorkflowGrant(o,r,s,t.removeUser),t.json){console.log(JSON.stringify({userId:t.removeUser,removed:!0}));return}console.log(`Revoked access for user ${t.removeUser}`);return}let i=await e.getWorkflowGrants(o,r,s);if(t.json){console.log(JSON.stringify(i));return}W(i)}async function M(e){try{if(e.help){c();return}let{accessToken:o,workspaceId:r}=await k(),t=e.action||"list",s=new p;if(t==="list"){await O(s,o,r,e);return}if(t==="get"){if(!e.workflowId)throw new Error("Missing workflow ID. Usage: entrydesk workflow get <workflowId>");let n=await s.getWorkflow(o,r,e.workflowId);if(e.json){console.log(JSON.stringify(n));return}v(n,!!e.showSource);return}if(t==="create"){(!e.name||!e.file)&&(console.error("create requires --name and --file <path.js>."),c(),process.exit(1));let n=h(e.file),i=await s.createWorkflow(o,r,{name:e.name,description:e.description,scriptSource:n});if(e.json){console.log(JSON.stringify(i));return}console.log(`Created workflow: ${i.name}`),console.log(` ID: ${i.id}`);return}if(t==="update"){if(!e.workflowId)throw new Error("Missing workflow ID. Usage: entrydesk workflow update <workflowId>");e.activate&&e.deactivate&&(console.error("Cannot use --activate and --deactivate together."),process.exit(1));let n={};if(e.name!==void 0&&(n.name=e.name),e.description!==void 0&&(n.description=e.description),e.file!==void 0&&(n.scriptSource=h(e.file)),e.activate&&(n.isActive=!0),e.deactivate&&(n.isActive=!1),Object.keys(n).length===0&&(console.error("No fields provided to update."),c(),process.exit(1)),await s.updateWorkflow(o,r,e.workflowId,n),e.json){console.log(JSON.stringify({id:e.workflowId,updated:!0}));return}console.log(`Updated workflow: ${e.workflowId}`);return}if(t==="run"){if(!e.workflowId)throw new Error("Missing workflow ID. Usage: entrydesk workflow run <workflowId>");let n=A(e),{runId:i}=await s.triggerWorkflowRun(o,r,e.workflowId,n);if(!e.wait){if(e.json){console.log(JSON.stringify({runId:i}));return}console.log(`Started run: ${i}`),console.log(` Check: entrydesk workflow run-get ${e.workflowId} ${i}`);return}let l=await N(s,o,r,e.workflowId,i);e.json?console.log(JSON.stringify(l)):S(l),l.status!=="completed"&&process.exit(1);return}if(t==="runs"){if(!e.workflowId)throw new Error("Missing workflow ID. Usage: entrydesk workflow runs <workflowId>");if(e.all&&e.nextKey&&(console.error("Cannot use --all and --next-key together."),process.exit(1)),e.all){let l=e.workflowId,f=await x(async a=>{let d=await s.getWorkflowRuns(o,r,l,{limit:e.limit??20,nextKey:a});return{items:d.runs,nextKey:d.nextKey}});if(e.json){console.log(JSON.stringify({runs:f}));return}if(f.length===0){console.log("No runs for this workflow.");return}I(f);return}let{runs:n,nextKey:i}=await s.getWorkflowRuns(o,r,e.workflowId,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({runs:n,nextKey:i}));return}if(n.length===0){console.log("No runs for this workflow.");return}I(n),i&&console.log(`Next page: --next-key ${i}`);return}if(t==="run-get"){if(!e.workflowId||!e.runId)throw new Error("Missing workflow ID or run ID. Usage: entrydesk workflow run-get <workflowId> <runId>");let n=await s.getWorkflowRun(o,r,e.workflowId,e.runId);if(e.json){console.log(JSON.stringify(n));return}S(n);return}if(t==="share"){await U(s,o,r,e);return}console.error(`Unknown workflow command: ${t}`),c(),process.exit(1)}catch(o){g(o)}}export{M as runWorkflow};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{B as i,C as k,O as w}from"./chunk-5QJUAR4K.js";import"./chunk-JMYSCKCF.js";function l(){console.log(`
|
|
3
|
-
Usage: entrydesk workspaces [list|switch|use] [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List all workspaces (default)
|
|
7
|
-
switch <workspaceId> Switch to a workspace
|
|
8
|
-
use <workspaceId> Switch to a workspace (alias)
|
|
9
|
-
|
|
10
|
-
Flags:
|
|
11
|
-
--json Output JSON
|
|
12
|
-
`)}async function h(e){if(e.help){l();return}let t,f=(await i.getAll())?.workspaceId;try{t=await w()}catch(o){let s=o instanceof Error?o.message:"Authentication failed";console.error(s),process.exit(1)}let r=e.action||"list",p=new k;if(r==="switch"||r==="use"){let o=e.configKey;o||(console.error("Missing workspace ID. Usage: entrydesk workspaces switch <workspaceId>"),l(),process.exit(1));let{workspaces:s}=await p.getWorkspaces(t),a=s.find(n=>n.id===o);if(!a){console.error(`Workspace not found: ${o}`),console.error(`
|
|
13
|
-
Available workspaces:`);for(let n of s)console.error(` ${n.name}: ${n.id}`);process.exit(1)}if(await i.saveWorkspaceId(o),e.json){console.log(JSON.stringify({workspaceId:o,workspaceName:a.name}));return}console.log(`Switched to workspace: ${a.name}`),console.log(` ID: ${o}`);return}r!=="list"&&(console.error(`Unknown workspaces command: ${r}`),l(),process.exit(1));let{workspaces:c}=await p.getWorkspaces(t);if(e.json){console.log(JSON.stringify(c));return}if(c.length===0){console.log("No workspaces found.");return}console.log(`Workspaces (${c.length}):
|
|
14
|
-
`);for(let o of c){let s=o.id===f?" (current)":"";console.log(` ${o.name}${s}`),console.log(` ID: ${o.id}`),console.log("")}}export{h as runWorkspaces};
|