@keystrokehq/cli 0.0.7 → 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.
- package/dist/{accept.handler-CudtwdDV.mjs → accept.handler-PpOOUemk.mjs} +3 -3
- package/dist/{admin-ByNq50FH.mjs → admin-Dga-_lDF.mjs} +10 -10
- package/dist/{agents-DbekD_Vx.mjs → agents-DII_JbCa.mjs} +8 -8
- package/dist/{api-keys-kvwq9Jb4.mjs → api-keys-DeTqHzI4.mjs} +6 -6
- package/dist/{auth-D2vYD0E8.mjs → auth-C0fuZ0_P.mjs} +6 -6
- package/dist/{auth.handler-BFnFI2fQ.mjs → auth.handler-BLU7LnW2.mjs} +2 -3
- package/dist/{build-agents-DfbiMZ_e-in-if4_C.mjs → build-agents-DfbiMZ_e-CgnKa9A6.mjs} +5 -5
- package/dist/{build-metadata-zidV9Cai-BAS0FMxT.mjs → build-metadata-zidV9Cai-Bq37kBOM.mjs} +7 -7
- package/dist/{build-progress-Cn2j1LqF.mjs → build-progress-Mzsk4RKr.mjs} +2 -2
- package/dist/{build-tasks-O1jYtlv1-B2Dm4hFj.mjs → build-tasks-O1jYtlv1-Bkw0w1r3.mjs} +3 -3
- package/dist/{build-workflows-3fdvdHHf-Bg5XV7hM.mjs → build-workflows-3fdvdHHf-BDTy9QgT.mjs} +8 -8
- package/dist/{build.handler-BzQRnkC3.mjs → build.handler-D15NjKkT.mjs} +5 -5
- package/dist/{clear.handler-U9n_V1IM.mjs → clear.handler-DgIXlYTs.mjs} +2 -2
- package/dist/{commander-pxSPDCZ4.mjs → commander-B6_tg5_w.mjs} +12 -12
- package/dist/{connect-B_uc0wqI.mjs → connect-D9PVABIW.mjs} +3 -3
- package/dist/{connect.handler-VJgm2ZQG.mjs → connect.handler-BmOVKYSN.mjs} +5 -5
- package/dist/{context-D-YKFNxL.mjs → context-DT06adrn.mjs} +3 -4
- package/dist/{create.handler-d9nfcKfp.mjs → create.handler-BWaULspg.mjs} +3 -3
- package/dist/{credential-requirements-DjDFthio.mjs → credential-requirements-BCW8aQWS.mjs} +3 -3
- package/dist/{credential-schema-mismatch-B-wwbCvw.mjs → credential-schema-mismatch-C-4kBAFw.mjs} +1 -1
- package/dist/{credentials-CL_PCuhM.mjs → credentials-BW-v9xVQ.mjs} +7 -7
- package/dist/{credentials-DHlK_O4L.mjs → credentials-DAQfKqn0.mjs} +7 -7
- package/dist/{current-deployment-workflow-BRYuEubW.mjs → current-deployment-workflow-j5DlVkb2.mjs} +6 -6
- package/dist/{current.handler-vJG2Dohx.mjs → current.handler-CUVgMZ-O.mjs} +1 -1
- package/dist/{declared-credential-requirements-Bwlb-KZE.mjs → declared-credential-requirements-BtlcsEVn.mjs} +1 -1
- package/dist/{delete.handler-RsYTkJLV.mjs → delete.handler-CzW7Rm5M.mjs} +2 -2
- package/dist/{deploy-B_bkUlIL.mjs → deploy-B8TYutOi.mjs} +1 -1
- package/dist/{deploy-BE3F62Mz.mjs → deploy-BU04ehfM.mjs} +2 -2
- package/dist/{deploy-progress-CZ2rPlOj.mjs → deploy-progress-BkpuGfGt.mjs} +1 -1
- package/dist/{deploy.handler-Dlyd8Zqs.mjs → deploy.handler-CbYYyVOg.mjs} +17 -18
- package/dist/{detect-env-access-CwkOYeYM-CsrSOCcj.mjs → detect-env-access-CwkOYeYM-D4o8gRZs.mjs} +1 -1
- package/dist/{diff-utils-DWNcRA8g.mjs → diff-utils-D1jYu6ny.mjs} +1 -1
- package/dist/{diff.handler-CH0xP8pk.mjs → diff.handler-Dtjc7Y4O.mjs} +5 -5
- package/dist/{dist-C2Dq_nx3.mjs → dist-DvO0q6Fo.mjs} +12 -12
- package/dist/{env.handler-BkCO2vjR.mjs → env.handler-DbxnyBYf.mjs} +8 -8
- package/dist/{error-boundary-B9PgBkv8.mjs → error-boundary-D6KTx1HL.mjs} +3 -3
- package/dist/{file-metadata-CdFXMMIw.mjs → file-metadata-BvGM-B2v.mjs} +1 -1
- package/dist/{iam-command-utils-CNC8JfZ5.mjs → iam-command-utils-B5G-N3Hx.mjs} +2 -2
- package/dist/{import-module-DDPnzlJ1-CYJD2n2b.mjs → import-module-DDPnzlJ1-BIBSgOhK.mjs} +8 -8
- package/dist/{init-BXwx0QA4.mjs → init-BITuemMR.mjs} +2 -2
- package/dist/{init.handler-Cs5YXM5Z.mjs → init.handler-HsCte00n.mjs} +5 -5
- package/dist/{inspect.handler-DRMKUJsh.mjs → inspect.handler-Buv68Vm9.mjs} +5 -5
- package/dist/{integration-catalog-ClP7YGqM.mjs → integration-catalog-4T5Yad-n.mjs} +3 -3
- package/dist/{integrations-CoBzLNEe.mjs → integrations-Dib-OfdN.mjs} +5 -5
- package/dist/{invites-BmNy1RHp.mjs → invites-CJtInw9Q.mjs} +5 -5
- package/dist/{invites.list.handler-ICP2V3p4.mjs → invites.list.handler-CBtOq8W4.mjs} +3 -3
- package/dist/{invites.resend.handler-BGaTTMka.mjs → invites.resend.handler-D-E2NxY1.mjs} +3 -3
- package/dist/{invites.revoke.handler-DBwF5Lxc.mjs → invites.revoke.handler-DFTxBZcm.mjs} +3 -3
- package/dist/keystroke.mjs +276 -28
- package/dist/{list-enrichment-CTqx0Rk_.mjs → list-enrichment-Bou_BqL0.mjs} +2 -2
- package/dist/{list.handler-Vv9KmhB9.mjs → list.handler-BFjtABDv.mjs} +4 -4
- package/dist/{list.handler-B2bN8NsQ.mjs → list.handler-BHmG2GY8.mjs} +1 -1
- package/dist/{list.handler-DO0PnyWP.mjs → list.handler-BWGnEnM8.mjs} +3 -3
- package/dist/{list.handler-BXTGPazY.mjs → list.handler-Bi28Gsee.mjs} +5 -5
- package/dist/{list.handler-b4qYQtwn.mjs → list.handler-CXT-te4G.mjs} +3 -3
- package/dist/{list.handler-BjihvxHn.mjs → list.handler-fGaEAMUZ.mjs} +7 -8
- package/dist/{list.handler-rnyzLJDy.mjs → list.handler-gjAg1aM6.mjs} +3 -3
- package/dist/{listen-DVV1fp5c.mjs → listen-_GvXm7iI.mjs} +3 -3
- package/dist/{listen.handler-CyFpUSOu.mjs → listen.handler-BKfcYsfv.mjs} +4 -4
- package/dist/{logs-BRticZ00.mjs → logs-De7ITMv1.mjs} +3 -3
- package/dist/{logs.handler-ddQu_MXN.mjs → logs.handler-CB2FtCvP.mjs} +1 -1
- package/dist/{logs.handler-CsnG7Bb0.mjs → logs.handler-COtiXeqn.mjs} +4 -4
- package/dist/{members.add.handler-CH0RhbgE.mjs → members.add.handler-BXldE_ec.mjs} +3 -3
- package/dist/{members.invite.handler-CYB7RQ9A.mjs → members.invite.handler-CWFsj5Gz.mjs} +3 -3
- package/dist/{members.list.handler-DrDtmMei.mjs → members.list.handler-DFg6VThp.mjs} +3 -3
- package/dist/{members.remove.handler-uGoZt2Me.mjs → members.remove.handler-lStbH_4M.mjs} +3 -3
- package/dist/{members.update.handler-DXCWkzOc.mjs → members.update.handler-CzcdsbtG.mjs} +3 -3
- package/dist/{normalize-path-CojS-CgQ-BKRFUzWW.mjs → normalize-path-CojS-CgQ-D_WTiHKw.mjs} +1 -1
- package/dist/{org-GdHhuSNk.mjs → org-DLY5V_Uw.mjs} +16 -16
- package/dist/{orgs.create.handler-5AaPgTZV.mjs → orgs.create.handler-CiYGUXBZ.mjs} +3 -3
- package/dist/{orgs.get.handler-BTfopRVm.mjs → orgs.get.handler-BgFsnpme.mjs} +3 -3
- package/dist/{orgs.list.handler-DKJgs6x0.mjs → orgs.list.handler-BuyOTc8K.mjs} +3 -3
- package/dist/{output-q4KljAhu.mjs → output-BCDZb3Gy.mjs} +1 -1
- package/dist/{paused.handler-BUifVTyQ.mjs → paused.handler-BX_71fzx.mjs} +3 -3
- package/dist/{projects-Bdl6-Z8l.mjs → projects-DN7dX6nN.mjs} +2 -2
- package/dist/{projects-BjnCG-pc.mjs → projects-lN-4ZR9Q.mjs} +5 -5
- package/dist/{register.handler-WzpvVXHx.mjs → register.handler-BA6p-TmU.mjs} +2 -2
- package/dist/{requirements.handler-coArDE8x.mjs → requirements.handler-DI4mgZ2l.mjs} +7 -8
- package/dist/{resolve-project-DgfftdPm.mjs → resolve-project-BREjwFKO.mjs} +2 -2
- package/dist/{try-deploy.handler-YDOirkk1.mjs → run-polling-BLT-uS2e.mjs} +87 -187
- package/dist/run.handler-B5NodlNi.mjs +136 -0
- package/dist/{runs-2BdRfql3.mjs → runs-BfgL8BR_.mjs} +4 -4
- package/dist/{schemas-DsvCZfF0.mjs → schemas-9FmGqrPT.mjs} +2 -2
- package/dist/{skills-sync.handler-CwwnzDiO.mjs → skills-sync.handler-CuuCiUGT.mjs} +3 -3
- package/dist/{skills.command-C2NXqc5h.mjs → skills.command-z-sOQpkN.mjs} +4 -4
- package/dist/{source-analysis-DEEChuND-eixwPnPP.mjs → source-analysis-DEEChuND-Csu0oOlw.mjs} +3 -3
- package/dist/{spinner-progress-bvKd1jXc.mjs → spinner-progress-BB2EHL-l.mjs} +1 -1
- package/dist/{src-CBL7AJ0H.mjs → src--fCtOxNX.mjs} +1 -1
- package/dist/{status.handler-D9GBEmao.mjs → status.handler-Bh0MtNu1.mjs} +1 -1
- package/dist/{switch.handler-DV0wiJP8.mjs → switch.handler-CSOycIbR.mjs} +2 -2
- package/dist/{sync-D098Vbv2.mjs → sync-CIibxcUe.mjs} +2 -2
- package/dist/{sync.handler-BocldSG_.mjs → sync.handler-D2cY3bia.mjs} +7 -8
- package/dist/{task-DsrXI6XH.mjs → task-1qz1XNq7.mjs} +4 -4
- package/dist/{task-target-build-Di8gflnj.mjs → task-target-build-D5IrHqSl.mjs} +4 -4
- package/dist/{task-target-deploy-Bf5i3ox1-BU16VPsE.mjs → task-target-deploy-Bf5i3ox1-2K0hAwzk.mjs} +1 -1
- package/dist/{task-target-deploy-BzGRNDiv.mjs → task-target-deploy-Bzfftyru.mjs} +1 -1
- package/dist/task-target-deploy-runner.mjs +5 -5
- package/dist/{test-BZt0Duhs.mjs → test-Dsx4cRnE.mjs} +14 -14
- package/dist/{test.handler-iCUotLes.mjs → test.handler-Duqj67Qi.mjs} +1 -1
- package/dist/{trigger-artifacts-B3OCTX9K-Cgt51KLh.mjs → trigger-artifacts-B3OCTX9K-ME6IVdUB.mjs} +4 -4
- package/dist/{trigger-manifest-CXD9I7Rb.mjs → trigger-manifest-B3Gq1739.mjs} +1 -1
- package/dist/try-deploy.handler-Lq69ON02.mjs +169 -0
- package/dist/{upgrade-Bdez-X6_.mjs → upgrade-DQrHCNR8.mjs} +2 -2
- package/dist/{upgrade.handler-DhH_Cuza.mjs → upgrade.handler-B0NxKINA.mjs} +1 -1
- package/dist/{upload.handler-BmqZAPxZ.mjs → upload.handler-BMJiaCzk.mjs} +10 -11
- package/dist/{users.get.handler-uoEgEwI-.mjs → users.get.handler-eJtaB-2G.mjs} +3 -3
- package/dist/{users.list.handler-DLWPOIHD.mjs → users.list.handler-DE6s08i0.mjs} +3 -3
- package/dist/{users.set-role.handler-BCJhTsyb.mjs → users.set-role.handler-BVNvaKKS.mjs} +3 -3
- package/dist/{utils-DlYHjGg9.mjs → utils-C_qCshBA.mjs} +2 -2
- package/dist/{validate.handler-ROzzUI85.mjs → validate.handler-BUga7Umz.mjs} +5 -5
- package/dist/{workflow-build-DD8TLlPu.mjs → workflow-build-Be6RMTb2.mjs} +21 -21
- package/dist/{workflow-bundler-BzHk73PM-Bt-poFqX.mjs → workflow-bundler-BzHk73PM-tt09RbIA.mjs} +2 -2
- package/dist/{workflow-manifest-CAW5FlX0.mjs → workflow-manifest-BfL74mjp.mjs} +4 -4
- package/dist/{workflows-DypSJM0t.mjs → workflows-Cdo-AgjV.mjs} +111 -16
- package/dist/{writer-CtvttJdP-DrJruQgR.mjs → writer-CtvttJdP-DZJ0mZCm.mjs} +5 -5
- package/package.json +5 -5
- package/dist/env-YTZGKGIu.mjs +0 -139
- package/dist/{agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs → agent-bundle-package-DWV6B_5q-B-qzc3zC.mjs} +0 -0
- package/dist/{agent-manifest-Bfa3DBgc.mjs → agent-manifest-sJFbH5H8.mjs} +0 -0
- package/dist/{browser-gddMccBQ.mjs → browser-CvuyMLhI.mjs} +0 -0
- package/dist/{clear-cache.handler-BDV-a3ku.mjs → clear-cache.handler-BuSx_ZDn.mjs} +0 -0
- package/dist/{clear.handler-Dh6QoVO1.mjs → clear.handler-BC6pz0x-.mjs} +0 -0
- package/dist/{common-BrVAdUyD.mjs → common-B3bLe3Mk.mjs} +0 -0
- package/dist/{concurrency-gXn9Rw8x-BTlfau8D.mjs → concurrency-gXn9Rw8x-CnBnF2cg.mjs} +0 -0
- package/dist/{constants-DHdiT5hc.mjs → constants-BUgIAu2a.mjs} +0 -0
- package/dist/{credential-env-map-C8P7uTD-.mjs → credential-env-map-C23GV6LN.mjs} +0 -0
- package/dist/{get-intrinsic-ZMBBjBEr.mjs → get-intrinsic-BjqiGgLt.mjs} +0 -0
- package/dist/{hosted-action-dispatcher-registry-TOVzMhUR.mjs → hosted-action-dispatcher-registry-BWEtn13o.mjs} +0 -0
- package/dist/{layout-B95Tku8F.mjs → layout-CXkZEsXI.mjs} +0 -0
- package/dist/{metadata-layout-C6ed-9dl-aBmqqvD5.mjs → metadata-layout-C6ed-9dl-C6Bylr_z.mjs} +0 -0
- package/dist/{options-BhB9qA5P.mjs → options-CIVqkc8V.mjs} +0 -0
- package/dist/{oxc-B3KI3rf_-BeimiQ2U.mjs → oxc-B3KI3rf_-ghZc3xZ5.mjs} +0 -0
- package/dist/{project-config-opj6DsPF.mjs → project-config-D9eFU8Jk.mjs} +1 -1
- /package/dist/{read-credential-keys-77a91T8M-aLuQvlIq.mjs → read-credential-keys-77a91T8M-B0eiobOd.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-8uqgIurC.mjs → rolldown-runtime-twds-ZHy-RuJszab7.mjs} +0 -0
- /package/dist/{run-polling-CF9OeLWl.mjs → run-polling-DDpkIvwy.mjs} +0 -0
- /package/dist/{schedule-BRN4hzQM.mjs → schedule-BWAI6qLx.mjs} +0 -0
- /package/dist/{schema-kbMHVnhm.mjs → schema-B-Wgo4rJ.mjs} +0 -0
- /package/dist/{schema-Di90TXoX.mjs → schema-BgGlAs8a.mjs} +0 -0
- /package/dist/{schema-display-D4A1gQEM.mjs → schema-display-DuWBmkwk.mjs} +0 -0
- /package/dist/{skills.handler-BTUhxO37.mjs → skills.handler-BQ3Qfej3.mjs} +0 -0
- /package/dist/{source-analysis-BspLa3E5.mjs → source-analysis-CHkWMC40.mjs} +0 -0
- /package/dist/{sync-keystroke-agent-skills-CBMQ4fh_.mjs → sync-keystroke-agent-skills-D746f2W_.mjs} +0 -0
- /package/dist/{upload-B8fiWveA.mjs → upload-C1qFWMm0.mjs} +0 -0
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { r as isLocalMode } from "./env-YTZGKGIu.mjs";
|
|
8
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-D-YKFNxL.mjs";
|
|
9
|
-
import { a as readManifestsFromOutDir, o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-C2Dq_nx3.mjs";
|
|
10
|
-
import { t as requireWorkflowsDir } from "./resolve-project-DgfftdPm.mjs";
|
|
11
|
-
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-DD8TLlPu.mjs";
|
|
12
|
-
import { a as validateRequiredFields, n as formatValidationError, r as isUnknownSchema, t as formatMissingInputError } from "./schema-display-D4A1gQEM.mjs";
|
|
13
|
-
import { t as createBuildProgress } from "./build-progress-Cn2j1LqF.mjs";
|
|
14
|
-
import { t as withErrorBoundary } from "./error-boundary-B9PgBkv8.mjs";
|
|
15
|
-
import { n as sleep, t as TERMINAL_STATUSES } from "./run-polling-CF9OeLWl.mjs";
|
|
3
|
+
import { b as toErrorMessage, k as InputValidationError, t as ui } from "./keystroke.mjs";
|
|
4
|
+
import { a as readManifestsFromOutDir } from "./dist-DvO0q6Fo.mjs";
|
|
5
|
+
import { a as validateRequiredFields, n as formatValidationError, t as formatMissingInputError } from "./schema-display-DuWBmkwk.mjs";
|
|
6
|
+
import { n as sleep, t as TERMINAL_STATUSES } from "./run-polling-DDpkIvwy.mjs";
|
|
16
7
|
import * as fs from "node:fs/promises";
|
|
17
8
|
import * as path$1 from "node:path";
|
|
18
9
|
import { z } from "zod";
|
|
19
|
-
//#region src/lib/format.ts
|
|
20
|
-
function formatBytes(bytes) {
|
|
21
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
22
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
23
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
10
|
//#region ../../packages/utils/src/json-schema-validation.ts
|
|
27
11
|
const SCHEMA_CACHE_LIMIT = 256;
|
|
28
12
|
const schemaCache = /* @__PURE__ */ new Map();
|
|
@@ -118,6 +102,53 @@ async function resolveInput(options) {
|
|
|
118
102
|
}
|
|
119
103
|
return {};
|
|
120
104
|
}
|
|
105
|
+
async function resolveRunInput(options) {
|
|
106
|
+
const sources = [
|
|
107
|
+
options.payload ? "positional payload" : null,
|
|
108
|
+
options.input ? "--input" : null,
|
|
109
|
+
options.inputFile ? "--input-file" : null
|
|
110
|
+
].filter((source) => source !== null);
|
|
111
|
+
if (sources.length > 1) {
|
|
112
|
+
const msg = `Cannot specify multiple workflow input sources: ${sources.join(", ")}`;
|
|
113
|
+
ui.error(msg);
|
|
114
|
+
throw new InputValidationError(msg);
|
|
115
|
+
}
|
|
116
|
+
if (options.payload) return parseJsonObjectInput(options.payload, "positional payload");
|
|
117
|
+
return resolveInput({
|
|
118
|
+
...options,
|
|
119
|
+
workflow: "workflow",
|
|
120
|
+
verbose: false,
|
|
121
|
+
timeout: 120
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async function resolveWorkflowGlobals(options) {
|
|
125
|
+
if (options.workflowGlobals && options.workflowGlobalsFile) {
|
|
126
|
+
const msg = "Cannot specify both --workflow-globals and --workflow-globals-file";
|
|
127
|
+
ui.error(msg);
|
|
128
|
+
throw new InputValidationError(msg);
|
|
129
|
+
}
|
|
130
|
+
if (options.workflowGlobals) return {
|
|
131
|
+
provided: true,
|
|
132
|
+
value: parseJsonObjectInput(options.workflowGlobals, "--workflow-globals flag")
|
|
133
|
+
};
|
|
134
|
+
if (options.workflowGlobalsFile) {
|
|
135
|
+
const filePath = path$1.resolve(options.workflowGlobalsFile);
|
|
136
|
+
try {
|
|
137
|
+
return {
|
|
138
|
+
provided: true,
|
|
139
|
+
value: parseJsonObjectInput(await fs.readFile(filePath, "utf-8"), `workflow globals file ${filePath}`)
|
|
140
|
+
};
|
|
141
|
+
} catch (error) {
|
|
142
|
+
const msg = `Failed to read workflow globals file: ${toErrorMessage(error)}`;
|
|
143
|
+
ui.error(msg);
|
|
144
|
+
throw new InputValidationError(msg);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
provided: false,
|
|
149
|
+
value: void 0
|
|
150
|
+
};
|
|
151
|
+
}
|
|
121
152
|
function parseJsonObjectInput(raw, source) {
|
|
122
153
|
let parsed;
|
|
123
154
|
try {
|
|
@@ -139,29 +170,45 @@ function parseJsonObjectInput(raw, source) {
|
|
|
139
170
|
* 2. Full schema parse via shared JSON schema validator (best effort)
|
|
140
171
|
*/
|
|
141
172
|
function validateInputOrExit(workflowName, input, inputSchema) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
173
|
+
return validateJsonObjectOrExit(workflowName, "workflow input", input, inputSchema);
|
|
174
|
+
}
|
|
175
|
+
function validateWorkflowGlobalsOrExit(workflowName, workflowGlobals, workflowGlobalsSchema) {
|
|
176
|
+
return validateJsonObjectOrExit(workflowName, "workflow globals", workflowGlobals, workflowGlobalsSchema);
|
|
177
|
+
}
|
|
178
|
+
function validateJsonObjectOrExit(workflowName, label, payload, schema) {
|
|
148
179
|
const result = validateJsonSchemaPayload({
|
|
149
|
-
jsonSchema:
|
|
150
|
-
payload
|
|
180
|
+
jsonSchema: schema,
|
|
181
|
+
payload
|
|
151
182
|
});
|
|
152
|
-
if (result.kind === "valid")
|
|
183
|
+
if (result.kind === "valid") {
|
|
184
|
+
if (typeof result.validatedData === "object" && result.validatedData !== null) return result.validatedData;
|
|
185
|
+
return payload;
|
|
186
|
+
}
|
|
153
187
|
if (result.kind === "invalid_payload") {
|
|
154
|
-
const
|
|
188
|
+
const { valid, missingRequired } = validateRequiredFields(payload, schema);
|
|
189
|
+
const msg = valid ? formatValidationError(workflowName, result.issues, schema) : formatMissingInputError(workflowName, missingRequired, schema);
|
|
155
190
|
ui.error(msg);
|
|
156
191
|
throw new InputValidationError(msg);
|
|
157
192
|
}
|
|
158
193
|
if (result.kind === "unsupported_schema") {
|
|
159
|
-
|
|
160
|
-
|
|
194
|
+
const { valid, missingRequired } = validateRequiredFields(payload, schema);
|
|
195
|
+
if (!valid) {
|
|
196
|
+
const msg = formatMissingInputError(workflowName, missingRequired, schema);
|
|
197
|
+
ui.error(msg);
|
|
198
|
+
throw new InputValidationError(msg);
|
|
199
|
+
}
|
|
200
|
+
ui.warn(`Schema import failed for ${label} on workflow "${workflowName}" (${result.message}). Required fields were checked, but full validation was skipped.`);
|
|
201
|
+
return payload;
|
|
161
202
|
}
|
|
162
203
|
if (result.kind === "unknown_schema") {
|
|
163
|
-
|
|
164
|
-
|
|
204
|
+
const { valid, missingRequired } = validateRequiredFields(payload, schema);
|
|
205
|
+
if (!valid) {
|
|
206
|
+
const msg = formatMissingInputError(workflowName, missingRequired, schema);
|
|
207
|
+
ui.error(msg);
|
|
208
|
+
throw new InputValidationError(msg);
|
|
209
|
+
}
|
|
210
|
+
ui.warn(`Schema for ${label} on workflow "${workflowName}" is unknown. Required fields were checked, but full validation was skipped.`);
|
|
211
|
+
return payload;
|
|
165
212
|
}
|
|
166
213
|
throw new Error(`Unhandled validation result: ${JSON.stringify(result)}`);
|
|
167
214
|
}
|
|
@@ -176,71 +223,7 @@ async function tryReadExistingInputSchema(workflowsDir, workflowName) {
|
|
|
176
223
|
return null;
|
|
177
224
|
}
|
|
178
225
|
//#endregion
|
|
179
|
-
//#region src/commands/workflows/_shared/run-
|
|
180
|
-
/**
|
|
181
|
-
* Resolve input and validate against existing schema if available.
|
|
182
|
-
* Returns input and workflowsDir for downstream use.
|
|
183
|
-
*/
|
|
184
|
-
async function resolveAndValidateInputForRun(options) {
|
|
185
|
-
const input = await resolveInput(options);
|
|
186
|
-
const workflowsDir = await requireWorkflowsDir(options.path);
|
|
187
|
-
trackProject(workflowsDir);
|
|
188
|
-
const existingSchema = await tryReadExistingInputSchema(workflowsDir, options.workflow);
|
|
189
|
-
if (existingSchema && !isUnknownSchema(existingSchema)) validateInputOrExit(options.workflow, input, existingSchema);
|
|
190
|
-
return {
|
|
191
|
-
input,
|
|
192
|
-
workflowsDir
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Build workflow(s) for run using the standard build pipeline, then read
|
|
197
|
-
* prepared artifacts from disk filtered by workflow ref.
|
|
198
|
-
*/
|
|
199
|
-
async function buildWorkflowsForRun(options) {
|
|
200
|
-
const progress = createBuildProgress(options.workflow);
|
|
201
|
-
try {
|
|
202
|
-
const { result, outDir } = await runWorkflowBuild({
|
|
203
|
-
workflowsDir: options.workflowsDir,
|
|
204
|
-
workflowRef: options.workflow,
|
|
205
|
-
verbose: options.verbose,
|
|
206
|
-
onProgressEvent: progress.handleEvent
|
|
207
|
-
});
|
|
208
|
-
const filtered = (await readWorkflowsFromDisk(outDir)).filter((wf) => wf.manifestData.id === options.workflow || wf.name === options.workflow);
|
|
209
|
-
if (filtered.length === 0) {
|
|
210
|
-
const availableNames = result.artifacts.map((a) => a.manifest.name);
|
|
211
|
-
throw new WorkflowNotFoundError(options.workflow, availableNames);
|
|
212
|
-
}
|
|
213
|
-
return filtered;
|
|
214
|
-
} finally {
|
|
215
|
-
progress.stop();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Validate input against the first build's input schema if available.
|
|
220
|
-
*/
|
|
221
|
-
function validateInputWithFirstBuild(options, input, builds) {
|
|
222
|
-
const inputSchema = builds[0]?.manifestData.workflowSchemas.input;
|
|
223
|
-
if (inputSchema && typeof inputSchema === "object" && !isUnknownSchema(inputSchema)) validateInputOrExit(options.workflow, input, inputSchema);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Render success message after build.
|
|
227
|
-
*/
|
|
228
|
-
function renderBuildSuccessMessage(builds) {
|
|
229
|
-
const first = builds[0];
|
|
230
|
-
if (!first) return;
|
|
231
|
-
if (builds.length > 1) ui.success(`Built ${builds.length} workflow(s) with name "${first.name}"`);
|
|
232
|
-
else ui.success(`Built ${first.name} (${formatBytes(first.bundleSize)})`);
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Render completion success message (single or multi).
|
|
236
|
-
*/
|
|
237
|
-
function renderRunCompletionSuccessMessage(builds, elapsedSeconds) {
|
|
238
|
-
if (builds.length === 0) return;
|
|
239
|
-
if (builds.length > 1) ui.success(`All ${builds.length} workflow(s) completed in ${elapsedSeconds}s`);
|
|
240
|
-
else ui.success(`Workflow completed in ${elapsedSeconds}s`);
|
|
241
|
-
}
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/commands/workflows/try-deploy.handler/render.ts
|
|
226
|
+
//#region src/commands/workflows/_shared/run-polling-render.ts
|
|
244
227
|
function createRuntimeRenderState() {
|
|
245
228
|
return {
|
|
246
229
|
seenEventIds: /* @__PURE__ */ new Set(),
|
|
@@ -354,9 +337,9 @@ function toObject(value) {
|
|
|
354
337
|
return value;
|
|
355
338
|
}
|
|
356
339
|
//#endregion
|
|
357
|
-
//#region src/commands/workflows/
|
|
340
|
+
//#region src/commands/workflows/_shared/run-polling.ts
|
|
358
341
|
const POLL_INTERVAL_MS = 1e3;
|
|
359
|
-
async function pollForCompletion(client, runId, timeoutSeconds, verbose) {
|
|
342
|
+
async function pollForCompletion(client, runId, timeoutSeconds, verbose, render = true) {
|
|
360
343
|
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
361
344
|
const renderState = createRuntimeRenderState();
|
|
362
345
|
const runtimeState = {
|
|
@@ -365,12 +348,12 @@ async function pollForCompletion(client, runId, timeoutSeconds, verbose) {
|
|
|
365
348
|
};
|
|
366
349
|
while (Date.now() < deadline) {
|
|
367
350
|
const snapshot = await getRunSnapshot(client, runId, runtimeState, verbose);
|
|
368
|
-
renderRunSnapshot(snapshot, renderState, verbose);
|
|
351
|
+
if (render) renderRunSnapshot(snapshot, renderState, verbose);
|
|
369
352
|
if (TERMINAL_STATUSES.has(snapshot.run.status)) return snapshot;
|
|
370
353
|
await sleep(POLL_INTERVAL_MS);
|
|
371
354
|
}
|
|
372
355
|
const snapshot = await getRunSnapshot(client, runId, runtimeState, verbose);
|
|
373
|
-
renderRunSnapshot(snapshot, renderState, verbose);
|
|
356
|
+
if (render) renderRunSnapshot(snapshot, renderState, verbose);
|
|
374
357
|
return snapshot;
|
|
375
358
|
}
|
|
376
359
|
async function getRunSnapshot(client, runId, runtimeState, verbose) {
|
|
@@ -404,87 +387,4 @@ async function getRunSnapshot(client, runId, runtimeState, verbose) {
|
|
|
404
387
|
};
|
|
405
388
|
}
|
|
406
389
|
//#endregion
|
|
407
|
-
|
|
408
|
-
var try_deploy_handler_exports = /* @__PURE__ */ __exportAll({ handleWorkflowsTryDeploy: () => handleWorkflowsTryDeploy });
|
|
409
|
-
async function handleWorkflowsTryDeploy(options, ctx) {
|
|
410
|
-
return withErrorBoundary("Try-deploy", async () => {
|
|
411
|
-
const client = requireClient(ctx);
|
|
412
|
-
const startTime = Date.now();
|
|
413
|
-
const local = isLocalMode();
|
|
414
|
-
const { input, workflowsDir } = await resolveAndValidateInputForRun(options);
|
|
415
|
-
const storagePaths = [];
|
|
416
|
-
let runError;
|
|
417
|
-
try {
|
|
418
|
-
const builds = await buildWorkflowsForRun({
|
|
419
|
-
...options,
|
|
420
|
-
workflowsDir
|
|
421
|
-
});
|
|
422
|
-
renderBuildSuccessMessage(builds);
|
|
423
|
-
validateInputWithFirstBuild(options, input, builds);
|
|
424
|
-
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
425
|
-
await assertProjectConfigMatchesAuthenticatedOrg(client, projectConfig);
|
|
426
|
-
for (const [i, build] of builds.entries()) {
|
|
427
|
-
if (builds.length > 1) ui.header(`Running "${build.name}" (${i + 1}/${builds.length})...`);
|
|
428
|
-
let storagePath;
|
|
429
|
-
if (local) {
|
|
430
|
-
storagePath = build.bundlePath;
|
|
431
|
-
if (i === 0) ui.hint("Local mode: using bundle from build output (skipping upload)");
|
|
432
|
-
} else {
|
|
433
|
-
ui.header("Uploading test bundle...");
|
|
434
|
-
storagePath = (await uploadTestBundle(client, build, false)).storagePath;
|
|
435
|
-
storagePaths.push(storagePath);
|
|
436
|
-
ui.success("Upload complete");
|
|
437
|
-
}
|
|
438
|
-
ui.header("Executing workflow...");
|
|
439
|
-
const { runId } = await client.workflows.testById({
|
|
440
|
-
workflowName: build.name,
|
|
441
|
-
storagePath,
|
|
442
|
-
exportName: build.exportName,
|
|
443
|
-
manifest: build.manifestData,
|
|
444
|
-
flowJson: build.flowData,
|
|
445
|
-
triggers: build.triggers,
|
|
446
|
-
bundleHash: build.bundleHash,
|
|
447
|
-
bundleSize: build.bundleSize,
|
|
448
|
-
args: [input],
|
|
449
|
-
organizationId: projectConfig.organizationId,
|
|
450
|
-
projectId: projectConfig.projectId
|
|
451
|
-
});
|
|
452
|
-
ui.hint(`Run ID: ${runId}`);
|
|
453
|
-
const snapshot = await pollForCompletion(client, runId, options.timeout, options.verbose);
|
|
454
|
-
const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
455
|
-
if (snapshot.run.status === "completed") {
|
|
456
|
-
if (snapshot.run.output !== void 0 && snapshot.run.output !== null) {
|
|
457
|
-
ui.br();
|
|
458
|
-
ui.header("Output:");
|
|
459
|
-
ui.text(JSON.stringify(snapshot.run.output, null, 2));
|
|
460
|
-
}
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
if (snapshot.run.status === "failed") {
|
|
464
|
-
ui.br();
|
|
465
|
-
ui.error(`Workflow failed after ${elapsed}s`);
|
|
466
|
-
if (snapshot.run.error) ui.error(toErrorMessage(snapshot.run.error));
|
|
467
|
-
runError = snapshot.run.error ?? /* @__PURE__ */ new Error("Workflow failed");
|
|
468
|
-
break;
|
|
469
|
-
}
|
|
470
|
-
ui.br();
|
|
471
|
-
ui.warn(`Workflow still ${snapshot.run.status} after ${elapsed}s (timeout: ${options.timeout}s)`);
|
|
472
|
-
ui.hint(`Check status: keystroke runs get ${runId}`);
|
|
473
|
-
runError = /* @__PURE__ */ new Error(`Workflow still ${snapshot.run.status} after timeout`);
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
if (!runError) {
|
|
477
|
-
ui.br();
|
|
478
|
-
renderRunCompletionSuccessMessage(builds, ((Date.now() - startTime) / 1e3).toFixed(1));
|
|
479
|
-
}
|
|
480
|
-
} finally {
|
|
481
|
-
if (!local) for (const sp of storagePaths) try {
|
|
482
|
-
await client.workflows.deleteTestBundle({ storagePath: sp });
|
|
483
|
-
if (options.verbose) ui.hint("Test bundle cleaned up");
|
|
484
|
-
} catch {}
|
|
485
|
-
}
|
|
486
|
-
if (runError) throw new CliExitError("Workflow execution failed");
|
|
487
|
-
}, { json: ctx.jsonMode });
|
|
488
|
-
}
|
|
489
|
-
//#endregion
|
|
490
|
-
export { validateInputOrExit as a, resolveInput as i, try_deploy_handler_exports as n, pollForCompletion as r, handleWorkflowsTryDeploy as t };
|
|
390
|
+
export { tryReadExistingInputSchema as a, resolveWorkflowGlobals as i, resolveInput as n, validateInputOrExit as o, resolveRunInput as r, validateWorkflowGlobalsOrExit as s, pollForCompletion as t };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { M as throwReportedCliExit, O as CliExitError, b as toErrorMessage, t as ui } from "./keystroke.mjs";
|
|
4
|
+
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-D9eFU8Jk.mjs";
|
|
6
|
+
import { i as writeJson } from "./output-BCDZb3Gy.mjs";
|
|
7
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-DT06adrn.mjs";
|
|
8
|
+
import { n as resolveWorkflowsDir } from "./resolve-project-BREjwFKO.mjs";
|
|
9
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-j5DlVkb2.mjs";
|
|
10
|
+
import { i as resolveWorkflowGlobals, o as validateInputOrExit, r as resolveRunInput, s as validateWorkflowGlobalsOrExit, t as pollForCompletion } from "./run-polling-BLT-uS2e.mjs";
|
|
11
|
+
//#region src/commands/workflows/run.handler.ts
|
|
12
|
+
async function handleWorkflowsRun(options, ctx) {
|
|
13
|
+
const client = requireClient(ctx);
|
|
14
|
+
const projectId = await resolveProjectId(options, ctx);
|
|
15
|
+
const input = await resolveRunInput(options);
|
|
16
|
+
const globals = await resolveWorkflowGlobals(options);
|
|
17
|
+
const deploymentLookup = await loadCurrentDeploymentWorkflow(client, {
|
|
18
|
+
projectId,
|
|
19
|
+
authoredWorkflowId: options.workflow
|
|
20
|
+
});
|
|
21
|
+
assertDeploymentWorkflowFound(deploymentLookup, options.workflow);
|
|
22
|
+
const workflow = deploymentLookup.workflow;
|
|
23
|
+
const inputSchema = workflow.manifest.workflowSchemas.input;
|
|
24
|
+
const validatedInput = isJsonObjectSchema(inputSchema) && inputSchema.type !== "unknown" ? validateInputOrExit(workflow.workflowName, input, inputSchema) : input;
|
|
25
|
+
const globalsSchema = workflow.manifest.workflowGlobals;
|
|
26
|
+
const validatedGlobals = resolveValidatedWorkflowGlobals({
|
|
27
|
+
workflowName: workflow.workflowName,
|
|
28
|
+
schema: globalsSchema,
|
|
29
|
+
globals
|
|
30
|
+
});
|
|
31
|
+
if (!ctx.jsonMode) ui.header("Executing workflow...");
|
|
32
|
+
const executeBody = {
|
|
33
|
+
projectId,
|
|
34
|
+
authoredWorkflowId: workflow.authoredWorkflowId,
|
|
35
|
+
args: [validatedInput],
|
|
36
|
+
...validatedGlobals.shouldSend ? { workflowGlobals: validatedGlobals.value } : {}
|
|
37
|
+
};
|
|
38
|
+
const { runId } = await client.workflows.execute(executeBody);
|
|
39
|
+
if (!(options.wait || options.follow)) {
|
|
40
|
+
if (ctx.jsonMode) {
|
|
41
|
+
writeJson({
|
|
42
|
+
runId,
|
|
43
|
+
status: "pending"
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
ui.success("Workflow run queued.");
|
|
48
|
+
ui.hint(`Run ID: ${runId}`);
|
|
49
|
+
ui.hint(`View logs: keystroke workflows logs --run-id ${runId} --follow`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (!ctx.jsonMode) ui.hint(`Run ID: ${runId}`);
|
|
53
|
+
const snapshot = await pollForCompletion(client, runId, options.timeout, options.verbose, !ctx.jsonMode);
|
|
54
|
+
if (ctx.jsonMode) {
|
|
55
|
+
writeJson({
|
|
56
|
+
runId,
|
|
57
|
+
run: snapshot.run,
|
|
58
|
+
logs: snapshot.logs,
|
|
59
|
+
events: snapshot.events
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
renderWaitResult(runId, snapshot, options.timeout);
|
|
64
|
+
}
|
|
65
|
+
async function resolveProjectId(options, ctx) {
|
|
66
|
+
if (options.projectId) return options.projectId;
|
|
67
|
+
const workflowsDir = await resolveWorkflowsDir(options.path);
|
|
68
|
+
if (!workflowsDir) {
|
|
69
|
+
ui.error("No keystroke.config.ts found in this directory or any parent directory.");
|
|
70
|
+
ui.hint("Run inside a Keystroke project or pass --project-id <uuid>.");
|
|
71
|
+
throwReportedCliExit("No keystroke.config.ts found");
|
|
72
|
+
}
|
|
73
|
+
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
74
|
+
await assertProjectConfigMatchesAuthenticatedOrg(requireClient(ctx), projectConfig);
|
|
75
|
+
trackProject(workflowsDir);
|
|
76
|
+
return projectConfig.projectId;
|
|
77
|
+
}
|
|
78
|
+
async function loadCurrentDeploymentWorkflow(client, params) {
|
|
79
|
+
try {
|
|
80
|
+
return await lookupCurrentDeploymentWorkflow(client, params);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
ui.error(`Failed to load current deployment workflow: ${toErrorMessage(error)}`);
|
|
83
|
+
throwReportedCliExit(`Failed to load current deployment workflow: ${toErrorMessage(error)}`, { cause: error });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function assertDeploymentWorkflowFound(deploymentLookup, workflowRef) {
|
|
87
|
+
if (deploymentLookup.status === "found") return;
|
|
88
|
+
if (deploymentLookup.status === "missingCurrentDeployment") {
|
|
89
|
+
ui.error("This project has no current deployment.");
|
|
90
|
+
ui.hint("Run `keystroke deploy` to create the current deployment, then try again.");
|
|
91
|
+
throwReportedCliExit("This project has no current deployment.");
|
|
92
|
+
}
|
|
93
|
+
if (deploymentLookup.status === "missingWorkflow") {
|
|
94
|
+
ui.error(`Workflow "${workflowRef}" is not part of the current deployment.`);
|
|
95
|
+
ui.hint("Run `keystroke deploy` to include it in the current deployment, then try again.");
|
|
96
|
+
throwReportedCliExit(`Workflow "${workflowRef}" is not part of the current deployment.`);
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Unhandled deployment lookup status: ${JSON.stringify(deploymentLookup)}`);
|
|
99
|
+
}
|
|
100
|
+
function resolveValidatedWorkflowGlobals(params) {
|
|
101
|
+
if (!isJsonObjectSchema(params.schema)) return params.globals.provided && params.globals.value ? {
|
|
102
|
+
shouldSend: true,
|
|
103
|
+
value: params.globals.value
|
|
104
|
+
} : { shouldSend: false };
|
|
105
|
+
const candidate = params.globals.value ?? {};
|
|
106
|
+
const validated = validateWorkflowGlobalsOrExit(params.workflowName, candidate, params.schema);
|
|
107
|
+
if (params.globals.provided || Object.keys(validated).length > 0) return {
|
|
108
|
+
shouldSend: true,
|
|
109
|
+
value: validated
|
|
110
|
+
};
|
|
111
|
+
return { shouldSend: false };
|
|
112
|
+
}
|
|
113
|
+
function renderWaitResult(runId, snapshot, timeoutSeconds) {
|
|
114
|
+
ui.br();
|
|
115
|
+
if (snapshot.run.status === "completed") {
|
|
116
|
+
ui.success("Workflow completed.");
|
|
117
|
+
ui.hint(`Run ID: ${runId}`);
|
|
118
|
+
if (snapshot.run.output !== void 0 && snapshot.run.output !== null) {
|
|
119
|
+
ui.br();
|
|
120
|
+
ui.header("Output:");
|
|
121
|
+
ui.text(JSON.stringify(snapshot.run.output, null, 2));
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (snapshot.run.status === "failed") {
|
|
126
|
+
if (snapshot.run.error) ui.error(toErrorMessage(snapshot.run.error));
|
|
127
|
+
throw new CliExitError("Workflow failed.");
|
|
128
|
+
}
|
|
129
|
+
ui.warn(`Workflow still ${snapshot.run.status} after ${timeoutSeconds}s.`);
|
|
130
|
+
throw new CliExitError(`Workflow still ${snapshot.run.status} after timeout.`);
|
|
131
|
+
}
|
|
132
|
+
function isJsonObjectSchema(value) {
|
|
133
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { handleWorkflowsRun };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
5
|
-
import { t as createTypedCommand } from "./commander-
|
|
6
|
-
import { i as requireClient } from "./context-
|
|
3
|
+
import { M as throwReportedCliExit, b as toErrorMessage, d as ANSI, f as style, t as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BCDZb3Gy.mjs";
|
|
5
|
+
import { t as createTypedCommand } from "./commander-B6_tg5_w.mjs";
|
|
6
|
+
import { i as requireClient } from "./context-DT06adrn.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/commands/runs/inspect-display.ts
|
|
9
9
|
function renderRunInspect(input) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { f as trimmedNonEmptyString, i as descriptionString, n as createStructuralSchema } from "./schema-
|
|
4
|
-
import { c as TriggerTypeSchema, m as CredentialSetManifestSchema, r as ExecutionIdentityPolicySchema } from "./credential-requirements-
|
|
3
|
+
import { f as trimmedNonEmptyString, i as descriptionString, n as createStructuralSchema } from "./schema-B-Wgo4rJ.mjs";
|
|
4
|
+
import { c as TriggerTypeSchema, m as CredentialSetManifestSchema, r as ExecutionIdentityPolicySchema } from "./credential-requirements-BCW8aQWS.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../packages/core/src/trigger/schemas.ts
|
|
7
7
|
const credentialSetInstanceSchema = createStructuralSchema([
|
|
@@ -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 { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-
|
|
3
|
+
import { O as CliExitError, t as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson, r as isJsonMode } from "./output-BCDZb3Gy.mjs";
|
|
5
|
+
import { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-D746f2W_.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) {
|
|
@@ -1,7 +1,7 @@
|
|
|
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-BCDZb3Gy.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-B6_tg5_w.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/skills/skills.command.ts
|
|
7
7
|
const SkillsCommandOptionsSchema = JsonOptionSchema.extend({ path: z.string().optional().describe("Project root (default: current directory)") });
|
|
@@ -18,13 +18,13 @@ function createSkillsCommand() {
|
|
|
18
18
|
description: "Sync Keystroke agent skills (SKILL.md) from @keystrokehq/skills",
|
|
19
19
|
schema: SkillsCommandOptionsSchema,
|
|
20
20
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
21
|
-
loadHandler: async () => (await import("./skills.handler-
|
|
21
|
+
loadHandler: async () => (await import("./skills.handler-BQ3Qfej3.mjs")).handleSkillsParent,
|
|
22
22
|
subcommands: [createTypedCommand({
|
|
23
23
|
name: "sync",
|
|
24
24
|
description: "Copy installed @keystrokehq/skills into .cursor/skills and .claude/skills",
|
|
25
25
|
schema: SkillsCommandOptionsSchema,
|
|
26
26
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
27
|
-
loadHandler: async () => (await import("./skills-sync.handler-
|
|
27
|
+
loadHandler: async () => (await import("./skills-sync.handler-CuuCiUGT.mjs")).handleSkillsSync
|
|
28
28
|
})]
|
|
29
29
|
});
|
|
30
30
|
cmd.enablePositionalOptions();
|
package/dist/{source-analysis-DEEChuND-eixwPnPP.mjs → source-analysis-DEEChuND-Csu0oOlw.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { d as getMetadataRoot } from "./layout-
|
|
4
|
-
import { t as BASE_IGNORE_PATTERNS } from "./metadata-layout-C6ed-9dl-
|
|
5
|
-
import { a as literalString, l as unwrapExpression, n as identifierName, r as isNode } from "./oxc-B3KI3rf_-
|
|
3
|
+
import { d as getMetadataRoot } from "./layout-CXkZEsXI.mjs";
|
|
4
|
+
import { t as BASE_IGNORE_PATTERNS } from "./metadata-layout-C6ed-9dl-C6Bylr_z.mjs";
|
|
5
|
+
import { a as literalString, l as unwrapExpression, n as identifierName, r as isNode } from "./oxc-B3KI3rf_-ghZc3xZ5.mjs";
|
|
6
6
|
import { readFile, readdir, rm } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
//#region ../../packages/workflow-builder/dist/source-analysis-DEEChuND.mjs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { d as ANSI, f as style, l as logger, p as isTTY, u as originalConsole } 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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { a as createKyInstance, i as buildSearchParams, n as auth, r as bundles, s as getClientEnv, t as projects$1 } from "./projects-
|
|
3
|
+
import { a as createKyInstance, i as buildSearchParams, n as auth, r as bundles, s as getClientEnv, t as projects$1 } from "./projects-DN7dX6nN.mjs";
|
|
4
4
|
//#region ../../packages/workflow-sdk/src/v1/admin.ts
|
|
5
5
|
const admin = (api) => ({
|
|
6
6
|
orgs: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { b as toErrorMessage, h as REAUTH_HINT, m as AUTH_HINT, t as ui, v as isAuthError, y as isNetworkError } from "./keystroke.mjs";
|
|
4
4
|
//#region src/commands/auth/status.handler.ts
|
|
5
5
|
async function getValidationStatus(ctx) {
|
|
6
6
|
if (!ctx.client) return { kind: "not_authenticated" };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { M as throwReportedCliExit, t as ui } from "./keystroke.mjs";
|
|
4
4
|
import { u as setActiveOrg } from "./dist-BF6r1hfv.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-DT06adrn.mjs";
|
|
6
6
|
import { select } from "@clack/prompts";
|
|
7
7
|
//#region src/commands/org/switch.handler.ts
|
|
8
8
|
async function handleOrgSwitch(_options, ctx) {
|
|
@@ -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-B6_tg5_w.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-D2cY3bia.mjs")).handleSync
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { M as throwReportedCliExit, a as isLocalMode, b as toErrorMessage, l as logger, t as ui } from "./keystroke.mjs";
|
|
4
4
|
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as createDeployProgress } from "./deploy-progress-CZ2rPlOj.mjs";
|
|
5
|
+
import { a as validateApiKey, i as requireClient } from "./context-DT06adrn.mjs";
|
|
6
|
+
import { n as deployFromDir } from "./dist-DvO0q6Fo.mjs";
|
|
7
|
+
import { t as requireWorkflowsDir } from "./resolve-project-BREjwFKO.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-Be6RMTb2.mjs";
|
|
9
|
+
import { t as createBuildProgress } from "./build-progress-Mzsk4RKr.mjs";
|
|
10
|
+
import { t as createDeployProgress } from "./deploy-progress-BkpuGfGt.mjs";
|
|
12
11
|
//#region src/commands/sync/sync.handler.ts
|
|
13
12
|
async function handleSync(options, ctx) {
|
|
14
13
|
try {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
|
-
import { r as SHA256HashSchema } from "./common-
|
|
5
|
-
import { a as idNoSpacesString, c as optionalDescriptionString, f as trimmedNonEmptyString, n as createStructuralSchema, o as jsonSchemaObject, p as trimmedNonEmptyStringUnbounded } from "./schema-
|
|
6
|
-
import { t as DurationSchema } from "./schedule-
|
|
7
|
-
import { n as TriggerRuntimeDescriptorSchema, t as TriggerManifestSchema } from "./schemas-
|
|
4
|
+
import { r as SHA256HashSchema } from "./common-B3bLe3Mk.mjs";
|
|
5
|
+
import { a as idNoSpacesString, c as optionalDescriptionString, f as trimmedNonEmptyString, n as createStructuralSchema, o as jsonSchemaObject, p as trimmedNonEmptyStringUnbounded } from "./schema-B-Wgo4rJ.mjs";
|
|
6
|
+
import { t as DurationSchema } from "./schedule-BWAI6qLx.mjs";
|
|
7
|
+
import { n as TriggerRuntimeDescriptorSchema, t as TriggerManifestSchema } from "./schemas-9FmGqrPT.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region ../../packages/core/src/task/schemas.ts
|
|
10
10
|
const agentInstanceSchema = createStructuralSchema([
|