@keystrokehq/cli 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- 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-LtoIcJGY.mjs → agents-CWGz8CR-.mjs} +6 -6
- package/dist/{api-DuKKdCpF.mjs → api-jkf0TTgD.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-qebrtraZ-D4SQNsBw.mjs → build-metadata-C8Ra_Gi--CTCBRjFA.mjs} +7 -7
- package/dist/{build-progress-CITED2tv.mjs → build-progress-BZivcVz4.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-CV4tBo6S-B4SPp86e.mjs} +7 -7
- package/dist/{build.handler-BZnLQt0_.mjs → build.handler-DqnngAkl.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-CS6sqNfA.mjs} +2 -2
- package/dist/{connect.handler-ToY6qmMz.mjs → connect.handler-DRO05ak3.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-1CPFwx-k.mjs} +6 -6
- package/dist/cron-parser-C2eJD0yD.mjs +393 -0
- package/dist/{current-deployment-workflow-zTmYbUjh.mjs → current-deployment-workflow-CUBHcdZl.mjs} +5 -5
- 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-DdMP-YaQ.mjs → deploy-DwRwyVwR.mjs} +2 -2
- package/dist/{deploy-progress-CLO-yidq.mjs → deploy-progress-DJHph1Fz.mjs} +1 -1
- package/dist/{deploy.handler-Bag7rBG-.mjs → deploy.handler-zMb-BHLo.mjs} +16 -16
- package/dist/{detect-env-access-CwkOYeYM-EmkYvbfJ.mjs → detect-env-access-CwkOYeYM-BLtKepjx.mjs} +1 -1
- package/dist/{diff.handler-Brgc-Ccl.mjs → diff.handler-C-XqswH5.mjs} +3 -3
- package/dist/{dist-BMkNN03r.mjs → dist-FQYQ2FLm.mjs} +8 -8
- package/dist/{env.handler-DFKzjIQT.mjs → env.handler-DK3B7MLl.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--8x5SLum-DaUNACER.mjs} +819 -36
- package/dist/{init-DhnABm3J.mjs → init-QhRFud0x.mjs} +2 -2
- package/dist/{init.handler-QgehN8B4.mjs → init.handler-Beu-vpIu.mjs} +42 -11
- package/dist/{inspect.handler-CMOFOb4G.mjs → inspect.handler-ULT2jiVU.mjs} +3 -3
- package/dist/{integration-catalog-BRrJIAVz.mjs → integration-catalog-BgT4mLzW.mjs} +1 -1
- package/dist/{integrations-7-U7nmkh.mjs → integrations-6BiywCph.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-D-YFoKLU.mjs} +5 -5
- package/dist/{list.handler-BrTW2viq.mjs → list.handler-U9-KuVlh.mjs} +1 -1
- package/dist/{list.handler-uzC77oIy.mjs → list2.handler-L3BKR5ok.mjs} +4 -4
- package/dist/{listen-DckJq0y0.mjs → listen-Tx2SrMyo.mjs} +2 -2
- package/dist/{listen.handler-Bf5MXKPO.mjs → listen.handler-C7AqsKLf.mjs} +2 -2
- package/dist/{logs-D_l5BIn2.mjs → logs-NI-DyeFY.mjs} +3 -3
- package/dist/{logs.handler-kYO3Uv9t.mjs → logs.handler-BGJU1p3H.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/{metadata-layout-C6ed-9dl-EF5pCtIH.mjs → metadata-layout-Bv-B0nHj-CqlcZz_g.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-9ND-i2EN.mjs} +1 -1
- package/dist/{project-config-CJGSh2RQ.mjs → project-config-CsBMT4TL.mjs} +1 -13
- package/dist/{projects-CYqeKQGT.mjs → projects-B5MRnbHS.mjs} +4 -4
- package/dist/{projects-CWLOF5x4.mjs → projects-DfaG_3WP.mjs} +1 -1
- package/dist/{requirements.handler-CnDTBcH5.mjs → requirements.handler-D5dFi7XZ.mjs} +5 -5
- package/dist/{resolve-project-bVPMcs-y.mjs → resolve-project-CURYMjex.mjs} +1 -1
- package/dist/{run-polling-Cb4ssXIE.mjs → run-polling-B4KvySvp.mjs} +1 -1
- package/dist/{run-polling-49w3PYAv.mjs → run-polling-BwyyKDwg.mjs} +3 -3
- package/dist/{run.handler-Bma88649.mjs → run.handler-TJNyF_p_.mjs} +5 -5
- package/dist/{runs-HJejvQnQ.mjs → runs-Bs8VzL8P.mjs} +2 -2
- package/dist/{schema-display-CyCWSgfY.mjs → schema-display-CNqiYBIb.mjs} +4 -4
- 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-DTnwNwKq-DoBxUDCg.mjs → source-analysis-BBg2E_6G-BQqm16RR.mjs} +4 -4
- package/dist/{spinner-progress-CS1BEdNB.mjs → spinner-progress-DfkMzwGx.mjs} +1 -1
- package/dist/spinner-worker.d.mts +3 -0
- package/dist/spinner-worker.mjs +203 -0
- 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-Bi2M_TUK.mjs → sync-BZj7Dkhq.mjs} +2 -2
- package/dist/{sync.handler-D6YFuVlq.mjs → sync.handler-Kk4R2lJ_.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 +5 -5
- package/dist/test-CJ8Vx_h5.mjs +74 -0
- package/dist/{try-deploy.handler-BMcWQVST.mjs → test.handler-BTn4NFmU.mjs} +15 -17
- package/dist/{test.handler-St9sBXyH.mjs → test.handler-Dk3CmTa7.mjs} +1 -1
- package/dist/{test-Ctjy8mwC.mjs → tool.handler-CuxoCstV.mjs} +65 -93
- package/dist/{trigger-artifacts-RizI57RC-C-yCtEi-.mjs → trigger-artifacts-RizI57RC-abdkW8-z.mjs} +3 -3
- package/dist/{upgrade-YavAf8AC.mjs → upgrade-CdA_Sw4F.mjs} +1 -1
- package/dist/{upload.handler-DemogvI1.mjs → upload.handler-CpKuAaQ_.mjs} +8 -8
- 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-VC0Vl_pm.mjs} +2 -2
- package/dist/{validate.handler-DSAvNgns.mjs → validate.handler-COJ53qWJ.mjs} +3 -3
- package/dist/{workflow-build-Cmu1TOFu.mjs → workflow-build-kNNcU-R8.mjs} +18 -18
- package/dist/{workflow-bundler-BzHk73PM-UJQa7Ubk.mjs → workflow-bundler-BzHk73PM-CRcJvu9a.mjs} +2 -2
- package/dist/{workflows-DTlypo2t.mjs → workflows-D04CqpO-.mjs} +56 -18
- package/dist/{writer-CtvttJdP-BfNsrheU.mjs → writer-B-SpZ0G2-olEAgSLc.mjs} +8 -8
- package/package.json +8 -8
- package/dist/options-DFPs-tAB.mjs +0 -43
- /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-CXkZEsXI.mjs} +0 -0
- /package/dist/{logs.handler-DxSKmDCq.mjs → logs.handler-BqmZ4eLx.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/{rolldown-runtime-twds-ZHy-3DMm_Sby.mjs → rolldown-runtime-twds-ZHy-CO5ir_za.mjs} +0 -0
- /package/dist/{schema-DFJiNWyd.mjs → schema-O9xTWad_.mjs} +0 -0
- /package/dist/{skills.handler-C_4VzVmc.mjs → skills.handler-CPKCf9ZK.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/{upload-C0kaZu08.mjs → upload-wwSPAC5_.mjs} +0 -0
|
@@ -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-Kk4R2lJ_.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-FQYQ2FLm.mjs";
|
|
7
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CURYMjex.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-kNNcU-R8.mjs";
|
|
9
|
+
import { t as createBuildProgress } from "./build-progress-BZivcVz4.mjs";
|
|
10
|
+
import { t as createDeployProgress } from "./deploy-progress-DJHph1Fz.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-
|
|
3
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-COvwpok_.mjs";
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
@@ -109,7 +109,7 @@ async function buildTaskTargetFile(options) {
|
|
|
109
109
|
return builtTasks;
|
|
110
110
|
}
|
|
111
111
|
async function bundleTaskTargetModule(options) {
|
|
112
|
-
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-
|
|
112
|
+
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-BLtKepjx.mjs").then((n) => n.n).then((n) => n.n)]);
|
|
113
113
|
const entryId = "\0virtual:task-target-entry";
|
|
114
114
|
const trackedDependencies = /* @__PURE__ */ new Set();
|
|
115
115
|
const envViolations = [];
|
|
@@ -216,7 +216,7 @@ async function attachTaskTargetTriggers(options) {
|
|
|
216
216
|
options.artifact.triggers.push(...buildTaskTriggerArtifactsWithoutBundles(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName));
|
|
217
217
|
return [];
|
|
218
218
|
}
|
|
219
|
-
const { buildTriggerArtifacts } = await import("./trigger-artifacts-RizI57RC-
|
|
219
|
+
const { buildTriggerArtifacts } = await import("./trigger-artifacts-RizI57RC-abdkW8-z.mjs").then((n) => n.n);
|
|
220
220
|
const triggerResult = await buildTriggerArtifacts(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName, options.projectRoot, {
|
|
221
221
|
workflowExportName: options.entry.source.localExportName,
|
|
222
222
|
workflowFilePath: options.entry.runtimeBundlePath
|
|
@@ -319,7 +319,7 @@ function createPreparedTaskTarget(artifact, triggers) {
|
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
async function tryParseTaskBuildManifest(manifest) {
|
|
322
|
-
const { TaskBuildManifestSchema } = await import("./task-
|
|
322
|
+
const { TaskBuildManifestSchema } = await import("./task-BNXDZU71.mjs").then((n) => n.t);
|
|
323
323
|
const result = TaskBuildManifestSchema.safeParse(manifest);
|
|
324
324
|
return result.success ? result.data : null;
|
|
325
325
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import "./default-urls-BS4twrsS.mjs";
|
|
4
4
|
import { l as resolveAuthOptions } from "./dist-BF6r1hfv.mjs";
|
|
5
|
-
import { n as findProjectRoot, t as assertWorkflowProjectRoot } from "./project-config-
|
|
5
|
+
import { n as findProjectRoot, t as assertWorkflowProjectRoot } from "./project-config-CsBMT4TL.mjs";
|
|
6
6
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { spawnSync } from "node:child_process";
|
|
@@ -116,7 +116,7 @@ function restartStage(options, projectRoot, stage) {
|
|
|
116
116
|
}
|
|
117
117
|
async function runBuildPhase(options, projectRoot) {
|
|
118
118
|
const projectConfig = await assertWorkflowProjectRoot(projectRoot);
|
|
119
|
-
const { buildTaskTargetEntries } = await import("./task-target-build-
|
|
119
|
+
const { buildTaskTargetEntries } = await import("./task-target-build-Du0ObGbb.mjs");
|
|
120
120
|
await writeBuildDescriptor(projectRoot, {
|
|
121
121
|
projectRoot,
|
|
122
122
|
projectConfig,
|
|
@@ -129,7 +129,7 @@ async function runBuildPhase(options, projectRoot) {
|
|
|
129
129
|
}
|
|
130
130
|
async function runPreparePhase(projectRoot) {
|
|
131
131
|
const buildDescriptor = await readBuildDescriptor(projectRoot);
|
|
132
|
-
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-
|
|
132
|
+
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-Du0ObGbb.mjs");
|
|
133
133
|
const prepareResult = await prepareTaskTargetBuiltTasks({
|
|
134
134
|
builtTasks: buildDescriptor.builtTasks,
|
|
135
135
|
projectRoot
|
|
@@ -158,11 +158,11 @@ async function resolveDeployAuthOptions(options) {
|
|
|
158
158
|
}
|
|
159
159
|
async function runDeployPhase(options, projectRoot) {
|
|
160
160
|
const descriptor = await readDescriptor(projectRoot);
|
|
161
|
-
const { createDeployClient } = await import("./deploy-
|
|
161
|
+
const { createDeployClient } = await import("./deploy-D4ILrWpx.mjs");
|
|
162
162
|
const client = createDeployClient(await resolveDeployAuthOptions(options));
|
|
163
163
|
const auth = await client.public.auth.validate();
|
|
164
164
|
if (auth.organizationId !== descriptor.projectConfig.organizationId) throw new Error(`Project organization mismatch: config=${descriptor.projectConfig.organizationId} auth=${auth.organizationId}`);
|
|
165
|
-
const { deployTaskTargets } = await import("./task-target-deploy-
|
|
165
|
+
const { deployTaskTargets } = await import("./task-target-deploy-OyxLvh3a.mjs");
|
|
166
166
|
const result = await deployTaskTargets({
|
|
167
167
|
preparedTasks: descriptor.preparedTasks,
|
|
168
168
|
client,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { n as ui } from "./keystroke.mjs";
|
|
4
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-CGdYhH0p.mjs";
|
|
5
|
+
import { t as createTypedCommand } from "./commander-i-7LgOyc.mjs";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
//#region src/commands/test/test.command.ts
|
|
8
|
+
const TestOptionsSchema = JsonOptionSchema;
|
|
9
|
+
const TestToolOptionsSchema = JsonOptionSchema.extend({
|
|
10
|
+
toolName: z.string().min(1),
|
|
11
|
+
agent: z.string().min(1).optional(),
|
|
12
|
+
input: z.string().optional(),
|
|
13
|
+
inputFile: z.string().optional(),
|
|
14
|
+
path: z.string().optional(),
|
|
15
|
+
timeout: z.coerce.number().int().min(1).default(120),
|
|
16
|
+
verbose: z.boolean().default(false)
|
|
17
|
+
});
|
|
18
|
+
const TEST_OPTIONS_CONFIG = { ...JSON_OPTION_CONFIG };
|
|
19
|
+
const TEST_TOOL_OPTIONS_CONFIG = {
|
|
20
|
+
...JSON_OPTION_CONFIG,
|
|
21
|
+
agent: {
|
|
22
|
+
flag: "--agent <agentId>",
|
|
23
|
+
description: "Authored agent id, agent id, or agent name containing the tool"
|
|
24
|
+
},
|
|
25
|
+
input: {
|
|
26
|
+
flag: "--input <json>",
|
|
27
|
+
description: "Tool input as inline JSON string"
|
|
28
|
+
},
|
|
29
|
+
inputFile: {
|
|
30
|
+
flag: "--input-file <path>",
|
|
31
|
+
description: "Path to a JSON file containing tool input"
|
|
32
|
+
},
|
|
33
|
+
path: {
|
|
34
|
+
flag: "--path <dir>",
|
|
35
|
+
description: "Path to project root (directory containing keystroke.config.ts); auto-discovered from CWD if omitted"
|
|
36
|
+
},
|
|
37
|
+
timeout: {
|
|
38
|
+
flag: "--timeout <seconds>",
|
|
39
|
+
description: "Max seconds to wait for workflow completion (default: 120)"
|
|
40
|
+
},
|
|
41
|
+
verbose: {
|
|
42
|
+
flag: "--verbose",
|
|
43
|
+
description: "Show detailed execution logs while polling workflow tools"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function handleTestHelp() {
|
|
47
|
+
ui.hint("Use `keystroke test tool <toolName> --input='{...}'`. To test workflows, use `keystroke workflows test <workflow>`.");
|
|
48
|
+
}
|
|
49
|
+
function createTestCommand() {
|
|
50
|
+
const cmd = createTypedCommand({
|
|
51
|
+
name: "test",
|
|
52
|
+
description: "Test agent-callable tools",
|
|
53
|
+
schema: TestOptionsSchema,
|
|
54
|
+
optionsConfig: TEST_OPTIONS_CONFIG,
|
|
55
|
+
handler: handleTestHelp,
|
|
56
|
+
subcommands: [createTypedCommand({
|
|
57
|
+
name: "tool",
|
|
58
|
+
description: "Test an agent-callable tool from a built agent manifest",
|
|
59
|
+
schema: TestToolOptionsSchema,
|
|
60
|
+
optionsConfig: TEST_TOOL_OPTIONS_CONFIG,
|
|
61
|
+
argument: {
|
|
62
|
+
name: "toolName",
|
|
63
|
+
description: "Agent tool name from the built manifest",
|
|
64
|
+
key: "toolName"
|
|
65
|
+
},
|
|
66
|
+
loadHandler: async () => (await import("./tool.handler-CuxoCstV.mjs")).handleTestTool
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
cmd.enablePositionalOptions();
|
|
70
|
+
cmd.passThroughOptions();
|
|
71
|
+
return cmd;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { createTestCommand };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
3
|
import { k as CliExitError, n as ui, o as isLocalMode, x as toErrorMessage } from "./keystroke.mjs";
|
|
5
4
|
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
6
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
7
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
8
|
-
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-
|
|
9
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
10
|
-
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-
|
|
11
|
-
import { r as isUnknownSchema } from "./schema-display-
|
|
12
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
13
|
-
import { t as withErrorBoundary } from "./error-boundary-
|
|
14
|
-
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-
|
|
5
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-CsBMT4TL.mjs";
|
|
6
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-B1L8pZsH.mjs";
|
|
7
|
+
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-FQYQ2FLm.mjs";
|
|
8
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CURYMjex.mjs";
|
|
9
|
+
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-kNNcU-R8.mjs";
|
|
10
|
+
import { r as isUnknownSchema } from "./schema-display-CNqiYBIb.mjs";
|
|
11
|
+
import { t as createBuildProgress } from "./build-progress-BZivcVz4.mjs";
|
|
12
|
+
import { t as withErrorBoundary } from "./error-boundary-CyLcinp1.mjs";
|
|
13
|
+
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-BwyyKDwg.mjs";
|
|
15
14
|
//#region src/lib/format.ts
|
|
16
15
|
function formatBytes(bytes) {
|
|
17
16
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -83,10 +82,9 @@ function renderRunCompletionSuccessMessage(builds, elapsedSeconds) {
|
|
|
83
82
|
else ui.success(`Workflow completed in ${elapsedSeconds}s`);
|
|
84
83
|
}
|
|
85
84
|
//#endregion
|
|
86
|
-
//#region src/commands/workflows/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return withErrorBoundary("Try-deploy", async () => {
|
|
85
|
+
//#region src/commands/workflows/test.handler.ts
|
|
86
|
+
async function handleWorkflowsTest(options, ctx) {
|
|
87
|
+
return withErrorBoundary("Workflow test", async () => {
|
|
90
88
|
const client = requireClient(ctx);
|
|
91
89
|
const startTime = Date.now();
|
|
92
90
|
const local = isLocalMode();
|
|
@@ -103,7 +101,7 @@ async function handleWorkflowsTryDeploy(options, ctx) {
|
|
|
103
101
|
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
104
102
|
await assertProjectConfigMatchesAuthenticatedOrg(client, projectConfig);
|
|
105
103
|
for (const [i, build] of builds.entries()) {
|
|
106
|
-
if (builds.length > 1) ui.header(`
|
|
104
|
+
if (builds.length > 1) ui.header(`Testing "${build.name}" (${i + 1}/${builds.length})...`);
|
|
107
105
|
let storagePath;
|
|
108
106
|
if (local) {
|
|
109
107
|
storagePath = build.bundlePath;
|
|
@@ -114,7 +112,7 @@ async function handleWorkflowsTryDeploy(options, ctx) {
|
|
|
114
112
|
storagePaths.push(storagePath);
|
|
115
113
|
ui.success("Upload complete");
|
|
116
114
|
}
|
|
117
|
-
ui.header("
|
|
115
|
+
ui.header("Testing workflow...");
|
|
118
116
|
const { runId } = await client.workflows.testById({
|
|
119
117
|
workflowName: build.name,
|
|
120
118
|
storagePath,
|
|
@@ -166,4 +164,4 @@ async function handleWorkflowsTryDeploy(options, ctx) {
|
|
|
166
164
|
}, { json: ctx.jsonMode });
|
|
167
165
|
}
|
|
168
166
|
//#endregion
|
|
169
|
-
export {
|
|
167
|
+
export { handleWorkflowsTest };
|