@entrydesk/cli 1.11.19 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/{agents-6SL2CJJJ.js → agents-YIPPGKPY.js} +1 -1
- package/dist/{budget-XMLYDL5J.js → budget-ZZG44RXO.js} +1 -1
- package/dist/{chunk-6AL7OBSG.js → chunk-HHCG7UQG.js} +1 -1
- package/dist/{config-FLAGIMCN.js → config-CTC4CBIG.js} +1 -1
- package/dist/{config-ASV5NL7Z.js → config-JU3KJETZ.js} +1 -1
- package/dist/config-help-HHCW7XFB.js +2 -0
- package/dist/{connectors-CWI5IVDN.js → connectors-ZGWBL6TL.js} +1 -1
- package/dist/{help-Z5YLPTUZ.js → help-NESOCXU4.js} +31 -31
- package/dist/index.js +1 -1
- package/dist/{login-JXFYDARD.js → login-FVBYXP32.js} +1 -1
- package/dist/{logout-Q55UDAOR.js → logout-PNYLTJQN.js} +1 -1
- package/dist/{mcp-3EUOE6DQ.js → mcp-DC7H7XHP.js} +1 -1
- package/dist/{models-3XO5UL2T.js → models-W6IJTX2A.js} +1 -1
- package/dist/{profile-37GMFZPS.js → profile-JOKK2XKJ.js} +1 -1
- package/dist/{schedules-TKPFSTIL.js → schedules-A6QPLBMI.js} +1 -1
- package/dist/{skills-CQFFZAZY.js → skills-OM2KB43P.js} +1 -1
- package/dist/{status-NIH542GP.js → status-QVELZ6DI.js} +1 -1
- package/dist/{chat-UGJ345HC.js → task-AMCTDHXH.js} +83 -83
- package/dist/tasks-BWEMFPPU.js +19 -0
- package/dist/{tool-I5NZCJP7.js → tool-VDBXLXT4.js} +5 -5
- package/dist/{usage-FKKIXVFK.js → usage-TGX24GRZ.js} +1 -1
- package/dist/version-IQPTL53K.js +2 -0
- package/dist/{workspaces-QJAHQQ2L.js → workspaces-ZAQAF3RJ.js} +1 -1
- package/package.json +1 -1
- package/dist/chats-O7AN67QW.js +0 -19
- package/dist/config-help-W3HXZ7F6.js +0 -2
- package/dist/version-6NQBVGVC.js +0 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as A,n as I,o as b,q as O}from"./chunk-HHCG7UQG.js";var $="\x1B[2m",a="\x1B[0m",d="\x1B[36m",w="\x1B[33m",R="\x1B[32m",v="stream-json";function f(e,s){let o=s===void 0?{event:e}:{event:e,data:s};process.stdout.write(`${JSON.stringify(o)}
|
|
3
|
+
`)}function S(e){let s=new Date(e),t=new Date().getTime()-s.getTime(),n=Math.floor(t/(1e3*60*60*24));return n===0?s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):n===1?"Yesterday":n<7?`${n} days ago`:s.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function y(e,s){if(s)return e;let o=e.split(`
|
|
4
|
+
`);if(o.length<=15)return e;let t=o.slice(0,6),n=o.slice(-4),i=o.length-10;return[...t,`... (${i} lines omitted, use --full-output to see all) ...`,...n].join(`
|
|
5
|
+
`)}function N(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(N);let s={};for(let[o,t]of Object.entries(e))typeof t=="string"&&t.length>200?s[o]=t.slice(0,150)+"... (truncated)":typeof t=="object"&&t!==null?s[o]=N(t):s[o]=t;return s}function j(e){if(!e||typeof e!="object")return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function E(e,s){if(!e)return"(no result)";if(typeof e!="object")return y(String(e),s);let o=s?e:N(e);if("structuredContent"in o&&o.structuredContent){let t=o.structuredContent,n=[];if(t.stdout&&typeof t.stdout=="string"&&t.stdout.trim()&&n.push(t.stdout.trim()),t.stderr&&typeof t.stderr=="string"&&t.stderr.trim()&&n.push(`${w}[stderr]${a} ${t.stderr.trim()}`),t.urls&&Array.isArray(t.urls)){let i=t.urls;for(let r of i)r.path&&r.url&&n.push(`${r.path}: ${r.url}`)}return n.length===0&&n.push(JSON.stringify(t,null,2)),y(n.join(`
|
|
6
|
+
`),s)}if("content"in o&&Array.isArray(o.content)){let n=o.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
|
|
7
|
+
`);return y(n||JSON.stringify(e,null,2),s)}return y(JSON.stringify(e,null,2),s)}function L(e){if(typeof e.title=="string")return e.title;if(typeof e.toolName=="string")return e.toolName;let s=e.type;return s.startsWith("tool-")?s.slice(5).replace(/__/g," ").replace(/_/g," "):s}function J(e,s){let o=[];for(let t of e)if(t.type==="reasoning"&&t.text)o.push(`${$}${t.text}${a}`);else if(t.type==="text"&&t.text)o.push(t.text);else if(t.type==="tool-call"&&t.toolName){let n=[];if(n.push(`${d}\u250C\u2500 Tool Call: ${t.toolName}${a}`),t.args){n.push(`${w}\u2502 Arguments:${a}`);let i=j(t.args);for(let r of i.split(`
|
|
8
|
+
`))n.push(`${$}\u2502 ${r}${a}`)}if(t.result!==void 0){n.push(`${R}\u2502 Result:${a}`);let i=E(t.result,s);for(let r of i.split(`
|
|
9
|
+
`))n.push(`${$}\u2502 ${r}${a}`);n.push(`${d}\u2514\u2500 ${t.toolName} completed${a}`)}else t.state==="call"?n.push(`${d}\u2514\u2500 (awaiting result)${a}`):n.push(`${d}\u2514\u2500${a}`);o.push(n.join(`
|
|
10
|
+
`))}else if(t.type.startsWith("tool-")&&t.type!=="tool-call"){let n=L(t),i=[];if(i.push(`${d}\u250C\u2500 Tool: ${n}${a}`),t.input){i.push(`${w}\u2502 Input:${a}`);let r=j(t.input);for(let l of r.split(`
|
|
11
|
+
`))i.push(`${$}\u2502 ${l}${a}`)}if(t.output!==void 0&&t.state==="output-available"){i.push(`${R}\u2502 Output:${a}`);let r=E(t.output,s);for(let l of r.split(`
|
|
12
|
+
`))i.push(`${$}\u2502 ${l}${a}`);i.push(`${d}\u2514\u2500 completed${a}`)}else t.state==="call"||t.state==="partial-call"?i.push(`${d}\u2514\u2500 (in progress)${a}`):i.push(`${d}\u2514\u2500${a}`);o.push(i.join(`
|
|
13
|
+
`))}return o.join(`
|
|
14
|
+
|
|
15
|
+
`).trim()}async function U(e){let s=e.output===v;e.output&&!s&&(console.error(`Invalid --output value. Supported: ${v}`),process.exit(1));let o=new A;if(e.shareId){let r;try{r=await I()}catch{}try{let l=await o.getSharedTask(e.shareId,r),{messages:c}=await o.getSharedMessages(e.shareId,50,r);if(e.json){console.log(JSON.stringify({task:l,messages:c}));return}if(s){if(f("task",l),c.length===0)f("info","No messages in this shared task.");else for(let u of c.toReversed())f("message",u);f("done");return}if(console.log(`Shared Task: ${l.title||"Untitled"}`),console.log(`Visibility: ${l.visibility}`),l.agent&&console.log(`Agent: ${l.agent.name}`),console.log(`${c.length} messages
|
|
16
|
+
`),c.length===0){console.log("No messages in this shared task.");return}let p=c.toReversed(),x=e.fullOutput??!1;for(let u of p){let k=J(u.parts,x);if(!k)continue;let T=u.role==="user"?"You":"Assistant";console.log(`[${T}] ${S(u.createdAt)}`),console.log(k),console.log("")}return}catch(l){if(l instanceof Error){let c=l.message.toLowerCase();c.includes("401")||c.includes("unauthorized")?console.error("Access denied. This shared task requires authentication or is not accessible to you."):c.includes("404")||c.includes("not found")?console.error("Shared task not found. The share ID may be invalid or the task was deleted."):console.error(`Failed to fetch shared task: ${l.message}`)}else console.error("Failed to fetch shared task");process.exit(1)}}let t,n;try{let r=await b();t=r.accessToken,n=r.workspaceId}catch(r){O(r)}if(e.taskId){let r=e.taskId,l=!1,c=null,p=parseInt(e.taskId,10);if(!isNaN(p)&&p>=0&&/^\d+$/.test(e.taskId)){let g=p===0?1:p,{tasks:h}=await o.getTasks(t,n,20);g>h.length&&(console.error(`Task number ${g} not found. You have ${h.length} recent tasks.`),process.exit(1));let m=h[g-1];r=m.id,l=!0,c=m,s||console.log(`Task: ${m.title||"Untitled"}
|
|
17
|
+
`)}let{messages:u}=await o.getMessages(t,n,r,50);if(e.json){console.log(JSON.stringify(u));return}if(s){if(c&&f("task",c),u.length===0)f("info","No messages in this task.");else for(let g of u.toReversed())f("message",g);f("done");return}if(u.length===0){console.log("No messages in this task.");return}let k=u.toReversed(),T=e.fullOutput??!1;l||console.log(`Task: ${e.taskId.slice(0,8)}...`),console.log(`${u.length} messages
|
|
18
|
+
`);for(let g of k){let h=J(g.parts,T);if(!h)continue;let m=g.role==="user"?"You":"Assistant";console.log(`[${m}] ${S(g.createdAt)}`),console.log(h),console.log("")}return}let{tasks:i}=await o.getTasks(t,n,20);if(s){for(let r of i)f("task",r);f("done");return}if(e.json){console.log(JSON.stringify(i));return}if(i.length===0){console.log("No tasks found.");return}console.log(`Recent Tasks (${i.length}):
|
|
19
|
+
`),i.forEach((r,l)=>{let c=(l+1).toString().padStart(2," ");console.log(` ${c}. ${S(r.createdAt).padEnd(12)} ${r.title||"Untitled"}`)}),console.log(""),console.log("Use `entrydesk tasks 1` to view the most recent task"),console.log('Use `entrydesk task -c 1 -m "message"` to continue it')}export{U as runTasks};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as S,o as _}from"./chunk-
|
|
2
|
+
import{c as S,o as _}from"./chunk-HHCG7UQG.js";import B from"fs";import{Client as L}from"@modelcontextprotocol/sdk/client/index.js";import{StreamableHTTPClientTransport as x}from"@modelcontextprotocol/sdk/client/streamableHttp.js";async function A(e={}){let t=e.apiUrl,n=e.accessToken,o=e.workspaceId;if(!n||!o){let l=await _();n=n||l.accessToken,o=o||l.workspaceId}t||(t=S().apiUrl);let i=new L({name:"entrydesk-cli",version:"1.0.0"}),s=new URL(`${t}/v1/workspaces/${o}/mcp`),r=new x(s,{requestInit:{headers:{Authorization:`Bearer ${n}`}}});return await i.connect(r),i}async function T(){return A()}import h from"fs/promises";import v from"os";import d from"path";var y=!process.env.NO_COLOR&&!!process.stdout.isTTY,p={green:y?"\x1B[32m":"",yellow:y?"\x1B[33m":"",reset:y?"\x1B[0m":""},D=10*1024,O=8*1024,I=2*1024,P=100,b=100;function M(){return d.join(v.homedir(),".entrydesk","tool-results")}function F(e){let t=e.trim().replace(/[/\\:*?"<>|\s]/g,"_").replace(/_+/g,"_").replace(/^[._]+|[._]+$/g,"").slice(0,P);return!t||t==="."||t===".."?"unnamed_tool":t}function J(e){try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}n`:typeof n=="function"?"[Function]":typeof n=="symbol"?n.toString():n,2)}catch{return String(e)}}function U(e){let t=new Date,n=[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("-"),o=F(e);return`${n}_${o}.json`}async function N(e,t){try{return await h.writeFile(e,t,{encoding:"utf8",flag:"wx"}),!0}catch(n){if(n instanceof Error&&"code"in n&&n.code==="EEXIST")return!1;throw n}}async function C(e,t){try{let n=M();await h.mkdir(n,{recursive:!0});let o=U(e),i=d.extname(o),s=o.slice(0,-i.length),r=J(t),l=d.join(n,o);if(await N(l,r))return l;for(let c=1;c<=b;c++){let w=d.join(n,`${s}-${c}${i}`);if(await N(w,r))return w}let u=Math.random().toString(36).slice(2,10),a=d.join(n,`${s}-${u}${i}`);return await h.writeFile(a,r,{encoding:"utf8",flag:"wx"}),a}catch(n){let o=n instanceof Error?n.message:"unknown error";return console.error(`${p.yellow}Warning: Could not save result to file: ${o}${p.reset}`),null}}function k(e,t){let n=Buffer.byteLength(e,"utf8");if(n<=D)return e;let o=e.slice(0,O),i=e.slice(-I),r=((n-O-I)/1024).toFixed(1),l=(n/1024).toFixed(1),u=` ... (skipped ${r}KB of ${l}KB) ...`;return t&&(u+=`
|
|
3
3
|
Tip: jq -r '.structuredContent.field' <file> | grep/head/tail`),`${o}
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${u}
|
|
6
6
|
|
|
7
|
-
${
|
|
7
|
+
${i}`}function $(e){console.log(`${p.green}Tool execution result saved to: ${e}${p.reset}`),console.log()}function E(){console.log(`${p.green}Tool execution result:${p.reset}`)}function R(e){return e.split("__")[0]??e}function f(e,t,n){console.error(n?JSON.stringify({error:{code:e,message:t}}):`Error [${e}]: ${t}`),process.exit(1)}function g(e,t,n="CONNECTION_FAILED"){let o=e instanceof Error?e.message:"Unknown error";o.includes("Not logged in")||o.includes("not-logged-in")?f("AUTH_MISSING",o,t):f(n,o,t)}async function H(){return process.stdin.isTTY?null:new Promise(e=>{let t=[],n=!1,o=!1,i,s,r,l,u=()=>{clearTimeout(i),process.stdin.removeListener("data",s),process.stdin.removeListener("end",r),process.stdin.removeListener("error",l)},a=c=>{o||(o=!0,u(),e(c))};s=c=>{n=!0,clearTimeout(i),t.push(c)},r=()=>{t.length===0?a(null):a(Buffer.concat(t).toString("utf-8").trim())},l=()=>{a(null)},i=setTimeout(()=>{n||a(null)},100),process.stdin.on("data",s),process.stdin.on("end",r),process.stdin.on("error",l),process.stdin.resume()})}var m=class extends Error{constructor(t){super(t),this.name="InputError"}};async function Y(e,t){if(e)return e;if(t)try{return B.readFileSync(t,"utf-8").trim()}catch(o){let i=o instanceof Error?o.message:"Failed to read input file";throw new m(`Failed to read input file: ${i}`)}let n=await H();if(n)return n;throw new m("Input JSON is required. Use --input, --input-file, or pipe via stdin")}function V(e){let t=[];return t.push(`Tool: ${e.name}`),e.description&&t.push(` Description: ${e.description}`),t.join(`
|
|
8
8
|
`)}function q(e){let t=[];return t.push(`Tool: ${e.name}`),e.description&&(t.push("Description:"),t.push(` ${e.description}`)),t.push("Input Schema:"),t.push(JSON.stringify(e.inputSchema,null,2)),t.join(`
|
|
9
|
-
`)}async function X(e,t){let n=await T().catch(o=>{g(o,e)});try{let
|
|
10
|
-
`);for(let r of
|
|
9
|
+
`)}async function X(e,t){let n=await T().catch(o=>{g(o,e)});try{let i=(await n.listTools()).tools;if(t){let s=t.toLowerCase();i=i.filter(r=>R(r.name).toLowerCase().startsWith(s))}if(e)console.log(JSON.stringify(i,null,2));else{let s=t?` (prefix: ${t})`:"";console.log(`Available Tools (${i.length})${s}:
|
|
10
|
+
`);for(let r of i)console.log(V(r)),console.log()}}catch(o){g(o,e)}finally{await n.close().catch(()=>{})}}async function z(e,t){let n=await T().catch(o=>{g(o,t)});try{let i=(await n.listTools()).tools.find(s=>s.name===e);i||f("TOOL_NOT_FOUND",`Tool not found: ${e}`,t),console.log(t?JSON.stringify(i,null,2):q(i))}catch(o){g(o,t)}finally{await n.close().catch(()=>{})}}async function G(e,t,n){let o;try{o=JSON.parse(t)}catch(r){let l=r instanceof Error?`Invalid JSON input: ${r.message}`:"Invalid JSON input";f("INVALID_INPUT",l,n)}let i=await T().catch(r=>{g(r,n,"TOOL_CALL_FAILED")}),s=!1;try{let r=await i.callTool({name:e,arguments:o});if(n)console.log(JSON.stringify(r,null,2));else{let l=await C(e,r);l&&$(l),E();let u=r.content;for(let a of u)a.type==="text"?console.log(a.text):a.type==="image"?console.log(`[Image: ${a.mimeType}]`):a.type==="resource"?console.log(`[Resource: ${a.resource?.uri??"unknown"}]`):console.log(JSON.stringify(a,null,2));if(r.structuredContent){let a=JSON.stringify(r.structuredContent,null,2),c=k(a,l);console.log(c)}}r.isError&&(s=!0)}catch(r){g(r,n,"TOOL_CALL_FAILED")}finally{await i.close().catch(()=>{})}s&&process.exit(1)}async function lt(e){let t=e.json??!1;switch(e.action){case"list":await X(t,e.prefix);break;case"get":e.name||f("INVALID_INPUT","Tool name is required",t),await z(e.name,t);break;case"call":{e.name||f("INVALID_INPUT","Tool name is required",t);let n;try{n=await Y(e.input,e.inputFile)}catch(o){throw o instanceof m&&f("INVALID_INPUT",o.message,t),o}await G(e.name,n,t);break}default:console.log(`Usage: entrydesk tool <action> [options]
|
|
11
11
|
|
|
12
12
|
Actions:
|
|
13
13
|
list List all available tools
|
package/package.json
CHANGED
package/dist/chats-O7AN67QW.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as I,n as k,o as T,q as b}from"./chunk-6AL7OBSG.js";var $="\x1B[2m",l="\x1B[0m",g="\x1B[36m",x="\x1B[33m",O="\x1B[32m",R="stream-json";function f(e,n){let o=n===void 0?{event:e}:{event:e,data:n};process.stdout.write(`${JSON.stringify(o)}
|
|
3
|
-
`)}function N(e){let n=new Date(e),t=new Date().getTime()-n.getTime(),s=Math.floor(t/(1e3*60*60*24));return s===0?n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):s===1?"Yesterday":s<7?`${s} days ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function S(e,n){if(n)return e;let o=e.split(`
|
|
4
|
-
`);if(o.length<=15)return e;let t=o.slice(0,6),s=o.slice(-4),i=o.length-10;return[...t,`... (${i} lines omitted, use --full-output to see all) ...`,...s].join(`
|
|
5
|
-
`)}function C(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(C);let n={};for(let[o,t]of Object.entries(e))typeof t=="string"&&t.length>200?n[o]=t.slice(0,150)+"... (truncated)":typeof t=="object"&&t!==null?n[o]=C(t):n[o]=t;return n}function v(e){if(!e||typeof e!="object")return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function j(e,n){if(!e)return"(no result)";if(typeof e!="object")return S(String(e),n);let o=n?e:C(e);if("structuredContent"in o&&o.structuredContent){let t=o.structuredContent,s=[];if(t.stdout&&typeof t.stdout=="string"&&t.stdout.trim()&&s.push(t.stdout.trim()),t.stderr&&typeof t.stderr=="string"&&t.stderr.trim()&&s.push(`${x}[stderr]${l} ${t.stderr.trim()}`),t.urls&&Array.isArray(t.urls)){let i=t.urls;for(let r of i)r.path&&r.url&&s.push(`${r.path}: ${r.url}`)}return s.length===0&&s.push(JSON.stringify(t,null,2)),S(s.join(`
|
|
6
|
-
`),n)}if("content"in o&&Array.isArray(o.content)){let s=o.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
|
|
7
|
-
`);return S(s||JSON.stringify(e,null,2),n)}return S(JSON.stringify(e,null,2),n)}function J(e){if(typeof e.title=="string")return e.title;if(typeof e.toolName=="string")return e.toolName;let n=e.type;return n.startsWith("tool-")?n.slice(5).replace(/__/g," ").replace(/_/g," "):n}function E(e,n){let o=[];for(let t of e)if(t.type==="reasoning"&&t.text)o.push(`${$}${t.text}${l}`);else if(t.type==="text"&&t.text)o.push(t.text);else if(t.type==="tool-call"&&t.toolName){let s=[];if(s.push(`${g}\u250C\u2500 Tool Call: ${t.toolName}${l}`),t.args){s.push(`${x}\u2502 Arguments:${l}`);let i=v(t.args);for(let r of i.split(`
|
|
8
|
-
`))s.push(`${$}\u2502 ${r}${l}`)}if(t.result!==void 0){s.push(`${O}\u2502 Result:${l}`);let i=j(t.result,n);for(let r of i.split(`
|
|
9
|
-
`))s.push(`${$}\u2502 ${r}${l}`);s.push(`${g}\u2514\u2500 ${t.toolName} completed${l}`)}else t.state==="call"?s.push(`${g}\u2514\u2500 (awaiting result)${l}`):s.push(`${g}\u2514\u2500${l}`);o.push(s.join(`
|
|
10
|
-
`))}else if(t.type.startsWith("tool-")&&t.type!=="tool-call"){let s=J(t),i=[];if(i.push(`${g}\u250C\u2500 Tool: ${s}${l}`),t.input){i.push(`${x}\u2502 Input:${l}`);let r=v(t.input);for(let c of r.split(`
|
|
11
|
-
`))i.push(`${$}\u2502 ${c}${l}`)}if(t.output!==void 0&&t.state==="output-available"){i.push(`${O}\u2502 Output:${l}`);let r=j(t.output,n);for(let c of r.split(`
|
|
12
|
-
`))i.push(`${$}\u2502 ${c}${l}`);i.push(`${g}\u2514\u2500 completed${l}`)}else t.state==="call"||t.state==="partial-call"?i.push(`${g}\u2514\u2500 (in progress)${l}`):i.push(`${g}\u2514\u2500${l}`);o.push(i.join(`
|
|
13
|
-
`))}return o.join(`
|
|
14
|
-
|
|
15
|
-
`).trim()}async function U(e){let n=e.output===R;e.output&&!n&&(console.error(`Invalid --output value. Supported: ${R}`),process.exit(1));let o=new I;if(e.shareId){let r;try{r=await k()}catch{}try{let c=await o.getSharedChat(e.shareId,r),{messages:a}=await o.getSharedMessages(e.shareId,50,r);if(e.json){console.log(JSON.stringify({chat:c,messages:a}));return}if(n){if(f("chat",c),a.length===0)f("info","No messages in this shared chat.");else for(let u of a.toReversed())f("message",u);f("done");return}if(console.log(`Shared Chat: ${c.title||"Untitled"}`),console.log(`Visibility: ${c.visibility}`),c.agent&&console.log(`Agent: ${c.agent.name}`),console.log(`${a.length} messages
|
|
16
|
-
`),a.length===0){console.log("No messages in this shared chat.");return}let d=a.toReversed(),A=e.fullOutput??!1;for(let u of d){let y=E(u.parts,A);if(!y)continue;let w=u.role==="user"?"You":"Assistant";console.log(`[${w}] ${N(u.createdAt)}`),console.log(y),console.log("")}return}catch(c){if(c instanceof Error){let a=c.message.toLowerCase();a.includes("401")||a.includes("unauthorized")?console.error("Access denied. This shared chat requires authentication or is not accessible to you."):a.includes("404")||a.includes("not found")?console.error("Shared chat not found. The share ID may be invalid or the chat was deleted."):console.error(`Failed to fetch shared chat: ${c.message}`)}else console.error("Failed to fetch shared chat");process.exit(1)}}let t,s;try{let r=await T();t=r.accessToken,s=r.workspaceId}catch(r){b(r)}if(e.chatId){let r=e.chatId,c=!1,a=null,d=parseInt(e.chatId,10);if(!isNaN(d)&&d>=0&&/^\d+$/.test(e.chatId)){let h=d===0?1:d,{chats:p}=await o.getChats(t,s,20);h>p.length&&(console.error(`Chat number ${h} not found. You have ${p.length} recent chats.`),process.exit(1));let m=p[h-1];r=m.id,c=!0,a=m,n||console.log(`Chat: ${m.title||"Untitled"}
|
|
17
|
-
`)}let{messages:u}=await o.getMessages(t,s,r,50);if(e.json){console.log(JSON.stringify(u));return}if(n){if(a&&f("chat",a),u.length===0)f("info","No messages in this chat.");else for(let h of u.toReversed())f("message",h);f("done");return}if(u.length===0){console.log("No messages in this chat.");return}let y=u.toReversed(),w=e.fullOutput??!1;c||console.log(`Chat: ${e.chatId.slice(0,8)}...`),console.log(`${u.length} messages
|
|
18
|
-
`);for(let h of y){let p=E(h.parts,w);if(!p)continue;let m=h.role==="user"?"You":"Assistant";console.log(`[${m}] ${N(h.createdAt)}`),console.log(p),console.log("")}return}let{chats:i}=await o.getChats(t,s,20);if(n){for(let r of i)f("chat",r);f("done");return}if(e.json){console.log(JSON.stringify(i));return}if(i.length===0){console.log("No chats found.");return}console.log(`Recent Chats (${i.length}):
|
|
19
|
-
`),i.forEach((r,c)=>{let a=(c+1).toString().padStart(2," ");console.log(` ${a}. ${N(r.createdAt).padEnd(12)} ${r.title||"Untitled"}`)}),console.log(""),console.log("Use `entrydesk chats 1` to view the most recent chat"),console.log('Use `entrydesk chat -c 1 -m "message"` to continue it')}export{U as runChats};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{c as i}from"./chunk-6AL7OBSG.js";import{Box as r,Text as e,render as l}from"ink";import{jsx as t,jsxs as n}from"react/jsx-runtime";function g(){l(t(a,{}))}function a(){let o=i();return n(r,{flexDirection:"column",children:[t(e,{bold:!0,children:"entrydesk config"}),t(e,{children:" "}),t(e,{children:"Manage CLI configuration"}),t(e,{children:" "}),t(e,{bold:!0,children:"Usage:"}),t(e,{children:" entrydesk config List all configuration"}),n(e,{children:[" entrydesk config get ","<key>"," Get a configuration value"]}),n(e,{children:[" ","entrydesk config set ","<key>"," ","<value>"," Set a configuration value"]}),n(e,{children:[" ","entrydesk config unset ","<key>"," Remove a configuration value"]}),t(e,{children:" "}),t(e,{bold:!0,children:"Available keys:"}),n(e,{children:[" apiUrl API server URL (default: ",o.apiUrl,")"]}),n(e,{children:[" hubUrl Hub server URL (default: ",o.hubUrl,")"]}),t(e,{children:" "}),t(e,{bold:!0,children:"Examples:"}),t(e,{children:" entrydesk config set apiUrl http://localhost:3200"}),t(e,{children:" entrydesk config get apiUrl"}),t(e,{children:" entrydesk config unset apiUrl"})]})}export{g as renderConfigHelp};
|
package/dist/version-6NQBVGVC.js
DELETED