@entrydesk/cli 1.31.0 → 2.0.0-beta
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 +148 -9
- package/dist/add-Cu0kBobt.js +2 -0
- package/dist/agents--2Fw5-et.js +2 -0
- package/dist/billing-B96487c6.js +2 -0
- package/dist/budget-DhX2gt5z.js +2 -0
- package/dist/commands-C1wX8XQY.js +2 -0
- package/dist/commands-DbXuQqse.js +2 -0
- package/dist/config-eCQwQAt1.js +3 -0
- package/dist/confirm-BrJZbaxf.js +2 -0
- package/dist/connectors-DGmZ4zTG.js +3 -0
- package/dist/hash-Ddmw8YE4.js +2 -0
- package/dist/index.js +49 -1
- package/dist/installer-iaoPJQn3.js +2 -0
- package/dist/login-IvudGta0.js +2 -0
- package/dist/logout-Bjmk9YUh.js +2 -0
- package/dist/marketplace-BPY5cD0d.js +4 -0
- package/dist/mcp-client-Cr_sHGPw.js +2 -0
- package/dist/mcp-ydzvH8kz.js +3 -0
- package/dist/meeting-BDhBTbm3.js +3 -0
- package/dist/models-BFnezI1c.js +2 -0
- package/dist/notifications-4bo-vcIW.js +2 -0
- package/dist/paths-BAZ2NsXN.js +2 -0
- package/dist/profile-BZo9STO2.js +2 -0
- package/dist/profile-storage-mtd3aKrx.js +72 -0
- package/dist/push-Mb0Xb42_.js +2 -0
- package/dist/recordings-D9jnWpxs.js +3 -0
- package/dist/remote-nEFOyIM2.js +2 -0
- package/dist/remove-CJiRVixg.js +2 -0
- package/dist/rolldown-runtime-CIdiawuB.js +2 -0
- package/dist/schedules-BFoirR6r.js +21 -0
- package/dist/skills-DYS1EQMn.js +2 -0
- package/dist/status-BgIfKAmr.js +2 -0
- package/dist/status-DzGv21m4.js +2 -0
- package/dist/task-Db4UcJ6G.js +115 -0
- package/dist/tasks-Dd-GdHfu.js +14 -0
- package/dist/tool-B6W8erW6.js +5 -0
- package/dist/update-CYieYkZl.js +2 -0
- package/dist/usage-BLdNvuse.js +3 -0
- package/dist/version-Cos6L15W.js +2 -0
- package/dist/workflow-DlQtL_J-.js +6 -0
- package/dist/workspaces-IAJitqaO.js +3 -0
- package/package.json +14 -9
- package/dist/agents-PRK5LQNG.js +0 -43
- package/dist/billing-L6QQXRZW.js +0 -24
- package/dist/budget-NSNB4TFT.js +0 -12
- package/dist/chunk-FKRIIPBA.js +0 -2
- package/dist/chunk-JMYSCKCF.js +0 -2
- package/dist/chunk-UVF7TGFB.js +0 -120
- package/dist/chunk-YBS4DYFH.js +0 -2
- package/dist/config-2JH7KXGU.js +0 -4
- package/dist/config-help-ND4I4Y4D.js +0 -2
- package/dist/connectors-26E6RK7B.js +0 -39
- package/dist/help-KDHCFJNF.js +0 -4
- package/dist/login-WXXDXOHI.js +0 -2
- package/dist/logout-6S6KRPMB.js +0 -2
- package/dist/marketplace-WV4PKSWS.js +0 -38
- package/dist/mcp-2Q5DRF4P.js +0 -4
- package/dist/meeting-ZI2UOSO6.js +0 -68
- package/dist/models-TXYNHCLD.js +0 -3
- package/dist/notifications-5CD6KFTP.js +0 -28
- package/dist/profile-OMP7YDYA.js +0 -17
- package/dist/recordings-MLYXHDWH.js +0 -42
- package/dist/schedules-GIAYSDUE.js +0 -66
- package/dist/skills-IK7KZZ45.js +0 -30
- package/dist/status-OKGY6H3C.js +0 -2
- package/dist/task-XXJ5PAJF.js +0 -179
- package/dist/tasks-2TMKPOTB.js +0 -41
- package/dist/tool-HMD5ROEP.js +0 -35
- package/dist/update-DM47OUD3.js +0 -4
- package/dist/usage-TLLEU4K7.js +0 -29
- package/dist/version-USTE3KNX.js +0 -2
- package/dist/workflow-PRS2UCQT.js +0 -62
- package/dist/workspaces-HML7DEAL.js +0 -14
package/dist/chunk-YBS4DYFH.js
DELETED
package/dist/config-2JH7KXGU.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{v as a,w as t}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";var i=["apiUrl","hubUrl"];function c(o){return i.includes(o)}function u(o){try{let{pathname:n}=new URL(o);return n.replace(/\/+$/u,"").endsWith("/api")}catch{return!1}}async function $(o){let n=o.action||"list",e=o.configKey,r=o.value,l=a.getEffectiveProfileName();if(n==="list"){let s=t.getAll(),f=Object.entries(s);if(o.json){console.log(JSON.stringify(s));return}if(console.log(`Profile: ${l}`),f.length===0){console.log("No configuration set."),console.log(`Available keys: ${i.join(", ")}`);return}console.log(`Configuration:
|
|
3
|
-
`);for(let[g,y]of f)console.log(` ${g}=${y}`);console.log(`
|
|
4
|
-
Available keys: ${i.join(", ")}`);return}if(n==="get"){e||(console.error("Missing key. Usage: entrydesk config get <key>"),process.exit(1)),c(e)||(console.error(`Unknown key '${e}'. Valid keys: ${i.join(", ")}`),process.exit(1));let s=t.get(e);o.json?console.log(JSON.stringify({[e]:s??null})):console.log(s||"Not set");return}if(n==="set"){e||(console.error("Missing key. Usage: entrydesk config set <key> <value>"),process.exit(1)),c(e)||(console.error(`Unknown key '${e}'. Valid keys: ${i.join(", ")}`),process.exit(1)),r||(console.error("Missing value. Usage: entrydesk config set <key> <value>"),process.exit(1)),t.set(e,r),console.log(`Set ${e}=${r}`),console.error(`(profile: ${l})`),e==="apiUrl"&&u(r)&&console.error(`Warning: ${r} looks like a web app's "/api" browser proxy path. Such proxies usually strip the Authorization header, so CLI requests will fail with 401 missing_token \u2014 prefer the API server's own URL unless you know this proxy forwards Authorization.`);return}if(n==="unset"){e||(console.error("Missing key. Usage: entrydesk config unset <key>"),process.exit(1)),c(e)||(console.error(`Unknown key '${e}'. Valid keys: ${i.join(", ")}`),process.exit(1)),t.unset(e),console.log(`Unset ${e}`),console.error(`(profile: ${l})`);return}console.error(`Unknown config command: ${n}`),process.exit(1)}export{$ as runConfig};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{x as i}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.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 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"})]})}function g(){l(t(a,{}))}export{g as renderConfigHelp};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as p}from"./chunk-YBS4DYFH.js";import{C as a,P as d,T as u}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function f(){console.log(`
|
|
3
|
-
Usage: entrydesk connectors [list|tools|connect|disconnect] [options]
|
|
4
|
-
|
|
5
|
-
List connectors and manage your connection to them.
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
list List connected connectors (default)
|
|
9
|
-
tools <connectorId> List the tools a connector exposes
|
|
10
|
-
connect <connectorId> Connect a connector (see auth options below)
|
|
11
|
-
disconnect <connectorId> Remove your connection to a connector
|
|
12
|
-
|
|
13
|
-
List Options:
|
|
14
|
-
--all Include connectors you haven't connected yet
|
|
15
|
-
--search <query> Filter by name (max 200 chars)
|
|
16
|
-
--limit <n> Max connectors to return (1-100, default 100)
|
|
17
|
-
--next-key <key> Pagination cursor from a previous page
|
|
18
|
-
|
|
19
|
-
Connect Options (pick one):
|
|
20
|
-
--token <token> Connect with a static token / API key
|
|
21
|
-
--username <u> --password <p> Connect with credentials
|
|
22
|
-
(prefer env vars; argv is visible in process listings)
|
|
23
|
-
--oauth Print an OAuth URL to open in your browser
|
|
24
|
-
|
|
25
|
-
Flags:
|
|
26
|
-
-y, --yes Skip the disconnect confirmation prompt
|
|
27
|
-
--json Output JSON
|
|
28
|
-
|
|
29
|
-
Examples:
|
|
30
|
-
entrydesk connectors # Connected connectors
|
|
31
|
-
entrydesk connectors --all --search github # Browse connectable ones
|
|
32
|
-
entrydesk connectors tools <connectorId>
|
|
33
|
-
entrydesk connectors connect <connectorId> --token ghp_xxx
|
|
34
|
-
entrydesk connectors connect <connectorId> --oauth
|
|
35
|
-
entrydesk connectors disconnect <connectorId>
|
|
36
|
-
`)}function l(e){return e.connectorId||(console.error(`Missing connector ID. Usage: entrydesk connectors ${e.action} <connectorId>`),process.exit(1)),e.connectorId}async function g(e,t,c,o){let{connectors:n,nextKey:s}=await e.getConnectors(t,c,{connectionStatus:o.all?"all":"connected",search:o.search,limit:o.limit,nextKey:o.nextKey});if(o.json){console.log(JSON.stringify({connectors:n,nextKey:s}));return}if(n.length===0){console.log(o.all?"No connectors found.":"No connected connectors. Use --all to browse connectable ones.");return}let i=o.all?"Connectors":"Connected connectors";console.log(`${i} (${n.length}):
|
|
37
|
-
`);for(let r of n){let y=r.connected?"connected":"not connected";console.log(` ${r.name} (${y})`),console.log(` Provider: ${r.provider}`),console.log(` ID: ${r.id}`),r.authorization?.type&&console.log(` Auth: ${r.authorization.type}`),console.log("")}s&&console.log(`More results: --next-key ${s}`)}async function m(e,t,c,o){let{tools:n}=await e.getConnectorTools(t,c,l(o));if(o.json){console.log(JSON.stringify({tools:n}));return}if(n.length===0){console.log("This connector exposes no tools.");return}console.log(`Tools (${n.length}):
|
|
38
|
-
`);for(let s of n)console.log(` ${s.name} [${s.policy}]`),s.description&&console.log(` ${s.description}`)}async function h(e,t,c,o){let n=l(o);if(o.oauth){let{url:i}=await e.getConnectorAuthUrl(t,c,n);if(o.json){console.log(JSON.stringify({url:i}));return}console.log("Open this URL in your browser to authorize the connector:"),console.log(` ${i}`),console.log(`
|
|
39
|
-
After you approve, the connection is saved automatically \u2014 re-run`),console.log("`entrydesk connectors` to confirm it shows as connected.");return}let s;o.token?s={token:o.token}:o.username&&o.password?s={username:o.username,password:o.password}:(console.error("Provide --token, or --username and --password, or --oauth to connect."),process.exit(1)),await e.connectConnectorToken(t,c,n,s),console.log(o.json?JSON.stringify({id:n,connected:!0}):`Connected connector ${n}.`)}async function k(e,t,c,o){let n=l(o);if(!o.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${n} needs confirmation. Re-run with --yes.`),process.exit(1)),!await p(`Disconnect connector ${n}?`))){console.log("Aborted.");return}await e.disconnectConnector(t,c,n),console.log(o.json?JSON.stringify({id:n,disconnected:!0}):`Disconnected connector ${n}.`)}async function $(e){if(e.help){f();return}try{let{accessToken:t,workspaceId:c}=await d(),o=new a,n=e.action||"list";switch(n){case"list":await g(o,t,c,e);break;case"tools":await m(o,t,c,e);break;case"connect":await h(o,t,c,e);break;case"disconnect":await k(o,t,c,e);break;default:console.error(`Unknown connectors command: ${n}`),f(),process.exit(1)}}catch(t){u(t)}}export{f as printConnectorsUsage,$ as runConnectors};
|
package/dist/help-KDHCFJNF.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-JMYSCKCF.js";var r=[{name:"task",category:"Chat & Tasks",summary:"Send a message or run an interactive task",example:'entrydesk task -m "..." --model <model>'},{name:"tasks",category:"Chat & Tasks",summary:"List, search, or view tasks"},{name:"tool",category:"Chat & Tasks",summary:"List, get, or call MCP tools"},{name:"agents",category:"Build",summary:"List, show, create, publish, and share agents"},{name:"skills",category:"Build",summary:"List, upload, version, toggle, and share skills"},{name:"workflow",category:"Build",summary:"Create, run, and manage workflows"},{name:"meeting",category:"Build",summary:"Manage meetings, summaries, transcripts, and sharing"},{name:"recordings",category:"Build",summary:"List, import, retry, and manage recordings"},{name:"schedules",category:"Build",summary:"Create and manage scheduled tasks"},{name:"notifications",category:"Build",summary:"List, count, or mark notifications read"},{name:"marketplace",category:"Build",summary:"Browse and install marketplace agents and skills"},{name:"workspaces",category:"Workspace",summary:"List or switch workspaces"},{name:"models",category:"Workspace",summary:"List available models"},{name:"connectors",category:"Workspace",summary:"List connectors and connect/disconnect them"},{name:"usage",category:"Workspace",summary:"Show balance, per-user breakdown, or CSV export"},{name:"billing",category:"Workspace",summary:"Show billing status and invoices"},{name:"budget",category:"Workspace",summary:"View or manage the workspace budget"},{name:"login",category:"Setup",summary:"Log in to EntryDesk"},{name:"logout",category:"Setup",summary:"Log out and clear credentials"},{name:"status",category:"Setup",summary:"Show who you are logged in as"},{name:"profile",category:"Setup",summary:"Manage profiles"},{name:"config",category:"Setup",summary:"Manage CLI configuration"},{name:"mcp-server",category:"Setup",summary:"Start the MCP server (stdio or HTTP)"},{name:"version",category:"Setup",summary:"Show the version number"},{name:"update",category:"Setup",summary:"Update the CLI to the latest version (--check to only check)"},{name:"help",category:"Setup",summary:"Show this help"}],m=new Set(["agents","billing","budget","config","connectors","marketplace","meeting","notifications","profile","recordings","schedules","skills","task","tasks","tool","usage","workflow","workspaces"]);function n(){let a=["","EntryDesk CLI \u2014 interact with EntryDesk from your terminal","","Usage: entrydesk <command> [options]","Run `entrydesk <command> --help` for a command's options.",""],s=[];for(let e of r)s.includes(e.category)||s.push(e.category);for(let e of s){a.push(`${e}:`);for(let t of r.filter(o=>o.category===e)){let o=` ${t.name.padEnd(14)} ${t.summary}`;a.push(t.example?`${o} \xB7 e.g. ${t.example}`:o)}a.push("")}return a.push("Global Options:"," --json Output JSON for scripting (most commands support it)"," --profile <p> Use a specific profile for this command"," -h, --help Show help (top-level, or for a specific command)","","Examples:",' entrydesk task -m "Summarize my open tasks" --model <model>',' entrydesk meeting transcript <recordingId> | entrydesk task -m "List action items"'," entrydesk agents --mine --json","","Docs: https://entrydesk.com/docs/cli"),a.join(`
|
|
3
|
-
`)}function i(){console.log(n())}function c(a){let s=r.find(t=>t.name===a),e=[""];s?e.push(`entrydesk ${s.name} \u2014 ${s.summary}`):e.push(`entrydesk ${a}`),e.push("",`Usage: entrydesk ${a} [options]`,"","Global Options:"," --json Output JSON for scripting (where supported)"," --profile <p> Use a specific profile for this command"," -h, --help Show this help","","Run `entrydesk --help` for the full command list."),console.log(e.join(`
|
|
4
|
-
`))}export{r as COMMANDS,m as COMMANDS_WITH_OWN_HELP,n as buildHelpText,c as printCommandHelp,i as printHelp};
|
package/dist/login-WXXDXOHI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{B as t,C as c,D as a,E as g,G as f,K as d,y as i,z as l}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";async function E(o){let r=a();if(r){o.json?console.log(JSON.stringify({alreadyAuthenticated:!0,authSource:"sandbox-env",workspaceId:r.workspaceId})):(console.log(`Already authenticated via ${f}.`),console.log("No login required \u2014 environment credentials are active."));return}g()&&console.error("Warning: ENTRYDESK_TOKEN is set \u2014 workspace commands will keep using it instead of the credentials saved by this login. Unset ENTRYDESK_TOKEN if you want this login to take effect."),process.env.DEBUG&&(console.log(`[DEBUG] Hub URL: ${l()}`),console.log(`[DEBUG] API URL: ${i()}`));let e=await d({onDeviceCodeReceived:(s,u)=>{o.json||(console.log(""),console.log("To finish logging in:"),console.log(""),console.log(` 1. Visit: ${u}`),console.log(` 2. Enter code: ${s}`),console.log(""))},onBrowserOpening:()=>{o.json||console.log("Opening browser\u2026")},onWaitingForAuthorization:()=>{o.json||console.log("Waiting for authorization\u2026")},onAuthorized:()=>{o.json||console.log("Authorization successful.")},onWarning:s=>{console.error(`Warning: ${s}`)}}),m=new c,{workspaces:p}=await m.getWorkspaces(e.accessToken),n=p[0];await t.saveAll({accessToken:e.accessToken,refreshToken:e.refreshToken,email:e.email,workspaceId:n?.id}),o.json?console.log(JSON.stringify({email:e.email,workspaceId:n?.id,workspaceName:n?.name,server:i()})):(console.log(`Logged in as ${e.email}`),n&&console.log(`Workspace: ${n.name}`),console.log(`Server: ${i()}`))}export{E as runLogin};
|
package/dist/logout-6S6KRPMB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{B as r,C as t,J as e,T as n}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";async function m(i){try{let o=await r.getAll();if(!o){console.log("Not logged in.");return}try{o.refreshToken&&await new t().revokeOAuthToken({token:o.refreshToken,clientId:e})}catch{}await r.clear(),console.log("Logged out.")}catch(o){n(o)}}export{m as runLogout};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as c,P as p,T as g,w as i}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";import{isHTTPError as d}from"ky";function u(){console.log(`
|
|
3
|
-
Usage: entrydesk marketplace [search|show|install|roles] [options]
|
|
4
|
-
|
|
5
|
-
Browse and install curated agents and skills from the marketplace.
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
search [tag] List marketplace agents/skills (default)
|
|
9
|
-
show <slug> Show an agent or skill's details
|
|
10
|
-
install <slug> Install an agent or skill into the current workspace
|
|
11
|
-
roles List role tags you can filter by
|
|
12
|
-
|
|
13
|
-
Options:
|
|
14
|
-
--type agent|skill Filter (search) or pick the resource type (show/install)
|
|
15
|
-
--tag <tag> Filter search by a tag
|
|
16
|
-
--limit <n> Max results to return (1-100, default 30)
|
|
17
|
-
--cursor <key> Pagination cursor from a previous page
|
|
18
|
-
--json Output JSON
|
|
19
|
-
|
|
20
|
-
Examples:
|
|
21
|
-
entrydesk marketplace search # Browse everything
|
|
22
|
-
entrydesk marketplace search --type agent # Only agents
|
|
23
|
-
entrydesk marketplace search devops # Tag shorthand
|
|
24
|
-
entrydesk marketplace show my-agent-slug # Auto-detect type
|
|
25
|
-
entrydesk marketplace install my-agent-slug --type agent
|
|
26
|
-
entrydesk marketplace roles --json
|
|
27
|
-
|
|
28
|
-
Notes:
|
|
29
|
-
search/show are public; install requires login and CreateAgent/CreateSkill
|
|
30
|
-
permission in the current workspace.
|
|
31
|
-
`)}function f(o){return d(o)&&o.response.status===404}var l=class extends Error{constructor(s){super(`"${s}" matches both an agent and a skill`);this.slug=s;this.name="AmbiguousResourceError"}slug},a=class extends Error{constructor(s){super(`Marketplace resource not found: ${s}`);this.slug=s;this.name="ResourceNotFoundError"}slug};async function k(o){try{return await o}catch(t){if(f(t))return null;throw t}}async function m(o,t,s){if(s==="agent")return{type:s,view:await o.getMarketplaceAgent(t)};if(s==="skill")return{type:s,view:await o.getMarketplaceSkill(t)};let[e,r]=await Promise.all([k(o.getMarketplaceAgent(t)),k(o.getMarketplaceSkill(t))]);if(e&&r)throw new l(t);if(e)return{type:"agent",view:e};if(r)return{type:"skill",view:r};throw new a(t)}async function y(o,t){let s=await o.searchMarketplace({type:t.type,tag:t.tag,limit:t.limit,cursor:t.cursor});if(t.json){console.log(JSON.stringify(s));return}if(s.items.length===0){console.log("No marketplace resources found.");return}console.log(`Marketplace (${s.items.length}):
|
|
32
|
-
`);for(let e of s.items)console.log(` ${e.name} [${e.type}]`),console.log(` Slug: ${e.slug}`),e.description&&console.log(` ${e.description}`),e.tags.length>0&&console.log(` Tags: ${e.tags.map(r=>r.label).join(", ")}`),console.log("");s.nextCursor&&console.log(`More results: --cursor ${s.nextCursor}`)}async function h(o,t){t.slug||(console.error("Missing slug. Usage: entrydesk marketplace show <slug>"),process.exit(1));let{type:s,view:e}=await m(o,t.slug,t.type);if(t.json){console.log(JSON.stringify(e));return}if(console.log(`${e.name} [${s}]`),console.log(`Slug: ${e.slug}`),e.description&&console.log(`
|
|
33
|
-
${e.description}`),e.tags.length>0&&console.log(`
|
|
34
|
-
Tags: ${e.tags.map(r=>r.label).join(", ")}`),s==="agent"){if(e.starterPrompts.length>0){console.log(`
|
|
35
|
-
Starter prompts:`);for(let r of e.starterPrompts)console.log(` - ${r}`)}if(e.connectors.length>0){console.log(`
|
|
36
|
-
Connectors:`);for(let r of e.connectors)console.log(` - ${r.name} (${r.provider})`)}}console.log(`
|
|
37
|
-
Install with: entrydesk marketplace install ${e.slug} --type ${s}`)}async function w(o,t){t.slug||(console.error("Missing slug. Usage: entrydesk marketplace install <slug>"),process.exit(1));let{accessToken:s,workspaceId:e}=await p(),r=t.type;r===void 0&&(r=(await m(o,t.slug)).type);let n=await o.installMarketplaceResource(s,e,r,t.slug,i.getToolApprovalMode()??void 0);if(t.json){console.log(JSON.stringify(n));return}console.log(`Installed ${r} "${t.slug}" into the workspace.`),console.log(` ${r} ID: ${n.resourceId}`),n.taskId&&(console.log(` Setup task: ${n.taskId}`),console.log(` Continue setup: entrydesk tasks ${n.taskId}`))}async function $(o,t){let{items:s}=await o.listMarketplaceRoles();if(t.json){console.log(JSON.stringify(s));return}if(s.length===0){console.log("No marketplace roles found.");return}console.log(`Marketplace roles (${s.length}):
|
|
38
|
-
`);for(let e of s)console.log(` ${e.tag} ${e.name}`),e.tagline&&console.log(` ${e.tagline}`)}async function x(o){if(o.help){u();return}let t=new c,s=o.action||"search";try{switch(s){case"search":await y(t,o);break;case"show":await h(t,o);break;case"install":await w(t,o);break;case"roles":await $(t,o);break;default:console.error(`Unknown marketplace command: ${s}`),u(),process.exit(1)}}catch(e){e instanceof l&&(console.error(`"${e.slug}" matches both an agent and a skill. Re-run with --type agent|skill.`),process.exit(1)),(e instanceof a||f(e))&&(console.error(o.slug?`Marketplace resource not found: ${o.slug}`:"Marketplace resource not found."),process.exit(1)),g(e)}}export{u as printMarketplaceUsage,x as runMarketplace};
|
package/dist/mcp-2Q5DRF4P.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-FKRIIPBA.js";import{B as y,M as f,N as g,P as w,x as u}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";import T from"http";import{stderr as k}from"process";import{Client as v,StreamableHTTPClientTransport as C}from"@modelcontextprotocol/client";import{NodeStreamableHTTPServerTransport as P}from"@modelcontextprotocol/node";import{Server as O}from"@modelcontextprotocol/server";import{StdioServerTransport as A}from"@modelcontextprotocol/server/stdio";function l(c){k.write(`${c}
|
|
3
|
-
`)}async function S(c,t,o){let n=new v({name:"entrydesk-cli-proxy",version:"1.0.0"}),s=new URL(`${c}/v1/workspaces/${o}/mcp`),e=new C(s,{requestInit:{headers:{Authorization:`Bearer ${t}`}}});return await n.connect(e),n}function h(c){let t=new O({name:"entrydesk-cli",version:"1.0.0"},{capabilities:{tools:{}}});return t.setRequestHandler("tools/list",async(o,n)=>({tools:(await(await c()).listTools({},m({signal:n.mcpReq.signal}))).tools})),t.setRequestHandler("tools/call",async(o,n)=>{let{name:s,arguments:e}=o.params,{progressToken:a}=n.mcpReq._meta??{},i=await(await c()).callTool({name:s,arguments:e},m({signal:n.mcpReq.signal,onProgress:a===void 0?void 0:d=>{n.mcpReq.notify({method:"notifications/progress",params:{...d,progressToken:a}}).catch(()=>{})}})),r=Array.isArray(i.content)?[...i.content]:[];return i.structuredContent&&r.push({type:"text",text:JSON.stringify(i.structuredContent,null,2)}),{content:r,structuredContent:i.structuredContent,isError:i.isError}}),t}async function E(c,t,o){let n=T.createServer(async(s,e)=>{if(s.method==="OPTIONS"){e.setHeader("Access-Control-Allow-Origin","*"),e.setHeader("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),e.setHeader("Access-Control-Allow-Headers","Content-Type, Accept"),e.writeHead(204),e.end();return}if(s.url!=="/mcp"){e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Not found"}));return}let a=h(c),p=new P({sessionIdGenerator:void 0});if(e.setHeader("Access-Control-Allow-Origin","*"),e.on("close",()=>{p.close(),a.close()}),await a.connect(p),s.method==="POST"){let i="";s.on("data",r=>{i+=r.toString()}),s.on("end",async()=>{try{let r=JSON.parse(i);await p.handleRequest(s,e,r)}catch{e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Invalid JSON"}))}})}else await p.handleRequest(s,e)});n.listen(o,()=>{l(`EntryDesk MCP server running at http://localhost:${o}/mcp`),l("Press Ctrl+C to stop")}),process.on("SIGINT",async()=>{l(`
|
|
4
|
-
Shutting down\u2026`),n.close(),await t(),process.exit(0)}),process.on("SIGTERM",async()=>{n.close(),await t(),process.exit(0)})}async function H(c,t){let o=h(c),n=new A;n.onclose=async()=>{await t()},await o.connect(n)}var M={mode:"stdio"};async function G(c=M){process.on("unhandledRejection",t=>{console.error("[entrydesk-mcp] Unhandled rejection:",t)}),process.on("uncaughtException",t=>{console.error("[entrydesk-mcp] Uncaught exception:",t)});try{l("[entrydesk-mcp] Starting MCP server\u2026");let t,o;try{let r=await w();t=r.accessToken,o=r.workspaceId}catch(r){let d=r instanceof Error?r.message:"Authentication failed";console.error(d),process.exit(1)}let{apiUrl:n,mcp:s}=u();l(`[entrydesk-mcp] Connecting to ${n}\u2026`),l(`[entrydesk-mcp] Workspace: ${o}`);let e=await S(n,t,o);l("[entrydesk-mcp] Connected to EntryDesk API");let a=null,p=async()=>f(t)?a||(a=(async()=>{l("[entrydesk-mcp] Token expiring soon, refreshing\u2026");let r=await y.getAll();if(!r?.accessToken)throw new Error("Not logged in. Run `entrydesk login` again.");let d=await g(r);if(d!==t){t=d;try{await e.close()}catch{}e=await S(n,t,o),l("[entrydesk-mcp] Token refreshed, reconnected")}return e})().finally(()=>{a=null}),a):e,i=async()=>{try{await e.close()}catch{}};if(c.mode==="http"){let r=c.port??s.httpPort;await E(p,i,r)}else l("[entrydesk-mcp] Starting stdio server\u2026"),await H(p,i),l("[entrydesk-mcp] Stdio server started")}catch(t){console.error("[entrydesk-mcp] Fatal error:",t),process.exit(1)}}export{h as createServer,G as startMcpServer};
|
package/dist/meeting-ZI2UOSO6.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as p,P as y,T as h,k as f}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function a(){console.log(`
|
|
3
|
-
Usage: entrydesk meeting [list|get|create|update|delete|summary|transcript|previous|share] [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List meetings (default)
|
|
7
|
-
get <meetingId> Show meeting details and its recordings
|
|
8
|
-
create Create a meeting manually
|
|
9
|
-
update <meetingId> Update a meeting
|
|
10
|
-
delete <meetingId> Delete a meeting (soft delete)
|
|
11
|
-
summary <meetingId> Print the meeting summary (markdown) to stdout
|
|
12
|
-
transcript <recordingId> Print a recording transcript to stdout
|
|
13
|
-
previous <meetingId> Show the previous meeting's brief in the same series
|
|
14
|
-
share <meetingId> Show or manage sharing (visibility, user/team grants)
|
|
15
|
-
|
|
16
|
-
List Options:
|
|
17
|
-
--filter mine|shared|all Filter meetings (default: all)
|
|
18
|
-
--search <text> Search title/description
|
|
19
|
-
--sort updated|start Sort by updated time or start time (default: updated)
|
|
20
|
-
--limit <number> Max meetings per page (default: 20)
|
|
21
|
-
--next-key <cursor> Fetch next page using cursor
|
|
22
|
-
--all Fetch all meetings (auto-paginate)
|
|
23
|
-
|
|
24
|
-
Create/Update Options:
|
|
25
|
-
--title <text> (required for create)
|
|
26
|
-
--description <text>
|
|
27
|
-
--location <text>
|
|
28
|
-
--start <ISO datetime>
|
|
29
|
-
--end <ISO datetime>
|
|
30
|
-
--conference-link <url>
|
|
31
|
-
--notes <text>
|
|
32
|
-
--status scheduled|in_progress|completed|cancelled (update only)
|
|
33
|
-
--visibility private|workspace (update only)
|
|
34
|
-
|
|
35
|
-
Transcript Options:
|
|
36
|
-
--raw Output raw transcript with timestamps (default: refined)
|
|
37
|
-
|
|
38
|
-
Share Options:
|
|
39
|
-
--visibility private|workspace Change who can see the meeting (owner only)
|
|
40
|
-
--add-user <userId> Grant a user access (use with --role)
|
|
41
|
-
--remove-user <userId> Revoke a user's access
|
|
42
|
-
--add-team <teamId> Grant a team access (use with --role)
|
|
43
|
-
--remove-team <teamId> Revoke a team's access
|
|
44
|
-
--role viewer|editor Role for --add-user/--add-team (default: viewer)
|
|
45
|
-
|
|
46
|
-
Flags:
|
|
47
|
-
--json Output JSON
|
|
48
|
-
|
|
49
|
-
Examples:
|
|
50
|
-
entrydesk meeting list --filter mine
|
|
51
|
-
entrydesk meeting get <meetingId>
|
|
52
|
-
entrydesk meeting create --title "Sprint Planning" --start 2026-06-20T09:00:00Z
|
|
53
|
-
entrydesk meeting update <meetingId> --status completed
|
|
54
|
-
entrydesk meeting transcript <recordingId> | entrydesk task -m "List the action items"
|
|
55
|
-
entrydesk meeting share <meetingId>
|
|
56
|
-
entrydesk meeting share <meetingId> --visibility workspace
|
|
57
|
-
entrydesk meeting share <meetingId> --add-user <userId> --role editor
|
|
58
|
-
`)}function d(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function w(e){return!e||e<=0?"":`${Math.round(e/60)}m`}function I(e){console.log(`Meetings (${e.length}):
|
|
59
|
-
`);for(let t of e){let i=[`(${t.status??"unknown"})`],o=d(t.startTime??t.sortTime);o&&i.push(o),t.hasRecordings&&i.push("\u{1F399}\uFE0F"),i.push(t.isOwner?"owner":t.myRole),console.log(` ${t.title}`),console.log(` ${i.join(" \xB7 ")}`),t.processingStatus&&console.log(` processing: ${t.processingStatus}`),console.log(` ID: ${t.id}`),console.log("")}}function v(e){if(console.log(`${e.title}
|
|
60
|
-
`),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: ${d(e.startTime)}`),e.endTime&&console.log(` End: ${d(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 i of e.participants){let o=i.displayName??i.email;console.log(` - ${o}${i.role?` (${i.role})`:""}`)}}e.summary&&console.log(`
|
|
61
|
-
Summary:
|
|
62
|
-
${e.summary}`);let t=e.recordings??[];if(console.log(`
|
|
63
|
-
Recordings (${t.length}):`),t.length===0){console.log(" (none)");return}for(let i of t){let o=[];i.processingStatus&&o.push(i.processingStatus);let s=w(i.duration);s&&o.push(s),i.hasTranscript&&o.push("transcript\u2713"),i.hasSummary&&o.push("summary\u2713"),console.log(` - ${i.title}`),o.length>0&&console.log(` ${o.join(" \xB7 ")}`),console.log(` ID: ${i.id}`)}}function $(e){if(console.log(`Visibility: ${e.visibility}
|
|
64
|
-
`),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}> \xB7 ${t.role}`),console.log(` ID: ${t.userId}`);if(console.log(`
|
|
65
|
-
Team 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) \xB7 ${t.role}`),console.log(` ID: ${t.teamId}`)}function M(e){e.title||(console.error("Missing required --title for meeting create."),a(),process.exit(1));let t={title:e.title};return e.description!==void 0&&(t.description=e.description),e.location!==void 0&&(t.location=e.location),e.startTime!==void 0&&(t.startTime=e.startTime),e.endTime!==void 0&&(t.endTime=e.endTime),e.conferenceLink!==void 0&&(t.conferenceLink=e.conferenceLink),e.notes!==void 0&&(t.notes=e.notes),t}function S(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.location!==void 0&&(t.location=e.location),e.startTime!==void 0&&(t.startTime=e.startTime),e.endTime!==void 0&&(t.endTime=e.endTime),e.conferenceLink!==void 0&&(t.conferenceLink=e.conferenceLink),e.notes!==void 0&&(t.notes=e.notes),e.status!==void 0&&(t.status=e.status),e.visibility!==void 0&&(t.visibility=e.visibility),t}async function k(e,t,i,o){o.all&&o.nextKey&&(console.error("Cannot use --all and --next-key together."),process.exit(1));let s={search:o.search,filter:o.filter,sortBy:o.sortBy};if(o.all){let l=[],m;for(let u=0;;u++){u>=100&&(console.error("Reached maximum page limit (100). Use --limit and --next-key for manual pagination."),process.exit(1));let g=await e.getMeetings(t,i,{limit:o.limit??20,nextKey:m,...s});if(l.push(...g.meetings),m=g.nextKey,!m)break}if(o.json){console.log(JSON.stringify({meetings:l}));return}if(l.length===0){console.log("No meetings found in this workspace.");return}I(l);return}let{meetings:n,nextKey:r}=await e.getMeetings(t,i,{limit:o.limit,nextKey:o.nextKey,...s});if(o.json){console.log(JSON.stringify({meetings:n,nextKey:r}));return}if(n.length===0){console.log("No meetings found in this workspace.");return}I(n),r&&console.log(`Next page: --next-key ${r}`)}async function U(e){try{if(e.help){a();return}let{accessToken:t,workspaceId:i}=await y(),o=e.action||"list",s=new p;if(o==="list"){await k(s,t,i,e);return}if(o==="get"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting get <meetingId>");let n=await s.getMeeting(t,i,e.meetingId);if(e.json){console.log(JSON.stringify(n));return}v(n);return}if(o==="create"){let n=M(e),r=await s.createMeeting(t,i,n);if(e.json){console.log(JSON.stringify(r));return}console.log(`Created meeting: ${r.title}`),console.log(` ID: ${r.id}`);return}if(o==="update"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting update <meetingId>");let n=S(e);Object.keys(n).length===0&&(console.error("No fields provided to update."),a(),process.exit(1));let r=await s.updateMeeting(t,i,e.meetingId,n);if(e.json){console.log(JSON.stringify(r));return}console.log(`Updated meeting: ${e.meetingId}`);return}if(o==="delete"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting delete <meetingId>");if(await s.deleteMeeting(t,i,e.meetingId),e.json){console.log(JSON.stringify({id:e.meetingId,deleted:!0}));return}console.log(`Deleted meeting: ${e.meetingId}`);return}if(o==="summary"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting summary <meetingId>");let n=await s.getMeeting(t,i,e.meetingId),r=f(n);if(e.json){console.log(JSON.stringify({summary:r??null}));return}r||(console.error("This meeting has no summary yet."),process.exit(1)),console.log(r);return}if(o==="transcript"){if(!e.recordingId)throw new Error("Missing recording ID. Usage: entrydesk meeting transcript <recordingId>");let n=await s.getRecording(t,i,e.recordingId),r=e.raw?n.transcriptWithTimestamps:n.transcript;if(e.json){console.log(JSON.stringify({transcript:r,processingStatus:n.processingStatus}));return}r||(console.error(n.processingStatus&&n.processingStatus!=="completed"?`Transcript not ready (processing status: ${n.processingStatus}).`:"This recording has no transcript."),process.exit(1)),console.log(r);return}if(o==="previous"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting previous <meetingId>");let{previous:n}=await s.getMeetingPreviousBrief(t,i,e.meetingId);if(e.json){console.log(JSON.stringify({previous:n}));return}if(!n){console.log("No previous meeting found in this series.");return}if(console.log(`Previous: ${n.title}`),n.startTime&&console.log(` ${d(n.startTime)}`),n.summary&&console.log(`
|
|
66
|
-
Summary:
|
|
67
|
-
${n.summary}`),n.actionItems.length>0){console.log(`
|
|
68
|
-
Action items:`);for(let r of n.actionItems){let c=r.completed?"[x]":"[ ]",l=r.assignee?` (@${r.assignee})`:"";console.log(` ${c} ${r.description}${l}`)}}return}if(o==="share"){if(!e.meetingId)throw new Error("Missing meeting ID. Usage: entrydesk meeting share <meetingId>");let n=e.meetingId,r=e.role??"viewer";if(e.addUser){let l=await s.upsertMeetingUserGrant(t,i,n,e.addUser,r);if(e.json){console.log(JSON.stringify(l));return}console.log(`Granted ${r} to user ${e.addUser}`);return}if(e.removeUser){if(await s.removeMeetingUserGrant(t,i,n,e.removeUser),e.json){console.log(JSON.stringify({userId:e.removeUser,removed:!0}));return}console.log(`Revoked access for user ${e.removeUser}`);return}if(e.addTeam){let l=await s.upsertMeetingTeamGrant(t,i,n,e.addTeam,r);if(e.json){console.log(JSON.stringify(l));return}console.log(`Granted ${r} to team ${e.addTeam}`);return}if(e.removeTeam){if(await s.removeMeetingTeamGrant(t,i,n,e.removeTeam),e.json){console.log(JSON.stringify({teamId:e.removeTeam,removed:!0}));return}console.log(`Revoked access for team ${e.removeTeam}`);return}if(e.visibility){let l=await s.updateMeeting(t,i,n,{visibility:e.visibility});if(e.json){console.log(JSON.stringify({visibility:l.visibility}));return}console.log(`Set visibility to ${l.visibility}`);return}let c=await s.getMeetingShares(t,i,n);if(e.json){console.log(JSON.stringify(c));return}$(c);return}console.error(`Unknown meeting command: ${o}`),a(),process.exit(1)}catch(t){h(t)}}export{U as runMeeting};
|
package/dist/models-TXYNHCLD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as n,P as t,T as l}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";async function p(c){try{let e,r;try{let o=await t();e=o.accessToken,r=o.workspaceId}catch(o){let a=o instanceof Error?o.message:"Authentication failed";console.error(a),process.exit(1)}let i=new n,{models:s}=await i.listSelectableModels(e,r);if(c.json){console.log(JSON.stringify(s));return}if(s.length===0){console.log("No models available in this workspace.");return}console.log(`Available models (${s.length}):
|
|
3
|
-
`);for(let o of s)console.log(` ${o.name}`),o.description&&console.log(` ${o.description.slice(0,80)}`),console.log(` ID: ${o.id}`),console.log("")}catch(e){l(e)}}export{p as runModels};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as d,P as u,T as g}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function m(){console.log(`
|
|
3
|
-
Usage: entrydesk notifications [list|unread|read|read-all] [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List notifications (default)
|
|
7
|
-
unread Show the unread notification count
|
|
8
|
-
read <notificationId> Mark a notification as read
|
|
9
|
-
read-all Mark every notification as read
|
|
10
|
-
|
|
11
|
-
List Options:
|
|
12
|
-
--tab all|action|info Filter by category (default: all)
|
|
13
|
-
--event-type <type> Filter by a single event type (e.g. task_complete)
|
|
14
|
-
--limit <number> Max per page (default: 20)
|
|
15
|
-
--next-key <cursor> Fetch next page using cursor
|
|
16
|
-
--all Fetch all notifications (auto-paginate)
|
|
17
|
-
|
|
18
|
-
Flags:
|
|
19
|
-
--json Output JSON
|
|
20
|
-
|
|
21
|
-
Examples:
|
|
22
|
-
entrydesk notifications
|
|
23
|
-
entrydesk notifications --tab action
|
|
24
|
-
entrydesk notifications unread
|
|
25
|
-
entrydesk notifications read <notificationId>
|
|
26
|
-
entrydesk notifications read-all
|
|
27
|
-
`)}function y(i){if(!i)return"";let t=new Date(i);return Number.isNaN(t.getTime())?i:t.toLocaleString()}function N(i,t){let o=i.replace(/\s+/g," ").trim();return o.length>t?`${o.slice(0,t)}\u2026`:o}function p(i){console.log(`Notifications (${i.length}):
|
|
28
|
-
`);for(let t of i){let o=t.readAt?" ":"\u25CF";console.log(` ${o} [${t.category}] ${t.rendered.title}`),t.rendered.body&&console.log(` ${N(t.rendered.body,100)}`);let n=y(t.createdAt);console.log(` ${n} \xB7 ${t.eventType} \xB7 ID: ${t.id}`),console.log("")}}async function k(i,t,o,n){n.all&&n.nextKey&&(console.error("Cannot use --all and --next-key together."),process.exit(1));let e={tab:n.tab,eventType:n.eventType};if(n.all){let s=[],c;for(let l=0;;l++){l>=100&&(console.error("Reached maximum page limit (100). Use --limit and --next-key for manual pagination."),process.exit(1));let f=await i.getNotifications(t,o,{...e,limit:n.limit??20,cursor:c});if(s.push(...f.items),c=f.nextKey,!c)break}if(n.json){console.log(JSON.stringify({items:s}));return}if(s.length===0){console.log("No notifications.");return}p(s);return}let{items:r,nextKey:a}=await i.getNotifications(t,o,{...e,limit:n.limit,cursor:n.nextKey});if(n.json){console.log(JSON.stringify({items:r,nextKey:a}));return}if(r.length===0){console.log("No notifications.");return}p(r),a&&console.log(`Next page: --next-key ${a}`)}async function w(i){try{if(i.help){m();return}let{accessToken:t,workspaceId:o}=await u(),n=i.action||"list",e=new d;if(n==="list"){await k(e,t,o,i);return}if(n==="unread"){let{count:r,capped:a}=await e.getNotificationUnreadCount(t,o);if(i.json){console.log(JSON.stringify({count:r,capped:a??!1}));return}console.log(`${a?`${r}+`:r} unread`);return}if(n==="read"){if(!i.notificationId)throw new Error("Missing notification ID. Usage: entrydesk notifications read <notificationId>");if(await e.markNotificationRead(t,o,i.notificationId),i.json){console.log(JSON.stringify({id:i.notificationId,read:!0}));return}console.log(`Marked notification read: ${i.notificationId}`);return}if(n==="read-all"){if(await e.markAllNotificationsRead(t,o),i.json){console.log(JSON.stringify({readAll:!0}));return}console.log("Marked all notifications read.");return}console.error(`Unknown notifications command: ${n}`),m(),process.exit(1)}catch(t){g(t)}}export{w as runNotifications};
|
package/dist/profile-OMP7YDYA.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{B as f,S as a,T as d,v as l,w as g}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function P(){console.log(`
|
|
3
|
-
Usage: entrydesk profile [list|show|current|create|use|delete|rename|clone] [args]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List profiles (default)
|
|
7
|
-
show <name> Show profile details
|
|
8
|
-
current Show active profile
|
|
9
|
-
create <name> Create a profile (default name: default)
|
|
10
|
-
use <name> Switch active profile
|
|
11
|
-
delete <name> Delete a profile
|
|
12
|
-
rename <from> <to> Rename a profile
|
|
13
|
-
clone <from> <to> Clone config defaults (no credentials)
|
|
14
|
-
|
|
15
|
-
Flags:
|
|
16
|
-
--json Output JSON
|
|
17
|
-
`)}function u(n,r){if(n)return n;if(r&&l.getProfileCount()===1)return l.getProfileNames()[0];throw new a("Profile name is required when multiple profiles exist.")}async function S(n){try{let r=n.action||"list",i=l.getCurrentProfileName(),c=n.name??n.profile,t=n.value;if(n.help||r==="help"){P();return}if(r==="list"){let e=l.getProfileNames();if(n.json){console.log(JSON.stringify({currentProfile:i,profiles:e.map(o=>({name:o,isCurrent:o===i}))}));return}console.log(`Profiles (${e.length}):`);for(let o of e)console.log(` ${o}${o===i?" (current)":""}`);return}if(r==="current"){if(n.json){console.log(JSON.stringify({name:i,isCurrent:!0}));return}console.log(`Current profile: ${i}`);return}if(r==="show"){let e=u(c,!0),o=g.getAll(e),s=await f.getAll(e),m=!!s?.accessToken;if(n.json){console.log(JSON.stringify({name:e,isCurrent:e===i,config:o,auth:m?{loggedIn:!0,email:s?.email??null,workspaceId:s?.workspaceId??null}:{loggedIn:!1}}));return}console.log(`Profile: ${e}${e===i?" (current)":""}`),console.log(` API URL: ${o.apiUrl??"default"}`),console.log(` Hub URL: ${o.hubUrl??"default"}`),console.log(` Model: ${o.model?.default??"unset"}`);let p=o.connectors?.defaults&&o.connectors.defaults.length>0?o.connectors.defaults.join(", "):"unset";console.log(` Connectors: ${p}`),console.log(m?` Logged in as: ${s?.email??"unknown"}`:" Not logged in"),m&&s?.workspaceId&&console.log(` Workspace ID: ${s.workspaceId}`);return}if(r==="create"){let e=c||l.DEFAULT_PROFILE;if(l.createProfile(e),n.json){console.log(JSON.stringify({name:e,created:!0}));return}console.log(`Profile created: ${e}`);return}if(r==="use"||r==="switch"){let e=u(c,!0);if(l.setCurrentProfile(e),n.json){console.log(JSON.stringify({name:e,current:!0}));return}console.log(`Switched to profile: ${e}`);return}if(r==="delete"||r==="remove"||r==="rm"){let e=u(c,!0),o=l.deleteProfile(e);if(await f.deleteProfileCredentials(e),n.json){console.log(JSON.stringify({deleted:e,currentProfile:o.currentProfile}));return}console.log(`Profile deleted: ${e}`),console.log(`Current profile: ${o.currentProfile}`);return}if(r==="rename"||r==="move"||r==="mv"){let e=u(c,!0);if(!t)throw new a("New profile name is required.");let o=l.renameProfile(e,t);if(await f.moveProfileCredentials(e,t),n.json){console.log(JSON.stringify({renamed:e,name:t,currentProfile:o.currentProfile}));return}console.log(`Profile renamed: ${e} -> ${t}`),console.log(`Current profile: ${o.currentProfile}`);return}if(r==="clone"||r==="copy"){let e=u(c,!0);if(!t)throw new a("Target profile name is required.");let o=g.getAll(e);if(l.createProfile(t),g.setAll(o,t),await f.clear(t),n.json){console.log(JSON.stringify({source:e,name:t,cloned:!0}));return}console.log(`Profile cloned: ${e} -> ${t}`);return}throw new a(`Unknown profile command: ${r}`)}catch(r){d(r)}}export{S as runProfile};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as u}from"./chunk-YBS4DYFH.js";import{C as d,P as a,T as g}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function c(r){if(r==null)return"\u2014";let n=Math.round(r),t=Math.floor(n/3600),o=Math.floor(n%3600/60),e=n%60,s=String(o).padStart(2,"0"),i=String(e).padStart(2,"0");return t>0?`${t}:${s}:${i}`:`${o}:${i}`}function m(){console.log(`
|
|
3
|
-
Usage: entrydesk recordings [list|get|import|preview|audio-url|retry|delete] [options]
|
|
4
|
-
|
|
5
|
-
List and manage meeting recordings, and import audio from a media URL.
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
list List recordings (default)
|
|
9
|
-
get <recordingId> Show a recording's metadata, summary, and status
|
|
10
|
-
import <url> Import a recording from a media URL
|
|
11
|
-
preview <url> Preview a media URL's metadata before importing
|
|
12
|
-
audio-url <recordingId> Get a signed URL to stream/download the audio
|
|
13
|
-
retry <recordingId> Retry processing of a failed recording
|
|
14
|
-
delete <recordingId> Delete a recording
|
|
15
|
-
|
|
16
|
-
Options:
|
|
17
|
-
--search <query> Filter list by title/transcript (max 200 chars)
|
|
18
|
-
--limit <n> Max recordings to return (1-100, default 20)
|
|
19
|
-
--next-key <key> Pagination cursor from a previous page
|
|
20
|
-
--title <text> Title for import
|
|
21
|
-
--model <modelId> Model to use for import transcription/summary
|
|
22
|
-
--language <code> Preferred transcript language for import (e.g. en, zh-TW)
|
|
23
|
-
-y, --yes Skip the delete confirmation prompt
|
|
24
|
-
--json Output JSON
|
|
25
|
-
|
|
26
|
-
Examples:
|
|
27
|
-
entrydesk recordings # List recent recordings
|
|
28
|
-
entrydesk recordings get <recordingId>
|
|
29
|
-
entrydesk recordings import https://example.com/audio.mp3 --title "Standup"
|
|
30
|
-
entrydesk recordings preview https://example.com/audio.mp3
|
|
31
|
-
entrydesk recordings audio-url <recordingId> --json
|
|
32
|
-
entrydesk recordings retry <recordingId>
|
|
33
|
-
entrydesk recordings delete <recordingId> --yes
|
|
34
|
-
|
|
35
|
-
Note:
|
|
36
|
-
Full transcripts live in \`entrydesk meeting transcript <recordingId>\`.
|
|
37
|
-
`)}function l(r){return r.recordingId||(console.error(`Missing recording ID. Usage: entrydesk recordings ${r.action} <recordingId>`),process.exit(1)),r.recordingId}function p(r){return r.url||(console.error(`Missing URL. Usage: entrydesk recordings ${r.action} <url>`),process.exit(1)),r.url}async function y(r,n,t,o){let{recordings:e,nextKey:s}=await r.listRecordings(n,t,{limit:o.limit,nextKey:o.nextKey,search:o.search});if(o.json){console.log(JSON.stringify({recordings:e,nextKey:s}));return}if(e.length===0){console.log("No recordings yet. Import one with `entrydesk recordings import <url>`.");return}console.log(`Recordings (${e.length}):
|
|
38
|
-
`);for(let i of e){let f=i.processingStatus??"ready";console.log(` ${i.title}`),console.log(` ID: ${i.id}`),console.log(` ${c(i.duration)} \xB7 ${f}${i.source?` \xB7 ${i.source}`:""}`),console.log("")}s&&console.log(`More results: --next-key ${s}`)}async function $(r,n,t,o){let e=await r.getRecording(n,t,l(o));if(o.json){console.log(JSON.stringify(e));return}if(console.log(e.title),console.log(`ID: ${e.id}`),console.log(`Status: ${e.processingStatus??"ready"}`),console.log(`Duration: ${c(e.duration)}`),e.recordedAt&&console.log(`Recorded: ${e.recordedAt}`),e.summary&&console.log(`
|
|
39
|
-
Summary:
|
|
40
|
-
${e.summary}`),e.actionItems&&e.actionItems.length>0){console.log(`
|
|
41
|
-
Action items:`);for(let s of e.actionItems)console.log(` - ${s.description}`)}e.transcript&&console.log(`
|
|
42
|
-
Transcript available \u2014 view with: entrydesk meeting transcript ${e.id}`)}async function w(r,n,t,o){let e=await r.importRecordingMedia(n,t,{url:p(o),title:o.title,modelId:o.modelId,preferredLanguage:o.language});if(o.json){console.log(JSON.stringify(e));return}console.log(`Importing ${e.source} recording.`),console.log(` Recording ID: ${e.recordingId}`),console.log(` ${e.message}`),console.log(` Check status: entrydesk recordings get ${e.recordingId}`)}async function k(r,n,t,o){let e=await r.previewRecordingMedia(n,t,p(o));if(o.json){console.log(JSON.stringify(e));return}console.log(`${e.title} [${e.type}]`),e.channelName&&console.log(`Channel: ${e.channelName}`),e.duration!=null&&console.log(`Duration: ${c(e.duration)}`),e.contentType&&console.log(`Type: ${e.contentType}`)}async function I(r,n,t,o){let e=await r.getRecordingAudioUrl(n,t,l(o));if(o.json){console.log(JSON.stringify(e));return}console.log(`Stream: ${e.url}`),console.log(`Download: ${e.downloadUrl}`)}async function R(r,n,t,o){let e=await r.retryRecording(n,t,l(o));if(o.json){console.log(JSON.stringify(e));return}console.log(e.message)}async function h(r,n,t,o){let e=l(o);if(!o.yes&&(process.stdin.isTTY||(console.error(`Deleting recording ${e} needs confirmation. Re-run with --yes.`),process.exit(1)),!await u(`Delete recording ${e}? This can't be undone from the CLI.`))){console.log("Aborted.");return}if(await r.deleteRecording(n,t,e),o.json){console.log(JSON.stringify({id:e,deleted:!0}));return}console.log(`Deleted recording ${e}.`)}async function U(r){if(r.help){m();return}try{let{accessToken:n,workspaceId:t}=await a(),o=new d,e=r.action||"list";switch(e){case"list":await y(o,n,t,r);break;case"get":await $(o,n,t,r);break;case"import":await w(o,n,t,r);break;case"preview":await k(o,n,t,r);break;case"audio-url":await I(o,n,t,r);break;case"retry":await R(o,n,t,r);break;case"delete":await h(o,n,t,r);break;default:console.error(`Unknown recordings command: ${e}`),m(),process.exit(1)}}catch(n){g(n)}}export{m as printRecordingsUsage,U as runRecordings};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as w,I as g,P as I,T as k}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";function l(){console.log(`
|
|
3
|
-
Usage: entrydesk schedules [list|get|create|edit|delete|activate|pause|run|runs|calendars] [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
list List all schedules (default)
|
|
7
|
-
get <scheduleId> Show schedule details
|
|
8
|
-
create Create a new schedule
|
|
9
|
-
edit <scheduleId> Update a schedule (only the fields you pass)
|
|
10
|
-
delete <scheduleId> Delete a schedule
|
|
11
|
-
activate <scheduleId> Resume a paused schedule
|
|
12
|
-
pause <scheduleId> Pause an active schedule
|
|
13
|
-
run <scheduleId> Run a schedule now; prints the created taskId
|
|
14
|
-
runs <scheduleId> List a schedule's run history
|
|
15
|
-
calendars List connected calendar accounts (for --holiday-calendars)
|
|
16
|
-
|
|
17
|
-
Create/Edit Options:
|
|
18
|
-
--name <name> Schedule name (required for create)
|
|
19
|
-
--prompt <text> Prompt to send to agent (required for create)
|
|
20
|
-
--agent-id <id> Agent ID to use (required for create)
|
|
21
|
-
--starts-at <datetime> Start time in ISO format (required for create)
|
|
22
|
-
--utc-offset <offset> Timezone offset (e.g., +08:00, default: +00:00)
|
|
23
|
-
--holiday-calendars <ids> Comma-separated connected calendar IDs to skip on holiday
|
|
24
|
-
|
|
25
|
-
Repeat Config:
|
|
26
|
-
--repeat-type <type> no-repeat, minutes, hours, days, weeks, months
|
|
27
|
-
--every <n> Repeat every N units
|
|
28
|
-
--time <HH:MM> Time of day (for days/weeks/months)
|
|
29
|
-
--times <HH:MM,...> Multiple daily trigger times (days only)
|
|
30
|
-
--days-of-week <0-6> Comma-separated days (0=Sun); required trigger day for
|
|
31
|
-
weeks, optional filter for minutes/hours/days
|
|
32
|
-
--days-of-month <1-31> Comma-separated days (for months)
|
|
33
|
-
--last-day-of-month Include last day of month
|
|
34
|
-
--daily-windows <ranges> Comma-separated HH:MM-HH:MM active-time windows
|
|
35
|
-
(minutes/hours only, e.g. "09:00-12:00,13:00-17:00")
|
|
36
|
-
|
|
37
|
-
Runs Options:
|
|
38
|
-
--limit <number> Max runs per page (default: 20)
|
|
39
|
-
--next-key <cursor> Fetch next page using cursor
|
|
40
|
-
--all Fetch all runs (auto-paginate)
|
|
41
|
-
|
|
42
|
-
Flags:
|
|
43
|
-
--json Output JSON
|
|
44
|
-
`)}function p(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}`}var D=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function O(e){return e?.length?` (windows: ${e.map(s=>`${p(s.start)}-${p(s.end)}`).join(", ")})`:""}function S(e){return e?.length?` [days: ${e.map(s=>D[s]).join(", ")}]`:""}function N(e){if(e.type==="no-repeat")return"No repeat";let{interval:t}=e;switch(t.unit){case"minutes":return`Every ${t.every} minute${t.every>1?"s":""}`+O(t.dailyWindows)+S(t.daysOfWeek);case"hours":return`Every ${t.every} hour${t.every>1?"s":""} at :${String(t.minute).padStart(2,"0")}`+O(t.dailyWindows)+S(t.daysOfWeek);case"days":{let s=`Every ${t.every} day${t.every>1?"s":""} at ${p(t.time)}`;return t.times?.length&&(s+=` (times: ${t.times.map(p).join(", ")})`),s+=S(t.daysOfWeek),s}case"weeks":{let s=t.daysOfWeek.map(n=>D[n]).join(", ");return`Every ${t.every} week${t.every>1?"s":""} on ${s} at ${p(t.time)}`}case"months":{let s=t.lastDayOfMonth?t.daysOfMonth.length>0?`${t.daysOfMonth.join(", ")} and last day`:"last day":t.daysOfMonth.join(", ");return`Every ${t.every} month${t.every>1?"s":""} on day ${s} at ${String(t.time.hour).padStart(2,"0")}:${String(t.time.minute).padStart(2,"0")}`}default:return"Unknown"}}function y(e,t){let s=new Date(e),n=t.match(/^([+-])(\d{2}):(\d{2})$/);if(!n)return s.toISOString();let r=n[1]==="+"?1:-1,a=Number.parseInt(n[2],10),d=Number.parseInt(n[3],10),c=r*(a*60+d)*60*1e3;return`${new Date(s.getTime()+c).toISOString().replace("T"," ").slice(0,19)} (${t})`}function R(e){console.log(`
|
|
45
|
-
Schedule: ${e.name}
|
|
46
|
-
${"\u2501".repeat(50)}
|
|
47
|
-
ID: ${e.id}
|
|
48
|
-
Agent: ${e.agent.name}
|
|
49
|
-
Status: ${e.isActive?"Active":"Paused"}
|
|
50
|
-
Timezone: ${e.utcOffset}
|
|
51
|
-
|
|
52
|
-
Prompt:
|
|
53
|
-
${e.prompt.slice(0,200)}${e.prompt.length>200?"\u2026":""}
|
|
54
|
-
|
|
55
|
-
Schedule:
|
|
56
|
-
${N(e.config)}
|
|
57
|
-
|
|
58
|
-
Holiday Calendars: ${e.holidayCalendarIds?.length?e.holidayCalendarIds.join(", "):"-"}
|
|
59
|
-
|
|
60
|
-
Next run: ${e.nextRunAt?y(e.nextRunAt,e.utcOffset):"-"}
|
|
61
|
-
Created: ${y(e.createdAt,e.utcOffset)}
|
|
62
|
-
Updated: ${y(e.updatedAt,e.utcOffset)}
|
|
63
|
-
`)}function x(e){console.log(`Runs (${e.length}):
|
|
64
|
-
`);for(let t of e){let s=new Date(t.scheduledAt).toLocaleString(),n;t.status==="skipped"?n=t.skipReason==="holiday"?"Skipped (holiday)":"Skipped":n=t.task?.title??"(task unavailable)";let r=t.task&&!t.task.read?" (unread)":"";console.log(` ${s}`),console.log(` Task: ${n}${r}`),t.task&&console.log(` Task ID: ${t.task.id}`),console.log(` Run ID: ${t.id}`),console.log("")}}function T(e){if(e.length===0){console.log("No connected calendar accounts. Connect one in the Hub first.");return}console.log(`Connected calendar accounts (${e.length}):
|
|
65
|
-
`);for(let t of e){let s=g(t.provider),n=g(t.email);console.log(` ${s} (${n})`),console.log(` Account ID: ${t.id}`);for(let r of t.calendars){let a=r.isVisible?"":" (hidden)",d=g(r.name);console.log(` ${r.id} ${d}${a}`)}console.log("")}}function A(e,t,s){return e.type==="no-repeat"?t!==void 0?[]:(s?.length??0)>0?[]:void 0:t??s??void 0}function C(e){let t=e.repeatType||"no-repeat";e.times!==void 0&&t!=="days"&&(console.error("--times is only supported with --repeat-type days."),process.exit(1)),e.dailyWindows!==void 0&&t!=="minutes"&&t!=="hours"&&(console.error("--daily-windows is only supported with --repeat-type minutes or hours."),process.exit(1)),e.daysOfWeek!==void 0&&t!=="minutes"&&t!=="hours"&&t!=="days"&&t!=="weeks"&&(console.error("--days-of-week is only supported with --repeat-type minutes, hours, days, or weeks."),process.exit(1))}function M(e){if(e.type!=="repeat")return;let{interval:t}=e;t.unit==="hours"&&(t.every<24||((t.dailyWindows?.length??0)>0&&(console.error("--daily-windows is not available with --repeat-type hours and --every 24 or more (equivalent to a daily interval, and the existing schedule already has active windows set) \u2014 use --repeat-type days instead."),process.exit(1)),(t.daysOfWeek?.length??0)>0&&(console.error("--days-of-week is not available with --repeat-type hours and --every 24 or more (equivalent to a daily interval, and the existing schedule already has a weekday filter set) \u2014 use --repeat-type days instead."),process.exit(1))))}function W(e,t){let s=e.repeatType||"no-repeat";if(s==="no-repeat")return{type:"no-repeat"};let n=t?.type==="repeat"&&t.interval.unit===s?t.interval:void 0,r=e.every??n?.every??1;function a(){if(e.time){let[d,c]=e.time.split(":");return{hour:Number.parseInt(d,10),minute:Number.parseInt(c,10)}}return n&&"time"in n?n.time:{hour:9,minute:0}}switch(s){case"minutes":return{type:"repeat",interval:{unit:"minutes",every:r,dailyWindows:e.dailyWindows??(n?.unit==="minutes"?n.dailyWindows:void 0),daysOfWeek:e.daysOfWeek??(n?.unit==="minutes"?n.daysOfWeek:void 0)}};case"hours":{let d=e.time?a().minute:n?.unit==="hours"?n.minute:0;return{type:"repeat",interval:{unit:"hours",every:r,minute:d,dailyWindows:e.dailyWindows??(n?.unit==="hours"?n.dailyWindows:void 0),daysOfWeek:e.daysOfWeek??(n?.unit==="hours"?n.daysOfWeek:void 0)}}}case"days":return{type:"repeat",interval:{unit:"days",every:r,time:a(),times:e.times??(n?.unit==="days"?n.times:void 0),daysOfWeek:e.daysOfWeek??(n?.unit==="days"?n.daysOfWeek:void 0)}};case"weeks":return{type:"repeat",interval:{unit:"weeks",every:r,daysOfWeek:e.daysOfWeek??(n?.unit==="weeks"?n.daysOfWeek:[1]),time:a()}};case"months":return{type:"repeat",interval:{unit:"months",every:r,daysOfMonth:e.daysOfMonth??(n?.unit==="months"?n.daysOfMonth:[1]),lastDayOfMonth:e.lastDayOfMonth??(n?.unit==="months"?n.lastDayOfMonth:!1),time:a()}};default:return{type:"no-repeat"}}}async function H(e){try{if(e.help){l();return}let t=await I(),{accessToken:s,workspaceId:n}=t,r=e.action||"list",a=new w;if(r==="get"){let o=e.scheduleId;o||(console.error("Missing schedule ID."),l(),process.exit(1));let i=await a.getSchedule(s,n,o);if(e.json){console.log(JSON.stringify(i));return}R(i);return}if(r==="create"){(!e.name||!e.prompt||!e.agentId||!e.startsAt)&&(console.error("Missing required fields for schedule creation."),console.error("Required: --name, --prompt, --agent-id, --starts-at"),l(),process.exit(1)),C(e);let o=W(e);M(o);let i={name:e.name,prompt:e.prompt,agentId:e.agentId,startsAt:e.startsAt,config:o,utcOffset:e.utcOffset||"+00:00",holidayCalendarIds:A(o,e.holidayCalendars,void 0)},u=await a.createSchedule(s,n,i);if(e.json){console.log(JSON.stringify(u));return}console.log(`Created schedule: ${u.name}`),console.log(` ID: ${u.id}`),console.log(` Next run: ${u.nextRunAt?y(u.nextRunAt,u.utcOffset):"-"}`);return}if(r==="edit"){let o=e.scheduleId;o||(console.error("Missing schedule ID."),l(),process.exit(1));let i=await a.getSchedule(s,n,o),u=e.agentId??i.agent?.id,$=e.agentId!==void 0&&e.agentId!==i.agent?.id;u||(console.error("This schedule is not agent-based; the CLI can only edit agent schedules."),process.exit(1)),(e.every!==void 0||e.time!==void 0||e.daysOfWeek!==void 0||e.daysOfMonth!==void 0||e.lastDayOfMonth!==void 0||e.dailyWindows!==void 0||e.times!==void 0)&&!e.repeatType&&(console.error("To change the cadence, pass --repeat-type along with the repeat options."),process.exit(1)),e.repeatType&&C(e);let f=e.repeatType?W(e,i.config):i.config;e.repeatType&&M(f);let m={name:e.name??i.name,prompt:e.prompt??i.prompt,agentId:u,startsAt:e.startsAt??i.startsAt,config:f,utcOffset:e.utcOffset??i.utcOffset,holidayCalendarIds:A(f,e.holidayCalendars,$?void 0:i.holidayCalendarIds)};if(await a.updateSchedule(s,n,o,m),i.isActive||await a.deactivateSchedule(s,n,o),e.json){console.log(JSON.stringify({id:o,updated:!0}));return}console.log(`Updated schedule: ${o}`);return}if(r==="activate"||r==="pause"){let o=e.scheduleId;o||(console.error("Missing schedule ID."),l(),process.exit(1));let i=r==="activate";if(await(i?a.activateSchedule(s,n,o):a.deactivateSchedule(s,n,o)),e.json){console.log(JSON.stringify({id:o,isActive:i}));return}console.log(`${i?"Activated":"Paused"} schedule: ${o}`);return}if(r==="run"){let o=e.scheduleId;o||(console.error("Missing schedule ID."),l(),process.exit(1));let{taskId:i}=await a.runScheduleNow(s,n,o);if(e.json){console.log(JSON.stringify({taskId:i}));return}console.log(`Started run for schedule ${o}`),console.log(` Task ID: ${i}`);return}if(r==="runs"){let o=e.scheduleId;if(o||(console.error("Missing schedule ID."),l(),process.exit(1)),e.all&&e.nextKey&&(console.error("Cannot use --all and --next-key together."),process.exit(1)),e.all){let h=[],f;for(let m=0;;m++){m>=100&&(console.error("Reached maximum page limit (100). Use --limit and --next-key for manual pagination."),process.exit(1));let v=await a.getScheduleRuns(s,n,o,{limit:e.limit??20,nextKey:f});if(h.push(...v.runs),f=v.nextKey,!f)break}if(e.json){console.log(JSON.stringify({runs:h}));return}if(h.length===0){console.log("No runs for this schedule.");return}x(h);return}let{runs:i,nextKey:u}=await a.getScheduleRuns(s,n,o,{limit:e.limit,nextKey:e.nextKey});if(e.json){console.log(JSON.stringify({runs:i,nextKey:u}));return}if(i.length===0){console.log("No runs for this schedule.");return}x(i),u&&console.log(`Next page: --next-key ${u}`);return}if(r==="delete"){let o=e.scheduleId;o||(console.error("Missing schedule ID."),l(),process.exit(1)),await a.deleteSchedule(s,n,o),console.log(`Deleted schedule: ${o}`);return}if(r==="calendars"){let{accounts:o}=await a.getCalendarAccounts(s,n);if(e.json){console.log(JSON.stringify({accounts:o}));return}T(o);return}r!=="list"&&(console.error(`Unknown schedules command: ${r}`),l(),process.exit(1));let d=[],c;do{let o=await a.getSchedules(s,n,{nextKey:c,limit:100});d.push(...o.schedules),c=o.nextKey}while(c);if(e.json){console.log(JSON.stringify(d));return}if(d.length===0){console.log("No schedules in this workspace yet. Create one with `entrydesk schedules create --name <name> --prompt <text> --agent-id <id> --starts-at <time>`.");return}console.log(`Schedules (${d.length}):
|
|
66
|
-
`);for(let o of d){let i=o.isActive?"\x1B[32mActive\x1B[0m":"\x1B[33mPaused\x1B[0m";console.log(` ${o.name}`),console.log(` Agent: ${o.agent.name}`),console.log(` Repeat: ${N(o.config)}`),console.log(` Status: ${i}`),console.log(` Next run: ${o.nextRunAt?y(o.nextRunAt,o.utcOffset):"-"}`),console.log(` ID: ${o.id}`),console.log("")}}catch(t){k(t)}}export{H as runSchedules};
|
package/dist/skills-IK7KZZ45.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as ge,P as he,T as J,r as ye,y as O}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";import Mt from"crypto";import M from"fs";import h from"fs/promises";import ke from"os";import k from"path";import{Readable as _t}from"stream";import{pipeline as Kt}from"stream/promises";import zt from"adm-zip";import Wt from"archiver";import{isHTTPError as Gt}from"ky";import ne from"fs/promises";import ie from"path";import{execFileSync as kt}from"child_process";import x from"fs";import yt from"os";import $ from"path";import rt from"os";import B from"fs";import Qe from"os";import _ from"path";import le from"fs";import we from"path";var qe="skills-lock.json",V=".entrydesk",ce=1;function Se(){return{version:ce,skills:{}}}function ve(e){return we.join(e,V,qe)}function I(e){try{let t=JSON.parse(le.readFileSync(ve(e),"utf8"));return t.version!==ce||typeof t.skills!="object"||t.skills===null?Se():t}catch{return Se()}}function be(e,t){let o={};for(let s of Object.keys(t.skills).toSorted())o[s]=t.skills[s];let r={version:ce,...t.workspaceId?{workspaceId:t.workspaceId}:{},skills:o},i=ve(e);le.mkdirSync(we.dirname(i),{recursive:!0}),le.writeFileSync(i,`${JSON.stringify(r,null,2)}
|
|
3
|
-
`,"utf8")}function Z(e,t){return I(e).skills[t]}function F(e,t,o){let r=I(e);r.skills[t]=o,be(e,r)}function Ie(e,t){let o=I(e);if(!(t in o.skills))return!1;let{[t]:r,...i}=o.skills;return be(e,{...o,skills:i}),!0}var et="project.json",tt="global-link.json";function Le(e){try{let t=JSON.parse(B.readFileSync(e,"utf8"));return typeof t.workspaceId!="string"||t.workspaceId===""?void 0:t}catch{return}}function xe(e,t){B.mkdirSync(_.dirname(e),{recursive:!0}),B.writeFileSync(e,`${JSON.stringify(t,null,2)}
|
|
4
|
-
`,"utf8")}function $e(e){return B.existsSync(e)?(B.rmSync(e),!0):!1}function R(e){return _.join(e,V,et)}function H(){return _.join(Qe.homedir(),V,tt)}function Ee(){return Le(H())}function Y(e){xe(H(),e)}function Pe(){return $e(H())}function ae(e=process.cwd()){let t=_.resolve(e);for(;;){if(B.existsSync(R(t)))return t;let o=_.dirname(t);if(o===t)return;t=o}}function ot(e){return Le(R(e))}function X(e,t){xe(R(e),t)}function je(e){return $e(R(e))}function Ae(e=process.cwd()){let t=ae(e);if(!t)return;let o=ot(t);return o?{rootDir:t,link:o}:void 0}function Ce(e){let t=O();if(e&&t&&e!==t)throw new Error(`This directory is linked to a workspace on ${e}, but the active profile points at ${t}. Re-run 'entrydesk skills link' or switch profile.`)}function q(){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 \u2014 if the override was temporary, re-run the link without it.")}function v(e,t){if(e){let r=rt.homedir(),i=Ee();return i?(Ce(i.apiUrl),{rootDir:r,workspaceId:i.workspaceId,linked:!0}):{rootDir:r,workspaceId:t,linked:!1}}let o=Ae(process.cwd());return o?(Ce(o.link.apiUrl),{rootDir:o.rootDir,workspaceId:o.link.workspaceId,linked:!0}):{rootDir:process.cwd(),workspaceId:t,linked:!1}}import E from"fs";import K from"path";function Q(e,t){let o=K.dirname(e);E.mkdirSync(o,{recursive:!0});let r=E.mkdtempSync(K.join(o,`.${K.basename(e)}.tmp-`)),i=K.join(r,"next"),s=K.join(r,"prev");E.mkdirSync(i,{recursive:!0});let c=!1;try{t(i),E.existsSync(e)&&(E.renameSync(e,s),c=!0),E.renameSync(i,e)}catch(n){throw c&&!E.existsSync(e)&&E.renameSync(s,e),n}finally{E.rmSync(r,{recursive:!0,force:!0})}}import{createHash as Re}from"crypto";import ee from"fs";import z from"path";var De=new Set([".git","node_modules","__pycache__",".DS_Store","__MACOSX"]),Ne="SKILL.md";function nt(e){let t=ee.readdirSync(e,{withFileTypes:!0}).filter(r=>!De.has(r.name));if(t.some(r=>r.isFile()&&r.name===Ne))return e;let o=t.filter(r=>r.isDirectory());if(o.length===1){let r=z.join(e,o[0].name);if(ee.existsSync(z.join(r,Ne)))return r}return e}function Te(e,t,o){for(let r of ee.readdirSync(t,{withFileTypes:!0})){if(De.has(r.name))continue;let i=z.join(t,r.name);r.isDirectory()?Te(e,i,o):r.isFile()&&o.push({rel:z.relative(e,i).split(z.sep).join("/"),abs:i})}}function it(e){let t=[];Te(e,e,t),t.sort((r,i)=>r.rel<i.rel?-1:r.rel>i.rel?1:0);let o=Re("sha256");for(let r of t){let i=Re("sha256").update(ee.readFileSync(r.abs)).digest("hex");o.update(r.rel).update("\0").update(i).update("\0")}return o.digest("hex")}function P(e){return it(nt(e))}import L from"fs";import S from"path";var N=[{id:"claude-code",displayName:"Claude Code",skillsSubdir:S.join(".claude","skills"),rootMarker:".claude"},{id:"codex",displayName:"Codex",skillsSubdir:S.join(".codex","skills"),rootMarker:".codex"},{id:"cursor",displayName:"Cursor",skillsSubdir:S.join(".cursor","skills"),rootMarker:".cursor"},{id:"universal",displayName:"Universal (.agents)",skillsSubdir:S.join(".agents","skills"),rootMarker:".agents"}];function te(e,t){return S.join(t,e.skillsSubdir)}function st(e){let t=N.filter(o=>o.id==="universal"||L.existsSync(S.join(e,o.rootMarker)));return t.length>0?t:N.filter(o=>o.id==="universal")}function Ue(e){let t;try{t=L.lstatSync(e)}catch{return}t.isSymbolicLink()?L.unlinkSync(e):t.isDirectory()?L.rmSync(e,{recursive:!0,force:!0}):L.rmSync(e,{force:!0})}function lt(e,t,o,r="symlink"){let i=S.basename(S.dirname(t))||t,s=S.join(t,o);if(L.mkdirSync(t,{recursive:!0}),Ue(s),r==="symlink")try{let c=S.relative(t,e);return L.symlinkSync(c,s,process.platform==="win32"?"junction":"dir"),{agentId:i,linkPath:s,mode:"symlink",ok:!0}}catch{}try{return L.cpSync(e,s,{recursive:!0}),{agentId:i,linkPath:s,mode:"copy",ok:!0}}catch(c){return{agentId:i,linkPath:s,mode:"copy",ok:!1,error:c instanceof Error?c.message:String(c)}}}function Oe(e,t){let o=S.join(e,t);try{L.lstatSync(o)}catch{return!1}return Ue(o),!0}function Fe(e,t){let o;try{o=L.lstatSync(e)}catch{return!1}return o.isSymbolicLink()?S.resolve(S.dirname(e),L.readlinkSync(e))===S.resolve(t):!1}function ct(e,t){return t&&t.length>0?t.includes("*")?[...N]:N.filter(o=>t.includes(o.id)):st(e)}function oe(e,t,o,r="symlink",i){return ct(o,i).map(s=>lt(e,te(s,o),t,r))}import re from"path";var at=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function fe(e){if(!at.test(e))throw new Error(`Invalid skill name "${e}": must be lowercase letters, digits and single hyphens (e.g. "my-skill").`)}function b(e,t){fe(t);let o=re.resolve(e,".entrydesk","skills"),r=re.resolve(o,t);if(r!==re.join(o,t)||!r.startsWith(o+re.sep))throw new Error(`Refusing unsafe skill path for "${t}".`);return r}async function j(e,t,o){let r=[],i;do{let s=await e.listAvailableSkills(t,o,{nextKey:i,limit:100});r.push(...s.skills),i=s.nextKey}while(i);return r}import A from"fs";import de from"os";import D from"path";var Be=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,ft=/^([\w.-]+)\/([\w.-]+)(?:\/(.+))?$/u;function dt(e){return e==="~"?de.homedir():e.startsWith("~/")||e.startsWith("~\\")?D.join(de.homedir(),e.slice(2)):e}function ut(e){return e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.startsWith("~")||e.startsWith(".\\")||/^[a-zA-Z]:[\\/]/u.test(e)}function pt(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 He(e){let t=e.trim();if(ut(t))return{type:"local",path:D.resolve(dt(t))};if(t.startsWith("ed:")){let i=t.slice(3);return{type:"entrydesk",ref:i,isId:Be.test(i)}}if(Be.test(t))return{type:"entrydesk",ref:t,isId:!0};if(t.startsWith("git@")||t.endsWith(".git"))return{type:"git",url:t};let o=pt(t);if(o)return o;if(/^https?:\/\//u.test(t))return{type:"git",url:t};let r=ft.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 ue(e){return e.type==="github"?"github":e.type}var mt=new Set([".git","node_modules","__pycache__",".DS_Store",".entrydesk"]);function pe(e,t){if(!A.existsSync(D.join(e,"SKILL.md")))throw new Error(`No SKILL.md found at ${e}`);let o=A.realpathSync(e),r=A.existsSync(t)?A.realpathSync(t):D.resolve(t);if(o===r)return;let i=A.mkdtempSync(D.join(de.tmpdir(),"ed-local-skill-")),s=D.join(i,"skill");try{A.cpSync(o,s,{recursive:!0,filter:c=>!mt.has(D.basename(c))}),Q(t,c=>{A.cpSync(s,c,{recursive:!0})})}finally{A.rmSync(i,{recursive:!0,force:!0})}}var gt="skills@1.5.12";function Me(e){try{let t=x.readFileSync($.join(e,"SKILL.md"),"utf8"),o=/^name:\s*(.+?)\s*$/mu.exec(t.split(/^---\s*$/mu)[1]??"");if(o?.[1])return o[1].replace(/^['"]|['"]$/gu,"")}catch{}return $.basename(e)}async function ht(e,t){let{default:o}=await import("adm-zip"),r=new o(e);Q(t,i=>{let s=$.resolve(i)+$.sep;for(let c of r.getEntries()){if(c.isDirectory)continue;let n=$.resolve(i,c.entryName);if(!n.startsWith(s))throw new Error(`Zip entry contains path traversal: ${c.entryName}`);x.mkdirSync($.dirname(n),{recursive:!0}),x.writeFileSync(n,c.getData())}})}async function St(e,t){if(t.isId)return t.ref;let r=(await j(e.client,e.accessToken,e.workspaceId)).find(i=>i.name===t.ref||i.id===t.ref);if(!r)throw new Error(`Skill not found in workspace: ${t.ref}`);return r.id}function wt(e,t,o){let r=x.mkdtempSync($.join(yt.tmpdir(),"ed-npx-skills-")),i=["-y",gt,"add",e,"--copy","--yes"];try{kt("npx",i,{cwd:r,stdio:o?["ignore","pipe","pipe"]:"inherit"})}catch(l){throw x.rmSync(r,{recursive:!0,force:!0}),new Error(`npx skills failed for ${e}. Ensure npx + network are available. (${l instanceof Error?l.message:String(l)})`,{cause:l})}let s=$.join(r,".agents","skills");if(!x.existsSync(s))throw x.rmSync(r,{recursive:!0,force:!0}),new Error(`npx skills produced no skills under ${s}`);let c=x.readdirSync(s,{withFileTypes:!0}).filter(l=>l.isDirectory());if(c.length===0)throw x.rmSync(r,{recursive:!0,force:!0}),new Error("npx skills installed no skill directory");let n=c[0];if(c.length>1){let l=t.type==="github"&&t.subpath?$.basename(t.subpath):void 0,f=l?c.find(a=>a.name===l):void 0;if(!f)throw x.rmSync(r,{recursive:!0,force:!0}),new Error(`npx skills installed [${c.map(a=>a.name).join(", ")}]; ${l?`none matched the subpath "${l}"`:"specify a subpath to pick one"}.`);n=f}return{dir:$.join(s,n.name),tmpRoot:r}}async function _e(e,t){let o=e.configKey;if(!o)throw new Error("Missing source. Usage: entrydesk skills add <source>");let r=He(o),i=!!e.global,s=v(i,t.workspaceId),c=s.rootDir,n={...t,workspaceId:s.workspaceId};if(!s.linked){let u={workspaceId:t.workspaceId,apiUrl:O()};q(),i?Y(u):X(process.cwd(),u)}let l,f,a;if(r.type==="entrydesk"){f=await St(n,r);let u=await n.client.downloadSkillCurrent(n.accessToken,n.workspaceId,f);l=u.name,a=b(c,l);let m=await fetch(u.url);if(!m.ok)throw new Error(`Failed to download ${l}: ${m.status}`);await ht(Buffer.from(await m.arrayBuffer()),a)}else if(r.type==="local")l=Me(r.path),a=b(c,l),pe(r.path,a);else{let{dir:u,tmpRoot:m}=wt(o,r,!!e.json);try{l=Me(u),a=b(c,l),pe(u,a)}finally{x.rmSync(m,{recursive:!0,force:!0})}}let y=P(a),g={source:o,sourceType:ue(r),skillId:f,localHash:y,lastPulledHash:r.type==="entrydesk"?y:"",mode:"symlink",...r.type==="github"?{sourceUrl:r.url,ref:r.gitRef,subpath:r.subpath}:{},...r.type==="git"?{sourceUrl:r.url}:{}};F(c,l,g);let d=oe(a,l,c,"symlink",e.agents);e.json?console.info(JSON.stringify({name:l,sourceType:ue(r),hash:y},null,2)):console.info(`\u2713 added ${l} (${r.type}, ${y.slice(0,12)}) \u2192 agents: ${d.map(u=>u.agentId).join(", ")}`)}import G from"fs";import vt from"os";import W from"path";import bt from"archiver";function It(e){return typeof e!="object"||e===null?!1:e.response?.status===404||/\b404\b/u.test(String(e.message??""))}function Lt(e){return e.remoteHash===null?"create":e.currentHash===e.baseHash?"noop":!e.force&&e.remoteHash!==e.lastPulledHash?"stale":"push"}function xt(e){return new Promise((t,o)=>{let r=[],i=bt("zip",{zlib:{level:9}});i.on("data",s=>r.push(s)),i.on("error",o),i.on("end",()=>t(Buffer.concat(r))),i.directory(e,!1),i.finalize()})}async function $t(e,t){let{url:o}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,t),r=await fetch(o);if(!r.ok)throw new Error(`download for staleness check failed: ${r.status}`);let i=G.mkdtempSync(W.join(vt.tmpdir(),"ed-push-cmp-"));try{let{default:s}=await import("adm-zip");for(let c of new s(Buffer.from(await r.arrayBuffer())).getEntries()){if(c.isDirectory)continue;let n=W.resolve(i,c.entryName);n.startsWith(W.resolve(i)+W.sep)&&(G.mkdirSync(W.dirname(n),{recursive:!0}),G.writeFileSync(n,c.getData()))}return P(i)}finally{G.rmSync(i,{recursive:!0,force:!0})}}async function Ke(e,t,o,r,i,s,c){let n=await xt(r),l=new FormData;l.append("file",new Blob([n],{type:"application/zip"}),`${o}.zip`),c&&l.append("force","true");let f=await e.client.uploadSkill(e.accessToken,e.workspaceId,l);F(t,o,{...s,skillId:f.id,localHash:i,lastPulledHash:i})}async function Et(e,t,o,r,i){let s=b(t,o);if(!G.existsSync(s))throw new Error(`No local copy for ${o}`);let c=P(s);if(r.skillId){let f=null;try{f=await $t(e,r.skillId)}catch(a){if(!It(a))throw a}if(f!==null){let a=Lt({currentHash:c,baseHash:r.localHash,lastPulledHash:r.lastPulledHash,remoteHash:f,force:i});return a==="noop"||a==="stale"||await Ke(e,t,o,s,c,r,!0),a}}let l=(await j(e.client,e.accessToken,e.workspaceId)).find(f=>f.name===o);return l&&!i?"name-conflict":(await Ke(e,t,o,s,c,r,!!l),"create")}async function ze(e,t){let{rootDir:o,workspaceId:r}=v(!!e.global,t.workspaceId),i={...t,workspaceId:r},s=!!e.force,c=e.configKey?[e.configKey]:Object.keys(I(o).skills);if(c.length===0){console.info("Nothing to push \u2014 no tracked skills.");return}let n=!1;for(let l of c){let f=Z(o,l);if(!f){console.info(`\u2717 ${l}: not tracked (run: entrydesk skills add <source>)`),n=!0;continue}let a=await Et(i,o,l,f,s),y={create:`\u2713 pushed ${l} (created in workspace)`,push:`\u2713 pushed ${l}`,noop:`\xB7 ${l} unchanged`,stale:`\u2717 ${l} rejected \u2014 remote changed since last pull. Run 'entrydesk skills pull ${l}' first (or --force).`,"name-conflict":`\u2717 ${l} rejected \u2014 a different skill named "${l}" already exists in the workspace. Pull it first, or --force to overwrite.`};console.info(y[a]),(a==="stale"||a==="name-conflict")&&(n=!0)}n&&(process.exitCode=1)}import me from"fs";import Pt from"path";function jt(e,t,o,r){let i=[],s=[];for(let c of N){let n=Pt.join(te(c,t),e);try{me.lstatSync(n)}catch{continue}r||Fe(n,o)?i.push(c.id):s.push(c.id)}return{removable:i,preserved:s}}async function We(e,t){let o=e.configKey;if(!o)throw new Error("Missing skill name. Usage: entrydesk skills remove <name>");fe(o);let{rootDir:r,workspaceId:i}=v(!!e.global,t.workspaceId),s=Z(r,o),c=b(r,o),n=me.existsSync(c),l=!!s||n,{removable:f,preserved:a}=jt(o,r,c,l);if(!(l||f.length>0)&&!(e.remote&&s?.skillId)){a.length>0?console.info(`Left ${o} untouched in ${a.join(", ")} \u2014 not EntryDesk-managed; remove it manually if intended.`):console.info(`Nothing to remove \u2014 ${o} is not installed.`);return}let g=!1;e.remote&&(s?.skillId?(await t.client.deleteSkill(t.accessToken,i,s.skillId),g=!0):console.info(`\xB7 skipped --remote: no known workspace skillId for ${o} (it was never pushed from here).`));for(let p of N)f.includes(p.id)&&Oe(te(p,r),o);n&&me.rmSync(c,{recursive:!0,force:!0}),Ie(r,o);let d={name:o,canonicalRemoved:n,agentsUnlinked:f,agentsPreserved:a,untracked:!s,remoteDeleted:g};if(e.json){console.info(JSON.stringify(d,null,2));return}let u=f.length>0?` (agents: ${f.join(", ")})`:"",m=a.length>0?` \u2014 kept non-managed entries in ${a.join(", ")}`:"";console.info(`\u2713 removed ${o}${u}${g?" + deleted from workspace":""}${m}`)}import At from"fs";function Ct(e,t,o){return t?(o??e.localHash)===e.lastPulledHash?"synced":"ahead":e.skillId?"remote-deleted":"local-only"}var Ge={synced:"\u2014",ahead:"push (local edits)","local-only":"push (never uploaded)","remote-deleted":"push to restore, or remove","remote-only":"add / pull to install"},Rt={synced:"\u2713",ahead:"\u2191","local-only":"\u2299","remote-deleted":"\u26A0","remote-only":"\u2601"};async function Je(e,t){let o=!!e.global,{rootDir:r,workspaceId:i}=v(o,t.workspaceId),s=o?"global":"project",c=I(r).skills,n=await j(t.client,t.accessToken,i),l=new Map(n.map(d=>[d.id,d])),f=new Map(n.map(d=>[d.name,d])),a=[],y=new Set;for(let[d,u]of Object.entries(c)){let m=u.skillId?l.get(u.skillId):f.get(d);m&&y.add(m.id);let p=b(r,d),w=At.existsSync(p)?P(p):null,T=Ct(u,!!m,w);a.push({name:d,scope:s,state:T,hint:Ge[T]})}for(let d of n)y.has(d.id)||a.push({name:d.name,scope:s,state:"remote-only",hint:Ge["remote-only"]});if(a.sort((d,u)=>d.name<u.name?-1:d.name>u.name?1:0),e.json){console.info(JSON.stringify(a,null,2));return}if(a.length===0){console.info("No skills tracked locally or available in the workspace.");return}let g=(d,u)=>d.padEnd(u);console.info(`${g("NAME",26)}${g("SCOPE",9)}STATUS`);for(let d of a)console.info(`${g(d.name,26)}${g(d.scope,9)}${Rt[d.state]} ${g(d.state,16)}${d.hint}`)}var Ve=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;function Nt(e,t){let o=e.configKey&&Ve.test(e.configKey)?e.configKey:t.workspaceId,r={workspaceId:o,apiUrl:O()};if(q(),e.global)Y(r),console.info(`Linked ${H()} \u2192 workspace ${o}`);else{let i=process.cwd();X(i,r),console.info(`Linked ${R(i)} \u2192 workspace ${o}`)}}function Dt(e){if(e.global){Pe()?console.info(`Unlinked ${H()}`):console.info("No global link found.");return}let t=ae(process.cwd());t&&je(t)?console.info(`Unlinked ${R(t)}`):console.info("No project link found.")}async function Tt(e,t,o,r,i){let s=o.skillId;if(!s){let{skills:p}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),w=p.find(T=>T.name===o.name);if(!w)throw new Error(`Skill not found in workspace: ${o.name}`);s=w.id}let{url:c,name:n}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,s),l=await fetch(c);if(!l.ok)throw new Error(`Failed to download ${n}: ${l.status}`);let f=Buffer.from(await l.arrayBuffer()),a=b(t,n);await ne.rm(a,{recursive:!0,force:!0}),await ne.mkdir(a,{recursive:!0});let{default:y}=await import("adm-zip"),g=ie.resolve(a)+ie.sep;for(let p of new y(f).getEntries()){if(p.isDirectory)continue;let w=ie.resolve(a,p.entryName);if(!w.startsWith(g))throw new Error(`Zip entry contains path traversal: ${p.entryName}`);await ne.mkdir(ie.dirname(w),{recursive:!0}),await ne.writeFile(w,p.getData())}let d=P(a);F(t,n,{source:s,sourceType:"entrydesk",skillId:s,localHash:d,lastPulledHash:d,mode:"symlink"});let m=oe(a,n,t,"symlink",i);return r||console.info(`\u2713 pulled ${n} (${d.slice(0,12)}) \u2192 agents: ${m.map(p=>p.agentId).join(", ")}`),{name:n,hash:d}}async function Ut(e,t){let{rootDir:o,workspaceId:r}=v(!!e.global,t.workspaceId),i={...t,workspaceId:r},s=!!e.json,c=[];if(e.configKey)c.push(Ve.test(e.configKey)?{skillId:e.configKey}:{name:e.configKey});else{let l=I(o).skills;for(let[f,a]of Object.entries(l))c.push({skillId:a.skillId,name:f});if(c.length===0){console.info("Nothing to pull \u2014 no tracked skills. Try: entrydesk skills pull <name>");return}}let n=[];for(let l of c)n.push(await Tt(i,o,l,s,e.agents));s&&console.info(JSON.stringify(n,null,2))}var Ot=new Set(["add","pull","push","status","remove","link","unlink"]);function Ze(e){return Ot.has(e)}function Ye(e,t){return e.action==="add"?_e(e,t):e.action==="pull"?Ut(e,t):e.action==="push"?ze(e,t):e.action==="status"?Je(e,t):e.action==="remove"?We(e,t):(e.action==="link"?Nt(e,t):e.action==="unlink"&&Dt(e),Promise.resolve())}function Ft(e){return e.all?"all":e.remote&&!e.local?"remote":e.local&&!e.remote?"local":"all"}function Bt(e,t,o){let r=new Map(t.map(n=>[n.name,n])),i=new Map(Object.entries(e)),s=new Set;if(o!=="remote")for(let n of i.keys())s.add(n);if(o!=="local")for(let n of r.keys())s.add(n);let c=[];for(let n of s){let l=i.get(n),f=r.get(n);c.push({name:n,local:!!l,remote:!!f,sourceType:l?.sourceType,skillId:l?.skillId??f?.id})}return c.sort((n,l)=>n.name<l.name?-1:n.name>l.name?1:0),c}function Ht(e){return e.local&&e.remote?"local+remote":e.local?"local-only":"remote-only"}async function Xe(e,t){let o=Ft(e),{rootDir:r,workspaceId:i}=v(!!e.global,t.workspaceId),s=o==="remote"?{}:I(r).skills,c=o==="local"?[]:await j(t.client,t.accessToken,i),n=Bt(s,c,o);if(e.json){console.info(JSON.stringify(n,null,2));return}if(n.length===0){console.info(o==="local"?"No skills tracked locally.":"No skills available in the workspace.");return}let l=(f,a)=>f.padEnd(a);console.info(`${l("NAME",28)}${l("WHERE",14)}SOURCE`);for(let f of n)console.info(`${l(f.name,28)}${l(Ht(f),14)}${f.sourceType??"\u2014"}`)}function C(){console.log(`
|
|
5
|
-
Usage: entrydesk skills [list|upload|delete|download|toggle|versions|share] [options]
|
|
6
|
-
|
|
7
|
-
Commands:
|
|
8
|
-
list List available skills (default)
|
|
9
|
-
upload <file.zip> Upload a skill zip file
|
|
10
|
-
upload <folder> Upload a skill folder (auto-zipped)
|
|
11
|
-
delete <skillId> Delete a skill you own
|
|
12
|
-
download <skillId> Download and extract a skill to ./<skill-name>/
|
|
13
|
-
toggle <skillId> Enable/disable a skill for yourself (--enable/--disable)
|
|
14
|
-
versions <skillId> List a skill's version history
|
|
15
|
-
share <skillId> Show or manage sharing (user grants)
|
|
16
|
-
remove <name> Uninstall a skill locally (--remote also deletes it from the workspace)
|
|
17
|
-
|
|
18
|
-
Options:
|
|
19
|
-
--me Only list skills you created
|
|
20
|
-
--force Overwrite an existing skill with the same name
|
|
21
|
-
--local / --remote / --all For list: scope the inventory (local lock / workspace / merged)
|
|
22
|
-
--remote For remove: also delete the skill from the workspace
|
|
23
|
-
--enable / --disable For toggle: turn the skill on/off for yourself
|
|
24
|
-
--add-user <userId> For share: grant a user access (use with --role)
|
|
25
|
-
--remove-user <userId> For share: revoke a user's access
|
|
26
|
-
--role owner|editor|viewer Role for --add-user (default: viewer)
|
|
27
|
-
--json Output JSON (for list/upload)
|
|
28
|
-
`)}function Jt(e,t){let o=k.relative(e,t);return o===""||!o.startsWith("..")&&!k.isAbsolute(o)}async function Vt(e){let t=await h.realpath(e),o=[process.cwd(),ke.homedir()];if(!(await Promise.all(o.map(async s=>{try{return await h.realpath(s)}catch{return k.resolve(s)}}))).some(s=>Jt(s,t)))throw new Error("Invalid upload path: must be within the current directory or your home directory.")}async function Zt(e){let t=await h.mkdtemp(k.join(ke.tmpdir(),"entrydesk-skill-")),o=k.join(t,`${k.basename(e)}.zip`);return await new Promise((r,i)=>{let s=M.createWriteStream(o),c=Wt("zip",{zlib:{level:9}});s.on("close",()=>r()),s.on("error",i),c.on("error",i),c.pipe(s),c.directory(e,!1),c.finalize()}),{zipPath:o,cleanupDir:t}}function Yt(e){console.log(`Versions (${e.length}):
|
|
29
|
-
`);for(let t of e){let o=new Date(t.createdAt).toLocaleString();if(console.log(` v${t.versionNumber} \xB7 ${o}`),t.description){let r=t.description.length>100?`${t.description.slice(0,100)}\u2026`:t.description;console.log(` ${r}`)}console.log(` Version ID: ${t.id}`),console.log("")}}function Xt(e){let t=ye(e);if(console.log(`User grants (${t.length}):`),t.length===0){console.log(" (none)");return}for(let o of t)console.log(` - ${o.user.name} <${o.user.email}> \xB7 ${o.role}`),console.log(` ID: ${o.userId}`)}async function Vr(e){if(e.help){C();return}let t,o;try{let n=await he();t=n.accessToken,o=n.workspaceId}catch(n){J(n)}let r=e.action||"list",i=new ge;if(Ze(r)){try{await Ye(e,{accessToken:t,workspaceId:o,client:i})}catch(n){J(n)}return}if(r==="list"&&(e.local||e.remote||e.all)){try{await Xe(e,{accessToken:t,workspaceId:o,client:i})}catch(n){J(n)}return}if(r==="upload"){let n=e.configKey;n||(console.error("Missing file path."),C(),process.exit(1));let l=k.resolve(n),f;try{f=await h.stat(l)}catch{console.error(`File not found: ${l}`),process.exit(1)}let a=l,y=null;try{try{await Vt(l)}catch(m){let p=m instanceof Error?m.message:"Invalid upload path.";console.error(p),process.exit(1)}if(f.isDirectory()){let m=await Zt(l);a=m.zipPath,y=m.cleanupDir}else f.isFile()||(console.error(`Not a file or directory: ${l}`),process.exit(1));k.extname(a).toLowerCase()!==".zip"&&(console.error("Only .zip files are supported for upload."),process.exit(1));let g=await h.readFile(a),d=new FormData;d.append("file",new Blob([g],{type:"application/zip"}),k.basename(a)),e.force&&d.append("force","true");let u;try{u=await i.uploadSkill(t,o,d)}catch(m){throw Gt(m)&&m.response.status===409&&(console.error("Upload failed: A skill with this name already exists."),console.error("Use --force to overwrite the existing skill."),process.exit(1)),m}if(e.json){console.log(JSON.stringify(u));return}console.log(`Uploaded skill: ${u.name}`),console.log(` ID: ${u.id}`),console.log(` Version ID: ${u.versionId}`),console.log(` Description: ${u.description}`);return}finally{y&&await h.rm(y,{recursive:!0,force:!0})}}if(r==="toggle"){let n=e.configKey;n||(console.error("Missing skill ID."),C(),process.exit(1)),e.enable===e.disable&&(console.error("Pass exactly one of --enable or --disable."),process.exit(1));let l=!!e.enable,f=await i.updateSkillPreference(t,o,n,l);if(e.json){console.log(JSON.stringify(f));return}console.log(`${f.isEnabled?"Enabled":"Disabled"} skill for you: ${n}`);return}if(r==="versions"){let n=e.configKey;n||(console.error("Missing skill ID."),C(),process.exit(1));let l=await i.getSkillVersions(t,o,n);if(e.json){console.log(JSON.stringify(l));return}if(l.versions.length===0){console.log("No versions for this skill.");return}Yt(l.versions);return}if(r==="share"){let n=e.configKey;n||(console.error("Missing skill ID."),C(),process.exit(1));let l=e.role??"viewer";if(e.addUser){let a=await i.upsertSkillGrant(t,o,n,e.addUser,l);if(e.json){console.log(JSON.stringify(a));return}console.log(`Granted ${l} to user ${e.addUser}`);return}if(e.removeUser){if(await i.removeSkillGrant(t,o,n,e.removeUser),e.json){console.log(JSON.stringify({userId:e.removeUser,removed:!0}));return}console.log(`Revoked access for user ${e.removeUser}`);return}let f=await i.getSkillGrants(t,o,n);if(e.json){console.log(JSON.stringify(f));return}Xt(f);return}if(r==="delete"){let n=e.configKey;n||(console.error("Missing skill ID."),C(),process.exit(1)),await i.deleteSkill(t,o,n),console.log(`Deleted skill: ${n}`);return}if(r==="download"){let n=e.configKey;n||(console.error("Missing skill ID."),C(),process.exit(1));let{url:l,name:f}=await i.downloadSkillCurrent(t,o,n);(f.includes("/")||f.includes(k.sep)||f==="."||f===".."||!f)&&(console.error(`Invalid skill name for output directory: ${f}`),process.exit(1));let a=k.resolve(f),y=await h.mkdtemp(k.join(ke.tmpdir(),"entrydesk-skill-download-")),g=k.join(y,`${f}.zip`);try{let d=await fetch(l);if(!d.ok)throw new Error(`Failed to download skill zip: ${d.status} ${d.statusText}`);if(!d.body)throw new Error("Response body is empty");let u=M.createWriteStream(g);await Kt(_t.fromWeb(d.body),u);let m=await h.mkdtemp(k.join(k.dirname(a),".entrydesk-skill-extract-")),p=null;try{e.json||console.log("Extracting\u2026");let w=new zt(g),T=k.resolve(m)+k.sep;for(let U of w.getEntries()){if(U.isDirectory)continue;let se=k.resolve(m,U.entryName);if(!se.startsWith(T))throw new Error(`Zip entry contains path traversal: ${U.entryName}`);await h.mkdir(k.dirname(se),{recursive:!0}),await h.writeFile(se,U.getData())}M.existsSync(a)&&(p=k.join(k.dirname(a),`.entrydesk-backup-${Mt.randomUUID()}`),e.json||console.log(`Replacing existing directory: ${a}`),await h.rename(a,p));try{await h.rename(m,a),p&&M.existsSync(p)&&(await h.rm(p,{recursive:!0,force:!0}),p=null)}catch(U){throw p&&M.existsSync(p)&&(await h.rename(p,a),p=null),U}}catch(w){if(await h.rm(m,{recursive:!0,force:!0}),p&&M.existsSync(p))try{await h.rename(p,a)}catch{console.error(`Warning: Could not restore backup. Your original files are at: ${p}`)}throw w}if(e.json){console.log(JSON.stringify({skillId:n,skillName:f,outputDir:a}));return}console.log(`Downloaded skill "${f}" to ${a}`)}finally{await h.rm(y,{recursive:!0,force:!0})}return}r!=="list"&&(console.error(`Unknown skills command: ${r}`),C(),process.exit(1));let s=[],c;do{let n=await i.listAvailableSkills(t,o,{createdBy:e.createdBy,nextKey:c,limit:100});s.push(...n.skills),c=n.nextKey}while(c);if(e.json){console.log(JSON.stringify(s));return}if(s.length===0){console.log("No skills in this workspace yet. Upload one with `entrydesk skills upload <path>`, or browse `entrydesk marketplace`.");return}console.log(`Available skills (${s.length}):
|
|
30
|
-
`);for(let n of s)console.log(` ${n.name} (${n.provider})`),console.log(` ${n.description.slice(0,120)}`),console.log(` ID: ${n.id}`),console.log(` Author: ${n.author.name}`),console.log("")}export{C as printSkillsUsage,Vr as runSkills};
|
package/dist/status-OKGY6H3C.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{B as f,C as p,H as d,L as m,O as u,T as k,v as g,w as c,y as a}from"./chunk-UVF7TGFB.js";import"./chunk-JMYSCKCF.js";async function C(n){try{let o=g.getEffectiveProfileName(),e=a(),s={model:c.getDefaultModel(),connectors:c.getDefaultConnectorIds()},l=d();if(l){n.json?console.log(JSON.stringify({loggedIn:!0,authSource:l.authSource,profile:o,server:e,workspaceId:l.workspaceId,defaults:s})):(console.log(`Profile: ${o}`),console.log(`Server: ${e}`),console.log(`Authenticated via ${l.label} (no login required)`),console.log(`Workspace ID: ${l.workspaceId}`));return}let r=await f.getAll();if(!r){n.json?console.log(JSON.stringify({loggedIn:!1,profile:o,server:e,defaults:s})):(console.log(`Profile: ${o}`),console.log(`Server: ${e}`),console.log("Not logged in"),console.log("Run `entrydesk login` to log in"));return}let t;if(r.workspaceId)try{let i=new p,I=await u(),{workspaces:w}=await i.getWorkspaces(I);t=w.find(S=>S.id===r.workspaceId)?.name}catch(i){if(i instanceof m){n.json?console.log(JSON.stringify({loggedIn:!1,profile:o,server:e,defaults:s})):(console.log(`Profile: ${o}`),console.log(`Server: ${e}`),console.log("Not logged in"),console.log("Run `entrydesk login` to log in"));return}}n.json?console.log(JSON.stringify({loggedIn:!0,authSource:"file",profile:o,server:e,email:r.email,workspaceId:r.workspaceId,workspaceName:t,defaults:s})):(console.log(`Profile: ${o}`),console.log(`Server: ${e}`),console.log(`Logged in as ${r.email}`),t&&console.log(`Workspace: ${t}`),r.workspaceId&&console.log(`Workspace ID: ${r.workspaceId}`))}catch(o){k(o)}}export{C as runStatus};
|