@keystrokehq/cli 0.0.8 → 0.0.9

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.
Files changed (51) hide show
  1. package/dist/{admin-Bhm7VkGG.mjs → admin-Dga-_lDF.mjs} +1 -1
  2. package/dist/{agents-DYP6fmGE.mjs → agents-DII_JbCa.mjs} +2 -2
  3. package/dist/{api-keys-CC5yevJn.mjs → api-keys-DeTqHzI4.mjs} +1 -1
  4. package/dist/{auth-KRUcoMkk.mjs → auth-C0fuZ0_P.mjs} +1 -1
  5. package/dist/{build-agents-DfbiMZ_e-CLHxZKOg.mjs → build-agents-DfbiMZ_e-CgnKa9A6.mjs} +2 -2
  6. package/dist/{build-tasks-O1jYtlv1-Cr7vs_B_.mjs → build-tasks-O1jYtlv1-Bkw0w1r3.mjs} +2 -2
  7. package/dist/{build-workflows-3fdvdHHf-DnDmsKuG.mjs → build-workflows-3fdvdHHf-BDTy9QgT.mjs} +2 -2
  8. package/dist/{build.handler-CXqfqwho.mjs → build.handler-D15NjKkT.mjs} +1 -1
  9. package/dist/{commander-Wr7RrODw.mjs → commander-B6_tg5_w.mjs} +9 -9
  10. package/dist/{connect-CbzAP3Zo.mjs → connect-D9PVABIW.mjs} +1 -1
  11. package/dist/{credentials-BpfWiGuG.mjs → credentials-BW-v9xVQ.mjs} +1 -1
  12. package/dist/{current-deployment-workflow-C5oiOVsx.mjs → current-deployment-workflow-j5DlVkb2.mjs} +1 -1
  13. package/dist/{deploy-B7BCgf_y.mjs → deploy-BU04ehfM.mjs} +2 -2
  14. package/dist/{deploy.handler-BLp-JNV2.mjs → deploy.handler-CbYYyVOg.mjs} +6 -6
  15. package/dist/{diff.handler-zVbHzE1Q.mjs → diff.handler-Dtjc7Y4O.mjs} +1 -1
  16. package/dist/{init-DwVARQud.mjs → init-BITuemMR.mjs} +1 -1
  17. package/dist/{inspect.handler-CcyFNUJP.mjs → inspect.handler-Buv68Vm9.mjs} +1 -1
  18. package/dist/{integrations-DCMkBcjI.mjs → integrations-Dib-OfdN.mjs} +1 -1
  19. package/dist/{invites-DpJjZznC.mjs → invites-CJtInw9Q.mjs} +1 -1
  20. package/dist/keystroke.mjs +21 -21
  21. package/dist/{list.handler-Val6EmGK.mjs → list.handler-Bi28Gsee.mjs} +1 -1
  22. package/dist/{listen-C_YrC5Go.mjs → listen-_GvXm7iI.mjs} +1 -1
  23. package/dist/{logs-C1f6RjQ7.mjs → logs-De7ITMv1.mjs} +1 -1
  24. package/dist/{org-8Dsab2dz.mjs → org-DLY5V_Uw.mjs} +1 -1
  25. package/dist/{projects-CZbAqlPQ.mjs → projects-lN-4ZR9Q.mjs} +1 -1
  26. package/dist/{try-deploy.handler-BCvwi1jc.mjs → run-polling-BLT-uS2e.mjs} +86 -185
  27. package/dist/run.handler-B5NodlNi.mjs +136 -0
  28. package/dist/{runs-C7uqumfa.mjs → runs-BfgL8BR_.mjs} +1 -1
  29. package/dist/{skills.command-23jSicQp.mjs → skills.command-z-sOQpkN.mjs} +1 -1
  30. package/dist/{sync-Pzb3od7n.mjs → sync-CIibxcUe.mjs} +2 -2
  31. package/dist/{sync.handler-bEzSgeTW.mjs → sync.handler-D2cY3bia.mjs} +1 -1
  32. package/dist/{task-target-build-BA67W_6d.mjs → task-target-build-D5IrHqSl.mjs} +3 -3
  33. package/dist/task-target-deploy-runner.mjs +4 -4
  34. package/dist/{test-B4uana86.mjs → test-Dsx4cRnE.mjs} +5 -4
  35. package/dist/{trigger-artifacts-B3OCTX9K-37Ca-ELC.mjs → trigger-artifacts-B3OCTX9K-ME6IVdUB.mjs} +2 -2
  36. package/dist/try-deploy.handler-Lq69ON02.mjs +169 -0
  37. package/dist/{upgrade-Bp9gnslY.mjs → upgrade-DQrHCNR8.mjs} +2 -2
  38. package/dist/{validate.handler-BiToUknO.mjs → validate.handler-BUga7Umz.mjs} +1 -1
  39. package/dist/{workflow-build-KCdasPyU.mjs → workflow-build-Be6RMTb2.mjs} +5 -5
  40. package/dist/{workflow-bundler-BzHk73PM-C1NWDEju.mjs → workflow-bundler-BzHk73PM-tt09RbIA.mjs} +1 -1
  41. package/dist/{workflows-Bhd_vuCI.mjs → workflows-Cdo-AgjV.mjs} +106 -11
  42. package/package.json +4 -4
  43. /package/dist/{build-metadata-zidV9Cai-BNC_-zub.mjs → build-metadata-zidV9Cai-Bq37kBOM.mjs} +0 -0
  44. /package/dist/{deploy-CHfWGM32.mjs → deploy-B8TYutOi.mjs} +0 -0
  45. /package/dist/{detect-env-access-CwkOYeYM-KtEle6I3.mjs → detect-env-access-CwkOYeYM-D4o8gRZs.mjs} +0 -0
  46. /package/dist/{env.handler-CqfOZEou.mjs → env.handler-DbxnyBYf.mjs} +0 -0
  47. /package/dist/{logs.handler-BNFUmakA.mjs → logs.handler-COtiXeqn.mjs} +0 -0
  48. /package/dist/{paused.handler-wgaf8sse.mjs → paused.handler-BX_71fzx.mjs} +0 -0
  49. /package/dist/{read-credential-keys-77a91T8M-DMmY6oDW.mjs → read-credential-keys-77a91T8M-B0eiobOd.mjs} +0 -0
  50. /package/dist/{task-target-deploy-DqX7bJ55.mjs → task-target-deploy-Bzfftyru.mjs} +0 -0
  51. /package/dist/{upgrade.handler-D82k9CHa.mjs → upgrade.handler-B0NxKINA.mjs} +0 -0
@@ -0,0 +1,169 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
4
+ import { O as CliExitError, a as isLocalMode, b as toErrorMessage, t as ui } from "./keystroke.mjs";
5
+ import { d as trackProject } from "./dist-BF6r1hfv.mjs";
6
+ import { t as assertWorkflowProjectRoot } from "./project-config-D9eFU8Jk.mjs";
7
+ import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-DT06adrn.mjs";
8
+ import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-DvO0q6Fo.mjs";
9
+ import { t as requireWorkflowsDir } from "./resolve-project-BREjwFKO.mjs";
10
+ import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-Be6RMTb2.mjs";
11
+ import { r as isUnknownSchema } from "./schema-display-DuWBmkwk.mjs";
12
+ import { t as createBuildProgress } from "./build-progress-Mzsk4RKr.mjs";
13
+ import { t as withErrorBoundary } from "./error-boundary-D6KTx1HL.mjs";
14
+ import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-BLT-uS2e.mjs";
15
+ //#region src/lib/format.ts
16
+ function formatBytes(bytes) {
17
+ if (bytes < 1024) return `${bytes} B`;
18
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
19
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
20
+ }
21
+ //#endregion
22
+ //#region src/commands/workflows/_shared/run-helpers.ts
23
+ /**
24
+ * Resolve input and validate against existing schema if available.
25
+ * Returns input and workflowsDir for downstream use.
26
+ */
27
+ async function resolveAndValidateInputForRun(options) {
28
+ const input = await resolveInput(options);
29
+ const workflowsDir = await requireWorkflowsDir(options.path);
30
+ trackProject(workflowsDir);
31
+ const existingSchema = await tryReadExistingInputSchema(workflowsDir, options.workflow);
32
+ if (existingSchema && !isUnknownSchema(existingSchema)) validateInputOrExit(options.workflow, input, existingSchema);
33
+ return {
34
+ input,
35
+ workflowsDir
36
+ };
37
+ }
38
+ /**
39
+ * Build workflow(s) for run using the standard build pipeline, then read
40
+ * prepared artifacts from disk filtered by workflow ref.
41
+ */
42
+ async function buildWorkflowsForRun(options) {
43
+ const progress = createBuildProgress(options.workflow);
44
+ try {
45
+ const { result, outDir } = await runWorkflowBuild({
46
+ workflowsDir: options.workflowsDir,
47
+ workflowRef: options.workflow,
48
+ verbose: options.verbose,
49
+ onProgressEvent: progress.handleEvent
50
+ });
51
+ const filtered = (await readWorkflowsFromDisk(outDir)).filter((wf) => wf.manifestData.id === options.workflow || wf.name === options.workflow);
52
+ if (filtered.length === 0) {
53
+ const availableNames = result.artifacts.map((a) => a.manifest.name);
54
+ throw new WorkflowNotFoundError(options.workflow, availableNames);
55
+ }
56
+ return filtered;
57
+ } finally {
58
+ progress.stop();
59
+ }
60
+ }
61
+ /**
62
+ * Validate input against the first build's input schema if available.
63
+ */
64
+ function validateInputWithFirstBuild(options, input, builds) {
65
+ const inputSchema = builds[0]?.manifestData.workflowSchemas.input;
66
+ if (inputSchema && typeof inputSchema === "object" && !isUnknownSchema(inputSchema)) validateInputOrExit(options.workflow, input, inputSchema);
67
+ }
68
+ /**
69
+ * Render success message after build.
70
+ */
71
+ function renderBuildSuccessMessage(builds) {
72
+ const first = builds[0];
73
+ if (!first) return;
74
+ if (builds.length > 1) ui.success(`Built ${builds.length} workflow(s) with name "${first.name}"`);
75
+ else ui.success(`Built ${first.name} (${formatBytes(first.bundleSize)})`);
76
+ }
77
+ /**
78
+ * Render completion success message (single or multi).
79
+ */
80
+ function renderRunCompletionSuccessMessage(builds, elapsedSeconds) {
81
+ if (builds.length === 0) return;
82
+ if (builds.length > 1) ui.success(`All ${builds.length} workflow(s) completed in ${elapsedSeconds}s`);
83
+ else ui.success(`Workflow completed in ${elapsedSeconds}s`);
84
+ }
85
+ //#endregion
86
+ //#region src/commands/workflows/try-deploy.handler/index.ts
87
+ var try_deploy_handler_exports = /* @__PURE__ */ __exportAll({ handleWorkflowsTryDeploy: () => handleWorkflowsTryDeploy });
88
+ async function handleWorkflowsTryDeploy(options, ctx) {
89
+ return withErrorBoundary("Try-deploy", async () => {
90
+ const client = requireClient(ctx);
91
+ const startTime = Date.now();
92
+ const local = isLocalMode();
93
+ const { input, workflowsDir } = await resolveAndValidateInputForRun(options);
94
+ const storagePaths = [];
95
+ let runError;
96
+ try {
97
+ const builds = await buildWorkflowsForRun({
98
+ ...options,
99
+ workflowsDir
100
+ });
101
+ renderBuildSuccessMessage(builds);
102
+ validateInputWithFirstBuild(options, input, builds);
103
+ const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
104
+ await assertProjectConfigMatchesAuthenticatedOrg(client, projectConfig);
105
+ for (const [i, build] of builds.entries()) {
106
+ if (builds.length > 1) ui.header(`Running "${build.name}" (${i + 1}/${builds.length})...`);
107
+ let storagePath;
108
+ if (local) {
109
+ storagePath = build.bundlePath;
110
+ if (i === 0) ui.hint("Local mode: using bundle from build output (skipping upload)");
111
+ } else {
112
+ ui.header("Uploading test bundle...");
113
+ storagePath = (await uploadTestBundle(client, build, false)).storagePath;
114
+ storagePaths.push(storagePath);
115
+ ui.success("Upload complete");
116
+ }
117
+ ui.header("Executing workflow...");
118
+ const { runId } = await client.workflows.testById({
119
+ workflowName: build.name,
120
+ storagePath,
121
+ exportName: build.exportName,
122
+ manifest: build.manifestData,
123
+ flowJson: build.flowData,
124
+ triggers: build.triggers,
125
+ bundleHash: build.bundleHash,
126
+ bundleSize: build.bundleSize,
127
+ args: [input],
128
+ organizationId: projectConfig.organizationId,
129
+ projectId: projectConfig.projectId
130
+ });
131
+ ui.hint(`Run ID: ${runId}`);
132
+ const snapshot = await pollForCompletion(client, runId, options.timeout, options.verbose);
133
+ const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
134
+ if (snapshot.run.status === "completed") {
135
+ if (snapshot.run.output !== void 0 && snapshot.run.output !== null) {
136
+ ui.br();
137
+ ui.header("Output:");
138
+ ui.text(JSON.stringify(snapshot.run.output, null, 2));
139
+ }
140
+ continue;
141
+ }
142
+ if (snapshot.run.status === "failed") {
143
+ ui.br();
144
+ ui.error(`Workflow failed after ${elapsed}s`);
145
+ if (snapshot.run.error) ui.error(toErrorMessage(snapshot.run.error));
146
+ runError = snapshot.run.error ?? /* @__PURE__ */ new Error("Workflow failed");
147
+ break;
148
+ }
149
+ ui.br();
150
+ ui.warn(`Workflow still ${snapshot.run.status} after ${elapsed}s (timeout: ${options.timeout}s)`);
151
+ ui.hint(`Check status: keystroke runs get ${runId}`);
152
+ runError = /* @__PURE__ */ new Error(`Workflow still ${snapshot.run.status} after timeout`);
153
+ break;
154
+ }
155
+ if (!runError) {
156
+ ui.br();
157
+ renderRunCompletionSuccessMessage(builds, ((Date.now() - startTime) / 1e3).toFixed(1));
158
+ }
159
+ } finally {
160
+ if (!local) for (const sp of storagePaths) try {
161
+ await client.workflows.deleteTestBundle({ storagePath: sp });
162
+ if (options.verbose) ui.hint("Test bundle cleaned up");
163
+ } catch {}
164
+ }
165
+ if (runError) throw new CliExitError("Workflow execution failed");
166
+ }, { json: ctx.jsonMode });
167
+ }
168
+ //#endregion
169
+ export { try_deploy_handler_exports as n, handleWorkflowsTryDeploy as t };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { t as createTypedCommand } from "./commander-Wr7RrODw.mjs";
3
+ import { t as createTypedCommand } from "./commander-B6_tg5_w.mjs";
4
4
  import { z } from "zod";
5
5
  //#region src/commands/upgrade/upgrade.command.ts
6
6
  const PackageManagerSchema = z.enum([
@@ -34,7 +34,7 @@ function createUpgradeCommand() {
34
34
  description: "Upgrade the Keystroke CLI to the latest published version",
35
35
  schema: UpgradeOptionsSchema,
36
36
  optionsConfig: UPGRADE_OPTIONS_CONFIG,
37
- loadHandler: async () => (await import("./upgrade.handler-D82k9CHa.mjs")).handleUpgrade
37
+ loadHandler: async () => (await import("./upgrade.handler-B0NxKINA.mjs")).handleUpgrade
38
38
  });
39
39
  }
40
40
  //#endregion
@@ -4,7 +4,7 @@ import { M as throwReportedCliExit, b as toErrorMessage, t as ui } from "./keyst
4
4
  import { d as trackProject } from "./dist-BF6r1hfv.mjs";
5
5
  import { i as writeJson } from "./output-BCDZb3Gy.mjs";
6
6
  import { t as requireWorkflowsDir } from "./resolve-project-BREjwFKO.mjs";
7
- import { s as build, t as WorkflowNotFoundError } from "./workflow-build-KCdasPyU.mjs";
7
+ import { s as build, t as WorkflowNotFoundError } from "./workflow-build-Be6RMTb2.mjs";
8
8
  import { t as createBuildProgress } from "./build-progress-Mzsk4RKr.mjs";
9
9
  import { mkdtemp, rm } from "node:fs/promises";
10
10
  import * as os from "node:os";
@@ -978,7 +978,7 @@ async function buildDiscoveredWorkflows(options) {
978
978
  const failures = [...buildPlan.failures];
979
979
  const warnings = [];
980
980
  if (buildPlan.workflows.length > 0) {
981
- const { buildWorkflowArtifacts } = await import("./build-workflows-3fdvdHHf-DnDmsKuG.mjs");
981
+ const { buildWorkflowArtifacts } = await import("./build-workflows-3fdvdHHf-BDTy9QgT.mjs");
982
982
  const result = await buildWorkflowArtifacts({
983
983
  entries: buildPlan.workflows,
984
984
  workflowsByKey,
@@ -993,7 +993,7 @@ async function buildDiscoveredWorkflows(options) {
993
993
  warnings.push(...result.warnings);
994
994
  }
995
995
  if (buildPlan.agents.length > 0) {
996
- const { buildAgentArtifacts } = await import("./build-agents-DfbiMZ_e-CLHxZKOg.mjs");
996
+ const { buildAgentArtifacts } = await import("./build-agents-DfbiMZ_e-CgnKa9A6.mjs");
997
997
  const result = await buildAgentArtifacts({
998
998
  entries: buildPlan.agents,
999
999
  projectRoot: options.projectRoot
@@ -1002,7 +1002,7 @@ async function buildDiscoveredWorkflows(options) {
1002
1002
  failures.push(...result.failures);
1003
1003
  }
1004
1004
  if (buildPlan.tasks.length > 0) {
1005
- const { buildTaskArtifacts } = await import("./build-tasks-O1jYtlv1-Cr7vs_B_.mjs");
1005
+ const { buildTaskArtifacts } = await import("./build-tasks-O1jYtlv1-Bkw0w1r3.mjs");
1006
1006
  const result = await buildTaskArtifacts({
1007
1007
  entries: buildPlan.tasks,
1008
1008
  projectRoot: options.projectRoot,
@@ -1110,7 +1110,7 @@ async function createBuildPlan(options) {
1110
1110
  const currentWorkflowIndex = workflowProgressIndex;
1111
1111
  workflowProgressIndex += 1;
1112
1112
  if (!loadResult?.ok) {
1113
- const { createWorkflowMetadataFailure } = await import("./build-workflows-3fdvdHHf-DnDmsKuG.mjs");
1113
+ const { createWorkflowMetadataFailure } = await import("./build-workflows-3fdvdHHf-BDTy9QgT.mjs");
1114
1114
  plan.failures.push(createWorkflowMetadataFailure(discoveredWorkflow, loadResult?.error));
1115
1115
  continue;
1116
1116
  }
@@ -1333,7 +1333,7 @@ async function runBuild(config, initialTargetBindingKeys, metadataRebuildDecisio
1333
1333
  elapsedMs: performance.now() - writeStartedAt,
1334
1334
  ...writeResult.skippedWriteCount !== void 0 && writeResult.skippedWriteCount > 0 ? { skippedWriteCount: writeResult.skippedWriteCount } : {}
1335
1335
  });
1336
- const { buildMetadataArtifacts } = await import("./build-metadata-zidV9Cai-BNC_-zub.mjs");
1336
+ const { buildMetadataArtifacts } = await import("./build-metadata-zidV9Cai-Bq37kBOM.mjs");
1337
1337
  const metadata = await buildMetadataArtifacts({
1338
1338
  projectRoot: config.projectRoot,
1339
1339
  outputDir,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { n as identifierName, o as parseSourceFile, r as isNode } from "./oxc-B3KI3rf_-ghZc3xZ5.mjs";
4
- import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-KtEle6I3.mjs";
4
+ import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-D4o8gRZs.mjs";
5
5
  import { existsSync, readFileSync, realpathSync } from "node:fs";
6
6
  import * as path$1 from "node:path";
7
7
  import { createHash } from "node:crypto";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BCDZb3Gy.mjs";
4
- import { t as createTypedCommand } from "./commander-Wr7RrODw.mjs";
4
+ import { t as createTypedCommand } from "./commander-B6_tg5_w.mjs";
5
5
  import { r as SHA256HashSchema, t as JsonSchemaSchema } from "./common-B3bLe3Mk.mjs";
6
6
  import { l as TriggerUploadDataSchema } from "./credential-requirements-BCW8aQWS.mjs";
7
7
  import { a as FlowGraphSchema, i as WorkflowManifestSchema } from "./workflow-manifest-BfL74mjp.mjs";
@@ -321,7 +321,7 @@ function createWorkflowsBuildCommand() {
321
321
  description: "Build workflows locally",
322
322
  schema: WorkflowsBuildOptionsSchema,
323
323
  optionsConfig: BUILD_OPTIONS_CONFIG,
324
- loadHandler: async () => (await import("./build.handler-CXqfqwho.mjs")).handleWorkflowsBuild
324
+ loadHandler: async () => (await import("./build.handler-D15NjKkT.mjs")).handleWorkflowsBuild
325
325
  });
326
326
  }
327
327
  //#endregion
@@ -348,7 +348,7 @@ function createWorkflowsDiffCommand() {
348
348
  description: "Authored workflow id (preferred) or workflow name",
349
349
  key: "workflow"
350
350
  },
351
- loadHandler: async () => (await import("./diff.handler-zVbHzE1Q.mjs")).handleWorkflowsDiff
351
+ loadHandler: async () => (await import("./diff.handler-Dtjc7Y4O.mjs")).handleWorkflowsDiff
352
352
  });
353
353
  }
354
354
  //#endregion
@@ -381,7 +381,7 @@ function createWorkflowsEnvCommand() {
381
381
  key: "workflow",
382
382
  required: false
383
383
  },
384
- loadHandler: async () => (await import("./env.handler-CqfOZEou.mjs")).handleWorkflowsEnv
384
+ loadHandler: async () => (await import("./env.handler-DbxnyBYf.mjs")).handleWorkflowsEnv
385
385
  });
386
386
  }
387
387
  //#endregion
@@ -413,7 +413,7 @@ function createWorkflowsInspectCommand() {
413
413
  description: "Authored workflow id (preferred) or workflow name",
414
414
  key: "workflow"
415
415
  },
416
- loadHandler: async () => (await import("./inspect.handler-CcyFNUJP.mjs")).handleWorkflowsInspect
416
+ loadHandler: async () => (await import("./inspect.handler-Buv68Vm9.mjs")).handleWorkflowsInspect
417
417
  });
418
418
  }
419
419
  //#endregion
@@ -509,7 +509,7 @@ function createWorkflowsLogsCommand() {
509
509
  key: "workflow",
510
510
  required: false
511
511
  },
512
- loadHandler: async () => (await import("./logs.handler-BNFUmakA.mjs")).handleWorkflowsLogs
512
+ loadHandler: async () => (await import("./logs.handler-COtiXeqn.mjs")).handleWorkflowsLogs
513
513
  });
514
514
  }
515
515
  //#endregion
@@ -700,7 +700,101 @@ function createWorkflowsPausedCommand() {
700
700
  key: "workflow",
701
701
  required: false
702
702
  },
703
- loadHandler: async () => (await import("./paused.handler-wgaf8sse.mjs")).handleWorkflowsPaused
703
+ loadHandler: async () => (await import("./paused.handler-BX_71fzx.mjs")).handleWorkflowsPaused
704
+ });
705
+ }
706
+ //#endregion
707
+ //#region src/commands/workflows/run.command.ts
708
+ const WorkflowsRunCommandOptionsSchema = JsonOptionSchema.extend({
709
+ workflow: z.string().min(1),
710
+ payload: z.string().optional(),
711
+ projectId: z.uuid().optional(),
712
+ input: z.string().optional(),
713
+ inputFile: z.string().optional(),
714
+ workflowGlobals: z.string().optional(),
715
+ workflowGlobalsFile: z.string().optional(),
716
+ path: z.string().optional(),
717
+ wait: z.boolean().default(false),
718
+ follow: z.boolean().default(false),
719
+ timeout: z.coerce.number().int().min(1).default(120),
720
+ verbose: z.boolean().default(false)
721
+ }).superRefine((value, ctx) => {
722
+ const inputSources = [
723
+ value.payload ? "positional payload" : null,
724
+ value.input ? "--input" : null,
725
+ value.inputFile ? "--input-file" : null
726
+ ].filter((source) => source !== null);
727
+ if (inputSources.length > 1) ctx.addIssue({
728
+ code: z.ZodIssueCode.custom,
729
+ path: ["input"],
730
+ message: `Use only one workflow input source: ${inputSources.join(", ")}.`
731
+ });
732
+ if (value.workflowGlobals && value.workflowGlobalsFile) ctx.addIssue({
733
+ code: z.ZodIssueCode.custom,
734
+ path: ["workflowGlobals"],
735
+ message: "Use either --workflow-globals or --workflow-globals-file, not both."
736
+ });
737
+ });
738
+ const WORKFLOWS_RUN_OPTIONS_CONFIG = {
739
+ ...JSON_OPTION_CONFIG,
740
+ projectId: {
741
+ flag: "--project-id <uuid>",
742
+ description: "Project override. If omitted, read keystroke.config.ts from --path/CWD"
743
+ },
744
+ input: {
745
+ flag: "--input <json>",
746
+ description: "Workflow input as inline JSON object"
747
+ },
748
+ inputFile: {
749
+ flag: "--input-file <path>",
750
+ description: "Path to a JSON file containing workflow input"
751
+ },
752
+ workflowGlobals: {
753
+ flag: "--workflow-globals <json>",
754
+ description: "Workflow globals as inline JSON object"
755
+ },
756
+ workflowGlobalsFile: {
757
+ flag: "--workflow-globals-file <path>",
758
+ description: "Path to a JSON file containing workflow globals"
759
+ },
760
+ path: {
761
+ flag: "--path <dir>",
762
+ description: "Path to project root (directory containing keystroke.config.ts); auto-discovered from CWD if omitted"
763
+ },
764
+ wait: {
765
+ flag: "--wait",
766
+ description: "Poll until the run reaches a terminal status"
767
+ },
768
+ follow: {
769
+ flag: "--follow",
770
+ description: "Poll logs/events while waiting; implies --wait"
771
+ },
772
+ timeout: {
773
+ flag: "--timeout <seconds>",
774
+ description: "Max seconds to wait for workflow completion (default: 120)"
775
+ },
776
+ verbose: {
777
+ flag: "--verbose",
778
+ description: "Show detailed runtime events and logs while waiting"
779
+ }
780
+ };
781
+ function createWorkflowsRunCommand() {
782
+ return createTypedCommand({
783
+ name: "run",
784
+ description: "Run a workflow from the current deployment",
785
+ schema: WorkflowsRunCommandOptionsSchema,
786
+ optionsConfig: WORKFLOWS_RUN_OPTIONS_CONFIG,
787
+ arguments: [{
788
+ name: "workflow",
789
+ description: "Authored workflow id",
790
+ key: "workflow"
791
+ }, {
792
+ name: "payload",
793
+ description: "Workflow input as inline JSON object",
794
+ key: "payload",
795
+ required: false
796
+ }],
797
+ loadHandler: async () => (await import("./run.handler-B5NodlNi.mjs")).handleWorkflowsRun
704
798
  });
705
799
  }
706
800
  //#endregion
@@ -716,7 +810,7 @@ function createWorkflowsTryDeployCommand() {
716
810
  description: "Authored workflow id (preferred) or workflow name. Multiple workflows with the same name run sequentially.",
717
811
  key: "workflow"
718
812
  },
719
- loadHandler: async () => (await import("./try-deploy.handler-BCvwi1jc.mjs").then((n) => n.n)).handleWorkflowsTryDeploy
813
+ loadHandler: async () => (await import("./try-deploy.handler-Lq69ON02.mjs").then((n) => n.n)).handleWorkflowsTryDeploy
720
814
  });
721
815
  }
722
816
  //#endregion
@@ -754,7 +848,7 @@ function createWorkflowsValidateCommand() {
754
848
  key: "workflow",
755
849
  required: false
756
850
  },
757
- loadHandler: async () => (await import("./validate.handler-BiToUknO.mjs")).handleWorkflowsValidate
851
+ loadHandler: async () => (await import("./validate.handler-BUga7Umz.mjs")).handleWorkflowsValidate
758
852
  });
759
853
  }
760
854
  //#endregion
@@ -773,16 +867,17 @@ function createWorkflowsCommand() {
773
867
  description: "Manage, run, inspect, and debug workflows",
774
868
  schema: WorkflowsOptionsSchema,
775
869
  optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
776
- loadHandler: async () => (await import("./list.handler-Val6EmGK.mjs")).handleWorkflowsList,
870
+ loadHandler: async () => (await import("./list.handler-Bi28Gsee.mjs")).handleWorkflowsList,
777
871
  subcommands: [
778
872
  createTypedCommand({
779
873
  name: "list",
780
874
  description: "List all workflows in the project",
781
875
  schema: WorkflowsOptionsSchema,
782
876
  optionsConfig: WORKFLOWS_OPTIONS_CONFIG,
783
- loadHandler: async () => (await import("./list.handler-Val6EmGK.mjs")).handleWorkflowsList
877
+ loadHandler: async () => (await import("./list.handler-Bi28Gsee.mjs")).handleWorkflowsList
784
878
  }),
785
879
  createWorkflowsBuildCommand(),
880
+ createWorkflowsRunCommand(),
786
881
  createWorkflowsTryDeployCommand(),
787
882
  createWorkflowsInspectCommand(),
788
883
  createWorkflowsValidateCommand(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystrokehq/cli",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "description": "Command-line interface for creating, managing, and deploying Keystroke automations.",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "rolldown": "1.0.0-rc.17",
34
34
  "tsx": "^4.21.0",
35
35
  "zod": "^4.3.6",
36
- "@keystrokehq/skills": "0.0.1"
36
+ "@keystrokehq/skills": "0.0.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "tsdown": "0.21.10",
@@ -43,13 +43,13 @@
43
43
  "@keystroke/local-memory": "0.0.0",
44
44
  "@keystroke/project-config": "0.0.1",
45
45
  "@keystroke/shared-types": "0.0.1",
46
- "@keystroke/test-utils": "0.0.0",
47
46
  "@keystroke/typescript-config": "0.0.0",
48
47
  "@keystroke/utils": "0.0.0",
49
48
  "@keystroke/workflow-builder": "0.0.2",
50
49
  "@keystrokehq/core": "0.0.4",
51
50
  "@keystroke/workflow-deploy": "0.0.1",
52
- "@keystroke/workflow-sdk": "0.0.0"
51
+ "@keystroke/workflow-sdk": "0.0.0",
52
+ "@keystroke/test-utils": "0.0.0"
53
53
  },
54
54
  "keywords": [
55
55
  "automation",