@entrydesk/cli 2.1.0 → 2.2.0-beta.1
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 +127 -29
- package/dist/add-BJv6tPO-.js +10 -0
- package/dist/agents-fP3hIH7X.js +10 -0
- package/dist/billing-Cy0BYngu.js +10 -0
- package/dist/budget-MVbF8WbS.js +10 -0
- package/dist/{build-task-request-config-C62XneUL.js → build-task-request-config-BzI-dDZP.js} +1 -1
- package/dist/commands-CfDSEDKI.js +10 -0
- package/dist/{commands-D5BrzwFc.js → commands-DU48SG8W.js} +1 -1
- package/dist/config-Cl-c7scx.js +11 -0
- package/dist/connectors-DVzXDbUU.js +11 -0
- package/dist/file-upload-Dq6B0x4m.js +24 -0
- package/dist/format-CIj0qQba.js +10 -0
- package/dist/{hash-CnSb1n2t.js → hash-92fWniGT.js} +1 -1
- package/dist/index.js +46 -26
- package/dist/{instruction-BzftVNfK.js → instruction-6ZWRQh4G.js} +1 -1
- package/dist/login-CO1aBG6c.js +10 -0
- package/dist/{logout-BFFnjWjY.js → logout-WKIZVWJ7.js} +1 -1
- package/dist/marketplace-C0C2JpYf.js +12 -0
- package/dist/{mcp-D2zejorr.js → mcp-CqMrd5AI.js} +2 -2
- package/dist/{mcp-client-ltOwvE7T.js → mcp-client-CEH9X7Vs.js} +1 -1
- package/dist/meeting-C5vHfcTw.js +11 -0
- package/dist/message-utils-D48Yqd9T.js +25 -0
- package/dist/models-BENTHton.js +11 -0
- package/dist/notifications-DdadH0Wc.js +10 -0
- package/dist/{paginate-C9ixtica.js → paginate-Cbe4RaEq.js} +1 -1
- package/dist/paths-BiowKnkz.js +10 -0
- package/dist/profile-hhU_G-Ea.js +10 -0
- package/dist/profile-storage-CKrZ-xsd.js +73 -0
- package/dist/{project-context-C0ozCzKH.js → project-context-DeYepfN2.js} +1 -1
- package/dist/project-governance-R__UPIhr.js +10 -0
- package/dist/{project-sources-DFn7Tn7u.js → project-sources-C-MXx6j-.js} +1 -1
- package/dist/project-sources-write-ygvHaDUu.js +10 -0
- package/dist/project-tasks-B0STK_8Q.js +10 -0
- package/dist/project-xiz3Jopl.js +10 -0
- package/dist/{push-mojEdys2.js → push-BxQQWCZ2.js} +1 -1
- package/dist/recordings-68Oe1Kvd.js +11 -0
- package/dist/remove-C7BCBdoq.js +10 -0
- package/dist/resolve-IOW00hfy.js +14 -0
- package/dist/resource-grants-Bb4evqsH.js +10 -0
- package/dist/schedules-wopieg4D.js +29 -0
- package/dist/skills-Drr0gw-l.js +10 -0
- package/dist/status-Bw2E5bfa.js +10 -0
- package/dist/status-DX6A6ugk.js +10 -0
- package/dist/task-bZNZ_yxV.js +116 -0
- package/dist/tasks-ZC9uSdkB.js +22 -0
- package/dist/{tasks-CA2QZ8rX.js → tasks-lK8PTMnE.js} +1 -1
- package/dist/team-8-enl9cj.js +11 -0
- package/dist/teams-ByeuT2Ks.js +10 -0
- package/dist/terminal-text-cBPBiP3x.js +10 -0
- package/dist/{isRecord-BNZWvqVS.js → token-DrAF7BWj.js} +1 -1
- package/dist/tool-82NKBr29.js +17 -0
- package/dist/update-DfOBWme1.js +10 -0
- package/dist/usage-BS_didkP.js +11 -0
- package/dist/usage-audit-DOuyWGaq.js +12 -0
- package/dist/{version-C1OwBsCd.js → version-D7DOD1ug.js} +1 -1
- package/dist/webhook-Da2l-gv6.js +11 -0
- package/dist/workflow-oudE3gsp.js +14 -0
- package/dist/workspaces-9SRfDSh3.js +11 -0
- package/package.json +8 -7
- package/dist/add-D4yZrlJH.js +0 -10
- package/dist/agents-3dOJzTmM.js +0 -10
- package/dist/billing-Cyk-IzGv.js +0 -10
- package/dist/budget-znTQ0rkG.js +0 -10
- package/dist/commands--5Ein-MI.js +0 -10
- package/dist/config-D-9dIy19.js +0 -11
- package/dist/connectors-B7smri5B.js +0 -11
- package/dist/file-upload-D2s_clGk.js +0 -24
- package/dist/format-DCvznP70.js +0 -10
- package/dist/login-Ch3S9nh6.js +0 -10
- package/dist/marketplace-DNm78dKX.js +0 -12
- package/dist/meeting-BdLr54zK.js +0 -11
- package/dist/message-utils-DiNLK_84.js +0 -15
- package/dist/models-6WioEQKB.js +0 -11
- package/dist/notifications-DIokyl4e.js +0 -10
- package/dist/paths-CZAS8cbS.js +0 -10
- package/dist/profile-CWsA2P_O.js +0 -10
- package/dist/profile-storage-CuiJZpFD.js +0 -68
- package/dist/project-c8F30d-Q.js +0 -10
- package/dist/project-governance-DRDjqvX8.js +0 -10
- package/dist/project-sources-write-Bz0lGCid.js +0 -10
- package/dist/project-tasks-DnOrMxr3.js +0 -10
- package/dist/recordings-BbeRVH0H.js +0 -11
- package/dist/remove-BLF3muSH.js +0 -10
- package/dist/resolve-BoqGhxVK.js +0 -14
- package/dist/resource-grants-CtIINiDN.js +0 -10
- package/dist/schedules-ec4cS2A0.js +0 -29
- package/dist/skills-C0xCUb-M.js +0 -10
- package/dist/status-Bfh5hjTq.js +0 -10
- package/dist/status-DpYhlJPA.js +0 -10
- package/dist/task-DfLoMsmZ.js +0 -108
- package/dist/tasks-Bl8A2HW6.js +0 -22
- package/dist/tool-B8CuZYYb.js +0 -17
- package/dist/update-BVBj3leV.js +0 -10
- package/dist/usage-CIhTZm98.js +0 -11
- package/dist/usage-audit-BUcbqdAc.js +0 -12
- package/dist/workflow-DJSq8hY5.js +0 -14
- package/dist/workspaces-BM_3Miqs.js +0 -11
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,d as t,p as n,s as r}from"./profile-storage-CKrZ-xsd.js";import{n as i,r as a,t as o}from"./terminal-text-cBPBiP3x.js";import{d as s,i as c,o as l,p as u,t as d}from"./resolve-IOW00hfy.js";import{a as f,i as p,n as m,r as h,s as g}from"./message-utils-D48Yqd9T.js";const _=`\x1B[2m`,v=`\x1B[0m`,y=`\x1B[36m`,b=`\x1B[33m`,x=`\x1B[32m`;function S(e,t){let n=t===void 0?{event:e}:{event:e,data:t};process.stdout.write(`${o(n)}\n`)}function C(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/(1e3*60*60*24));return r===0?t.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`}):r===1?`Yesterday`:r<7?`${r} days ago`:t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function w(e){return e.replace(/<mark>/g,`\x1B[1m`).replace(/<\/mark>/g,v).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`)}function T(e,t){if(t)return e;let n=e.split(`
|
|
11
|
+
`);if(n.length<=15)return e;let r=n.slice(0,6),i=n.slice(-4),a=n.length-10;return[...r,`… (${a} lines omitted, use --full-output to see all) …`,...i].join(`
|
|
12
|
+
`)}function E(e){if(!e||typeof e!=`object`)return e;if(Array.isArray(e))return e.map(E);let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&r.length>200?t[n]=r.slice(0,150)+`… (truncated)`:typeof r==`object`&&r?t[n]=E(r):t[n]=r;return t}function D(e){if(!e||typeof e!=`object`)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function O(e){return a(D(e))}function k(e,t){if(!e)return`(no result)`;if(typeof e!=`object`)return T(a(String(e)),t);let n=t?e:E(e);if(`structuredContent`in n&&n.structuredContent){let e=n.structuredContent,r=[];if(e.stdout&&typeof e.stdout==`string`&&e.stdout.trim()&&r.push(a(e.stdout.trim())),e.stderr&&typeof e.stderr==`string`&&e.stderr.trim()&&r.push(`${b}[stderr]${v} ${a(e.stderr.trim())}`),e.urls&&Array.isArray(e.urls)){let t=e.urls;for(let e of t)e.path&&e.url&&r.push(a(`${e.path}: ${e.url}`))}return r.length===0&&r.push(a(JSON.stringify(e,null,2))),T(r.join(`
|
|
13
|
+
`),t)}return`content`in n&&Array.isArray(n.content)?T(a(n.content.filter(e=>e.type===`text`&&e.text).map(e=>e.text).join(`
|
|
14
|
+
`)||JSON.stringify(e,null,2)),t):n.type===`text`&&typeof n.content==`string`?T(a(n.content),t):T(a(JSON.stringify(e,null,2)),t)}function A(e){if(typeof e.title==`string`)return e.title;if(typeof e.toolName==`string`)return e.toolName;let t=e.type;return t.startsWith(`tool-`)?t.slice(5).replaceAll(`__`,` `).replace(/_/g,` `):t}function j(e,t){let n=[];for(let r of e)if(r.type===`reasoning`&&r.text)n.push(`${_}${a(r.text)}${v}`);else if(r.type===`text`&&r.text)n.push(a(r.text));else if(r.type===`data-background-run-receipt`){let e=m(r.data);e&&n.push(e)}else if(r.type===`tool-call`&&r.toolName){let e=[`${y}┌─ Tool: ${i(String(r.toolName))}${v}`];if(r.args){e.push(`${b}│ Input:${v}`);let t=O(r.args);for(let n of t.split(`
|
|
15
|
+
`))e.push(`${_}│ ${n}${v}`)}if(r.result!==void 0){e.push(`${x}│ Output:${v}`);let n=k(r.result,t);for(let t of n.split(`
|
|
16
|
+
`))e.push(`${_}│ ${t}${v}`);e.push(`${y}└─ ${r.toolName} completed${v}`)}else r.state===`call`?e.push(`${y}└─ (awaiting result)${v}`):e.push(`${y}└─${v}`);n.push(e.join(`
|
|
17
|
+
`))}else if(r.type.startsWith(`tool-`)&&r.type!==`tool-call`){if(f(r))continue;let e=h(r);if(e){n.push(e);continue}let o=i(A(r)),s=[`${y}┌─ Tool: ${o}${v}`];if(r.input){s.push(`${b}│ Input:${v}`);let e=O(r.input);for(let t of e.split(`
|
|
18
|
+
`))s.push(`${_}│ ${t}${v}`)}let c=g({state:r.state,output:r.output,errorText:r.errorText});if(r.output!==void 0&&r.state===`output-available`){s.push(`${x}│ Output:${v}`);let e=k(r.output,t);for(let t of e.split(`
|
|
19
|
+
`))s.push(`${_}│ ${t}${v}`);let n=p(r.approval);n&&s.push(`${_}│ ${n}${v}`),s.push(`${y}└─ completed${v}`)}else c===void 0?r.state===`call`||r.state===`partial-call`?s.push(`${y}└─ (in progress)${v}`):s.push(`${y}└─${v}`):(c&&s.push(`${_}│ ${a(c)}${v}`),s.push(`${y}└─ failed${v}`));n.push(s.join(`
|
|
20
|
+
`))}return n.join(`
|
|
21
|
+
|
|
22
|
+
`).trim()}function M(){return{empty:'No tasks yet. Start one with `entrydesk task -m "..."`.',heading:e=>`Recent tasks (${e}):`,label:(e,t)=>`${(t+1).toString().padStart(2,` `)}.`,footer:e=>["Use `entrydesk tasks 1` to view the most recent task",'Use `entrydesk task -c 1 -m "message"` to continue it',...e?[`Next page: --next-key ${e}`]:[]]}}function N(e){return{empty:`No tasks you can see in this project yet. Start one with \`entrydesk task --project ${e} -m "..."\`.`,heading:e=>`Tasks in this project (${e}):`,label:e=>`${_}${e.id}${v}`,footer:e=>["Use `entrydesk tasks <taskId>` to view one of them",...e?[`Next page: --next-key ${e}`]:[]]}}async function P(i,a){let f=a.output!==void 0,p=new e;if(i&&a.project&&await s(a,new l(`project_not_applicable`,"`--project` narrows the listing and the search; drop it to view a task.")),a.share){let e;try{e=await t()}catch{}try{let t=await p.getSharedTask(a.share,e),{messages:n}=await p.getSharedMessages(a.share,50,e);if(a.json){console.log(o({task:t,messages:n}));return}if(f){if(S(`task`,t),n.length===0)S(`info`,`No messages in this shared task.`);else for(let e of n.toReversed())S(`message`,e);S(`done`);return}if(console.log(`Shared task: ${t.title||`Untitled`}`),console.log(`Visibility: ${t.visibility}`),t.agent&&console.log(`Agent: ${t.agent.name}`),console.log(`${n.length} messages\n`),n.length===0){console.log(`No messages in this shared task.`);return}let r=n.toReversed(),i=a.fullOutput??!1;for(let e of r){let t=j(e.parts,i);if(!t)continue;let n=e.role===`user`?`You`:`Assistant`;console.log(`[${n}] ${C(e.createdAt)}`),console.log(t),console.log(``)}return}catch(e){if(e instanceof Error){let t=e.message.toLowerCase();t.includes(`401`)||t.includes(`unauthorized`)?console.error(`Access denied. This shared task requires authentication or is not accessible to you.`):t.includes(`404`)||t.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: ${e.message}`)}else console.error(`Failed to fetch shared task`);process.exit(1)}}let m=a.project?await c(a.project,a.json??!1):void 0,h=e=>m?u({json:a.json??!1},e,`tasks:read`):e(),g,y;try{let e=await n();g=e.accessToken,y=e.workspaceId}catch(e){r(e)}if(i){let e=i,t=!1,n=null,r=Number.parseInt(i,10);if(!Number.isNaN(r)&&r>=0&&/^\d+$/.test(i)){let i=r===0?1:r,{tasks:a}=await p.getTasks(g,y),o=a[i-1];o===void 0&&(console.error(`Task number ${i} not found. You have ${a.length} recent tasks.`),process.exit(1)),e=o.id,t=!0,n=o,f||console.log(`Task: ${o.title||`Untitled`}\n`)}let{messages:s}=await p.getMessages(g,y,e,50);if(a.json){console.log(o(s));return}if(f){if(n&&S(`task`,n),s.length===0)S(`info`,`No messages in this task.`);else for(let e of s.toReversed())S(`message`,e);S(`done`);return}if(s.length===0){console.log(`No messages in this task.`);return}let c=s.toReversed(),l=a.fullOutput??!1;t||console.log(`Task: ${i.slice(0,8)}…`),console.log(`${s.length} messages\n`);for(let e of c){let t=j(e.parts,l);if(!t)continue;let n=e.role===`user`?`You`:`Assistant`;console.log(`[${n}] ${C(e.createdAt)}`),console.log(t),console.log(``)}return}let x=a.search;if(x){m&&await h(()=>d({client:p,accessToken:g,workspaceId:y},m));let{results:e,nextKey:t}=await h(()=>p.searchTasks(g,y,x,{limit:a.limit,nextKey:a.nextKey,projectId:m}));if(f){for(let t of e)S(`task`,t);S(`done`);return}if(a.json){console.log(o({results:e,nextKey:t}));return}if(e.length===0){console.log(`No tasks match "${a.search}".`);return}console.log(`Search results for "${a.search}" (${e.length}):\n`);for(let[t,n]of e.entries()){let e=(t+1).toString().padStart(2,` `),r=n.titleHighlight?w(n.titleHighlight):n.title||`Untitled`;console.log(` ${e}. ${_}${C(n.createdAt)}${v} ${r}`),n.contentSnippet&&console.log(` ${w(n.contentSnippet)}`),console.log(` ${_}ID: ${n.id}${v}`)}t&&console.log(`\nNext page: --next-key ${t}`);return}let T=m&&a.project?N(a.project):M(),{tasks:E,nextKey:D}=await h(()=>p.getTasks(g,y,{limit:a.limit,nextKey:a.nextKey,projectId:m}));if(f){for(let e of E)S(`task`,e);S(`done`);return}if(a.json){console.log(o(E));return}if(E.length===0){console.log(T.empty);return}console.log(`${T.heading(E.length)}\n`);for(let[e,t]of E.entries()){let n=t.waitingReason===`approval`?` ${b}[waiting approval]${v}`:t.waitingReason===`client`?` ${b}[waiting device]${v}`:t.waitingReason===`background`?` [34m[waiting background]${v}`:``;console.log(` ${T.label(t,e)} ${C(t.createdAt).padEnd(12)} ${t.title||`Untitled`}${n}`)}console.log(``);for(let e of T.footer(D))console.log(e)}export{P as n,w as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{O as e}from"./profile-storage-CKrZ-xsd.js";import{o as t}from"./resolve-IOW00hfy.js";import{validate as n}from"uuid";function r(t){return t.map(t=>` - ${e(t.name)} (${t.teamId})`).join(`
|
|
11
|
+
`)}function i(e){return e.toLocaleLowerCase(`en`)}function a(e,i,a){return new t(`project_team_not_found`,`${n(e)?`No team with id ${e}.`:`No team named "${e}".`} ${i}${a.length>0?`\nA name has to match exactly, including case. Teams with a similar name:\n${r(a)}`:``}`)}function o(e,t){return e.teamId.toLowerCase()===t.toLowerCase()}function s(e,t){return n(t)?e.filter(e=>o(e,t)):e.filter(e=>e.name===t)}function c(e,o,c){let l=s(e,o),[u]=l;if(l.length===1&&u!==void 0)return u;if(l.length>1)throw new t(`team_ambiguous`,`More than one team is named "${o}". Pass one of these ids with --team:\n${r(l)}`);if(n(o))throw a(o,c,[]);let d=i(o);throw a(o,c,e.filter(e=>i(e.name).includes(d)))}export{c as n,s as t};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,O as t,p as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";async function i(i){let{accessToken:a,workspaceId:o}=await n(),s=new e,c=[],l;do{let e=await s.listTeams(a,o,{nextKey:l,search:i.search});c.push(...e.teams),l=e.nextKey}while(l);if(i.json){console.log(r(c));return}if(c.length===0){console.log(`No teams found.`);return}console.log(`Teams (${c.length}):\n`);for(let e of c){let n=e.currentUserRole?` · you are ${e.currentUserRole}`:``;console.log(` ${t(e.name)} (${e.memberCount} members, ${e.visibility}${n})`),console.log(` ID: ${e.id}`),console.log(``)}}export{i as listTeams};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
function e(e,t){return e.replace(/\u001B\][^\u001B\u0007]*(?:\u0007|\u001B\\)/gu,``).replace(/\u001B\[[0-?]*[ -/]*[@-~]/gu,``).replace(t,``)}function t(t){return e(t,/[\u0000-\u001F\u007F-\u009F]/gu)}function n(t){return e(t,/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/gu)}function r(e){return`\\u${(e.codePointAt(0)??0).toString(16).padStart(4,`0`)}`}function i(e,t){return JSON.stringify(e??null,null,t).replace(/[\u0080-\u009F]/gu,r)}export{t as n,n as r,i as t};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
function e(
|
|
10
|
+
import{f as e,u as t}from"./profile-storage-CKrZ-xsd.js";async function n(n){let{accessToken:r,workspaceId:i}=await e();if(!n.json){process.stdout.write(`${r}\n`);return}let a=t(r)?.exp;process.stdout.write(`${JSON.stringify({token:r,expiresAt:typeof a==`number`?new Date(a*1e3).toISOString():void 0,workspaceId:i})}\n`)}export{n as printAccessToken};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{Tn as e,Yt as t,c as n,i as r,l as i}from"./profile-storage-CKrZ-xsd.js";import{t as a}from"./terminal-text-cBPBiP3x.js";import{n as o,r as s}from"./mcp-client-CEH9X7Vs.js";import{t as c}from"./stdin-B18x8pUF.js";import l from"node:fs";import u from"node:os";import d from"node:path";import f from"node:fs/promises";const p=!process.env.NO_COLOR&&process.stdout.isTTY,m={green:p?`\x1B[32m`:``,yellow:p?`\x1B[33m`:``,reset:p?`\x1B[0m`:``},h=8*1024;function g(){return d.join(u.homedir(),`.entrydesk`,`tool-results`)}function _(e){let t=e.trim().replace(/[/\\:*?"<>|\s]/g,`_`).replace(/_+/g,`_`).replace(/^[._]+|[._]+$/g,``).slice(0,100);return!t||t===`.`||t===`..`?`unnamed_tool`:t}function v(e){try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}n`:typeof t==`function`?`[Function]`:typeof t==`symbol`?t.toString():t,2)}catch{return String(e)}}function y(e){let t=new Date;return`${[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(`-`)}_${_(e)}.json`}async function b(e,t){try{return await f.writeFile(e,t,{encoding:`utf8`,flag:`wx`}),!0}catch(e){if(e instanceof Error&&`code`in e&&e.code===`EEXIST`)return!1;throw e}}async function x(e,t){try{let n=g();await f.mkdir(n,{recursive:!0});let r=y(e),i=d.extname(r),a=r.slice(0,-i.length),o=v(t),s=d.join(n,r);if(await b(s,o))return s;for(let e=1;e<=100;e++){let t=d.join(n,`${a}-${e}${i}`);if(await b(t,o))return t}let c=Math.random().toString(36).slice(2,10),l=d.join(n,`${a}-${c}${i}`);return await f.writeFile(l,o,{encoding:`utf8`,flag:`wx`}),l}catch(e){let t=e instanceof Error?e.message:`unknown error`;return console.error(`${m.yellow}Warning: Could not save result to file: ${t}${m.reset}`),null}}function S(e,t){let n=Buffer.byteLength(e,`utf8`);if(n<=10240)return e;let r=e.slice(0,h),i=e.slice(-2048),a=` … (skipped ${((n-h-2048)/1024).toFixed(1)}KB of ${(n/1024).toFixed(1)}KB) …`;return t&&(a+=`
|
|
11
|
+
Tip: jq -r '.structuredContent.field' <file> | grep/head/tail`),`${r}\n\n${a}\n\n${i}`}function C(e){console.log(`${m.green}Tool execution result saved to: ${e}${m.reset}`),console.log()}function w(){console.log(`${m.green}Tool execution result:${m.reset}`)}function T(t){return e(t)&&typeof t.name==`string`&&(t.description===void 0||typeof t.description==`string`)}function E(t){return Array.isArray(t.primaryTools)&&t.primaryTools.every(T)&&(t.relatedTools===void 0||Array.isArray(t.relatedTools)&&t.relatedTools.every(T))&&(t.toolSchemas===void 0||e(t.toolSchemas))&&(t.authStatuses===void 0||Array.isArray(t.authStatuses)&&t.authStatuses.every(t=>e(t)&&typeof t.toolNamespace==`string`&&typeof t.connected==`boolean`&&(t.authStatusMessage===void 0||typeof t.authStatusMessage==`string`)))&&[t.recommendedPlanSteps,t.knownPitfalls].every(e=>e===void 0||Array.isArray(e)&&e.every(e=>typeof e==`string`))&&(t.error===null||typeof t.error==`string`)}function D(e){return e.split(`__`)[0]??e}function O(e,t,n){console.error(n?a({error:{code:e,message:t}}):`Error [${e}]: ${t}`),process.exitCode=1}function k(e,t,n){O(e,t,n),process.exit(1)}function A(e,t,a=`CONNECTION_FAILED`){if(n(e)){O(a,r(),t);return}let o=e instanceof Error?e.message:`Unknown error`;e instanceof i&&e.code===`not-logged-in`?O(`AUTH_MISSING`,o,t):O(a,o,t)}function j(e,t,n=`CONNECTION_FAILED`){A(e,t,n),process.exit(1)}var M=class extends Error{constructor(e){super(e),this.name=`InputError`}};async function N(e,t){if(e)return e;if(t)try{return l.readFileSync(t,`utf-8`).trim()}catch(e){throw new M(`Failed to read input file: ${e instanceof Error?e.message:`Failed to read input file`}`)}if(!process.stdin.isTTY){let e;try{e=await c()}catch(e){throw new M(`Failed to read stdin: ${e instanceof Error?e.message:`Failed to read stdin`}`)}let t=e.trim();if(t)return t}throw new M(`Input JSON is required. Use --input, --input-file, or pipe it via stdin.`)}function P(e){let t=[`Tool: ${e.name}`];return e.description&&t.push(` Description: ${e.description}`),t.join(`
|
|
12
|
+
`)}async function F(e){let t=[],n=new Set,r;do{let i=await e.listTools(r?{cursor:r}:{},s());if(t.push(...i.tools),r=i.nextCursor,r){if(n.has(r))throw Error(`Tool listing returned a repeated pagination cursor`);n.add(r)}}while(r);return t}async function I(t,n,r){let i=await t.callTool({name:n,arguments:r},s());if(i.isError){let e=i.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
13
|
+
`);throw Error(e||`Tool discovery failed: ${n}`)}if(!e(i.structuredContent))throw Error(`Tool discovery returned no structured content: ${n}`);return i.structuredContent}async function L(e,n){let r=await I(e,t.GET_TOOL_SCHEMAS,{toolNames:[n]}),i=r.errors;if(i?.length)throw Error(i.join(`
|
|
14
|
+
`));let a=r.toolSchemas?.[n];if(a?.inputSchema)return{name:n,...a};throw Error(`Could not retrieve an input schema for ${n}. The name may be incorrect, or its connector may need authorization or be unavailable. Use entrydesk tool search "<English query>" to discover tool names, or entrydesk connectors --all to check connections.`)}async function R(e,n){let r=n.json??!1,i=await o().catch(e=>{j(e,r)}),s;try{let r=await I(i,t.SEARCH_TOOLS,{query:e,...n.namespace&&{toolNamespaces:n.namespace}});if(!E(r))throw Error(`Tool discovery returned invalid search results`);s=r}catch(e){A(e,r,`TOOL_DISCOVERY_FAILED`);return}finally{await i.close().catch(()=>{})}if(r)console.log(a(s,2));else{console.log(`Matched tools (${s.primaryTools.length}):\n`);for(let e of s.primaryTools)console.log(P(e));if(s.relatedTools?.length){console.log(`
|
|
15
|
+
Related tools:`);for(let e of s.relatedTools)console.log(P(e))}for(let e of s.authStatuses??[])e.connected||console.log(`\n${e.toolNamespace}: ${e.authStatusMessage??`Not connected. Run entrydesk connectors --all to check authorization.`}`);for(let e of s.recommendedPlanSteps??[])console.log(e);for(let e of s.knownPitfalls??[])console.log(e);console.log(`
|
|
16
|
+
Next: entrydesk tool get <name> --json`),console.log(`Then: entrydesk tool call <name> --input-file input.json --json`)}s.error&&O(`TOOL_DISCOVERY_FAILED`,s.error,r)}function z(e){let t=[`Tool: ${e.name}`];return e.description&&(t.push(`Description:`),t.push(` ${e.description}`)),t.push(`Input Schema:`),t.push(a(e.inputSchema,2)),t.join(`
|
|
17
|
+
`)}async function B(e){let t=e.json??!1,n=await o().catch(e=>{j(e,t)});try{let r=await F(n);if(e.prefix){let t=e.prefix.toLowerCase();r=r.filter(e=>D(e.name).toLowerCase().startsWith(t))}if(t)console.log(a(r,2));else{let t=e.prefix?` (prefix: ${e.prefix})`:``;console.log(`Directly listed tools (${r.length})${t}:\n`);for(let e of r)console.log(P(e)),console.log();console.log(`Connector tools may be available without appearing here. Use entrydesk tool search "<English query>" or entrydesk tool get <name>.`)}}catch(e){j(e,t)}finally{await n.close().catch(()=>{})}}async function V(e,t){let n=t.json??!1,r=await o().catch(e=>{j(e,n)}),i;try{i=(await F(r)).find(t=>t.name===e)??await L(r,e)}catch(e){A(e,n,`TOOL_DISCOVERY_FAILED`);return}finally{await r.close().catch(()=>{})}console.log(n?a(i,2):z(i))}async function H(e,t,n){let r;try{r=JSON.parse(t)}catch(e){k(`INVALID_INPUT`,e instanceof Error?`Invalid JSON input: ${e.message}`:`Invalid JSON input`,n)}let i=await o().catch(e=>{j(e,n,`TOOL_CALL_FAILED`)}),c=!1;try{let t=await i.callTool({name:e,arguments:r},s());if(n)console.log(a(t,2));else{let n=await x(e,t);n&&C(n),w();for(let e of t.content)e.type===`text`?console.log(e.text):e.type===`image`?console.log(`[Image: ${e.mimeType}]`):e.type===`resource`?console.log(`[Resource: ${e.resource.uri}]`):console.log(a(e,2));if(t.structuredContent){let e=S(a(t.structuredContent,2),n);console.log(e)}}t.isError&&(c=!0)}catch(e){j(e,n,`TOOL_CALL_FAILED`)}finally{await i.close().catch(()=>{})}c&&process.exit(1)}async function U(e,t){let n=t.json??!1,r;try{r=await N(t.input,t.inputFile)}catch(e){throw e instanceof M&&k(`INVALID_INPUT`,e.message,n),e}await H(e,r,n)}export{V as getTool,B as listTools,U as runToolCall,R as searchTools};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{r as e}from"./profile-storage-CKrZ-xsd.js";import{t}from"./version-D7DOD1ug.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import r from"cross-spawn";const i=`@entrydesk/cli`;function a(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/u.exec(e.trim());return t?{nums:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:t[4]??null}:null}function o(e,t){if(e===t)return 0;if(e===null)return 1;if(t===null)return-1;let n=e.split(`.`),r=t.split(`.`);for(let[e,t]of n.entries()){let n=r[e];if(n===void 0)break;if(t!==n){let e=/^\d+$/u.test(t),r=/^\d+$/u.test(n);return e&&r?Number(t)<Number(n)?-1:1:e?-1:r?1:t<n?-1:1}}return n.length===r.length?0:n.length<r.length?-1:1}function s(e,t){let n=a(e),r=a(t);if(!n||!r)return n?1:r?-1:0;for(let[e,t]of n.nums.entries()){let n=r.nums[e];if(n!==void 0&&t!==n)return t<n?-1:1}return o(n.prerelease,r.prerelease)}function c(e,{inheritOutput:t}){return new Promise((n,i)=>{let a=r(`npm`,e,{stdio:t?[`ignore`,`inherit`,`inherit`]:[`ignore`,`pipe`,`pipe`]}),o=``,s=``;a.stdout?.on(`data`,e=>{o+=String(e)}),a.stderr?.on(`data`,e=>{s+=String(e)}),a.once(`error`,i),a.once(`close`,e=>{n({exitCode:e??1,stdout:o,stderr:s})})})}async function l(){let t;try{t=await c([`view`,i,`version`],{inheritOutput:!1})}catch(t){throw new e(`Failed to run npm — is npm installed and on your PATH?`,1,t instanceof Error?t:void 0)}let n=t.stdout.trim();if(t.exitCode!==0||!n)throw new e(`Failed to look up the latest ${i} version from the npm registry.${t.stderr?`\n${t.stderr.trim()}`:``}`);if(!a(n))throw new e(`Unexpected version from the npm registry: ${JSON.stringify(n)}`);return n}async function u(r){let a=t(),o=await l(),u=s(a,o),d=u>=0;if(r.check||d){r.json?console.log(n({current:a,latest:o,upToDate:d,updated:!1})):console.log(u>0?`entrydesk ${a} is newer than the latest published version (${o}). Nothing to do.`:d?`entrydesk ${a} is already the latest version.`:`Update available: ${a} → ${o}. Run \`entrydesk update\` to install.`);return}r.json||console.log(`Updating entrydesk ${a} → ${o}…`);let f=await c([`install`,`-g`,`${i}@${o}`],{inheritOutput:!r.json});if(f.exitCode!==0){let t=f.stderr?`\n${f.stderr.trim()}`:``;throw new e(`npm install failed (exit code ${f.exitCode}). You can update manually with \`npm install -g ${i}@latest\`.`+t,f.exitCode)}r.json?console.log(n({current:a,latest:o,upToDate:d,updated:!0})):console.log(`entrydesk updated to ${o}.`)}export{u as runUpdate};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,p as t}from"./profile-storage-CKrZ-xsd.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import{i as r,n as i}from"./format-CIj0qQba.js";import{writeFileSync as a}from"node:fs";function o(e){console.log(`Extra-usage balance: ${r(e.balanceUsd)}`);let t=e.currentSpentUsedPercent==null?``:` (${e.currentSpentUsedPercent}% of limit)`;console.log(`Spent this period: ${i(e.currentSpentUsd)}${t}`),e.monthlyExtraUsageLimitUsd!=null&&console.log(`Workspace limit: ${r(e.monthlyExtraUsageLimitUsd)} / month`),e.memberMonthlyExtraUsageLimitUsd!=null&&console.log(`Per-member limit: ${r(e.memberMonthlyExtraUsageLimitUsd)} / month`),e.nextExpiry&&console.log(`Next expiry: ${r(e.nextExpiry.amountUsd)} at ${new Date(e.nextExpiry.expiresAt).toLocaleString()}`),console.log(`Period: ${new Date(e.period.startAt).toLocaleDateString()} – ${new Date(e.period.endAt).toLocaleDateString()}`)}function s(e){console.log(`Seat type: ${e.seatType}`),e.hourly&&console.log(`Hourly used: ${e.hourly.usedPercent}%`),console.log(`Weekly used: ${e.weekly.usedPercent}%`),console.log(`Extra spent: ${i(e.extraUsage.spentUsd)}`),console.log(`Available: ${e.availability.allowed?`yes`:`no (${e.availability.reason??`unknown`})`}`),e.trial&&console.log(`Trial: ${e.trial.remainingDays} days remaining`)}function c(e){console.log(`Consumptions (${e.items.length} of ${e.total}):\n`);for(let t of e.items)console.log(` ${t.user.name} (${t.user.email})`),console.log(` Seat: ${t.seatType} · Extra usage: ${i(t.extraUsage)}`),console.log(` User ID: ${t.user.id}`),console.log(``)}async function l(r){let{accessToken:i,workspaceId:a}=await t(),s=await new e().getUsageOverview(i,a);if(r.json){console.log(n(s));return}o(s)}async function u(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().getUsageMe(i,a);if(r.json){console.log(n(o));return}s(o)}async function d(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().getUsageConsumptions(i,a,{limit:r.limit,offset:r.offset,periodStart:r.periodStart});if(r.json){console.log(n(o));return}if(o.items.length===0){console.log(`No consumptions for this period.`);return}c(o)}async function f(n){let{accessToken:r,workspaceId:i}=await t(),o=await new e().exportUsageCsv(r,i,n.periodStart);if(n.output){a(n.output,o),console.log(`Wrote usage CSV to ${n.output}`);return}process.stdout.write(o)}async function p(r){let{accessToken:a,workspaceId:o}=await t(),s=new e,c=[],l,u=0;do{let e=await s.getMonthlyUsages(a,o,{nextKey:l,limit:100});if(c.push(...e.monthlyUsages),l=e.nextKey,u++,u>=100){console.error(`Warning: Showing first ${c.length} entries (pagination limit reached)`);break}}while(l);if(r.json){console.log(n(c));return}if(c.length===0){console.log(`No usage data found for this workspace.`);return}console.log(`Current month usage:
|
|
11
|
+
`);let d=0,f=0;for(let e of c)d+=Number.parseFloat(e.totalCost),f+=e.operationCount;console.log(`Total cost: ${i(d)}`),console.log(`Total operations: ${f.toLocaleString()}`),console.log(`Users: ${c.length}\n`);let p=[...c].toSorted((e,t)=>r.sortBy===`cost`?Number.parseFloat(t.totalCost)-Number.parseFloat(e.totalCost):t.operationCount-e.operationCount),m=r.limit??p.length,h=p.slice(0,m);console.log(`Usage by user (sorted by ${r.sortBy}, showing ${h.length} of ${c.length}):\n`);for(let e of h)console.log(` ${e.user.name} (${e.user.email})`),console.log(` Cost: ${i(e.totalCost)}`),console.log(` Operations: ${e.operationCount.toLocaleString()}`),console.log(``);h.length<c.length&&console.log(`… and ${c.length-h.length} more users`)}export{f as exportUsage,d as listUsageConsumptions,u as showOwnUsage,l as showUsageBalance,p as showUsageSummary};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{O as e,Zt as t,r as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i}from"./format-CIj0qQba.js";import{n as a,r as o}from"./mcp-client-CEH9X7Vs.js";function s(t){return Array.isArray(t)&&e(t.map(e=>typeof e==`object`&&e&&`text`in e?String(e.text):``).filter(Boolean).join(`
|
|
11
|
+
`))||`usage-audit tool call failed`}async function c(e,t,r){let i=await e.callTool({name:t,arguments:r},o());if(i.isError){let e=s(i.content);throw/not found/i.test(e)?new n(`This deployment does not expose the usage-audit tools (${t}). Credit-billed workspaces record spend in a separate ledger — use \`entrydesk usage consumptions\` and \`entrydesk usage balance\` instead.`):new n(e)}if(i.structuredContent==null)throw new n(`${t} returned no structured content; the workspace may not expose the usage-audit tools.`);return i.structuredContent}async function l(e){let t=await a();try{return await e(t)}finally{await t.close().catch(()=>{})}}function u(e){return e.toLocaleString()}function d(e){return e==null?`—`:`${e>0?`+`:``}${e}%`}function f(e){return e?e.slice(0,10):`never`}async function p(e){let n=await l(n=>c(n,t.GET_COST_RANKING,{groupBy:e.by,...e.days!=null&&{windowDays:e.days},...e.model&&{model:e.model},...e.limit!=null&&{limit:e.limit}}));if(e.json){console.log(r(n,2));return}let a=n.windowDays==null?`all time`:`last ${n.windowDays} days`,o=e.model?` · model ~ "${e.model}"`:``;if(console.log(`Cost ranking by ${e.by} · ${a}${o}\n`),n.rows.length===0){console.log(` No spend in this window.`);return}let s=Math.max(...n.rows.map(e=>i(e.cost).length));for(let e of n.rows){let t=e.ownerEmail?` · ${e.ownerEmail}`:``;console.log(` ${i(e.cost).padStart(s)} ${d(e.costChangePct).padEnd(7)} ${u(e.calls).padStart(8)} calls ${e.key}${t}`)}console.log(`\n ${n.rows.length} rows.`)}async function m(e,n){let[a,o]=await l(r=>Promise.all([c(r,t.GET_USER_BREAKDOWN,{email:e,sinceDays:n.days,minCost:n.minCost??0}),c(r,t.GET_USER_DAILY_TREND,{emails:[e],days:n.days})]));if(n.json){console.log(r({breakdown:a,trend:o},2));return}if(console.log(`${e} · last ${n.days} days\n`),console.log(`By agent / operation:`),a.breakdown.length===0)console.log(` (no spend)`);else{let e=Math.max(...a.breakdown.map(e=>i(e.cost).length));for(let t of a.breakdown)console.log(` ${i(t.cost).padStart(e)} ${u(t.calls).padStart(8)} calls ${t.agentOrOperation}`)}let s=o.trends[0]?.days??[];if(s.length>0){console.log(`
|
|
12
|
+
Daily:`);for(let e of s)console.log(` ${e.date} ${i(e.cost).padStart(10)} ${u(e.calls).padStart(8)} calls`)}if(a.activeSchedules.length>0){console.log(`\nActive schedules (${a.activeSchedules.length}):`);for(let e of a.activeSchedules){let t=e.agentName?` · ${e.agentName}`:``;console.log(` ${e.name}${t} (${e.scheduleType}, last run ${f(e.lastTaskAt)})`)}}}async function h(e){let{stale:n,toolCalls:a}=await l(async n=>{let r=await c(n,t.FIND_STALE_SCHEDULES,{sinceDays:e.days,...e.minCost!=null&&{minCost:e.minCost},...e.limit!=null&&{limit:e.limit}}),i=r.schedules.map(e=>e.scheduleId),a=[];for(let e=0;e<i.length;e+=20)a.push(i.slice(e,e+20));return{stale:r,toolCalls:{schedules:(await Promise.all(a.map(r=>c(n,t.GET_SCHEDULE_TOOL_CALLS,{scheduleIds:r,sinceDays:e.days,recentRuns:5})))).flatMap(e=>e.schedules)}}});if(e.json){console.log(r({stale:n,toolCalls:a},2));return}if(console.log(`Schedules spending with unread output · last ${e.days} days\n`),n.schedules.length===0){console.log(` Nothing flagged.`);return}let o=new Map(a.schedules.map(e=>[e.scheduleId,e.toolCalls]));for(let e of n.schedules){console.log(` ${i(e.cost)} ${u(e.runs)} runs ${e.unreadPct}% unread last read ${f(e.lastReadAt)}`),console.log(` ${e.scheduleName} · ${e.ownerEmail}`);let t=o.get(e.scheduleId)??[];if(t.length===0){console.log(` no tool calls in the last 5 runs — deactivation candidate`);continue}console.log(` tools (last 5 runs): ${t.map(e=>`${e.tool} ${e.calls}`).join(`, `)}`);let n=t.filter(e=>e.failedCalls>0);n.length>0&&console.log(` failing: ${n.map(e=>`${e.tool} ${e.failedCalls}`).join(`, `)} — may be spinning on retries`)}console.log(`\n ${n.schedules.length} schedules.`)}export{m as drillUsage,h as findUsageWaste,p as rankUsage};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,D as t,O as n,a as r,o as i,p as a}from"./profile-storage-CKrZ-xsd.js";import{t as o}from"./terminal-text-cBPBiP3x.js";import{t as s}from"./paginate-Cbe4RaEq.js";import{t as c}from"./confirm-Ct432t3K.js";import{HTTPError as l}from"ky";var u=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`WebhookCommandError`}};const d={webhook_destination_not_found:"Webhook destination not found. `entrydesk webhook list` shows the destinations in this workspace.",webhook_delivery_not_found:"Delivery not found. `entrydesk webhook deliveries <id>` lists the deliveries to a destination.",webhook_destination_disabled:"This destination is disabled. Run `entrydesk webhook enable <id>` first.",webhook_destination_limit_reached:`This workspace already has the maximum number of webhook destinations. Delete one first.`,insufficient_permissions:`Managing webhooks needs the Manage workspace permission in this workspace.`};async function f(e){try{let{features:t}=await e.getRuntimeConfig();if(!t.enableOutgoingWebhooks)return new u(`webhooks_not_enabled`,`Outgoing webhooks are not enabled on this EntryDesk environment.`)}catch(e){return new u(`not_found`,`Not found, and this EntryDesk environment's feature flags could not be read to tell whether webhooks are enabled (${r(e).message.replace(/^Error: /u,``)}).`)}return new u(`not_found`,`Not found.`)}async function p(e,n){if(n instanceof u)return n;if(!(n instanceof l))return null;let r=t(n.data);if(r===`insufficient_scope`)return new u(r,"Your token lacks the workspaces:read / workspaces:write scope webhooks need. Run `entrydesk login` again, or issue a token with those scopes and set ENTRYDESK_TOKEN.");let i=r&&Object.hasOwn(d,r)?d[r]:void 0;return r&&i?new u(r,i):n.response.status===404?f(e):null}async function m(t,r){let s=new e;try{let{accessToken:e,workspaceId:t}=await a();await r({client:s,accessToken:e,workspaceId:t})}catch(e){let{code:r,message:a}=await p(s,e)??i(e),c={code:r,message:a.replace(/^Error: /u,``)};t.json?console.error(o({error:c})):console.error(`Error: ${n(c.message)}`),process.exit(1)}}function h(e){return e?n(e):``}function g(e){return e===null?`—`:`${(e*100).toFixed(1)}%`}function _(e){return e===null?`—`:`${e} ms`}function v(e){return e.httpStatus===null?e.error===null?`In progress`:`${h(e.error)}, ${_(e.responseTimeMs)}`:`HTTP ${e.httpStatus}, ${_(e.responseTimeMs)}`}function y(e){let t=[e.status];return e.disabledReason===`consecutive_failures`&&t.push(`after repeated failures`),e.verifiedAt||t.push(`unverified`),t.join(`, `)}function b(e){return e===null?`All events`:e.join(`, `)}function x(e){let{metrics:t}=e;console.log(`${h(e.name)} (${e.id})`),console.log(` URL: ${h(e.url)}`),e.description&&console.log(` Description: ${h(e.description)}`),console.log(` Status: ${y(e)}`),console.log(` Listening to: ${b(e.eventTypes)}`),console.log(` API version: ${e.apiVersion}`),console.log(` Last 7 days: ${t.deliveryCount} deliveries, ${g(t.errorRate)} errors, p50 ${_(t.p50ResponseTimeMs)}`),e.previousSecretExpiresAt&&console.log(` Previous secret signs until ${e.previousSecretExpiresAt}`)}function S(e){console.log(``),console.log(`Signing secret: ${e}`),console.log(`Store it now; it is not shown again. Verify X-ED-Signature as v1=HMAC-SHA256(secret, "{X-ED-Timestamp}.{raw body}").`)}function C(e){let t=e.lastHttpStatus?`HTTP ${e.lastHttpStatus}`:h(e.lastError)||`—`,n=e.nextAttemptAt?`, next attempt ${e.nextAttemptAt}`:``;console.log(`${e.id} ${e.status.padEnd(9)} ${e.eventType} attempts ${e.attempts} ${t}${n} ${e.createdAt}`)}function w(e){return e.allEvents?{eventTypes:null}:e.events?{eventTypes:e.events}:{}}async function T(e){await m(e,async({client:t,accessToken:n,workspaceId:r})=>{let i=await t.listWebhookDestinations(n,r);if(e.json){console.log(o(i));return}if(i.items.length===0){console.log("No webhook destinations. Create one with `entrydesk webhook create`.");return}for(let e of i.items)console.log(`${e.id} ${h(e.name)} ${h(e.url)} [${y(e)}] ${b(e.eventTypes)} errors ${g(e.metrics.errorRate)}`)})}async function E(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{let a=await n.getWebhookDestination(r,i,e);if(t.json){console.log(o(a));return}x(a)})}async function D(e){await m(e,async({client:t,accessToken:n,workspaceId:r})=>{if(!e.events&&!e.allEvents)throw new u(`events_required`,`Pass --events <types> or --all-events.`);let i=await t.createWebhookDestination(n,r,{url:e.url,name:e.name,description:e.description?.trim()||null,eventTypes:e.allEvents?null:e.events??null,...e.apiVersion?{apiVersion:e.apiVersion}:{}});if(e.json){console.log(o(i));return}console.log(`Created webhook destination.`),x(i.destination),S(i.signingSecret)})}async function O(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{let a={...t.url===void 0?{}:{url:t.url},...t.name===void 0?{}:{name:t.name},...t.description===void 0?{}:{description:t.description.trim()||null},...t.apiVersion===void 0?{}:{apiVersion:t.apiVersion},...w(t)};if(Object.keys(a).length===0)throw new u(`nothing_to_update`,`Pass at least one of --url, --name, --description, --events, --all-events or --api-version.`);let s=await n.updateWebhookDestination(r,i,e,a);if(t.json){console.log(o(s));return}console.log(`Updated webhook destination.`),x(s)})}async function k(e,t,n){await m(n,async({client:r,accessToken:i,workspaceId:a})=>{let s=await r.updateWebhookDestination(i,a,e,{status:t?`active`:`disabled`});if(n.json){console.log(o(s));return}console.log(t?`Enabled ${h(s.name)}. Events from while it was disabled are not resent.`:`Disabled ${h(s.name)}. No events are delivered until you enable it again.`)})}async function A(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{if(!t.yes){if(!process.stdin.isTTY||t.json)throw new u(`confirmation_required`,`Deleting webhook destination ${e} needs confirmation. Re-run with --yes.`);if(!await c(`Delete webhook destination ${e}? Its signing secret is destroyed and deliveries stop.`)){console.log(`Aborted.`);return}}if(await n.deleteWebhookDestination(r,i,e),t.json){console.log(o({id:e,deleted:!0}));return}console.log(`Deleted webhook destination ${e}.`)})}async function j(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{let a=await n.rotateWebhookSecret(r,i,e,t.expirePrevious===void 0?{}:{expirePreviousInSeconds:t.expirePrevious});if(t.json){console.log(o(a));return}console.log(a.previousSecretExpiresAt?`Rotated. The previous secret keeps signing until ${a.previousSecretExpiresAt}.`:`Rotated. The previous secret no longer signs.`),S(a.signingSecret)})}async function M(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{let a=a=>n.listWebhookDeliveries(r,i,e,{status:t.status,eventType:t.eventType,limit:t.all?100:t.limit,nextKey:a}),c=t.all?{items:await s(async e=>{let t=await a(e);return{items:t.items,nextKey:t.nextKey??void 0}}),nextKey:null}:await a(t.nextKey);if(t.json){console.log(o(c));return}if(c.items.length===0){console.log(`No deliveries.`);return}for(let e of c.items)C(e);c.nextKey&&console.log(`\nMore deliveries: --next-key ${h(c.nextKey)}`)})}async function N(e,t,n){await m(n,async({client:r,accessToken:i,workspaceId:a})=>{let s=await r.getWebhookDelivery(i,a,e,t);if(n.json){console.log(o(s));return}C(s),console.log(`\nEvent ${s.eventId}, occurred ${s.occurredAt}`),console.log(`
|
|
11
|
+
Request body:`),console.log(h(s.requestBody));for(let e of s.attemptHistory)console.log(`\nAttempt ${e.attempt} at ${e.attemptedAt} (X-ED-Delivery-Id ${e.id})`),console.log(` Result: ${v(e)}`),e.responseBody&&console.log(` Response: ${h(e.responseBody)}`)})}async function P(e,t,n){await m(n,async({client:r,accessToken:i,workspaceId:a})=>{let s=await r.resendWebhookDelivery(i,a,e,t);if(n.json){console.log(o(s));return}console.log(`Queued delivery ${t} again (event ${s.delivery.eventId}). Check it with \`entrydesk webhook delivery ${e} ${t}\`.`)})}async function F(e,t){await m(t,async({client:n,accessToken:r,workspaceId:i})=>{let a=await n.sendWebhookTest(r,i,e,t.eventType?{eventType:t.eventType}:{});if(t.json){console.log(o(a));return}let{outcome:s,delivery:c}=a,l=s.httpStatus?`HTTP ${s.httpStatus}`:h(s.error);console.log(`${s.succeeded?`Delivered`:`Failed`}: ${l}${s.responseTimeMs===null?``:` in ${_(s.responseTimeMs)}`} (delivery ${c.id}).`),!s.succeeded&&c.nextAttemptAt&&console.log(`Retrying at ${c.nextAttemptAt}.`)})}async function I(e){await m(e,async({client:t,accessToken:n,workspaceId:r})=>{let i=await t.listWebhookEventTypes(n,r);if(e.json){console.log(o(i));return}for(let e of i.items.filter(e=>e.subscribable))console.log(`${e.type} (since ${e.addedIn})`),console.log(` ${e.description}`)})}export{D as createWebhook,A as deleteWebhook,M as listWebhookDeliveries,I as listWebhookEventTypes,T as listWebhooks,P as resendWebhookDelivery,j as rotateWebhookSecret,F as sendWebhookTest,k as setWebhookEnabled,E as showWebhook,N as showWebhookDelivery,O as updateWebhook};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,p as t}from"./profile-storage-CKrZ-xsd.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import{t as r}from"./resource-grants-Bb4evqsH.js";import{r as i}from"./format-CIj0qQba.js";import{t as a}from"./paginate-Cbe4RaEq.js";import{readFileSync as o}from"node:fs";import{setTimeout as s}from"node:timers/promises";const c=262144,l=new Set([`completed`,`failed`,`cancelled`]);function u(e){let t;try{t=o(e,`utf8`)}catch{console.error(`Cannot read script file: ${e}`),process.exit(1)}return t.trim().length===0&&(console.error(`Script file is empty: ${e}`),process.exit(1)),Buffer.byteLength(t,`utf8`)>c&&(console.error(`Script file exceeds ${c} bytes.`),process.exit(1)),t}function d(e){console.log(`Workflows (${e.length}):\n`);for(let t of e){let e=t.isActive?`active`:`inactive`;if(console.log(` ${t.name} (${e})`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ${t.myRole??`no-role`} · ID: ${t.id}`),console.log(``)}}function f(e,t){console.log(`${e.name}\n`),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: ${i(e.updatedAt)}`);let n=e.scriptSource.split(`
|
|
11
|
+
`).length;t?(console.log(`\n Script (${n} lines):\n`),console.log(e.scriptSource)):console.log(` Script: ${n} lines (use --show-source to print)`)}function p(e){console.log(`Runs (${e.length}):\n`);for(let t of e){let e=i(t.startedAt??t.createdAt);console.log(` ${t.status}${e?` · ${e}`:``}`),console.log(` ID: ${t.id}`)}}function m(e){console.log(`Run ${e.id}`),console.log(` Workflow: ${e.workflowId}`),console.log(` Status: ${e.status}`),e.startedAt&&console.log(` Started: ${i(e.startedAt)}`),e.completedAt&&console.log(` Completed: ${i(e.completedAt)}`),e.error!=null&&console.log(` Error: ${n(e.error)}`);let t=Object.entries(e.context?.nodes??{});if(t.length>0){console.log(`\n Nodes (${t.length}):`);for(let[e,n]of t){let t=[n.kind??`node`,n.status];n.durationMs!=null&&t.push(`${n.durationMs}ms`),console.log(` - ${n.label??e} [${t.join(` · `)}]`)}}let r=e.context?.logs??[];if(r.length>0){console.log(`
|
|
12
|
+
Logs:`);for(let e of r)console.log(` ${e}`)}e.context?.spent!=null&&console.log(`\n Tokens spent: ${e.context.spent}`)}async function h(e,t,n,r,i){for(let a=0;a<600;a++){let o=await e.getWorkflowRun(t,n,r,i);if(l.has(o.status))return a>0&&process.stderr.write(`
|
|
13
|
+
`),o;let c=a*2;process.stderr.write(`\rWaiting… ${o.status} (${c}s)`),await s(2e3)}throw process.stderr.write(`
|
|
14
|
+
`),Error(`Run ${i} did not finish within the wait window.`)}function g(e){let t;if(e.argsFile===void 0)t=e.args;else try{t=o(e.argsFile,`utf8`)}catch{console.error(`Cannot read args file: ${e.argsFile}`),process.exit(1)}if(t!==void 0)try{return JSON.parse(t)}catch{console.error(`--args/--args-file must be valid JSON.`),process.exit(1)}}const _="No workflows in this workspace yet. Create one with `entrydesk workflow create --name <name> --file <path.js>`.";async function v(r){let{accessToken:i,workspaceId:o}=await t(),s=new e;if(r.all){let e=await a(async e=>{let t=await s.getWorkflows(i,o,{limit:r.limit??20,nextKey:e,search:r.search});return{items:t.workflows,nextKey:t.nextKey}});if(r.json){console.log(n({workflows:e}));return}if(e.length===0){console.log(_);return}d(e);return}let{workflows:c,nextKey:l}=await s.getWorkflows(i,o,{limit:r.limit,nextKey:r.nextKey,search:r.search});if(r.json){console.log(n({workflows:c,nextKey:l}));return}if(c.length===0){console.log(_);return}d(c),l&&console.log(`Next page: --next-key ${l}`)}async function y(r,i){let{accessToken:a,workspaceId:o}=await t(),s=await new e().getWorkflow(a,o,r);if(i.json){console.log(n(s));return}f(s,!!i.showSource)}async function b(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().createWorkflow(i,a,{name:r.name,description:r.description,scriptSource:u(r.file)});if(r.json){console.log(n(o));return}console.log(`Created workflow: ${o.name}`),console.log(` ID: ${o.id}`)}async function x(r,i){let a={};i.name!==void 0&&(a.name=i.name),i.description!==void 0&&(a.description=i.description),i.file!==void 0&&(a.scriptSource=u(i.file)),i.activate&&(a.isActive=!0),i.deactivate&&(a.isActive=!1),Object.keys(a).length===0&&(console.error(`No fields provided to update.`),process.exit(1));let{accessToken:o,workspaceId:s}=await t();if(await new e().updateWorkflow(o,s,r,a),i.json){console.log(n({id:r,updated:!0}));return}console.log(`Updated workflow: ${r}`)}async function S(r,i){let a=g(i),{accessToken:o,workspaceId:s}=await t(),c=new e,{runId:l}=await c.triggerWorkflowRun(o,s,r,a);if(!i.wait){if(i.json){console.log(n({runId:l}));return}console.log(`Started run: ${l}`),console.log(` Check: entrydesk workflow run-get ${r} ${l}`);return}let u=await h(c,o,s,r,l);i.json?console.log(n(u)):m(u),u.status!==`completed`&&process.exit(1)}async function C(r,i){let{accessToken:o,workspaceId:s}=await t(),c=new e;if(i.all){let e=await a(async e=>{let t=await c.getWorkflowRuns(o,s,r,{limit:i.limit??20,nextKey:e});return{items:t.runs,nextKey:t.nextKey}});if(i.json){console.log(n({runs:e}));return}if(e.length===0){console.log(`No runs for this workflow.`);return}p(e);return}let{runs:l,nextKey:u}=await c.getWorkflowRuns(o,s,r,{limit:i.limit,nextKey:i.nextKey});if(i.json){console.log(n({runs:l,nextKey:u}));return}if(l.length===0){console.log(`No runs for this workflow.`);return}p(l),u&&console.log(`Next page: --next-key ${u}`)}async function w(r,i,a){let{accessToken:o,workspaceId:s}=await t(),c=await new e().getWorkflowRun(o,s,r,i);if(a.json){console.log(n(c));return}m(c)}async function T(e,t){await r({resource:{collection:`workflows`,id:e},label:`workflow`},t)}export{b as createWorkflow,C as listWorkflowRuns,v as listWorkflows,T as shareWorkflow,y as showWorkflow,w as showWorkflowRun,S as triggerWorkflowRun,x as updateWorkflow};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,E as t,d as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";async function i(i){let a=await t.getAll(),o=await n(),{workspaces:s}=await new e().getWorkspaces(o);if(i.json){console.log(r(s));return}if(s.length===0){console.log(`No workspaces found.`);return}console.log(`Workspaces (${s.length}):\n`);for(let e of s){let t=e.id===a?.workspaceId?` (current)`:``;console.log(` ${e.name}${t}`),console.log(` ID: ${e.id}`),console.log(``)}}async function a(i,a){let o=await n(),{workspaces:s}=await new e().getWorkspaces(o),c=s.find(e=>e.id===i);if(!c){console.error(`Workspace not found: ${i}`),console.error(`
|
|
11
|
+
Available workspaces:`);for(let e of s)console.error(` ${e.name}: ${e.id}`);process.exit(1)}if(await t.saveWorkspaceId(i),a.json){console.log(r({workspaceId:i,workspaceName:c.name}));return}console.log(`Switched to workspace: ${c.name}`),console.log(` ID: ${i}`)}export{i as listWorkspaces,a as switchWorkspace};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entrydesk/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-beta.1",
|
|
4
4
|
"description": "EntryDesk CLI - Interact with EntryDesk from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ai-sdk/react": "^4.0.
|
|
14
|
+
"@ai-sdk/react": "^4.0.126",
|
|
15
15
|
"@commander-js/extra-typings": "^15.0.0",
|
|
16
16
|
"@modelcontextprotocol/client": "^2.0.0",
|
|
17
17
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
18
18
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
19
19
|
"@vscode/ripgrep": "1.18.0",
|
|
20
20
|
"adm-zip": "^0.6.1",
|
|
21
|
-
"ai": "^7.0.
|
|
21
|
+
"ai": "^7.0.123",
|
|
22
22
|
"archiver": "^7.0.1",
|
|
23
23
|
"commander": "^15.0.0",
|
|
24
24
|
"cross-spawn": "^7.0.6",
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
"jose": "^6.2.3",
|
|
29
29
|
"ky": "^2.0.2",
|
|
30
30
|
"react": "^19.3.0",
|
|
31
|
-
"undici": "^7.29.
|
|
31
|
+
"undici": "^7.29.1",
|
|
32
32
|
"uuid": "^14.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@entrydesk/client-tools": "^0.0.0",
|
|
36
36
|
"@entrydesk/shared": "^0.0.0",
|
|
37
37
|
"@gntc/ci": "^0.0.0",
|
|
38
|
+
"@gntc/tsconfig": "^0.0.0",
|
|
38
39
|
"@gntc/utils": "^0.0.0",
|
|
39
40
|
"@gntc/vitest": "^0.0.0",
|
|
40
41
|
"@rolldown/plugin-babel": "^0.2.3",
|
|
@@ -45,13 +46,13 @@
|
|
|
45
46
|
"@types/node": "^24.12.4",
|
|
46
47
|
"@types/react": "^19.3.0",
|
|
47
48
|
"@vitejs/plugin-react": "^6.0.3",
|
|
48
|
-
"@vitest/coverage-v8": "^5.0.
|
|
49
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
49
50
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
50
51
|
"happy-dom": "^20.8.9",
|
|
51
|
-
"oxlint": "^1.
|
|
52
|
+
"oxlint": "^1.87.0",
|
|
52
53
|
"tsdown": "^0.22.14",
|
|
53
54
|
"typescript": "^7.0.2",
|
|
54
|
-
"vitest": "^5.0.
|
|
55
|
+
"vitest": "^5.0.3"
|
|
55
56
|
},
|
|
56
57
|
"optionalDependencies": {
|
|
57
58
|
"keytar": "^7.9.0"
|
package/dist/add-D4yZrlJH.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{M as e}from"./profile-storage-CuiJZpFD.js";import{a as t,d as n,f as r,g as i,i as a,r as o}from"./paths-CZAS8cbS.js";import{t as s}from"./hash-CnSb1n2t.js";import{r as c}from"./installer-CKB3jBE-.js";import{t as l}from"./remote-D3JMUBbh.js";import u from"node:fs";import d from"node:os";import f from"node:path";import p from"cross-spawn";function m(e,t){let n=f.dirname(e);u.mkdirSync(n,{recursive:!0});let r=u.mkdtempSync(f.join(n,`.${f.basename(e)}.tmp-`)),i=f.join(r,`next`),a=f.join(r,`prev`);u.mkdirSync(i,{recursive:!0});let o=!1;try{t(i),u.existsSync(e)&&(u.renameSync(e,a),o=!0),u.renameSync(i,e)}catch(t){throw o&&!u.existsSync(e)&&u.renameSync(a,e),t}finally{u.rmSync(r,{recursive:!0,force:!0})}}const h=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,g=/^([\w.-]+)\/([\w.-]+)(?:\/(.+))?$/u;function _(e){return e===`~`?d.homedir():e.startsWith(`~/`)||e.startsWith(`~\\`)?f.join(d.homedir(),e.slice(2)):e}function v(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||e.startsWith(`~`)||e.startsWith(`.\\`)||/^[a-zA-Z]:[\\/]/u.test(e)}function y(e){let t=/^https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/tree\/([^/]+)(?:\/(.+))?)?\/?$/u.exec(e);return t?{type:`github`,owner:t[1],repo:t[2],gitRef:t[3],subpath:t[4],url:`https://github.com/${t[1]}/${t[2]}`}:null}function b(e){let t=e.trim();if(v(t))return{type:`local`,path:f.resolve(_(t))};if(t.startsWith(`ed:`)){let e=t.slice(3);return{type:`entrydesk`,ref:e,isId:h.test(e)}}if(h.test(t))return{type:`entrydesk`,ref:t,isId:!0};if(t.startsWith(`git@`)||t.endsWith(`.git`))return{type:`git`,url:t};let n=y(t);if(n)return n;if(/^https?:\/\//u.test(t))return{type:`git`,url:t};let r=g.exec(t);return r?{type:`github`,owner:r[1],repo:r[2],subpath:r[3],url:`https://github.com/${r[1]}/${r[2]}`}:{type:`entrydesk`,ref:t,isId:!1}}function x(e){return e.type===`github`?`github`:e.type}const S=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`.entrydesk`]);function C(e,t){if(!u.existsSync(f.join(e,`SKILL.md`)))throw Error(`No SKILL.md found at ${e}`);let n=u.realpathSync(e);if(n===(u.existsSync(t)?u.realpathSync(t):f.resolve(t)))return;let r=u.mkdtempSync(f.join(d.tmpdir(),`ed-local-skill-`)),i=f.join(r,`skill`);try{u.cpSync(n,i,{recursive:!0,filter:e=>!S.has(f.basename(e))}),m(t,e=>{u.cpSync(i,e,{recursive:!0})})}finally{u.rmSync(r,{recursive:!0,force:!0})}}function w(e){try{let t=u.readFileSync(f.join(e,`SKILL.md`),`utf8`),n=/^name:\s*(.+?)\s*$/mu.exec(t.split(/^---\s*$/mu)[1]??``);if(n?.[1])return n[1].replace(/^['"]|['"]$/gu,``)}catch{}return f.basename(e)}async function T(e,t){let{default:n}=await import(`adm-zip`),r=new n(e);m(t,e=>{let t=f.resolve(e)+f.sep;for(let n of r.getEntries()){if(n.isDirectory)continue;let r=f.resolve(e,n.entryName);if(!r.startsWith(t))throw Error(`Zip entry contains path traversal: ${n.entryName}`);u.mkdirSync(f.dirname(r),{recursive:!0}),u.writeFileSync(r,n.getData())}})}async function E(e,t){if(t.isId)return t.ref;let n=(await l(e.client,e.accessToken,e.workspaceId)).find(e=>e.name===t.ref||e.id===t.ref);if(!n)throw Error(`Skill not found in workspace: ${t.ref}`);return n.id}function D(e,t,n){let r=u.mkdtempSync(f.join(d.tmpdir(),`ed-npx-skills-`)),i=[`-y`,`skills@1.5.12`,`add`,e,`--copy`,`--yes`];try{let e=p.sync(`npx`,i,{cwd:r,stdio:n?[`ignore`,`pipe`,`pipe`]:`inherit`});if(e.error)throw e.error;if(e.status!==0){let t=e.stderr?.toString().trim();throw Error(`npx exited with code ${e.status??`null`}${t?`: ${t}`:``}`)}}catch(t){throw u.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills failed for ${e}. Ensure npx + network are available. (${t instanceof Error?t.message:String(t)})`,{cause:t})}let a=f.join(r,`.agents`,`skills`);if(!u.existsSync(a))throw u.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills produced no skills under ${a}`);let o=u.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory());if(o.length===0)throw u.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed no skill directory`);let s=o[0];if(o.length>1){let e=t.type===`github`&&t.subpath?f.basename(t.subpath):void 0,n=e?o.find(t=>t.name===e):void 0;if(!n)throw u.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed [${o.map(e=>e.name).join(`, `)}]; ${e?`none matched the subpath "${e}"`:`specify a subpath to pick one`}.`);s=n}return{dir:f.join(a,s.name),tmpRoot:r}}async function O(l,d,f){let p=b(l),m=!!d.global,h=await a(m,f.workspaceId),g=h.rootDir,_={...f,workspaceId:h.workspaceId};if(!h.linked){let i={workspaceId:f.workspaceId,apiUrl:await e()};t(),m?n(i):r(process.cwd(),i)}let v,y,S;if(p.type===`entrydesk`){y=await E(_,p);let e=await _.client.downloadSkillCurrent(_.accessToken,_.workspaceId,y);v=e.name,S=o(g,v);let t=await fetch(e.url);if(!t.ok)throw Error(`Failed to download ${v}: ${t.status}`);await T(Buffer.from(await t.arrayBuffer()),S)}else if(p.type===`local`)v=w(p.path),S=o(g,v),C(p.path,S);else{let{dir:e,tmpRoot:t}=D(l,p,!!d.json);try{v=w(e),S=o(g,v),C(e,S)}finally{u.rmSync(t,{recursive:!0,force:!0})}}let O=s(S),k={source:l,sourceType:x(p),skillId:y,localHash:O,lastPulledHash:p.type===`entrydesk`?O:``,mode:`symlink`,...p.type===`github`?{sourceUrl:p.url,ref:p.gitRef,subpath:p.subpath}:{},...p.type===`git`?{sourceUrl:p.url}:{}};i(g,v,k);let A=c(S,v,g,`symlink`,d.agent);d.json?console.info(JSON.stringify({name:v,sourceType:x(p),hash:O},null,2)):console.info(`✓ added ${v} (${p.type}, ${O.slice(0,12)}) → agents: ${A.map(e=>e.agentId).join(`, `)}`)}export{O as runSkillsAdd};
|
package/dist/agents-3dOJzTmM.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{Mt as e,Ot as t,b as n,dt as r,jt as i,u as a}from"./profile-storage-CuiJZpFD.js";import{t as o}from"./resource-grants-CtIINiDN.js";function s(n){return n?e([...new Set(n)]):t}function c(e){console.log(`Available agents (${e.length}):\n`);for(let t of e){if(console.log(` ${t.name} (${t.visibility})`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ID: ${t.id}`),console.log(``)}}function l(e){console.log(`My agents (${e.length}):\n`);for(let t of e){let e=[];t.latestVersionNumber!=null&&e.push(`v${t.latestVersionNumber}`),t.hasUnpublishedChanges&&e.push(`unpublished changes`);let n=e.length>0?` (${e.join(` · `)})`:``;if(console.log(` ${t.name}${n}`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ${t.myRole??`no-role`} · ID: ${t.id}`),console.log(``)}}function u(e){if(console.log(`${e.name}\n`),console.log(` ID: ${e.id}`),e.visibility&&console.log(` Visibility: ${e.visibility}`),e.model&&console.log(` Model: ${e.model.name}`),e.author&&console.log(` Author: ${e.author.name}${e.author.isMe?` (you)`:``}`),e.description&&console.log(` Description: ${e.description}`),e.capabilities){let t=i(e.capabilities).map(e=>r(e));t.length>0&&console.log(` Capabilities: ${t.join(`, `)}`)}e.connectors&&e.connectors.length>0&&console.log(` Connectors: ${e.connectors.map(e=>e.name).join(`, `)}`),e.tools&&e.tools.length>0&&console.log(` Tools: ${e.tools.length}`),e.conversationStarters&&e.conversationStarters.length>0&&console.log(` Starters: ${e.conversationStarters.length}`),e.systemPrompt&&console.log(`\n System prompt:\n${e.systemPrompt}`)}async function d(e){let{accessToken:t,workspaceId:r}=await a(),i=new n;if(e.mine){let n=[],a=e.all?void 0:e.nextKey;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getMyAgents(t,r,{limit:e.limit,nextKey:a});if(n.push(...s.agents),a=s.nextKey,!e.all||!a)break}if(e.json){console.log(JSON.stringify({agents:n,nextKey:a}));return}if(n.length===0){console.log("You own no agents in this workspace. Create one with `entrydesk agents create --name <name> …`, or browse `entrydesk marketplace`.");return}l(n),!e.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(e.all){let n=[],a;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getAgents(t,r,{limit:e.limit??100,nextKey:a});if(n.push(...s.agents),a=s.nextKey,!a)break}if(e.json){console.log(JSON.stringify({agents:n}));return}if(n.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}c(n);return}let{agents:o,nextKey:s}=await i.getAgents(t,r,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({agents:o,nextKey:s}));return}if(o.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}c(o),s&&console.log(`Next page: --next-key ${s}`)}async function f(e,t){let{accessToken:r,workspaceId:i}=await a(),o=await new n().getAgent(r,i,e);if(t.json){console.log(JSON.stringify(o));return}u(o)}async function p(e){let{accessToken:t,workspaceId:r}=await a(),i=await new n().createAgent(t,r,{name:e.name,description:e.description,systemPrompt:e.systemPrompt,modelId:e.modelId,connectorIds:e.connectorIds??[],capabilities:s(e.capabilities),conversationStarters:e.conversationStarters??[],tools:e.tools,iconId:e.iconId});if(e.json){console.log(JSON.stringify(i));return}console.log(`Created agent: ${i.name}`),console.log(` ID: ${i.id}`)}async function m(e,t){let{accessToken:r,workspaceId:i}=await a(),o=new n,c=await o.getAgent(r,i,e),l={name:t.name??c.name,description:t.description??c.description,systemPrompt:t.systemPrompt??c.systemPrompt??``,modelId:t.modelId??c.model?.id??``,connectorIds:t.connectorIds??c.connectors?.map(e=>e.id)??[],capabilities:t.capabilities?s(t.capabilities):c.capabilities??{},conversationStarters:t.conversationStarters??c.conversationStarters??[],tools:t.tools??c.tools??[],iconId:t.iconId??c.iconId};await o.updateAgent(r,i,e,l),console.log(`Updated agent: ${e}`)}async function h(e){let{accessToken:t,workspaceId:r}=await a();await new n().deleteAgent(t,r,e),console.log(`Deleted agent: ${e}`)}async function g(e,t){let{accessToken:r,workspaceId:i}=await a();if(await new n().publishAgent(r,i,e),t.json){console.log(JSON.stringify({id:e,published:!0}));return}console.log(`Published agent to the workspace: ${e}`)}async function _(e,t){let{accessToken:r,workspaceId:i}=await a(),s=new n;if(t.addUser){let n=await s.upsertAgentGrant(r,i,e,t.addUser,t.role);if(t.json){console.log(JSON.stringify(n));return}console.log(`Granted ${t.role} to user ${t.addUser}`);return}if(t.removeUser){if(await s.removeAgentGrant(r,i,e,t.removeUser),t.json){console.log(JSON.stringify({userId:t.removeUser,removed:!0}));return}console.log(`Revoked access for user ${t.removeUser}`);return}let c=await s.getAgentGrants(r,i,e);if(t.json){console.log(JSON.stringify(c));return}o(c)}export{p as createAgent,h as deleteAgent,d as listAgents,g as publishAgent,_ as shareAgent,f as showAgent,m as updateAgent};
|
package/dist/billing-Cyk-IzGv.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{b as e,u as t,v as n}from"./profile-storage-CuiJZpFD.js";import{r}from"./format-DCvznP70.js";import{t as i}from"./paginate-C9ixtica.js";function a(e){if(console.log(`Billing status: ${e.lifecycle.kind}`),e.subscription){let t=e.subscription,n=t.nextInvoiceDueAt?` · next invoice ${new Date(t.nextInvoiceDueAt).toLocaleDateString()}`:``;console.log(` Plan: ${t.planName} · ~${r(t.estimatedMonthlyChargeUsd)}/month${n}`)}else console.log(` Plan: (no active subscription)`);let t=e.seats;console.log(` Seats: pro ${t.assigned.pro}/${t.purchased.pro}, premium ${t.assigned.premium}/${t.purchased.premium} (assigned/purchased)`);let n=e.extraUsage;console.log(` Balance: ${r(n.balanceUsd)} extra usage`),console.log(` Spent: ${r(n.currentSpentUsd)} this period`),n.monthlyExtraUsageLimitUsd!=null&&console.log(` Limit: ${r(n.monthlyExtraUsageLimitUsd)} / month`)}function o(e){console.log(`Invoices (${e.length}):\n`);for(let t of e){let e=new Date(t.billingDate).toLocaleDateString();console.log(` ${e} · ${t.type} · ${t.status} · ${r(t.totalUsd)}`),t.hostedInvoiceUrl&&console.log(` ${t.hostedInvoiceUrl}`),console.log(` ID: ${t.id}`),console.log(``)}}async function s(){return n()&&(console.error("Billing requires an interactive login. A workspace PAT (ENTRYDESK_TOKEN) cannot read billing — run `entrydesk login`."),process.exit(1)),t()}async function c(t){let{accessToken:n,workspaceId:r}=await s(),i=await new e().getBillingOverview(n,r);if(t.json){console.log(JSON.stringify(i));return}a(i)}async function l(t){let{accessToken:n,workspaceId:r}=await s(),a=new e;if(t.all){let e=await i(async e=>{let i=await a.getBillingInvoices(n,r,{limit:t.limit??20,nextKey:e});return{items:i.invoices,nextKey:i.nextKey}});if(t.json){console.log(JSON.stringify({invoices:e}));return}if(e.length===0){console.log(`No invoices.`);return}o(e);return}let{invoices:c,nextKey:l}=await a.getBillingInvoices(n,r,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(JSON.stringify({invoices:c,nextKey:l}));return}if(c.length===0){console.log(`No invoices.`);return}o(c),l&&console.log(`Next page: --next-key ${l}`)}export{l as listInvoices,c as showBillingStatus};
|
package/dist/budget-znTQ0rkG.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{b as e,u as t}from"./profile-storage-CuiJZpFD.js";async function n(n){let{accessToken:r,workspaceId:i}=await t(),a=await new e().getBudget(r,i);if(n.json){console.log(JSON.stringify(a));return}if(a.budget===null){console.log(`No budget set for this workspace.`);return}console.log(`Current workspace budget: $${a.budget}`)}async function r(n,r){let{accessToken:i,workspaceId:a}=await t(),o=new e;if(await o.updateBudget(i,a,n),r.json){console.log(JSON.stringify(await o.getBudget(i,a)));return}console.log(`Budget updated: $${n}`)}async function i(n){let{accessToken:r,workspaceId:i}=await t(),a=new e;if(await a.updateBudget(r,i,null),n.json){console.log(JSON.stringify(await a.getBudget(r,i)));return}console.log(`Budget cleared.`)}export{i as clearBudget,r as setBudget,n as showBudget};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{M as e}from"./profile-storage-CuiJZpFD.js";import{a as t,c as n,d as r,f as i,g as a,i as o,l as s,m as c,o as l,r as u,s as d,u as f}from"./paths-CZAS8cbS.js";import{t as p}from"./hash-CnSb1n2t.js";import{r as m}from"./installer-CKB3jBE-.js";import h from"node:path";import g from"node:fs/promises";const _=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;async function v(a,o,s){let c=a&&_.test(a)?a:s.workspaceId,l={workspaceId:c,apiUrl:await e()};if(t(),o.global)r(l),console.info(`Linked ${d()} → workspace ${c}`);else{let e=process.cwd();i(e,l),console.info(`Linked ${n(e)} → workspace ${c}`)}}function y(e){if(e.global){s()?console.info(`Unlinked ${d()}`):console.info(`No global link found.`);return}let t=l(process.cwd());t&&f(t)?console.info(`Unlinked ${n(t)}`):console.info(`No project link found.`)}async function b(e,t,n,r,i){let o=n.skillId;if(!o){let{skills:t}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),r=t.find(e=>e.name===n.name);if(!r)throw Error(`Skill not found in workspace: ${n.name}`);o=r.id}let{url:s,name:c}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,o),l=await fetch(s);if(!l.ok)throw Error(`Failed to download ${c}: ${l.status}`);let d=Buffer.from(await l.arrayBuffer()),f=u(t,c);await g.rm(f,{recursive:!0,force:!0}),await g.mkdir(f,{recursive:!0});let{default:_}=await import(`adm-zip`),v=h.resolve(f)+h.sep;for(let e of new _(d).getEntries()){if(e.isDirectory)continue;let t=h.resolve(f,e.entryName);if(!t.startsWith(v))throw Error(`Zip entry contains path traversal: ${e.entryName}`);await g.mkdir(h.dirname(t),{recursive:!0}),await g.writeFile(t,e.getData())}let y=p(f);a(t,c,{source:o,sourceType:`entrydesk`,skillId:o,localHash:y,lastPulledHash:y,mode:`symlink`});let b=m(f,c,t,`symlink`,i);return r||console.info(`✓ pulled ${c} (${y.slice(0,12)}) → agents: ${b.map(e=>e.agentId).join(`, `)}`),{name:c,hash:y}}async function x(e,t,n){let{rootDir:r,workspaceId:i}=await o(!!t.global,n.workspaceId),a={...n,workspaceId:i},s=!!t.json,l=[];if(e)l.push(_.test(e)?{skillId:e}:{name:e});else{let e=c(r).skills;for(let[t,n]of Object.entries(e))l.push({skillId:n.skillId,name:t});if(l.length===0){console.info(`Nothing to pull — no tracked skills. Try: entrydesk skills pull <name>`);return}}let u=[];for(let e of l)u.push(await b(a,r,e,s,t.agent));s&&console.info(JSON.stringify(u,null,2))}export{x as n,y as r,v as t};
|
package/dist/config-D-9dIy19.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{F as e,P as t,t as n}from"./profile-storage-CuiJZpFD.js";function r(e){try{let{pathname:t}=new URL(e);return t.replace(/\/+$/u,``).endsWith(`/api`)}catch{return!1}}function i(r){let i=e.getAll();if(r.json){console.log(JSON.stringify(i));return}let a=Object.entries(i);if(console.log(`Profile: ${n.getEffectiveProfileName()}`),a.length===0){console.log(`No configuration set.`),console.log(`Available keys: ${t.join(`, `)}`);return}console.log(`Configuration:
|
|
11
|
-
`);for(let[e,t]of a)console.log(` ${e}=${t}`);console.log(`\nAvailable keys: ${t.join(`, `)}`)}function a(t,n){let r=e.get(t);n.json?console.log(JSON.stringify({[t]:r??null})):console.log(r||`Not set`)}function o(t,i){e.set(t,i),console.log(`Set ${t}=${i}`),console.error(`(profile: ${n.getEffectiveProfileName()})`),t===`apiUrl`&&r(i)&&console.error(`Warning: ${i} looks like a web app's "/api" browser proxy path. Such proxies usually strip the Authorization header, so CLI requests will fail with 401 missing_token — prefer the API server's own URL unless you know this proxy forwards Authorization.`)}function s(t){e.unset(t),console.log(`Unset ${t}`),console.error(`(profile: ${n.getEffectiveProfileName()})`)}export{a as getConfigValue,i as listConfig,o as setConfigValue,s as unsetConfigValue};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{Dt as e,K as t,W as n,X as r,Z as i,b as a,u as o}from"./profile-storage-CuiJZpFD.js";import{t as s}from"./confirm-Ct432t3K.js";function c(e,t){return t?r(t)?`Next: entrydesk connectors connect ${e} --oauth`:t===`credentials`?`Next: entrydesk connectors connect ${e} --username <username> --password <password>`:`Next: entrydesk connectors connect ${e} --token <token>`:`This connector needs no authorization — there is no connect step.`}async function l(e){let{accessToken:t,workspaceId:n}=await o(),{connectors:r,nextKey:i}=await new a().getConnectors(t,n,{connectionStatus:e.all?`all`:`connected`,search:e.search,limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({connectors:r,nextKey:i}));return}if(r.length===0){console.log(e.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let s=e.all?`Connectors`:`Connected connectors`;console.log(`${s} (${r.length}):\n`);for(let e of r){let t=e.connected?`connected`:`not connected`;console.log(` ${e.name} (${t})`),console.log(` Provider: ${e.provider}`),console.log(` ID: ${e.id}`),e.authorization?.type&&console.log(` Auth: ${e.authorization.type}`),console.log(``)}i&&console.log(`More results: --next-key ${i}`)}async function u(e,t){let{accessToken:n,workspaceId:r}=await o(),{tools:i}=await new a().getConnectorTools(n,r,e);if(t.json){console.log(JSON.stringify({tools:i}));return}if(i.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${i.length}):\n`);for(let e of i)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function d(e,t){let{accessToken:n,workspaceId:r}=await o();await new a().syncConnectorTools(n,r,e),console.log(t.json?JSON.stringify({id:e,synced:!0}):`Synced tools for connector ${e}.`)}async function f(e,t){let{accessToken:n,workspaceId:r}=await o(),i=new a;if(t.oauth){let{url:a}=await i.getConnectorAuthUrl(n,r,e);if(t.json){console.log(JSON.stringify({url:a}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${a}`),console.log(`
|
|
11
|
-
After you approve, the connection is saved automatically — re-run`),console.log("`entrydesk connectors` to confirm it shows as connected.");return}let s;t.token?s={token:t.token}:t.username&&t.password?s={username:t.username,password:t.password}:(console.error(`Provide --token, or --username and --password, or --oauth to connect.`),process.exit(1)),await i.connectConnectorToken(n,r,e,s),console.log(t.json?JSON.stringify({id:e,connected:!0}):`Connected connector ${e}.`)}function p(e){let t=e.auth===`oauth`||e.auth===`google-iap`;if(t&&(!e.provider||!e.scope?.length)&&(console.error(`--auth ${e.auth} needs --provider and at least one --scope.`),process.exit(1)),!t&&(e.provider||e.scope?.length)&&(console.error(e.auth?`--provider and --scope apply only to --auth oauth and --auth google-iap, not --auth ${e.auth}.`:`--provider and --scope need --auth oauth or --auth google-iap.`),process.exit(1)),e.auth!==void 0)return e.auth===!1?null:{type:e.auth,...e.provider?{provider:e.provider}:{},...e.scope?.length?{scopes:e.scope}:{}}}async function m(r){let s=p(r),l=r.toolNamespace??r.toolPrefix,u=l??i(r.name),d=t(u);if(d){let e=n[d];console.error(l?`--tool-namespace ${e}.`:`The tool namespace derived from --name ("${u}") ${e}. Pass --tool-namespace explicitly.`),process.exit(1)}let{accessToken:f,workspaceId:m}=await o(),h=await new a().createCustomConnector(f,m,{type:e.CUSTOM_REMOTE_URL,name:r.name,description:r.description,transport:r.transport,url:r.url,toolNamespace:u,...s?{authorization:s}:{}});if(r.json){console.log(JSON.stringify(h));return}console.log(`Created connector ${h.name}.`),console.log(` ID: ${h.id}`),console.log(` URL: ${h.url}`),console.log(` Tool namespace: ${h.toolNamespace}`),console.log(`\n${c(h.id,r.auth)}`)}function h(e,t){return t===void 0?e:t===null||t.type!==e?.type?t:{...e,...t}}async function g(t,n){[n.name,n.url,n.description,n.transport,n.toolNamespace,n.auth,n.provider,n.scope].every(e=>e===void 0)&&(console.error(`Nothing to update. Pass at least one of --name, --url, --description, --transport, --tool-namespace, --auth or --no-auth.`),process.exit(1));let r=p(n),{accessToken:i,workspaceId:s}=await o(),c=new a,l=await c.getCustomConnector(i,s,t),u=await c.updateCustomConnector(i,s,t,{type:e.CUSTOM_REMOTE_URL,name:n.name??l.name,description:n.description??l.description,transport:n.transport??l.transport,url:n.url??l.url,toolNamespace:n.toolNamespace??l.toolNamespace,authorization:h(l.authorization,r)});if(n.json){console.log(JSON.stringify(u));return}console.log(`Updated connector ${u.name}.`),console.log(` ID: ${u.id}`),console.log(` URL: ${u.url}`),console.log(` Tool namespace: ${u.toolNamespace}`)}async function _(e,t){let{accessToken:n,workspaceId:r}=await o();if(!t.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${e} needs confirmation. Re-run with --yes.`),process.exit(1)),!await s(`Disconnect connector ${e}?`))){console.log(`Aborted.`);return}await new a().disconnectConnector(n,r,e),console.log(t.json?JSON.stringify({id:e,disconnected:!0}):`Disconnected connector ${e}.`)}export{f as connectConnector,m as createConnector,_ as disconnectConnector,u as listConnectorTools,l as listConnectors,d as syncConnectorTools,g as updateConnector};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:path";import{execFile as i}from"node:child_process";import a from"node:fs/promises";import{promisify as o}from"node:util";const s=o(i);async function c(){let t=r.join(n.tmpdir(),`entrydesk-clipboard-${Date.now()}.png`);try{let e=`
|
|
11
|
-
set imageData to the clipboard as "PNGf"
|
|
12
|
-
set fileRef to open for access POSIX file "${t}" with write permission
|
|
13
|
-
set eof fileRef to 0
|
|
14
|
-
write imageData to fileRef
|
|
15
|
-
close access fileRef
|
|
16
|
-
`;return await s(`osascript`,[`-e`,e]),(await a.stat(t)).size===0?void 0:{buffer:await a.readFile(t),mime:`image/png`}}catch{return}finally{try{e.existsSync(t)&&await a.unlink(t)}catch{}}}async function l(){try{let{stdout:e}=await s(`powershell.exe`,[`-command`,`
|
|
17
|
-
Add-Type -AssemblyName System.Windows.Forms
|
|
18
|
-
$img = [System.Windows.Forms.Clipboard]::GetImage()
|
|
19
|
-
if ($img) {
|
|
20
|
-
$ms = New-Object System.IO.MemoryStream
|
|
21
|
-
$img.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
22
|
-
[System.Convert]::ToBase64String($ms.ToArray())
|
|
23
|
-
}
|
|
24
|
-
`]),t=e.trim();if(!t)return;let n=Buffer.from(t,`base64`);return n.length===0?void 0:{buffer:n,mime:`image/png`}}catch{return}}async function u(){try{let{stdout:e}=await s(`wl-paste`,[`-t`,`image/png`],{encoding:`buffer`,maxBuffer:50*1024*1024});if(e&&e.length>0)return{buffer:e,mime:`image/png`}}catch{}try{let{stdout:e}=await s(`xclip`,[`-selection`,`clipboard`,`-t`,`image/png`,`-o`],{encoding:`buffer`,maxBuffer:50*1024*1024});if(e&&e.length>0)return{buffer:e,mime:`image/png`}}catch{}}async function d(){let e=n.platform();if(e===`darwin`)return c();if(e===`win32`)return l();if(e===`linux`)return u()}const f=new Set(`.png,.jpg,.jpeg,.gif,.webp,.bmp,.ico,.heic,.heif,.pdf,.txt,.md,.rtf,.csv,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.key,.pages,.numbers,.odt,.ods,.odp,.json,.xml,.yaml,.yml`.split(`,`));function p(e){let t=r.extname(e).toLowerCase();return f.has(t)}function m(e){return{".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".bmp":`image/bmp`,".ico":`image/x-icon`,".heic":`image/heic`,".heif":`image/heif`,".txt":`text/plain`,".md":`text/markdown`,".pdf":`application/pdf`,".csv":`text/csv`,".rtf":`application/rtf`,".doc":`application/msword`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xls":`application/vnd.ms-excel`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".ppt":`application/vnd.ms-powerpoint`,".pptx":`application/vnd.openxmlformats-officedocument.presentationml.presentation`,".key":`application/vnd.apple.keynote`,".pages":`application/vnd.apple.pages`,".numbers":`application/vnd.apple.numbers`,".odt":`application/vnd.oasis.opendocument.text`,".ods":`application/vnd.oasis.opendocument.spreadsheet`,".odp":`application/vnd.oasis.opendocument.presentation`,".json":`application/json`,".xml":`application/xml`,".yaml":`text/yaml`,".yml":`text/yaml`}[r.extname(e).toLowerCase()]||`application/octet-stream`}function h(e){let t=e.trim();return t.startsWith(`file://`)&&(t=decodeURIComponent(t.slice(7))),(t.startsWith(`'`)&&t.endsWith(`'`)||t.startsWith(`"`)&&t.endsWith(`"`))&&(t=t.slice(1,-1)),t=t.replace(/\\(.)/g,`$1`),t}async function g(e){let t=h(e);if(/^https?:\/\//.test(t))return!1;try{return await a.access(t),!0}catch{return!1}}var _=class extends Error{problem;filePath;constructor(e,t){super(`${e}: ${t}`),this.problem=e,this.filePath=t,this.name=`LocalFileError`}};function v(e){return e instanceof Error&&`code`in e}function y(e){if(v(e)){if(e.code===`ENOENT`||e.code===`ENOTDIR`)return`missing`;if(e.code===`EISDIR`)return`not_a_file`}return`unreadable`}async function b(e){try{if(!(await t.stat(e)).isFile())throw new _(`not_a_file`,e);return{buffer:await t.readFile(e),filename:r.basename(e),mimeType:m(e)}}catch(t){throw t instanceof _?t:new _(y(t),e)}}export{h as a,g as i,b as n,d as o,p as r,_ as t};
|
package/dist/format-DCvznP70.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
function e(e){return`$${e.toFixed(2)}`}function t(e){if(e==null)return`—`;let t=Math.round(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${r}:${o}`}function n(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function r(e,t){return`${e} ${t}${e===1?``:`s`}`}export{r as i,n,e as r,t};
|
package/dist/login-Ch3S9nh6.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{A as e,O as t,S as n,_ as r,b as i,h as a,m as o,y as s}from"./profile-storage-CuiJZpFD.js";async function c(c){let l=r();if(l){c.json?console.log(JSON.stringify({alreadyAuthenticated:!0,authSource:`sandbox-env`,workspaceId:l.workspaceId})):(console.log(`Already authenticated via ${a}.`),console.log(`No login required — environment credentials are active.`));return}s()&&console.error(`Warning: ENTRYDESK_TOKEN is set — workspace commands will keep using it instead of the credentials saved by this login. Unset ENTRYDESK_TOKEN if you want this login to take effect.`),process.env.DEBUG&&(console.log(`[DEBUG] Hub URL: ${e()}`),console.log(`[DEBUG] API URL: ${t()}`));let u=await o({onDeviceCodeReceived:(e,t)=>{c.json||(console.log(``),console.log(`To finish logging in:`),console.log(``),console.log(` 1. Visit: ${t}`),console.log(` 2. Enter code: ${e}`),console.log(``))},onBrowserOpening:()=>{c.json||console.log(`Opening browser…`)},onWaitingForAuthorization:()=>{c.json||console.log(`Waiting for authorization…`)},onAuthorized:()=>{c.json||console.log(`Authorization successful.`)},onWarning:e=>{console.error(`Warning: ${e}`)}}),{workspaces:d}=await new i().getWorkspaces(u.accessToken),f=d[0];await n.saveAll({accessToken:u.accessToken,refreshToken:u.refreshToken,email:u.email,workspaceId:f?.id}),c.json?console.log(JSON.stringify({email:u.email,workspaceId:f?.id,workspaceName:f?.name,server:t()})):(console.log(`Logged in as ${u.email}`),f&&console.log(`Workspace: ${f.name}`),console.log(`Server: ${t()}`))}export{c as runLogin};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{F as e,b as t,u as n}from"./profile-storage-CuiJZpFD.js";import{isHTTPError as r}from"ky";function i(e){return r(e)&&e.response.status===404}var a=class extends Error{slug;constructor(e){super(`"${e}" matches both an agent and a skill`),this.slug=e,this.name=`AmbiguousResourceError`}},o=class extends Error{slug;constructor(e){super(`Marketplace resource not found: ${e}`),this.slug=e,this.name=`ResourceNotFoundError`}};async function s(e){try{return await e}catch(e){if(i(e))return null;throw e}}async function c(e,t,n){if(n===`agent`)return{type:n,view:await e.getMarketplaceAgent(t)};if(n===`skill`)return{type:n,view:await e.getMarketplaceSkill(t)};let[r,i]=await Promise.all([s(e.getMarketplaceAgent(t)),s(e.getMarketplaceSkill(t))]);if(r&&i)throw new a(t);if(r)return{type:`agent`,view:r};if(i)return{type:`skill`,view:i};throw new o(t)}async function l(e,t){try{return await t()}catch(t){throw t instanceof a&&(console.error(`"${t.slug}" matches both an agent and a skill. Re-run with --type agent|skill.`),process.exit(1)),(t instanceof o||i(t))&&(console.error(`Marketplace resource not found: ${e}`),process.exit(1)),t}}async function u(e,n){let r=await new t().searchMarketplace({type:n.type,tag:e??n.tag,limit:n.limit,cursor:n.cursor});if(n.json){console.log(JSON.stringify(r));return}if(r.items.length===0){console.log(`No marketplace resources found.`);return}console.log(`Marketplace (${r.items.length}):\n`);for(let e of r.items)console.log(` ${e.name} [${e.type}]`),console.log(` Slug: ${e.slug}`),e.description&&console.log(` ${e.description}`),e.tags.length>0&&console.log(` Tags: ${e.tags.map(e=>e.label).join(`, `)}`),console.log(``);r.nextCursor&&console.log(`More results: --cursor ${r.nextCursor}`)}async function d(e,n){let{type:r,view:i}=await l(e,()=>c(new t,e,n.type));if(n.json){console.log(JSON.stringify(i));return}if(console.log(`${i.name} [${r}]`),console.log(`Slug: ${i.slug}`),i.description&&console.log(`\n${i.description}`),i.tags.length>0&&console.log(`\nTags: ${i.tags.map(e=>e.label).join(`, `)}`),r===`agent`){if(i.starterPrompts.length>0){console.log(`
|
|
11
|
-
Starter prompts:`);for(let e of i.starterPrompts)console.log(` - ${e}`)}if(i.connectors.length>0){console.log(`
|
|
12
|
-
Connectors:`);for(let e of i.connectors)console.log(` - ${e.name} (${e.provider})`)}}console.log(`\nInstall with: entrydesk marketplace install ${i.slug} --type ${r}`)}async function f(r,i){let a=new t,{accessToken:o,workspaceId:s}=await n(),{type:u}=i.type?{type:i.type}:await l(r,()=>c(a,r)),d=await l(r,()=>a.installMarketplaceResource(o,s,u,r,e.getToolApprovalMode()??void 0));if(i.json){console.log(JSON.stringify(d));return}console.log(`Installed ${u} "${r}" into the workspace.`),console.log(` ${u} ID: ${d.resourceId}`),d.taskId&&(console.log(` Setup task: ${d.taskId}`),console.log(` Continue setup: entrydesk tasks ${d.taskId}`))}async function p(e){let{items:n}=await new t().listMarketplaceRoles();if(e.json){console.log(JSON.stringify(n));return}if(n.length===0){console.log(`No marketplace roles found.`);return}console.log(`Marketplace roles (${n.length}):\n`);for(let e of n)console.log(` ${e.tag} ${e.name}`),e.tagline&&console.log(` ${e.tagline}`)}export{f as installMarketplaceResource,u as searchMarketplace,d as showMarketplaceResource,p as showMarketplaceRoles};
|
package/dist/meeting-BdLr54zK.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{B as e,b as t,u as n}from"./profile-storage-CuiJZpFD.js";import{n as r}from"./format-DCvznP70.js";import{t as i}from"./paginate-C9ixtica.js";function a(e){return!e||e<=0?``:`${Math.round(e/60)}m`}function o(e){console.log(`Meetings (${e.length}):\n`);for(let t of e){let e=[`(${t.status??`unknown`})`],n=r(t.startTime??t.sortTime);n&&e.push(n),t.hasRecordings&&e.push(`🎙️`),e.push(t.isOwner?`owner`:t.myRole),console.log(` ${t.title}`),console.log(` ${e.join(` · `)}`),t.processingStatus&&console.log(` processing: ${t.processingStatus}`),console.log(` ID: ${t.id}`),console.log(``)}}function s(e){if(console.log(`${e.title}\n`),console.log(` ID: ${e.id}`),console.log(` Status: ${e.status}`),console.log(` Visibility: ${e.visibility}`),console.log(` Source: ${e.source}`),e.myRole&&console.log(` My role: ${e.isOwner?`owner`:e.myRole}`),e.startTime&&console.log(` Start: ${r(e.startTime)}`),e.endTime&&console.log(` End: ${r(e.endTime)}`),e.location&&console.log(` Location: ${e.location}`),e.conferenceLink&&console.log(` Conference: ${e.conferenceLink}`),e.participants&&e.participants.length>0){console.log(` Participants (${e.participants.length}):`);for(let t of e.participants){let e=t.displayName??t.email;console.log(` - ${e}${t.role?` (${t.role})`:``}`)}}e.summary&&console.log(`\n Summary:\n${e.summary}`);let t=e.recordings??[];if(console.log(`\n Recordings (${t.length}):`),t.length===0){console.log(` (none)`);return}for(let e of t){let t=[];e.processingStatus&&t.push(e.processingStatus);let n=a(e.duration);n&&t.push(n),e.hasTranscript&&t.push(`transcript✓`),e.hasSummary&&t.push(`summary✓`),console.log(` - ${e.title}`),t.length>0&&console.log(` ${t.join(` · `)}`),console.log(` ID: ${e.id}`)}}function c(e){if(console.log(`Visibility: ${e.visibility}\n`),console.log(`User grants (${e.userGrants.length}):`),e.userGrants.length===0)console.log(` (none)`);else for(let t of e.userGrants)console.log(` - ${t.userName} <${t.userEmail}> · ${t.role}`),console.log(` ID: ${t.userId}`);if(console.log(`\nTeam grants (${e.teamGrants.length}):`),e.teamGrants.length===0)console.log(` (none)`);else for(let t of e.teamGrants)console.log(` - ${t.teamName} (${t.memberCount} members) · ${t.role}`),console.log(` ID: ${t.teamId}`)}async function l(e){let{accessToken:r,workspaceId:a}=await n(),s=new t,c={search:e.search,filter:e.filter,sortBy:e.sort};if(e.all){let t=await i(async t=>{let n=await s.getMeetings(r,a,{limit:e.limit??20,nextKey:t,...c});return{items:n.meetings,nextKey:n.nextKey}});if(e.json){console.log(JSON.stringify({meetings:t}));return}if(t.length===0){console.log(`No meetings found in this workspace.`);return}o(t);return}let{meetings:l,nextKey:u}=await s.getMeetings(r,a,{limit:e.limit,nextKey:e.nextKey,...c});if(e.json){console.log(JSON.stringify({meetings:l,nextKey:u}));return}if(l.length===0){console.log(`No meetings found in this workspace.`);return}o(l),u&&console.log(`Next page: --next-key ${u}`)}async function u(e,r){let{accessToken:i,workspaceId:a}=await n(),o=await new t().getMeeting(i,a,e);if(r.json){console.log(JSON.stringify(o));return}s(o)}async function d(e){let{accessToken:r,workspaceId:i}=await n(),a={title:e.title};e.description!==void 0&&(a.description=e.description),e.location!==void 0&&(a.location=e.location),e.start!==void 0&&(a.startTime=e.start),e.end!==void 0&&(a.endTime=e.end),e.conferenceLink!==void 0&&(a.conferenceLink=e.conferenceLink),e.notes!==void 0&&(a.notes=e.notes);let o=await new t().createMeeting(r,i,a);if(e.json){console.log(JSON.stringify(o));return}console.log(`Created meeting: ${o.title}`),console.log(` ID: ${o.id}`)}async function f(e,r){let i={};r.title!==void 0&&(i.title=r.title),r.description!==void 0&&(i.description=r.description),r.location!==void 0&&(i.location=r.location),r.start!==void 0&&(i.startTime=r.start),r.end!==void 0&&(i.endTime=r.end),r.conferenceLink!==void 0&&(i.conferenceLink=r.conferenceLink),r.notes!==void 0&&(i.notes=r.notes),r.status!==void 0&&(i.status=r.status),r.visibility!==void 0&&(i.visibility=r.visibility),Object.keys(i).length===0&&(console.error(`No fields provided to update.`),process.exit(1));let{accessToken:a,workspaceId:o}=await n(),s=await new t().updateMeeting(a,o,e,i);if(r.json){console.log(JSON.stringify(s));return}console.log(`Updated meeting: ${e}`)}async function p(e,r){let{accessToken:i,workspaceId:a}=await n();if(await new t().deleteMeeting(i,a,e),r.json){console.log(JSON.stringify({id:e,deleted:!0}));return}console.log(`Deleted meeting: ${e}`)}async function m(r,i){let{accessToken:a,workspaceId:o}=await n(),s=e(await new t().getMeeting(a,o,r));if(i.json){console.log(JSON.stringify({summary:s??null}));return}s||(console.error(`This meeting has no summary yet.`),process.exit(1)),console.log(s)}async function h(e,r){let{accessToken:i,workspaceId:a}=await n(),o=await new t().getRecording(i,a,e),s=r.raw?o.transcriptWithTimestamps:o.transcript;if(r.json){console.log(JSON.stringify({transcript:s,processingStatus:o.processingStatus}));return}s||(console.error(o.processingStatus&&o.processingStatus!==`completed`?`Transcript not ready (processing status: ${o.processingStatus}).`:`This recording has no transcript.`),process.exit(1)),console.log(s)}async function g(e,i){let{accessToken:a,workspaceId:o}=await n(),{previous:s}=await new t().getMeetingPreviousBrief(a,o,e);if(i.json){console.log(JSON.stringify({previous:s}));return}if(!s){console.log(`No previous meeting found in this series.`);return}if(console.log(`Previous: ${s.title}`),s.startTime&&console.log(` ${r(s.startTime)}`),s.summary&&console.log(`\nSummary:\n${s.summary}`),s.actionItems.length>0){console.log(`
|
|
11
|
-
Action items:`);for(let e of s.actionItems){let t=e.completed?`[x]`:`[ ]`,n=e.assignee?` (@${e.assignee})`:``;console.log(` ${t} ${e.description}${n}`)}}}async function _(e,r){let{accessToken:i,workspaceId:a}=await n(),o=new t;if(r.addUser){let t=await o.upsertMeetingUserGrant(i,a,e,r.addUser,r.role);if(r.json){console.log(JSON.stringify(t));return}console.log(`Granted ${r.role} to user ${r.addUser}`);return}if(r.removeUser){if(await o.removeMeetingUserGrant(i,a,e,r.removeUser),r.json){console.log(JSON.stringify({userId:r.removeUser,removed:!0}));return}console.log(`Revoked access for user ${r.removeUser}`);return}if(r.addTeam){let t=await o.upsertMeetingTeamGrant(i,a,e,r.addTeam,r.role);if(r.json){console.log(JSON.stringify(t));return}console.log(`Granted ${r.role} to team ${r.addTeam}`);return}if(r.removeTeam){if(await o.removeMeetingTeamGrant(i,a,e,r.removeTeam),r.json){console.log(JSON.stringify({teamId:r.removeTeam,removed:!0}));return}console.log(`Revoked access for team ${r.removeTeam}`);return}if(r.visibility){let t=await o.updateMeeting(i,a,e,{visibility:r.visibility});if(r.json){console.log(JSON.stringify({visibility:t.visibility}));return}console.log(`Set visibility to ${t.visibility}`);return}let s=await o.getMeetingShares(i,a,e);if(r.json){console.log(JSON.stringify(s));return}c(s)}export{d as createMeeting,p as deleteMeeting,l as listMeetings,_ as shareMeeting,u as showMeeting,m as showMeetingSummary,h as showMeetingTranscript,g as showPreviousMeeting,f as updateMeeting};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{Bt as e,Ht as t}from"./profile-storage-CuiJZpFD.js";import{t as n}from"./isRecord-BNZWvqVS.js";function r(e,t){return e.replace(/\u001B\][^\u001B\u0007]*(?:\u0007|\u001B\\)/gu,``).replace(/\u001B\[[0-?]*[ -/]*[@-~]/gu,``).replace(t,``)}function i(e){return r(e,/[\u0000-\u001F\u007F-\u009F]/gu)}function a(e){return r(e,/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/gu)}const o=`\x1B[2m`,s=`\x1B[0m`,c=`\x1B[36m`,l=`\x1B[32m`,u=`\x1B[38;2;59;91;204m`,d=`\x1B[38;2;126;200;248m`,f=`\x1B[38;2;244;196;78m`,p={preauthorized:`Auto-approved · preauthorized for this task`,low_risk:`Auto-approved · assessed low risk`};function m(e){if(!n(e))return;let r=t({approved:e.approved===!0,isAutomatic:e.isAutomatic===!0,reason:typeof e.reason==`string`?e.reason:void 0});return r?p[r.kind]:void 0}function h(t){if(t.state===`output-denied`||t.state===`approval-responded`&&t.approval?.approved===!1)return t.approval?.reason||e.BY_USER}function g(e,t){if(!e)return`(no result)`;if(typeof e!=`object`){let n=String(e);return t||n.length<=200?n:n.slice(0,200)+`…`}let n=e;if(`structuredContent`in n&&n.structuredContent){let e=n.structuredContent;if(e.stdout&&typeof e.stdout==`string`){let n=e.stdout.trim();return t||n.length<=200?n:n.slice(0,200)+`…`}}if(`content`in n&&Array.isArray(n.content)){let e=n.content.filter(e=>e.type===`text`&&e.text).map(e=>e.text).join(`
|
|
11
|
-
`);return e?t||e.length<=200?e:e.slice(0,200)+`…`:`(result)`}if(n.type===`text`&&typeof n.content==`string`){let e=n.content;return t||e.length<=200?e:e.slice(0,200)+`…`}let r=JSON.stringify(e,null,t?2:void 0);return t||r.length<=200?r:r.slice(0,200)+`…`}function _(e,t){return a(g(e,t))}function v(e,t=!1){let n=[];for(let r of e)if(r.type===`text`&&r.text)n.push(a(r.text));else if(r.type===`reasoning`&&r.text)t?n.push(`${o}[Thinking]\n${a(r.text)}${s}`):n.push(`${o}[Thinking…]${s}`);else if(r.type===`tool-call`&&r.toolName){let e=[`${c}┌─ Tool: ${i(r.toolName)}${s}`];if(r.args){let n=JSON.stringify(r.args,null,t?2:void 0),a=t||n.length<=100?n:n.slice(0,100)+`…`;e.push(`${o}│ Input: ${i(a)}${s}`)}r.result===void 0?e.push(`${c}└─${s}`):(e.push(`${l}│ Output: ${_(r.result,t)}${s}`),e.push(`${c}└─ completed${s}`)),n.push(e.join(`
|
|
12
|
-
`))}else if(r.type.startsWith(`tool-`)&&r.type!==`tool-call`){let e=[`${c}┌─ Tool: ${i(r.title||r.type.slice(5).replaceAll(`__`,` `))}${s}`];if(r.input){let n=JSON.stringify(r.input,null,t?2:void 0),a=t||n.length<=100?n:n.slice(0,100)+`…`;e.push(`${o}│ Input: ${i(a)}${s}`)}let a=h(r);if(r.output!==void 0&&r.state===`output-available`){e.push(`${l}│ Output: ${_(r.output,t)}${s}`);let n=m(r.approval);n&&e.push(`${o}│ ${n}${s}`),e.push(`${c}└─ completed${s}`)}else a===void 0?r.state===`error`?e.push(`${c}└─ failed${s}`):e.push(`${c}└─${s}`):(e.push(`${o}│ ${i(a)}${s}`),e.push(`${c}└─ rejected${s}`));n.push(e.join(`
|
|
13
|
-
`))}return n.join(`
|
|
14
|
-
|
|
15
|
-
`).trim()}export{o as a,f as c,u as i,i as l,m as n,d as o,c as r,s,v as t,a as u};
|