@keystrokehq/cli 0.0.12 → 0.0.14
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-BU6kg8ET.mjs → accept.handler-BsZQqmzU.mjs} +1 -1
- package/dist/{admin-B4GNbCl5.mjs → admin-CXQezpQA.mjs} +9 -9
- package/dist/{agents-DDqXmmFV.mjs → agents-BdzwXAI1.mjs} +6 -6
- package/dist/{api-DuKKdCpF.mjs → api-Sf7A0I5T.mjs} +1 -1
- package/dist/{api-keys-BE_hLonn.mjs → api-keys-BZmUiIEr.mjs} +5 -5
- package/dist/{auth-DNK5MYm4.mjs → auth-CGBgi6PG.mjs} +5 -5
- package/dist/{auth.handler-DrjDODhZ.mjs → auth.handler-u3qmoUX0.mjs} +1 -2
- package/dist/{build-agents-DseUtzd4-DIDGsZWL.mjs → build-agents-DseUtzd4-DBQ82ErJ.mjs} +3 -3
- package/dist/{build-metadata-xqeWhaTS-WR8IooGe.mjs → build-metadata-qebrtraZ-BL-fo8HW.mjs} +7 -7
- package/dist/{build-progress-CITED2tv.mjs → build-progress-BataNqG-.mjs} +1 -1
- package/dist/{build-tasks-GVuMLS0h-DnS9QWzf.mjs → build-tasks-GVuMLS0h-CWrrj8SF.mjs} +3 -3
- package/dist/{build-workflows-Dmzay1vP-DKVuBAjD.mjs → build-workflows-Dmzay1vP-CAhb0BSk.mjs} +6 -6
- package/dist/{build.handler-DI146Cd3.mjs → build.handler-DTKBdDzF.mjs} +4 -4
- package/dist/{clear.handler-B1c17nAi.mjs → clear.handler-Dpe05eTq.mjs} +1 -1
- package/dist/{commander-BwtBoukr.mjs → commander-i-7LgOyc.mjs} +1 -1
- package/dist/{connect-IPcL37np.mjs → connect-BcTkRZ10.mjs} +2 -2
- package/dist/{connect.handler-ToY6qmMz.mjs → connect.handler-DilOwhlW.mjs} +3 -3
- package/dist/{context-DQ4IA0yO.mjs → context-B1L8pZsH.mjs} +1 -1
- package/dist/{create.handler-BAyG0PmG.mjs → create.handler-DF1Ye4nr.mjs} +1 -1
- package/dist/{credentials-CZiu-534.mjs → credentials-BsEHWMBh.mjs} +6 -6
- package/dist/cron-parser-C2eJD0yD.mjs +393 -0
- package/dist/{current-deployment-workflow-B4IufKqe.mjs → current-deployment-workflow-Biw1zV7S.mjs} +4 -4
- package/dist/{current.handler-DA4FGfUP.mjs → current.handler-C48q2mBd.mjs} +1 -1
- package/dist/{delete.handler-CJcyvnUF.mjs → delete.handler-Bude0SVP.mjs} +1 -1
- package/dist/{deploy-BvaFgVvf.mjs → deploy-D4ILrWpx.mjs} +1 -1
- package/dist/{deploy-CqXOhecY.mjs → deploy-DVE7Mx_X.mjs} +2 -2
- package/dist/{deploy-progress-CLO-yidq.mjs → deploy-progress-7qj5ek8b.mjs} +1 -1
- package/dist/{deploy.handler-DQg_rXgs.mjs → deploy.handler-B3E7uX-x.mjs} +15 -15
- package/dist/{detect-env-access-CwkOYeYM-EmkYvbfJ.mjs → detect-env-access-CwkOYeYM-BLtKepjx.mjs} +1 -1
- package/dist/{diff.handler-BXg47NIZ.mjs → diff.handler-BMNZ_3J_.mjs} +3 -3
- package/dist/{dist-BMkNN03r.mjs → dist-BVD3Ga_l.mjs} +7 -7
- package/dist/{env.handler-DFKzjIQT.mjs → env.handler-BUBsjm1k.mjs} +6 -6
- package/dist/{error-boundary-B2ZKRkZI.mjs → error-boundary-CyLcinp1.mjs} +1 -1
- package/dist/{import-module-DEI7R8Yh-Xz-KAPvB.mjs → import-module-DEI7R8Yh-L32hhSoh.mjs} +817 -34
- package/dist/{init-DhnABm3J.mjs → init-CxMQ2ysa.mjs} +2 -2
- package/dist/{init.handler-QgehN8B4.mjs → init.handler-BPKxeGZS.mjs} +2 -2
- package/dist/{inspect.handler-CerVdo23.mjs → inspect.handler-CJ7e6iFB.mjs} +3 -3
- package/dist/{integration-catalog-BRrJIAVz.mjs → integration-catalog-BgT4mLzW.mjs} +1 -1
- package/dist/{integrations-7-U7nmkh.mjs → integrations-DUlJhGUS.mjs} +5 -5
- package/dist/{invites-CmGmnUla.mjs → invites-BlB-hKUE.mjs} +4 -4
- package/dist/{invites.list.handler-CmkIf-uW.mjs → invites.list.handler-DmeMcezN.mjs} +1 -1
- package/dist/{invites.resend.handler-FZl20yat.mjs → invites.resend.handler-pJTPtKHE.mjs} +1 -1
- package/dist/{invites.revoke.handler-D95mrfmB.mjs → invites.revoke.handler-4NgnnfiU.mjs} +1 -1
- package/dist/keystroke.mjs +21 -21
- package/dist/{list-enrichment-I4XQaMg0.mjs → list-enrichment-C6u5eI0j.mjs} +1 -1
- package/dist/{list.handler-DRnHsEa0.mjs → list.handler-BSyrxCma.mjs} +1 -1
- package/dist/{list.handler-DsYyTUhA.mjs → list.handler-BuX-bb2y.mjs} +1 -1
- package/dist/{list.handler-H8aQSsFM.mjs → list.handler-C7AChEPW.mjs} +2 -2
- package/dist/{list.handler-Cp767f5l.mjs → list.handler-CBEXiTAK.mjs} +1 -1
- package/dist/{list.handler-DXl8igi2.mjs → list.handler-DhFni3rk.mjs} +5 -5
- package/dist/{list.handler-k8k7wVIV.mjs → list.handler-K3x71Y4Z.mjs} +3 -3
- package/dist/{listen-DckJq0y0.mjs → listen-drcHFcKq.mjs} +2 -2
- package/dist/{listen.handler-Bf5MXKPO.mjs → listen.handler-DjK6RlLf.mjs} +2 -2
- package/dist/{logs-D_l5BIn2.mjs → logs-NI-DyeFY.mjs} +3 -3
- package/dist/{logs.handler-kYO3Uv9t.mjs → logs.handler-PRYGI57p.mjs} +2 -2
- package/dist/{members.add.handler-C2cppd-9.mjs → members.add.handler-B4H8Hn6x.mjs} +1 -1
- package/dist/{members.invite.handler-DY6kS4LN.mjs → members.invite.handler-D8ONlt4Y.mjs} +1 -1
- package/dist/{members.list.handler-CFBG3SBw.mjs → members.list.handler-BHJTMMiA.mjs} +1 -1
- package/dist/{members.remove.handler-LQ61_qip.mjs → members.remove.handler-_hKd_sFd.mjs} +1 -1
- package/dist/{members.update.handler-CqISA1mf.mjs → members.update.handler-CC7J0k8n.mjs} +1 -1
- package/dist/{normalize-path-CojS-CgQ-D5D0AIHR.mjs → normalize-path-CojS-CgQ-DFTvyA27.mjs} +1 -1
- package/dist/{org-KQ2nD0yN.mjs → org-8bkIZAJ4.mjs} +15 -15
- package/dist/{orgs.create.handler-Mv5CTGcG.mjs → orgs.create.handler-vXQgDJZ_.mjs} +1 -1
- package/dist/{orgs.get.handler-DvvOhshX.mjs → orgs.get.handler-D_Jfl18x.mjs} +1 -1
- package/dist/{orgs.list.handler-wWAg6cKg.mjs → orgs.list.handler-BNjoTJvV.mjs} +1 -1
- package/dist/{paused.handler-CbMkPD9e.mjs → paused.handler-ST9dCe8E.mjs} +1 -1
- package/dist/{projects-CWLOF5x4.mjs → projects-DfaG_3WP.mjs} +1 -1
- package/dist/{projects-CYqeKQGT.mjs → projects-Pp5ENoyh.mjs} +4 -4
- package/dist/{requirements.handler-CnDTBcH5.mjs → requirements.handler-CZ53jJ_5.mjs} +5 -5
- package/dist/{run-polling-49w3PYAv.mjs → run-polling-7YWCL6c-.mjs} +3 -3
- package/dist/{run.handler-CX3YiJmj.mjs → run.handler-BNrAIXDG.mjs} +4 -4
- package/dist/{runs-HJejvQnQ.mjs → runs-Bs8VzL8P.mjs} +2 -2
- package/dist/{skills-sync.handler-Cf74vKJA.mjs → skills-sync.handler-DXF6IgEX.mjs} +1 -1
- package/dist/{skills.command-KyAwBeST.mjs → skills.command-B8yExFCn.mjs} +3 -3
- package/dist/{source-analysis-DEEChuND-zifGW9QF.mjs → source-analysis-DTnwNwKq-BqHdBGtw.mjs} +5 -5
- package/dist/{src-D-dFmoAF.mjs → src-BQdOWkyv.mjs} +1 -1
- package/dist/{switch.handler-DfsKVtR6.mjs → switch.handler-BFBM8rSi.mjs} +1 -1
- package/dist/{sync-Coh9YPjY.mjs → sync-BSL1s6PR.mjs} +2 -2
- package/dist/{sync.handler-vvFIUut1.mjs → sync.handler-BN9oDWVx.mjs} +6 -6
- package/dist/{task-BBgEvdG1.mjs → task-BNXDZU71.mjs} +1 -390
- package/dist/{task-target-build-atWwwnSF.mjs → task-target-build-Du0ObGbb.mjs} +4 -4
- package/dist/{task-target-deploy-CRsrQTOy.mjs → task-target-deploy-OyxLvh3a.mjs} +1 -1
- package/dist/task-target-deploy-runner.mjs +4 -4
- package/dist/{test-BzpSLhV8.mjs → test-BIz-oBxy.mjs} +65 -11
- package/dist/{test.handler-St9sBXyH.mjs → test.handler-Dk3CmTa7.mjs} +1 -1
- package/dist/{trigger-artifacts-RizI57RC-C-yCtEi-.mjs → trigger-artifacts-RizI57RC-abdkW8-z.mjs} +3 -3
- package/dist/{try-deploy.handler-32lU1tg4.mjs → try-deploy.handler-A16ahnCF.mjs} +8 -8
- package/dist/{upgrade-YavAf8AC.mjs → upgrade-f97U8Rll.mjs} +2 -2
- package/dist/{upload.handler-DemogvI1.mjs → upload.handler-CUtfr3hY.mjs} +7 -7
- package/dist/{users.get.handler-B20PMSbl.mjs → users.get.handler-D0WO6D1K.mjs} +1 -1
- package/dist/{users.list.handler-BplFTjv3.mjs → users.list.handler-BSTIniF1.mjs} +1 -1
- package/dist/{users.set-role.handler-wdmI6o3G.mjs → users.set-role.handler-DAKdSkbn.mjs} +1 -1
- package/dist/{utils-DpEtybzI.mjs → utils-LlH3l_yT.mjs} +1 -1
- package/dist/{validate.handler-BoRyygMl.mjs → validate.handler-CUP3SjzC.mjs} +3 -3
- package/dist/{workflow-build-CoJMwpPO.mjs → workflow-build-C_qkq7jk.mjs} +17 -17
- package/dist/{workflow-bundler-BzHk73PM-UJQa7Ubk.mjs → workflow-bundler-BzHk73PM-CRcJvu9a.mjs} +2 -2
- package/dist/{workflows-Cag9O9hx.mjs → workflows-ixllXKLo.mjs} +13 -13
- package/dist/{writer-CtvttJdP-BfNsrheU.mjs → writer-CtvttJdP-BEJHbiLs.mjs} +5 -5
- package/package.json +10 -10
- /package/dist/{agent-bundle-package-DWV6B_5q-cB76j6UL.mjs → agent-bundle-package-DWV6B_5q-rRTPU13L.mjs} +0 -0
- /package/dist/{browser-B4K0VW8p.mjs → browser-3cUiPlk2.mjs} +0 -0
- /package/dist/{clear-cache.handler-Dywqc7TG.mjs → clear-cache.handler-Bkt6GKnF.mjs} +0 -0
- /package/dist/{clear.handler-ui4e1CnJ.mjs → clear.handler-BieI9Oix.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-CaI6Vtbu.mjs → concurrency-gXn9Rw8x-BI6HQNfC.mjs} +0 -0
- /package/dist/{credential-env-map-D0zgoUl0.mjs → credential-env-map-B2nVJXPn.mjs} +0 -0
- /package/dist/{credential-schema-mismatch-8pqwvswO.mjs → credential-schema-mismatch-CfyBUMPS.mjs} +0 -0
- /package/dist/{credentials-Bu1MBiCL.mjs → credentials-CiOwDS5y.mjs} +0 -0
- /package/dist/{diff-utils-BoXI705D.mjs → diff-utils-4OQTpP5s.mjs} +0 -0
- /package/dist/{file-metadata-Dwy9KKq_.mjs → file-metadata-DaPPpiTh.mjs} +0 -0
- /package/dist/{layout-DRf9qUf8.mjs → layout-DaoP8bcD.mjs} +0 -0
- /package/dist/{list.handler-BrTW2viq.mjs → list.handler-VGPaJzl-.mjs} +0 -0
- /package/dist/{logs.handler-DxSKmDCq.mjs → logs.handler-BqmZ4eLx.mjs} +0 -0
- /package/dist/{metadata-layout-C6ed-9dl-EF5pCtIH.mjs → metadata-layout-C6ed-9dl-DCTTsjiG.mjs} +0 -0
- /package/dist/{options-DFPs-tAB.mjs → options-BsIkm0Bb.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-CHDUXsus.mjs → oxc-B3KI3rf_-DdiZWqe2.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-CzXPGxdU.mjs → read-credential-keys-77a91T8M-COvwpok_.mjs} +0 -0
- /package/dist/{register.handler-D7ZZAnGP.mjs → register.handler-CttgzybN.mjs} +0 -0
- /package/dist/{resolve-project-bVPMcs-y.mjs → resolve-project-CI_PxRXi.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-3DMm_Sby.mjs → rolldown-runtime-twds-ZHy-CO5ir_za.mjs} +0 -0
- /package/dist/{run-polling-Cb4ssXIE.mjs → run-polling-BPmB5N5A.mjs} +0 -0
- /package/dist/{schema-DFJiNWyd.mjs → schema-BjH_e4Fo.mjs} +0 -0
- /package/dist/{schema-display-CyCWSgfY.mjs → schema-display-B0LmISCe.mjs} +0 -0
- /package/dist/{skills.handler-C_4VzVmc.mjs → skills.handler-CPKCf9ZK.mjs} +0 -0
- /package/dist/{spinner-progress-CS1BEdNB.mjs → spinner-progress-DpL68vYK.mjs} +0 -0
- /package/dist/{status.handler-Cm9aNUBn.mjs → status.handler-DxCJRm1n.mjs} +0 -0
- /package/dist/{sync-keystroke-agent-skills-CX9fS5nQ.mjs → sync-keystroke-agent-skills-ChUj1LnK.mjs} +0 -0
- /package/dist/{task-target-deploy-CZBGNC0H-BwPSfaJQ.mjs → task-target-deploy-CZBGNC0H-Ck724yF4.mjs} +0 -0
- /package/dist/{trigger-manifest-D5rnpPkA.mjs → trigger-manifest-PTjVYL1r.mjs} +0 -0
- /package/dist/{upgrade.handler-C2eZ_tg3.mjs → upgrade.handler-CXEF4ue0.mjs} +0 -0
- /package/dist/{upload-C0kaZu08.mjs → upload-wwSPAC5_.mjs} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-B1L8pZsH.mjs";
|
|
6
6
|
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-ByLX0A-V.mjs";
|
|
7
7
|
//#region src/commands/admin/orgs.get.handler.ts
|
|
8
8
|
async function handleAdminOrgsGet(options, ctx) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-B1L8pZsH.mjs";
|
|
6
6
|
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-ByLX0A-V.mjs";
|
|
7
7
|
import Table from "cli-table3";
|
|
8
8
|
//#region src/commands/admin/orgs.list.handler.ts
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { N as throwReportedCliExit, n as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-B1L8pZsH.mjs";
|
|
6
6
|
//#region src/commands/workflows/paused/paused.handler.ts
|
|
7
7
|
async function handleWorkflowsPaused(options, ctx) {
|
|
8
8
|
const client = requireClient(ctx);
|
|
@@ -2204,7 +2204,7 @@ const bundles = (api) => ({
|
|
|
2204
2204
|
})),
|
|
2205
2205
|
purpose
|
|
2206
2206
|
} }).json();
|
|
2207
|
-
const { batchUpload } = await import("./upload-
|
|
2207
|
+
const { batchUpload } = await import("./upload-wwSPAC5_.mjs").then((n) => n.n);
|
|
2208
2208
|
return batchUpload(workflows.map((wf) => ({
|
|
2209
2209
|
name: wf.workflowName,
|
|
2210
2210
|
bundle: wf.bundle,
|
|
@@ -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-CGdYhH0p.mjs";
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
4
|
+
import { t as createTypedCommand } from "./commander-i-7LgOyc.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/projects/projects.command.ts
|
|
7
7
|
function createProjectsCommand() {
|
|
@@ -10,19 +10,19 @@ function createProjectsCommand() {
|
|
|
10
10
|
description: "List tracked Keystroke projects",
|
|
11
11
|
schema: JsonOptionSchema,
|
|
12
12
|
optionsConfig: { ...JSON_OPTION_CONFIG },
|
|
13
|
-
loadHandler: async () => (await import("./list.handler-
|
|
13
|
+
loadHandler: async () => (await import("./list.handler-VGPaJzl-.mjs")).handleProjectsList,
|
|
14
14
|
subcommands: [createTypedCommand({
|
|
15
15
|
name: "list",
|
|
16
16
|
description: "List all tracked Keystroke projects",
|
|
17
17
|
schema: JsonOptionSchema,
|
|
18
18
|
optionsConfig: { ...JSON_OPTION_CONFIG },
|
|
19
|
-
loadHandler: async () => (await import("./list.handler-
|
|
19
|
+
loadHandler: async () => (await import("./list.handler-VGPaJzl-.mjs")).handleProjectsList
|
|
20
20
|
}), createTypedCommand({
|
|
21
21
|
name: "clear-cache",
|
|
22
22
|
description: "Clear the stored projects cache (projects.json)",
|
|
23
23
|
schema: z.object({}),
|
|
24
24
|
optionsConfig: {},
|
|
25
|
-
loadHandler: async () => (await import("./clear-cache.handler-
|
|
25
|
+
loadHandler: async () => (await import("./clear-cache.handler-Bkt6GKnF.mjs")).handleProjectsClearCache
|
|
26
26
|
})]
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { a as getProcessEnv, f as ANSI, n as ui, p as style } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { a as readManifestsFromOutDir } from "./dist-
|
|
6
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
7
|
-
import { t as readCredentialEnvMap } from "./credential-env-map-
|
|
8
|
-
import { a as loadProjectDotenvFile, c as getTerminalContentWidth, o as manifestGroupKey, s as normalizeManifestScopeToServer, t as buildCredentialWorkflowConsumersByGroup, u as truncateWithEllipsis } from "./list-enrichment-
|
|
9
|
-
import { t as groupCredentialRequirements } from "./credentials-
|
|
5
|
+
import { a as readManifestsFromOutDir } from "./dist-BVD3Ga_l.mjs";
|
|
6
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CI_PxRXi.mjs";
|
|
7
|
+
import { t as readCredentialEnvMap } from "./credential-env-map-B2nVJXPn.mjs";
|
|
8
|
+
import { a as loadProjectDotenvFile, c as getTerminalContentWidth, o as manifestGroupKey, s as normalizeManifestScopeToServer, t as buildCredentialWorkflowConsumersByGroup, u as truncateWithEllipsis } from "./list-enrichment-C6u5eI0j.mjs";
|
|
9
|
+
import { t as groupCredentialRequirements } from "./credentials-CiOwDS5y.mjs";
|
|
10
10
|
//#region src/commands/credentials/requirements/requirements-display.ts
|
|
11
11
|
function dimLabel(label, width = 10) {
|
|
12
12
|
return style(label.padEnd(width), ANSI.dim);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { A as InputValidationError, n as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
-
import { a as readManifestsFromOutDir } from "./dist-
|
|
5
|
-
import { a as validateRequiredFields, n as formatValidationError, t as formatMissingInputError } from "./schema-display-
|
|
6
|
-
import { n as sleep, t as TERMINAL_STATUSES } from "./run-polling-
|
|
4
|
+
import { a as readManifestsFromOutDir } from "./dist-BVD3Ga_l.mjs";
|
|
5
|
+
import { a as validateRequiredFields, n as formatValidationError, t as formatMissingInputError } from "./schema-display-B0LmISCe.mjs";
|
|
6
|
+
import { n as sleep, t as TERMINAL_STATUSES } from "./run-polling-BPmB5N5A.mjs";
|
|
7
7
|
import * as fs from "node:fs/promises";
|
|
8
8
|
import * as path$1 from "node:path";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -4,10 +4,10 @@ import { N as throwReportedCliExit, k as CliExitError, n as ui, x as toErrorMess
|
|
|
4
4
|
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
5
|
import { t as assertWorkflowProjectRoot } from "./project-config-CJGSh2RQ.mjs";
|
|
6
6
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
7
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
8
|
-
import { n as resolveWorkflowsDir } from "./resolve-project-
|
|
9
|
-
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-
|
|
10
|
-
import { i as resolveWorkflowGlobals, o as validateInputOrExit, r as resolveRunInput, s as validateWorkflowGlobalsOrExit, t as pollForCompletion } from "./run-polling-
|
|
7
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-B1L8pZsH.mjs";
|
|
8
|
+
import { n as resolveWorkflowsDir } from "./resolve-project-CI_PxRXi.mjs";
|
|
9
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-Biw1zV7S.mjs";
|
|
10
|
+
import { i as resolveWorkflowGlobals, o as validateInputOrExit, r as resolveRunInput, s as validateWorkflowGlobalsOrExit, t as pollForCompletion } from "./run-polling-7YWCL6c-.mjs";
|
|
11
11
|
//#region src/commands/workflows/run.handler.ts
|
|
12
12
|
async function handleWorkflowsRun(options, ctx) {
|
|
13
13
|
const client = requireClient(ctx);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { N as throwReportedCliExit, f as ANSI, n as ui, p as style, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { t as createTypedCommand } from "./commander-
|
|
6
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { t as createTypedCommand } from "./commander-i-7LgOyc.mjs";
|
|
6
|
+
import { i as requireClient } from "./context-B1L8pZsH.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/commands/runs/inspect-display.ts
|
|
9
9
|
function renderRunInspect(input) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { k as CliExitError, n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson, r as isJsonMode } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-
|
|
5
|
+
import { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-ChUj1LnK.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
3
|
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-CGdYhH0p.mjs";
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
4
|
+
import { t as createTypedCommand } from "./commander-i-7LgOyc.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-CPKCf9ZK.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-DXF6IgEX.mjs")).handleSkillsSync
|
|
28
28
|
})]
|
|
29
29
|
});
|
|
30
30
|
cmd.enablePositionalOptions();
|
package/dist/{source-analysis-DEEChuND-zifGW9QF.mjs → source-analysis-DTnwNwKq-BqHdBGtw.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
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-DaoP8bcD.mjs";
|
|
4
|
+
import { t as BASE_IGNORE_PATTERNS } from "./metadata-layout-C6ed-9dl-DCTTsjiG.mjs";
|
|
5
|
+
import { a as literalString, l as unwrapExpression, n as identifierName, r as isNode } from "./oxc-B3KI3rf_-DdiZWqe2.mjs";
|
|
6
6
|
import { readFile, readdir, rm } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
//#region ../../packages/workflow-builder/dist/source-analysis-
|
|
8
|
+
//#region ../../packages/workflow-builder/dist/source-analysis-DTnwNwKq.mjs
|
|
9
9
|
async function removeAllMetadataArtifacts(outputDir) {
|
|
10
10
|
await rm(getMetadataRoot(outputDir), {
|
|
11
11
|
recursive: true,
|
|
@@ -42,7 +42,7 @@ const DISCOVERY_GLOB = [
|
|
|
42
42
|
];
|
|
43
43
|
const DISCOVERY_IGNORE = [...BASE_IGNORE_PATTERNS, "**/dist/**"];
|
|
44
44
|
const WORKFLOW_IMPORT_SOURCES = ["@keystrokehq/core"];
|
|
45
|
-
const AGENT_FACTORY_IMPORT_SOURCES = ["@
|
|
45
|
+
const AGENT_FACTORY_IMPORT_SOURCES = ["@keystrokehq/ai"];
|
|
46
46
|
const AGENT_FACTORY_NAMES = ["agent"];
|
|
47
47
|
function getLocalModuleSpecifier(moduleSpecifier) {
|
|
48
48
|
if (!moduleSpecifier) return null;
|
|
@@ -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-DfaG_3WP.mjs";
|
|
4
4
|
//#region ../../packages/workflow-sdk/src/v1/admin.ts
|
|
5
5
|
const admin = (api) => ({
|
|
6
6
|
orgs: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { N as throwReportedCliExit, n 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-B1L8pZsH.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-i-7LgOyc.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-BN9oDWVx.mjs")).handleSync
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { N as throwReportedCliExit, n as ui, o as isLocalMode, u as logger, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
4
|
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
|
-
import { a as validateApiKey, i as requireClient } from "./context-
|
|
6
|
-
import { n as deployFromDir } from "./dist-
|
|
7
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
8
|
-
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-
|
|
9
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
10
|
-
import { t as createDeployProgress } from "./deploy-progress-
|
|
5
|
+
import { a as validateApiKey, i as requireClient } from "./context-B1L8pZsH.mjs";
|
|
6
|
+
import { n as deployFromDir } from "./dist-BVD3Ga_l.mjs";
|
|
7
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CI_PxRXi.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-C_qkq7jk.mjs";
|
|
9
|
+
import { t as createBuildProgress } from "./build-progress-BataNqG-.mjs";
|
|
10
|
+
import { t as createDeployProgress } from "./deploy-progress-7qj5ek8b.mjs";
|
|
11
11
|
//#region src/commands/sync/sync.handler.ts
|
|
12
12
|
async function handleSync(options, ctx) {
|
|
13
13
|
try {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
4
|
import { a as descriptionString, c as optionalDescriptionString, d as trimmedNonEmptyStringUnbounded, i as createStructuralSchema, n as credentialSetProxyConfigSchema, o as idNoSpacesString, s as jsonSchemaObject, t as CredentialSetManifestSchema, u as trimmedNonEmptyString } from "./schemas-DodkHgnS.mjs";
|
|
5
|
+
import { t as parseCronExpression } from "./cron-parser-C2eJD0yD.mjs";
|
|
5
6
|
import { z } from "zod";
|
|
6
7
|
const SHA256HashSchema = z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
|
|
7
8
|
const JsonSchemaSchema = z.record(z.string(), z.unknown());
|
|
@@ -19,396 +20,6 @@ z.object({
|
|
|
19
20
|
return data.constant !== void 0 !== (data.exponential !== void 0);
|
|
20
21
|
}, { error: "Retry config must specify exactly one of constant or exponential strategy" });
|
|
21
22
|
//#endregion
|
|
22
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/utils.js
|
|
23
|
-
function extractDateElements(date) {
|
|
24
|
-
return {
|
|
25
|
-
second: date.getSeconds(),
|
|
26
|
-
minute: date.getMinutes(),
|
|
27
|
-
hour: date.getHours(),
|
|
28
|
-
day: date.getDate(),
|
|
29
|
-
month: date.getMonth(),
|
|
30
|
-
weekday: date.getDay(),
|
|
31
|
-
year: date.getFullYear()
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function getDaysInMonth(year, month) {
|
|
35
|
-
return new Date(year, month + 1, 0).getDate();
|
|
36
|
-
}
|
|
37
|
-
function getDaysBetweenWeekdays(weekday1, weekday2) {
|
|
38
|
-
if (weekday1 <= weekday2) return weekday2 - weekday1;
|
|
39
|
-
return 6 - weekday1 + weekday2 + 1;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron.js
|
|
43
|
-
var Cron = class {
|
|
44
|
-
constructor({ seconds, minutes, hours, days, months, weekdays }) {
|
|
45
|
-
if (!seconds || seconds.size === 0) throw new Error("There must be at least one allowed second.");
|
|
46
|
-
if (!minutes || minutes.size === 0) throw new Error("There must be at least one allowed minute.");
|
|
47
|
-
if (!hours || hours.size === 0) throw new Error("There must be at least one allowed hour.");
|
|
48
|
-
if (!months || months.size === 0) throw new Error("There must be at least one allowed month.");
|
|
49
|
-
if ((!weekdays || weekdays.size === 0) && (!days || days.size === 0)) throw new Error("There must be at least one allowed day or weekday.");
|
|
50
|
-
this.seconds = Array.from(seconds).sort((a, b) => a - b);
|
|
51
|
-
this.minutes = Array.from(minutes).sort((a, b) => a - b);
|
|
52
|
-
this.hours = Array.from(hours).sort((a, b) => a - b);
|
|
53
|
-
this.days = Array.from(days).sort((a, b) => a - b);
|
|
54
|
-
this.months = Array.from(months).sort((a, b) => a - b);
|
|
55
|
-
this.weekdays = Array.from(weekdays).sort((a, b) => a - b);
|
|
56
|
-
const validateData = (name, data, constraint) => {
|
|
57
|
-
if (data.some((x) => typeof x !== "number" || x % 1 !== 0 || x < constraint.min || x > constraint.max)) throw new Error(`${name} must only consist of integers which are within the range of ${constraint.min} and ${constraint.max}`);
|
|
58
|
-
};
|
|
59
|
-
validateData("seconds", this.seconds, {
|
|
60
|
-
min: 0,
|
|
61
|
-
max: 59
|
|
62
|
-
});
|
|
63
|
-
validateData("minutes", this.minutes, {
|
|
64
|
-
min: 0,
|
|
65
|
-
max: 59
|
|
66
|
-
});
|
|
67
|
-
validateData("hours", this.hours, {
|
|
68
|
-
min: 0,
|
|
69
|
-
max: 23
|
|
70
|
-
});
|
|
71
|
-
validateData("days", this.days, {
|
|
72
|
-
min: 1,
|
|
73
|
-
max: 31
|
|
74
|
-
});
|
|
75
|
-
validateData("months", this.months, {
|
|
76
|
-
min: 0,
|
|
77
|
-
max: 11
|
|
78
|
-
});
|
|
79
|
-
validateData("weekdays", this.weekdays, {
|
|
80
|
-
min: 0,
|
|
81
|
-
max: 6
|
|
82
|
-
});
|
|
83
|
-
this.reversed = {
|
|
84
|
-
seconds: this.seconds.map((x) => x).reverse(),
|
|
85
|
-
minutes: this.minutes.map((x) => x).reverse(),
|
|
86
|
-
hours: this.hours.map((x) => x).reverse(),
|
|
87
|
-
days: this.days.map((x) => x).reverse(),
|
|
88
|
-
months: this.months.map((x) => x).reverse(),
|
|
89
|
-
weekdays: this.weekdays.map((x) => x).reverse()
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Find the next or previous hour, starting from the given start hour that matches the hour constraint.
|
|
94
|
-
* startHour itself might also be allowed.
|
|
95
|
-
*/
|
|
96
|
-
findAllowedHour(dir, startHour) {
|
|
97
|
-
return dir === "next" ? this.hours.find((x) => x >= startHour) : this.reversed.hours.find((x) => x <= startHour);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Find the next or previous minute, starting from the given start minute that matches the minute constraint.
|
|
101
|
-
* startMinute itself might also be allowed.
|
|
102
|
-
*/
|
|
103
|
-
findAllowedMinute(dir, startMinute) {
|
|
104
|
-
return dir === "next" ? this.minutes.find((x) => x >= startMinute) : this.reversed.minutes.find((x) => x <= startMinute);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Find the next or previous second, starting from the given start second that matches the second constraint.
|
|
108
|
-
* startSecond itself IS NOT allowed.
|
|
109
|
-
*/
|
|
110
|
-
findAllowedSecond(dir, startSecond) {
|
|
111
|
-
return dir === "next" ? this.seconds.find((x) => x > startSecond) : this.reversed.seconds.find((x) => x < startSecond);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Find the next or previous time, starting from the given start time that matches the hour, minute
|
|
115
|
-
* and second constraints. startTime itself might also be allowed.
|
|
116
|
-
*/
|
|
117
|
-
findAllowedTime(dir, startTime) {
|
|
118
|
-
let hour = this.findAllowedHour(dir, startTime.hour);
|
|
119
|
-
if (hour !== void 0) if (hour === startTime.hour) {
|
|
120
|
-
let minute = this.findAllowedMinute(dir, startTime.minute);
|
|
121
|
-
if (minute !== void 0) if (minute === startTime.minute) {
|
|
122
|
-
const second = this.findAllowedSecond(dir, startTime.second);
|
|
123
|
-
if (second !== void 0) return {
|
|
124
|
-
hour,
|
|
125
|
-
minute,
|
|
126
|
-
second
|
|
127
|
-
};
|
|
128
|
-
minute = this.findAllowedMinute(dir, dir === "next" ? startTime.minute + 1 : startTime.minute - 1);
|
|
129
|
-
if (minute !== void 0) return {
|
|
130
|
-
hour,
|
|
131
|
-
minute,
|
|
132
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
133
|
-
};
|
|
134
|
-
} else return {
|
|
135
|
-
hour,
|
|
136
|
-
minute,
|
|
137
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
138
|
-
};
|
|
139
|
-
hour = this.findAllowedHour(dir, dir === "next" ? startTime.hour + 1 : startTime.hour - 1);
|
|
140
|
-
if (hour !== void 0) return {
|
|
141
|
-
hour,
|
|
142
|
-
minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
|
|
143
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
144
|
-
};
|
|
145
|
-
} else return {
|
|
146
|
-
hour,
|
|
147
|
-
minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
|
|
148
|
-
second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Find the next or previous day in the given month, starting from the given startDay
|
|
153
|
-
* that matches either the day or the weekday constraint. startDay itself might also be allowed.
|
|
154
|
-
*/
|
|
155
|
-
findAllowedDayInMonth(dir, year, month, startDay) {
|
|
156
|
-
var _a, _b;
|
|
157
|
-
if (startDay < 1) throw new Error("startDay must not be smaller than 1.");
|
|
158
|
-
const daysInMonth = getDaysInMonth(year, month);
|
|
159
|
-
const daysRestricted = this.days.length !== 31;
|
|
160
|
-
const weekdaysRestricted = this.weekdays.length !== 7;
|
|
161
|
-
if (!daysRestricted && !weekdaysRestricted) {
|
|
162
|
-
if (startDay > daysInMonth) return dir === "next" ? void 0 : daysInMonth;
|
|
163
|
-
return startDay;
|
|
164
|
-
}
|
|
165
|
-
let allowedDayByDays;
|
|
166
|
-
if (daysRestricted) {
|
|
167
|
-
allowedDayByDays = dir === "next" ? this.days.find((x) => x >= startDay) : this.reversed.days.find((x) => x <= startDay);
|
|
168
|
-
if (allowedDayByDays !== void 0 && allowedDayByDays > daysInMonth) allowedDayByDays = void 0;
|
|
169
|
-
}
|
|
170
|
-
let allowedDayByWeekdays;
|
|
171
|
-
if (weekdaysRestricted) {
|
|
172
|
-
const startWeekday = new Date(year, month, startDay).getDay();
|
|
173
|
-
const nearestAllowedWeekday = dir === "next" ? (_a = this.weekdays.find((x) => x >= startWeekday)) !== null && _a !== void 0 ? _a : this.weekdays[0] : (_b = this.reversed.weekdays.find((x) => x <= startWeekday)) !== null && _b !== void 0 ? _b : this.reversed.weekdays[0];
|
|
174
|
-
if (nearestAllowedWeekday !== void 0) {
|
|
175
|
-
const daysBetweenWeekdays = dir === "next" ? getDaysBetweenWeekdays(startWeekday, nearestAllowedWeekday) : getDaysBetweenWeekdays(nearestAllowedWeekday, startWeekday);
|
|
176
|
-
allowedDayByWeekdays = dir === "next" ? startDay + daysBetweenWeekdays : startDay - daysBetweenWeekdays;
|
|
177
|
-
if (allowedDayByWeekdays > daysInMonth || allowedDayByWeekdays < 1) allowedDayByWeekdays = void 0;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (allowedDayByDays !== void 0 && allowedDayByWeekdays !== void 0) return dir === "next" ? Math.min(allowedDayByDays, allowedDayByWeekdays) : Math.max(allowedDayByDays, allowedDayByWeekdays);
|
|
181
|
-
if (allowedDayByDays !== void 0) return allowedDayByDays;
|
|
182
|
-
if (allowedDayByWeekdays !== void 0) return allowedDayByWeekdays;
|
|
183
|
-
}
|
|
184
|
-
/** Gets the next date starting from the given start date or now. */
|
|
185
|
-
getNextDate(startDate = /* @__PURE__ */ new Date()) {
|
|
186
|
-
const startDateElements = extractDateElements(startDate);
|
|
187
|
-
let minYear = startDateElements.year;
|
|
188
|
-
let startIndexMonth = this.months.findIndex((x) => x >= startDateElements.month);
|
|
189
|
-
if (startIndexMonth === -1) {
|
|
190
|
-
startIndexMonth = 0;
|
|
191
|
-
minYear++;
|
|
192
|
-
}
|
|
193
|
-
const maxIterations = this.months.length * 5;
|
|
194
|
-
for (let i = 0; i < maxIterations; i++) {
|
|
195
|
-
const year = minYear + Math.floor((startIndexMonth + i) / this.months.length);
|
|
196
|
-
const month = this.months[(startIndexMonth + i) % this.months.length];
|
|
197
|
-
const isStartMonth = year === startDateElements.year && month === startDateElements.month;
|
|
198
|
-
let day = this.findAllowedDayInMonth("next", year, month, isStartMonth ? startDateElements.day : 1);
|
|
199
|
-
let isStartDay = isStartMonth && day === startDateElements.day;
|
|
200
|
-
if (day !== void 0 && isStartDay) {
|
|
201
|
-
const nextTime = this.findAllowedTime("next", startDateElements);
|
|
202
|
-
if (nextTime !== void 0) return new Date(year, month, day, nextTime.hour, nextTime.minute, nextTime.second);
|
|
203
|
-
day = this.findAllowedDayInMonth("next", year, month, day + 1);
|
|
204
|
-
isStartDay = false;
|
|
205
|
-
}
|
|
206
|
-
if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.hours[0], this.minutes[0], this.seconds[0]);
|
|
207
|
-
}
|
|
208
|
-
throw new Error("No valid next date was found.");
|
|
209
|
-
}
|
|
210
|
-
/** Gets the specified amount of future dates starting from the given start date or now. */
|
|
211
|
-
getNextDates(amount, startDate) {
|
|
212
|
-
const dates = [];
|
|
213
|
-
let nextDate;
|
|
214
|
-
for (let i = 0; i < amount; i++) {
|
|
215
|
-
nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
|
|
216
|
-
dates.push(nextDate);
|
|
217
|
-
}
|
|
218
|
-
return dates;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now.
|
|
222
|
-
* The iterator runs until the optional endDate is reached or forever.
|
|
223
|
-
*/
|
|
224
|
-
*getNextDatesIterator(startDate, endDate) {
|
|
225
|
-
let nextDate;
|
|
226
|
-
while (true) {
|
|
227
|
-
nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
|
|
228
|
-
if (endDate && endDate.getTime() < nextDate.getTime()) return;
|
|
229
|
-
yield nextDate;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
/** Gets the previous date starting from the given start date or now. */
|
|
233
|
-
getPrevDate(startDate = /* @__PURE__ */ new Date()) {
|
|
234
|
-
const startDateElements = extractDateElements(startDate);
|
|
235
|
-
let maxYear = startDateElements.year;
|
|
236
|
-
let startIndexMonth = this.reversed.months.findIndex((x) => x <= startDateElements.month);
|
|
237
|
-
if (startIndexMonth === -1) {
|
|
238
|
-
startIndexMonth = 0;
|
|
239
|
-
maxYear--;
|
|
240
|
-
}
|
|
241
|
-
const maxIterations = this.reversed.months.length * 5;
|
|
242
|
-
for (let i = 0; i < maxIterations; i++) {
|
|
243
|
-
const year = maxYear - Math.floor((startIndexMonth + i) / this.reversed.months.length);
|
|
244
|
-
const month = this.reversed.months[(startIndexMonth + i) % this.reversed.months.length];
|
|
245
|
-
const isStartMonth = year === startDateElements.year && month === startDateElements.month;
|
|
246
|
-
let day = this.findAllowedDayInMonth("prev", year, month, isStartMonth ? startDateElements.day : getDaysInMonth(year, month));
|
|
247
|
-
let isStartDay = isStartMonth && day === startDateElements.day;
|
|
248
|
-
if (day !== void 0 && isStartDay) {
|
|
249
|
-
const prevTime = this.findAllowedTime("prev", startDateElements);
|
|
250
|
-
if (prevTime !== void 0) return new Date(year, month, day, prevTime.hour, prevTime.minute, prevTime.second);
|
|
251
|
-
if (day > 1) {
|
|
252
|
-
day = this.findAllowedDayInMonth("prev", year, month, day - 1);
|
|
253
|
-
isStartDay = false;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.reversed.hours[0], this.reversed.minutes[0], this.reversed.seconds[0]);
|
|
257
|
-
}
|
|
258
|
-
throw new Error("No valid previous date was found.");
|
|
259
|
-
}
|
|
260
|
-
/** Gets the specified amount of previous dates starting from the given start date or now. */
|
|
261
|
-
getPrevDates(amount, startDate) {
|
|
262
|
-
const dates = [];
|
|
263
|
-
let prevDate;
|
|
264
|
-
for (let i = 0; i < amount; i++) {
|
|
265
|
-
prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
|
|
266
|
-
dates.push(prevDate);
|
|
267
|
-
}
|
|
268
|
-
return dates;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now.
|
|
272
|
-
* The iterator runs until the optional endDate is reached or forever.
|
|
273
|
-
*/
|
|
274
|
-
*getPrevDatesIterator(startDate, endDate) {
|
|
275
|
-
let prevDate;
|
|
276
|
-
while (true) {
|
|
277
|
-
prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
|
|
278
|
-
if (endDate && endDate.getTime() > prevDate.getTime()) return;
|
|
279
|
-
yield prevDate;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
/** Returns true when there is a cron date at the given date. */
|
|
283
|
-
matchDate(date) {
|
|
284
|
-
const { second, minute, hour, day, month, weekday } = extractDateElements(date);
|
|
285
|
-
if (this.seconds.indexOf(second) === -1 || this.minutes.indexOf(minute) === -1 || this.hours.indexOf(hour) === -1 || this.months.indexOf(month) === -1) return false;
|
|
286
|
-
if (this.days.length !== 31 && this.weekdays.length !== 7) return this.days.indexOf(day) !== -1 || this.weekdays.indexOf(weekday) !== -1;
|
|
287
|
-
return this.days.indexOf(day) !== -1 && this.weekdays.indexOf(weekday) !== -1;
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron-parser.js
|
|
292
|
-
const secondConstraint = {
|
|
293
|
-
min: 0,
|
|
294
|
-
max: 59
|
|
295
|
-
};
|
|
296
|
-
const minuteConstraint = {
|
|
297
|
-
min: 0,
|
|
298
|
-
max: 59
|
|
299
|
-
};
|
|
300
|
-
const hourConstraint = {
|
|
301
|
-
min: 0,
|
|
302
|
-
max: 23
|
|
303
|
-
};
|
|
304
|
-
const dayConstraint = {
|
|
305
|
-
min: 1,
|
|
306
|
-
max: 31
|
|
307
|
-
};
|
|
308
|
-
const monthConstraint = {
|
|
309
|
-
min: 1,
|
|
310
|
-
max: 12,
|
|
311
|
-
aliases: {
|
|
312
|
-
jan: "1",
|
|
313
|
-
feb: "2",
|
|
314
|
-
mar: "3",
|
|
315
|
-
apr: "4",
|
|
316
|
-
may: "5",
|
|
317
|
-
jun: "6",
|
|
318
|
-
jul: "7",
|
|
319
|
-
aug: "8",
|
|
320
|
-
sep: "9",
|
|
321
|
-
oct: "10",
|
|
322
|
-
nov: "11",
|
|
323
|
-
dec: "12"
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
const weekdayConstraint = {
|
|
327
|
-
min: 0,
|
|
328
|
-
max: 7,
|
|
329
|
-
aliases: {
|
|
330
|
-
mon: "1",
|
|
331
|
-
tue: "2",
|
|
332
|
-
wed: "3",
|
|
333
|
-
thu: "4",
|
|
334
|
-
fri: "5",
|
|
335
|
-
sat: "6",
|
|
336
|
-
sun: "7"
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
const timeNicknames = {
|
|
340
|
-
"@yearly": "0 0 1 1 *",
|
|
341
|
-
"@annually": "0 0 1 1 *",
|
|
342
|
-
"@monthly": "0 0 1 * *",
|
|
343
|
-
"@weekly": "0 0 * * 0",
|
|
344
|
-
"@daily": "0 0 * * *",
|
|
345
|
-
"@hourly": "0 * * * *",
|
|
346
|
-
"@minutely": "* * * * *"
|
|
347
|
-
};
|
|
348
|
-
function parseElement(element, constraint) {
|
|
349
|
-
const result = /* @__PURE__ */ new Set();
|
|
350
|
-
if (element === "*") {
|
|
351
|
-
for (let i = constraint.min; i <= constraint.max; i = i + 1) result.add(i);
|
|
352
|
-
return result;
|
|
353
|
-
}
|
|
354
|
-
const listElements = element.split(",");
|
|
355
|
-
if (listElements.length > 1) {
|
|
356
|
-
for (const listElement of listElements) {
|
|
357
|
-
const parsedListElement = parseElement(listElement, constraint);
|
|
358
|
-
for (const x of parsedListElement) result.add(x);
|
|
359
|
-
}
|
|
360
|
-
return result;
|
|
361
|
-
}
|
|
362
|
-
const parseSingleElement = (singleElement) => {
|
|
363
|
-
var _a, _b;
|
|
364
|
-
singleElement = (_b = (_a = constraint.aliases) === null || _a === void 0 ? void 0 : _a[singleElement.toLowerCase()]) !== null && _b !== void 0 ? _b : singleElement;
|
|
365
|
-
const parsedElement = Number.parseInt(singleElement, 10);
|
|
366
|
-
if (Number.isNaN(parsedElement)) throw new Error(`Failed to parse ${element}: ${singleElement} is NaN.`);
|
|
367
|
-
if (parsedElement < constraint.min || parsedElement > constraint.max) throw new Error(`Failed to parse ${element}: ${singleElement} is outside of constraint range of ${constraint.min} - ${constraint.max}.`);
|
|
368
|
-
return parsedElement;
|
|
369
|
-
};
|
|
370
|
-
const rangeSegments = /^(([0-9a-zA-Z]+)-([0-9a-zA-Z]+)|\*)(\/([0-9]+))?$/.exec(element);
|
|
371
|
-
if (rangeSegments === null) {
|
|
372
|
-
result.add(parseSingleElement(element));
|
|
373
|
-
return result;
|
|
374
|
-
}
|
|
375
|
-
let parsedStart = rangeSegments[1] === "*" ? constraint.min : parseSingleElement(rangeSegments[2]);
|
|
376
|
-
const parsedEnd = rangeSegments[1] === "*" ? constraint.max : parseSingleElement(rangeSegments[3]);
|
|
377
|
-
if (constraint === weekdayConstraint && parsedStart === 7 && parsedEnd !== 7) parsedStart = 0;
|
|
378
|
-
if (parsedStart > parsedEnd) throw new Error(`Failed to parse ${element}: Invalid range (start: ${parsedStart}, end: ${parsedEnd}).`);
|
|
379
|
-
const step = rangeSegments[5];
|
|
380
|
-
let parsedStep = 1;
|
|
381
|
-
if (step !== void 0) {
|
|
382
|
-
parsedStep = Number.parseInt(step, 10);
|
|
383
|
-
if (Number.isNaN(parsedStep)) throw new Error(`Failed to parse step: ${step} is NaN.`);
|
|
384
|
-
if (parsedStep < 1) throw new Error(`Failed to parse step: Expected ${step} to be greater than 0.`);
|
|
385
|
-
}
|
|
386
|
-
for (let i = parsedStart; i <= parsedEnd; i = i + parsedStep) result.add(i);
|
|
387
|
-
return result;
|
|
388
|
-
}
|
|
389
|
-
/** Parses a cron expression into a Cron instance. */
|
|
390
|
-
function parseCronExpression(cronExpression) {
|
|
391
|
-
var _a;
|
|
392
|
-
if (typeof cronExpression !== "string") throw new TypeError("Invalid cron expression: must be of type string.");
|
|
393
|
-
cronExpression = (_a = timeNicknames[cronExpression.toLowerCase()]) !== null && _a !== void 0 ? _a : cronExpression;
|
|
394
|
-
const elements = cronExpression.split(" ").filter((elem) => elem.length > 0);
|
|
395
|
-
if (elements.length < 5 || elements.length > 6) throw new Error("Invalid cron expression: expected 5 or 6 elements.");
|
|
396
|
-
const rawSeconds = elements.length === 6 ? elements[0] : "0";
|
|
397
|
-
const rawMinutes = elements.length === 6 ? elements[1] : elements[0];
|
|
398
|
-
const rawHours = elements.length === 6 ? elements[2] : elements[1];
|
|
399
|
-
const rawDays = elements.length === 6 ? elements[3] : elements[2];
|
|
400
|
-
const rawMonths = elements.length === 6 ? elements[4] : elements[3];
|
|
401
|
-
const rawWeekdays = elements.length === 6 ? elements[5] : elements[4];
|
|
402
|
-
return new Cron({
|
|
403
|
-
seconds: parseElement(rawSeconds, secondConstraint),
|
|
404
|
-
minutes: parseElement(rawMinutes, minuteConstraint),
|
|
405
|
-
hours: parseElement(rawHours, hourConstraint),
|
|
406
|
-
days: parseElement(rawDays, dayConstraint),
|
|
407
|
-
months: new Set(Array.from(parseElement(rawMonths, monthConstraint)).map((x) => x - 1)),
|
|
408
|
-
weekdays: new Set(Array.from(parseElement(rawWeekdays, weekdayConstraint)).map((x) => x % 7))
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
//#endregion
|
|
412
23
|
//#region ../../packages/core/src/shared/schedule.ts
|
|
413
24
|
/**
|
|
414
25
|
* shared/schedule.ts
|