@entrydesk/cli 2.0.0-beta.1 → 2.1.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.
Files changed (78) hide show
  1. package/README.md +279 -0
  2. package/dist/add-Lh_kLR85.js +2 -0
  3. package/dist/agents-CLcXSbBp.js +2 -0
  4. package/dist/billing-DHrYi0SU.js +2 -0
  5. package/dist/{budget-5BgMv02k.js → budget-D_DDPBBb.js} +1 -1
  6. package/dist/build-task-request-config-Y9X2h9Ia.js +2 -0
  7. package/dist/commands-3Yqb38G_.js +2 -0
  8. package/dist/commands-CdnyYMrx.js +2 -0
  9. package/dist/{config-B9tUjrKe.js → config-hGzOCx4u.js} +2 -2
  10. package/dist/connectors-CxzG22No.js +3 -0
  11. package/dist/file-upload-BmP4AJY0.js +16 -0
  12. package/dist/format-C3tQC6LL.js +2 -0
  13. package/dist/index.js +83 -10
  14. package/dist/instruction-CRCyBKQf.js +2 -0
  15. package/dist/{login-DDHPKjnl.js → login-CwXjzUnO.js} +1 -1
  16. package/dist/{logout-BfBH5eJn.js → logout-BYCFpaxh.js} +1 -1
  17. package/dist/{marketplace-uKCzG2ZZ.js → marketplace-NSEUjhXf.js} +1 -1
  18. package/dist/{mcp-DINA1zRb.js → mcp-B7wo_sRO.js} +2 -2
  19. package/dist/mcp-client-DMOEcmul.js +2 -0
  20. package/dist/meeting-yS83In45.js +3 -0
  21. package/dist/models-AN9cWKSj.js +3 -0
  22. package/dist/notifications-QF11-X32.js +2 -0
  23. package/dist/options-D6fCp3Q_.js +2 -0
  24. package/dist/paginate-CfIrho1f.js +2 -0
  25. package/dist/paths-C9BPsZVF.js +2 -0
  26. package/dist/{profile-BvYUZvxC.js → profile-WtKtO0yp.js} +1 -1
  27. package/dist/profile-storage-Dv0xRb8J.js +58 -0
  28. package/dist/project-BhPYRsaZ.js +2 -0
  29. package/dist/project-context-Cc_Js6n4.js +2 -0
  30. package/dist/project-governance-C7rl6gDW.js +2 -0
  31. package/dist/project-sources-CzylP6oS.js +2 -0
  32. package/dist/project-sources-write-6cBfdUfV.js +2 -0
  33. package/dist/project-tasks-DaGBt4Cp.js +2 -0
  34. package/dist/push-Ce79oiu0.js +2 -0
  35. package/dist/recordings-DoExjM1F.js +3 -0
  36. package/dist/remove-bHAmCTdf.js +2 -0
  37. package/dist/resolve-f238uD6C.js +6 -0
  38. package/dist/schedules-tDaIGaad.js +21 -0
  39. package/dist/{skills-fZI01pai.js → skills-CDd-emMc.js} +1 -1
  40. package/dist/status-CDMSNVD8.js +2 -0
  41. package/dist/{status-DmJ-xYvm.js → status-gK3MA1oe.js} +1 -1
  42. package/dist/stdin-DzzLUF6W.js +2 -0
  43. package/dist/task-CHnFR-Zp.js +103 -0
  44. package/dist/tasks-D4RIFT8Y.js +14 -0
  45. package/dist/tasks-acCatE6n.js +2 -0
  46. package/dist/{tool-Cok2kze5.js → tool-BEivzspP.js} +1 -1
  47. package/dist/update-CJlVgq8V.js +2 -0
  48. package/dist/usage-DOI9sowA.js +3 -0
  49. package/dist/usage-audit-1GZx4VBG.js +4 -0
  50. package/dist/version-C37EX5li.js +2 -0
  51. package/dist/workflow-DhomAltH.js +6 -0
  52. package/dist/{workspaces-DE3ileKk.js → workspaces-D0VOrP2A.js} +1 -1
  53. package/package.json +8 -4
  54. package/dist/add-B1NhONLo.js +0 -2
  55. package/dist/agents-CmqbjcOy.js +0 -2
  56. package/dist/billing-1jI7tuUm.js +0 -2
  57. package/dist/build-task-request-config-BvfeDz3u.js +0 -2
  58. package/dist/commands-B0bUDitb.js +0 -2
  59. package/dist/commands-DCchuLQ9.js +0 -2
  60. package/dist/connectors-Du0gwdNw.js +0 -3
  61. package/dist/custom-connector-D5nYtPdy.js +0 -2
  62. package/dist/mcp-client-CmjAqUI6.js +0 -2
  63. package/dist/meeting-DyRLAlio.js +0 -3
  64. package/dist/models-MjAV8n3p.js +0 -2
  65. package/dist/notifications-ChqOyq50.js +0 -2
  66. package/dist/paths-B_0RLzm4.js +0 -2
  67. package/dist/profile-storage-CsigYr0Q.js +0 -72
  68. package/dist/push-Dv7v6CZ8.js +0 -2
  69. package/dist/recordings-k6uAy1-Z.js +0 -3
  70. package/dist/remove-C846BKtl.js +0 -2
  71. package/dist/schedules-gNv67oB_.js +0 -21
  72. package/dist/status-gxTm4vOE.js +0 -2
  73. package/dist/task-Cu8s2pLl.js +0 -115
  74. package/dist/tasks-iSFyXmqr.js +0 -14
  75. package/dist/update-DvJ7nqZt.js +0 -2
  76. package/dist/usage-BwizU9L8.js +0 -3
  77. package/dist/version-Db_lMuAl.js +0 -2
  78. package/dist/workflow-BZblFLYG.js +0 -6
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{n as e}from"./tasks-D4RIFT8Y.js";export{e as runTasks};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,o as t}from"./profile-storage-CsigYr0Q.js";import{n,r}from"./mcp-client-CmjAqUI6.js";import i from"node:fs";import a from"node:os";import o from"node:path";import s from"node:fs/promises";const c=!process.env.NO_COLOR&&process.stdout.isTTY,l={green:c?`\x1B[32m`:``,yellow:c?`\x1B[33m`:``,reset:c?`\x1B[0m`:``},u=8*1024;function d(){return o.join(a.homedir(),`.entrydesk`,`tool-results`)}function f(e){let t=e.trim().replace(/[/\\:*?"<>|\s]/g,`_`).replace(/_+/g,`_`).replace(/^[._]+|[._]+$/g,``).slice(0,100);return!t||t===`.`||t===`..`?`unnamed_tool`:t}function p(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 m(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(`-`)}_${f(e)}.json`}async function h(e,t){try{return await s.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 g(e,t){try{let n=d();await s.mkdir(n,{recursive:!0});let r=m(e),i=o.extname(r),a=r.slice(0,-i.length),c=p(t),l=o.join(n,r);if(await h(l,c))return l;for(let e=1;e<=100;e++){let t=o.join(n,`${a}-${e}${i}`);if(await h(t,c))return t}let u=Math.random().toString(36).slice(2,10),f=o.join(n,`${a}-${u}${i}`);return await s.writeFile(f,c,{encoding:`utf8`,flag:`wx`}),f}catch(e){let t=e instanceof Error?e.message:`unknown error`;return console.error(`${l.yellow}Warning: Could not save result to file: ${t}${l.reset}`),null}}function _(e,t){let n=Buffer.byteLength(e,`utf8`);if(n<=10240)return e;let r=e.slice(0,u),i=e.slice(-2048),a=` … (skipped ${((n-u-2048)/1024).toFixed(1)}KB of ${(n/1024).toFixed(1)}KB) …`;return t&&(a+=`
2
+ import{i as e,s as t}from"./profile-storage-Dv0xRb8J.js";import{n,r}from"./mcp-client-DMOEcmul.js";import i from"node:fs";import a from"node:os";import o from"node:path";import s from"node:fs/promises";const c=!process.env.NO_COLOR&&process.stdout.isTTY,l={green:c?`\x1B[32m`:``,yellow:c?`\x1B[33m`:``,reset:c?`\x1B[0m`:``},u=8*1024;function d(){return o.join(a.homedir(),`.entrydesk`,`tool-results`)}function f(e){let t=e.trim().replace(/[/\\:*?"<>|\s]/g,`_`).replace(/_+/g,`_`).replace(/^[._]+|[._]+$/g,``).slice(0,100);return!t||t===`.`||t===`..`?`unnamed_tool`:t}function p(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 m(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(`-`)}_${f(e)}.json`}async function h(e,t){try{return await s.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 g(e,t){try{let n=d();await s.mkdir(n,{recursive:!0});let r=m(e),i=o.extname(r),a=r.slice(0,-i.length),c=p(t),l=o.join(n,r);if(await h(l,c))return l;for(let e=1;e<=100;e++){let t=o.join(n,`${a}-${e}${i}`);if(await h(t,c))return t}let u=Math.random().toString(36).slice(2,10),f=o.join(n,`${a}-${u}${i}`);return await s.writeFile(f,c,{encoding:`utf8`,flag:`wx`}),f}catch(e){let t=e instanceof Error?e.message:`unknown error`;return console.error(`${l.yellow}Warning: Could not save result to file: ${t}${l.reset}`),null}}function _(e,t){let n=Buffer.byteLength(e,`utf8`);if(n<=10240)return e;let r=e.slice(0,u),i=e.slice(-2048),a=` … (skipped ${((n-u-2048)/1024).toFixed(1)}KB of ${(n/1024).toFixed(1)}KB) …`;return t&&(a+=`
3
3
  Tip: jq -r '.structuredContent.field' <file> | grep/head/tail`),`${r}\n\n${a}\n\n${i}`}function v(e){console.log(`${l.green}Tool execution result saved to: ${e}${l.reset}`),console.log()}function y(){console.log(`${l.green}Tool execution result:${l.reset}`)}function b(e){return e.split(`__`)[0]??e}function x(e,t,n){console.error(n?JSON.stringify({error:{code:e,message:t}}):`Error [${e}]: ${t}`),process.exit(1)}function S(n,r,i=`CONNECTION_FAILED`){t(n)&&x(i,e(),r);let a=n instanceof Error?n.message:`Unknown error`;a.includes(`Not logged in`)||a.includes(`not-logged-in`)?x(`AUTH_MISSING`,a,r):x(i,a,r)}async function C(){return process.stdin.isTTY?null:new Promise(e=>{let t=[],n=!1,r=!1,i,a,o,s,c=()=>{clearTimeout(i),process.stdin.removeListener(`data`,a),process.stdin.removeListener(`end`,o),process.stdin.removeListener(`error`,s)},l=t=>{r||(r=!0,c(),e(t))};a=e=>{n=!0,clearTimeout(i),t.push(e)},o=()=>{t.length===0?l(null):l(Buffer.concat(t).toString(`utf-8`).trim())},s=()=>{l(null)},i=setTimeout(()=>{n||l(null)},100),process.stdin.on(`data`,a),process.stdin.on(`end`,o),process.stdin.on(`error`,s),process.stdin.resume()})}var w=class extends Error{constructor(e){super(e),this.name=`InputError`}};async function T(e,t){if(e)return e;if(t)try{return i.readFileSync(t,`utf-8`).trim()}catch(e){throw new w(`Failed to read input file: ${e instanceof Error?e.message:`Failed to read input file`}`)}let n=await C();if(n)return n;throw new w(`Input JSON is required. Use --input, --input-file, or pipe it via stdin.`)}function E(e){let t=[`Tool: ${e.name}`];return e.description&&t.push(` Description: ${e.description}`),t.join(`
4
4
  `)}function D(e){let t=[`Tool: ${e.name}`];return e.description&&(t.push(`Description:`),t.push(` ${e.description}`)),t.push(`Input Schema:`),t.push(JSON.stringify(e.inputSchema,null,2)),t.join(`
5
5
  `)}async function O(e){let t=e.json??!1,i=await n().catch(e=>{S(e,t)});try{let n=(await i.listTools({},r())).tools;if(e.prefix){let t=e.prefix.toLowerCase();n=n.filter(e=>b(e.name).toLowerCase().startsWith(t))}if(t)console.log(JSON.stringify(n,null,2));else{let t=e.prefix?` (prefix: ${e.prefix})`:``;console.log(`Available tools (${n.length})${t}:\n`);for(let e of n)console.log(E(e)),console.log()}}catch(e){S(e,t)}finally{await i.close().catch(()=>{})}}async function k(e,t){let i=t.json??!1,a=await n().catch(e=>{S(e,i)});try{let t=(await a.listTools({},r())).tools.find(t=>t.name===e);t||x(`TOOL_NOT_FOUND`,`Tool not found: ${e}`,i),console.log(i?JSON.stringify(t,null,2):D(t))}catch(e){S(e,i)}finally{await a.close().catch(()=>{})}}async function A(e,t,i){let a;try{a=JSON.parse(t)}catch(e){x(`INVALID_INPUT`,e instanceof Error?`Invalid JSON input: ${e.message}`:`Invalid JSON input`,i)}let o=await n().catch(e=>{S(e,i,`TOOL_CALL_FAILED`)}),s=!1;try{let t=await o.callTool({name:e,arguments:a},r());if(i)console.log(JSON.stringify(t,null,2));else{let n=await g(e,t);n&&v(n),y();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(JSON.stringify(e,null,2));if(t.structuredContent){let e=_(JSON.stringify(t.structuredContent,null,2),n);console.log(e)}}t.isError&&(s=!0)}catch(e){S(e,i,`TOOL_CALL_FAILED`)}finally{await o.close().catch(()=>{})}s&&process.exit(1)}async function j(e,t){let n=t.json??!1,r;try{r=await T(t.input,t.inputFile)}catch(e){throw e instanceof w&&x(`INVALID_INPUT`,e.message,n),e}await A(e,r,n)}export{k as getTool,O as listTools,j as runToolCall};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{r as e}from"./profile-storage-Dv0xRb8J.js";import{t}from"./version-C37EX5li.js";import n from"cross-spawn";const r=`@entrydesk/cli`;function i(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 a(e,t){if(e===t)return 0;if(e===null)return 1;if(t===null)return-1;let n=e.split(`.`),r=t.split(`.`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t!==i){let e=/^\d+$/u.test(t),n=/^\d+$/u.test(i);return e&&n?Number(t)<Number(i)?-1:1:e?-1:n?1:t<i?-1:1}}return n.length===r.length?0:n.length<r.length?-1:1}function o(e,t){let n=i(e),r=i(t);if(!n||!r)return n?1:r?-1:0;for(let e=0;e<3;e++)if(n.nums[e]!==r.nums[e])return n.nums[e]<r.nums[e]?-1:1;return a(n.prerelease,r.prerelease)}function s(e,{inheritOutput:t}){return new Promise((r,i)=>{let a=n(`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=>{r({exitCode:e??1,stdout:o,stderr:s})})})}async function c(){let t;try{t=await s([`view`,r,`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 ${r} version from the npm registry.${t.stderr?`\n${t.stderr.trim()}`:``}`);if(!i(n))throw new e(`Unexpected version from the npm registry: ${JSON.stringify(n)}`);return n}async function l(n){let i=t(),a=await c(),l=o(i,a),u=l>=0;if(n.check||u){n.json?console.log(JSON.stringify({current:i,latest:a,upToDate:u,updated:!1})):console.log(l>0?`entrydesk ${i} is newer than the latest published version (${a}). Nothing to do.`:u?`entrydesk ${i} is already the latest version.`:`Update available: ${i} → ${a}. Run \`entrydesk update\` to install.`);return}n.json||console.log(`Updating entrydesk ${i} → ${a}…`);let d=await s([`install`,`-g`,`${r}@${a}`],{inheritOutput:!n.json});if(d.exitCode!==0){let t=d.stderr?`\n${d.stderr.trim()}`:``;throw new e(`npm install failed (exit code ${d.exitCode}). You can update manually with \`npm install -g ${r}@latest\`.`+t,d.exitCode)}n.json?console.log(JSON.stringify({current:i,latest:a,upToDate:u,updated:!0})):console.log(`entrydesk updated to ${a}.`)}export{l as runUpdate};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{b as e,u as t}from"./profile-storage-Dv0xRb8J.js";import{r as n}from"./format-C3tQC6LL.js";import{writeFileSync as r}from"node:fs";function i(e){console.log(`Extra-usage balance: ${n(e.balanceUsd)}`);let t=e.currentSpentUsedPercent==null?``:` (${e.currentSpentUsedPercent}% of limit)`;console.log(`Spent this period: ${n(e.currentSpentUsd)}${t}`),e.monthlyExtraUsageLimitUsd!=null&&console.log(`Workspace limit: ${n(e.monthlyExtraUsageLimitUsd)} / month`),e.memberMonthlyExtraUsageLimitUsd!=null&&console.log(`Per-member limit: ${n(e.memberMonthlyExtraUsageLimitUsd)} / month`),e.nextExpiry&&console.log(`Next expiry: ${n(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 a(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: ${n(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 o(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: ${n(t.extraUsage)}`),console.log(` User ID: ${t.user.id}`),console.log(``)}async function s(n){let{accessToken:r,workspaceId:a}=await t(),o=await new e().getUsageOverview(r,a);if(n.json){console.log(JSON.stringify(o));return}i(o)}async function c(n){let{accessToken:r,workspaceId:i}=await t(),o=await new e().getUsageMe(r,i);if(n.json){console.log(JSON.stringify(o));return}a(o)}async function l(n){let{accessToken:r,workspaceId:i}=await t(),a=await new e().getUsageConsumptions(r,i,{limit:n.limit,offset:n.offset,periodStart:n.periodStart});if(n.json){console.log(JSON.stringify(a));return}if(a.items.length===0){console.log(`No consumptions for this period.`);return}o(a)}async function u(n){let{accessToken:i,workspaceId:a}=await t(),o=await new e().exportUsageCsv(i,a,n.periodStart);if(n.output){r(n.output,o),console.log(`Wrote usage CSV to ${n.output}`);return}process.stdout.write(o)}async function d(n){let{accessToken:r,workspaceId:i}=await t(),a=new e,o=[],s,c=0;do{let e=await a.getMonthlyUsages(r,i,{nextKey:s,limit:100});if(o.push(...e.monthlyUsages),s=e.nextKey,c++,c>=100){console.error(`Warning: Showing first ${o.length} entries (pagination limit reached)`);break}}while(s);if(n.json){console.log(JSON.stringify(o));return}if(o.length===0){console.log(`No usage data found for this workspace.`);return}console.log(`Current month usage:
3
+ `);let l=0,u=0;for(let e of o)l+=Number.parseFloat(e.totalCost),u+=e.operationCount;console.log(`Total cost: $${l.toFixed(2)}`),console.log(`Total operations: ${u.toLocaleString()}`),console.log(`Users: ${o.length}\n`);let d=[...o].toSorted((e,t)=>n.sortBy===`cost`?Number.parseFloat(t.totalCost)-Number.parseFloat(e.totalCost):t.operationCount-e.operationCount),f=n.limit??d.length,p=d.slice(0,f);console.log(`Usage by user (sorted by ${n.sortBy}, showing ${p.length} of ${o.length}):\n`);for(let e of p)console.log(` ${e.user.name} (${e.user.email})`),console.log(` Cost: $${Number.parseFloat(e.totalCost).toFixed(2)}`),console.log(` Operations: ${e.operationCount.toLocaleString()}`),console.log(``);p.length<o.length&&console.log(`… and ${o.length-p.length} more users`)}export{u as exportUsage,l as listUsageConsumptions,c as showOwnUsage,s as showUsageBalance,d as showUsageSummary};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{T as e,Y as t,r as n}from"./profile-storage-Dv0xRb8J.js";import{r}from"./format-C3tQC6LL.js";import{n as i,r as a}from"./mcp-client-DMOEcmul.js";function o(t){return Array.isArray(t)&&e(t.map(e=>typeof e==`object`&&e&&`text`in e?String(e.text):``).filter(Boolean).join(`
3
+ `))||`usage-audit tool call failed`}async function s(e,t,r){let i=await e.callTool({name:t,arguments:r},a());if(i.isError){let e=o(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 c(e){let t=await i();try{return await e(t)}finally{await t.close().catch(()=>{})}}function l(e){return e.toLocaleString()}function u(e){return e==null?`—`:`${e>0?`+`:``}${e}%`}function d(e){return e?e.slice(0,10):`never`}async function f(e){let n=await c(n=>s(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(JSON.stringify(n,null,2));return}let i=n.windowDays==null?`all time`:`last ${n.windowDays} days`,a=e.model?` · model ~ "${e.model}"`:``;if(console.log(`Cost ranking by ${e.by} · ${i}${a}\n`),n.rows.length===0){console.log(` No spend in this window.`);return}let o=Math.max(...n.rows.map(e=>r(e.cost).length));for(let e of n.rows){let t=e.ownerEmail?` · ${e.ownerEmail}`:``;console.log(` ${r(e.cost).padStart(o)} ${u(e.costChangePct).padEnd(7)} ${l(e.calls).padStart(8)} calls ${e.key}${t}`)}console.log(`\n ${n.rows.length} rows.`)}async function p(e,n){let[i,a]=await c(r=>Promise.all([s(r,t.GET_USER_BREAKDOWN,{email:e,sinceDays:n.days,minCost:n.minCost??0}),s(r,t.GET_USER_DAILY_TREND,{emails:[e],days:n.days})]));if(n.json){console.log(JSON.stringify({breakdown:i,trend:a},null,2));return}if(console.log(`${e} · last ${n.days} days\n`),console.log(`By agent / operation:`),i.breakdown.length===0)console.log(` (no spend)`);else{let e=Math.max(...i.breakdown.map(e=>r(e.cost).length));for(let t of i.breakdown)console.log(` ${r(t.cost).padStart(e)} ${l(t.calls).padStart(8)} calls ${t.agentOrOperation}`)}let o=a.trends[0]?.days??[];if(o.length>0){console.log(`
4
+ Daily:`);for(let e of o)console.log(` ${e.date} ${r(e.cost).padStart(10)} ${l(e.calls).padStart(8)} calls`)}if(i.activeSchedules.length>0){console.log(`\nActive schedules (${i.activeSchedules.length}):`);for(let e of i.activeSchedules){let t=e.agentName?` · ${e.agentName}`:``;console.log(` ${e.name}${t} (${e.scheduleType}, last run ${d(e.lastTaskAt)})`)}}}async function m(e){let{stale:n,toolCalls:i}=await c(async n=>{let r=await s(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=>s(n,t.GET_SCHEDULE_TOOL_CALLS,{scheduleIds:r,sinceDays:e.days,recentRuns:5})))).flatMap(e=>e.schedules)}}});if(e.json){console.log(JSON.stringify({stale:n,toolCalls:i},null,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 a=new Map(i.schedules.map(e=>[e.scheduleId,e.toolCalls]));for(let e of n.schedules){console.log(` ${r(e.cost)} ${l(e.runs)} runs ${e.unreadPct}% unread last read ${d(e.lastReadAt)}`),console.log(` ${e.scheduleName} · ${e.ownerEmail}`);let t=a.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{p as drillUsage,m as findUsageWaste,f as rankUsage};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ function e(){return`2.1.0-beta.1`}export{e as t};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{F as e,b as t,u as n}from"./profile-storage-Dv0xRb8J.js";import{n as r}from"./format-C3tQC6LL.js";import{t as i}from"./paginate-CfIrho1f.js";import{readFileSync as a}from"node:fs";const o=262144,s=new Set([`completed`,`failed`,`cancelled`]);function c(e){let t;try{t=a(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`)>o&&(console.error(`Script file exceeds ${o} bytes.`),process.exit(1)),t}function l(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 u(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: ${r(e.updatedAt)}`);let n=e.scriptSource.split(`
3
+ `).length;t?(console.log(`\n Script (${n} lines):\n`),console.log(e.scriptSource)):console.log(` Script: ${n} lines (use --show-source to print)`)}function d(e){console.log(`Runs (${e.length}):\n`);for(let t of e){let e=r(t.startedAt??t.createdAt);console.log(` ${t.status}${e?` · ${e}`:``}`),console.log(` ID: ${t.id}`)}}function f(e){console.log(`Run ${e.id}`),console.log(` Workflow: ${e.workflowId}`),console.log(` Status: ${e.status}`),e.startedAt&&console.log(` Started: ${r(e.startedAt)}`),e.completedAt&&console.log(` Completed: ${r(e.completedAt)}`),e.error!=null&&console.log(` Error: ${JSON.stringify(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 n=e.context?.logs??[];if(n.length>0){console.log(`
4
+ Logs:`);for(let e of n)console.log(` ${e}`)}e.context?.spent!=null&&console.log(`\n Tokens spent: ${e.context.spent}`)}function p(t){let n=e(t);if(console.log(`User grants (${n.length}):`),n.length===0){console.log(` (none)`);return}for(let e of n)console.log(` - ${e.user.name} <${e.user.email}> · ${e.role}`),console.log(` ID: ${e.userId}`)}async function m(e,t,n,r,i){for(let a=0;a<600;a++){let o=await e.getWorkflowRun(t,n,r,i);if(s.has(o.status))return a>0&&process.stderr.write(`
5
+ `),o;let c=a*2;process.stderr.write(`\rWaiting… ${o.status} (${c}s)`),await new Promise(e=>setTimeout(e,2e3))}throw process.stderr.write(`
6
+ `),Error(`Run ${i} did not finish within the wait window.`)}function h(e){let t;if(e.argsFile===void 0)t=e.args;else try{t=a(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 g="No workflows in this workspace yet. Create one with `entrydesk workflow create --name <name> --file <path.js>`.";async function _(e){let{accessToken:r,workspaceId:a}=await n(),o=new t;if(e.all){let t=await i(async t=>{let n=await o.getWorkflows(r,a,{limit:e.limit??20,nextKey:t,search:e.search});return{items:n.workflows,nextKey:n.nextKey}});if(e.json){console.log(JSON.stringify({workflows:t}));return}if(t.length===0){console.log(g);return}l(t);return}let{workflows:s,nextKey:c}=await o.getWorkflows(r,a,{limit:e.limit,nextKey:e.nextKey,search:e.search});if(e.json){console.log(JSON.stringify({workflows:s,nextKey:c}));return}if(s.length===0){console.log(g);return}l(s),c&&console.log(`Next page: --next-key ${c}`)}async function v(e,r){let{accessToken:i,workspaceId:a}=await n(),o=await new t().getWorkflow(i,a,e);if(r.json){console.log(JSON.stringify(o));return}u(o,!!r.showSource)}async function y(e){let{accessToken:r,workspaceId:i}=await n(),a=await new t().createWorkflow(r,i,{name:e.name,description:e.description,scriptSource:c(e.file)});if(e.json){console.log(JSON.stringify(a));return}console.log(`Created workflow: ${a.name}`),console.log(` ID: ${a.id}`)}async function b(e,r){let i={};r.name!==void 0&&(i.name=r.name),r.description!==void 0&&(i.description=r.description),r.file!==void 0&&(i.scriptSource=c(r.file)),r.activate&&(i.isActive=!0),r.deactivate&&(i.isActive=!1),Object.keys(i).length===0&&(console.error(`No fields provided to update.`),process.exit(1));let{accessToken:a,workspaceId:o}=await n();if(await new t().updateWorkflow(a,o,e,i),r.json){console.log(JSON.stringify({id:e,updated:!0}));return}console.log(`Updated workflow: ${e}`)}async function x(e,r){let i=h(r),{accessToken:a,workspaceId:o}=await n(),s=new t,{runId:c}=await s.triggerWorkflowRun(a,o,e,i);if(!r.wait){if(r.json){console.log(JSON.stringify({runId:c}));return}console.log(`Started run: ${c}`),console.log(` Check: entrydesk workflow run-get ${e} ${c}`);return}let l=await m(s,a,o,e,c);r.json?console.log(JSON.stringify(l)):f(l),l.status!==`completed`&&process.exit(1)}async function S(e,r){let{accessToken:a,workspaceId:o}=await n(),s=new t;if(r.all){let t=await i(async t=>{let n=await s.getWorkflowRuns(a,o,e,{limit:r.limit??20,nextKey:t});return{items:n.runs,nextKey:n.nextKey}});if(r.json){console.log(JSON.stringify({runs:t}));return}if(t.length===0){console.log(`No runs for this workflow.`);return}d(t);return}let{runs:c,nextKey:l}=await s.getWorkflowRuns(a,o,e,{limit:r.limit,nextKey:r.nextKey});if(r.json){console.log(JSON.stringify({runs:c,nextKey:l}));return}if(c.length===0){console.log(`No runs for this workflow.`);return}d(c),l&&console.log(`Next page: --next-key ${l}`)}async function C(e,r,i){let{accessToken:a,workspaceId:o}=await n(),s=await new t().getWorkflowRun(a,o,e,r);if(i.json){console.log(JSON.stringify(s));return}f(s)}async function w(e,r){let{accessToken:i,workspaceId:a}=await n(),o=new t;if(r.addUser){let t=await o.upsertWorkflowGrant(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.removeWorkflowGrant(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}let s=await o.getWorkflowGrants(i,a,e);if(r.json){console.log(JSON.stringify(s));return}p(s)}export{y as createWorkflow,S as listWorkflowRuns,_ as listWorkflows,w as shareWorkflow,v as showWorkflow,C as showWorkflowRun,x as triggerWorkflowRun,b as updateWorkflow};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,b as t,c as n}from"./profile-storage-CsigYr0Q.js";async function r(r){let i=await e.getAll(),a=await n(),{workspaces:o}=await new t().getWorkspaces(a);if(r.json){console.log(JSON.stringify(o));return}if(o.length===0){console.log(`No workspaces found.`);return}console.log(`Workspaces (${o.length}):\n`);for(let e of o){let t=e.id===i?.workspaceId?` (current)`:``;console.log(` ${e.name}${t}`),console.log(` ID: ${e.id}`),console.log(``)}}async function i(r,i){let a=await n(),{workspaces:o}=await new t().getWorkspaces(a),s=o.find(e=>e.id===r);if(!s){console.error(`Workspace not found: ${r}`),console.error(`
2
+ import{C as e,b as t,l as n}from"./profile-storage-Dv0xRb8J.js";async function r(r){let i=await e.getAll(),a=await n(),{workspaces:o}=await new t().getWorkspaces(a);if(r.json){console.log(JSON.stringify(o));return}if(o.length===0){console.log(`No workspaces found.`);return}console.log(`Workspaces (${o.length}):\n`);for(let e of o){let t=e.id===i?.workspaceId?` (current)`:``;console.log(` ${e.name}${t}`),console.log(` ID: ${e.id}`),console.log(``)}}async function i(r,i){let a=await n(),{workspaces:o}=await new t().getWorkspaces(a),s=o.find(e=>e.id===r);if(!s){console.error(`Workspace not found: ${r}`),console.error(`
3
3
  Available workspaces:`);for(let e of o)console.error(` ${e.name}: ${e.id}`);process.exit(1)}if(await e.saveWorkspaceId(r),i.json){console.log(JSON.stringify({workspaceId:r,workspaceName:s.name}));return}console.log(`Switched to workspace: ${s.name}`),console.log(` ID: ${r}`)}export{r as listWorkspaces,i as switchWorkspace};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entrydesk/cli",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.1.0-beta.1",
4
4
  "description": "EntryDesk CLI - Interact with EntryDesk from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,15 +11,17 @@
11
11
  "README.md"
12
12
  ],
13
13
  "dependencies": {
14
- "@ai-sdk/react": "^4.0.71",
14
+ "@ai-sdk/react": "^4.0.94",
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
  "adm-zip": "^0.6.0",
20
- "ai": "^7.0.68",
20
+ "ai": "^7.0.91",
21
21
  "archiver": "^7.0.1",
22
22
  "commander": "^15.0.0",
23
+ "cross-spawn": "^7.0.6",
24
+ "filename-reserved-regex": "^4.0.1",
23
25
  "ink": "^7.1.1",
24
26
  "ink-spinner": "^5.0.0",
25
27
  "jose": "^6.2.3",
@@ -36,13 +38,15 @@
36
38
  "@rolldown/plugin-babel": "^0.2.3",
37
39
  "@testing-library/react": "^16.3.2",
38
40
  "@types/archiver": "^7.0.0",
41
+ "@types/cross-spawn": "^6.0.6",
42
+ "@types/filename-reserved-regex": "^3.0.0",
39
43
  "@types/node": "^24.12.4",
40
44
  "@types/react": "^19.2.17",
41
45
  "@vitejs/plugin-react": "^6.0.3",
42
46
  "@vitest/coverage-v8": "^4.1.6",
43
47
  "babel-plugin-react-compiler": "^1.0.0",
44
48
  "happy-dom": "^20.8.9",
45
- "oxlint": "^1.78.0",
49
+ "oxlint": "^1.81.0",
46
50
  "tsdown": "^0.22.14",
47
51
  "typescript": "^7.0.2",
48
52
  "vitest": "^4.1.8"
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e}from"./profile-storage-CsigYr0Q.js";import{d as t,h as n,i as r,n as i,r as a,u as o}from"./paths-B_0RLzm4.js";import{t as s}from"./hash-Ddmw8YE4.js";import{r as c}from"./installer-iaoPJQn3.js";import{t as l}from"./remote-nEFOyIM2.js";import u from"node:fs";import d from"node:os";import f from"node:path";import{execFileSync as p}from"node:child_process";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{p(`npx`,i,{cwd:r,stdio:n?[`ignore`,`pipe`,`pipe`]:`inherit`})}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=a(m,f.workspaceId),g=h.rootDir,_={...f,workspaceId:h.workspaceId};if(!h.linked){let n={workspaceId:f.workspaceId,apiUrl:e()};r(),m?o(n):t(process.cwd(),n)}let v,y,S;if(p.type===`entrydesk`){y=await E(_,p);let e=await _.client.downloadSkillCurrent(_.accessToken,_.workspaceId,y);v=e.name,S=i(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=i(g,v),C(p.path,S);else{let{dir:e,tmpRoot:t}=D(l,p,!!d.json);try{v=w(e),S=i(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}:{}};n(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};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{Y as e,b as t,ct as n,dt as r,ft as i,j as a,l as o}from"./profile-storage-CsigYr0Q.js";function s(e){return e?i([...new Set(e)]):n}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(t){if(console.log(`${t.name}\n`),console.log(` ID: ${t.id}`),t.visibility&&console.log(` Visibility: ${t.visibility}`),t.model&&console.log(` Model: ${t.model.name}`),t.author&&console.log(` Author: ${t.author.name}${t.author.isMe?` (you)`:``}`),t.description&&console.log(` Description: ${t.description}`),t.capabilities){let n=r(t.capabilities).map(t=>e(t));n.length>0&&console.log(` Capabilities: ${n.join(`, `)}`)}t.connectors&&t.connectors.length>0&&console.log(` Connectors: ${t.connectors.map(e=>e.name).join(`, `)}`),t.tools&&t.tools.length>0&&console.log(` Tools: ${t.tools.length}`),t.conversationStarters&&t.conversationStarters.length>0&&console.log(` Starters: ${t.conversationStarters.length}`),t.systemPrompt&&console.log(`\n System prompt:\n${t.systemPrompt}`)}function d(e){let t=a(e);if(console.log(`User grants (${t.length}):`),t.length===0){console.log(` (none)`);return}for(let e of t)console.log(` - ${e.user.name} <${e.user.email}> · ${e.role}`),console.log(` ID: ${e.userId}`)}async function f(e){let{accessToken:n,workspaceId:r}=await o(),i=new t;if(e.mine){let t=[],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(n,r,{limit:e.limit,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!e.all||!a)break}if(e.json){console.log(JSON.stringify({agents:t,nextKey:a}));return}if(t.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(t),!e.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(e.all){let t=[],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(n,r,{limit:e.limit??100,nextKey:a});if(t.push(...s.agents),a=s.nextKey,!a)break}if(e.json){console.log(JSON.stringify({agents:t}));return}if(t.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}c(t);return}let{agents:a,nextKey:s}=await i.getAgents(n,r,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({agents:a,nextKey:s}));return}if(a.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}c(a),s&&console.log(`Next page: --next-key ${s}`)}async function p(e,n){let{accessToken:r,workspaceId:i}=await o(),a=await new t().getAgent(r,i,e);if(n.json){console.log(JSON.stringify(a));return}u(a)}async function m(e){let{accessToken:n,workspaceId:r}=await o(),i=await new t().createAgent(n,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 h(e,n){let{accessToken:r,workspaceId:i}=await o(),a=new t,c=await a.getAgent(r,i,e),l={name:n.name??c.name,description:n.description??c.description,systemPrompt:n.systemPrompt??c.systemPrompt??``,modelId:n.modelId??c.model?.id??``,connectorIds:n.connectorIds??c.connectors?.map(e=>e.id)??[],capabilities:n.capabilities?s(n.capabilities):c.capabilities??{},conversationStarters:n.conversationStarters??c.conversationStarters??[],tools:n.tools??c.tools??[],iconId:n.iconId??c.iconId};await a.updateAgent(r,i,e,l),console.log(`Updated agent: ${e}`)}async function g(e){let{accessToken:n,workspaceId:r}=await o();await new t().deleteAgent(n,r,e),console.log(`Deleted agent: ${e}`)}async function _(e,n){let{accessToken:r,workspaceId:i}=await o();if(await new t().publishAgent(r,i,e),n.json){console.log(JSON.stringify({id:e,published:!0}));return}console.log(`Published agent to the workspace: ${e}`)}async function v(e,n){let{accessToken:r,workspaceId:i}=await o(),a=new t;if(n.addUser){let t=await a.upsertAgentGrant(r,i,e,n.addUser,n.role);if(n.json){console.log(JSON.stringify(t));return}console.log(`Granted ${n.role} to user ${n.addUser}`);return}if(n.removeUser){if(await a.removeAgentGrant(r,i,e,n.removeUser),n.json){console.log(JSON.stringify({userId:n.removeUser,removed:!0}));return}console.log(`Revoked access for user ${n.removeUser}`);return}let s=await a.getAgentGrants(r,i,e);if(n.json){console.log(JSON.stringify(s));return}d(s)}export{m as createAgent,g as deleteAgent,f as listAgents,_ as publishAgent,v as shareAgent,p as showAgent,h as updateAgent};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as e,l as t,v as n}from"./profile-storage-CsigYr0Q.js";function r(e){return`$${e.toFixed(2)}`}function i(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 a(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 o(){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 s(t){let{accessToken:n,workspaceId:r}=await o(),a=await new e().getBillingOverview(n,r);if(t.json){console.log(JSON.stringify(a));return}i(a)}async function c(t){let{accessToken:n,workspaceId:r}=await o(),i=new e;if(t.all){let e=[],o;for(let a=0;;a++){a>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getBillingInvoices(n,r,{limit:t.limit??20,nextKey:o});if(e.push(...s.invoices),o=s.nextKey,!o)break}if(t.json){console.log(JSON.stringify({invoices:e}));return}if(e.length===0){console.log(`No invoices.`);return}a(e);return}let{invoices:s,nextKey:c}=await i.getBillingInvoices(n,r,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(JSON.stringify({invoices:s,nextKey:c}));return}if(s.length===0){console.log(`No invoices.`);return}a(s),c&&console.log(`Next page: --next-key ${c}`)}export{c as listInvoices,s as showBillingStatus};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{X as e,Z as t}from"./profile-storage-CsigYr0Q.js";function n({allowedTools:n,disallowedTools:r}){if(!(!n?.length&&!r?.length))return[...t(n?.map(t=>({toolName:t,policy:e.ALWAYS_ALLOW})),r?.map(t=>({toolName:t,policy:e.BLOCK})))].map(([e,t])=>({toolName:e,policy:t}))}function r({agentId:e,model:t,connectorIds:n,clientTools:r,clientToolSystemPrompt:i,toolApprovalMode:a,toolPolicies:o}){return{...e?{agentId:e}:{...t?{model:t}:{},...n?.length?{connectorIds:n}:{}},...r?{clientTools:r}:{},...i?{clientToolSystemPrompt:i}:{},...a?{toolApprovalMode:a}:{},...o?.length?{toolPolicies:o}:{}}}export{n,r as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./commands-DCchuLQ9.js";export{e as runSkillsUnlink};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e}from"./profile-storage-CsigYr0Q.js";import{a as t,c as n,d as r,h as i,i as a,l as o,n as s,o as c,p as l,r as u,s as d,u as f}from"./paths-B_0RLzm4.js";import{t as p}from"./hash-Ddmw8YE4.js";import{r as m}from"./installer-iaoPJQn3.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;function v(t,n,i){let o=t&&_.test(t)?t:i.workspaceId,s={workspaceId:o,apiUrl:e()};if(a(),n.global)f(s),console.info(`Linked ${c()} → workspace ${o}`);else{let e=process.cwd();r(e,s),console.info(`Linked ${d(e)} → workspace ${o}`)}}function y(e){if(e.global){n()?console.info(`Unlinked ${c()}`):console.info(`No global link found.`);return}let r=t(process.cwd());r&&o(r)?console.info(`Unlinked ${d(r)}`):console.info(`No project link found.`)}async function b(e,t,n,r,a){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:c,name:l}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,o),u=await fetch(c);if(!u.ok)throw Error(`Failed to download ${l}: ${u.status}`);let d=Buffer.from(await u.arrayBuffer()),f=s(t,l);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);i(t,l,{source:o,sourceType:`entrydesk`,skillId:o,localHash:y,lastPulledHash:y,mode:`symlink`});let b=m(f,l,t,`symlink`,a);return r||console.info(`✓ pulled ${l} (${y.slice(0,12)}) → agents: ${b.map(e=>e.agentId).join(`, `)}`),{name:l,hash:y}}async function x(e,t,n){let{rootDir:r,workspaceId:i}=u(!!t.global,n.workspaceId),a={...n,workspaceId:i},o=!!t.json,s=[];if(e)s.push(_.test(e)?{skillId:e}:{name:e});else{let e=l(r).skills;for(let[t,n]of Object.entries(e))s.push({skillId:n.skillId,name:t});if(s.length===0){console.info(`Nothing to pull — no tracked skills. Try: entrydesk skills pull <name>`);return}}let c=[];for(let e of s)c.push(await b(a,r,e,o,t.agent));o&&console.info(JSON.stringify(c,null,2))}export{x as n,y as r,v as t};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{H as e,U as t,b as n,l as r,st as i}from"./profile-storage-CsigYr0Q.js";import{n as a}from"./custom-connector-D5nYtPdy.js";import{t as o}from"./confirm-BrJZbaxf.js";function s(t,n){return n?e(n)?`Next: entrydesk connectors connect ${t} --oauth`:n===`credentials`?`Next: entrydesk connectors connect ${t} --username <username> --password <password>`:`Next: entrydesk connectors connect ${t} --token <token>`:`This connector needs no authorization — there is no connect step.`}async function c(e){let{accessToken:t,workspaceId:i}=await r(),{connectors:a,nextKey:o}=await new n().getConnectors(t,i,{connectionStatus:e.all?`all`:`connected`,search:e.search,limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({connectors:a,nextKey:o}));return}if(a.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} (${a.length}):\n`);for(let e of a){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(``)}o&&console.log(`More results: --next-key ${o}`)}async function l(e,t){let{accessToken:i,workspaceId:a}=await r(),{tools:o}=await new n().getConnectorTools(i,a,e);if(t.json){console.log(JSON.stringify({tools:o}));return}if(o.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${o.length}):\n`);for(let e of o)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function u(e,t){let{accessToken:i,workspaceId:a}=await r(),o=new n;if(t.oauth){let{url:n}=await o.getConnectorAuthUrl(i,a,e);if(t.json){console.log(JSON.stringify({url:n}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${n}`),console.log(`
3
- 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 o.connectConnectorToken(i,a,e,s),console.log(t.json?JSON.stringify({id:e,connected:!0}):`Connected connector ${e}.`)}async function d(e){let o=e.auth===`oauth`||e.auth===`google-iap`;o&&(!e.provider||!e.scope?.length)&&(console.error(`--auth ${e.auth} needs --provider and at least one --scope.`),process.exit(1)),!o&&(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));let c=e.toolPrefix??t(e.name),l=a(c);l&&(console.error(e.toolPrefix?`--tool-prefix ${l}.`:`The tool prefix derived from --name ("${c}") ${l}. Pass --tool-prefix explicitly.`),process.exit(1));let{accessToken:u,workspaceId:d}=await r(),f=e.auth?{type:e.auth,...e.provider?{provider:e.provider}:{},...e.scope?.length?{scopes:e.scope}:{}}:void 0,p=await new n().createCustomConnector(u,d,{type:i.CUSTOM_REMOTE_URL,name:e.name,description:e.description,transport:e.transport,url:e.url,toolPrefix:c,...f?{authorization:f}:{}});if(e.json){console.log(JSON.stringify(p));return}console.log(`Created connector ${p.name}.`),console.log(` ID: ${p.id}`),console.log(` URL: ${p.url}`),console.log(` Tool prefix: ${p.toolPrefix}`),console.log(`\n${s(p.id,e.auth)}`)}async function f(e,t){let{accessToken:i,workspaceId:a}=await r();if(!t.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${e} needs confirmation. Re-run with --yes.`),process.exit(1)),!await o(`Disconnect connector ${e}?`))){console.log(`Aborted.`);return}await new n().disconnectConnector(i,a,e),console.log(t.json?JSON.stringify({id:e,disconnected:!0}):`Disconnected connector ${e}.`)}export{u as connectConnector,d as createConnector,f as disconnectConnector,l as listConnectorTools,c as listConnectors};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{R as e,z as t}from"./profile-storage-CsigYr0Q.js";function n(t){if(t.length===0)return`must not be empty`;if(t.length>50)return`must be at most 50 characters`;if(!e.test(t))return`must use only letters, digits and spaces`;if(/\s{2,}/u.test(t))return`must not contain consecutive spaces`;if(t.trim()!==t)return`must not start or end with whitespace`}function r(e){if(e.length===0)return`must not be empty`;if(e.length>20)return`must be at most 20 characters`;if(!t.test(e))return`must use only lowercase letters, digits, hyphen and underscore`;if(/__+/u.test(e))return`must not contain consecutive underscores`}export{r as n,n as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,l as t,w as n,x as r}from"./profile-storage-CsigYr0Q.js";import{Client as i,StreamableHTTPClientTransport as a}from"@modelcontextprotocol/client";const o=()=>{};function s(t={}){let{requestTimeout:n,requestMaxTotalTimeout:r}=e();return{timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:!0,onprogress:t.onProgress??o,signal:t.signal}}async function c(e={}){let o=e.apiUrl,s=e.accessToken,c=e.workspaceId;if(!s||!c){let e=await t();s||=e.accessToken,c||=e.workspaceId}o||=n().apiUrl;let l=new i({name:e.name??`entrydesk-cli`,version:`1.0.0`}),u=new a(new URL(`${o}/v1/workspaces/${c}/mcp`),{requestInit:{headers:{Authorization:`Bearer ${s}`,...r()}}});return await l.connect(u),l}async function l(){return c()}export{l as n,s as r,c as t};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{P as e,b as t,l as n}from"./profile-storage-CsigYr0Q.js";function r(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function i(e){return!e||e<=0?``:`${Math.round(e/60)}m`}function a(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 o(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=i(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 s(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 c(e){let{accessToken:r,workspaceId:i}=await n(),o=new t,s={search:e.search,filter:e.filter,sortBy:e.sort};if(e.all){let t=[],n;for(let a=0;;a++){a>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let c=await o.getMeetings(r,i,{limit:e.limit??20,nextKey:n,...s});if(t.push(...c.meetings),n=c.nextKey,!n)break}if(e.json){console.log(JSON.stringify({meetings:t}));return}if(t.length===0){console.log(`No meetings found in this workspace.`);return}a(t);return}let{meetings:c,nextKey:l}=await o.getMeetings(r,i,{limit:e.limit,nextKey:e.nextKey,...s});if(e.json){console.log(JSON.stringify({meetings:c,nextKey:l}));return}if(c.length===0){console.log(`No meetings found in this workspace.`);return}a(c),l&&console.log(`Next page: --next-key ${l}`)}async function l(e,r){let{accessToken:i,workspaceId:a}=await n(),s=await new t().getMeeting(i,a,e);if(r.json){console.log(JSON.stringify(s));return}o(s)}async function u(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 d(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 f(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 p(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 m(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 h(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(`
3
- 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 g(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 c=await o.getMeetingShares(i,a,e);if(r.json){console.log(JSON.stringify(c));return}s(c)}export{u as createMeeting,f as deleteMeeting,c as listMeetings,g as shareMeeting,l as showMeeting,p as showMeetingSummary,m as showMeetingTranscript,h as showPreviousMeeting,d as updateMeeting};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as e,l as t}from"./profile-storage-CsigYr0Q.js";async function n(n){let{accessToken:r,workspaceId:i}=await t(),{models:a}=await new e().listSelectableModels(r,i);if(n.json){console.log(JSON.stringify(a));return}if(a.length===0){console.log(`No models available in this workspace.`);return}console.log(`Available models (${a.length}):\n`);for(let e of a)console.log(` ${e.name}`),e.description&&console.log(` ${e.description.slice(0,80)}`),console.log(` ID: ${e.id}`),console.log(``)}export{n as runModels};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as e,l as t}from"./profile-storage-CsigYr0Q.js";function n(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function r(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function i(e){console.log(`Notifications (${e.length}):\n`);for(let t of e){let e=t.readAt?` `:`●`;console.log(` ${e} [${t.category}] ${t.rendered.title}`),t.rendered.body&&console.log(` ${r(t.rendered.body,100)}`);let i=n(t.createdAt);console.log(` ${i} · ${t.eventType} · ID: ${t.id}`),console.log(``)}}async function a(n){let{accessToken:r,workspaceId:a}=await t(),o=new e,s={tab:n.tab,eventType:n.eventType};if(n.all){let e=[],t;for(let i=0;;i++){i>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let c=await o.getNotifications(r,a,{...s,limit:n.limit??20,cursor:t});if(e.push(...c.items),t=c.nextKey,!t)break}if(n.json){console.log(JSON.stringify({items:e}));return}if(e.length===0){console.log(`No notifications.`);return}i(e);return}let{items:c,nextKey:l}=await o.getNotifications(r,a,{...s,limit:n.limit,cursor:n.nextKey});if(n.json){console.log(JSON.stringify({items:c,nextKey:l}));return}if(c.length===0){console.log(`No notifications.`);return}i(c),l&&console.log(`Next page: --next-key ${l}`)}async function o(n){let{accessToken:r,workspaceId:i}=await t(),{count:a,capped:o}=await new e().getNotificationUnreadCount(r,i);if(n.json){console.log(JSON.stringify({count:a,capped:o??!1}));return}console.log(`${o?`${a}+`:a} unread`)}async function s(n,r){let{accessToken:i,workspaceId:a}=await t();if(await new e().markNotificationRead(i,a,n),r.json){console.log(JSON.stringify({id:n,read:!0}));return}console.log(`Marked notification read: ${n}`)}async function c(n){let{accessToken:r,workspaceId:i}=await t();if(await new e().markAllNotificationsRead(r,i),n.json){console.log(JSON.stringify({readAll:!0}));return}console.log(`Marked all notifications read.`)}export{a as listNotifications,c as markAllNotificationsRead,s as markNotificationRead,o as showUnreadCount};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e}from"./profile-storage-CsigYr0Q.js";import t from"node:fs";import n from"node:os";import r from"node:path";const i=`.entrydesk`;function a(){return{version:1,skills:{}}}function o(e){return r.join(e,i,`skills-lock.json`)}function s(e){try{let n=JSON.parse(t.readFileSync(o(e),`utf8`));return n.version!==1||typeof n.skills!=`object`||n.skills===null?a():n}catch{return a()}}function c(e,n){let i={};for(let e of Object.keys(n.skills).toSorted())i[e]=n.skills[e];let a={version:1,...n.workspaceId?{workspaceId:n.workspaceId}:{},skills:i},s=o(e);t.mkdirSync(r.dirname(s),{recursive:!0}),t.writeFileSync(s,`${JSON.stringify(a,null,2)}\n`,`utf8`)}function l(e,t){return s(e).skills[t]}function u(e,t,n){let r=s(e);r.skills[t]=n,c(e,r)}function d(e,t){let n=s(e);if(!(t in n.skills))return!1;let{[t]:r,...i}=n.skills;return c(e,{...n,skills:i}),!0}function f(e){try{let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.workspaceId!=`string`||n.workspaceId===``?void 0:n}catch{return}}function p(e,n){t.mkdirSync(r.dirname(e),{recursive:!0}),t.writeFileSync(e,`${JSON.stringify(n,null,2)}\n`,`utf8`)}function m(e){return t.existsSync(e)?(t.rmSync(e),!0):!1}function h(e){return r.join(e,i,`project.json`)}function g(){return r.join(n.homedir(),i,`global-link.json`)}function _(){return f(g())}function v(e){p(g(),e)}function y(){return m(g())}function b(e=process.cwd()){let n=r.resolve(e);for(;;){if(t.existsSync(h(n)))return n;let e=r.dirname(n);if(e===n)return;n=e}}function x(e){return f(h(e))}function S(e,t){p(h(e),t)}function C(e){return m(h(e))}function w(e=process.cwd()){let t=b(e);if(!t)return;let n=x(t);return n?{rootDir:t,link:n}:void 0}function T(t){let n=e();if(t&&n&&t!==n)throw Error(`This directory is linked to a workspace on ${t}, but the active profile points at ${n}. Re-run 'entrydesk skills link' or switch profile.`)}function E(){process.env.ENTRYDESK_API_URL&&console.error(`Note: the recorded apiUrl comes from the ENTRYDESK_API_URL environment variable. This link pins the directory to that API — if the override was temporary, re-run the link without it.`)}function D(e,t){if(e){let e=n.homedir(),r=_();return r?(T(r.apiUrl),{rootDir:e,workspaceId:r.workspaceId,linked:!0}):{rootDir:e,workspaceId:t,linked:!1}}let r=w(process.cwd());return r?(T(r.link.apiUrl),{rootDir:r.rootDir,workspaceId:r.link.workspaceId,linked:!0}):{rootDir:process.cwd(),workspaceId:t,linked:!1}}const O=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function k(e){if(!O.test(e))throw Error(`Invalid skill name "${e}": must be lowercase letters, digits and single hyphens (e.g. "my-skill").`)}function A(e,t){k(t);let n=r.resolve(e,`.entrydesk`,`skills`),i=r.resolve(n,t);if(i!==r.join(n,t)||!i.startsWith(n+r.sep))throw Error(`Refusing unsafe skill path for "${t}".`);return i}export{b as a,y as c,S as d,l as f,u as h,E as i,C as l,d as m,A as n,g as o,s as p,D as r,h as s,k as t,v as u};