@entrydesk/cli 2.2.0-beta.1 → 2.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +74 -5
  2. package/dist/{add-BJv6tPO-.js → add-QRCNes33.js} +1 -1
  3. package/dist/{agents-fP3hIH7X.js → agents-C6_4nYx3.js} +1 -1
  4. package/dist/billing-B52QpxBo.js +10 -0
  5. package/dist/{budget-MVbF8WbS.js → budget-CCZUSzQX.js} +1 -1
  6. package/dist/{build-task-request-config-BzI-dDZP.js → build-task-request-config-D1BoTQ_r.js} +1 -1
  7. package/dist/{commands-CfDSEDKI.js → commands-DT40svYr.js} +1 -1
  8. package/dist/{commands-DU48SG8W.js → commands-OQF1wQ6Z.js} +1 -1
  9. package/dist/{config-Cl-c7scx.js → config-DRasb4uc.js} +2 -2
  10. package/dist/{connectors-DVzXDbUU.js → connectors-CGdm_hGV.js} +2 -2
  11. package/dist/{file-upload-Dq6B0x4m.js → file-upload-DuXlHqyj.js} +1 -1
  12. package/dist/{format-CIj0qQba.js → format-C0MI0rzh.js} +1 -1
  13. package/dist/index.js +43 -23
  14. package/dist/{instruction-6ZWRQh4G.js → instruction-OdStaJMu.js} +1 -1
  15. package/dist/{login-CO1aBG6c.js → login-BJK-C-yF.js} +1 -1
  16. package/dist/{logout-WKIZVWJ7.js → logout-b335WkA6.js} +1 -1
  17. package/dist/{marketplace-C0C2JpYf.js → marketplace-B5HXnl23.js} +2 -2
  18. package/dist/{mcp-client-CEH9X7Vs.js → mcp-client-mMhJPPZN.js} +1 -1
  19. package/dist/{mcp-CqMrd5AI.js → mcp-hLbWIery.js} +1 -1
  20. package/dist/{meeting-C5vHfcTw.js → meeting-2Z2c7Ppj.js} +1 -1
  21. package/dist/{message-utils-D48Yqd9T.js → message-utils-BHtHL44l.js} +7 -7
  22. package/dist/{models-BENTHton.js → models-Cd725_l2.js} +1 -1
  23. package/dist/{notifications-DdadH0Wc.js → notifications-D1-iA_h8.js} +1 -1
  24. package/dist/{paginate-Cbe4RaEq.js → paginate-y3CJuqRW.js} +1 -1
  25. package/dist/{paths-BiowKnkz.js → paths-CIj_zxDF.js} +1 -1
  26. package/dist/profile-B1Jui2gr.js +10 -0
  27. package/dist/profile-storage-BPBUFvA6.js +74 -0
  28. package/dist/{project-xiz3Jopl.js → project-DwR8Pf3y.js} +1 -1
  29. package/dist/project-context-CiI3hHaT.js +10 -0
  30. package/dist/{project-governance-R__UPIhr.js → project-governance-OVpv9LXv.js} +1 -1
  31. package/dist/{project-sources-C-MXx6j-.js → project-sources-CtSvnInR.js} +1 -1
  32. package/dist/{project-sources-write-ygvHaDUu.js → project-sources-write-BaWV2jtH.js} +1 -1
  33. package/dist/{project-tasks-B0STK_8Q.js → project-tasks-BKdZe3qu.js} +1 -1
  34. package/dist/push-CMRb7H6f.js +10 -0
  35. package/dist/{recordings-68Oe1Kvd.js → recordings-Bz6wVqBM.js} +1 -1
  36. package/dist/{remove-C7BCBdoq.js → remove-B7p4PV6f.js} +1 -1
  37. package/dist/resolve-DdZsf3QT.js +14 -0
  38. package/dist/resource-grants-HDU2bPhQ.js +10 -0
  39. package/dist/{schedules-wopieg4D.js → schedules-DrzGEvSR.js} +2 -2
  40. package/dist/{skills-Drr0gw-l.js → skills-CdcBhRxn.js} +1 -1
  41. package/dist/{status-Bw2E5bfa.js → status-p4tJRN-I.js} +1 -1
  42. package/dist/status-wTfceoHq.js +10 -0
  43. package/dist/task-CyuwUFin.js +116 -0
  44. package/dist/tasks-B0x5P4UU.js +22 -0
  45. package/dist/{tasks-lK8PTMnE.js → tasks-BpqBNtta.js} +1 -1
  46. package/dist/{team-8-enl9cj.js → team-R67MPRfp.js} +1 -1
  47. package/dist/{teams-ByeuT2Ks.js → teams-DvACXgpt.js} +1 -1
  48. package/dist/{token-DrAF7BWj.js → token-Diy_e8pF.js} +1 -1
  49. package/dist/{tool-82NKBr29.js → tool-CFaX5Q8e.js} +7 -7
  50. package/dist/{update-DfOBWme1.js → update-CvHLQuTu.js} +1 -1
  51. package/dist/{usage-BS_didkP.js → usage-Bv04bmPn.js} +1 -1
  52. package/dist/{usage-audit-DOuyWGaq.js → usage-audit-D65sU87J.js} +3 -3
  53. package/dist/{version-D7DOD1ug.js → version-BFfQldMJ.js} +1 -1
  54. package/dist/{webhook-Da2l-gv6.js → webhook-h1JuRyJf.js} +1 -1
  55. package/dist/{workflow-oudE3gsp.js → workflow-CrOwbORs.js} +1 -1
  56. package/dist/{workspaces-9SRfDSh3.js → workspaces-CJP3Q8wV.js} +1 -1
  57. package/package.json +8 -8
  58. package/dist/billing-Cy0BYngu.js +0 -10
  59. package/dist/profile-hhU_G-Ea.js +0 -10
  60. package/dist/profile-storage-CKrZ-xsd.js +0 -73
  61. package/dist/project-context-DeYepfN2.js +0 -10
  62. package/dist/push-BxQQWCZ2.js +0 -10
  63. package/dist/resolve-IOW00hfy.js +0 -14
  64. package/dist/resource-grants-Bb4evqsH.js +0 -10
  65. package/dist/status-DX6A6ugk.js +0 -10
  66. package/dist/task-bZNZ_yxV.js +0 -116
  67. package/dist/tasks-ZC9uSdkB.js +0 -22
@@ -1,22 +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{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(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#39;/g,`'`).replace(/&amp;/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`?` [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};