@entrydesk/cli 2.2.0-beta.2 → 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 +72 -3
  2. package/dist/{add-BYupRwo_.js → add-QRCNes33.js} +1 -1
  3. package/dist/{agents-CeXkI4US.js → agents-C6_4nYx3.js} +1 -1
  4. package/dist/{billing-BeaQvLSK.js → billing-B52QpxBo.js} +1 -1
  5. package/dist/{budget-B4SKcu-1.js → budget-CCZUSzQX.js} +1 -1
  6. package/dist/build-task-request-config-D1BoTQ_r.js +10 -0
  7. package/dist/{commands-Bisc9IY0.js → commands-DT40svYr.js} +1 -1
  8. package/dist/{commands-Drf0_Uu8.js → commands-OQF1wQ6Z.js} +1 -1
  9. package/dist/{config-ROg2C1qz.js → config-DRasb4uc.js} +2 -2
  10. package/dist/connectors-CGdm_hGV.js +11 -0
  11. package/dist/{file-upload-ClVCUJp1.js → file-upload-DuXlHqyj.js} +1 -1
  12. package/dist/{format-B6a10P86.js → format-C0MI0rzh.js} +1 -1
  13. package/dist/index.js +43 -23
  14. package/dist/{instruction-D0Sy5WJu.js → instruction-OdStaJMu.js} +1 -1
  15. package/dist/{login-7nuzjqqL.js → login-BJK-C-yF.js} +1 -1
  16. package/dist/{logout-O7uVmxmK.js → logout-b335WkA6.js} +1 -1
  17. package/dist/{marketplace-8V1DNOld.js → marketplace-B5HXnl23.js} +2 -2
  18. package/dist/{mcp-client-DpDabxv9.js → mcp-client-mMhJPPZN.js} +1 -1
  19. package/dist/{mcp-DwMCTWU-.js → mcp-hLbWIery.js} +1 -1
  20. package/dist/{meeting-DCMyPA59.js → meeting-2Z2c7Ppj.js} +1 -1
  21. package/dist/{message-utils-C6JS91tT.js → message-utils-BHtHL44l.js} +7 -7
  22. package/dist/{models-BdxCIBZD.js → models-Cd725_l2.js} +1 -1
  23. package/dist/{notifications-BZxmGqEM.js → notifications-D1-iA_h8.js} +1 -1
  24. package/dist/{paginate-B-nHzQ0j.js → paginate-y3CJuqRW.js} +1 -1
  25. package/dist/{paths-ZPsPG0IC.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-Ba5LBPMF.js → project-DwR8Pf3y.js} +1 -1
  29. package/dist/project-context-CiI3hHaT.js +10 -0
  30. package/dist/{project-governance-B66BEQxO.js → project-governance-OVpv9LXv.js} +1 -1
  31. package/dist/{project-sources-D4m1oEvu.js → project-sources-CtSvnInR.js} +1 -1
  32. package/dist/{project-sources-write-CCICd6f8.js → project-sources-write-BaWV2jtH.js} +1 -1
  33. package/dist/{project-tasks-ylwpld2n.js → project-tasks-BKdZe3qu.js} +1 -1
  34. package/dist/{push-CNZNGP6D.js → push-CMRb7H6f.js} +1 -1
  35. package/dist/{recordings-DpDUq0iw.js → recordings-Bz6wVqBM.js} +1 -1
  36. package/dist/{remove-CbGljmXk.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-CTFIi2SL.js → schedules-DrzGEvSR.js} +2 -2
  40. package/dist/{skills-DbFd9oBS.js → skills-CdcBhRxn.js} +1 -1
  41. package/dist/{status-Br8KI96N.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-CNUJbs7w.js → tasks-BpqBNtta.js} +1 -1
  46. package/dist/{team-BfBb-uk2.js → team-R67MPRfp.js} +1 -1
  47. package/dist/{teams-47YS8wYw.js → teams-DvACXgpt.js} +1 -1
  48. package/dist/{token-CvjOXFDB.js → token-Diy_e8pF.js} +1 -1
  49. package/dist/{tool-D_n28XK0.js → tool-CFaX5Q8e.js} +7 -7
  50. package/dist/{update-B8gxXkSO.js → update-CvHLQuTu.js} +1 -1
  51. package/dist/{usage-BPyHU-GL.js → usage-Bv04bmPn.js} +1 -1
  52. package/dist/{usage-audit-STxCfVta.js → usage-audit-D65sU87J.js} +3 -3
  53. package/dist/{version-Ca4arzgb.js → version-BFfQldMJ.js} +1 -1
  54. package/dist/{webhook-B0E0M2EK.js → webhook-h1JuRyJf.js} +1 -1
  55. package/dist/{workflow-B-iN8d5R.js → workflow-CrOwbORs.js} +1 -1
  56. package/dist/{workspaces-DmqtYNX1.js → workspaces-CJP3Q8wV.js} +1 -1
  57. package/package.json +4 -4
  58. package/dist/build-task-request-config-eOeyGAfk.js +0 -10
  59. package/dist/connectors-jktsuWlk.js +0 -11
  60. package/dist/profile-D4jP-vQE.js +0 -10
  61. package/dist/profile-storage--QCh_u_Q.js +0 -73
  62. package/dist/project-context-8lb14kaU.js +0 -10
  63. package/dist/resolve-Di6ohyyF.js +0 -14
  64. package/dist/resource-grants-DojPWFs8.js +0 -10
  65. package/dist/status-DLI2OgMv.js +0 -10
  66. package/dist/task-CRwWxEOf.js +0 -116
  67. package/dist/tasks-VEfTbXVT.js +0 -22
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{E as e,F as t,I as n,h as r,m as i,p as a}from"./profile-storage--QCh_u_Q.js";import{r as o,t as s}from"./mcp-client-DpDabxv9.js";import c from"node:http";import{stderr as l}from"node:process";import{NodeStreamableHTTPServerTransport as u}from"@modelcontextprotocol/node";import{Server as d}from"@modelcontextprotocol/server";import{StdioServerTransport as f}from"@modelcontextprotocol/server/stdio";function p(e){l.write(`${e}\n`)}function m(e,t,n){return s({apiUrl:e,accessToken:t,workspaceId:n,name:`entrydesk-cli-proxy`})}function h(e){let t=new d({name:`entrydesk-cli`,version:`1.0.0`},{capabilities:{tools:{}}});return t.setRequestHandler(`tools/list`,async(t,n)=>({tools:(await(await e()).listTools({},o({signal:n.mcpReq.signal}))).tools})),t.setRequestHandler(`tools/call`,async(n,r)=>{let{name:i,arguments:a}=n.params,{progressToken:s}=r.mcpReq._meta??{},c=await(await e()).callTool({name:i,arguments:a},o({signal:r.mcpReq.signal,onProgress:s===void 0?void 0:e=>{r.mcpReq.notify({method:`notifications/progress`,params:{...e,progressToken:s}}).catch(()=>{})}})),l=Array.isArray(c.content)?[...c.content]:[];return c.structuredContent&&l.push({type:`text`,text:JSON.stringify(c.structuredContent,null,2)}),t.projectCallToolResult({content:l,structuredContent:c.structuredContent,isError:c.isError},void 0)}),t}async function g(e,t,n){let r=c.createServer(async(t,n)=>{if(t.method===`OPTIONS`){n.setHeader(`Access-Control-Allow-Origin`,`*`),n.setHeader(`Access-Control-Allow-Methods`,`GET, POST, DELETE, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type, Accept`),n.writeHead(204),n.end();return}if(t.url!==`/mcp`){n.writeHead(404,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`Not found`}));return}let r=h(e),i=new u({sessionIdGenerator:void 0});if(n.setHeader(`Access-Control-Allow-Origin`,`*`),n.on(`close`,()=>{i.close(),r.close()}),await r.connect(i),t.method===`POST`){let e=``;t.on(`data`,t=>{e+=t.toString()}),t.on(`end`,async()=>{try{let r=JSON.parse(e);await i.handleRequest(t,n,r)}catch{n.writeHead(400,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`Invalid JSON`}))}})}else await i.handleRequest(t,n)});r.listen(n,()=>{p(`EntryDesk MCP server running at http://localhost:${n}/mcp`),p(`Press Ctrl+C to stop`)}),process.on(`SIGINT`,async()=>{p(`
10
+ import{D as e,I as t,L as n,h as r,m as i,p as a}from"./profile-storage-BPBUFvA6.js";import{r as o,t as s}from"./mcp-client-mMhJPPZN.js";import c from"node:http";import{stderr as l}from"node:process";import{NodeStreamableHTTPServerTransport as u}from"@modelcontextprotocol/node";import{Server as d}from"@modelcontextprotocol/server";import{StdioServerTransport as f}from"@modelcontextprotocol/server/stdio";function p(e){l.write(`${e}\n`)}function m(e,t,n){return s({apiUrl:e,accessToken:t,workspaceId:n,name:`entrydesk-cli-proxy`})}function h(e){let t=new d({name:`entrydesk-cli`,version:`1.0.0`},{capabilities:{tools:{}}});return t.setRequestHandler(`tools/list`,async(t,n)=>({tools:(await(await e()).listTools({},o({signal:n.mcpReq.signal}))).tools})),t.setRequestHandler(`tools/call`,async(n,r)=>{let{name:i,arguments:a}=n.params,{progressToken:s}=r.mcpReq._meta??{},c=await(await e()).callTool({name:i,arguments:a},o({signal:r.mcpReq.signal,onProgress:s===void 0?void 0:e=>{r.mcpReq.notify({method:`notifications/progress`,params:{...e,progressToken:s}}).catch(()=>{})}})),l=Array.isArray(c.content)?[...c.content]:[];return c.structuredContent&&l.push({type:`text`,text:JSON.stringify(c.structuredContent,null,2)}),t.projectCallToolResult({content:l,structuredContent:c.structuredContent,isError:c.isError},void 0)}),t}async function g(e,t,n){let r=c.createServer(async(t,n)=>{if(t.method===`OPTIONS`){n.setHeader(`Access-Control-Allow-Origin`,`*`),n.setHeader(`Access-Control-Allow-Methods`,`GET, POST, DELETE, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type, Accept`),n.writeHead(204),n.end();return}if(t.url!==`/mcp`){n.writeHead(404,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`Not found`}));return}let r=h(e),i=new u({sessionIdGenerator:void 0});if(n.setHeader(`Access-Control-Allow-Origin`,`*`),n.on(`close`,()=>{i.close(),r.close()}),await r.connect(i),t.method===`POST`){let e=``;t.on(`data`,t=>{e+=t.toString()}),t.on(`end`,async()=>{try{let r=JSON.parse(e);await i.handleRequest(t,n,r)}catch{n.writeHead(400,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`Invalid JSON`}))}})}else await i.handleRequest(t,n)});r.listen(n,()=>{p(`EntryDesk MCP server running at http://localhost:${n}/mcp`),p(`Press Ctrl+C to stop`)}),process.on(`SIGINT`,async()=>{p(`
11
11
  Shutting down…`),r.close(),await t(),process.exit(0)}),process.on(`SIGTERM`,async()=>{r.close(),await t(),process.exit(0)})}async function _(e,t){let n=h(e),r=new f;r.onclose=()=>{t()},await n.connect(r)}const v={mode:`stdio`};async function y(o=v){process.on(`unhandledRejection`,e=>{console.error(`[entrydesk-mcp] Unhandled rejection:`,e)}),process.on(`uncaughtException`,e=>{console.error(`[entrydesk-mcp] Uncaught exception:`,e)});try{p(`[entrydesk-mcp] Starting MCP server…`);let s,c;try{let e=await a();s=e.accessToken,c=e.workspaceId}catch(e){let t=e instanceof Error?e.message:`Authentication failed`;console.error(t),process.exit(1)}let l=await n(),u=t();p(`[entrydesk-mcp] Connecting to ${l}…`),p(`[entrydesk-mcp] Workspace: ${c}`);let d=await m(l,s,c);p(`[entrydesk-mcp] Connected to EntryDesk API`);let f=null,h=async()=>i(s)?f||(f=(async()=>{p(`[entrydesk-mcp] Token expiring soon, refreshing…`);let t=await e.getAll();if(!t?.accessToken)throw Error("Not logged in. Run `entrydesk login` again.");let i=await r(t);if(i!==s){s=i;try{await d.close()}catch{}d=await m(await n(),s,c),p(`[entrydesk-mcp] Token refreshed, reconnected`)}return d})().finally(()=>{f=null}),f):d,v=async()=>{try{await d.close()}catch{}};o.mode===`http`?await g(h,v,o.port??u.httpPort):(p(`[entrydesk-mcp] Starting stdio server…`),await _(h,v),p(`[entrydesk-mcp] Stdio server started`))}catch(e){console.error(`[entrydesk-mcp] Fatal error:`,e),process.exit(1)}}export{y as startMcpServer};
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{C as e,J as t,p as n}from"./profile-storage--QCh_u_Q.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{r as i}from"./format-B6a10P86.js";import{t as a}from"./paginate-B-nHzQ0j.js";import{HTTPError as o}from"ky";function s(e){return!e||e<=0?``:`${Math.round(e/60)}m`}function c(e){console.log(`Meetings (${e.length}):\n`);for(let t of e){let e=[`(${t.status??`unknown`})`],n=i(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 l(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: ${i(e.startTime)}`),e.endTime&&console.log(` End: ${i(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=s(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 u(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 d(t){let{accessToken:i,workspaceId:o}=await n(),s=new e,l={search:t.search,filter:t.filter,sortBy:t.sort};if(t.all){let e=await a(async e=>{let n=await s.getMeetings(i,o,{limit:t.limit??20,nextKey:e,...l});return{items:n.meetings,nextKey:n.nextKey}});if(t.json){console.log(r({meetings:e}));return}if(e.length===0){console.log(`No meetings found in this workspace.`);return}c(e);return}let{meetings:u,nextKey:d}=await s.getMeetings(i,o,{limit:t.limit,nextKey:t.nextKey,...l});if(t.json){console.log(r({meetings:u,nextKey:d}));return}if(u.length===0){console.log(`No meetings found in this workspace.`);return}c(u),d&&console.log(`Next page: --next-key ${d}`)}async function f(t,i){let{accessToken:a,workspaceId:o}=await n(),s=await new e().getMeeting(a,o,t);if(i.json){console.log(r(s));return}l(s)}async function p(t){let{accessToken:i,workspaceId:a}=await n(),o={title:t.title};t.description!==void 0&&(o.description=t.description),t.location!==void 0&&(o.location=t.location),t.start!==void 0&&(o.startTime=t.start),t.end!==void 0&&(o.endTime=t.end),t.conferenceLink!==void 0&&(o.conferenceLink=t.conferenceLink),t.notes!==void 0&&(o.notes=t.notes);let s=await new e().createMeeting(i,a,o);if(t.json){console.log(r(s));return}console.log(`Created meeting: ${s.title}`),console.log(` ID: ${s.id}`)}function m(e){let{host:t,pathname:n}=new URL(e);return`${t}${n===`/`?``:n}`.slice(0,500)}function h(e){return e instanceof o&&e.response.status<500}async function g(t,i){let{accessToken:a,workspaceId:o}=await n(),s=new e,c=e=>s.dispatchMeetingBot(a,o,e,{meetingUrl:t,joinTiming:`now`,...i.botName?{botName:i.botName}:{},...i.video?{saveVideo:!0}:{}}),l=i.meeting,u;if(l===void 0){let e=await s.createMeeting(a,o,{title:i.title??m(t),startTime:new Date().toISOString(),conferenceLink:t});l=e.id;try{u=await c(e.id)}catch(t){throw h(t)&&await s.deleteMeeting(a,o,e.id).then(()=>!0,()=>!1)||console.error(`Meeting ${e.id} was kept; check \`entrydesk meeting get ${e.id}\` before retrying with --meeting ${e.id}`),t}}else u=await c(l);if(i.json){console.log(r({meetingId:l,...u}));return}console.log(`Recording bot ${u.status}: ${t}`),console.log(` Meeting ID: ${l}`),console.log(` Recording ID: ${u.recordingId}`),console.log(`Once the call ends: entrydesk meeting summary ${l}`)}async function _(t,i){let a={};i.title!==void 0&&(a.title=i.title),i.description!==void 0&&(a.description=i.description),i.location!==void 0&&(a.location=i.location),i.start!==void 0&&(a.startTime=i.start),i.end!==void 0&&(a.endTime=i.end),i.conferenceLink!==void 0&&(a.conferenceLink=i.conferenceLink),i.notes!==void 0&&(a.notes=i.notes),i.status!==void 0&&(a.status=i.status),i.visibility!==void 0&&(a.visibility=i.visibility),Object.keys(a).length===0&&(console.error(`No fields provided to update.`),process.exit(1));let{accessToken:o,workspaceId:s}=await n(),c=await new e().updateMeeting(o,s,t,a);if(i.json){console.log(r(c));return}console.log(`Updated meeting: ${t}`)}async function v(t,i){let{accessToken:a,workspaceId:o}=await n();if(await new e().deleteMeeting(a,o,t),i.json){console.log(r({id:t,deleted:!0}));return}console.log(`Deleted meeting: ${t}`)}async function y(i,a){let{accessToken:o,workspaceId:s}=await n(),c=t(await new e().getMeeting(o,s,i));if(a.json){console.log(r({summary:c??null}));return}c||(console.error(`This meeting has no summary yet.`),process.exit(1)),console.log(c)}async function b(t,i){let{accessToken:a,workspaceId:o}=await n(),s=await new e().getRecording(a,o,t),c=i.raw?s.transcriptWithTimestamps:s.transcript;if(i.json){console.log(r({transcript:c,processingStatus:s.processingStatus}));return}c||(console.error(s.processingStatus&&s.processingStatus!==`completed`?`Transcript not ready (processing status: ${s.processingStatus}).`:`This recording has no transcript.`),process.exit(1)),console.log(c)}async function x(t,a){let{accessToken:o,workspaceId:s}=await n(),{previous:c}=await new e().getMeetingPreviousBrief(o,s,t);if(a.json){console.log(r({previous:c}));return}if(!c){console.log(`No previous meeting found in this series.`);return}if(console.log(`Previous: ${c.title}`),c.startTime&&console.log(` ${i(c.startTime)}`),c.summary&&console.log(`\nSummary:\n${c.summary}`),c.actionItems.length>0){console.log(`
10
+ import{C as e,Y as t,p as n}from"./profile-storage-BPBUFvA6.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{r as i}from"./format-C0MI0rzh.js";import{t as a}from"./paginate-y3CJuqRW.js";import{HTTPError as o}from"ky";function s(e){return!e||e<=0?``:`${Math.round(e/60)}m`}function c(e){console.log(`Meetings (${e.length}):\n`);for(let t of e){let e=[`(${t.status??`unknown`})`],n=i(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 l(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: ${i(e.startTime)}`),e.endTime&&console.log(` End: ${i(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=s(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 u(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 d(t){let{accessToken:i,workspaceId:o}=await n(),s=new e,l={search:t.search,filter:t.filter,sortBy:t.sort};if(t.all){let e=await a(async e=>{let n=await s.getMeetings(i,o,{limit:t.limit??20,nextKey:e,...l});return{items:n.meetings,nextKey:n.nextKey}});if(t.json){console.log(r({meetings:e}));return}if(e.length===0){console.log(`No meetings found in this workspace.`);return}c(e);return}let{meetings:u,nextKey:d}=await s.getMeetings(i,o,{limit:t.limit,nextKey:t.nextKey,...l});if(t.json){console.log(r({meetings:u,nextKey:d}));return}if(u.length===0){console.log(`No meetings found in this workspace.`);return}c(u),d&&console.log(`Next page: --next-key ${d}`)}async function f(t,i){let{accessToken:a,workspaceId:o}=await n(),s=await new e().getMeeting(a,o,t);if(i.json){console.log(r(s));return}l(s)}async function p(t){let{accessToken:i,workspaceId:a}=await n(),o={title:t.title};t.description!==void 0&&(o.description=t.description),t.location!==void 0&&(o.location=t.location),t.start!==void 0&&(o.startTime=t.start),t.end!==void 0&&(o.endTime=t.end),t.conferenceLink!==void 0&&(o.conferenceLink=t.conferenceLink),t.notes!==void 0&&(o.notes=t.notes);let s=await new e().createMeeting(i,a,o);if(t.json){console.log(r(s));return}console.log(`Created meeting: ${s.title}`),console.log(` ID: ${s.id}`)}function m(e){let{host:t,pathname:n}=new URL(e);return`${t}${n===`/`?``:n}`.slice(0,500)}function h(e){return e instanceof o&&e.response.status<500}async function g(t,i){let{accessToken:a,workspaceId:o}=await n(),s=new e,c=e=>s.dispatchMeetingBot(a,o,e,{meetingUrl:t,joinTiming:`now`,...i.botName?{botName:i.botName}:{},...i.video?{saveVideo:!0}:{}}),l=i.meeting,u;if(l===void 0){let e=await s.createMeeting(a,o,{title:i.title??m(t),startTime:new Date().toISOString(),conferenceLink:t});l=e.id;try{u=await c(e.id)}catch(t){throw h(t)&&await s.deleteMeeting(a,o,e.id).then(()=>!0,()=>!1)||console.error(`Meeting ${e.id} was kept; check \`entrydesk meeting get ${e.id}\` before retrying with --meeting ${e.id}`),t}}else u=await c(l);if(i.json){console.log(r({meetingId:l,...u}));return}console.log(`Recording bot ${u.status}: ${t}`),console.log(` Meeting ID: ${l}`),console.log(` Recording ID: ${u.recordingId}`),console.log(`Once the call ends: entrydesk meeting summary ${l}`)}async function _(t,i){let a={};i.title!==void 0&&(a.title=i.title),i.description!==void 0&&(a.description=i.description),i.location!==void 0&&(a.location=i.location),i.start!==void 0&&(a.startTime=i.start),i.end!==void 0&&(a.endTime=i.end),i.conferenceLink!==void 0&&(a.conferenceLink=i.conferenceLink),i.notes!==void 0&&(a.notes=i.notes),i.status!==void 0&&(a.status=i.status),i.visibility!==void 0&&(a.visibility=i.visibility),Object.keys(a).length===0&&(console.error(`No fields provided to update.`),process.exit(1));let{accessToken:o,workspaceId:s}=await n(),c=await new e().updateMeeting(o,s,t,a);if(i.json){console.log(r(c));return}console.log(`Updated meeting: ${t}`)}async function v(t,i){let{accessToken:a,workspaceId:o}=await n();if(await new e().deleteMeeting(a,o,t),i.json){console.log(r({id:t,deleted:!0}));return}console.log(`Deleted meeting: ${t}`)}async function y(i,a){let{accessToken:o,workspaceId:s}=await n(),c=t(await new e().getMeeting(o,s,i));if(a.json){console.log(r({summary:c??null}));return}c||(console.error(`This meeting has no summary yet.`),process.exit(1)),console.log(c)}async function b(t,i){let{accessToken:a,workspaceId:o}=await n(),s=await new e().getRecording(a,o,t),c=i.raw?s.transcriptWithTimestamps:s.transcript;if(i.json){console.log(r({transcript:c,processingStatus:s.processingStatus}));return}c||(console.error(s.processingStatus&&s.processingStatus!==`completed`?`Transcript not ready (processing status: ${s.processingStatus}).`:`This recording has no transcript.`),process.exit(1)),console.log(c)}async function x(t,a){let{accessToken:o,workspaceId:s}=await n(),{previous:c}=await new e().getMeetingPreviousBrief(o,s,t);if(a.json){console.log(r({previous:c}));return}if(!c){console.log(`No previous meeting found in this series.`);return}if(console.log(`Previous: ${c.title}`),c.startTime&&console.log(` ${i(c.startTime)}`),c.summary&&console.log(`\nSummary:\n${c.summary}`),c.actionItems.length>0){console.log(`
11
11
  Action items:`);for(let e of c.actionItems){let t=e.completed?`[x]`:`[ ]`,n=e.assignee?` (@${e.assignee})`:``;console.log(` ${t} ${e.description}${n}`)}}}async function S(t,i){let{accessToken:a,workspaceId:o}=await n(),s=new e;if(i.addUser){let e=await s.upsertMeetingUserGrant(a,o,t,i.addUser,i.role);if(i.json){console.log(r(e));return}console.log(`Granted ${i.role} to user ${i.addUser}`);return}if(i.removeUser){if(await s.removeMeetingUserGrant(a,o,t,i.removeUser),i.json){console.log(r({userId:i.removeUser,removed:!0}));return}console.log(`Revoked access for user ${i.removeUser}`);return}if(i.addTeam){let e=await s.upsertMeetingTeamGrant(a,o,t,i.addTeam,i.role);if(i.json){console.log(r(e));return}console.log(`Granted ${i.role} to team ${i.addTeam}`);return}if(i.removeTeam){if(await s.removeMeetingTeamGrant(a,o,t,i.removeTeam),i.json){console.log(r({teamId:i.removeTeam,removed:!0}));return}console.log(`Revoked access for team ${i.removeTeam}`);return}if(i.visibility){let e=await s.updateMeeting(a,o,t,{visibility:i.visibility});if(i.json){console.log(r({visibility:e.visibility}));return}console.log(`Set visibility to ${e.visibility}`);return}let c=await s.getMeetingShares(a,o,t);if(i.json){console.log(r(c));return}u(c)}export{p as createMeeting,v as deleteMeeting,d as listMeetings,g as recordMeeting,S as shareMeeting,f as showMeeting,y as showMeetingSummary,b as showMeetingTranscript,x as showPreviousMeeting,_ as updateMeeting};
@@ -7,18 +7,18 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{G as e,Rt as t,Tn as n,U as r,W as i,cn as a,on as o,pt as s}from"./profile-storage--QCh_u_Q.js";import{n as c,r as l}from"./terminal-text-cBPBiP3x.js";import{a as u,r as d,t as f}from"./format-B6a10P86.js";import p from"node:os";import m from"node:path";import h from"node:fs/promises";function g(e){return e.status===`failed`&&(e.errorMessage?.startsWith(`The sandbox restarted while the command was running`)??!1)}function _(e){return n(e)&&e.type===`data-tool-run-start`}function v(e,t,n){return e?Math.max(0,((t?Date.parse(t):n)-Date.parse(e))/1e3):null}function y(e,t){switch(e){case`running`:return t===`—`?`running`:`running · ${t}`;case`unknown`:return`status unknown`;default:return e}}function b(e,t=`—`){if(e.status===`completed`){if(e.timedOut)return`timed out`;if(e.outputLimitExceeded)return`output limit exceeded`;if(e.exitCode!==null&&e.exitCode!==0)return`exit ${e.exitCode}`}return g(e)?`interrupted`:y(e.status,t)}function x(e){switch(e.status){case`queued`:return`Starting soon.`;case`completed`:return e.timedOut?`The command ran past its time limit and was stopped.`:e.outputLimitExceeded?`The output exceeded the size limit and the command was stopped.`:e.exitCode!==null&&e.exitCode!==0?`The command finished but returned a non-zero exit code.`:void 0;case`failed`:return g(e)?`Interrupted: the sandbox restarted while the command was running. It may have run only partly; check its effects before running it again.`:e.errorMessage??void 0;case`cancelled`:return`Stopped as requested.`;case`unknown`:return`Could not confirm whether the command ran or stopped; the sandbox may need checking.`;default:return}}function S(e,t){if(e.kind!==`tool`)return`${e.kind} · ${e.status}`;let n=f(v(e.startedAt,null,t));return`tool · ${y(e.status,n)}`}function C(e,t){let n=f(e.status===`running`||e.completedAt?v(e.startedAt,e.completedAt,t):null),r=b(e,n);return e.status===`running`||n===`—`?r:`${r} · ${n}`}function w(e,t,n){let r=new Set(e.map(e=>e.runId));return[...e.map(e=>({runId:e.runId,kind:e.kind,label:e.label,status:S(e,n)})),...t.filter(e=>!r.has(e.runId)).map(e=>({runId:e.runId,kind:e.kind,label:e.description??e.toolName,status:`tool · ${C(e,n)}`}))]}function T(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function E(e){return e?l(e.replace(/\n$/,``)).split(`
10
+ import{G as e,Ht as t,K as n,W as r,fn as i,ht as a,jn as o,un as s}from"./profile-storage-BPBUFvA6.js";import{n as c,r as l}from"./terminal-text-cBPBiP3x.js";import{a as u,r as d,t as f}from"./format-C0MI0rzh.js";import p from"node:os";import m from"node:path";import h from"node:fs/promises";function g(e){return e.status===`failed`&&(e.errorMessage?.startsWith(`The sandbox restarted while the command was running`)??!1)}function _(e){return o(e)&&e.type===`data-tool-run-start`}function v(e,t,n){return e?Math.max(0,((t?Date.parse(t):n)-Date.parse(e))/1e3):null}function y(e,t){switch(e){case`running`:return t===`—`?`running`:`running · ${t}`;case`unknown`:return`status unknown`;default:return e}}function b(e,t=`—`){if(e.status===`completed`){if(e.timedOut)return`timed out`;if(e.outputLimitExceeded)return`output limit exceeded`;if(e.exitCode!==null&&e.exitCode!==0)return`exit ${e.exitCode}`}return g(e)?`interrupted`:y(e.status,t)}function x(e){switch(e.status){case`queued`:return`Starting soon.`;case`completed`:return e.timedOut?`The command ran past its time limit and was stopped.`:e.outputLimitExceeded?`The output exceeded the size limit and the command was stopped.`:e.exitCode!==null&&e.exitCode!==0?`The command finished but returned a non-zero exit code.`:void 0;case`failed`:return g(e)?`Interrupted: the sandbox restarted while the command was running. It may have run only partly; check its effects before running it again.`:e.errorMessage??void 0;case`cancelled`:return`Stopped as requested.`;case`unknown`:return`Could not confirm whether the command ran or stopped; the sandbox may need checking.`;default:return}}function S(e,t){if(e.kind!==`tool`)return`${e.kind} · ${e.status}`;let n=f(v(e.startedAt,null,t));return`tool · ${y(e.status,n)}`}function C(e,t){let n=f(e.status===`running`||e.completedAt?v(e.startedAt,e.completedAt,t):null),r=b(e,n);return e.status===`running`||n===`—`?r:`${r} · ${n}`}function w(e,t,n){let r=new Set(e.map(e=>e.runId));return[...e.map(e=>({runId:e.runId,kind:e.kind,label:e.label,status:S(e,n)})),...t.filter(e=>!r.has(e.runId)).map(e=>({runId:e.runId,kind:e.kind,label:e.description??e.toolName,status:`tool · ${C(e,n)}`}))]}function T(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function E(e){return e?l(e.replace(/\n$/,``)).split(`
11
11
  `).map(e=>` ${e}`):[` (empty)`]}function D(e,t){let n=[`Tool run ${c(e.runId)}`,`$ ${c(e.description??e.toolName)}`,`Status: ${C(e,t)}`];e.startedAt&&n.push(`Started: ${d(e.startedAt)}`);let r=x(e);if(r&&n.push(c(r)),e.status===`running`)e.liveTail?(n.push(``,`stdout (live):`,...E(e.liveTail.stdout)),n.push(`stderr (live):`,...E(e.liveTail.stderr))):n.push(``,`Output is temporarily unavailable.`),n.push(``,`Live output: press i on this run in /runs to refresh.`);else{for(let[t,r]of[[`stdout`,e.stdout],[`stderr`,e.stderr]])r&&n.push(``,`${t} (${T(r.bytes)}, last part):`,...E(r.tail));e.fullOutputAvailable&&n.push(``,`Full output: press o on this run in /runs.`)}return(e.status===`queued`||e.status===`running`)&&n.push(`Stop: press Enter on this run in /runs.`),n.join(`
12
- `)}async function O(e){try{await h.mkdir(e,{mode:448})}catch(e){if(!n(e)||e.code!==`EEXIST`)throw e}let t=await h.lstat(e),r=process.getuid?.();if(!t.isDirectory()||r!==void 0&&t.uid!==r)throw Error(`${e} is not a directory owned by you`);t.mode&63&&await h.chmod(e,448)}async function k(e,t,n){let r=m.join(p.tmpdir(),`entrydesk`),i=m.join(r,`tool-runs`);await O(r),await O(i);let a=m.join(i,`${m.basename(e)}.${t}.txt`);return await h.writeFile(a,n,{mode:384}),await h.chmod(a,384),a}function A(e,t){let n={stdout:t.stdout?Buffer.byteLength(t.stdout.text):0,stderr:t.stderr?Buffer.byteLength(t.stderr.text):0},r=r=>t[r]!==null&&n[r]<(e[r]?.bytes??0),i=[`${[`stdout`,`stderr`].every(n=>!e[n]?.bytes||t[n]!==null&&!r(n))?`Full output`:`Output`} of ${c(e.runId)}`,`$ ${c(e.description??e.toolName)}`];for(let a of[`stdout`,`stderr`]){let o=t[a];if(o){let t=o.text.replace(/\n$/,``).split(`
12
+ `)}async function O(e){try{await h.mkdir(e,{mode:448})}catch(e){if(!o(e)||e.code!==`EEXIST`)throw e}let t=await h.lstat(e),n=process.getuid?.();if(!t.isDirectory()||n!==void 0&&t.uid!==n)throw Error(`${e} is not a directory owned by you`);t.mode&63&&await h.chmod(e,448)}async function k(e,t,n){let r=m.join(p.tmpdir(),`entrydesk`),i=m.join(r,`tool-runs`);await O(r),await O(i);let a=m.join(i,`${m.basename(e)}.${t}.txt`);return await h.writeFile(a,n,{mode:384}),await h.chmod(a,384),a}function A(e,t){let n={stdout:t.stdout?Buffer.byteLength(t.stdout.text):0,stderr:t.stderr?Buffer.byteLength(t.stderr.text):0},r=r=>t[r]!==null&&n[r]<(e[r]?.bytes??0),i=[`${[`stdout`,`stderr`].every(n=>!e[n]?.bytes||t[n]!==null&&!r(n))?`Full output`:`Output`} of ${c(e.runId)}`,`$ ${c(e.description??e.toolName)}`];for(let a of[`stdout`,`stderr`]){let o=t[a];if(o){let t=o.text.replace(/\n$/,``).split(`
13
13
  `),s=t.slice(-50);i.push(``,r(a)?`${a} saved to ${c(o.path)}, showing the last ${T(n[a])} of ${T(e[a]?.bytes??0)}`:`${a} saved to ${c(o.path)}`,t.length>s.length?`last ${s.length} of ${t.length} lines:`:`${u(t.length,`line`)}:`,...E(s.join(`
14
14
  `)));continue}let s=e[a];s?.bytes&&i.push(``,`${a} (full output unavailable, last part):`,...E(s.tail))}return i.join(`
15
- `)}function j(e){if(n(e))return n(e.structuredContent)?e.structuredContent:void 0}const M=i.pick({status:!0,exitCode:!0,timedOut:!0,outputLimitExceeded:!0,errorMessage:!0});function N(e){let t=j(e);if(t?.kind===`tool`){let e=M.safeParse(t);return e.success?` · ${b(e.data)}`:``}return typeof t?.status==`string`&&t.status?` · ${c(t.status)}`:``}function P(t){let n=e.safeParse(j(t)?.status);return!n.success||!r(n.data)?`Stop requested for a background run`:n.data===`cancelled`?`Stopped a background run`:`Background run already finished${N(t)}`}function ee(e){let t=j(e)?.runs;return Array.isArray(t)?`Listed ${u(t.length,`background run`)}`:`Listed background runs`}function F(e,r,i){switch(e){case t.GET_RUN:return`Checked a background run${N(i)}`;case t.STOP_RUN:return P(i);case t.LIST_RUNS:return ee(i)}let a=j(i);if(!(!n(r)||r.background!==!0||a?.kind!==`tool`||typeof a.runId!=`string`))return[`Started in the background`,`$ ${c(typeof r.command==`string`?r.command:e)}`,`Details: /runs, then i on run ${c(a.runId)}`].join(`
16
- `)}const I=`\x1B[2m`,L=`\x1B[0m`,R=`\x1B[36m`,z=`\x1B[32m`,B=`\x1B[38;2;59;91;204m`,V=`\x1B[38;2;126;200;248m`,H=`\x1B[38;2;244;196;78m`,U={preauthorized:`Auto-approved · preauthorized for this task`,low_risk:`Auto-approved · assessed low risk`};function W(e){if(!n(e))return;let t=a({approved:e.approved===!0,isAutomatic:e.isAutomatic===!0,reason:typeof e.reason==`string`?e.reason:void 0});return t?U[t.kind]:void 0}function G(e){if(e.state===`output-denied`||e.state===`approval-responded`&&e.approval?.approved===!1)return e.approval?.reason||o.BY_USER}function K(e){return n(e)&&e.isError===!0}function q(e){if(e.state===`output-error`)return typeof e.errorText==`string`?e.errorText:``;if(e.state===`error`)return typeof e.output==`string`?e.output:``}const J=new Set([`input-streaming`,`input-available`,`output-available`]);function Y(e){return e.type===`tool-${t.WAIT}`&&J.has(e.state)&&!K(e.output)}function X(e){if(e.state!==`output-available`||K(e.output))return;let t=F(e.type.slice(5),e.input,e.output);if(!t)return;let[n,...r]=t.split(`
15
+ `)}function j(e){if(o(e))return o(e.structuredContent)?e.structuredContent:void 0}const M=e.pick({status:!0,exitCode:!0,timedOut:!0,outputLimitExceeded:!0,errorMessage:!0});function N(e){let t=j(e);if(t?.kind===`tool`){let e=M.safeParse(t);return e.success?` · ${b(e.data)}`:``}return typeof t?.status==`string`&&t.status?` · ${c(t.status)}`:``}function P(e){let t=n.safeParse(j(e)?.status);return!t.success||!r(t.data)?`Stop requested for a background run`:t.data===`cancelled`?`Stopped a background run`:`Background run already finished${N(e)}`}function ee(e){let t=j(e)?.runs;return Array.isArray(t)?`Listed ${u(t.length,`background run`)}`:`Listed background runs`}function F(e,n,r){switch(e){case t.GET_RUN:return`Checked a background run${N(r)}`;case t.STOP_RUN:return P(r);case t.LIST_RUNS:return ee(r)}let i=j(r);if(!(!o(n)||n.background!==!0||i?.kind!==`tool`||typeof i.runId!=`string`))return[`Started in the background`,`$ ${c(typeof n.command==`string`?n.command:e)}`,`Details: /runs, then i on run ${c(i.runId)}`].join(`
16
+ `)}const I=`\x1B[2m`,L=`\x1B[0m`,R=`\x1B[36m`,z=`\x1B[32m`,B=`\x1B[38;2;59;91;204m`,V=`\x1B[38;2;126;200;248m`,H=`\x1B[38;2;244;196;78m`,U={preauthorized:`Auto-approved · preauthorized for this task`,low_risk:`Auto-approved · assessed low risk`};function W(e){if(!o(e))return;let t=i({approved:e.approved===!0,isAutomatic:e.isAutomatic===!0,reason:typeof e.reason==`string`?e.reason:void 0});return t?U[t.kind]:void 0}function G(e){if(e.state===`output-denied`||e.state===`approval-responded`&&e.approval?.approved===!1)return e.approval?.reason||s.BY_USER}function K(e){return o(e)&&e.isError===!0}function q(e){if(e.state===`output-error`)return typeof e.errorText==`string`?e.errorText:``;if(e.state===`error`)return typeof e.output==`string`?e.output:``}const J=new Set([`input-streaming`,`input-available`,`output-available`]);function Y(e){return e.type===`tool-${t.WAIT}`&&J.has(e.state)&&!K(e.output)}function X(e){if(e.state!==`output-available`||K(e.output))return;let t=F(e.type.slice(5),e.input,e.output);if(!t)return;let[n,...r]=t.split(`
17
17
  `);return[`${R}● ${n}${L}`,...r.map(e=>`${I} ${e}${L}`)].join(`
18
18
  `)}function Z(e){let t=c(e.trim().split(`
19
- `)[0]??``);return t.length<=120?t:t.slice(0,120)+`…`}function Q(e){let t=s(e);if(t.length!==0)return[`${R}● Background runs finished${L}`,...t.map(e=>{let t=e.kind===`tool`?``:Z(e.summary);return`${I} ${[e.kind,c(e.status),t].filter(Boolean).join(` · `)}${L}`})].join(`
20
- `)}function te(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 r=n(e)?e:{},i=r.structuredContent;if(n(i)&&i.stdout&&typeof i.stdout==`string`){let e=i.stdout.trim();return t||e.length<=200?e:e.slice(0,200)+`…`}if(`content`in r&&Array.isArray(r.content)){let e=r.content.filter(e=>e.type===`text`&&e.text).map(e=>e.text).join(`
21
- `);return e?t||e.length<=200?e:e.slice(0,200)+`…`:`(result)`}if(r.type===`text`&&typeof r.content==`string`){let e=r.content;return t||e.length<=200?e:e.slice(0,200)+`…`}let a=JSON.stringify(e,null,t?2:void 0);return t||a.length<=200?a:a.slice(0,200)+`…`}function $(e,t){return l(te(e,t))}function ne(e,t=!1){let n=[];for(let r of e)if(r.type===`text`&&r.text)n.push(l(r.text));else if(r.type===`data-background-run-receipt`){let e=Q(r.data);e&&n.push(e)}else if(r.type===`reasoning`&&r.text)t?n.push(`${I}[Thinking]\n${l(r.text)}${L}`):n.push(`${I}[Thinking…]${L}`);else if(r.type===`tool-call`&&r.toolName){let e=[`${R}┌─ Tool: ${c(r.toolName)}${L}`];if(r.args){let n=JSON.stringify(r.args,null,t?2:void 0),i=t||n.length<=100?n:n.slice(0,100)+`…`;e.push(`${I}│ Input: ${c(i)}${L}`)}r.result===void 0?e.push(`${R}└─${L}`):(e.push(`${z}│ Output: ${$(r.result,t)}${L}`),e.push(`${R}└─ completed${L}`)),n.push(e.join(`
19
+ `)[0]??``);return t.length<=120?t:t.slice(0,120)+`…`}function Q(e){let t=a(e);if(t.length!==0)return[`${R}● Background runs finished${L}`,...t.map(e=>{let t=e.kind===`tool`?``:Z(e.summary);return`${I} ${[e.kind,c(e.status),t].filter(Boolean).join(` · `)}${L}`})].join(`
20
+ `)}function te(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=o(e)?e:{},r=n.structuredContent;if(o(r)&&r.stdout&&typeof r.stdout==`string`){let e=r.stdout.trim();return t||e.length<=200?e:e.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(`
21
+ `);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 i=JSON.stringify(e,null,t?2:void 0);return t||i.length<=200?i:i.slice(0,200)+`…`}function $(e,t){return l(te(e,t))}function ne(e,t=!1){let n=[];for(let r of e)if(r.type===`text`&&r.text)n.push(l(r.text));else if(r.type===`data-background-run-receipt`){let e=Q(r.data);e&&n.push(e)}else if(r.type===`reasoning`&&r.text)t?n.push(`${I}[Thinking]\n${l(r.text)}${L}`):n.push(`${I}[Thinking…]${L}`);else if(r.type===`tool-call`&&r.toolName){let e=[`${R}┌─ Tool: ${c(r.toolName)}${L}`];if(r.args){let n=JSON.stringify(r.args,null,t?2:void 0),i=t||n.length<=100?n:n.slice(0,100)+`…`;e.push(`${I}│ Input: ${c(i)}${L}`)}r.result===void 0?e.push(`${R}└─${L}`):(e.push(`${z}│ Output: ${$(r.result,t)}${L}`),e.push(`${R}└─ completed${L}`)),n.push(e.join(`
22
22
  `))}else if(r.type.startsWith(`tool-`)&&r.type!==`tool-call`){if(Y(r))continue;let e=X(r);if(e){n.push(e);continue}let i=[`${R}┌─ Tool: ${c(r.title||r.type.slice(5).replaceAll(`__`,` `))}${L}`];if(r.input){let e=JSON.stringify(r.input,null,t?2:void 0),n=t||e.length<=100?e:e.slice(0,100)+`…`;i.push(`${I}│ Input: ${c(n)}${L}`)}let a=G(r),o=q(r);if(r.output!==void 0&&r.state===`output-available`){i.push(`${z}│ Output: ${$(r.output,t)}${L}`);let e=W(r.approval);e&&i.push(`${I}│ ${e}${L}`),i.push(`${R}└─ completed${L}`)}else a===void 0?o===void 0?i.push(`${R}└─${L}`):(o&&i.push(`${I}│ ${l(o)}${L}`),i.push(`${R}└─ failed${L}`)):(i.push(`${I}│ ${c(a)}${L}`),i.push(`${R}└─ rejected${L}`));n.push(i.join(`
23
23
  `))}return n.join(`
24
24
 
@@ -7,5 +7,5 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{C as e,p as t}from"./profile-storage--QCh_u_Q.js";import{t as n}from"./terminal-text-cBPBiP3x.js";function r(e){return e===`saas`?{resolvesFrom:`model tiers`,note:`A task picks a tier (lite / pro / max) and the platform-default tier row decides the concrete model — but not always: a workspace with additional models enabled, or one on a subscription-pool model, can pin a concrete model id that resolves from its own rows and bypasses the tier mapping entirely.`}:{resolvesFrom:`this workspace's own rows`,note:`A task picks either a tier slug or a concrete model id. Tier rows are read per workspace and never fall back to the platform defaults, so changing a platform tier does not reach this workspace.`}}async function i(e){try{return await e()}catch(e){return{error:e instanceof Error?e.message:String(e)}}}function a(e){return` ${e.tier.padEnd(14)} → ${e.model?.id??`(no row)`}`}function o(e){if(`notExposed`in e){console.log(` Tier mappings: not exposed on SaaS — the public tier API strips the backing model id.`);return}if(`error`in e){console.log(` Tier mappings: unavailable (${e.error})`);return}if(e.tiers.length===0){console.log(` Tier mappings: none`);return}console.log(` Tier mappings (${e.tiers.length}):`);for(let t of e.tiers)console.log(a(t))}async function s(a){let{accessToken:s,workspaceId:c}=await t(),l=new e,{deploymentMode:u}=await l.getRuntimeConfig(),{resolvesFrom:d,note:f}=r(u),p=u===`saas`?Promise.resolve({notExposed:!0}):i(()=>l.getModelTierMappings(s,c)),[m,h]=await Promise.all([p,i(()=>l.getModels(s,c))]);if(a.json){console.log(n({deploymentMode:u,resolvesFrom:d,mappings:m,concrete:h}));return}console.log(`Model configuration
10
+ import{C as e,p as t}from"./profile-storage-BPBUFvA6.js";import{t as n}from"./terminal-text-cBPBiP3x.js";function r(e){return e===`saas`?{resolvesFrom:`model tiers`,note:`A task picks a tier (lite / pro / max) and the platform-default tier row decides the concrete model — but not always: a workspace with additional models enabled, or one on a subscription-pool model, can pin a concrete model id that resolves from its own rows and bypasses the tier mapping entirely.`}:{resolvesFrom:`this workspace's own rows`,note:`A task picks either a tier slug or a concrete model id. Tier rows are read per workspace and never fall back to the platform defaults, so changing a platform tier does not reach this workspace.`}}async function i(e){try{return await e()}catch(e){return{error:e instanceof Error?e.message:String(e)}}}function a(e){return` ${e.tier.padEnd(14)} → ${e.model?.id??`(no row)`}`}function o(e){if(`notExposed`in e){console.log(` Tier mappings: not exposed on SaaS — the public tier API strips the backing model id.`);return}if(`error`in e){console.log(` Tier mappings: unavailable (${e.error})`);return}if(e.tiers.length===0){console.log(` Tier mappings: none`);return}console.log(` Tier mappings (${e.tiers.length}):`);for(let t of e.tiers)console.log(a(t))}async function s(a){let{accessToken:s,workspaceId:c}=await t(),l=new e,{deploymentMode:u}=await l.getRuntimeConfig(),{resolvesFrom:d,note:f}=r(u),p=u===`saas`?Promise.resolve({notExposed:!0}):i(()=>l.getModelTierMappings(s,c)),[m,h]=await Promise.all([p,i(()=>l.getModels(s,c))]);if(a.json){console.log(n({deploymentMode:u,resolvesFrom:d,mappings:m,concrete:h}));return}console.log(`Model configuration
11
11
  `),console.log(` Deployment mode: ${u}`),console.log(` Selection resolves from: ${d}`),console.log(` ${f}\n`),o(m),console.log(`error`in h?` Concrete models: unavailable (${h.error})`:` Concrete models available: ${h.models.length}`)}async function c(r){if(r.config){await s(r);return}let{accessToken:i,workspaceId:a}=await t(),{models:o}=await new e().listSelectableModels(i,a);if(r.json){console.log(n(o));return}if(o.length===0){console.log(`No models available in this workspace.`);return}console.log(`Available models (${o.length}):\n`);for(let e of o)console.log(` ${e.name}`),e.description&&console.log(` ${e.description.slice(0,80)}`),console.log(` ID: ${e.id}`),console.log(``)}export{c as runModels};
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{C as e,p as t}from"./profile-storage--QCh_u_Q.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import{r}from"./format-B6a10P86.js";import{t as i}from"./paginate-B-nHzQ0j.js";function a(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function o(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(` ${a(t.rendered.body,100)}`);let n=r(t.createdAt);console.log(` ${n} · ${t.eventType} · ID: ${t.id}`),console.log(``)}}async function s(r){let{accessToken:a,workspaceId:s}=await t(),c=new e,l={tab:r.tab,eventType:r.eventType};if(r.all){let e=await i(async e=>{let t=await c.getNotifications(a,s,{...l,limit:r.limit??20,cursor:e});return{items:t.items,nextKey:t.nextKey}});if(r.json){console.log(n({items:e}));return}if(e.length===0){console.log(`No notifications.`);return}o(e);return}let{items:u,nextKey:d}=await c.getNotifications(a,s,{...l,limit:r.limit,cursor:r.nextKey});if(r.json){console.log(n({items:u,nextKey:d}));return}if(u.length===0){console.log(`No notifications.`);return}o(u),d&&console.log(`Next page: --next-key ${d}`)}async function c(r){let{accessToken:i,workspaceId:a}=await t(),{count:o,capped:s}=await new e().getNotificationUnreadCount(i,a);if(r.json){console.log(n({count:o,capped:s??!1}));return}console.log(`${s?`${o}+`:o} unread`)}async function l(r,i){let{accessToken:a,workspaceId:o}=await t();if(await new e().markNotificationRead(a,o,r),i.json){console.log(n({id:r,read:!0}));return}console.log(`Marked notification read: ${r}`)}async function u(r){let{accessToken:i,workspaceId:a}=await t();if(await new e().markAllNotificationsRead(i,a),r.json){console.log(n({readAll:!0}));return}console.log(`Marked all notifications read.`)}export{s as listNotifications,u as markAllNotificationsRead,l as markNotificationRead,c as showUnreadCount};
10
+ import{C as e,p as t}from"./profile-storage-BPBUFvA6.js";import{t as n}from"./terminal-text-cBPBiP3x.js";import{r}from"./format-C0MI0rzh.js";import{t as i}from"./paginate-y3CJuqRW.js";function a(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function o(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(` ${a(t.rendered.body,100)}`);let n=r(t.createdAt);console.log(` ${n} · ${t.eventType} · ID: ${t.id}`),console.log(``)}}async function s(r){let{accessToken:a,workspaceId:s}=await t(),c=new e,l={tab:r.tab,eventType:r.eventType};if(r.all){let e=await i(async e=>{let t=await c.getNotifications(a,s,{...l,limit:r.limit??20,cursor:e});return{items:t.items,nextKey:t.nextKey}});if(r.json){console.log(n({items:e}));return}if(e.length===0){console.log(`No notifications.`);return}o(e);return}let{items:u,nextKey:d}=await c.getNotifications(a,s,{...l,limit:r.limit,cursor:r.nextKey});if(r.json){console.log(n({items:u,nextKey:d}));return}if(u.length===0){console.log(`No notifications.`);return}o(u),d&&console.log(`Next page: --next-key ${d}`)}async function c(r){let{accessToken:i,workspaceId:a}=await t(),{count:o,capped:s}=await new e().getNotificationUnreadCount(i,a);if(r.json){console.log(n({count:o,capped:s??!1}));return}console.log(`${s?`${o}+`:o} unread`)}async function l(r,i){let{accessToken:a,workspaceId:o}=await t();if(await new e().markNotificationRead(a,o,r),i.json){console.log(n({id:r,read:!0}));return}console.log(`Marked notification read: ${r}`)}async function u(r){let{accessToken:i,workspaceId:a}=await t();if(await new e().markAllNotificationsRead(i,a),r.json){console.log(n({readAll:!0}));return}console.log(`Marked all notifications read.`)}export{s as listNotifications,u as markAllNotificationsRead,l as markNotificationRead,c as showUnreadCount};
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{r as e}from"./profile-storage--QCh_u_Q.js";async function t(t){let n=[],r;for(let i=0;;i++){if(i>=100)throw new e(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`);let a=await t(r);if(n.push(...a.items),r=a.nextKey,!r)return n}}export{t};
10
+ import{r as e}from"./profile-storage-BPBUFvA6.js";async function t(t){let n=[],r;for(let i=0;;i++){if(i>=100)throw new e(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`);let a=await t(r);if(n.push(...a.items),r=a.nextKey,!r)return n}}export{t};
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
7
7
  );
8
8
  process.exit(1);
9
9
  }
10
- import{I as e}from"./profile-storage--QCh_u_Q.js";import t from"node:fs";import n from"node:os";import r from"node:path";import{windowsReservedNameRegex as i}from"filename-reserved-regex";const a=`.entrydesk`;function o(){return{version:1,skills:{}}}function s(e){return r.join(e,a,`skills-lock.json`)}function c(e){try{let n=JSON.parse(t.readFileSync(s(e),`utf8`));return n.version!==1||typeof n.skills!=`object`||n.skills===null?o():n}catch{return o()}}function l(e,n){let i={};for(let e of Object.keys(n.skills).toSorted()){let t=n.skills[e];t&&(i[e]=t)}let a={version:1,...n.workspaceId?{workspaceId:n.workspaceId}:{},skills:i},o=s(e);t.mkdirSync(r.dirname(o),{recursive:!0}),t.writeFileSync(o,`${JSON.stringify(a,null,2)}\n`,`utf8`)}function u(e,t){return c(e).skills[t]}function d(e,t,n){let r=c(e);r.skills[t]=n,l(e,r)}function f(e,t){let n=c(e);if(!(t in n.skills))return!1;let{[t]:r,...i}=n.skills;return l(e,{...n,skills:i}),!0}function p(e){try{let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.workspaceId!=`string`||n.workspaceId===``?void 0:n}catch{return}}function m(e,n){t.mkdirSync(r.dirname(e),{recursive:!0}),t.writeFileSync(e,`${JSON.stringify(n,null,2)}\n`,`utf8`)}function h(e){return t.existsSync(e)?(t.rmSync(e),!0):!1}function g(e){return r.join(e,a,`project.json`)}function _(){return r.join(n.homedir(),a,`global-link.json`)}function v(){return p(_())}function y(e){m(_(),e)}function b(){return h(_())}function x(e=process.cwd()){let n=r.resolve(e);for(;;){if(t.existsSync(g(n)))return n;let e=r.dirname(n);if(e===n)return;n=e}}function S(e){return p(g(e))}function C(e,t){m(g(e),t)}function w(e){return h(g(e))}function T(e=process.cwd()){let t=x(e);if(!t)return;let n=S(t);return n?{rootDir:t,link:n}:void 0}async function E(t){let n=await 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 D(){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.`)}async function O(e,t){if(e){let e=n.homedir(),r=v();return r?(await E(r.apiUrl),{rootDir:e,workspaceId:r.workspaceId,linked:!0}):{rootDir:e,workspaceId:t,linked:!1}}let r=T(process.cwd());return r?(await E(r.link.apiUrl),{rootDir:r.rootDir,workspaceId:r.link.workspaceId,linked:!0}):{rootDir:process.cwd(),workspaceId:t,linked:!1}}const k=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function A(e){if(!k.test(e))throw Error(`Invalid skill name "${e}": must be lowercase letters, digits and single hyphens (e.g. "my-skill").`)}function j(e,t){A(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}function M(e,t){let n=j(e,t);if(i().test(t))throw Error(`Invalid skill name "${t}": reserved as a device name on Windows.`);return n}function N(e,t){return process.platform!==`win32`&&u(e,t)!==void 0?j(e,t):M(e,t)}export{D as a,g as c,y as d,C as f,d as g,f as h,O as i,b as l,c as m,j as n,x as o,u as p,N as r,_ as s,A as t,w as u};
10
+ import{L as e}from"./profile-storage-BPBUFvA6.js";import t from"node:fs";import n from"node:os";import r from"node:path";import{windowsReservedNameRegex as i}from"filename-reserved-regex";const a=`.entrydesk`;function o(){return{version:1,skills:{}}}function s(e){return r.join(e,a,`skills-lock.json`)}function c(e){try{let n=JSON.parse(t.readFileSync(s(e),`utf8`));return n.version!==1||typeof n.skills!=`object`||n.skills===null?o():n}catch{return o()}}function l(e,n){let i={};for(let e of Object.keys(n.skills).toSorted()){let t=n.skills[e];t&&(i[e]=t)}let a={version:1,...n.workspaceId?{workspaceId:n.workspaceId}:{},skills:i},o=s(e);t.mkdirSync(r.dirname(o),{recursive:!0}),t.writeFileSync(o,`${JSON.stringify(a,null,2)}\n`,`utf8`)}function u(e,t){return c(e).skills[t]}function d(e,t,n){let r=c(e);r.skills[t]=n,l(e,r)}function f(e,t){let n=c(e);if(!(t in n.skills))return!1;let{[t]:r,...i}=n.skills;return l(e,{...n,skills:i}),!0}function p(e){try{let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.workspaceId!=`string`||n.workspaceId===``?void 0:n}catch{return}}function m(e,n){t.mkdirSync(r.dirname(e),{recursive:!0}),t.writeFileSync(e,`${JSON.stringify(n,null,2)}\n`,`utf8`)}function h(e){return t.existsSync(e)?(t.rmSync(e),!0):!1}function g(e){return r.join(e,a,`project.json`)}function _(){return r.join(n.homedir(),a,`global-link.json`)}function v(){return p(_())}function y(e){m(_(),e)}function b(){return h(_())}function x(e=process.cwd()){let n=r.resolve(e);for(;;){if(t.existsSync(g(n)))return n;let e=r.dirname(n);if(e===n)return;n=e}}function S(e){return p(g(e))}function C(e,t){m(g(e),t)}function w(e){return h(g(e))}function T(e=process.cwd()){let t=x(e);if(!t)return;let n=S(t);return n?{rootDir:t,link:n}:void 0}async function E(t){let n=await 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 D(){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.`)}async function O(e,t){if(e){let e=n.homedir(),r=v();return r?(await E(r.apiUrl),{rootDir:e,workspaceId:r.workspaceId,linked:!0}):{rootDir:e,workspaceId:t,linked:!1}}let r=T(process.cwd());return r?(await E(r.link.apiUrl),{rootDir:r.rootDir,workspaceId:r.link.workspaceId,linked:!0}):{rootDir:process.cwd(),workspaceId:t,linked:!1}}const k=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function A(e){if(!k.test(e))throw Error(`Invalid skill name "${e}": must be lowercase letters, digits and single hyphens (e.g. "my-skill").`)}function j(e,t){A(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}function M(e,t){let n=j(e,t);if(i().test(t))throw Error(`Invalid skill name "${t}": reserved as a device name on Windows.`);return n}function N(e,t){return process.platform!==`win32`&&u(e,t)!==void 0?j(e,t):M(e,t)}export{D as a,g as c,y as d,C as f,d as g,f as h,O as i,b as l,c as m,j as n,x as o,u as p,N as r,_ as s,A as t,w as u};
@@ -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{B as e,D as t,V as n,r,t as i}from"./profile-storage-BPBUFvA6.js";import{t as a}from"./terminal-text-cBPBiP3x.js";function o(e,t){let n=e??t.profile;if(n)return n;let a=i.getProfileNames(),[o]=a;if(a.length===1&&o!==void 0)return o;throw new r(`Profile name is required when multiple profiles exist.`)}function s(e,t){let r=n(e,t);r&&console.error(r)}function c(e){let t=i.getCurrentProfileName(),n=i.getProfileNames();if(e.json){console.log(a({currentProfile:t,profiles:n.map(e=>({name:e,isCurrent:e===t}))}));return}console.log(`Profiles (${n.length}):`);for(let e of n)console.log(` ${e}${e===t?` (current)`:``}`)}function l(e){let t=i.getCurrentProfileName();if(e.json){console.log(a({name:t,isCurrent:!0}));return}console.log(`Current profile: ${t}`)}async function u(n,r){let s=o(n,r),c=e.getAll(s),l=await t.getAll(s),u=!!l?.accessToken,d=s===i.getCurrentProfileName();if(r.json){console.log(a({name:s,isCurrent:d,config:c,auth:u?{loggedIn:!0,email:l?.email??null,workspaceId:l?.workspaceId??null}:{loggedIn:!1}}));return}console.log(`Profile: ${s}${d?` (current)`:``}`),console.log(` API URL: ${c.apiUrl??`default`}`),console.log(` Hub URL: ${c.hubUrl??`default`}`),console.log(` Model: ${c.model?.default??`unset`}`);let f=c.connectors?.defaults&&c.connectors.defaults.length>0?c.connectors.defaults.join(`, `):`unset`;console.log(` Connectors: ${f}`),console.log(u?` Logged in as: ${l?.email??`unknown`}`:` Not logged in`),u&&l?.workspaceId&&console.log(` Workspace ID: ${l.workspaceId}`)}async function d(t,n){let r=t??n.profile??i.DEFAULT_PROFILE,o=n.use??!0,c={...n.apiUrl&&{apiUrl:n.apiUrl},...n.hubUrl&&{hubUrl:n.hubUrl}};i.createProfile(r),e.setAll(c,r),c.apiUrl&&s(`apiUrl`,c.apiUrl),o&&i.setCurrentProfile(r);let l={name:r,created:!0,current:o,config:c};if(n.json||(console.log(`Profile created: ${r}${o?` (current)`:``}`),c.apiUrl&&console.log(` API URL: ${c.apiUrl}`),c.hubUrl&&console.log(` Hub URL: ${c.hubUrl}`)),!n.login){n.json&&console.log(a(l));return}i.setOverrideProfile(r);let{performLogin:u,printLoginResult:d}=await import(`./login-BJK-C-yF.js`),f=await u(n);n.json?console.log(a({...l,login:f})):d(f,n)}function f(e,t){let n=o(e,t);if(i.setCurrentProfile(n),t.json){console.log(a({name:n,current:!0}));return}console.log(`Switched to profile: ${n}`)}async function p(e,n){let r=o(e,n),s=i.deleteProfile(r);if(await t.deleteProfileCredentials(r),n.json){console.log(a({deleted:r,currentProfile:s.currentProfile}));return}console.log(`Profile deleted: ${r}`),console.log(`Current profile: ${s.currentProfile}`)}async function m(e,n,r){let o=i.renameProfile(e,n);if(await t.moveProfileCredentials(e,n),r.json){console.log(a({renamed:e,name:n,currentProfile:o.currentProfile}));return}console.log(`Profile renamed: ${e} -> ${n}`),console.log(`Current profile: ${o.currentProfile}`)}async function h(n,r,o){let s=e.getAll(n);if(i.createProfile(r),e.setAll(s,r),await t.clear(r),o.json){console.log(a({source:n,name:r,cloned:!0}));return}console.log(`Profile cloned: ${n} -> ${r}`)}function g(t,n){let r=i.getEffectiveProfileName(n.profile),o=e.get(t,r);if(n.json){console.log(a({profile:r,[t]:o??null}));return}console.log(o||`Not set`)}function _(t,n,r){let a=i.getEffectiveProfileName(r.profile);e.set(t,n,a),console.log(`Set ${t}=${n}`),console.error(`(profile: ${a})`),s(t,n)}function v(t,n){let r=i.getEffectiveProfileName(n.profile);e.unset(t,r),console.log(`Unset ${t}`),console.error(`(profile: ${r})`)}export{h as cloneProfile,d as createProfile,p as deleteProfile,g as getProfileValue,c as listProfiles,m as renameProfile,_ as setProfileValue,l as showCurrentProfile,u as showProfile,v as unsetProfileValue,f as useProfile};