@keystrokehq/cli 0.0.16 → 0.0.18
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-BPwp_UAE.mjs → accept.handler-B7QzdKCh.mjs} +4 -4
- package/dist/{admin-Bb9Hx-gO.mjs → admin-CYpulx_A.mjs} +11 -11
- package/dist/{agents-CbmvvOAx.mjs → agents-Co6Jy_N8.mjs} +10 -10
- package/dist/{api-jkf0TTgD.mjs → api-DsK8M-ZH.mjs} +1 -1
- package/dist/{api-keys-DJlyIf10.mjs → api-keys-BUCLzRv_.mjs} +6 -6
- package/dist/{auth-DpDEkJz7.mjs → auth-niNm-yNT.mjs} +12 -7
- package/dist/{auth.handler-u3qmoUX0.mjs → auth.handler-BTH-Qb00.mjs} +59 -26
- package/dist/{build-agents-DseUtzd4-VYWtIZy9.mjs → build-agents-DseUtzd4-CthuIecx.mjs} +6 -6
- package/dist/{build-metadata-C8Ra_Gi--BdoyLQMl.mjs → build-metadata-C8Ra_Gi--L3l8w0rh.mjs} +7 -7
- package/dist/{build-progress-BZivcVz4.mjs → build-progress-AR8xow4_.mjs} +2 -2
- package/dist/{build-tasks-GVuMLS0h-p08mMOyK.mjs → build-tasks-GVuMLS0h-CCxCqd02.mjs} +3 -3
- package/dist/{build-workflows-CV4tBo6S-knCnBKTc.mjs → build-workflows-CV4tBo6S-DhFBlp6m.mjs} +10 -10
- package/dist/{build.handler-BNSC_zhQ.mjs → build.handler-BmlXPhed.mjs} +7 -7
- package/dist/{clear-cache.handler-gr5VmEYB.mjs → clear-cache.handler-CTLQ1PIN.mjs} +3 -3
- package/dist/clear.handler-BDlwBzX4.mjs +68 -0
- package/dist/{clear.handler-CtOZ4aRn.mjs → clear.handler-C_pXAeBG.mjs} +3 -2
- package/dist/{commander-D15UZVjp.mjs → commander-BE37hxR3.mjs} +4 -4
- package/dist/{connect-DzSNDSmI.mjs → connect-C9NMD8Ky.mjs} +3 -3
- package/dist/{connect.handler-DRO05ak3.mjs → connect.handler-C7kysvhz.mjs} +5 -5
- package/dist/{context-B1L8pZsH.mjs → context-Bid-Rqj7.mjs} +49 -17
- package/dist/{create.handler-DF1Ye4nr.mjs → create.handler-Cp9CV6SN.mjs} +3 -3
- package/dist/{credential-env-map-B2nVJXPn.mjs → credential-env-map-BA4LNI7x.mjs} +6 -5
- package/dist/{credential-requirements-FtBk5JVB.mjs → credential-requirements-DrrQ9x9P.mjs} +3 -3
- package/dist/{credential-schema-mismatch-CfyBUMPS.mjs → credential-schema-mismatch-z74ud-YZ.mjs} +1 -1
- package/dist/{credentials-CiOwDS5y.mjs → credentials-DUkVbhvj.mjs} +1 -1
- package/dist/{credentials-VidBoOd7.mjs → credentials-fMfKVlEn.mjs} +7 -7
- package/dist/{current-deployment-workflow-BRUEdPrN.mjs → current-deployment-workflow-DiwUcKoB.mjs} +6 -6
- package/dist/{current.handler-QZQ-l84v.mjs → current.handler-eCR4nClu.mjs} +3 -3
- package/dist/{delete.handler-Bude0SVP.mjs → delete.handler-D4ElSAcr.mjs} +2 -2
- package/dist/{deploy-eshEEiP-.mjs → deploy-B7LRWcp6.mjs} +2 -2
- package/dist/{deploy-CJbVB7e2.mjs → deploy-DyZh--f7.mjs} +1 -1
- package/dist/{deploy-progress-DJHph1Fz.mjs → deploy-progress-DK87VKJ-.mjs} +2 -2
- package/dist/{deploy.handler-BxxWI7nV.mjs → deploy.handler-DVnH-Niv.mjs} +20 -20
- package/dist/{detect-env-access-CwkOYeYM-CZIixHeR.mjs → detect-env-access-CwkOYeYM-CNTyUzme.mjs} +1 -1
- package/dist/{diff-utils-4OQTpP5s.mjs → diff-utils-B0ED-Igv.mjs} +1 -1
- package/dist/{diff.handler-CzrKCj7N.mjs → diff.handler-lIA2pRBX.mjs} +7 -7
- package/dist/dist-CIInPRGh.mjs +1071 -0
- package/dist/{dist-FQYQ2FLm.mjs → dist-WFPTDQB3.mjs} +15 -15
- package/dist/{env.handler-B3YDQIVE.mjs → env.handler-BIzQLlmo.mjs} +10 -10
- package/dist/{error-boundary-CyLcinp1.mjs → error-boundary-B8cmSwJH.mjs} +3 -3
- package/dist/{file-metadata-DaPPpiTh.mjs → file-metadata-lrX05iRt.mjs} +1 -1
- package/dist/{iam-command-utils-ByLX0A-V.mjs → iam-command-utils-CSZj4XlH.mjs} +2 -2
- package/dist/{import-module--8x5SLum-DaUNACER.mjs → import-module--8x5SLum-D7EiPjwl.mjs} +6 -6
- package/dist/{init-PTwX63_P.mjs → init-jaqNLGmB.mjs} +3 -3
- package/dist/{init.handler-CdytFiFt.mjs → init.handler-DamvbPEw.mjs} +11 -9
- package/dist/{inspect.handler-umc7of-r.mjs → inspect.handler-_UcN7dxE.mjs} +8 -8
- package/dist/{integration-catalog-BgT4mLzW.mjs → integration-catalog-m8tj_XlD.mjs} +3 -3
- package/dist/{integrations-B0Gv-L0s.mjs → integrations-DRL3JmC8.mjs} +12 -7
- package/dist/{invites-Cqi7iyIN.mjs → invites-VntHNMYk.mjs} +5 -5
- package/dist/{invites.list.handler-CErgY35S.mjs → invites.list.handler-CPl4QHfc.mjs} +4 -4
- package/dist/{invites.resend.handler-DRCRIA4F.mjs → invites.resend.handler-BAtb3AX4.mjs} +4 -4
- package/dist/{invites.revoke.handler-C0FZdAR0.mjs → invites.revoke.handler-qXOF1Vgx.mjs} +4 -4
- package/dist/keystroke.mjs +558 -207
- package/dist/{list-enrichment-C6u5eI0j.mjs → list-enrichment-DYvr3XDb.mjs} +3 -3
- package/dist/{list.handler-c-8RpgB9.mjs → list.handler-BLkQKiV1.mjs} +17 -16
- package/dist/{list.handler-CBEXiTAK.mjs → list.handler-BdRsjRlf.mjs} +3 -3
- package/dist/{list.handler-BjutlIkE.mjs → list.handler-CEjKSezx.mjs} +59 -13
- package/dist/{list2.handler-T5v4EK20.mjs → list.handler-CJUFdmaU.mjs} +7 -7
- package/dist/{list.handler-Cr_DFAae.mjs → list.handler-C_iBLBmS.mjs} +3 -3
- package/dist/{list.handler-FlchXrKz.mjs → list.handler-DUz1bJ4x.mjs} +4 -4
- package/dist/{list.handler-D-YFoKLU.mjs → list.handler-pHnPFep8.mjs} +7 -7
- package/dist/{listen-rHLiCWbn.mjs → listen-DLGZEQRL.mjs} +3 -3
- package/dist/{listen.handler-B9T58yAj.mjs → listen.handler-kaAvYk-B.mjs} +4 -4
- package/dist/logs-CcYqFKRU.mjs +58 -0
- package/dist/logs.handler-DyRoevtO.mjs +53 -0
- package/dist/{logs.handler-DGcGN2qb.mjs → logs.handler-lboRKNoE.mjs} +4 -4
- package/dist/{members.add.handler-DmYI43rZ.mjs → members.add.handler-DBydP0SR.mjs} +4 -4
- package/dist/{members.invite.handler-B_KVxv5m.mjs → members.invite.handler-D4-7fiYC.mjs} +4 -4
- package/dist/{members.list.handler-BtuuIgQS.mjs → members.list.handler-Z4cIbcNg.mjs} +4 -4
- package/dist/{members.remove.handler-Lvg-CqVv.mjs → members.remove.handler-J56D83O7.mjs} +4 -4
- package/dist/{members.update.handler-D-8izeso.mjs → members.update.handler-B5rBv6dt.mjs} +4 -4
- package/dist/{normalize-path-CojS-CgQ-DFTvyA27.mjs → normalize-path-CojS-CgQ-D4wSBHgG.mjs} +1 -1
- package/dist/{org-DUCts2MV.mjs → org-DGS91uc-.mjs} +17 -17
- package/dist/{orgs.create.handler-vXQgDJZ_.mjs → orgs.create.handler-B4naNUSN.mjs} +4 -4
- package/dist/{orgs.get.handler-D_Jfl18x.mjs → orgs.get.handler-Ci_JrT08.mjs} +4 -4
- package/dist/{orgs.list.handler-BNjoTJvV.mjs → orgs.list.handler-CJ2byIEj.mjs} +4 -4
- package/dist/{output-CGdYhH0p.mjs → output-BWcVRt-T.mjs} +1 -1
- package/dist/paths-JzzFkXQA-CEipIeVl.mjs +36 -0
- package/dist/{paused.handler-ST9dCe8E.mjs → paused.handler-BQSQvQhB.mjs} +3 -3
- package/dist/{projects-CbquwUlm.mjs → projects-D90_uEC2.mjs} +5 -5
- package/dist/{projects-DfaG_3WP.mjs → projects-fWvIJQ80.mjs} +1 -1
- package/dist/{register.handler-BAx0IC-u.mjs → register.handler-CleQJhtQ.mjs} +2 -2
- package/dist/{requirements.handler-D5dFi7XZ.mjs → requirements.handler-B51sxQSy.mjs} +7 -7
- package/dist/resolve-cli-credentials-DytxgMwn.mjs +47 -0
- package/dist/{resolve-project-CURYMjex.mjs → resolve-project-CNQtOWE4.mjs} +7 -7
- package/dist/{run-polling-BWcLQvm0.mjs → run-polling-CC6y2XXI.mjs} +5 -5
- package/dist/{run.handler-BiBDLoeH.mjs → run.handler-B31BpZJP.mjs} +9 -9
- package/dist/{runs-Bc3zjk7V.mjs → runs-Bg_qDeQi.mjs} +4 -4
- package/dist/{skill-installer-DkRJ6oLi.mjs → skill-installer-BBgN2tzW.mjs} +2 -2
- package/dist/{skills-sync.handler-C4ztv1Vu.mjs → skills-sync.handler-DOxudKmV.mjs} +3 -3
- package/dist/{skills.command-DuL4kLUi.mjs → skills.command-JwKWpGvU.mjs} +5 -5
- package/dist/{skills.handler-R5KAbioE.mjs → skills.handler-Do9I3dQS.mjs} +1 -1
- package/dist/{source-analysis-BBg2E_6G-BQqm16RR.mjs → source-analysis-BBg2E_6G-Ut7kYHOz.mjs} +4 -4
- package/dist/{spinner-progress-DfkMzwGx.mjs → spinner-progress-Bx-fYItP.mjs} +1 -1
- package/dist/{src-BQdOWkyv.mjs → src-B0tNjKMg.mjs} +1 -1
- package/dist/{status.handler-DxCJRm1n.mjs → status.handler-BsVtDW_V.mjs} +19 -4
- package/dist/{switch.handler-CTwhIcaQ.mjs → switch.handler-Cu81T2HY.mjs} +5 -5
- package/dist/{sync-Pssitj6K.mjs → sync-CXNveL61.mjs} +2 -2
- package/dist/{sync.handler-Be0U3x-n.mjs → sync.handler-7g1yDt0H.mjs} +9 -9
- package/dist/{task-BNXDZU71.mjs → task-BguWXIiH.mjs} +2 -2
- package/dist/{task-target-build-BG6cC3bz.mjs → task-target-build-BaMtXnN7.mjs} +8 -7
- package/dist/{task-target-deploy-CZBGNC0H-Ck724yF4.mjs → task-target-deploy-CZBGNC0H-I-tvkGCC.mjs} +1 -1
- package/dist/{task-target-deploy-gMQC8kXU.mjs → task-target-deploy-DmpCWE3u.mjs} +1 -1
- package/dist/task-target-deploy-runner.mjs +22 -17
- package/dist/{test-BISghlKg.mjs → test-A5hz3c7j.mjs} +4 -4
- package/dist/{test.handler-DkizZhVu.mjs → test.handler-CJtaMZVy.mjs} +12 -12
- package/dist/{test.handler-Dk3CmTa7.mjs → test.handler-Cq2l7SAr.mjs} +2 -2
- package/dist/{tool.handler-Bu130Vcz.mjs → tool.handler-B-mOL128.mjs} +115 -95
- package/dist/{trigger-artifacts-RizI57RC-CxHwCkQ_.mjs → trigger-artifacts-RizI57RC-DjhOsdOm.mjs} +4 -4
- package/dist/{trigger-manifest-PTjVYL1r.mjs → trigger-manifest-Bq2zRbkV.mjs} +1 -1
- package/dist/{upgrade-cH9I_pZq.mjs → upgrade-DhfpoyRV.mjs} +2 -2
- package/dist/{upgrade.handler-CXEF4ue0.mjs → upgrade.handler-5qSzPC7D.mjs} +1 -1
- package/dist/{upload.handler-CpKuAaQ_.mjs → upload.handler-D3-W_1kq.mjs} +10 -10
- package/dist/{users.get.handler-D0WO6D1K.mjs → users.get.handler-Bd0OBI-E.mjs} +4 -4
- package/dist/{users.list.handler-BSTIniF1.mjs → users.list.handler-CacJz6eC.mjs} +4 -4
- package/dist/{users.set-role.handler-DAKdSkbn.mjs → users.set-role.handler-bZMQtUR0.mjs} +4 -4
- package/dist/{utils-VC0Vl_pm.mjs → utils-BMUWnz1P.mjs} +2 -2
- package/dist/{validate.handler-I8LY-UkG.mjs → validate.handler-Ccq66ki4.mjs} +8 -8
- package/dist/{workflow-build-C9rQQ4qU.mjs → workflow-build-_WNsLKwW.mjs} +23 -23
- package/dist/{workflow-build-manifest-OPFqFD6f.mjs → workflow-build-manifest-B2GqHyWE.mjs} +3 -3
- package/dist/{workflow-bundler-BzHk73PM-AIB4-u4Y.mjs → workflow-bundler-BzHk73PM-WI31RJjH.mjs} +3 -3
- package/dist/{workflows-CL1jYSLR.mjs → workflows-Dy2M9bEr.mjs} +16 -16
- package/dist/{writer-B-SpZ0G2-olEAgSLc.mjs → writer-B-SpZ0G2-tq1MFgid.mjs} +6 -6
- package/package.json +6 -6
- package/dist/clear.handler-Dpe05eTq.mjs +0 -42
- package/dist/dist-BF6r1hfv.mjs +0 -308
- package/dist/logs-DUwdYZB-.mjs +0 -28
- package/dist/logs.handler-dcRq-zoc.mjs +0 -35
- package/dist/{agent-bundle-package-DWV6B_5q-rRTPU13L.mjs → agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs} +0 -0
- package/dist/{agent-manifest-CZdlCTFs.mjs → agent-manifest-tIsqF2OP.mjs} +0 -0
- package/dist/{browser-3cUiPlk2.mjs → browser-BpJ8ut9z.mjs} +0 -0
- package/dist/{common-BaGFkj3n.mjs → common-AK0q0Oz0.mjs} +0 -0
- package/dist/{concurrency-gXn9Rw8x-BI6HQNfC.mjs → concurrency-gXn9Rw8x-BTlfau8D.mjs} +0 -0
- package/dist/{cron-parser-C2eJD0yD.mjs → cron-parser-Dw_cWzFu.mjs} +0 -0
- package/dist/{declared-credential-requirements-B6h4WRv4.mjs → declared-credential-requirements-D6KT-r-e.mjs} +0 -0
- package/dist/{default-urls-BS4twrsS.mjs → default-urls-CTQqM1_A.mjs} +0 -0
- package/dist/{layout-CXkZEsXI.mjs → layout-P1v-Gssz.mjs} +0 -0
- package/dist/{metadata-layout-Bv-B0nHj-CqlcZz_g.mjs → metadata-layout-Bv-B0nHj-B1c5giJ7.mjs} +1 -1
- package/dist/{oxc-B3KI3rf_-DdiZWqe2.mjs → oxc-B3KI3rf_-Cvx4Z-4H.mjs} +0 -0
- package/dist/{project-config-CsBMT4TL.mjs → project-config-DudGRFPO.mjs} +1 -1
- package/dist/{read-credential-keys-77a91T8M-DMmY6oDW.mjs → read-credential-keys-77a91T8M-B0eiobOd.mjs} +0 -0
- package/dist/{rolldown-runtime-twds-ZHy-CO5ir_za.mjs → rolldown-runtime-twds-ZHy-8uqgIurC.mjs} +0 -0
- package/dist/{run-polling-CwlzB5-9.mjs → run-polling-DARidqo-.mjs} +0 -0
- package/dist/{schema-O9xTWad_.mjs → schema-BjH_e4Fo.mjs} +0 -0
- package/dist/{schema-_FQrHcIS.mjs → schema-Lbp5lGJu.mjs} +0 -0
- package/dist/{schema-display-CNqiYBIb.mjs → schema-display-NVEl_DFY.mjs} +0 -0
- package/dist/{schemas-DodkHgnS.mjs → schemas-B8c7Z5Iy.mjs} +0 -0
- package/dist/{source-analysis-CJPymdaA.mjs → source-analysis-Cs0CTBQk.mjs} +0 -0
- package/dist/{types-D04ah3uY.mjs → types-BMBuhHhW.mjs} +0 -0
- package/dist/{upload-wwSPAC5_.mjs → upload-BbcMkyVl.mjs} +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
3
|
+
import { a as ui, j as throwReportedCliExit } from "./keystroke.mjs";
|
|
4
|
+
import { n as credentials } from "./dist-CIInPRGh.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Bid-Rqj7.mjs";
|
|
6
6
|
import { select } from "@clack/prompts";
|
|
7
7
|
//#region src/commands/org/switch.handler.ts
|
|
8
8
|
async function handleOrgSwitch(_options, ctx) {
|
|
9
9
|
const { user } = await requireClient(ctx).users.getMe();
|
|
10
10
|
const orgs = user.organizations ?? [];
|
|
11
|
-
const storedOrgIds = new Set(ctx.
|
|
11
|
+
const storedOrgIds = new Set(ctx.storedOrgs.map((o) => o.organizationId));
|
|
12
12
|
if (orgs.length === 0) {
|
|
13
13
|
ui.warn("You do not belong to any organization.");
|
|
14
14
|
return;
|
|
@@ -44,7 +44,7 @@ async function handleOrgSwitch(_options, ctx) {
|
|
|
44
44
|
ui.warn(`No stored API key for ${selectedOrg.name}. Run \`keystroke auth\` and select this org to add credentials.`);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
await setActiveOrg(selected);
|
|
47
|
+
await credentials.setActiveOrg(selected);
|
|
48
48
|
ui.success(`Switched to ${selectedOrg.name}`);
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
@@ -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-BE37hxR3.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-7g1yDt0H.mjs")).handleSync
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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-
|
|
3
|
+
import { P as logger, a as ui, j as throwReportedCliExit, l as isLocalMode, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-CIInPRGh.mjs";
|
|
5
|
+
import { a as validateApiKey, i as requireClient } from "./context-Bid-Rqj7.mjs";
|
|
6
|
+
import { n as deployFromDir } from "./dist-WFPTDQB3.mjs";
|
|
7
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CNQtOWE4.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-_WNsLKwW.mjs";
|
|
9
|
+
import { t as createBuildProgress } from "./build-progress-AR8xow4_.mjs";
|
|
10
|
+
import { t as createDeployProgress } from "./deploy-progress-DK87VKJ-.mjs";
|
|
11
11
|
//#region src/commands/sync/sync.handler.ts
|
|
12
12
|
async function handleSync(options, ctx) {
|
|
13
13
|
try {
|
|
@@ -25,7 +25,7 @@ async function handleSync(options, ctx) {
|
|
|
25
25
|
}
|
|
26
26
|
async function runSingleSync(options, ctx) {
|
|
27
27
|
const workflowsDir = await requireWorkflowsDir();
|
|
28
|
-
|
|
28
|
+
projects.track(workflowsDir);
|
|
29
29
|
const client = requireClient(ctx);
|
|
30
30
|
await validateApiKey(client);
|
|
31
31
|
logger.info("Starting sync", {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
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-
|
|
5
|
-
import { t as parseCronExpression } from "./cron-parser-
|
|
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-B8c7Z5Iy.mjs";
|
|
5
|
+
import { t as parseCronExpression } from "./cron-parser-Dw_cWzFu.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
const SHA256HashSchema = z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
|
|
8
8
|
const JsonSchemaSchema = z.record(z.string(), z.unknown());
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { r as getKeystrokeProjectPath } from "./paths-JzzFkXQA-CEipIeVl.mjs";
|
|
4
|
+
import "./dist-CIInPRGh.mjs";
|
|
5
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-B0eiobOd.mjs";
|
|
5
6
|
import path from "node:path";
|
|
7
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
6
8
|
import { pathToFileURL } from "node:url";
|
|
7
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
10
|
//#region ../../packages/workflow-builder/dist/builder-options-BT2McCyF.mjs
|
|
@@ -109,7 +111,7 @@ async function buildTaskTargetFile(options) {
|
|
|
109
111
|
return builtTasks;
|
|
110
112
|
}
|
|
111
113
|
async function bundleTaskTargetModule(options) {
|
|
112
|
-
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-
|
|
114
|
+
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-CNTyUzme.mjs").then((n) => n.n).then((n) => n.n)]);
|
|
113
115
|
const entryId = "\0virtual:task-target-entry";
|
|
114
116
|
const trackedDependencies = /* @__PURE__ */ new Set();
|
|
115
117
|
const envViolations = [];
|
|
@@ -216,7 +218,7 @@ async function attachTaskTargetTriggers(options) {
|
|
|
216
218
|
options.artifact.triggers.push(...buildTaskTriggerArtifactsWithoutBundles(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName));
|
|
217
219
|
return [];
|
|
218
220
|
}
|
|
219
|
-
const { buildTriggerArtifacts } = await import("./trigger-artifacts-RizI57RC-
|
|
221
|
+
const { buildTriggerArtifacts } = await import("./trigger-artifacts-RizI57RC-DjhOsdOm.mjs").then((n) => n.n);
|
|
220
222
|
const triggerResult = await buildTriggerArtifacts(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName, options.projectRoot, {
|
|
221
223
|
workflowExportName: options.entry.source.localExportName,
|
|
222
224
|
workflowFilePath: options.entry.runtimeBundlePath
|
|
@@ -319,7 +321,7 @@ function createPreparedTaskTarget(artifact, triggers) {
|
|
|
319
321
|
};
|
|
320
322
|
}
|
|
321
323
|
async function tryParseTaskBuildManifest(manifest) {
|
|
322
|
-
const { TaskBuildManifestSchema } = await import("./task-
|
|
324
|
+
const { TaskBuildManifestSchema } = await import("./task-BguWXIiH.mjs").then((n) => n.t);
|
|
323
325
|
const result = TaskBuildManifestSchema.safeParse(manifest);
|
|
324
326
|
return result.success ? result.data : null;
|
|
325
327
|
}
|
|
@@ -330,8 +332,7 @@ function readOptionalJsonSchemaKeysFromSchemaObject(schema) {
|
|
|
330
332
|
return properties.filter((key) => !required.has(key));
|
|
331
333
|
}
|
|
332
334
|
function getTaskRuntimeBundlePath(projectRoot, target) {
|
|
333
|
-
|
|
334
|
-
return path.join(projectRoot, ".keystroke", "task-target-build", `${hash}.mjs`);
|
|
335
|
+
return getKeystrokeProjectPath(projectRoot, "task-target-build", `${createHash("sha256").update(target.bindingKey).digest("hex").slice(0, 16)}.mjs`);
|
|
335
336
|
}
|
|
336
337
|
async function writeRuntimeBundle(bundlePath, code) {
|
|
337
338
|
await mkdir(path.dirname(bundlePath), { recursive: true });
|
package/dist/{task-target-deploy-CZBGNC0H-Ck724yF4.mjs → task-target-deploy-CZBGNC0H-I-tvkGCC.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as SHA256HashSchema } from "./common-
|
|
3
|
+
import { n as SHA256HashSchema } from "./common-AK0q0Oz0.mjs";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region ../../packages/shared-types/src/deployments/api/snapshot-payload.ts
|
|
6
6
|
function sortObjectKeysDeep(value) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
3
|
+
import { r as getKeystrokeProjectPath } from "./paths-JzzFkXQA-CEipIeVl.mjs";
|
|
4
|
+
import "./default-urls-CTQqM1_A.mjs";
|
|
5
|
+
import "./dist-CIInPRGh.mjs";
|
|
6
|
+
import { n as findProjectRoot, t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
7
|
+
import { t as resolveCliCredentials } from "./resolve-cli-credentials-DytxgMwn.mjs";
|
|
7
8
|
import path from "node:path";
|
|
9
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
8
10
|
import { spawnSync } from "node:child_process";
|
|
9
11
|
//#region src/lib/process-handoff.ts
|
|
10
12
|
function replaceProcessOrSpawn(options) {
|
|
@@ -22,8 +24,9 @@ function replaceProcessOrSpawn(options) {
|
|
|
22
24
|
}
|
|
23
25
|
//#endregion
|
|
24
26
|
//#region src/task-target-deploy-runner.ts
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
+
const TASK_TARGET_DEPLOY_DIR = "task-target-deploy";
|
|
28
|
+
const TASK_TARGET_DESCRIPTOR_FILE = "descriptor.json";
|
|
29
|
+
const TASK_TARGET_BUILD_DESCRIPTOR_FILE = "build-descriptor.json";
|
|
27
30
|
function parseArgs(argv) {
|
|
28
31
|
const options = {
|
|
29
32
|
targetFiles: [],
|
|
@@ -68,10 +71,10 @@ async function resolveProjectRoot(explicitPath) {
|
|
|
68
71
|
return discovered;
|
|
69
72
|
}
|
|
70
73
|
function descriptorPath(projectRoot) {
|
|
71
|
-
return
|
|
74
|
+
return getKeystrokeProjectPath(projectRoot, TASK_TARGET_DEPLOY_DIR, TASK_TARGET_DESCRIPTOR_FILE);
|
|
72
75
|
}
|
|
73
76
|
function buildDescriptorPath(projectRoot) {
|
|
74
|
-
return
|
|
77
|
+
return getKeystrokeProjectPath(projectRoot, TASK_TARGET_DEPLOY_DIR, TASK_TARGET_BUILD_DESCRIPTOR_FILE);
|
|
75
78
|
}
|
|
76
79
|
async function writeDescriptor(projectRoot, descriptor) {
|
|
77
80
|
const filePath = descriptorPath(projectRoot);
|
|
@@ -116,7 +119,7 @@ function restartStage(options, projectRoot, stage) {
|
|
|
116
119
|
}
|
|
117
120
|
async function runBuildPhase(options, projectRoot) {
|
|
118
121
|
const projectConfig = await assertWorkflowProjectRoot(projectRoot);
|
|
119
|
-
const { buildTaskTargetEntries } = await import("./task-target-build-
|
|
122
|
+
const { buildTaskTargetEntries } = await import("./task-target-build-BaMtXnN7.mjs");
|
|
120
123
|
await writeBuildDescriptor(projectRoot, {
|
|
121
124
|
projectRoot,
|
|
122
125
|
projectConfig,
|
|
@@ -129,7 +132,7 @@ async function runBuildPhase(options, projectRoot) {
|
|
|
129
132
|
}
|
|
130
133
|
async function runPreparePhase(projectRoot) {
|
|
131
134
|
const buildDescriptor = await readBuildDescriptor(projectRoot);
|
|
132
|
-
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-
|
|
135
|
+
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-BaMtXnN7.mjs");
|
|
133
136
|
const prepareResult = await prepareTaskTargetBuiltTasks({
|
|
134
137
|
builtTasks: buildDescriptor.builtTasks,
|
|
135
138
|
projectRoot
|
|
@@ -142,12 +145,14 @@ async function runPreparePhase(projectRoot) {
|
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
async function resolveDeployAuthOptions(options) {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
const envApiKey = process.env.KEYSTROKE_API_KEY;
|
|
149
|
+
const envServerUrl = process.env.SERVER_URL;
|
|
150
|
+
const resolved = await resolveCliCredentials({
|
|
151
|
+
apiKey: options.apiKey ?? envApiKey,
|
|
152
|
+
serverUrl: options.serverUrl ?? envServerUrl
|
|
148
153
|
});
|
|
149
|
-
const apiKey = resolved.apiKey
|
|
150
|
-
const serverUrl = resolved.serverUrl ??
|
|
154
|
+
const apiKey = resolved.apiKey;
|
|
155
|
+
const serverUrl = resolved.serverUrl ?? "https://api.kestroke.ai";
|
|
151
156
|
const organizationId = options.org ?? process.env.KEYSTROKE_ORG_ID ?? resolved.activeOrg?.organizationId;
|
|
152
157
|
if (!apiKey || !serverUrl) throw new Error("Not authenticated. Run `keystroke auth` or pass --api-key and --server-url.");
|
|
153
158
|
return {
|
|
@@ -158,11 +163,11 @@ async function resolveDeployAuthOptions(options) {
|
|
|
158
163
|
}
|
|
159
164
|
async function runDeployPhase(options, projectRoot) {
|
|
160
165
|
const descriptor = await readDescriptor(projectRoot);
|
|
161
|
-
const { createDeployClient } = await import("./deploy-
|
|
166
|
+
const { createDeployClient } = await import("./deploy-DyZh--f7.mjs");
|
|
162
167
|
const client = createDeployClient(await resolveDeployAuthOptions(options));
|
|
163
168
|
const auth = await client.public.auth.validate();
|
|
164
169
|
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-
|
|
170
|
+
const { deployTaskTargets } = await import("./task-target-deploy-DmpCWE3u.mjs");
|
|
166
171
|
const result = await deployTaskTargets({
|
|
167
172
|
preparedTasks: descriptor.preparedTasks,
|
|
168
173
|
client,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
5
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { a as ui } from "./keystroke.mjs";
|
|
4
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BWcVRt-T.mjs";
|
|
5
|
+
import { t as createTypedCommand } from "./commander-BE37hxR3.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/commands/test/test.command.ts
|
|
8
8
|
const TestOptionsSchema = JsonOptionSchema;
|
|
@@ -63,7 +63,7 @@ function createTestCommand() {
|
|
|
63
63
|
description: "Agent tool name from the built manifest",
|
|
64
64
|
key: "toolName"
|
|
65
65
|
},
|
|
66
|
-
loadHandler: async () => (await import("./tool.handler-
|
|
66
|
+
loadHandler: async () => (await import("./tool.handler-B-mOL128.mjs")).handleTestTool
|
|
67
67
|
})]
|
|
68
68
|
});
|
|
69
69
|
cmd.enablePositionalOptions();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
6
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
7
|
-
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-
|
|
8
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
9
|
-
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-
|
|
10
|
-
import { r as isUnknownSchema } from "./schema-display-
|
|
11
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
12
|
-
import { t as withErrorBoundary } from "./error-boundary-
|
|
13
|
-
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-
|
|
3
|
+
import { D as CliExitError, a as ui, l as isLocalMode, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-CIInPRGh.mjs";
|
|
5
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
6
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-Bid-Rqj7.mjs";
|
|
7
|
+
import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-WFPTDQB3.mjs";
|
|
8
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CNQtOWE4.mjs";
|
|
9
|
+
import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-_WNsLKwW.mjs";
|
|
10
|
+
import { r as isUnknownSchema } from "./schema-display-NVEl_DFY.mjs";
|
|
11
|
+
import { t as createBuildProgress } from "./build-progress-AR8xow4_.mjs";
|
|
12
|
+
import { t as withErrorBoundary } from "./error-boundary-B8cmSwJH.mjs";
|
|
13
|
+
import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-CC6y2XXI.mjs";
|
|
14
14
|
//#region src/lib/format.ts
|
|
15
15
|
function formatBytes(bytes) {
|
|
16
16
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -26,7 +26,7 @@ function formatBytes(bytes) {
|
|
|
26
26
|
async function resolveAndValidateInputForRun(options) {
|
|
27
27
|
const input = await resolveInput(options);
|
|
28
28
|
const workflowsDir = await requireWorkflowsDir(options.path);
|
|
29
|
-
|
|
29
|
+
projects.track(workflowsDir);
|
|
30
30
|
const existingSchema = await tryReadExistingInputSchema(workflowsDir, options.workflow);
|
|
31
31
|
if (existingSchema && !isUnknownSchema(existingSchema)) validateInputOrExit(options.workflow, input, existingSchema);
|
|
32
32
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { a as validateApiKey, i as requireClient } from "./context-
|
|
3
|
+
import { a as ui } from "./keystroke.mjs";
|
|
4
|
+
import { a as validateApiKey, i as requireClient } from "./context-Bid-Rqj7.mjs";
|
|
5
5
|
//#region src/commands/auth/test.handler.ts
|
|
6
6
|
async function handleAuthTest(_options, ctx) {
|
|
7
7
|
const result = await validateApiKey(requireClient(ctx));
|
|
@@ -1,19 +1,102 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
6
|
-
import { i as writeJson } from "./output-
|
|
7
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
8
|
-
import { a as readManifestsFromOutDir } from "./dist-
|
|
9
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
10
|
-
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-
|
|
11
|
-
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-
|
|
12
|
-
import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-
|
|
13
|
-
import
|
|
3
|
+
import { D as CliExitError, a as ui, c as getProcessEnv, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { t as Credentials } from "./dist-CIInPRGh.mjs";
|
|
5
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
6
|
+
import { i as writeJson } from "./output-BWcVRt-T.mjs";
|
|
7
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-Bid-Rqj7.mjs";
|
|
8
|
+
import { a as readManifestsFromOutDir } from "./dist-WFPTDQB3.mjs";
|
|
9
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CNQtOWE4.mjs";
|
|
10
|
+
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-_WNsLKwW.mjs";
|
|
11
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-DiwUcKoB.mjs";
|
|
12
|
+
import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-CC6y2XXI.mjs";
|
|
13
|
+
import * as os from "node:os";
|
|
14
14
|
import { tmpdir } from "node:os";
|
|
15
|
+
import * as path$1 from "node:path";
|
|
15
16
|
import path from "node:path";
|
|
17
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
16
18
|
import { pathToFileURL } from "node:url";
|
|
19
|
+
//#region ../../packages/testing/src/shared/create-mock-hook.ts
|
|
20
|
+
/** Creates a Hook that resolves immediately when awaited. */
|
|
21
|
+
function createMockHook() {
|
|
22
|
+
const resolved = Promise.resolve(void 0);
|
|
23
|
+
return {
|
|
24
|
+
then: (onfulfilled, onrejected) => resolved.then(onfulfilled, onrejected),
|
|
25
|
+
token: Promise.resolve("mock-token"),
|
|
26
|
+
resumeUrl: Promise.resolve("http://mock/resume"),
|
|
27
|
+
cancelUrl: Promise.resolve("http://mock/cancel"),
|
|
28
|
+
approvalPageUrl: Promise.resolve("http://mock/approve")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region ../../packages/testing/src/test-runtime/helpers/create-test-workflow-context.ts
|
|
33
|
+
function createTestWorkflowContext(options = {}) {
|
|
34
|
+
return {
|
|
35
|
+
createHook: options.createHook ?? ((_name) => createMockHook()),
|
|
36
|
+
stepContext: options.stepContext,
|
|
37
|
+
wait: options.wait ?? (async () => {}),
|
|
38
|
+
hasCredentialSet: options.hasCredentialSet ?? (() => false),
|
|
39
|
+
workflowGlobals: options.workflowGlobals,
|
|
40
|
+
workflowId: options.workflowId ?? "test-workflow-run"
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../../packages/core/dist/chunks/execution-scope-BCDb3CU7.mjs
|
|
45
|
+
const SCOPE_STACK_KEY = "__ks_execution_scope_stack__";
|
|
46
|
+
function getScopeStack() {
|
|
47
|
+
const g = globalThis;
|
|
48
|
+
if (!g[SCOPE_STACK_KEY]) g[SCOPE_STACK_KEY] = [];
|
|
49
|
+
return g[SCOPE_STACK_KEY];
|
|
50
|
+
}
|
|
51
|
+
function getCurrentScope() {
|
|
52
|
+
const stack = getScopeStack();
|
|
53
|
+
return stack[stack.length - 1] ?? getDefaultScope();
|
|
54
|
+
}
|
|
55
|
+
const DEFAULT_SCOPE_KEY = "__ks_execution_scope_default__";
|
|
56
|
+
function getDefaultScope() {
|
|
57
|
+
const g = globalThis;
|
|
58
|
+
if (!g[DEFAULT_SCOPE_KEY]) g[DEFAULT_SCOPE_KEY] = { stepContextProviders: [] };
|
|
59
|
+
return g[DEFAULT_SCOPE_KEY];
|
|
60
|
+
}
|
|
61
|
+
function setExecutionScopeWorkflowRuntime(provider) {
|
|
62
|
+
const scope = getCurrentScope();
|
|
63
|
+
scope.workflowRuntimeProvider = provider;
|
|
64
|
+
}
|
|
65
|
+
function pushExecutionScopeStepContext(provider) {
|
|
66
|
+
const scope = getCurrentScope();
|
|
67
|
+
scope.stepContextProviders = [...scope.stepContextProviders, provider];
|
|
68
|
+
}
|
|
69
|
+
function clearExecutionScopeStepContexts() {
|
|
70
|
+
const scope = getCurrentScope();
|
|
71
|
+
scope.stepContextProviders = [];
|
|
72
|
+
}
|
|
73
|
+
function setExecutionScopeStepCredentialResolver(resolver) {
|
|
74
|
+
const scope = getCurrentScope();
|
|
75
|
+
scope.stepCredentialResolver = resolver;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region ../../packages/core/dist/chunks/credential-resolver-registry-BRH30wCz.mjs
|
|
79
|
+
function registerOperationContext(registry) {
|
|
80
|
+
pushExecutionScopeStepContext(registry.getOperationContext);
|
|
81
|
+
}
|
|
82
|
+
function clearOperationContext() {
|
|
83
|
+
clearExecutionScopeStepContexts();
|
|
84
|
+
}
|
|
85
|
+
function registerOperationCredentialResolver(resolver) {
|
|
86
|
+
setExecutionScopeStepCredentialResolver(resolver.resolveOperationCredentials);
|
|
87
|
+
}
|
|
88
|
+
function clearOperationCredentialResolver() {
|
|
89
|
+
setExecutionScopeStepCredentialResolver(void 0);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region ../../packages/core/dist/chunks/context-registry-DqNWcTgK.mjs
|
|
93
|
+
function registerRuntime(registry) {
|
|
94
|
+
setExecutionScopeWorkflowRuntime(registry.getRuntime);
|
|
95
|
+
}
|
|
96
|
+
function clearRuntime() {
|
|
97
|
+
setExecutionScopeWorkflowRuntime(void 0);
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
17
100
|
//#region ../../packages/testing/src/test-runtime/credentials/env-resolver.ts
|
|
18
101
|
/**
|
|
19
102
|
* Computes the env var name for a credential key.
|
|
@@ -61,12 +144,30 @@ function createCredentialCache() {
|
|
|
61
144
|
}
|
|
62
145
|
//#endregion
|
|
63
146
|
//#region ../../packages/testing/src/test-runtime/credentials/server-resolver.ts
|
|
147
|
+
/**
|
|
148
|
+
* Default `CredentialAuthResolver` that derives a `homeDir` from the supplied
|
|
149
|
+
* `credentialsPath` (when present) and reads from the local-memory
|
|
150
|
+
* `Credentials` controller. Falls back to the singleton on the user's home.
|
|
151
|
+
*/
|
|
152
|
+
const defaultResolveAuth = async (input) => {
|
|
153
|
+
const credentials = new Credentials({ homeDir: input.credentialsPath ? path$1.dirname(path$1.dirname(input.credentialsPath)) : os.homedir() });
|
|
154
|
+
let active = null;
|
|
155
|
+
let urls = null;
|
|
156
|
+
try {
|
|
157
|
+
active = await credentials.getActiveOrg();
|
|
158
|
+
urls = await credentials.getServerUrls();
|
|
159
|
+
} catch {}
|
|
160
|
+
return {
|
|
161
|
+
apiKey: input.apiKey ?? active?.apiKey,
|
|
162
|
+
serverUrl: input.serverUrl ?? urls?.serverUrl
|
|
163
|
+
};
|
|
164
|
+
};
|
|
64
165
|
async function createServerCredentialResolver(options, dependencies = {
|
|
65
166
|
fetch: globalThis.fetch,
|
|
66
|
-
|
|
167
|
+
resolveAuth: defaultResolveAuth
|
|
67
168
|
}) {
|
|
68
169
|
try {
|
|
69
|
-
const resolvedAuth = await dependencies.
|
|
170
|
+
const resolvedAuth = await dependencies.resolveAuth({
|
|
70
171
|
apiKey: options.apiKey,
|
|
71
172
|
serverUrl: options.baseUrl,
|
|
72
173
|
credentialsPath: options.credentialsPath
|
|
@@ -169,87 +270,6 @@ async function createTestCredentialResolver(options, _runtimeOptions = {}) {
|
|
|
169
270
|
//#region ../../packages/testing/src/test-runtime/credentials/options.ts
|
|
170
271
|
const DEFAULT_TEST_CREDENTIAL_MODE = "auto";
|
|
171
272
|
//#endregion
|
|
172
|
-
//#region ../../packages/testing/src/shared/create-mock-hook.ts
|
|
173
|
-
/** Creates a Hook that resolves immediately when awaited. */
|
|
174
|
-
function createMockHook() {
|
|
175
|
-
const resolved = Promise.resolve(void 0);
|
|
176
|
-
return {
|
|
177
|
-
then: (onfulfilled, onrejected) => resolved.then(onfulfilled, onrejected),
|
|
178
|
-
token: Promise.resolve("mock-token"),
|
|
179
|
-
resumeUrl: Promise.resolve("http://mock/resume"),
|
|
180
|
-
cancelUrl: Promise.resolve("http://mock/cancel"),
|
|
181
|
-
approvalPageUrl: Promise.resolve("http://mock/approve")
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region ../../packages/testing/src/test-runtime/helpers/create-test-workflow-context.ts
|
|
186
|
-
function createTestWorkflowContext(options = {}) {
|
|
187
|
-
return {
|
|
188
|
-
createHook: options.createHook ?? ((_name) => createMockHook()),
|
|
189
|
-
stepContext: options.stepContext,
|
|
190
|
-
wait: options.wait ?? (async () => {}),
|
|
191
|
-
hasCredentialSet: options.hasCredentialSet ?? (() => false),
|
|
192
|
-
workflowGlobals: options.workflowGlobals,
|
|
193
|
-
workflowId: options.workflowId ?? "test-workflow-run"
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region ../../packages/core/dist/chunks/execution-scope-BCDb3CU7.mjs
|
|
198
|
-
const SCOPE_STACK_KEY = "__ks_execution_scope_stack__";
|
|
199
|
-
function getScopeStack() {
|
|
200
|
-
const g = globalThis;
|
|
201
|
-
if (!g[SCOPE_STACK_KEY]) g[SCOPE_STACK_KEY] = [];
|
|
202
|
-
return g[SCOPE_STACK_KEY];
|
|
203
|
-
}
|
|
204
|
-
function getCurrentScope() {
|
|
205
|
-
const stack = getScopeStack();
|
|
206
|
-
return stack[stack.length - 1] ?? getDefaultScope();
|
|
207
|
-
}
|
|
208
|
-
const DEFAULT_SCOPE_KEY = "__ks_execution_scope_default__";
|
|
209
|
-
function getDefaultScope() {
|
|
210
|
-
const g = globalThis;
|
|
211
|
-
if (!g[DEFAULT_SCOPE_KEY]) g[DEFAULT_SCOPE_KEY] = { stepContextProviders: [] };
|
|
212
|
-
return g[DEFAULT_SCOPE_KEY];
|
|
213
|
-
}
|
|
214
|
-
function setExecutionScopeWorkflowRuntime(provider) {
|
|
215
|
-
const scope = getCurrentScope();
|
|
216
|
-
scope.workflowRuntimeProvider = provider;
|
|
217
|
-
}
|
|
218
|
-
function pushExecutionScopeStepContext(provider) {
|
|
219
|
-
const scope = getCurrentScope();
|
|
220
|
-
scope.stepContextProviders = [...scope.stepContextProviders, provider];
|
|
221
|
-
}
|
|
222
|
-
function clearExecutionScopeStepContexts() {
|
|
223
|
-
const scope = getCurrentScope();
|
|
224
|
-
scope.stepContextProviders = [];
|
|
225
|
-
}
|
|
226
|
-
function setExecutionScopeStepCredentialResolver(resolver) {
|
|
227
|
-
const scope = getCurrentScope();
|
|
228
|
-
scope.stepCredentialResolver = resolver;
|
|
229
|
-
}
|
|
230
|
-
//#endregion
|
|
231
|
-
//#region ../../packages/core/dist/chunks/credential-resolver-registry-BRH30wCz.mjs
|
|
232
|
-
function registerOperationContext(registry) {
|
|
233
|
-
pushExecutionScopeStepContext(registry.getOperationContext);
|
|
234
|
-
}
|
|
235
|
-
function clearOperationContext() {
|
|
236
|
-
clearExecutionScopeStepContexts();
|
|
237
|
-
}
|
|
238
|
-
function registerOperationCredentialResolver(resolver) {
|
|
239
|
-
setExecutionScopeStepCredentialResolver(resolver.resolveOperationCredentials);
|
|
240
|
-
}
|
|
241
|
-
function clearOperationCredentialResolver() {
|
|
242
|
-
setExecutionScopeStepCredentialResolver(void 0);
|
|
243
|
-
}
|
|
244
|
-
//#endregion
|
|
245
|
-
//#region ../../packages/core/dist/chunks/context-registry-DqNWcTgK.mjs
|
|
246
|
-
function registerRuntime(registry) {
|
|
247
|
-
setExecutionScopeWorkflowRuntime(registry.getRuntime);
|
|
248
|
-
}
|
|
249
|
-
function clearRuntime() {
|
|
250
|
-
setExecutionScopeWorkflowRuntime(void 0);
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
273
|
//#region ../../packages/testing/src/test-runtime/runtime/create-keystroke-test-runtime.ts
|
|
254
274
|
async function createKeystrokeTestRuntime(options = {}) {
|
|
255
275
|
clearOperationCredentialResolver();
|
|
@@ -394,7 +414,7 @@ async function executeOperationTool(params) {
|
|
|
394
414
|
mode: "auto",
|
|
395
415
|
apiKey: ctx.apiKey,
|
|
396
416
|
baseUrl: ctx.baseUrl,
|
|
397
|
-
credentialsPath: ctx.
|
|
417
|
+
credentialsPath: ctx.metadataFilePath
|
|
398
418
|
},
|
|
399
419
|
source: "cli",
|
|
400
420
|
sourceLabel: "CLI"
|
package/dist/{trigger-artifacts-RizI57RC-CxHwCkQ_.mjs → trigger-artifacts-RizI57RC-DjhOsdOm.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as readOptionalJsonSchemaKeys } from "./declared-credential-requirements-
|
|
4
|
-
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy-
|
|
5
|
-
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-
|
|
6
|
-
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-
|
|
3
|
+
import { n as readOptionalJsonSchemaKeys } from "./declared-credential-requirements-D6KT-r-e.mjs";
|
|
4
|
+
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy-8uqgIurC.mjs";
|
|
5
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-B0eiobOd.mjs";
|
|
6
|
+
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-CNTyUzme.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { rolldown } from "rolldown";
|
|
9
9
|
//#region ../../packages/workflow-builder/dist/trigger-artifacts-RizI57RC.mjs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { a as TriggerCredentialRequirementsSchema, l as WebhookMethodSchema, o as TriggerSourceSchema, s as TriggerTypeSchema } from "./credential-requirements-
|
|
3
|
+
import { a as TriggerCredentialRequirementsSchema, l as WebhookMethodSchema, o as TriggerSourceSchema, s as TriggerTypeSchema } from "./credential-requirements-DrrQ9x9P.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../../packages/shared-types/src/workflows/build-output/trigger-manifest.ts
|
|
6
6
|
const TriggerBuildFunctionSchema = z.object({
|
|
@@ -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-BE37hxR3.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/commands/upgrade/upgrade.command.ts
|
|
6
6
|
const PackageManagerSchema = z.enum([
|
|
@@ -34,7 +34,7 @@ function createUpgradeCommand() {
|
|
|
34
34
|
description: "Upgrade the Keystroke CLI to the latest published version",
|
|
35
35
|
schema: UpgradeOptionsSchema,
|
|
36
36
|
optionsConfig: UPGRADE_OPTIONS_CONFIG,
|
|
37
|
-
loadHandler: async () => (await import("./upgrade.handler-
|
|
37
|
+
loadHandler: async () => (await import("./upgrade.handler-5qSzPC7D.mjs")).handleUpgrade
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { a as ui, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
//#region src/commands/upgrade/upgrade.handler.ts
|
|
6
6
|
const CLI_PACKAGE_NAME = "@keystrokehq/cli";
|