@keystrokehq/cli 0.0.32 → 0.0.37
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 +25 -4
- package/dist/{accept.handler-DNfIXPSP.mjs → accept.handler-DCsud1s5.mjs} +4 -4
- package/dist/{admin-CJp8XksD.mjs → admin-BaOtHeZ2.mjs} +10 -10
- package/dist/{agent-manifest-De5TCxZq.mjs → agent-manifest-DfWD5tvv.mjs} +17 -27
- package/dist/{agents-G37PM35Z.mjs → agents-BVAVfMR_.mjs} +9 -9
- package/dist/{api-keys-4igNHJ_W.mjs → api-keys-BhEEsHUh.mjs} +6 -6
- package/dist/{api-BK3EhPvs.mjs → api-sWkB_Wta.mjs} +1 -1
- package/dist/{auth-CIOmmV4x.mjs → auth-BnsitjzT.mjs} +6 -6
- package/dist/{auth.handler-CznN_vfz.mjs → auth.handler-W_xk14TL.mjs} +3 -3
- package/dist/authored-workflow-ref-fkHEEVnd.mjs +113 -0
- package/dist/{build-agents-DseUtzd4-CSGpNXur.mjs → build-agents-CUzBnlAG-3ePFZiJ6.mjs} +12 -11
- package/dist/{build-progress-DLM1Bt4T.mjs → build-progress-CM-b6Bby.mjs} +2 -2
- package/dist/{build-tasks-C09SdfjC-BmAVLTtQ.mjs → build-tasks-5eOvI19S-tbN6CRx9.mjs} +4 -4
- package/dist/{build-workflows-BZ_m97Pr-BiyptCrn.mjs → build-workflows-C-gQM3l5-_zcBHE3M.mjs} +14 -9
- package/dist/{build.handler-zHimoO7c.mjs → build.handler-CpAsAsBc.mjs} +12 -9
- package/dist/{clear-cache.handler-BP0K1-uN.mjs → clear-cache.handler-gJpwslkK.mjs} +2 -2
- package/dist/{clear.handler-T27GpgSu.mjs → clear.handler-CDyG6-dk.mjs} +1 -1
- package/dist/{clear.handler-PsA5QKHx.mjs → clear.handler-_sR33Hp8.mjs} +2 -2
- package/dist/{commander-BlrSdFcu.mjs → commander-C6SSTQJ2.mjs} +22 -3
- package/dist/{connect-BbLJhlIA.mjs → connect-27EgnljZ.mjs} +3 -3
- package/dist/{connect.handler-BthE-7Wg.mjs → connect.handler-COM1LnNg.mjs} +5 -5
- package/dist/{context-sgKhRc5v.mjs → context-ebZssGCY.mjs} +4 -4
- package/dist/{create.handler-BovbO_g0.mjs → create.handler-CAWJAGzQ.mjs} +3 -3
- package/dist/{credential-env-map-CRs0llf0.mjs → credential-env-map-5a41jLwM.mjs} +1 -1
- package/dist/{credential-requirements-D0mavK8j-CFMf0Xwu.mjs → credential-requirements-B5Alhu1v-DanlSKnT.mjs} +3 -3
- package/dist/{credential-schema-mismatch-ClQgEVtO.mjs → credential-schema-mismatch-c17ktoNU.mjs} +1 -1
- package/dist/{credentials-CsncZ52a.mjs → credentials-C0ssbMlp.mjs} +10 -10
- package/dist/{credentials-DKrSaaLw.mjs → credentials-DtwLbee6.mjs} +1 -1
- package/dist/current-deployment-workflow-C6x65imE.mjs +20 -0
- package/dist/current.handler-DP1L_hm3.mjs +19 -0
- package/dist/{delete.handler-DkAK396w.mjs → delete.handler-C-5XFkgN.mjs} +2 -2
- package/dist/{deploy-DvPfR9fC.mjs → deploy-BcVQJza8.mjs} +2 -2
- package/dist/{deploy-progress-BsUH7fGE.mjs → deploy-progress-Bt86Yc1r.mjs} +2 -2
- package/dist/{deploy.handler-BW3f2N2G.mjs → deploy.handler-GPS9lxGk.mjs} +16 -16
- package/dist/{diff-utils-Bs--xmoV.mjs → diff-utils-YEUYtSRs.mjs} +1 -1
- package/dist/{diff.handler-BwhsoAg0.mjs → diff.handler-DkM5dhaN.mjs} +15 -9
- package/dist/{dist-Dw7gCE7y.mjs → dist-B5jy238v.mjs} +37 -11
- package/dist/{dist-CTEtWDW4.mjs → dist-BmbFJq8U.mjs} +8 -27
- package/dist/{env.handler-Dks6ZQh-.mjs → env.handler-V_isbSi2.mjs} +52 -29
- package/dist/{error-boundary-0veZ_RDS.mjs → error-boundary-BRxUsPi7.mjs} +3 -3
- package/dist/{iam-command-utils-CSZj4XlH.mjs → iam-command-utils-DNDN0wT6.mjs} +3 -13
- package/dist/{import-module-y0glInUe-DV_3dsU0.mjs → import-module-y0glInUe-EuAWaw9g.mjs} +506 -128
- package/dist/{init-BOCDwqKR.mjs → init-D1OmmclX.mjs} +3 -3
- package/dist/{init.handler-B3T4J6u_.mjs → init.handler-CUbYlUgP.mjs} +5 -5
- package/dist/{inspect.handler-v9snxDLi.mjs → inspect.handler-BE6coOuW.mjs} +24 -13
- package/dist/{integration-catalog-CiZ62hb_.mjs → integration-catalog-pSmWHFLQ.mjs} +3 -3
- package/dist/{integrations-m7_tb3GV.mjs → integrations-DZD5t8n2.mjs} +7 -7
- package/dist/{invites-BuatfJmN.mjs → invites-BuR1H-tA.mjs} +5 -5
- package/dist/{invites.list.handler-CK6mL10z.mjs → invites.list.handler-Dj4a6XOg.mjs} +6 -5
- package/dist/{invites.resend.handler-CKZouK1Z.mjs → invites.resend.handler-DEGF4vlB.mjs} +6 -5
- package/dist/{invites.revoke.handler-H0VI-3sp.mjs → invites.revoke.handler-Dg4ZvlFS.mjs} +6 -5
- package/dist/keystroke.mjs +122 -77
- package/dist/{list-enrichment-DP1wEyBZ.mjs → list-enrichment-dqbkXJzy.mjs} +2 -2
- package/dist/{list.handler-LxZInip2.mjs → list.handler-2g1CZAvB.mjs} +4 -4
- package/dist/{list.handler-DbYUk6ko.mjs → list.handler-7MkJfkak.mjs} +5 -5
- package/dist/list.handler-BTYVIn6z.mjs +39 -0
- package/dist/{list.handler-BiY5NFWd.mjs → list.handler-Bchcr3-e.mjs} +3 -3
- package/dist/list.handler-Choc4SZz.mjs +64 -0
- package/dist/{list.handler-CMRQKH4b.mjs → list.handler-D47C1z3m.mjs} +4 -4
- package/dist/{list.handler-DVnFrlis.mjs → list.handler-DYE48apa.mjs} +7 -7
- package/dist/{list.handler-DIMWZx78.mjs → list.handler-KcCaG3PZ.mjs} +4 -4
- package/dist/list2.handler-BIaIyrQf.mjs +99 -0
- package/dist/{listen-C_7Rgwkb.mjs → listen-CVY-_F29.mjs} +3 -3
- package/dist/{listen.handler-dJgorIzr.mjs → listen.handler-D_nEvXRn.mjs} +4 -4
- package/dist/{logs-B9YMhUGt.mjs → logs-CZ2qnsSH.mjs} +3 -3
- package/dist/{logs.handler-BfjCsAyq.mjs → logs.handler-BRUzZC9Z.mjs} +26 -29
- package/dist/{logs.handler-DGGVPMOX.mjs → logs.handler-Wk6mYyAZ.mjs} +1 -1
- package/dist/{members.add.handler-DSRCRxsI.mjs → members.add.handler-BJ0wr6rP.mjs} +6 -5
- package/dist/{members.invite.handler-BNpHn1dY.mjs → members.invite.handler-DyveDMuq.mjs} +6 -5
- package/dist/{members.list.handler-Bn9LJEPG.mjs → members.list.handler-CyQxH_zS.mjs} +6 -5
- package/dist/{members.remove.handler-Dkr2t_tX.mjs → members.remove.handler-Dtv9PooY.mjs} +6 -5
- package/dist/{members.update.handler-DBtUYuAY.mjs → members.update.handler-CeK-tCjT.mjs} +6 -5
- package/dist/{operations-CF2nUiBs.mjs → operations-CxQlt0S0.mjs} +5 -5
- package/dist/{org-DOH7YHk2.mjs → org-B8MPHJJu.mjs} +35 -28
- package/dist/org-context-BI9OSpbb.mjs +112 -0
- package/dist/org-output-DffU7DKn.mjs +64 -0
- package/dist/{orgs.create.handler-BO70zIdp.mjs → orgs.create.handler-BKvSmkU3.mjs} +4 -4
- package/dist/{orgs.get.handler-BuGg5bc9.mjs → orgs.get.handler-BA-CexIY.mjs} +4 -4
- package/dist/{orgs.list.handler--5HutMkl.mjs → orgs.list.handler-eCEg5kC1.mjs} +4 -4
- package/dist/{output-BWcVRt-T.mjs → output-DnIFEmi5.mjs} +1 -1
- package/dist/{package-manager-CvY4IW7X.mjs → package-manager-BP3-q8hh.mjs} +27 -2
- package/dist/{paused.handler-DHvxz-cC.mjs → paused.handler-4wKMTKZ-.mjs} +20 -33
- package/dist/{projects-C5GZ5Jrf.mjs → projects-Wu_2fB_x.mjs} +11 -9
- package/dist/{register.handler-CKMZ2WmD.mjs → register.handler-BvAkXCwE.mjs} +2 -2
- package/dist/{render-credential-Bn15FEUC.mjs → render-credential-D-H1ECDt.mjs} +1 -1
- package/dist/{render-operation-DWbMwhfc.mjs → render-operation-VdEPhoII.mjs} +2 -2
- package/dist/{requirements.handler-B5rqCjMu.mjs → requirements.handler-Bab4kBtw.mjs} +7 -7
- package/dist/{resolve-cli-credentials-CAOSVMJP.mjs → resolve-cli-credentials-GVOOedoQ.mjs} +1 -1
- package/dist/{resolve-project-E9mrh_el.mjs → resolve-project-DLKlAy0z.mjs} +24 -8
- package/dist/{run-polling-DawiBus-.mjs → run-polling-C5fI7xTp.mjs} +97 -14
- package/dist/{run.handler-BG7xitEK.mjs → run.handler-BKD5Xu0A.mjs} +42 -30
- package/dist/{runs-swYYBT6C.mjs → runs-CT31dczt.mjs} +4 -4
- package/dist/{schema-display-FvI8QjOQ.mjs → schema-display-sZ6ConJd.mjs} +33 -26
- package/dist/schemas-ClAIoIrX.mjs +281 -0
- package/dist/{search-CA0J5NOY.mjs → search-BeQW_pf4.mjs} +3 -3
- package/dist/{search.handler-BVDsYZlJ.mjs → search.handler-BJ-ZlDL4.mjs} +6 -6
- package/dist/{show.handler-nkK6Erbb.mjs → show.handler-BrIHUH28.mjs} +4 -4
- package/dist/{show.handler-CsidInW8.mjs → show.handler-Cqe_hCqU.mjs} +5 -5
- package/dist/{show.handler-CwwnCmbp.mjs → show.handler-DB8xl5FU.mjs} +6 -6
- package/dist/{skill-installer-DG8kTaQR.mjs → skill-installer-DuMhavmM.mjs} +3 -1
- package/dist/{skills-sync.handler-yRmi3OgP.mjs → skills-sync.handler-BGs-_YD9.mjs} +13 -7
- package/dist/{skills.command-COYd3k4Z.mjs → skills.command-DUWn6FbL.mjs} +5 -5
- package/dist/skills.handler-DqLXJepA.mjs +9 -0
- package/dist/{spinner-progress-lrKDs4YF.mjs → spinner-progress-BYxlr3lY.mjs} +1 -1
- package/dist/status.handler-DAId4bVU.mjs +72 -0
- package/dist/{switch.handler-BwYndsP-.mjs → switch.handler-Cd4Yg2n8.mjs} +17 -4
- package/dist/{sync-6fZkIUtn.mjs → sync-DgC4lcxh.mjs} +2 -2
- package/dist/{sync.handler-Ctr-cN9X.mjs → sync.handler-Cm_WtGmH.mjs} +8 -8
- package/dist/{task-BWuIKWh4.mjs → task-DTvLzUkA.mjs} +2 -88
- package/dist/{task-target-build-QllcCfoN.mjs → task-target-build-CtvRyVjH.mjs} +5 -5
- package/dist/task-target-deploy-runner.mjs +6 -6
- package/dist/{test-C8VIZe9V.mjs → test-4V7nh67i.mjs} +5 -5
- package/dist/{test.handler-BCW0YBPd.mjs → test.handler-BdCYcwR4.mjs} +2 -2
- package/dist/{test.handler-DLaxrJ9V.mjs → test.handler-Bo4YTs2Z.mjs} +19 -16
- package/dist/{tool.handler-8qNmgdRe.mjs → tool.handler-CPCrSDq2.mjs} +12 -12
- package/dist/{trigger-artifacts-BcRScRSp-BiD2h6do.mjs → trigger-artifacts-BcRScRSp-BRpU-He5.mjs} +2 -2
- package/dist/{trigger-manifest-C07EM-b2.mjs → trigger-manifest-BVqjDhxU.mjs} +1 -1
- package/dist/{upgrade-DgOcc8IT.mjs → upgrade-2qUOcjxb.mjs} +4 -8
- package/dist/upgrade.handler-PqlKSuUE.mjs +99 -0
- package/dist/{upload.handler-B7xle1oX.mjs → upload.handler-CS-vLpzC.mjs} +9 -9
- package/dist/{users.get.handler-C4t1vXwi.mjs → users.get.handler-CH1c6Lnj.mjs} +4 -4
- package/dist/{users.list.handler-Dvl90grq.mjs → users.list.handler-CxbZFgjO.mjs} +4 -4
- package/dist/{users.set-role.handler-Djw1_VGf.mjs → users.set-role.handler-CBRE-Ws6.mjs} +4 -4
- package/dist/{validate.handler-Drf_lssw.mjs → validate.handler-1d-UmtXB.mjs} +171 -26
- package/dist/{workflow-build-Begvjfq8.mjs → workflow-build-Bm8JoVv4.mjs} +234 -32
- package/dist/{workflow-build-manifest-1sC52TIG.mjs → workflow-build-manifest-CV6bBmDO.mjs} +1 -1
- package/dist/{workflow-bundler-BzHk73PM-muPv1yGG.mjs → workflow-bundler-Bs3zQNQv-Dy7lXxy3.mjs} +15 -4
- package/dist/{workflows-DjMlxuBX.mjs → workflows-ny7rOdeH.mjs} +34 -37
- package/dist/{writer-byNNUjRm-B-on1n6c.mjs → writer-BLg0RuZa-Y6ExdYH9.mjs} +6 -4
- package/package.json +10 -10
- package/dist/current-deployment-workflow-B1VQCYC-.mjs +0 -94
- package/dist/current.handler-BaGaCLzB.mjs +0 -21
- package/dist/list.handler-BEMj3FyH.mjs +0 -76
- package/dist/list.handler-Cq_oQY5B.mjs +0 -52
- package/dist/list.handler-htR9TeiS.mjs +0 -24
- package/dist/schemas-D2zfmyC-.mjs +0 -671
- package/dist/skills.handler-DYIQK0Vu.mjs +0 -9
- package/dist/status.handler-Ch_DtyBp.mjs +0 -109
- package/dist/upgrade.handler-DSZuw7-9.mjs +0 -80
- /package/dist/{build-metadata-BB_L45ZS-DSJL7dTy.mjs → build-metadata-BB_L45ZS-DRQsV6JK.mjs} +0 -0
- /package/dist/{deploy-DhCbYFc7.mjs → deploy-BiKBH25R.mjs} +0 -0
- /package/dist/{detect-env-access-CwkOYeYM-COq4U-4Y.mjs → detect-env-access-CwkOYeYM-r4aynBU0.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-DGK5XTQp.mjs → read-credential-keys-77a91T8M-I07NYwfH.mjs} +0 -0
- /package/dist/{run-polling-fBouPjJ2.mjs → run-polling-1c0ckC1A.mjs} +0 -0
- /package/dist/{schemas-4Mq_bxob.mjs → schemas-8nhXlXWh.mjs} +0 -0
- /package/dist/{task-target-deploy-B_3HPSo2.mjs → task-target-deploy-m9LfE488.mjs} +0 -0
- /package/dist/{types-AlA-ifK9.mjs → types-Cb0eWmUU.mjs} +0 -0
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { _ as isAuthError, a as ui, m as REAUTH_HINT, p as AUTH_HINT, v as isNetworkError, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
-
//#region src/commands/auth/status.handler.ts
|
|
5
|
-
async function getValidationStatus(ctx) {
|
|
6
|
-
if (!ctx.client) return { kind: "not_authenticated" };
|
|
7
|
-
try {
|
|
8
|
-
const result = await ctx.client.public.auth.validate();
|
|
9
|
-
return {
|
|
10
|
-
kind: "valid",
|
|
11
|
-
apiKeyId: result.apiKeyId,
|
|
12
|
-
organizationId: result.organizationId
|
|
13
|
-
};
|
|
14
|
-
} catch (error) {
|
|
15
|
-
const message = toErrorMessage(error);
|
|
16
|
-
if (isAuthError(error)) return {
|
|
17
|
-
kind: "invalid",
|
|
18
|
-
message
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
kind: "unavailable",
|
|
22
|
-
message,
|
|
23
|
-
reason: isNetworkError(error) ? "network" : "other"
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async function getLiveUser(ctx, validation) {
|
|
28
|
-
if (!ctx.client || validation.kind !== "valid") return;
|
|
29
|
-
try {
|
|
30
|
-
const { user } = await ctx.client.users.getMe();
|
|
31
|
-
return user;
|
|
32
|
-
} catch {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function getLocalOrganization(ctx) {
|
|
37
|
-
if (!ctx.organizationId) return;
|
|
38
|
-
const org = ctx.storedOrgs.find((entry) => entry.organizationId === ctx.organizationId);
|
|
39
|
-
if (!org) return { id: ctx.organizationId };
|
|
40
|
-
return {
|
|
41
|
-
id: org.organizationId,
|
|
42
|
-
name: org.organizationName
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function getLiveOrganization(liveUser, organizationId) {
|
|
46
|
-
if (!liveUser || !organizationId) return;
|
|
47
|
-
const org = liveUser.organizations?.find((entry) => entry.id === organizationId);
|
|
48
|
-
if (!org) return;
|
|
49
|
-
return {
|
|
50
|
-
id: org.id,
|
|
51
|
-
name: org.name
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function printOrganization(org) {
|
|
55
|
-
if (!org) {
|
|
56
|
-
ui.warn("No organization set. Use `keystroke org switch` or `--org` to select one.");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (org.name) {
|
|
60
|
-
ui.text(`Current organization: ${org.name}`);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
ui.text(`Current organization: ${org.id}`);
|
|
64
|
-
}
|
|
65
|
-
function printValidationStatus(validation) {
|
|
66
|
-
switch (validation.kind) {
|
|
67
|
-
case "valid":
|
|
68
|
-
ui.success("API key is valid.");
|
|
69
|
-
ui.hint(`Key ID: ${validation.apiKeyId}`);
|
|
70
|
-
return;
|
|
71
|
-
case "invalid":
|
|
72
|
-
ui.warn("Saved API key is invalid or expired.");
|
|
73
|
-
ui.hint(REAUTH_HINT);
|
|
74
|
-
ui.hint(`Validation error: ${validation.message}`);
|
|
75
|
-
return;
|
|
76
|
-
case "unavailable":
|
|
77
|
-
ui.warn(validation.reason === "network" ? "Could not reach the API to verify the saved API key." : "Could not verify the saved API key right now.");
|
|
78
|
-
ui.hint(`Validation error: ${validation.message}`);
|
|
79
|
-
return;
|
|
80
|
-
case "not_authenticated":
|
|
81
|
-
ui.warn(`Not authenticated. ${AUTH_HINT}`);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function printCredentialStorage(ctx) {
|
|
86
|
-
const info = ctx.credentialStorageInfo;
|
|
87
|
-
ui.hint(`Credentials: ${info.credentialsFilePath}`);
|
|
88
|
-
if (ctx.credentialReadError) {
|
|
89
|
-
ui.warn("Saved credentials exist, but the saved API key could not be read.");
|
|
90
|
-
ui.hint(`Credential read error: ${ctx.credentialReadError}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async function handleAuthStatus(_options, ctx) {
|
|
94
|
-
const validation = await getValidationStatus(ctx);
|
|
95
|
-
const liveUser = await getLiveUser(ctx, validation);
|
|
96
|
-
const organization = getLiveOrganization(liveUser, ctx.organizationId ?? (validation.kind === "valid" ? validation.organizationId : void 0)) ?? getLocalOrganization(ctx);
|
|
97
|
-
const userEmail = liveUser?.email ?? ctx.storedUser?.email;
|
|
98
|
-
ui.header("Keystroke CLI auth status");
|
|
99
|
-
if (userEmail) ui.text(`Signed in as: ${userEmail}`);
|
|
100
|
-
else if (validation.kind === "not_authenticated") ui.hint("No saved user identity found.");
|
|
101
|
-
else ui.warn("Signed-in user could not be determined from saved credentials.");
|
|
102
|
-
printOrganization(organization);
|
|
103
|
-
if (ctx.orgSource) ui.hint(`Source: ${ctx.orgSource}`);
|
|
104
|
-
printValidationStatus(validation);
|
|
105
|
-
if (ctx.baseUrl) ui.hint(`API URL: ${ctx.baseUrl}`);
|
|
106
|
-
printCredentialStorage(ctx);
|
|
107
|
-
}
|
|
108
|
-
//#endregion
|
|
109
|
-
export { handleAuthStatus };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { a as ui, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
-
import { spawn } from "node:child_process";
|
|
5
|
-
//#region src/commands/upgrade/upgrade.handler.ts
|
|
6
|
-
const CLI_PACKAGE_NAME = "@keystrokehq/cli";
|
|
7
|
-
function buildUpgradeCommand(options) {
|
|
8
|
-
const packageSpec = `${CLI_PACKAGE_NAME}@${options.to}`;
|
|
9
|
-
switch (options.packageManager) {
|
|
10
|
-
case "npm": return {
|
|
11
|
-
command: "npm",
|
|
12
|
-
args: [
|
|
13
|
-
"install",
|
|
14
|
-
"--global",
|
|
15
|
-
packageSpec
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
case "pnpm": return {
|
|
19
|
-
command: "pnpm",
|
|
20
|
-
args: [
|
|
21
|
-
"add",
|
|
22
|
-
"--global",
|
|
23
|
-
packageSpec
|
|
24
|
-
]
|
|
25
|
-
};
|
|
26
|
-
case "yarn": return {
|
|
27
|
-
command: "yarn",
|
|
28
|
-
args: [
|
|
29
|
-
"global",
|
|
30
|
-
"add",
|
|
31
|
-
packageSpec
|
|
32
|
-
]
|
|
33
|
-
};
|
|
34
|
-
case "bun": return {
|
|
35
|
-
command: "bun",
|
|
36
|
-
args: [
|
|
37
|
-
"add",
|
|
38
|
-
"--global",
|
|
39
|
-
packageSpec
|
|
40
|
-
]
|
|
41
|
-
};
|
|
42
|
-
default: return assertNever(options.packageManager);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
async function handleUpgrade(options, _ctx) {
|
|
46
|
-
const upgradeCommand = buildUpgradeCommand(options);
|
|
47
|
-
const renderedCommand = renderCommand(upgradeCommand);
|
|
48
|
-
if (options.dryRun) {
|
|
49
|
-
ui.text(renderedCommand);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
ui.header(`Upgrading Keystroke CLI with ${options.packageManager}...`);
|
|
53
|
-
ui.hint(renderedCommand);
|
|
54
|
-
const exitCode = await runCommand(upgradeCommand);
|
|
55
|
-
if (exitCode !== 0) throwReportedCliExit(`CLI upgrade failed with exit code ${exitCode}.`);
|
|
56
|
-
ui.success("Keystroke CLI upgrade complete.");
|
|
57
|
-
}
|
|
58
|
-
function runCommand({ command, args }) {
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
const child = spawn(command, args, {
|
|
61
|
-
stdio: "inherit",
|
|
62
|
-
shell: process.platform === "win32"
|
|
63
|
-
});
|
|
64
|
-
child.on("error", (error) => {
|
|
65
|
-
reject(new Error(`Failed to start upgrade command: ${toErrorMessage(error)}`, { cause: error }));
|
|
66
|
-
});
|
|
67
|
-
child.on("close", (code) => resolve(code ?? 1));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function renderCommand({ command, args }) {
|
|
71
|
-
return [command, ...args].map(shellToken).join(" ");
|
|
72
|
-
}
|
|
73
|
-
function shellToken(value) {
|
|
74
|
-
return /^[A-Za-z0-9_./:@=-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
75
|
-
}
|
|
76
|
-
function assertNever(value) {
|
|
77
|
-
throw new Error(`Unsupported package manager: ${value}`);
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
export { handleUpgrade };
|
|
File without changes
|
|
File without changes
|
/package/dist/{detect-env-access-CwkOYeYM-COq4U-4Y.mjs → detect-env-access-CwkOYeYM-r4aynBU0.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|