@entrydesk/cli 2.2.0-beta → 2.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/add-BJv6tPO-.js +10 -0
- package/dist/agents-fP3hIH7X.js +10 -0
- package/dist/{billing-DHV0Wfwm.js → billing-Cy0BYngu.js} +1 -1
- package/dist/{budget-Dvl1Q6_g.js → budget-MVbF8WbS.js} +1 -1
- package/dist/build-task-request-config-BzI-dDZP.js +10 -0
- package/dist/{commands-qNH4DlB_.js → commands-CfDSEDKI.js} +1 -1
- package/dist/{commands-ghS7KAQr.js → commands-DU48SG8W.js} +1 -1
- package/dist/config-Cl-c7scx.js +11 -0
- package/dist/connectors-DVzXDbUU.js +11 -0
- package/dist/{file-upload-CgLvxPGL.js → file-upload-Dq6B0x4m.js} +3 -3
- package/dist/{format-BaXJBAlk.js → format-CIj0qQba.js} +1 -1
- package/dist/{hash-CnSb1n2t.js → hash-92fWniGT.js} +1 -1
- package/dist/index.js +25 -20
- package/dist/{instruction-DaoJgFgE.js → instruction-6ZWRQh4G.js} +1 -1
- package/dist/{login-CVUzJp76.js → login-CO1aBG6c.js} +1 -1
- package/dist/{resource-grants-DMj0dy5m.js → logout-WKIZVWJ7.js} +1 -1
- package/dist/{marketplace-C-7CArF7.js → marketplace-C0C2JpYf.js} +2 -2
- package/dist/{mcp-BnFLUTG-.js → mcp-CqMrd5AI.js} +2 -2
- package/dist/{mcp-client-CPFC6TCy.js → mcp-client-CEH9X7Vs.js} +1 -1
- package/dist/meeting-C5vHfcTw.js +11 -0
- package/dist/message-utils-D48Yqd9T.js +25 -0
- package/dist/{models-pzt8nNX7.js → models-BENTHton.js} +2 -2
- package/dist/{notifications-Bo7oPqK5.js → notifications-DdadH0Wc.js} +1 -1
- package/dist/{paginate-DetNe5nU.js → paginate-Cbe4RaEq.js} +1 -1
- package/dist/paths-BiowKnkz.js +10 -0
- package/dist/profile-hhU_G-Ea.js +10 -0
- package/dist/profile-storage-CKrZ-xsd.js +73 -0
- package/dist/{project-context-D8YawkvR.js → project-context-DeYepfN2.js} +1 -1
- package/dist/{project-governance-EFbI_Qan.js → project-governance-R__UPIhr.js} +1 -1
- package/dist/{project-sources-CFgB4loh.js → project-sources-C-MXx6j-.js} +1 -1
- package/dist/project-sources-write-ygvHaDUu.js +10 -0
- package/dist/{project-tasks-Bk8-wOyn.js → project-tasks-B0STK_8Q.js} +1 -1
- package/dist/{project-CPKxduou.js → project-xiz3Jopl.js} +1 -1
- package/dist/{push-4Y4mjxO7.js → push-BxQQWCZ2.js} +1 -1
- package/dist/{recordings-DtgXMjp2.js → recordings-68Oe1Kvd.js} +2 -2
- package/dist/{remove-DUFnCuRT.js → remove-C7BCBdoq.js} +1 -1
- package/dist/resolve-IOW00hfy.js +14 -0
- package/dist/resource-grants-Bb4evqsH.js +10 -0
- package/dist/{schedules-6T2-994t.js → schedules-wopieg4D.js} +2 -2
- package/dist/skills-Drr0gw-l.js +10 -0
- package/dist/{status-DHllWQ7c.js → status-Bw2E5bfa.js} +1 -1
- package/dist/status-DX6A6ugk.js +10 -0
- package/dist/task-bZNZ_yxV.js +116 -0
- package/dist/tasks-ZC9uSdkB.js +22 -0
- package/dist/{tasks-CLlI3fiV.js → tasks-lK8PTMnE.js} +1 -1
- package/dist/{team-aQszguLF.js → team-8-enl9cj.js} +2 -2
- package/dist/teams-ByeuT2Ks.js +10 -0
- package/dist/{logout-B6Bb4w2Y.js → token-DrAF7BWj.js} +1 -1
- package/dist/tool-82NKBr29.js +17 -0
- package/dist/update-DfOBWme1.js +10 -0
- package/dist/{usage-BLPq7c6l.js → usage-BS_didkP.js} +1 -1
- package/dist/{usage-audit-BYvZgTJp.js → usage-audit-DOuyWGaq.js} +3 -3
- package/dist/{version-jPJWKUcc.js → version-D7DOD1ug.js} +1 -1
- package/dist/{webhook-BxPA95wd.js → webhook-Da2l-gv6.js} +1 -1
- package/dist/{workflow-DJkPvmuA.js → workflow-oudE3gsp.js} +4 -4
- package/dist/{workspaces-CDotU443.js → workspaces-9SRfDSh3.js} +2 -2
- package/package.json +5 -4
- package/dist/add-A1EZKhMH.js +0 -10
- package/dist/agents-CZzVru0_.js +0 -10
- package/dist/build-task-request-config-B_mlDg_c.js +0 -10
- package/dist/config-B3pbK-VP.js +0 -11
- package/dist/connectors-Dqa8qg7s.js +0 -11
- package/dist/meeting-B5-UQSO3.js +0 -11
- package/dist/message-utils-DRHsMlj2.js +0 -15
- package/dist/paths-CLGwOhp4.js +0 -10
- package/dist/profile-Cth2_rzi.js +0 -10
- package/dist/profile-storage-BVSyHoBn.js +0 -68
- package/dist/project-sources-write-DUx1voCZ.js +0 -10
- package/dist/resolve-yAqzT64X.js +0 -14
- package/dist/skills-C56S2Z62.js +0 -10
- package/dist/status-BBvz4l0p.js +0 -10
- package/dist/task-Hcgf0oDf.js +0 -110
- package/dist/tasks-D2CtxbpJ.js +0 -22
- package/dist/tool-CASBzR_z.js +0 -17
- package/dist/update-CSh9DfHK.js +0 -10
package/README.md
CHANGED
|
@@ -43,8 +43,29 @@ entrydesk
|
|
|
43
43
|
entrydesk login # OAuth device flow — prints a verification URL + code to enter
|
|
44
44
|
entrydesk status
|
|
45
45
|
entrydesk logout
|
|
46
|
+
entrydesk token # Print a fresh access token for scripts
|
|
46
47
|
```
|
|
47
48
|
|
|
49
|
+
### Scripting with the access token
|
|
50
|
+
|
|
51
|
+
`entrydesk token` prints a valid access token and nothing else, refreshing the
|
|
52
|
+
stored session first when it is about to expire, so scripts and CI can call the
|
|
53
|
+
API directly without reading the keychain:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
entrydesk token --json # {"token":"…","expiresAt":"…","workspaceId":"…"}
|
|
57
|
+
WORKSPACE_ID=$(entrydesk token --json | jq -r .workspaceId)
|
|
58
|
+
curl -H "Authorization: Bearer $(entrydesk token)" \
|
|
59
|
+
"https://api.entrydesk.com/v1/workspaces/$WORKSPACE_ID/agents"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Call workspace-scoped endpoints (`/v1/workspaces/<id>/...`) with the printed
|
|
63
|
+
token: a personal access token (`ENTRYDESK_TOKEN`) is only accepted there, and
|
|
64
|
+
account-level endpoints such as `/v1/workspaces` reject it with 403.
|
|
65
|
+
`expiresAt` is read from the token itself and omitted when it carries none;
|
|
66
|
+
when `ENTRYDESK_TOKEN` is set, that token is printed as-is. The token is a
|
|
67
|
+
bearer credential for your account — keep it out of logs and shared output.
|
|
68
|
+
|
|
48
69
|
### Credential Storage
|
|
49
70
|
|
|
50
71
|
By default, EntryDesk CLI stores credentials in the OS keychain when available.
|
|
@@ -529,12 +550,21 @@ entrydesk agents --json # Output in JSON format
|
|
|
529
550
|
entrydesk agents create --name "My Agent" --description "..." --system-prompt "..." --model-id <modelId>
|
|
530
551
|
entrydesk agents update <agentId> --name "New Name" --description "..." --system-prompt "..." --model-id <modelId>
|
|
531
552
|
entrydesk agents delete <agentId>
|
|
553
|
+
|
|
554
|
+
# Icons: give an agentId to apply the icon to that agent, or omit it to only print the iconId and URL
|
|
555
|
+
entrydesk agents icon generate <agentId> # AI icon from the agent's name and description
|
|
556
|
+
entrydesk agents icon generate --name "Bot" --description "..." # Icon for --icon-id on create/update
|
|
557
|
+
entrydesk agents icon upload ./icon.png <agentId> # PNG, JPEG, GIF, or WebP, up to 10MB
|
|
558
|
+
# generate falls back to the system prompt when the agent has no description.
|
|
559
|
+
# Applying an icon fails instead of overwriting if someone edits the agent meanwhile;
|
|
560
|
+
# the error prints the `agents update <agentId> --icon-id <iconId>` command to apply it.
|
|
532
561
|
```
|
|
533
562
|
|
|
534
563
|
## Meetings and Recordings
|
|
535
564
|
|
|
536
565
|
```bash
|
|
537
566
|
entrydesk meeting # List meetings
|
|
567
|
+
entrydesk meeting record https://meet.google.com/abc-defg-hij # Send a recording bot into the call now
|
|
538
568
|
entrydesk meeting get <meetingId> # Details and its recordings
|
|
539
569
|
entrydesk meeting summary <meetingId> # Print the summary as markdown
|
|
540
570
|
entrydesk meeting transcript <recordingId> # Print a transcript (--raw for timestamps)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{I as e}from"./profile-storage-CKrZ-xsd.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,d as r,f as i,g as a,i as o,r as s}from"./paths-BiowKnkz.js";import{t as c}from"./hash-92fWniGT.js";import{r as l}from"./installer-CKB3jBE-.js";import{t as u}from"./remote-D3JMUBbh.js";import d from"node:fs";import f from"node:os";import p from"node:path";import m from"cross-spawn";function h(e,t){let n=p.dirname(e);d.mkdirSync(n,{recursive:!0});let r=d.mkdtempSync(p.join(n,`.${p.basename(e)}.tmp-`)),i=p.join(r,`next`),a=p.join(r,`prev`);d.mkdirSync(i,{recursive:!0});let o=!1;try{t(i),d.existsSync(e)&&(d.renameSync(e,a),o=!0),d.renameSync(i,e)}catch(t){throw o&&!d.existsSync(e)&&d.renameSync(a,e),t}finally{d.rmSync(r,{recursive:!0,force:!0})}}const g=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,_=/^([\w.-]+)\/([\w.-]+)(?:\/(.+))?$/u;function v(e){return e===`~`?f.homedir():e.startsWith(`~/`)||e.startsWith(`~\\`)?p.join(f.homedir(),e.slice(2)):e}function y(e){return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||e.startsWith(`~`)||e.startsWith(`.\\`)||/^[a-zA-Z]:[\\/]/u.test(e)}function b(e){let[,t,n,r,i]=/^https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/tree\/([^/]+)(?:\/(.+))?)?\/?$/u.exec(e)??[];return t===void 0||n===void 0?null:{type:`github`,owner:t,repo:n,gitRef:r,subpath:i,url:`https://github.com/${t}/${n}`}}function x(e){let t=e.trim();if(y(t))return{type:`local`,path:p.resolve(v(t))};if(t.startsWith(`ed:`)){let e=t.slice(3);return{type:`entrydesk`,ref:e,isId:g.test(e)}}if(g.test(t))return{type:`entrydesk`,ref:t,isId:!0};if(t.startsWith(`git@`)||t.endsWith(`.git`))return{type:`git`,url:t};let n=b(t);if(n)return n;if(/^https?:\/\//u.test(t))return{type:`git`,url:t};let[,r,i,a]=_.exec(t)??[];return r!==void 0&&i!==void 0?{type:`github`,owner:r,repo:i,subpath:a,url:`https://github.com/${r}/${i}`}:{type:`entrydesk`,ref:t,isId:!1}}function S(e){return e.type===`github`?`github`:e.type}const C=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`.entrydesk`]);function w(e,t){if(!d.existsSync(p.join(e,`SKILL.md`)))throw Error(`No SKILL.md found at ${e}`);let n=d.realpathSync(e);if(n===(d.existsSync(t)?d.realpathSync(t):p.resolve(t)))return;let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-local-skill-`)),i=p.join(r,`skill`);try{d.cpSync(n,i,{recursive:!0,filter:e=>!C.has(p.basename(e))}),h(t,e=>{d.cpSync(i,e,{recursive:!0})})}finally{d.rmSync(r,{recursive:!0,force:!0})}}function T(e){try{let t=d.readFileSync(p.join(e,`SKILL.md`),`utf8`),n=/^name:\s*(.+?)\s*$/mu.exec(t.split(/^---\s*$/mu)[1]??``);if(n?.[1])return n[1].replace(/^['"]|['"]$/gu,``)}catch{}return p.basename(e)}async function E(e,t){let{default:n}=await import(`adm-zip`),r=new n(e);h(t,e=>{let t=p.resolve(e)+p.sep;for(let n of r.getEntries()){if(n.isDirectory)continue;let r=p.resolve(e,n.entryName);if(!r.startsWith(t))throw Error(`Zip entry contains path traversal: ${n.entryName}`);d.mkdirSync(p.dirname(r),{recursive:!0}),d.writeFileSync(r,n.getData())}})}async function D(e,t){if(t.isId)return t.ref;let n=(await u(e.client,e.accessToken,e.workspaceId)).find(e=>e.name===t.ref||e.id===t.ref);if(!n)throw Error(`Skill not found in workspace: ${t.ref}`);return n.id}function O(e,t,n){let r=d.mkdtempSync(p.join(f.tmpdir(),`ed-npx-skills-`)),i=[`-y`,`skills@1.5.12`,`add`,e,`--copy`,`--yes`];try{let e=m.sync(`npx`,i,{cwd:r,stdio:n?[`ignore`,`pipe`,`pipe`]:`inherit`});if(e.error)throw e.error;if(e.status!==0){let t=e.stderr?.toString().trim();throw Error(`npx exited with code ${e.status??`null`}${t?`: ${t}`:``}`)}}catch(t){throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills failed for ${e}. Ensure npx + network are available. (${t instanceof Error?t.message:String(t)})`,{cause:t})}let a=p.join(r,`.agents`,`skills`);if(!d.existsSync(a))throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills produced no skills under ${a}`);let o=d.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()),[s]=o;if(s===void 0)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed no skill directory`);let c=s;if(o.length>1){let e=t.type===`github`&&t.subpath?p.basename(t.subpath):void 0,n=e?o.find(t=>t.name===e):void 0;if(!n)throw d.rmSync(r,{recursive:!0,force:!0}),Error(`npx skills installed [${o.map(e=>e.name).join(`, `)}]; ${e?`none matched the subpath "${e}"`:`specify a subpath to pick one`}.`);c=n}return{dir:p.join(a,c.name),tmpRoot:r}}async function k(u,f,p){let m=x(u),h=!!f.global,g=await o(h,p.workspaceId),_=g.rootDir,v={...p,workspaceId:g.workspaceId};if(!g.linked){let t={workspaceId:p.workspaceId,apiUrl:await e()};n(),h?r(t):i(process.cwd(),t)}let y,b,C;if(m.type===`entrydesk`){b=await D(v,m);let e=await v.client.downloadSkillCurrent(v.accessToken,v.workspaceId,b);y=e.name,C=s(_,y);let t=await fetch(e.url);if(!t.ok)throw Error(`Failed to download ${y}: ${t.status}`);await E(Buffer.from(await t.arrayBuffer()),C)}else if(m.type===`local`)y=T(m.path),C=s(_,y),w(m.path,C);else{let{dir:e,tmpRoot:t}=O(u,m,!!f.json);try{y=T(e),C=s(_,y),w(e,C)}finally{d.rmSync(t,{recursive:!0,force:!0})}}let k=c(C),A={source:u,sourceType:S(m),skillId:b,localHash:k,lastPulledHash:m.type===`entrydesk`?k:``,mode:`symlink`,...m.type===`github`?{sourceUrl:m.url,ref:m.gitRef,subpath:m.subpath}:{},...m.type===`git`?{sourceUrl:m.url}:{}};a(_,y,A);let j=l(C,y,_,`symlink`,f.agent);f.json?console.info(t({name:y,sourceType:S(m),hash:k},2)):console.info(`✓ added ${y} (${m.type}, ${k.slice(0,12)}) → agents: ${j.map(e=>e.agentId).join(`, `)}`)}export{k as runSkillsAdd};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,D as t,O as n,an as r,bt as i,cn as a,in as o,ln as s,p as c,r as l,tn as u,yt as d}from"./profile-storage-CKrZ-xsd.js";import{n as f,t as p}from"./file-upload-Dq6B0x4m.js";import{n as m,t as h}from"./terminal-text-cBPBiP3x.js";import{t as g}from"./resource-grants-Bb4evqsH.js";import{HTTPError as _}from"ky";const v=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function y(e){return e?s([...new Set(e)]):r}function b(e){console.log(`Available agents (${e.length}):\n`);for(let t of e){if(console.log(` ${t.name} (${t.visibility})`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ID: ${t.id}`),console.log(``)}}function x(e){console.log(`My agents (${e.length}):\n`);for(let t of e){let e=[];t.latestVersionNumber!=null&&e.push(`v${t.latestVersionNumber}`),t.hasUnpublishedChanges&&e.push(`unpublished changes`);let n=e.length>0?` (${e.join(` · `)})`:``;if(console.log(` ${t.name}${n}`),t.description){let e=t.description.length>80?`${t.description.slice(0,80)}…`:t.description;console.log(` ${e}`)}console.log(` ${t.myRole??`no-role`} · ID: ${t.id}`),console.log(``)}}function S(e){if(console.log(`${e.name}\n`),console.log(` ID: ${e.id}`),e.visibility&&console.log(` Visibility: ${e.visibility}`),e.model&&console.log(` Model: ${e.model.name}`),e.author&&console.log(` Author: ${e.author.name}${e.author.isMe?` (you)`:``}`),e.description&&console.log(` Description: ${e.description}`),e.capabilities){let t=a(e.capabilities).map(e=>i(e));t.length>0&&console.log(` Capabilities: ${t.join(`, `)}`)}e.connectors&&e.connectors.length>0&&console.log(` Connectors: ${e.connectors.map(e=>e.name).join(`, `)}`),e.tools&&e.tools.length>0&&console.log(` Tools: ${e.tools.length}`),e.conversationStarters&&e.conversationStarters.length>0&&console.log(` Starters: ${e.conversationStarters.length}`),e.systemPrompt&&console.log(`\n System prompt:\n${e.systemPrompt}`)}async function C(t){let{accessToken:n,workspaceId:r}=await c(),i=new e;if(t.mine){let e=[],a=t.all?void 0:t.nextKey;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getMyAgents(n,r,{limit:t.limit,nextKey:a});if(e.push(...s.agents),a=s.nextKey,!t.all||!a)break}if(t.json){console.log(h({agents:e,nextKey:a}));return}if(e.length===0){console.log("You own no agents in this workspace. Create one with `entrydesk agents create --name <name> …`, or browse `entrydesk marketplace`.");return}x(e),!t.all&&a&&console.log(`Next page: --next-key ${a}`);return}if(t.all){let e=[],a;for(let o=0;;o++){o>=100&&(console.error(`Reached maximum page limit (100). Use --limit and --next-key for manual pagination.`),process.exit(1));let s=await i.getAgents(n,r,{limit:t.limit??100,nextKey:a});if(e.push(...s.agents),a=s.nextKey,!a)break}if(t.json){console.log(h({agents:e}));return}if(e.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(e);return}let{agents:a,nextKey:o}=await i.getAgents(n,r,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(h({agents:a,nextKey:o}));return}if(a.length===0){console.log("No agents in this workspace yet. Create one with `entrydesk agents create`, or browse `entrydesk marketplace`.");return}b(a),o&&console.log(`Next page: --next-key ${o}`)}async function w(t,n){let{accessToken:r,workspaceId:i}=await c(),a=await new e().getAgent(r,i,t);if(n.json){console.log(h(a));return}S(a)}async function T(t){let{accessToken:n,workspaceId:r}=await c(),i=await new e().createAgent(n,r,{name:t.name,description:t.description,systemPrompt:t.systemPrompt,modelId:t.modelId,connectorIds:t.connectorIds??[],capabilities:y(t.capabilities),conversationStarters:t.conversationStarters??[],tools:t.tools,iconId:t.iconId});if(t.json){console.log(h(i));return}console.log(`Created agent: ${i.name}`),console.log(` ID: ${i.id}`)}function E(e,t){return{name:t.name??e.name,description:t.description??e.description,systemPrompt:t.systemPrompt??e.systemPrompt??``,modelId:t.modelId??e.model?.id??``,connectorIds:t.connectorIds??e.connectors?.map(e=>e.id)??[],capabilities:t.capabilities?y(t.capabilities):e.capabilities??{},conversationStarters:t.conversationStarters??e.conversationStarters??[],tools:t.tools??e.tools??[],iconId:t.iconId??e.iconId}}async function D(t,n){let{accessToken:r,workspaceId:i}=await c(),a=new e,o=await a.getAgent(r,i,t);await a.updateAgent(r,i,t,E(o,n)),console.log(`Updated agent: ${t}`)}async function O(e){let t=n(e),r;try{r=await f(e,{maxBytes:d})}catch(e){if(!(e instanceof p))throw e;switch(e.problem){case`missing`:throw new l(`No file at ${t}.`);case`not_a_file`:throw new l(`${t} is not a regular file.`);case`too_large`:throw new l(`${t} is larger than ${d/1024/1024}MB, the agent icon limit.`);case`unreadable`:throw new l(`Could not read ${t}. Check its permissions.`)}}if(!v.has(r.mimeType))throw new l(`${t} is not a supported icon image. Use a PNG, JPEG, GIF, or WebP file (.png, .jpg, .jpeg, .gif, .webp).`);return r}async function k(t){let{accessToken:n,workspaceId:r}=await c(),i=new e;return{client:i,accessToken:n,workspaceId:r,agent:t?await i.getAgent(n,r,t):void 0}}async function A({client:e,accessToken:n,workspaceId:r},i,a){let o=await e.getAgentHeadVersionId(n,r,i),s=await e.getAgent(n,r,i);try{await e.updateAgent(n,r,i,{...E(s,{iconId:a}),expectedHeadVersionId:o})}catch(e){throw e instanceof _&&t(e.data)===`agent_version_conflict`?new l(`Agent ${i} was changed by someone else while the icon was being made, so it was not applied. Apply it with \`entrydesk agents update ${i} --icon-id ${a}\`.`):e}}async function j(e,t,n){let{agent:r}=e;if(r&&await A(e,r.id,t.iconId),n.json){console.log(h({...t,agentId:r?.id}));return}if(console.log(`Icon ID: ${t.iconId}`),console.log(`URL: ${m(t.url)}`),r){console.log(`\nApplied the icon to agent: ${m(r.name)} (${r.id})`);return}console.log(`\nApply it with \`entrydesk agents update <agentId> --icon-id ${t.iconId}\`.`)}async function M(e,t){if(!e&&(!t.name?.trim()||!t.description?.trim()))throw new l(`Pass --name and --description, or an agentId to generate the icon from that agent.`);let n=await k(e),r=t.name??n.agent?.name??``,i=t.description??(n.agent?.description.trim()?n.agent.description:n.agent?.systemPrompt??``);if(!r.trim()||!i.trim())throw new l(`Agent ${e} has no ${r.trim()?`description or system prompt`:`name`} to generate an icon from. Pass --name and --description.`);await j(n,await n.client.generateAgentIcon(n.accessToken,n.workspaceId,{name:r,description:i}),t)}async function N(e,t,n){let r=await O(e),i=await k(t);await j(i,await i.client.uploadAgentIcon(i.accessToken,i.workspaceId,r),n)}async function P(t){let{accessToken:n,workspaceId:r}=await c();await new e().deleteAgent(n,r,t),console.log(`Deleted agent: ${t}`)}async function F(e,t,n,r){let i;do{let a=await e.getMyAgents(t,n,{nextKey:i}),o=a.agents.find(e=>e.id===r);if(o)return o;i=a.nextKey}while(i)}function I(e){return{resource:{collection:`agents`,id:e},label:`agent`,publishResourceType:o.AGENT,findEditable:(t,n,r)=>F(t,n,r,e)}}async function L(e,t){await g(I(e),{...t,addWorkspace:!0,role:u.VIEWER})}async function R(e,t){await g(I(e),t)}export{T as createAgent,P as deleteAgent,M as generateAgentIcon,C as listAgents,L as publishAgent,R as shareAgent,w as showAgent,D as updateAgent,N as uploadAgentIcon};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{
|
|
10
|
+
import{C as e,p as t,x as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i,n as a}from"./format-CIj0qQba.js";import{t as o}from"./paginate-Cbe4RaEq.js";function s(e){if(console.log(`Billing status: ${e.lifecycle.kind}`),e.subscription){let t=e.subscription,n=t.nextInvoiceDueAt?` · next invoice ${new Date(t.nextInvoiceDueAt).toLocaleDateString()}`:``;console.log(` Plan: ${t.planName} · ~${i(t.estimatedMonthlyChargeUsd)}/month${n}`)}else console.log(` Plan: (no active subscription)`);let t=e.seats;console.log(` Seats: pro ${t.assigned.pro}/${t.purchased.pro}, premium ${t.assigned.premium}/${t.purchased.premium} (assigned/purchased)`);let n=e.extraUsage;console.log(` Balance: ${i(n.balanceUsd)} extra usage`),console.log(` Spent: ${a(n.currentSpentUsd)} this period`),n.monthlyExtraUsageLimitUsd!=null&&console.log(` Limit: ${i(n.monthlyExtraUsageLimitUsd)} / month`)}function c(e){console.log(`Invoices (${e.length}):\n`);for(let t of e){let e=new Date(t.billingDate).toLocaleDateString();console.log(` ${e} · ${t.type} · ${t.status} · ${i(t.totalUsd)}`),t.hostedInvoiceUrl&&console.log(` ${t.hostedInvoiceUrl}`),console.log(` ID: ${t.id}`),console.log(``)}}async function l(){return n()&&(console.error("Billing requires an interactive login. A workspace PAT (ENTRYDESK_TOKEN) cannot read billing — run `entrydesk login`."),process.exit(1)),t()}async function u(t){let{accessToken:n,workspaceId:i}=await l(),a=await new e().getBillingOverview(n,i);if(t.json){console.log(r(a));return}s(a)}async function d(t){let{accessToken:n,workspaceId:i}=await l(),a=new e;if(t.all){let e=await o(async e=>{let r=await a.getBillingInvoices(n,i,{limit:t.limit??20,nextKey:e});return{items:r.invoices,nextKey:r.nextKey}});if(t.json){console.log(r({invoices:e}));return}if(e.length===0){console.log(`No invoices.`);return}c(e);return}let{invoices:s,nextKey:u}=await a.getBillingInvoices(n,i,{limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(r({invoices:s,nextKey:u}));return}if(s.length===0){console.log(`No invoices.`);return}c(s),u&&console.log(`Next page: --next-key ${u}`)}export{d as listInvoices,u as showBillingStatus};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{
|
|
10
|
+
import{C as e,p as t}from"./profile-storage-CKrZ-xsd.js";import{t as n}from"./terminal-text-cBPBiP3x.js";async function r(r){let{accessToken:i,workspaceId:a}=await t(),o=await new e().getBudget(i,a);if(r.json){console.log(n(o));return}if(o.budget===null){console.log(`No budget set for this workspace.`);return}console.log(`Current workspace budget: $${o.budget}`)}async function i(r,i){let{accessToken:a,workspaceId:o}=await t(),s=new e;if(await s.updateBudget(a,o,r),i.json){console.log(n(await s.getBudget(a,o)));return}console.log(`Budget updated: $${r}`)}async function a(r){let{accessToken:i,workspaceId:a}=await t(),o=new e;if(await o.updateBudget(i,a,null),r.json){console.log(n(await o.getBudget(i,a)));return}console.log(`Budget cleared.`)}export{a as clearBudget,i as setBudget,r as showBudget};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{$t as e,Ct as t,Qt as n,St as r}from"./profile-storage-CKrZ-xsd.js";function i({allowedTools:e,disallowedTools:n}){if(!(!e?.length&&!n?.length))return[...t(e?.map(e=>({toolName:e,policy:r.ALWAYS_ALLOW})),n?.map(e=>({toolName:e,policy:r.BLOCK})))].map(([e,t])=>({toolName:e,policy:t}))}function a(e,n){let i=[...n].map(e=>({toolName:e,policy:r.ALWAYS_ALLOW}));return i.length===0?e:[...t(e,i)].map(([e,t])=>({toolName:e,policy:t}))}function o({agentId:t,model:r,projectId:i,connectorIds:a,clientTools:o,clientToolSystemPrompt:s,toolApprovalMode:c,toolPolicies:l}){return{...i?{projectId:i}:{},...t?{agentId:t}:{...r?{model:r}:{},...a?.length?{connectorIds:a}:{}},...o?{clientTools:e(o,n.DIRECT)}:{},...s?{clientToolSystemPrompt:s}:{},...c?{toolApprovalMode:c}:{},...l?.length?{toolPolicies:l}:{}}}export{i as n,a as r,o as t};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{
|
|
10
|
+
import{I as e}from"./profile-storage-CKrZ-xsd.js";import{t}from"./terminal-text-cBPBiP3x.js";import{a as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,o as u,r as d,s as f,u as p}from"./paths-BiowKnkz.js";import{t as m}from"./hash-92fWniGT.js";import{r as h}from"./installer-CKB3jBE-.js";import g from"node:path";import _ from"node:fs/promises";const v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;async function y(t,o,s){let c=t&&v.test(t)?t:s.workspaceId,l={workspaceId:c,apiUrl:await e()};if(n(),o.global)i(l),console.info(`Linked ${f()} → workspace ${c}`);else{let e=process.cwd();a(e,l),console.info(`Linked ${r(e)} → workspace ${c}`)}}function b(e){if(e.global){c()?console.info(`Unlinked ${f()}`):console.info(`No global link found.`);return}let t=u(process.cwd());t&&p(t)?console.info(`Unlinked ${r(t)}`):console.info(`No project link found.`)}async function x(e,t,n,r,i){let a=n.skillId;if(!a){let{skills:t}=await e.client.listAvailableSkills(e.accessToken,e.workspaceId),r=t.find(e=>e.name===n.name);if(!r)throw Error(`Skill not found in workspace: ${n.name}`);a=r.id}let{url:s,name:c}=await e.client.downloadSkillCurrent(e.accessToken,e.workspaceId,a),l=await fetch(s);if(!l.ok)throw Error(`Failed to download ${c}: ${l.status}`);let u=Buffer.from(await l.arrayBuffer()),f=d(t,c);await _.rm(f,{recursive:!0,force:!0}),await _.mkdir(f,{recursive:!0});let{default:p}=await import(`adm-zip`),v=g.resolve(f)+g.sep;for(let e of new p(u).getEntries()){if(e.isDirectory)continue;let t=g.resolve(f,e.entryName);if(!t.startsWith(v))throw Error(`Zip entry contains path traversal: ${e.entryName}`);await _.mkdir(g.dirname(t),{recursive:!0}),await _.writeFile(t,e.getData())}let y=m(f);o(t,c,{source:a,sourceType:`entrydesk`,skillId:a,localHash:y,lastPulledHash:y,mode:`symlink`});let b=h(f,c,t,`symlink`,i);return r||console.info(`✓ pulled ${c} (${y.slice(0,12)}) → agents: ${b.map(e=>e.agentId).join(`, `)}`),{name:c,hash:y}}async function S(e,n,r){let{rootDir:i,workspaceId:a}=await s(!!n.global,r.workspaceId),o={...r,workspaceId:a},c=!!n.json,u=[];if(e)u.push(v.test(e)?{skillId:e}:{name:e});else{let e=l(i).skills;for(let[t,n]of Object.entries(e))u.push({skillId:n.skillId,name:t});if(u.length===0){console.info(`Nothing to pull — no tracked skills. Try: entrydesk skills pull <name>`);return}}let d=[];for(let e of u)d.push(await x(o,i,e,c,n.agent));c&&console.info(t(d,2))}export{S as n,b as r,y as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{R as e,t,z as n}from"./profile-storage-CKrZ-xsd.js";import{t as r}from"./terminal-text-cBPBiP3x.js";function i(i){let a=n.getAll();if(i.json){console.log(r(a));return}let o=Object.entries(a);if(console.log(`Profile: ${t.getEffectiveProfileName()}`),o.length===0){console.log(`No configuration set.`),console.log(`Available keys: ${e.join(`, `)}`);return}console.log(`Configuration:
|
|
11
|
+
`);for(let[e,t]of o)console.log(` ${e}=${t}`);console.log(`\nAvailable keys: ${e.join(`, `)}`)}export{i as listConfig};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __entrydeskNodeFloor = 24;
|
|
3
|
+
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
+
process.stderr.write(
|
|
5
|
+
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
+
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
+
);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
import{C as e,Gt as t,Kt as n,Vt as r,p as i,qt as a,zt as o}from"./profile-storage-CKrZ-xsd.js";import{t as s}from"./terminal-text-cBPBiP3x.js";import{t as c}from"./confirm-Ct432t3K.js";function l(e,n){return n?t(n)?`Next: entrydesk connectors connect ${e} --oauth`:n===`credentials`?`Next: entrydesk connectors connect ${e} --username <username> --password <password>`:`Next: entrydesk connectors connect ${e} --token <token>`:`This connector needs no authorization — there is no connect step.`}async function u(t){let{accessToken:n,workspaceId:r}=await i(),{connectors:a,nextKey:o}=await new e().getConnectors(n,r,{connectionStatus:t.all?`all`:`connected`,search:t.search,limit:t.limit,nextKey:t.nextKey});if(t.json){console.log(s({connectors:a,nextKey:o}));return}if(a.length===0){console.log(t.all?`No connectors found.`:`No connected connectors. Use --all to browse connectable ones.`);return}let c=t.all?`Connectors`:`Connected connectors`;console.log(`${c} (${a.length}):\n`);for(let e of a){let t=e.connected?`connected`:`not connected`;console.log(` ${e.name} (${t})`),console.log(` Provider: ${e.provider}`),console.log(` ID: ${e.id}`),e.authorization?.type&&console.log(` Auth: ${e.authorization.type}`),console.log(``)}o&&console.log(`More results: --next-key ${o}`)}async function d(t,n){let{accessToken:r,workspaceId:a}=await i(),{tools:o}=await new e().getConnectorTools(r,a,t);if(n.json){console.log(s({tools:o}));return}if(o.length===0){console.log(`This connector exposes no tools.`);return}console.log(`Tools (${o.length}):\n`);for(let e of o)console.log(` ${e.name} [${e.policy}]`),e.description&&console.log(` ${e.description}`)}async function f(t,n){let{accessToken:r,workspaceId:a}=await i();await new e().syncConnectorTools(r,a,t),console.log(n.json?s({id:t,synced:!0}):`Synced tools for connector ${t}.`)}async function p(t,n){let{accessToken:r,workspaceId:a}=await i(),o=new e;if(n.oauth){let{url:e}=await o.getConnectorAuthUrl(r,a,t);if(n.json){console.log(s({url:e}));return}console.log(`Open this URL in your browser to authorize the connector:`),console.log(` ${e}`),console.log(`
|
|
11
|
+
After you approve, the connection is saved automatically — re-run`),console.log("`entrydesk connectors` to confirm it shows as connected.");return}let c;n.token?c={token:n.token}:n.username&&n.password?c={username:n.username,password:n.password}:(console.error(`Provide --token, or --username and --password, or --oauth to connect.`),process.exit(1)),await o.connectConnectorToken(r,a,t,c),console.log(n.json?s({id:t,connected:!0}):`Connected connector ${t}.`)}function m(e){let t=e.auth===`oauth`||e.auth===`google-iap`;if(t&&(!e.provider||!e.scope?.length)&&(console.error(`--auth ${e.auth} needs --provider and at least one --scope.`),process.exit(1)),!t&&(e.provider||e.scope?.length)&&(console.error(e.auth?`--provider and --scope apply only to --auth oauth and --auth google-iap, not --auth ${e.auth}.`:`--provider and --scope need --auth oauth or --auth google-iap.`),process.exit(1)),e.auth!==void 0)return e.auth===!1?null:{type:e.auth,...e.provider?{provider:e.provider}:{},...e.scope?.length?{scopes:e.scope}:{}}}async function h(t){let c=m(t),u=t.toolNamespace??t.toolPrefix,d=u??n(t.name),f=r(d);if(f){let e=o[f];console.error(u?`--tool-namespace ${e}.`:`The tool namespace derived from --name ("${d}") ${e}. Pass --tool-namespace explicitly.`),process.exit(1)}let{accessToken:p,workspaceId:h}=await i(),g=await new e().createCustomConnector(p,h,{type:a.CUSTOM_REMOTE_URL,name:t.name,description:t.description,transport:t.transport,url:t.url,toolNamespace:d,...c?{authorization:c}:{}});if(t.json){console.log(s(g));return}console.log(`Created connector ${g.name}.`),console.log(` ID: ${g.id}`),console.log(` URL: ${g.url}`),console.log(` Tool namespace: ${g.toolNamespace}`),console.log(`\n${l(g.id,t.auth)}`)}function g(e,t){return t===void 0?e:t===null||t.type!==e?.type?t:{...e,...t}}async function _(t,n){[n.name,n.url,n.description,n.transport,n.toolNamespace,n.auth,n.provider,n.scope].every(e=>e===void 0)&&(console.error(`Nothing to update. Pass at least one of --name, --url, --description, --transport, --tool-namespace, --auth or --no-auth.`),process.exit(1));let r=m(n),{accessToken:o,workspaceId:c}=await i(),l=new e,u=await l.getCustomConnector(o,c,t),d=await l.updateCustomConnector(o,c,t,{type:a.CUSTOM_REMOTE_URL,name:n.name??u.name,description:n.description??u.description,transport:n.transport??u.transport,url:n.url??u.url,toolNamespace:n.toolNamespace??u.toolNamespace,authorization:g(u.authorization,r)});if(n.json){console.log(s(d));return}console.log(`Updated connector ${d.name}.`),console.log(` ID: ${d.id}`),console.log(` URL: ${d.url}`),console.log(` Tool namespace: ${d.toolNamespace}`)}async function v(t,n){let{accessToken:r,workspaceId:a}=await i();if(!n.yes&&(process.stdin.isTTY||(console.error(`Disconnecting connector ${t} needs confirmation. Re-run with --yes.`),process.exit(1)),!await c(`Disconnect connector ${t}?`))){console.log(`Aborted.`);return}await new e().disconnectConnector(r,a,t),console.log(n.json?s({id:t,disconnected:!0}):`Disconnected connector ${t}.`)}export{p as connectConnector,h as createConnector,v as disconnectConnector,d as listConnectorTools,u as listConnectors,f as syncConnectorTools,_ as updateConnector};
|
|
@@ -7,13 +7,13 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:path";import{execFile as i}from"node:child_process";import a from"node:fs/promises";import{promisify as o}from"node:util";const
|
|
10
|
+
import"./profile-storage-CKrZ-xsd.js";import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:path";import{execFile as i}from"node:child_process";import a from"node:fs/promises";import{promisify as o}from"node:util";function s(e){return e instanceof Error&&`code`in e}const c=o(i);async function l(){let t=r.join(n.tmpdir(),`entrydesk-clipboard-${Date.now()}.png`);try{let e=`
|
|
11
11
|
set imageData to the clipboard as "PNGf"
|
|
12
12
|
set fileRef to open for access POSIX file "${t}" with write permission
|
|
13
13
|
set eof fileRef to 0
|
|
14
14
|
write imageData to fileRef
|
|
15
15
|
close access fileRef
|
|
16
|
-
`;return await
|
|
16
|
+
`;return await c(`osascript`,[`-e`,e]),(await a.stat(t)).size===0?void 0:{buffer:await a.readFile(t),mime:`image/png`}}catch{return}finally{try{e.existsSync(t)&&await a.unlink(t)}catch{}}}async function u(){try{let{stdout:e}=await c(`powershell.exe`,[`-command`,`
|
|
17
17
|
Add-Type -AssemblyName System.Windows.Forms
|
|
18
18
|
$img = [System.Windows.Forms.Clipboard]::GetImage()
|
|
19
19
|
if ($img) {
|
|
@@ -21,4 +21,4 @@ import e,{promises as t}from"node:fs";import n from"node:os";import r from"node:
|
|
|
21
21
|
$img.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
22
22
|
[System.Convert]::ToBase64String($ms.ToArray())
|
|
23
23
|
}
|
|
24
|
-
`]),t=e.trim();if(!t)return;let n=Buffer.from(t,`base64`);return n.length===0?void 0:{buffer:n,mime:`image/png`}}catch{return}}async function
|
|
24
|
+
`]),t=e.trim();if(!t)return;let n=Buffer.from(t,`base64`);return n.length===0?void 0:{buffer:n,mime:`image/png`}}catch{return}}async function d(){try{let{stdout:e}=await c(`wl-paste`,[`-t`,`image/png`],{encoding:`buffer`,maxBuffer:50*1024*1024});if(e.length>0)return{buffer:e,mime:`image/png`}}catch{}try{let{stdout:e}=await c(`xclip`,[`-selection`,`clipboard`,`-t`,`image/png`,`-o`],{encoding:`buffer`,maxBuffer:50*1024*1024});if(e.length>0)return{buffer:e,mime:`image/png`}}catch{}}async function f(){let e=n.platform();if(e===`darwin`)return l();if(e===`win32`)return u();if(e===`linux`)return d()}const p=new Set(`.png,.jpg,.jpeg,.gif,.webp,.bmp,.ico,.heic,.heif,.pdf,.txt,.md,.rtf,.csv,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.key,.pages,.numbers,.odt,.ods,.odp,.json,.xml,.yaml,.yml`.split(`,`));function m(e){let t=r.extname(e).toLowerCase();return p.has(t)}function h(e){return{".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".bmp":`image/bmp`,".ico":`image/x-icon`,".heic":`image/heic`,".heif":`image/heif`,".txt":`text/plain`,".md":`text/markdown`,".pdf":`application/pdf`,".csv":`text/csv`,".rtf":`application/rtf`,".doc":`application/msword`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xls":`application/vnd.ms-excel`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".ppt":`application/vnd.ms-powerpoint`,".pptx":`application/vnd.openxmlformats-officedocument.presentationml.presentation`,".key":`application/vnd.apple.keynote`,".pages":`application/vnd.apple.pages`,".numbers":`application/vnd.apple.numbers`,".odt":`application/vnd.oasis.opendocument.text`,".ods":`application/vnd.oasis.opendocument.spreadsheet`,".odp":`application/vnd.oasis.opendocument.presentation`,".json":`application/json`,".xml":`application/xml`,".yaml":`text/yaml`,".yml":`text/yaml`}[r.extname(e).toLowerCase()]||`application/octet-stream`}function g(e){let t=e.trim();return t.startsWith(`file://`)&&(t=decodeURIComponent(t.slice(7))),(t.startsWith(`'`)&&t.endsWith(`'`)||t.startsWith(`"`)&&t.endsWith(`"`))&&(t=t.slice(1,-1)),t=t.replace(/\\(.)/g,`$1`),t}async function _(e){let t=g(e);if(/^https?:\/\//.test(t))return!1;try{return await a.access(t),!0}catch{return!1}}var v=class extends Error{problem;filePath;constructor(e,t){super(`${e}: ${t}`),this.problem=e,this.filePath=t,this.name=`LocalFileError`}};function y(e){if(s(e)){if(e.code===`ENOENT`||e.code===`ENOTDIR`)return`missing`;if(e.code===`EISDIR`)return`not_a_file`}return`unreadable`}async function b(e,{maxBytes:n=1/0}={}){try{let i=await t.stat(e);if(!i.isFile())throw new v(`not_a_file`,e);if(i.size>n)throw new v(`too_large`,e);return{buffer:await t.readFile(e),filename:r.basename(e),mimeType:h(e)}}catch(t){throw t instanceof v?t:new v(y(t),e)}}export{g as a,_ as i,b as n,f as o,m as r,s,v as t};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import{
|
|
10
|
+
import{Q as e}from"./profile-storage-CKrZ-xsd.js";function t(e){return`$${e.toFixed(2)}`}function n(t){return`$${e(t)}`}function r(e){if(e==null)return`—`;let t=Math.round(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${r}:${o}`}function i(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function a(e,t){return`${e} ${t}${e===1?``:`s`}`}export{a,t as i,n,i as r,r as t};
|
|
@@ -7,4 +7,4 @@ if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
|
7
7
|
);
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
|
-
import e from"node:fs";import t from"node:path";import{createHash as n}from"node:crypto";const r=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`__MACOSX`]),i=`SKILL.md`;function a(n){let a=e.readdirSync(n,{withFileTypes:!0}).filter(e=>!r.has(e.name));if(a.some(e=>e.isFile()&&e.name===i))return n;let o=a.filter(e=>e.isDirectory());if(o.length===1){let r=t.join(n,
|
|
10
|
+
import e from"node:fs";import t from"node:path";import{createHash as n}from"node:crypto";const r=new Set([`.git`,`node_modules`,`__pycache__`,`.DS_Store`,`__MACOSX`]),i=`SKILL.md`;function a(n){let a=e.readdirSync(n,{withFileTypes:!0}).filter(e=>!r.has(e.name));if(a.some(e=>e.isFile()&&e.name===i))return n;let o=a.filter(e=>e.isDirectory()),[s]=o;if(o.length===1&&s!==void 0){let r=t.join(n,s.name);if(e.existsSync(t.join(r,i)))return r}return n}function o(n,i,a){for(let s of e.readdirSync(i,{withFileTypes:!0})){if(r.has(s.name))continue;let e=t.join(i,s.name);s.isDirectory()?o(n,e,a):s.isFile()&&a.push({rel:t.relative(n,e).split(t.sep).join(`/`),abs:e})}}function s(t){let r=[];o(t,t,r),r.sort((e,t)=>e.rel<t.rel?-1:+(e.rel>t.rel));let i=n(`sha256`);for(let t of r){let r=n(`sha256`).update(e.readFileSync(t.abs)).digest(`hex`);i.update(t.rel).update(`\0`).update(r).update(`\0`)}return i.digest(`hex`)}function c(e){return s(a(e))}export{c as t};
|