@keystrokehq/cli 0.0.31 → 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-DX08T87c.mjs → init-D1OmmclX.mjs} +8 -3
- package/dist/{init.handler-CzlmkNXi.mjs → init.handler-CUbYlUgP.mjs} +57 -14
- 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-MEExmqcg.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-BKfGLkFu.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-Jk_vK66s.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-AWMLs6mE.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-BP3-q8hh.mjs +162 -0
- 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-CePNU3sP.mjs → register.handler-BvAkXCwE.mjs} +2 -2
- package/dist/{render-credential-Bn15FEUC.mjs → render-credential-D-H1ECDt.mjs} +1 -1
- package/dist/{render-operation-Bc7Wu1sP.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-BEfy2fG9.mjs → search-BeQW_pf4.mjs} +3 -3
- package/dist/{search.handler-V7ObLGjN.mjs → search.handler-BJ-ZlDL4.mjs} +6 -6
- package/dist/{show.handler-C_VDYU91.mjs → show.handler-BrIHUH28.mjs} +4 -4
- package/dist/{show.handler-CsidInW8.mjs → show.handler-Cqe_hCqU.mjs} +5 -5
- package/dist/{show.handler-Wmv0tkxx.mjs → show.handler-DB8xl5FU.mjs} +6 -6
- package/dist/{skill-installer-D6j9IA3Z.mjs → skill-installer-DuMhavmM.mjs} +3 -1
- package/dist/{skills-sync.handler-BAATdT6N.mjs → skills-sync.handler-BGs-_YD9.mjs} +13 -7
- package/dist/{skills.command-0-E8mcYE.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 +11 -11
- 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/package-manager-DT1EhOkS.mjs +0 -61
- 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,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson, r as isJsonMode } from "./output-
|
|
5
|
-
import { i as UnknownSkillAgentError, n as resolveSkillInstallChoices, r as installKeystrokeAgentSkills, t as summarizeSkillInstall } from "./skill-installer-
|
|
3
|
+
import { k as CliExitError } from "./keystroke.mjs";
|
|
4
|
+
import { a as writeJsonError, i as writeJson, r as isJsonMode } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { i as UnknownSkillAgentError, n as resolveSkillInstallChoices, r as installKeystrokeAgentSkills, t as summarizeSkillInstall } from "./skill-installer-DuMhavmM.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
//#region src/commands/skills/skills-sync.handler.ts
|
|
8
8
|
async function handleSkillsSync(options, _ctx) {
|
|
@@ -12,7 +12,7 @@ async function handleSkillsSync(options, _ctx) {
|
|
|
12
12
|
const choices = await resolveSkillInstallChoices({
|
|
13
13
|
agentSlugs: options.agent,
|
|
14
14
|
method: options.method,
|
|
15
|
-
interactive: process.stdin.isTTY && !isJsonMode(options)
|
|
15
|
+
interactive: Boolean(process.stdin.isTTY) && !isJsonMode(options)
|
|
16
16
|
});
|
|
17
17
|
result = await installKeystrokeAgentSkills({
|
|
18
18
|
projectDir,
|
|
@@ -20,7 +20,13 @@ async function handleSkillsSync(options, _ctx) {
|
|
|
20
20
|
method: choices.method
|
|
21
21
|
});
|
|
22
22
|
} catch (error) {
|
|
23
|
-
if (error instanceof UnknownSkillAgentError)
|
|
23
|
+
if (error instanceof UnknownSkillAgentError) {
|
|
24
|
+
if (isJsonMode(options)) writeJsonError(error.message, {
|
|
25
|
+
code: "UNKNOWN_AGENT",
|
|
26
|
+
cause: error
|
|
27
|
+
});
|
|
28
|
+
throw new CliExitError(error.message, { cause: error });
|
|
29
|
+
}
|
|
24
30
|
throw error;
|
|
25
31
|
}
|
|
26
32
|
if (isJsonMode(options)) {
|
|
@@ -40,8 +46,8 @@ async function handleSkillsSync(options, _ctx) {
|
|
|
40
46
|
summarizeSkillInstall(result, "Synced");
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
|
-
if (result.reason === "not_installed") throw new CliExitError("Could not resolve @keystrokehq/skills from
|
|
44
|
-
|
|
49
|
+
if (result.reason === "not_installed") throw new CliExitError("Could not resolve @keystrokehq/skills from the installed CLI. Reinstall the CLI, then run `keystroke skills sync`.", { exitCode: 1 });
|
|
50
|
+
throw new CliExitError(`@keystrokehq/skills is installed at ${result.packageRoot} but no skill directories with SKILL.md were found.`, { exitCode: 1 });
|
|
45
51
|
}
|
|
46
52
|
//#endregion
|
|
47
53
|
export { handleSkillsSync };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
5
|
-
import { t as SKILL_INSTALL_METHODS } from "./types-
|
|
3
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DnIFEmi5.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
5
|
+
import { t as SKILL_INSTALL_METHODS } from "./types-Cb0eWmUU.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/commands/skills/skills.command.ts
|
|
8
8
|
const SkillsCommandOptionsSchema = JsonOptionSchema.extend({
|
|
@@ -32,13 +32,13 @@ function createSkillsCommand() {
|
|
|
32
32
|
description: "Sync Keystroke agent skills (SKILL.md) from @keystrokehq/skills",
|
|
33
33
|
schema: SkillsCommandOptionsSchema,
|
|
34
34
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
35
|
-
loadHandler: async () => (await import("./skills.handler-
|
|
35
|
+
loadHandler: async () => (await import("./skills.handler-DqLXJepA.mjs")).handleSkillsParent,
|
|
36
36
|
subcommands: [createTypedCommand({
|
|
37
37
|
name: "sync",
|
|
38
38
|
description: "Install bundled Keystroke skills into selected agent skill directories",
|
|
39
39
|
schema: SkillsCommandOptionsSchema,
|
|
40
40
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
41
|
-
loadHandler: async () => (await import("./skills-sync.handler-
|
|
41
|
+
loadHandler: async () => (await import("./skills-sync.handler-BGs-_YD9.mjs")).handleSkillsSync
|
|
42
42
|
})]
|
|
43
43
|
});
|
|
44
44
|
cmd.enablePositionalOptions();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
//#region src/commands/skills/skills.handler.ts
|
|
5
|
+
async function handleSkillsParent(_options, _ctx) {
|
|
6
|
+
ui.hint("Run `keystroke skills sync` to refresh bundled skills in `.agents/skills`, or `keystroke skills sync --agent claude-code --method symlink` for agent-specific folders.");
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { handleSkillsParent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { I as logger, L as originalConsole, n as style, r as isTTY, t as ANSI } from "./keystroke.mjs";
|
|
4
4
|
import { writeSync } from "node:fs";
|
|
5
5
|
import { Worker } from "node:worker_threads";
|
|
6
6
|
//#region src/lib/spinner-progress.ts
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { g as REAUTH_HINT, h as AUTH_HINT, p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { a as getApiKeyValidationStatus, c as resolveEffectiveOrganization, i as formatOrgSourceLabel, t as ORG_CONTEXT_HINT } from "./org-context-BI9OSpbb.mjs";
|
|
5
|
+
//#region src/commands/auth/status.handler.ts
|
|
6
|
+
async function getLiveUser(ctx, validation) {
|
|
7
|
+
if (!ctx.client || validation.kind !== "valid") return;
|
|
8
|
+
try {
|
|
9
|
+
const { user } = await ctx.client.users.getMe();
|
|
10
|
+
return user;
|
|
11
|
+
} catch {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function printOrganization(effective) {
|
|
16
|
+
if (!effective) {
|
|
17
|
+
ui.warn(`No organization set. ${ORG_CONTEXT_HINT}`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (effective.name) {
|
|
21
|
+
ui.text(`Current organization: ${effective.name}`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
ui.text(`Current organization: ${effective.organizationId}`);
|
|
25
|
+
}
|
|
26
|
+
function printValidationStatus(validation) {
|
|
27
|
+
switch (validation.kind) {
|
|
28
|
+
case "valid":
|
|
29
|
+
ui.success("API key is valid.");
|
|
30
|
+
ui.hint(`Key ID: ${validation.apiKeyId}`);
|
|
31
|
+
return;
|
|
32
|
+
case "invalid":
|
|
33
|
+
ui.warn("Saved API key is invalid or expired.");
|
|
34
|
+
ui.hint(REAUTH_HINT);
|
|
35
|
+
ui.hint(`Validation error: ${validation.message}`);
|
|
36
|
+
return;
|
|
37
|
+
case "unavailable":
|
|
38
|
+
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.");
|
|
39
|
+
ui.hint(`Validation error: ${validation.message}`);
|
|
40
|
+
return;
|
|
41
|
+
case "not_authenticated":
|
|
42
|
+
ui.warn(`Not authenticated. ${AUTH_HINT}`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function printCredentialStorage(ctx) {
|
|
47
|
+
if (ctx.credentialReadError) {
|
|
48
|
+
ui.warn("Saved credentials could not be read.");
|
|
49
|
+
ui.hint(`Credential read error: ${ctx.credentialReadError}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (ctx.storedOrgs.length === 0) return;
|
|
53
|
+
ui.hint(`Credentials: ${ctx.credentialStorageInfo.credentialsFilePath}`);
|
|
54
|
+
}
|
|
55
|
+
async function handleAuthStatus(_options, ctx) {
|
|
56
|
+
const validation = await getApiKeyValidationStatus(ctx);
|
|
57
|
+
const liveUser = await getLiveUser(ctx, validation);
|
|
58
|
+
const effective = await resolveEffectiveOrganization(ctx, liveUser?.organizations ?? []);
|
|
59
|
+
const userEmail = liveUser?.email ?? ctx.storedUser?.email;
|
|
60
|
+
ui.header("Keystroke CLI auth status");
|
|
61
|
+
if (userEmail) ui.text(`Signed in as: ${userEmail}`);
|
|
62
|
+
else if (validation.kind === "not_authenticated") ui.hint("No saved user identity found.");
|
|
63
|
+
else ui.warn("Signed-in user could not be determined from saved credentials.");
|
|
64
|
+
printOrganization(effective);
|
|
65
|
+
if (effective?.source) ui.hint(`Source: ${formatOrgSourceLabel(effective.source)}`);
|
|
66
|
+
else if (ctx.orgSource) ui.hint(`Source: ${formatOrgSourceLabel(ctx.orgSource)}`);
|
|
67
|
+
printValidationStatus(validation);
|
|
68
|
+
if (ctx.baseUrl) ui.hint(`API URL: ${ctx.baseUrl}`);
|
|
69
|
+
printCredentialStorage(ctx);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { handleAuthStatus };
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { n as credentials } from "./dist-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
3
|
+
import { N as throwReportedCliExit, p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { n as credentials } from "./dist-B5jy238v.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { c as resolveEffectiveOrganization, n as ORG_STORED_KEYS_HINT, t as ORG_CONTEXT_HINT } from "./org-context-BI9OSpbb.mjs";
|
|
6
7
|
import { select } from "@clack/prompts";
|
|
7
8
|
//#region src/commands/org/switch.handler.ts
|
|
8
9
|
async function handleOrgSwitch(_options, ctx) {
|
|
10
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
11
|
+
const message = "Organization switch requires an interactive terminal.";
|
|
12
|
+
ui.error(message);
|
|
13
|
+
ui.hint(ORG_CONTEXT_HINT);
|
|
14
|
+
throwReportedCliExit(message);
|
|
15
|
+
}
|
|
9
16
|
const { user } = await requireClient(ctx).users.getMe();
|
|
10
17
|
const orgs = user.organizations ?? [];
|
|
18
|
+
const currentOrgId = (await resolveEffectiveOrganization(ctx, orgs))?.organizationId;
|
|
11
19
|
const storedOrgIds = new Set(ctx.storedOrgs.map((o) => o.organizationId));
|
|
12
20
|
if (orgs.length === 0) {
|
|
13
21
|
ui.warn("You do not belong to any organization.");
|
|
@@ -18,10 +26,15 @@ async function handleOrgSwitch(_options, ctx) {
|
|
|
18
26
|
ui.hint(`You only belong to one organization: ${name}`);
|
|
19
27
|
return;
|
|
20
28
|
}
|
|
29
|
+
if (storedOrgIds.size === 0) {
|
|
30
|
+
ui.warn("No stored API keys for any organization.");
|
|
31
|
+
ui.hint(ORG_STORED_KEYS_HINT);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
21
34
|
const selected = await select({
|
|
22
35
|
message: "Switch to organization:",
|
|
23
36
|
options: orgs.map((org) => {
|
|
24
|
-
const isCurrent = org.id ===
|
|
37
|
+
const isCurrent = org.id === currentOrgId;
|
|
25
38
|
const hasKey = storedOrgIds.has(org.id);
|
|
26
39
|
const hint = isCurrent ? "(current)" : hasKey ? void 0 : "No stored key, run `keystroke auth`";
|
|
27
40
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/commands/sync/sync.command.ts
|
|
6
6
|
/**
|
|
@@ -32,7 +32,7 @@ function createSyncCommand() {
|
|
|
32
32
|
description: "Sync local workflows with Keystroke",
|
|
33
33
|
schema: SyncOptionsSchema,
|
|
34
34
|
optionsConfig: SYNC_OPTIONS_CONFIG,
|
|
35
|
-
loadHandler: async () => (await import("./sync.handler-
|
|
35
|
+
loadHandler: async () => (await import("./sync.handler-Cm_WtGmH.mjs")).handleSync
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as projects } from "./dist-
|
|
5
|
-
import { a as validateApiKey, i as requireClient } from "./context-
|
|
6
|
-
import { n as deployFromDir } from "./dist-
|
|
7
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
8
|
-
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-
|
|
9
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
10
|
-
import { t as createDeployProgress } from "./deploy-progress-
|
|
3
|
+
import { I as logger, N as throwReportedCliExit, l as isLocalMode, p as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-B5jy238v.mjs";
|
|
5
|
+
import { a as validateApiKey, i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { n as deployFromDir } from "./dist-BmbFJq8U.mjs";
|
|
7
|
+
import { t as requireWorkflowsDir } from "./resolve-project-DLKlAy0z.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-Bm8JoVv4.mjs";
|
|
9
|
+
import { t as createBuildProgress } from "./build-progress-CM-b6Bby.mjs";
|
|
10
|
+
import { t as createDeployProgress } from "./deploy-progress-Bt86Yc1r.mjs";
|
|
11
11
|
//#region src/commands/sync/sync.handler.ts
|
|
12
12
|
async function handleSync(options, ctx) {
|
|
13
13
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
|
-
import { a as descriptionString, c as optionalDescriptionString, d as trimmedNonEmptyStringUnbounded,
|
|
4
|
+
import { a as descriptionString, c as optionalDescriptionString, d as trimmedNonEmptyStringUnbounded, i as createStructuralSchema, n as credentialSetProxyConfigSchema, o as idNoSpacesString, s as jsonSchemaObject, t as CredentialSetManifestSchema, u as trimmedNonEmptyString } from "./schemas-ClAIoIrX.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import "node:crypto";
|
|
7
7
|
const SHA256HashSchema = z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
|
|
@@ -20,94 +20,8 @@ z.object({
|
|
|
20
20
|
return data.constant !== void 0 !== (data.exponential !== void 0);
|
|
21
21
|
}, { error: "Retry config must specify exactly one of constant or exponential strategy" });
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region ../../packages/core/src/shared/
|
|
24
|
-
/**
|
|
25
|
-
* shared/schedule.ts
|
|
26
|
-
*
|
|
27
|
-
* Unified schedule type that supports both simple intervals and cron expressions.
|
|
28
|
-
* Can be used in both cron and polling triggers for maximum flexibility.
|
|
29
|
-
*
|
|
30
|
-
* Template literal types provide compile-time type safety.
|
|
31
|
-
* Zod schemas with refinements provide runtime validation.
|
|
32
|
-
*/
|
|
23
|
+
//#region ../../packages/core/src/shared/duration.ts
|
|
33
24
|
const DurationSchema = z.union([z.number().int().positive().finite(), z.string().regex(/^[1-9]\d*[smhdwy]$/)]);
|
|
34
|
-
const DurationStringSchema = z.string().refine((val) => /^\d+[smhdwy]$/.test(val), { message: "Invalid duration format. Must be a positive integer followed by s, m, h, d, w, or y (e.g., \"5m\", \"1h\")" }).refine((val) => {
|
|
35
|
-
const match = val.match(/^(\d+)[smhdwy]$/);
|
|
36
|
-
if (!match?.[1]) return false;
|
|
37
|
-
const num = Number.parseInt(match[1], 10);
|
|
38
|
-
return num > 0 && Number.isFinite(num);
|
|
39
|
-
}, { message: "Duration value must be a positive integer greater than 0" });
|
|
40
|
-
const CronExpressionSchema = z.string().superRefine((val, ctx) => {
|
|
41
|
-
try {
|
|
42
|
-
parseCronExpression(val);
|
|
43
|
-
} catch (error) {
|
|
44
|
-
const errorMessage = error instanceof Error ? error.message : "Invalid cron expression format";
|
|
45
|
-
ctx.addIssue({
|
|
46
|
-
code: "custom",
|
|
47
|
-
message: `Invalid cron expression: ${errorMessage}. Must be a valid 5-field cron: minute hour day month weekday (e.g., "0 9 * * *", "*/15 * * * *")`
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
z.union([
|
|
52
|
-
z.number().refine((val) => val > 0, { message: "Duration in milliseconds must be positive" }).refine(Number.isFinite, { message: "Duration in milliseconds must be finite" }).refine(Number.isInteger, { message: "Duration in milliseconds must be an integer" }),
|
|
53
|
-
DurationStringSchema,
|
|
54
|
-
CronExpressionSchema
|
|
55
|
-
]);
|
|
56
|
-
z.enum([
|
|
57
|
-
"UTC",
|
|
58
|
-
"GMT",
|
|
59
|
-
"Etc/UTC",
|
|
60
|
-
"Etc/GMT",
|
|
61
|
-
"America/New_York",
|
|
62
|
-
"America/Chicago",
|
|
63
|
-
"America/Denver",
|
|
64
|
-
"America/Los_Angeles",
|
|
65
|
-
"America/Phoenix",
|
|
66
|
-
"America/Anchorage",
|
|
67
|
-
"America/Toronto",
|
|
68
|
-
"America/Vancouver",
|
|
69
|
-
"America/Mexico_City",
|
|
70
|
-
"America/Sao_Paulo",
|
|
71
|
-
"America/Buenos_Aires",
|
|
72
|
-
"Europe/London",
|
|
73
|
-
"Europe/Paris",
|
|
74
|
-
"Europe/Berlin",
|
|
75
|
-
"Europe/Rome",
|
|
76
|
-
"Europe/Madrid",
|
|
77
|
-
"Europe/Amsterdam",
|
|
78
|
-
"Europe/Stockholm",
|
|
79
|
-
"Europe/Vienna",
|
|
80
|
-
"Europe/Zurich",
|
|
81
|
-
"Europe/Moscow",
|
|
82
|
-
"Europe/Athens",
|
|
83
|
-
"Europe/Dublin",
|
|
84
|
-
"Asia/Tokyo",
|
|
85
|
-
"Asia/Shanghai",
|
|
86
|
-
"Asia/Hong_Kong",
|
|
87
|
-
"Asia/Singapore",
|
|
88
|
-
"Asia/Seoul",
|
|
89
|
-
"Asia/Dubai",
|
|
90
|
-
"Asia/Kolkata",
|
|
91
|
-
"Asia/Bangkok",
|
|
92
|
-
"Asia/Jakarta",
|
|
93
|
-
"Asia/Manila",
|
|
94
|
-
"Asia/Taipei",
|
|
95
|
-
"Australia/Sydney",
|
|
96
|
-
"Australia/Melbourne",
|
|
97
|
-
"Australia/Brisbane",
|
|
98
|
-
"Australia/Perth",
|
|
99
|
-
"Australia/Adelaide",
|
|
100
|
-
"Pacific/Auckland",
|
|
101
|
-
"Pacific/Honolulu",
|
|
102
|
-
"Africa/Cairo",
|
|
103
|
-
"Africa/Johannesburg",
|
|
104
|
-
"Africa/Lagos",
|
|
105
|
-
"Africa/Nairobi",
|
|
106
|
-
"Asia/Riyadh",
|
|
107
|
-
"Asia/Tehran",
|
|
108
|
-
"Asia/Jerusalem",
|
|
109
|
-
"Asia/Doha"
|
|
110
|
-
]);
|
|
111
25
|
//#endregion
|
|
112
26
|
//#region ../../packages/core/src/artifacts/source-analysis.ts
|
|
113
27
|
const SourceLocationSchema = z.object({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { r as getKeystrokeProjectPath } from "./paths-DpHfoaXN-CdPimpky.mjs";
|
|
4
|
-
import "./dist-
|
|
5
|
-
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-
|
|
4
|
+
import "./dist-B5jy238v.mjs";
|
|
5
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-I07NYwfH.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
|
@@ -111,7 +111,7 @@ async function buildTaskTargetFile(options) {
|
|
|
111
111
|
return builtTasks;
|
|
112
112
|
}
|
|
113
113
|
async function bundleTaskTargetModule(options) {
|
|
114
|
-
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-
|
|
114
|
+
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-r4aynBU0.mjs").then((n) => n.n).then((n) => n.n)]);
|
|
115
115
|
const entryId = "\0virtual:task-target-entry";
|
|
116
116
|
const trackedDependencies = /* @__PURE__ */ new Set();
|
|
117
117
|
const envViolations = [];
|
|
@@ -218,7 +218,7 @@ async function attachTaskTargetTriggers(options) {
|
|
|
218
218
|
options.artifact.triggers.push(...buildTaskTriggerArtifactsWithoutBundles(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName));
|
|
219
219
|
return [];
|
|
220
220
|
}
|
|
221
|
-
const { buildTriggerArtifacts } = await import("./trigger-artifacts-BcRScRSp-
|
|
221
|
+
const { buildTriggerArtifacts } = await import("./trigger-artifacts-BcRScRSp-BRpU-He5.mjs").then((n) => n.n);
|
|
222
222
|
const triggerResult = await buildTriggerArtifacts(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName, options.projectRoot, {
|
|
223
223
|
workflowExportName: options.entry.source.localExportName,
|
|
224
224
|
workflowFilePath: options.entry.runtimeBundlePath
|
|
@@ -319,7 +319,7 @@ function createPreparedTaskTarget(artifact, triggers) {
|
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
async function tryParseTaskBuildManifest(manifest) {
|
|
322
|
-
const { TaskBuildManifestSchema } = await import("./task-
|
|
322
|
+
const { TaskBuildManifestSchema } = await import("./task-DTvLzUkA.mjs").then((n) => n.t);
|
|
323
323
|
const result = TaskBuildManifestSchema.safeParse(manifest);
|
|
324
324
|
return result.success ? result.data : null;
|
|
325
325
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { r as getKeystrokeProjectPath } from "./paths-DpHfoaXN-CdPimpky.mjs";
|
|
4
4
|
import "./default-urls-BoSm4s9C.mjs";
|
|
5
|
-
import "./dist-
|
|
5
|
+
import "./dist-B5jy238v.mjs";
|
|
6
6
|
import { n as findProjectRoot, t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
7
|
-
import { t as resolveCliCredentials } from "./resolve-cli-credentials-
|
|
7
|
+
import { t as resolveCliCredentials } from "./resolve-cli-credentials-GVOOedoQ.mjs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
10
10
|
import { spawnSync } from "node:child_process";
|
|
@@ -119,7 +119,7 @@ function restartStage(options, projectRoot, stage) {
|
|
|
119
119
|
}
|
|
120
120
|
async function runBuildPhase(options, projectRoot) {
|
|
121
121
|
const projectConfig = await assertWorkflowProjectRoot(projectRoot);
|
|
122
|
-
const { buildTaskTargetEntries } = await import("./task-target-build-
|
|
122
|
+
const { buildTaskTargetEntries } = await import("./task-target-build-CtvRyVjH.mjs");
|
|
123
123
|
await writeBuildDescriptor(projectRoot, {
|
|
124
124
|
projectRoot,
|
|
125
125
|
projectConfig,
|
|
@@ -132,7 +132,7 @@ async function runBuildPhase(options, projectRoot) {
|
|
|
132
132
|
}
|
|
133
133
|
async function runPreparePhase(projectRoot) {
|
|
134
134
|
const buildDescriptor = await readBuildDescriptor(projectRoot);
|
|
135
|
-
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-
|
|
135
|
+
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-CtvRyVjH.mjs");
|
|
136
136
|
const prepareResult = await prepareTaskTargetBuiltTasks({
|
|
137
137
|
builtTasks: buildDescriptor.builtTasks,
|
|
138
138
|
projectRoot
|
|
@@ -163,11 +163,11 @@ async function resolveDeployAuthOptions(options) {
|
|
|
163
163
|
}
|
|
164
164
|
async function runDeployPhase(options, projectRoot) {
|
|
165
165
|
const descriptor = await readDescriptor(projectRoot);
|
|
166
|
-
const { createDeployClient } = await import("./deploy-
|
|
166
|
+
const { createDeployClient } = await import("./deploy-BiKBH25R.mjs");
|
|
167
167
|
const client = createDeployClient(await resolveDeployAuthOptions(options));
|
|
168
168
|
const auth = await client.public.auth.validate();
|
|
169
169
|
if (auth.organizationId !== descriptor.projectConfig.organizationId) throw new Error(`Project organization mismatch: config=${descriptor.projectConfig.organizationId} auth=${auth.organizationId}`);
|
|
170
|
-
const { deployTaskTargets } = await import("./task-target-deploy-
|
|
170
|
+
const { deployTaskTargets } = await import("./task-target-deploy-m9LfE488.mjs");
|
|
171
171
|
const result = await deployTaskTargets({
|
|
172
172
|
preparedTasks: descriptor.preparedTasks,
|
|
173
173
|
client,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
5
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/commands/test/test.command.ts
|
|
8
8
|
const TestOptionsSchema = JsonOptionSchema;
|
|
@@ -44,7 +44,7 @@ const TEST_TOOL_OPTIONS_CONFIG = {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
function handleTestHelp() {
|
|
47
|
-
ui.hint("Use `keystroke test tool <toolName> --input='{...}'`. To test workflows, use `keystroke workflows test <workflow>`.");
|
|
47
|
+
ui.hint("Use `keystroke test tool <toolName> --input='{...}'`. To test workflows, use `keystroke workflows test <authored-workflow-id>`.");
|
|
48
48
|
}
|
|
49
49
|
function createTestCommand() {
|
|
50
50
|
const cmd = createTypedCommand({
|
|
@@ -63,7 +63,7 @@ function createTestCommand() {
|
|
|
63
63
|
description: "Agent tool name from the built manifest",
|
|
64
64
|
key: "toolName"
|
|
65
65
|
},
|
|
66
|
-
loadHandler: async () => (await import("./tool.handler-
|
|
66
|
+
loadHandler: async () => (await import("./tool.handler-CPCrSDq2.mjs")).handleTestTool
|
|
67
67
|
})]
|
|
68
68
|
});
|
|
69
69
|
cmd.enablePositionalOptions();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { a as validateApiKey, i as requireClient } from "./context-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { a as validateApiKey, i as requireClient } from "./context-ebZssGCY.mjs";
|
|
5
5
|
//#region src/commands/auth/test.handler.ts
|
|
6
6
|
async function handleAuthTest(_options, ctx) {
|
|
7
7
|
const result = await validateApiKey(requireClient(ctx));
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as projects } from "./dist-
|
|
3
|
+
import { k as CliExitError, l as isLocalMode, p as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-B5jy238v.mjs";
|
|
5
5
|
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
6
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
7
|
-
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-
|
|
8
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
9
|
-
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-
|
|
10
|
-
import {
|
|
11
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
12
|
-
import { t as withErrorBoundary } from "./error-boundary-
|
|
13
|
-
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-
|
|
6
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-ebZssGCY.mjs";
|
|
7
|
+
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-BmbFJq8U.mjs";
|
|
8
|
+
import { t as requireWorkflowsDir } from "./resolve-project-DLKlAy0z.mjs";
|
|
9
|
+
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-Bm8JoVv4.mjs";
|
|
10
|
+
import { a as isUnknownSchema } from "./schema-display-sZ6ConJd.mjs";
|
|
11
|
+
import { t as createBuildProgress } from "./build-progress-CM-b6Bby.mjs";
|
|
12
|
+
import { t as withErrorBoundary } from "./error-boundary-BRxUsPi7.mjs";
|
|
13
|
+
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-C5fI7xTp.mjs";
|
|
14
|
+
import { n as assertAuthoredWorkflowId, t as WORKFLOW_ID_COMMANDS } from "./authored-workflow-ref-fkHEEVnd.mjs";
|
|
14
15
|
//#region src/lib/format.ts
|
|
15
16
|
function formatBytes(bytes) {
|
|
16
17
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -27,6 +28,7 @@ async function resolveAndValidateInputForRun(options) {
|
|
|
27
28
|
const input = await resolveInput(options);
|
|
28
29
|
const workflowsDir = await requireWorkflowsDir(options.path);
|
|
29
30
|
projects.track(workflowsDir);
|
|
31
|
+
await assertAuthoredWorkflowId(options.workflow, workflowsDir, WORKFLOW_ID_COMMANDS.test);
|
|
30
32
|
const existingSchema = await tryReadExistingInputSchema(workflowsDir, options.workflow);
|
|
31
33
|
if (existingSchema && !isUnknownSchema(existingSchema)) validateInputOrExit(options.workflow, input, existingSchema);
|
|
32
34
|
return {
|
|
@@ -36,7 +38,7 @@ async function resolveAndValidateInputForRun(options) {
|
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Build workflow(s) for run using the standard build pipeline, then read
|
|
39
|
-
* prepared artifacts from disk filtered by workflow
|
|
41
|
+
* prepared artifacts from disk filtered by authored workflow id.
|
|
40
42
|
*/
|
|
41
43
|
async function buildWorkflowsForRun(options) {
|
|
42
44
|
const progress = createBuildProgress(options.workflow);
|
|
@@ -47,10 +49,10 @@ async function buildWorkflowsForRun(options) {
|
|
|
47
49
|
verbose: options.verbose,
|
|
48
50
|
onProgressEvent: progress.handleEvent
|
|
49
51
|
});
|
|
50
|
-
const filtered = (await readWorkflowsFromDisk(outDir)).filter((wf) => wf.manifestData.id === options.workflow
|
|
52
|
+
const filtered = (await readWorkflowsFromDisk(outDir)).filter((wf) => wf.manifestData.id === options.workflow);
|
|
51
53
|
if (filtered.length === 0) {
|
|
52
|
-
const
|
|
53
|
-
throw new WorkflowNotFoundError(options.workflow,
|
|
54
|
+
const availableIds = result.artifacts.map((artifact) => artifact.manifest.id).filter((id) => typeof id === "string" && id.length > 0);
|
|
55
|
+
throw new WorkflowNotFoundError(options.workflow, availableIds);
|
|
54
56
|
}
|
|
55
57
|
return filtered;
|
|
56
58
|
} finally {
|
|
@@ -70,8 +72,9 @@ function validateInputWithFirstBuild(options, input, builds) {
|
|
|
70
72
|
function renderBuildSuccessMessage(builds) {
|
|
71
73
|
const first = builds[0];
|
|
72
74
|
if (!first) return;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const label = first.manifestData.id ?? first.name;
|
|
76
|
+
if (builds.length > 1) ui.success(`Built ${builds.length} workflow(s) with id "${label}"`);
|
|
77
|
+
else ui.success(`Built ${label} (${formatBytes(first.bundleSize)})`);
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
77
80
|
* Render completion success message (single or multi).
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { t as Credentials } from "./dist-
|
|
3
|
+
import { N as throwReportedCliExit, c as getProcessEnv, k as CliExitError, p as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { t as Credentials } from "./dist-B5jy238v.mjs";
|
|
5
5
|
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
6
|
-
import { i as writeJson } from "./output-
|
|
7
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
8
|
-
import { a as readManifestsFromOutDir } from "./dist-
|
|
9
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
10
|
-
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-
|
|
11
|
-
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-
|
|
12
|
-
import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-
|
|
6
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
7
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-ebZssGCY.mjs";
|
|
8
|
+
import { a as readManifestsFromOutDir } from "./dist-BmbFJq8U.mjs";
|
|
9
|
+
import { t as requireWorkflowsDir } from "./resolve-project-DLKlAy0z.mjs";
|
|
10
|
+
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Bm8JoVv4.mjs";
|
|
11
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-C6x65imE.mjs";
|
|
12
|
+
import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-C5fI7xTp.mjs";
|
|
13
13
|
import * as path$1 from "node:path";
|
|
14
14
|
import path from "node:path";
|
|
15
15
|
import * as os from "node:os";
|
|
@@ -41,7 +41,7 @@ function createTestWorkflowContext(options = {}) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
|
-
//#region ../../packages/core/dist/chunks/execution-scope-
|
|
44
|
+
//#region ../../packages/core/dist/chunks/execution-scope-C0XN_QSm.mjs
|
|
45
45
|
const SCOPE_STACK_KEY = "__ks_execution_scope_stack__";
|
|
46
46
|
function getScopeStack() {
|
|
47
47
|
const g = globalThis;
|
|
@@ -75,7 +75,7 @@ function setExecutionScopeStepCredentialResolver(resolver) {
|
|
|
75
75
|
scope.stepCredentialResolver = resolver;
|
|
76
76
|
}
|
|
77
77
|
//#endregion
|
|
78
|
-
//#region ../../packages/core/dist/chunks/credential-resolver-registry-
|
|
78
|
+
//#region ../../packages/core/dist/chunks/credential-resolver-registry-DDCfrXbA.mjs
|
|
79
79
|
function registerOperationContext(registry) {
|
|
80
80
|
pushExecutionScopeStepContext(registry.getOperationContext);
|
|
81
81
|
}
|
|
@@ -89,7 +89,7 @@ function clearOperationCredentialResolver() {
|
|
|
89
89
|
setExecutionScopeStepCredentialResolver(void 0);
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region ../../packages/core/dist/chunks/context-registry-
|
|
92
|
+
//#region ../../packages/core/dist/chunks/context-registry-XkpuCrWY.mjs
|
|
93
93
|
function registerRuntime(registry) {
|
|
94
94
|
setExecutionScopeWorkflowRuntime(registry.getRuntime);
|
|
95
95
|
}
|
package/dist/{trigger-artifacts-BcRScRSp-BiD2h6do.mjs → trigger-artifacts-BcRScRSp-BRpU-He5.mjs}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as readOptionalJsonSchemaKeys } from "./declared-credential-requirements-B6h4WRv4.mjs";
|
|
4
4
|
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy-RuJszab7.mjs";
|
|
5
|
-
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-
|
|
6
|
-
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-
|
|
5
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-I07NYwfH.mjs";
|
|
6
|
+
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-r4aynBU0.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { rolldown } from "rolldown";
|
|
9
9
|
//#region ../../packages/workflow-builder/dist/trigger-artifacts-BcRScRSp.mjs
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { t as JsonSchemaSchema } from "./common-AK0q0Oz0.mjs";
|
|
4
|
-
import { c as TriggerSourceSchema, i as IdempotencyKeyConfigSchema, l as TriggerTypeSchema, s as TriggerCredentialRequirementsSchema } from "./credential-requirements-
|
|
4
|
+
import { c as TriggerSourceSchema, i as IdempotencyKeyConfigSchema, l as TriggerTypeSchema, s as TriggerCredentialRequirementsSchema } from "./credential-requirements-B5Alhu1v-DanlSKnT.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../packages/shared-types/src/workflows/build-output/trigger-manifest.ts
|
|
7
7
|
const TriggerBuildFunctionSchema = z.object({
|