@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,11 +1,11 @@
|
|
|
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-
|
|
3
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DnIFEmi5.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
5
5
|
import { n as SHA256HashSchema, t as JsonSchemaSchema } from "./common-AK0q0Oz0.mjs";
|
|
6
|
-
import { u as TriggerUploadDataSchema } from "./credential-requirements-
|
|
7
|
-
import { a as FlowGraphSchema, r as WorkflowBuildManifestSchema } from "./workflow-build-manifest-
|
|
8
|
-
import { n as PaginationQuerySchema } from "./schemas-
|
|
6
|
+
import { u as TriggerUploadDataSchema } from "./credential-requirements-B5Alhu1v-DanlSKnT.mjs";
|
|
7
|
+
import { a as FlowGraphSchema, r as WorkflowBuildManifestSchema } from "./workflow-build-manifest-CV6bBmDO.mjs";
|
|
8
|
+
import { n as PaginationQuerySchema } from "./schemas-8nhXlXWh.mjs";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
const GitProviderSchema = z.enum(["codestorage", "github"]);
|
|
11
11
|
const GitTreeEntryTypeSchema = z.enum(["file", "directory"]);
|
|
@@ -250,7 +250,7 @@ z.object({
|
|
|
250
250
|
const WorkflowsBuildOptionsSchema = z.object({
|
|
251
251
|
path: z.string().optional(),
|
|
252
252
|
verbose: z.boolean().default(false),
|
|
253
|
-
|
|
253
|
+
id: z.string().min(1).optional(),
|
|
254
254
|
target: z.array(z.string()).default([]),
|
|
255
255
|
force: z.boolean().default(false),
|
|
256
256
|
disableSourcemaps: z.boolean().default(false)
|
|
@@ -264,9 +264,9 @@ const BUILD_OPTIONS_CONFIG = {
|
|
|
264
264
|
flag: "--verbose",
|
|
265
265
|
description: "Show detailed build logs"
|
|
266
266
|
},
|
|
267
|
-
|
|
268
|
-
flag: "--
|
|
269
|
-
description: "
|
|
267
|
+
id: {
|
|
268
|
+
flag: "--id <authored-workflow-id>",
|
|
269
|
+
description: "After build, verify output includes this authored workflow id (use --target to scope files)"
|
|
270
270
|
},
|
|
271
271
|
target: {
|
|
272
272
|
flag: "--target <file>",
|
|
@@ -288,7 +288,7 @@ function createWorkflowsBuildCommand() {
|
|
|
288
288
|
description: "Build workflows locally",
|
|
289
289
|
schema: WorkflowsBuildOptionsSchema,
|
|
290
290
|
optionsConfig: BUILD_OPTIONS_CONFIG,
|
|
291
|
-
loadHandler: async () => (await import("./build.handler-
|
|
291
|
+
loadHandler: async () => (await import("./build.handler-CpAsAsBc.mjs")).handleWorkflowsBuild
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
//#endregion
|
|
@@ -312,10 +312,10 @@ function createWorkflowsDiffCommand() {
|
|
|
312
312
|
optionsConfig: DIFF_OPTIONS_CONFIG,
|
|
313
313
|
argument: {
|
|
314
314
|
name: "workflow",
|
|
315
|
-
description: "Authored workflow id
|
|
315
|
+
description: "Authored workflow id",
|
|
316
316
|
key: "workflow"
|
|
317
317
|
},
|
|
318
|
-
loadHandler: async () => (await import("./diff.handler-
|
|
318
|
+
loadHandler: async () => (await import("./diff.handler-DkM5dhaN.mjs")).handleWorkflowsDiff
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
321
|
//#endregion
|
|
@@ -333,22 +333,22 @@ const ENV_OPTIONS_CONFIG = {
|
|
|
333
333
|
},
|
|
334
334
|
check: {
|
|
335
335
|
flag: "--check",
|
|
336
|
-
description: "Exit non-zero if any required
|
|
336
|
+
description: "Exit non-zero if any required credential is not configured on the server (useful for CI)"
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
function createWorkflowsEnvCommand() {
|
|
340
340
|
return createTypedCommand({
|
|
341
341
|
name: "env",
|
|
342
|
-
description: "Show
|
|
342
|
+
description: "Show server-side credentials required by workflows",
|
|
343
343
|
schema: WorkflowsEnvOptionsSchema,
|
|
344
344
|
optionsConfig: ENV_OPTIONS_CONFIG,
|
|
345
345
|
argument: {
|
|
346
346
|
name: "workflow",
|
|
347
|
-
description: "Authored workflow id
|
|
347
|
+
description: "Authored workflow id — omit to show all",
|
|
348
348
|
key: "workflow",
|
|
349
349
|
required: false
|
|
350
350
|
},
|
|
351
|
-
loadHandler: async () => (await import("./env.handler-
|
|
351
|
+
loadHandler: async () => (await import("./env.handler-V_isbSi2.mjs")).handleWorkflowsEnv
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
//#endregion
|
|
@@ -377,10 +377,10 @@ function createWorkflowsInspectCommand() {
|
|
|
377
377
|
optionsConfig: INSPECT_OPTIONS_CONFIG,
|
|
378
378
|
argument: {
|
|
379
379
|
name: "workflow",
|
|
380
|
-
description: "Authored workflow id
|
|
380
|
+
description: "Authored workflow id",
|
|
381
381
|
key: "workflow"
|
|
382
382
|
},
|
|
383
|
-
loadHandler: async () => (await import("./inspect.handler-
|
|
383
|
+
loadHandler: async () => (await import("./inspect.handler-BE6coOuW.mjs")).handleWorkflowsInspect
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
@@ -406,7 +406,7 @@ const WorkflowsLogsOptionsSchema = JsonOptionSchema.extend({
|
|
|
406
406
|
if (!value.workflow && !value.runId) ctx.addIssue({
|
|
407
407
|
code: z.ZodIssueCode.custom,
|
|
408
408
|
path: ["workflow"],
|
|
409
|
-
message: "Provide an authored workflow id
|
|
409
|
+
message: "Provide an authored workflow id, or use --run-id <id> to inspect a specific run."
|
|
410
410
|
});
|
|
411
411
|
if (value.latest && value.runId) ctx.addIssue({
|
|
412
412
|
code: z.ZodIssueCode.custom,
|
|
@@ -416,7 +416,7 @@ const WorkflowsLogsOptionsSchema = JsonOptionSchema.extend({
|
|
|
416
416
|
if (value.latest && !value.workflow) ctx.addIssue({
|
|
417
417
|
code: z.ZodIssueCode.custom,
|
|
418
418
|
path: ["workflow"],
|
|
419
|
-
message: "--latest requires an authored workflow id
|
|
419
|
+
message: "--latest requires an authored workflow id."
|
|
420
420
|
});
|
|
421
421
|
if (value.status && logMode) ctx.addIssue({
|
|
422
422
|
code: z.ZodIssueCode.custom,
|
|
@@ -467,16 +467,16 @@ const LOGS_OPTIONS_CONFIG = {
|
|
|
467
467
|
function createWorkflowsLogsCommand() {
|
|
468
468
|
return createTypedCommand({
|
|
469
469
|
name: "logs",
|
|
470
|
-
description: "List recent runs for a workflow id
|
|
470
|
+
description: "List recent runs for a workflow id, or show logs for the latest or a specific run",
|
|
471
471
|
schema: WorkflowsLogsOptionsSchema,
|
|
472
472
|
optionsConfig: LOGS_OPTIONS_CONFIG,
|
|
473
473
|
argument: {
|
|
474
474
|
name: "workflow",
|
|
475
|
-
description: "Authored workflow id
|
|
475
|
+
description: "Authored workflow id",
|
|
476
476
|
key: "workflow",
|
|
477
477
|
required: false
|
|
478
478
|
},
|
|
479
|
-
loadHandler: async () => (await import("./logs.handler-
|
|
479
|
+
loadHandler: async () => (await import("./logs.handler-BRUzZC9Z.mjs")).handleWorkflowsLogs
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
//#endregion
|
|
@@ -662,11 +662,11 @@ function createWorkflowsPausedCommand() {
|
|
|
662
662
|
optionsConfig: PAUSED_OPTIONS_CONFIG,
|
|
663
663
|
argument: {
|
|
664
664
|
name: "workflow",
|
|
665
|
-
description: "Optional authored workflow id
|
|
665
|
+
description: "Optional authored workflow id",
|
|
666
666
|
key: "workflow",
|
|
667
667
|
required: false
|
|
668
668
|
},
|
|
669
|
-
loadHandler: async () => (await import("./paused.handler-
|
|
669
|
+
loadHandler: async () => (await import("./paused.handler-4wKMTKZ-.mjs")).handleWorkflowsPaused
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
672
|
//#endregion
|
|
@@ -760,19 +760,16 @@ function createWorkflowsRunCommand() {
|
|
|
760
760
|
key: "payload",
|
|
761
761
|
required: false
|
|
762
762
|
}],
|
|
763
|
-
loadHandler: async () => (await import("./run.handler-
|
|
763
|
+
loadHandler: async () => (await import("./run.handler-BKD5Xu0A.mjs")).handleWorkflowsRun
|
|
764
764
|
});
|
|
765
765
|
}
|
|
766
766
|
//#endregion
|
|
767
767
|
//#region src/commands/workflows/_shared/options.ts
|
|
768
768
|
/**
|
|
769
769
|
* Options schema for `workflows test` (build, upload, and run on server).
|
|
770
|
-
*
|
|
771
|
-
* Resolution order for workflow ref: authored workflow id (preferred) then name. If multiple workflows share a
|
|
772
|
-
* name, all are run sequentially. Use workflow id for exact targeting.
|
|
773
770
|
*/
|
|
774
771
|
const WorkflowsRunOptionsSchema = z.object({
|
|
775
|
-
/** Authored workflow id
|
|
772
|
+
/** Authored workflow id. */
|
|
776
773
|
workflow: z.string(),
|
|
777
774
|
input: z.string().optional(),
|
|
778
775
|
inputFile: z.string().optional(),
|
|
@@ -812,10 +809,10 @@ function createWorkflowsTestCommand() {
|
|
|
812
809
|
optionsConfig: RUN_OPTIONS_CONFIG,
|
|
813
810
|
argument: {
|
|
814
811
|
name: "workflow",
|
|
815
|
-
description: "Authored workflow id
|
|
812
|
+
description: "Authored workflow id",
|
|
816
813
|
key: "workflow"
|
|
817
814
|
},
|
|
818
|
-
loadHandler: async () => (await import("./test.handler-
|
|
815
|
+
loadHandler: async () => (await import("./test.handler-Bo4YTs2Z.mjs")).handleWorkflowsTest
|
|
819
816
|
});
|
|
820
817
|
}
|
|
821
818
|
//#endregion
|
|
@@ -838,7 +835,7 @@ const VALIDATE_OPTIONS_CONFIG = {
|
|
|
838
835
|
},
|
|
839
836
|
typecheck: {
|
|
840
837
|
flag: "--no-typecheck",
|
|
841
|
-
description: "
|
|
838
|
+
description: "Skip TypeScript type-checking of workflow source files"
|
|
842
839
|
}
|
|
843
840
|
};
|
|
844
841
|
function createWorkflowsValidateCommand() {
|
|
@@ -849,11 +846,11 @@ function createWorkflowsValidateCommand() {
|
|
|
849
846
|
optionsConfig: VALIDATE_OPTIONS_CONFIG,
|
|
850
847
|
argument: {
|
|
851
848
|
name: "workflow",
|
|
852
|
-
description: "Authored workflow id
|
|
849
|
+
description: "Authored workflow id — omit to validate all",
|
|
853
850
|
key: "workflow",
|
|
854
851
|
required: false
|
|
855
852
|
},
|
|
856
|
-
loadHandler: async () => (await import("./validate.handler-
|
|
853
|
+
loadHandler: async () => (await import("./validate.handler-1d-UmtXB.mjs")).handleWorkflowsValidate
|
|
857
854
|
});
|
|
858
855
|
}
|
|
859
856
|
//#endregion
|
|
@@ -872,14 +869,14 @@ function createWorkflowsCommand() {
|
|
|
872
869
|
description: "Manage, run, inspect, and debug workflows",
|
|
873
870
|
schema: WorkflowsOptionsSchema,
|
|
874
871
|
optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
|
|
875
|
-
loadHandler: async () => (await import("./list.handler-
|
|
872
|
+
loadHandler: async () => (await import("./list.handler-Choc4SZz.mjs")).handleWorkflowsList,
|
|
876
873
|
subcommands: [
|
|
877
874
|
createTypedCommand({
|
|
878
875
|
name: "list",
|
|
879
876
|
description: "List all workflows in the project",
|
|
880
877
|
schema: WorkflowsOptionsSchema,
|
|
881
878
|
optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
|
|
882
|
-
loadHandler: async () => (await import("./list.handler-
|
|
879
|
+
loadHandler: async () => (await import("./list.handler-Choc4SZz.mjs")).handleWorkflowsList
|
|
883
880
|
}),
|
|
884
881
|
createWorkflowsBuildCommand(),
|
|
885
882
|
createWorkflowsTestCommand(),
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
4
|
import { f as getTriggersDir, n as BUILD_OUTPUT_DIR_NAME, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-B95Tku8F.mjs";
|
|
5
|
-
import { t as TriggerBuildManifestSchema } from "./trigger-manifest-
|
|
5
|
+
import { t as TriggerBuildManifestSchema } from "./trigger-manifest-BVqjDhxU.mjs";
|
|
6
6
|
import { t as __exportAll$1 } from "./rolldown-runtime-twds-ZHy-RuJszab7.mjs";
|
|
7
7
|
import { s as sha256String } from "./metadata-layout-Bv-B0nHj-CO8mjjSl.mjs";
|
|
8
8
|
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-CnBnF2cg.mjs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { access, mkdir, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
|
-
//#region ../../packages/workflow-builder/dist/writer-
|
|
13
|
-
var
|
|
12
|
+
//#region ../../packages/workflow-builder/dist/writer-BLg0RuZa.mjs
|
|
13
|
+
var writer_BLg0RuZa_exports = /* @__PURE__ */ __exportAll({
|
|
14
14
|
a: () => getAgentArtifactPaths,
|
|
15
15
|
d: () => allOutputFilesExist,
|
|
16
16
|
f: () => hashAgentManifestForDisk,
|
|
@@ -179,6 +179,7 @@ async function writeWorkflowArtifact(artifact, outputDir, options) {
|
|
|
179
179
|
writeFile(artifactPaths.bundlePath, artifact.bundle.code, "utf-8")
|
|
180
180
|
];
|
|
181
181
|
if (artifact.bundle.sourceMap) writes.push(writeFile(artifactPaths.sourceMapPath, artifact.bundle.sourceMap, "utf-8"));
|
|
182
|
+
else await rm(artifactPaths.sourceMapPath, { force: true });
|
|
182
183
|
await Promise.all(writes);
|
|
183
184
|
markBundleDiskBacked(artifact.bundle, {
|
|
184
185
|
outputPath: artifactPaths.bundlePath,
|
|
@@ -228,6 +229,7 @@ async function writeTaskArtifact(artifact, outputDir, options) {
|
|
|
228
229
|
const manifestJson = `${JSON.stringify(artifact.manifest, null, 2)}\n`;
|
|
229
230
|
const writes = [writeFile(artifactPaths.manifestPath, manifestJson, "utf-8"), writeFile(artifactPaths.bundlePath, artifact.bundle.code, "utf-8")];
|
|
230
231
|
if (artifact.bundle.sourceMap) writes.push(writeFile(artifactPaths.sourceMapPath, artifact.bundle.sourceMap, "utf-8"));
|
|
232
|
+
else await rm(artifactPaths.sourceMapPath, { force: true });
|
|
231
233
|
await Promise.all(writes);
|
|
232
234
|
markBundleDiskBacked(artifact.bundle, {
|
|
233
235
|
outputPath: artifactPaths.bundlePath,
|
|
@@ -414,4 +416,4 @@ var writer_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
414
416
|
writeTargetedBuildOutput: () => writeTargetedBuildOutput
|
|
415
417
|
});
|
|
416
418
|
//#endregion
|
|
417
|
-
export { getAgentArtifactPaths as a, hashWorkflowManifestForDisk as c, resolveOutputDir as d,
|
|
419
|
+
export { getAgentArtifactPaths as a, hashWorkflowManifestForDisk as c, resolveOutputDir as d, writer_BLg0RuZa_exports as f, createAgentOutputFiles as i, removeAgentArtifacts as l, BUILD_CACHE_FILE_NAME as n, hashAgentManifestForDisk as o, allOutputFilesExist as r, hashWorkflowFlowForDisk as s, AGENT_ARTIFACT_DIR_PREFIX as t, removeWorkflowArtifacts as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Command-line interface for creating, managing, and deploying Keystroke automations.",
|
|
6
6
|
"type": "module",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"tsdown": "0.21.10",
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
40
|
"vitest": "^4.1.5",
|
|
41
|
-
"@keystroke/local-memory": "0.0.2",
|
|
42
41
|
"@keystroke/env-utils": "0.0.0",
|
|
42
|
+
"@keystroke/local-memory": "0.0.2",
|
|
43
|
+
"@keystroke/shared-types": "0.0.12",
|
|
43
44
|
"@keystrokehq/config": "0.0.2",
|
|
44
|
-
"@keystroke/
|
|
45
|
-
"@keystroke/test-utils": "0.0.6",
|
|
45
|
+
"@keystroke/test-utils": "0.0.7",
|
|
46
46
|
"@keystroke/typescript-config": "0.0.0",
|
|
47
47
|
"@keystroke/utils": "0.0.0",
|
|
48
|
-
"@keystroke/workflow-builder": "0.0.
|
|
49
|
-
"@keystrokehq/core": "0.0.
|
|
50
|
-
"@keystrokehq/runtime": "0.0.
|
|
51
|
-
"@keystrokehq/
|
|
52
|
-
"@
|
|
53
|
-
"@keystroke/workflow-
|
|
54
|
-
"@
|
|
48
|
+
"@keystroke/workflow-builder": "0.0.17",
|
|
49
|
+
"@keystrokehq/core": "0.0.11",
|
|
50
|
+
"@keystrokehq/runtime": "0.0.8",
|
|
51
|
+
"@keystrokehq/testing": "0.2.6",
|
|
52
|
+
"@keystroke/workflow-deploy": "0.0.14",
|
|
53
|
+
"@keystroke/workflow-sdk": "0.0.12",
|
|
54
|
+
"@keystrokehq/workflow-build-contracts": "0.0.7"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"automation",
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { A as WorkflowResolutionError, a as ui, g as getHttpStatus, h as getApiErrorCode } from "./keystroke.mjs";
|
|
4
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
5
|
-
import { a as readManifestsFromOutDir } from "./dist-CTEtWDW4.mjs";
|
|
6
|
-
import { t as requireWorkflowsDir } from "./resolve-project-E9mrh_el.mjs";
|
|
7
|
-
import { t as createSpinnerProgress } from "./spinner-progress-lrKDs4YF.mjs";
|
|
8
|
-
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Begvjfq8.mjs";
|
|
9
|
-
//#region src/commands/workflows/_shared/current-deployment-workflow.ts
|
|
10
|
-
/**
|
|
11
|
-
* Lightweight resolution: gets projectId from keystroke.config.ts and authoredWorkflowId
|
|
12
|
-
* from cached manifests without triggering a build. Falls back to a full build
|
|
13
|
-
* only if the cached manifest is unavailable and the ref isn't already an authored ID.
|
|
14
|
-
*/
|
|
15
|
-
async function resolveProjectContext(workflowRef, explicitPath, options) {
|
|
16
|
-
const workflowsDir = await requireWorkflowsDir(explicitPath);
|
|
17
|
-
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
18
|
-
const cachedId = (await readManifestsFromOutDir(workflowsDir, workflowRef))[0]?.manifest.id;
|
|
19
|
-
if (typeof cachedId === "string" && cachedId.length > 0) return {
|
|
20
|
-
workflowsDir,
|
|
21
|
-
organizationId: projectConfig.organizationId,
|
|
22
|
-
projectId: projectConfig.projectId,
|
|
23
|
-
authoredWorkflowId: cachedId
|
|
24
|
-
};
|
|
25
|
-
if (workflowRef.startsWith("wf_")) return {
|
|
26
|
-
workflowsDir,
|
|
27
|
-
organizationId: projectConfig.organizationId,
|
|
28
|
-
projectId: projectConfig.projectId,
|
|
29
|
-
authoredWorkflowId: workflowRef
|
|
30
|
-
};
|
|
31
|
-
const resolved = await resolveLocalWorkflowManifest(workflowRef, explicitPath, options);
|
|
32
|
-
return {
|
|
33
|
-
workflowsDir: resolved.workflowsDir,
|
|
34
|
-
organizationId: resolved.organizationId,
|
|
35
|
-
projectId: resolved.projectId,
|
|
36
|
-
authoredWorkflowId: resolved.authoredWorkflowId
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
async function resolveLocalWorkflowManifest(workflowRef, explicitPath, options) {
|
|
40
|
-
const workflowsDir = await requireWorkflowsDir(explicitPath);
|
|
41
|
-
let results = await readManifestsFromOutDir(workflowsDir, workflowRef);
|
|
42
|
-
if (results.length === 0) {
|
|
43
|
-
const spinner = !options?.jsonMode ? createSpinnerProgress("[resolve]") : void 0;
|
|
44
|
-
spinner?.start(`Building "${workflowRef}" to resolve manifest...`);
|
|
45
|
-
try {
|
|
46
|
-
await runWorkflowBuild({
|
|
47
|
-
workflowsDir,
|
|
48
|
-
workflowRef,
|
|
49
|
-
verbose: false,
|
|
50
|
-
force: false
|
|
51
|
-
});
|
|
52
|
-
spinner?.stop();
|
|
53
|
-
} catch (error) {
|
|
54
|
-
spinner?.stop();
|
|
55
|
-
renderBuildFailure(error);
|
|
56
|
-
throw new WorkflowResolutionError(`Build failed for "${workflowRef}"`);
|
|
57
|
-
}
|
|
58
|
-
results = await readManifestsFromOutDir(workflowsDir, workflowRef);
|
|
59
|
-
}
|
|
60
|
-
const found = results[0];
|
|
61
|
-
if (!found) {
|
|
62
|
-
ui.error(`Workflow "${workflowRef}" not found.`);
|
|
63
|
-
throw new WorkflowResolutionError(`Workflow "${workflowRef}" not found.`);
|
|
64
|
-
}
|
|
65
|
-
const authoredWorkflowId = typeof found.manifest.id === "string" && found.manifest.id.length > 0 ? found.manifest.id : null;
|
|
66
|
-
if (!authoredWorkflowId) {
|
|
67
|
-
ui.error(`Workflow "${workflowRef}" is missing an authored workflow ID.`);
|
|
68
|
-
throw new WorkflowResolutionError(`Workflow "${workflowRef}" is missing an authored workflow ID.`);
|
|
69
|
-
}
|
|
70
|
-
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
71
|
-
return {
|
|
72
|
-
workflowsDir,
|
|
73
|
-
organizationId: projectConfig.organizationId,
|
|
74
|
-
projectId: projectConfig.projectId,
|
|
75
|
-
authoredWorkflowId,
|
|
76
|
-
manifest: found.manifest
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
async function lookupCurrentDeploymentWorkflow(client, params) {
|
|
80
|
-
try {
|
|
81
|
-
return {
|
|
82
|
-
status: "found",
|
|
83
|
-
workflow: (await client.projects.getCurrentDeploymentWorkflow(params.projectId, params.authoredWorkflowId)).workflow
|
|
84
|
-
};
|
|
85
|
-
} catch (error) {
|
|
86
|
-
if (getHttpStatus(error) !== 404) throw error;
|
|
87
|
-
const errorCode = await getApiErrorCode(error);
|
|
88
|
-
if (errorCode === "no_current_deployment") return { status: "missingCurrentDeployment" };
|
|
89
|
-
if (errorCode === "workflow_not_in_deployment") return { status: "missingWorkflow" };
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { resolveLocalWorkflowManifest as n, resolveProjectContext as r, lookupCurrentDeploymentWorkflow as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { a as ui } from "./keystroke.mjs";
|
|
4
|
-
import { i as requireClient } from "./context-sgKhRc5v.mjs";
|
|
5
|
-
//#region src/commands/org/current.handler.ts
|
|
6
|
-
async function handleOrgCurrent(_options, ctx) {
|
|
7
|
-
if (!ctx.organizationId) {
|
|
8
|
-
ui.warn("No organization set. Use `keystroke org switch` or `--org` to select one.");
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const { user } = await requireClient(ctx).users.getMe();
|
|
12
|
-
const currentOrg = user.organizations?.find((o) => o.id === ctx.organizationId);
|
|
13
|
-
if (currentOrg) {
|
|
14
|
-
ui.text(`Current organization: ${currentOrg.name}`);
|
|
15
|
-
if (ctx.orgSource) ui.hint(`Source: ${ctx.orgSource}`);
|
|
16
|
-
} else ui.text(`Current organization ID: ${ctx.organizationId}`);
|
|
17
|
-
const storedOrgCount = ctx.storedOrgs.length;
|
|
18
|
-
if (storedOrgCount > 1) ui.hint(`${storedOrgCount} organizations with stored credentials. Use \`keystroke org switch\` to change.`);
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { handleOrgCurrent };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { a as ui, n as style, t as ANSI } from "./keystroke.mjs";
|
|
4
|
-
import { i as projects } from "./dist-Dw7gCE7y.mjs";
|
|
5
|
-
import { i as readProjectConfig } from "./project-config-DudGRFPO.mjs";
|
|
6
|
-
import { i as writeJson } from "./output-BWcVRt-T.mjs";
|
|
7
|
-
import { access } from "node:fs/promises";
|
|
8
|
-
import Table from "cli-table3";
|
|
9
|
-
//#region src/commands/projects/list.handler.ts
|
|
10
|
-
async function getProjectNameFromConfig(projectPath) {
|
|
11
|
-
return (await readProjectConfig(projectPath))?.name;
|
|
12
|
-
}
|
|
13
|
-
function relativeTime(isoDate) {
|
|
14
|
-
const diff = Date.now() - new Date(isoDate).getTime();
|
|
15
|
-
const seconds = Math.floor(diff / 1e3);
|
|
16
|
-
if (seconds < 60) return `${seconds}s ago`;
|
|
17
|
-
const minutes = Math.floor(seconds / 60);
|
|
18
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
19
|
-
const hours = Math.floor(minutes / 60);
|
|
20
|
-
if (hours < 24) return `${hours}h ago`;
|
|
21
|
-
return `${Math.floor(hours / 24)}d ago`;
|
|
22
|
-
}
|
|
23
|
-
async function pathExists(p) {
|
|
24
|
-
try {
|
|
25
|
-
await access(p);
|
|
26
|
-
return true;
|
|
27
|
-
} catch {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async function handleProjectsList(_options, ctx) {
|
|
32
|
-
const tracked = await projects.list();
|
|
33
|
-
if (tracked.length === 0) {
|
|
34
|
-
if (ctx.jsonMode) {
|
|
35
|
-
writeJson([]);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
ui.hint("No tracked projects. Run `keystroke init` to get started.");
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const lastProject = await projects.getLast();
|
|
42
|
-
const sorted = [...tracked].sort((a, b) => new Date(b.lastAccessed).getTime() - new Date(a.lastAccessed).getTime());
|
|
43
|
-
if (ctx.jsonMode) {
|
|
44
|
-
writeJson(sorted.map((entry) => ({
|
|
45
|
-
name: entry.name ?? null,
|
|
46
|
-
path: entry.path,
|
|
47
|
-
lastAccessed: entry.lastAccessed,
|
|
48
|
-
isRecent: lastProject === entry.path
|
|
49
|
-
})));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const table = new Table({
|
|
53
|
-
head: [
|
|
54
|
-
"Name",
|
|
55
|
-
"Path",
|
|
56
|
-
"Last Accessed"
|
|
57
|
-
],
|
|
58
|
-
style: { head: [] }
|
|
59
|
-
});
|
|
60
|
-
for (const entry of sorted) {
|
|
61
|
-
const exists = await pathExists(entry.path);
|
|
62
|
-
const nameCol = entry.name ?? (exists ? await getProjectNameFromConfig(entry.path) : void 0) ?? style("(unnamed)", ANSI.dim);
|
|
63
|
-
const pathCol = exists ? entry.path : `${entry.path} ${style("(missing)", ANSI.yellow)}`;
|
|
64
|
-
const timeCol = relativeTime(entry.lastAccessed);
|
|
65
|
-
const indicator = lastProject === entry.path ? ` ${style("(recent)", ANSI.cyan)}` : "";
|
|
66
|
-
table.push([
|
|
67
|
-
nameCol,
|
|
68
|
-
`${pathCol}${indicator}`,
|
|
69
|
-
timeCol
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
ui.text(table.toString());
|
|
73
|
-
ui.hint(`\n${sorted.length} project(s) tracked`);
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
export { handleProjectsList };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { a as ui, j as throwReportedCliExit, n as style, t as ANSI } from "./keystroke.mjs";
|
|
4
|
-
import { i as projects } from "./dist-Dw7gCE7y.mjs";
|
|
5
|
-
import { i as writeJson } from "./output-BWcVRt-T.mjs";
|
|
6
|
-
import { t as requireWorkflowsDir } from "./resolve-project-E9mrh_el.mjs";
|
|
7
|
-
import { t as createSpinnerProgress } from "./spinner-progress-lrKDs4YF.mjs";
|
|
8
|
-
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Begvjfq8.mjs";
|
|
9
|
-
//#region src/commands/workflows/list.handler.ts
|
|
10
|
-
function formatWorkflow(artifact) {
|
|
11
|
-
const name = style(artifact.manifest.name, `${ANSI.bold}${ANSI.cyan}`);
|
|
12
|
-
const filePath = style(artifact.workflow.resolvedFilePath, ANSI.dim);
|
|
13
|
-
const lines = [` ${name}`, ` ${filePath}`];
|
|
14
|
-
if (artifact.manifest.description) lines.push(` ${artifact.manifest.description}`);
|
|
15
|
-
lines.push(` ${style(`$ keystroke workflows test "${artifact.manifest.name}"`, ANSI.dim)}`);
|
|
16
|
-
return lines.join("\n");
|
|
17
|
-
}
|
|
18
|
-
async function handleWorkflowsList(options, ctx) {
|
|
19
|
-
const workflowsDir = await requireWorkflowsDir(options.path);
|
|
20
|
-
await projects.track(workflowsDir);
|
|
21
|
-
const spinner = !ctx.jsonMode ? createSpinnerProgress("[list]") : void 0;
|
|
22
|
-
spinner?.start("Loading workflows...");
|
|
23
|
-
try {
|
|
24
|
-
const { result } = await runWorkflowBuild({
|
|
25
|
-
workflowsDir,
|
|
26
|
-
verbose: false
|
|
27
|
-
});
|
|
28
|
-
spinner?.stop();
|
|
29
|
-
if (ctx.jsonMode) {
|
|
30
|
-
writeJson(result.artifacts.map((artifact) => ({
|
|
31
|
-
name: artifact.manifest.name,
|
|
32
|
-
filePath: artifact.workflow.resolvedFilePath,
|
|
33
|
-
description: artifact.manifest.description ?? null,
|
|
34
|
-
exportName: artifact.workflow.exportName
|
|
35
|
-
})));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (result.artifacts.length === 0) {
|
|
39
|
-
ui.hint(`No workflows found in ${workflowsDir}`);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
ui.text(result.artifacts.map(formatWorkflow).join("\n\n"));
|
|
43
|
-
ui.br();
|
|
44
|
-
ui.hint(`${result.artifacts.length} workflow(s) found`);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
spinner?.stop();
|
|
47
|
-
renderBuildFailure(error);
|
|
48
|
-
throwReportedCliExit("Failed to list workflows.", { cause: error });
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { handleWorkflowsList };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { a as ui } from "./keystroke.mjs";
|
|
4
|
-
import { i as requireClient } from "./context-sgKhRc5v.mjs";
|
|
5
|
-
//#region src/commands/org/list.handler.ts
|
|
6
|
-
async function handleOrgList(_options, ctx) {
|
|
7
|
-
const { user } = await requireClient(ctx).users.getMe();
|
|
8
|
-
const orgs = user.organizations ?? [];
|
|
9
|
-
const currentOrgId = ctx.organizationId;
|
|
10
|
-
const storedOrgIds = new Set(ctx.storedOrgs.map((o) => o.organizationId));
|
|
11
|
-
if (orgs.length === 0) {
|
|
12
|
-
ui.warn("You do not belong to any organization.");
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
for (const org of orgs) {
|
|
16
|
-
const parts = [];
|
|
17
|
-
if (org.id === currentOrgId) parts.push("current");
|
|
18
|
-
if (storedOrgIds.has(org.id)) parts.push("key stored");
|
|
19
|
-
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
20
|
-
ui.text(` ${org.name}${suffix}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { handleOrgList };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
-
//#region src/lib/package-manager.ts
|
|
6
|
-
const PackageManagerValues = [
|
|
7
|
-
"npm",
|
|
8
|
-
"pnpm",
|
|
9
|
-
"yarn",
|
|
10
|
-
"bun"
|
|
11
|
-
];
|
|
12
|
-
function parsePackageManagerField(value) {
|
|
13
|
-
if (typeof value !== "string" || value.length === 0) return null;
|
|
14
|
-
const name = value.split("@")[0]?.trim();
|
|
15
|
-
if (name && PackageManagerValues.includes(name)) return name;
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
function detectFromLockfiles(directory) {
|
|
19
|
-
if (existsSync(join(directory, "bun.lockb")) || existsSync(join(directory, "bun.lock"))) return "bun";
|
|
20
|
-
if (existsSync(join(directory, "pnpm-lock.yaml"))) return "pnpm";
|
|
21
|
-
if (existsSync(join(directory, "yarn.lock"))) return "yarn";
|
|
22
|
-
if (existsSync(join(directory, "package-lock.json")) || existsSync(join(directory, "npm-shrinkwrap.json"))) return "npm";
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
function readPackageManagerField(directory) {
|
|
26
|
-
const packageJsonPath = join(directory, "package.json");
|
|
27
|
-
if (!existsSync(packageJsonPath)) return null;
|
|
28
|
-
try {
|
|
29
|
-
return parsePackageManagerField(JSON.parse(readFileSync(packageJsonPath, "utf8")).packageManager);
|
|
30
|
-
} catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Infers the package manager for the current working directory by walking up
|
|
36
|
-
* from `cwd` and preferring lockfiles (monorepo roots) over nested package.json
|
|
37
|
-
* files without lockfiles.
|
|
38
|
-
*/
|
|
39
|
-
function detectPackageManager(options = {}) {
|
|
40
|
-
let directory = options.cwd ?? process.cwd();
|
|
41
|
-
let packageManagerFromField = null;
|
|
42
|
-
while (true) {
|
|
43
|
-
const fromLockfiles = detectFromLockfiles(directory);
|
|
44
|
-
if (fromLockfiles) return fromLockfiles;
|
|
45
|
-
const fromField = readPackageManagerField(directory);
|
|
46
|
-
if (fromField && !packageManagerFromField) packageManagerFromField = fromField;
|
|
47
|
-
const parent = dirname(directory);
|
|
48
|
-
if (parent === directory) break;
|
|
49
|
-
directory = parent;
|
|
50
|
-
}
|
|
51
|
-
return packageManagerFromField ?? "npm";
|
|
52
|
-
}
|
|
53
|
-
function formatPackageInstallCommand(packageName, options = {}) {
|
|
54
|
-
const packageManager = options.packageManager ?? detectPackageManager({ cwd: options.cwd });
|
|
55
|
-
if (packageManager === "npm") return `npm install ${packageName}`;
|
|
56
|
-
if (packageManager === "pnpm") return `pnpm add ${packageName}`;
|
|
57
|
-
if (packageManager === "yarn") return `yarn add ${packageName}`;
|
|
58
|
-
return `bun add ${packageName}`;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
export { formatPackageInstallCommand as n, detectPackageManager as t };
|