@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
|
@@ -1,10 +0,0 @@
|
|
|
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{Dt as e,Ot as t,T as n,Yt as r}from"./profile-storage-BVSyHoBn.js";import{E as i,S as a,_ as o,a as s,d as c,f as l,o as u,v as d}from"./resolve-yAqzT64X.js";import{n as f,t as p}from"./file-upload-CgLvxPGL.js";const m=[`file`,`link`],h=m.join(`, `),g=/^https?:\/\//iu;function _(e){return m.some(t=>t===e)}function v(e){return e===`asset`||e===`assets`?new u(`asset_not_a_source`,`Assets are managed in the Hub, not through \`sources-*\`. Pass one of: ${h}.`):new u(`invalid_source_type`,`"${n(e)}" is not a source type. Pass one of: ${h}.`)}async function y(e,t){return _(e)?e:c(t,v(e))}function b(e){let t=e?.path[0];return t===`title`||t===`description`?new u(`${t}_too_long`,`--${t} ${e?.message??`is invalid`}.`):new u(`edit_missing`,`Pass --title <text> and/or --description <text>. An empty string clears the field.`)}async function x(e){let n={...e.title!==void 0&&{title:e.title},...e.description!==void 0&&{description:e.description}},r=t.safeParse(n);return r.success?n:c(e,b(r.error.issues[0]))}async function S(e){if(e.description!==void 0)return(await x({description:e.description,json:e.json})).description}async function C(e,t){let i=r.safeParse(e);return i.success?i.data:c(t,new u(`invalid_link_url`,`${n(e)} is not a link the project can fetch: ${i.error.issues[0]?.message??`invalid URL`}. Pass a public http(s) URL.`))}function w(e){let t=n(e.filePath);switch(e.problem){case`missing`:return new u(`local_file_not_found`,`No file at ${t}. Pass the path of a local file, or an http(s):// URL to add a link.`);case`not_a_file`:return new u(`local_path_not_a_file`,`${t} is not a regular file. Pass the path of one file at a time.`);default:return new u(`local_file_unreadable`,`Cannot read ${t}. Check its permissions and try again.`)}}async function T(e,t){try{return await f(e)}catch(e){if(!(e instanceof p))throw e;return c(t,w(e))}}async function E(e,t,n,r){let{client:i,accessToken:a,workspaceId:s}=e;return n.type===`file`?o(await i.updateProjectFile(a,s,t,n.id,r)):d(await i.updateProjectLink(a,s,t,n.id,r))}async function D(e,t,n,r){let{client:i,accessToken:a,workspaceId:s}=e;return n.kind===`link`?d(await i.addProjectLink(a,s,t,{url:n.url,description:r})):o(await i.uploadProjectFile(a,s,t,n.file,{description:r}))}function O(e,t,n){if(n.json){a(t);return}i(e,t,t.status===`pending`?"Its snapshot is being fetched; `entrydesk project sources <project>` shows when it is ready.":void 0)}async function k(e,t){return g.test(e)?{kind:`link`,url:await C(e,t)}:{kind:`file`,file:await T(e,t)}}async function A(e,t,n){let r=await S(n),i=await k(t,n);await l(n,async t=>{O(`Added`,await D(t,await s(t,e),i,r),n)})}async function j(t){let n=e.safeParse({expectedVersionNumber:t.expectedVersion});return n.success?n.data.expectedVersionNumber:c(t,new u(`invalid_expected_version`,"--expected-version must be a positive whole number: the version `entrydesk project sources <project>` shows for this file."))}async function M(e,t,n,r){let i=await j(r),a=await T(n,r);await l(r,async n=>{let{client:c,accessToken:l,workspaceId:u}=n,d=await s(n,e);O(`Replaced`,o(await c.replaceProjectFile(l,u,d,t,a,{expectedVersionNumber:i})),r)})}async function N(e,t,n,r){let i=await y(t,r),a=await x(r);await l(r,async t=>{O(`Updated`,await E(t,await s(t,e),{type:i,id:n},a),r)})}async function P(e,t,n){await l(n,async r=>{let i=await s(r,e);O(`Refetching`,d(await r.client.refetchProjectLink(r.accessToken,r.workspaceId,i,t)),n)})}async function F(e,t,r,i){let o=await y(t,i);await l(i,async t=>{let{client:c,accessToken:l,workspaceId:u}=t,d=await s(t,e);if(o===`file`?await c.removeProjectFile(l,u,d,r):await c.removeProjectLink(l,u,d,r),i.json){a({type:o,id:r,removed:!0});return}console.log(`Removed ${o}: ${n(r)}`)})}export{A as addProjectSource,N as editProjectSource,P as refetchProjectSource,F as removeProjectSource,M as replaceProjectSource};
|
package/dist/resolve-yAqzT64X.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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{Ct as e,S as t,T as n,Tt as r,Xt as i,_ as a,d as ee,o,s,w as c,wt as te,x as ne,yt as l}from"./profile-storage-BVSyHoBn.js";import"./options-Dpxg1wT1.js";import{t as u}from"./terminal-text-cBPBiP3x.js";import{a as d,r as f}from"./format-BaXJBAlk.js";import{HTTPError as p}from"ky";import{validate as re}from"uuid";function m(e){return n(e)}function h(e){return e.split(`
|
|
11
|
-
`).map(m)}function g(e,{numbered:t}){console.log(`Projects (${e.length}):\n`);for(let[n,r]of e.entries()){let e=t?`${String(n+1).padStart(2,` `)} `:``;console.log(` ${e}${m(r.name)}`),console.log(` ${r.role} · updated ${f(r.updatedAt)}`),console.log(` ID: ${r.id}`),console.log(``)}t||console.log("This listing is filtered or paged, so its positions are not the numbers `<project>` takes — pass an ID above.")}function _(e){return`${m(e.name)} <${m(e.email)}> · ${e.role}`}function v(e){return Array.isArray(e.teams)?e.teams:[]}function y(e){let t=[m(e.name),d(e.memberCount,`member`),e.visibility];return e.canExpand||t.push(`locked`),t.join(` · `)}function b(e,t){e.some(e=>!e.canExpand)&&console.log(`\n${t}A locked team is a hidden team you are not in: only its own members can see who belongs to it.`)}function x(e){console.log(`${m(e.name)}\n`),console.log(` ID: ${e.id}`),console.log(` Role: ${e.role}`),e.description&&console.log(` Description: ${m(e.description)}`),console.log(` Updated: ${f(e.updatedAt)}`),console.log(` Sources: ${e.sourceCount} · Tasks: ${e.taskCount} · Assets: ${e.assetCount}`),console.log(`\n Members (${e.members.length}):`);for(let t of e.members)console.log(` - ${_(t)}`);let t=v(e);console.log(`\n Teams (${t.length}):`);for(let e of t)console.log(` - ${y(e)}`);if(b(t,` `),console.log(`
|
|
12
|
-
Instruction:`),!e.instruction){console.log(` (none)`);return}for(let t of h(e.instruction))console.log(` ${t}`)}function S(e){console.log(`Members of ${m(e.name)} (${e.members.length}):\n`);for(let t of e.members)console.log(` - ${_(t)}`),console.log(` ID: ${t.userId}`);let t=v(e);console.log(`\nTeams (${t.length}):\n`);for(let e of t)console.log(` - ${y(e)}`),console.log(` ID: ${e.teamId}`);b(t,``)}function C(e){console.log(`Deleting project: ${m(e.name)}`),console.log(` ID: ${e.id}\n`),console.log(`This will:`),console.log(` - Detach its ${d(e.taskCount,`task`)}; each returns to its owner's main list`),console.log(` - Delete its ${d(e.sourceCount,`source`)} — the files and links in it`),console.log(` - Delete its ${d(e.assetCount,`asset`)}, with every version in their history`),console.log(`
|
|
13
|
-
This can't be undone.`)}function w(e){return process.stdout.isTTY?h(e).join(`
|
|
14
|
-
`):e}function ie(e){console.log(u(e))}function T(e){process.stderr.write(`${u(e)}\n`)}function ae(t){return{type:`file`,id:t.id,title:e(t),description:t.description,status:`ready`,versionNumber:t.versionNumber}}function oe(e){return{type:`link`,id:e.id,title:r(e),description:e.description,status:e.status,url:e.url,fetchError:e.fetchError}}function E(e){return e.status===`failed`&&e.fetchError?`${e.status} — ${m(e.fetchError)}`:e.status}function D(e){console.log(`Sources (${e.length}):\n`);for(let t of e)console.log(` [${t.type}] ${m(t.title)}`),console.log(` ID: ${t.id}`),console.log(` Status: ${E(t)}`),t.versionNumber!==void 0&&console.log(` Version: ${t.versionNumber}`),t.url&&console.log(` URL: ${m(t.url)}`),console.log(` Description: ${t.description?m(t.description):`(none)`}`),console.log(``)}function O(e,t,n){console.log(`${e} ${t.type}: ${m(t.title)}`),console.log(` ID: ${t.id}`),console.log(` Status: ${E(t)}`),t.versionNumber!==void 0&&console.log(` Version: ${t.versionNumber}`),n&&console.log(n)}function k(e){for(let t of h(e))console.log(` ${t}`)}function A(e){console.log(`Results (${e.length}):\n`);for(let t of e)console.log(` [${t.type}] ${m(t.title)}`),t.type===`task`?(console.log(` ID: ${t.taskId}`),console.log(` Updated: ${f(t.updatedAt)}`)):(console.log(` ID: ${t.sourceId}`),t.description&&console.log(` Description: ${m(t.description)}`)),t.snippet&&k(t.snippet),console.log(``)}var j=class extends Error{code;conflict;constructor(e,t,n){super(t),this.code=e,this.conflict=n,this.name=`ProjectCommandError`}};const M=`Project not found`,N="Source not found. Check the type and id against `entrydesk project sources <project>`.";function P(){return new j(`project_not_found`,M)}function F(){return new j(`server_unsupported`,"This server does not support this command yet. Update the server, or point `entrydesk profile set apiUrl <url>` at one that does.")}function I(){return new j(`project_feature_disabled`,"Projects are not enabled on this server. Ask an operator to set ENABLE_PROJECT, or point `entrydesk profile set apiUrl <url>` at a server that has them.")}const L={context_source_not_found:`Context source not found. Check the id, and note that assets are not part of the CLI context surface — view them in the Hub.`,project_owner_required:`Only a project owner can do this. Ask an owner, or have one make you an owner first.`,project_last_owner_required:`This is the last owner of the project. Promote another member to owner before removing or demoting them.`,project_invitee_not_in_workspace:`That user is not a member of this workspace, so they cannot be added to a project in it.`,project_member_already_exists:`That user is already a member of this project.`,project_member_not_found:`That user is not a member of this project.`,project_member_via_team:`This person is in the project through a team, not as a direct member. They leave it by leaving the team, or when an owner removes the team from the project.`,project_team_not_found:"Team not found. Only a team in this workspace can be added — a hidden team only by its own members — and only a team already in the project can be removed. `entrydesk project members <project>` lists the teams in it.",project_team_already_added:`That team is already in this project.`,task_not_found:`Task not found. Only a task you own can be moved or shared, and only by its id.`,asset_sharing_confirmation_required:`This task produced assets the project does not hold yet. Moving it in shares them with every member of the project — re-run with --confirm-asset-sharing to confirm.`,task_not_in_project:`This task is not in a project, so there are no project members to share it with.`,task_project_mismatch:"This task was moved out of this project while the command ran, so nothing was changed. `entrydesk project tasks <project>` lists the tasks in each project; re-run against the one it is in now.",not_project_member:"That member or team is not in the project. `entrydesk project members <project>` lists the members and teams with their ids.",task_grant_not_found:`This task is not shared with that member or team, so there is nothing to stop sharing.`,sharing_disabled:`Sharing is turned off for this workspace by an admin.`,share_visibility_not_allowed:`This share level is not allowed by the workspace share policy set by an admin.`,project_not_found:M,project_file_not_found:N,project_link_not_found:N,file_not_found:`The uploaded file is no longer there to attach. Run the command again.`,project_file_already_attached:`This file is already a source of the project.`,project_link_fetch_in_progress:"This link is already being fetched. Wait for `entrydesk project sources <project>` to show it as ready or failed, then refetch."};function R(){return new j(`project_owner_required`,L.project_owner_required)}function z(){return new j(`project_team_already_added`,L.project_team_already_added)}function B(e){if(e.response.status!==409)return null;let t=te.safeParse(e.data);if(!t.success)return null;let n=t.data.data;return new j(l,`This source changed after version ${n.baseVersionNumber}, which your edit is based on: it is now at version ${n.currentVersionNumber}, saved by ${n.currentVersionEditor.name||n.currentVersionEditor.id} at ${n.currentVersionSavedAt} (${n.size} bytes). Read it again${n.url?` from ${n.url}`:``}, merge your change into it, then replace with --expected-version ${n.currentVersionNumber}.`,n)}function se(e){return L[e]}function V(e){let{status:t}=e.response;if(t<400||t>=500)return null;let n=c(e.data);if(n===void 0)return null;let r=L[n];return r===void 0?null:new j(n,r)}async function H(e,t){try{let{features:n}=await e.getRuntimeConfig();if(!n.enableProject)return I();if(c(t.data)===`not_found`)return F()}catch{}return P()}const U=[/\/projects\/[^/]+\/notes$/u,/\/projects\/[^/]+\/tasks$/u,/\/tasks\/[^/]+$/u,/\/tasks\/[^/]+\/project$/u,/\/tasks\/[^/]+\/shares(?:\/(?:members|teams)\/[^/]+)?$/u];function W(e){let{pathname:t}=new URL(e.request.url),n=U.some(e=>e.test(t));return e.request.method.toUpperCase()===`GET`?n?`tasks:read`:`projects:read`:n?`tasks:write`:`projects:write`}function G(e){if(typeof e!=`object`||!e)return;let t=e.data;if(typeof t!=`object`||!t)return;let{missingScopes:n,mode:r}=t;if(!Array.isArray(n)||n.length===0)return;let a=n.filter(e=>typeof e==`string`&&Object.hasOwn(i,e));if(a.length===n.length)return{scopes:a,mode:r===`any`?`any`:`all`}}function K({scopes:e,mode:t}){let n=e.map(e=>`\`${e}\``);if(n.length===1)return`the ${n[0]} scope`;let r=new Intl.ListFormat(`en`,{type:t===`any`?`disjunction`:`conjunction`}).format(n);return t===`any`?`one of the ${r} scopes`:`the ${r} scopes`}function ce(e){let t=null;try{t=a()}catch{}let n=K(e),r=e.scopes.length===1||e.mode===`any`?`it`:`them`;return t?.authSource===`pat-env`?`This token is missing ${n}. Issue a personal access token that grants ${r}, then set ENTRYDESK_TOKEN to it.`:`Your session is missing ${n} — it predates project support. Run \`entrydesk login\` again to grant ${r}.`}function q(e){return new j(`insufficient_scope`,ce(e))}function le(e){if(!(e instanceof t))return null;switch(e.code){case`project_not_found`:return P();case`project_not_enabled`:return I();case`insufficient_scope`:return q({scopes:[`tasks:write`],mode:`all`});default:return null}}async function J(e,t,n){if(t instanceof j)return t;if(!(t instanceof p))return null;let r=t.response.status;return r===403&&c(t.data)===`insufficient_scope`?q(G(t.data)??{scopes:[n??W(t)],mode:`all`}):r===404&&e?V(t)??H(e,t):B(t)??V(t)}async function ue(e,t={}){return J(t.client,e,t.requiredScope)}async function Y(e,t,r,i){let a=await J(e,t,i);r.json||(a||s(t),console.error(`Error: ${n(a.message)}`),process.exit(1)),T({error:a?{code:a.code,message:a.message,...a.conflict&&{data:a.conflict}}:o(t)}),process.exit(1)}function X(e,t){return Y(void 0,t,e)}async function Z(e,t,n){let r=new ne;try{let{accessToken:e,workspaceId:n}=await ee();return await t({client:r,accessToken:e,workspaceId:n})}catch(t){return Y(r,t,e,n)}}async function de(e,t){await Z(e,t)}async function Q({client:e,accessToken:t,workspaceId:n},r){return e.listProjects(t,n,{limit:r.limit??20,nextKey:r.nextKey,filter:r.filter,sortBy:r.sortBy??`createdAt`,order:r.order??`asc`})}async function $(e,t){if(re(t))return t;if(!/^\d+$/u.test(t))throw P();let n=Number.parseInt(t,10),{projects:r}=await Q(e,{filter:`all`});if(n<1||n>r.length)throw new j(`project_index_out_of_range`,`No project numbered ${n}. \`entrydesk project list\` shows ${r.length}.`);return r[n-1].id}async function fe(e,t){let n=await $(e,t);return e.client.getProject(e.accessToken,e.workspaceId,n)}async function pe(e,t){await e.client.getTasks(e.accessToken,e.workspaceId,{limit:1,projectId:t})}async function me(e,t){return Z({json:t},t=>$(t,e),`projects:read`)}export{T as C,D,O as E,v as O,ie as S,S as T,ae as _,$ as a,C as b,le as c,X as d,de as f,y as g,_ as h,me as i,w as k,R as l,se as m,Q as n,j as o,Z as p,fe as r,ue as s,pe as t,z as u,oe as v,g as w,x,A as y};
|
package/dist/skills-C56S2Z62.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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{d as e,x as t}from"./profile-storage-BVSyHoBn.js";import{t as n}from"./resource-grants-DMj0dy5m.js";import{t as r}from"./terminal-text-cBPBiP3x.js";import{i,m as a}from"./paths-CLGwOhp4.js";import{n as o,t as s}from"./commands-qNH4DlB_.js";import{t as c}from"./remote-D3JMUBbh.js";import l from"node:fs";import u from"node:os";import d from"node:path";import{isHTTPError as f}from"ky";import p from"node:crypto";import m from"node:fs/promises";import{Readable as h}from"node:stream";import{pipeline as g}from"node:stream/promises";import _ from"adm-zip";import v from"archiver";function y(e){return e.all?`all`:e.remote&&!e.local?`remote`:e.local&&!e.remote?`local`:`all`}function b(e,t,n){let r=new Map(t.map(e=>[e.name,e])),i=new Map(Object.entries(e)),a=new Set;if(n!==`remote`)for(let e of i.keys())a.add(e);if(n!==`local`)for(let e of r.keys())a.add(e);let o=[];for(let e of a){let t=i.get(e),n=r.get(e);o.push({name:e,local:!!t,remote:!!n,sourceType:t?.sourceType,skillId:t?.skillId??n?.id})}return o.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name)),o}function x(e){return e.local&&e.remote?`local+remote`:e.local?`local-only`:`remote-only`}async function S(e,t){let n=y(e),{rootDir:o,workspaceId:s}=await i(!!e.global,t.workspaceId),l=b(n===`remote`?{}:a(o).skills,n===`local`?[]:await c(t.client,t.accessToken,s),n);if(e.json){console.info(r(l,2));return}if(l.length===0){console.info(n===`local`?`No skills tracked locally.`:`No skills available in the workspace.`);return}let u=(e,t)=>e.padEnd(t);console.info(`${u(`NAME`,28)}${u(`WHERE`,14)}SOURCE`);for(let e of l)console.info(`${u(e.name,28)}${u(x(e),14)}${e.sourceType??`—`}`)}async function C(){let{accessToken:n,workspaceId:r}=await e();return{accessToken:n,workspaceId:r,client:new t}}function w(e,t){let n=d.relative(e,t);return n===``||!n.startsWith(`..`)&&!d.isAbsolute(n)}async function T(e){let t=await m.realpath(e),n=[process.cwd(),u.homedir()];if(!(await Promise.all(n.map(async e=>{try{return await m.realpath(e)}catch{return d.resolve(e)}}))).some(e=>w(e,t)))throw Error(`Invalid upload path: must be within the current directory or your home directory.`)}async function E(e){let t=await m.mkdtemp(d.join(u.tmpdir(),`entrydesk-skill-`)),n=d.join(t,`${d.basename(e)}.zip`);return await new Promise((t,r)=>{let i=l.createWriteStream(n),a=v(`zip`,{zlib:{level:9}});i.on(`close`,()=>t()),i.on(`error`,r),a.on(`error`,r),a.pipe(i),a.directory(e,!1),a.finalize()}),{zipPath:n,cleanupDir:t}}function D(e){console.log(`Versions (${e.length}):\n`);for(let t of e){let e=new Date(t.createdAt).toLocaleString();if(console.log(` v${t.versionNumber} · ${e}`),t.description){let e=t.description.length>100?`${t.description.slice(0,100)}…`:t.description;console.log(` ${e}`)}console.log(` Version ID: ${t.id}`),console.log(``)}}async function O(e){let t=await C();if(e.local||e.remote||e.all){await S(e,t);return}let n=[],i;do{let r=await t.client.listAvailableSkills(t.accessToken,t.workspaceId,{createdBy:e.mine?`me`:void 0,nextKey:i,limit:100});n.push(...r.skills),i=r.nextKey}while(i);if(e.json){console.log(r(n));return}if(n.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 (${n.length}):\n`);for(let e of n)console.log(e.provider?` ${e.name} (${e.provider})`:` ${e.name}`),console.log(` ${e.description.slice(0,120)}`),console.log(` ID: ${e.id}`),e.author&&console.log(` Author: ${e.author.name}`),console.log(``)}async function k(n,i){let{accessToken:a,workspaceId:o}=await e(),s=new t,c=d.resolve(n),l;try{l=await m.stat(c)}catch{console.error(`File not found: ${c}`),process.exit(1)}let u=c,p=null;try{try{await T(c)}catch(e){let t=e instanceof Error?e.message:`Invalid upload path.`;console.error(t),process.exit(1)}if(l.isDirectory()){let e=await E(c);u=e.zipPath,p=e.cleanupDir}else l.isFile()||(console.error(`Not a file or directory: ${c}`),process.exit(1));d.extname(u).toLowerCase()!==`.zip`&&(console.error(`Only .zip files are supported for upload.`),process.exit(1));let e=await m.readFile(u),t=new FormData;t.append(`file`,new Blob([e],{type:`application/zip`}),d.basename(u)),i.force&&t.append(`force`,`true`);let n;try{n=await s.uploadSkill(a,o,t)}catch(e){throw f(e)&&e.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)),e}if(i.json){console.log(r(n));return}console.log(`Uploaded skill: ${n.name}`),console.log(` ID: ${n.id}`),console.log(` Version ID: ${n.currentVersionId}`),console.log(` Description: ${n.description}`)}finally{p&&await m.rm(p,{recursive:!0,force:!0})}}async function A(n,i){!i.enable&&!i.disable&&(console.error(`Pass exactly one of --enable or --disable.`),process.exit(1));let a=!!i.enable,{accessToken:o,workspaceId:s}=await e(),c=await new t().updateSkillPreference(o,s,n,a);if(i.json){console.log(r(c));return}console.log(`${c.isEnabled?`Enabled`:`Disabled`} skill for you: ${n}`)}async function j(n,i){let{accessToken:a,workspaceId:o}=await e(),s=await new t().getSkillVersions(a,o,n);if(i.json){console.log(r(s));return}if(s.versions.length===0){console.log(`No versions for this skill.`);return}D(s.versions)}async function M(i,a){let{accessToken:o,workspaceId:s}=await e(),c=new t;if(a.addUser){let e=await c.upsertSkillGrant(o,s,i,a.addUser,a.role);if(a.json){console.log(r(e));return}console.log(`Granted ${a.role} to user ${a.addUser}`);return}if(a.removeUser){if(await c.removeSkillGrant(o,s,i,a.removeUser),a.json){console.log(r({userId:a.removeUser,removed:!0}));return}console.log(`Revoked access for user ${a.removeUser}`);return}let l=await c.getSkillGrants(o,s,i);if(a.json){console.log(r(l));return}n(l)}async function N(n){let{accessToken:r,workspaceId:i}=await e();await new t().deleteSkill(r,i,n),console.log(`Deleted skill: ${n}`)}async function P(n,i){let{accessToken:a,workspaceId:o}=await e(),{url:s,name:c}=await new t().downloadSkillCurrent(a,o,n);(c.includes(`/`)||c.includes(d.sep)||c===`.`||c===`..`||!c)&&(console.error(`Invalid skill name for output directory: ${c}`),process.exit(1));let f=d.resolve(c),v=await m.mkdtemp(d.join(u.tmpdir(),`entrydesk-skill-download-`)),y=d.join(v,`${c}.zip`);try{let e=await fetch(s);if(!e.ok)throw Error(`Failed to download skill zip: ${e.status} ${e.statusText}`);if(!e.body)throw Error(`Response body is empty`);let t=l.createWriteStream(y);await g(h.fromWeb(e.body),t);let a=await m.mkdtemp(d.join(d.dirname(f),`.entrydesk-skill-extract-`)),o=null;try{i.json||console.log(`Extracting…`);let e=new _(y),t=d.resolve(a)+d.sep;for(let n of e.getEntries()){if(n.isDirectory)continue;let e=d.resolve(a,n.entryName);if(!e.startsWith(t))throw Error(`Zip entry contains path traversal: ${n.entryName}`);await m.mkdir(d.dirname(e),{recursive:!0}),await m.writeFile(e,n.getData())}l.existsSync(f)&&(o=d.join(d.dirname(f),`.entrydesk-backup-${p.randomUUID()}`),i.json||console.log(`Replacing existing directory: ${f}`),await m.rename(f,o));try{await m.rename(a,f),o&&l.existsSync(o)&&(await m.rm(o,{recursive:!0,force:!0}),o=null)}catch(e){throw o&&l.existsSync(o)&&(await m.rename(o,f),o=null),e}}catch(e){if(await m.rm(a,{recursive:!0,force:!0}),o&&l.existsSync(o))try{await m.rename(o,f)}catch{console.error(`Warning: Could not restore backup. Your original files are at: ${o}`)}throw e}if(i.json){console.log(r({skillId:n,skillName:c,outputDir:f}));return}console.log(`Downloaded skill "${c}" to ${f}`)}finally{await m.rm(v,{recursive:!0,force:!0})}}async function F(e,t){let{runSkillsAdd:n}=await import(`./add-A1EZKhMH.js`);await n(e,t,await C())}async function I(e,t){await o(e,t,await C())}async function L(e,t){let{runSkillsPush:n}=await import(`./push-4Y4mjxO7.js`);await n(e,t,await C())}async function R(e){let{runSkillsStatus:t}=await import(`./status-DHllWQ7c.js`);await t(e,await C())}async function z(e,t){let{runSkillsRemove:n}=await import(`./remove-DUFnCuRT.js`);await n(e,t,await C())}async function B(e,t){await s(e,t,await C())}export{F as addSkill,N as deleteSkill,P as downloadSkill,B as linkSkillsDirectory,j as listSkillVersions,O as listSkills,I as pullSkill,L as pushSkill,z as removeSkill,M as shareSkill,R as showSkillsStatus,A as toggleSkill,k as uploadSkill};
|
package/dist/status-BBvz4l0p.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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,I as t,_ as n,k as r,l as i,t as a,u as o,x as s}from"./profile-storage-BVSyHoBn.js";import{t as c}from"./terminal-text-cBPBiP3x.js";async function l(l){let u=a.getEffectiveProfileName(),d={model:t.getDefaultModel(),connectors:t.getDefaultConnectorIds()},f=n();if(f){l.json?console.log(c({loggedIn:!0,authSource:f.authSource,profile:u,server:r(),workspaceId:f.workspaceId,defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${r()}`),console.log(`Authenticated via ${f.label} (no login required)`),console.log(`Workspace ID: ${f.workspaceId}`));return}let p=await e.getAll();if(!p){l.json?console.log(c({loggedIn:!1,profile:u,server:r(),defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${r()}`),console.log(`Not logged in`),console.log("Run `entrydesk login` to log in"));return}let m;if(p.workspaceId)try{let e=new s,t=await o(),{workspaces:n}=await e.getWorkspaces(t);m=n.find(e=>e.id===p.workspaceId)?.name}catch(e){if(e instanceof i){l.json?console.log(c({loggedIn:!1,profile:u,server:r(),defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${r()}`),console.log(`Not logged in`),console.log("Run `entrydesk login` to log in"));return}}l.json?console.log(c({loggedIn:!0,authSource:`file`,profile:u,server:r(),email:p.email,workspaceId:p.workspaceId,workspaceName:m,defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${r()}`),console.log(`Logged in as ${p.email}`),m&&console.log(`Workspace: ${m}`),p.workspaceId&&console.log(`Workspace ID: ${p.workspaceId}`))}export{l as runStatus};
|