@keystrokehq/cli 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/{accept.handler-DWuxmMuY.mjs → accept.handler-BU6kg8ET.mjs} +1 -1
  2. package/dist/{admin-BK4bFTTd.mjs → admin-B4GNbCl5.mjs} +9 -9
  3. package/dist/{agent-manifest-sJFbH5H8.mjs → agent-manifest-CZdlCTFs.mjs} +5 -5
  4. package/dist/{agents-DYnw2VPX.mjs → agents-LtoIcJGY.mjs} +6 -6
  5. package/dist/api-DuKKdCpF.mjs +246 -0
  6. package/dist/{api-keys-Dizx3YqE.mjs → api-keys-BE_hLonn.mjs} +5 -5
  7. package/dist/{auth-BqsKd4IA.mjs → auth-DNK5MYm4.mjs} +5 -5
  8. package/dist/{auth.handler-BsoWeCFD.mjs → auth.handler-DrjDODhZ.mjs} +1 -1
  9. package/dist/{build-agents-DfbiMZ_e-CgnKa9A6.mjs → build-agents-DseUtzd4-DIDGsZWL.mjs} +12 -13
  10. package/dist/{build-metadata-zidV9Cai-Bq37kBOM.mjs → build-metadata-qebrtraZ-D4SQNsBw.mjs} +19 -35
  11. package/dist/{build-progress-DigAP-BN.mjs → build-progress-CITED2tv.mjs} +1 -1
  12. package/dist/{build-tasks-O1jYtlv1-Bkw0w1r3.mjs → build-tasks-GVuMLS0h-DnS9QWzf.mjs} +4 -4
  13. package/dist/{build-workflows-3fdvdHHf-BDTy9QgT.mjs → build-workflows-Dmzay1vP-DKVuBAjD.mjs} +17 -18
  14. package/dist/{build.handler-B2UDhh72.mjs → build.handler-BZnLQt0_.mjs} +4 -4
  15. package/dist/{clear.handler-BR97yudD.mjs → clear.handler-B1c17nAi.mjs} +1 -1
  16. package/dist/{commander-DcftG6dX.mjs → commander-BwtBoukr.mjs} +2 -2
  17. package/dist/{common-B3bLe3Mk.mjs → common-BaGFkj3n.mjs} +2 -2
  18. package/dist/{connect-DQ4xIcyE.mjs → connect-IPcL37np.mjs} +12 -6
  19. package/dist/{connect.handler-CWSLgf87.mjs → connect.handler-ToY6qmMz.mjs} +74 -224
  20. package/dist/{context-1VgRbzr-.mjs → context-DQ4IA0yO.mjs} +1 -1
  21. package/dist/{create.handler-C2CkPWsy.mjs → create.handler-BAyG0PmG.mjs} +1 -1
  22. package/dist/credential-requirements-FtBk5JVB.mjs +250 -0
  23. package/dist/credentials-Bu1MBiCL.mjs +182 -0
  24. package/dist/{credentials-D8_AwH9o.mjs → credentials-CZiu-534.mjs} +12 -7
  25. package/dist/{current-deployment-workflow-B05z0EQa.mjs → current-deployment-workflow-zTmYbUjh.mjs} +5 -5
  26. package/dist/{current.handler-CuAtMZmm.mjs → current.handler-DA4FGfUP.mjs} +1 -1
  27. package/dist/{declared-credential-requirements-BtlcsEVn.mjs → declared-credential-requirements-B6h4WRv4.mjs} +5 -34
  28. package/dist/{delete.handler-DDY3X1Zm.mjs → delete.handler-CJcyvnUF.mjs} +1 -1
  29. package/dist/{deploy-B8TYutOi.mjs → deploy-BvaFgVvf.mjs} +1 -1
  30. package/dist/{deploy-Cn6FFnOM.mjs → deploy-DdMP-YaQ.mjs} +2 -2
  31. package/dist/{deploy-progress-XAfautnA.mjs → deploy-progress-CLO-yidq.mjs} +1 -1
  32. package/dist/{deploy.handler-D1DcAe-h.mjs → deploy.handler-Bag7rBG-.mjs} +16 -16
  33. package/dist/{detect-env-access-CwkOYeYM-D4o8gRZs.mjs → detect-env-access-CwkOYeYM-EmkYvbfJ.mjs} +1 -1
  34. package/dist/{diff.handler-BU6IewNG.mjs → diff.handler-Brgc-Ccl.mjs} +3 -3
  35. package/dist/{dist-DvO0q6Fo.mjs → dist-BMkNN03r.mjs} +16 -16
  36. package/dist/{env.handler-C6YAmHLi.mjs → env.handler-DFKzjIQT.mjs} +10 -7
  37. package/dist/{error-boundary-CpaVvFXk.mjs → error-boundary-B2ZKRkZI.mjs} +1 -1
  38. package/dist/{file-metadata-BvGM-B2v.mjs → file-metadata-Dwy9KKq_.mjs} +2 -2
  39. package/dist/{import-module-DDPnzlJ1-BIBSgOhK.mjs → import-module-DEI7R8Yh-Xz-KAPvB.mjs} +248 -246
  40. package/dist/{init-Da6_obl0.mjs → init-DhnABm3J.mjs} +2 -2
  41. package/dist/{init.handler-Cq2nk8DO.mjs → init.handler-QgehN8B4.mjs} +4 -4
  42. package/dist/{inspect.handler-D4YGryQB.mjs → inspect.handler-CMOFOb4G.mjs} +3 -3
  43. package/dist/{integration-catalog-DtNWaMvh.mjs → integration-catalog-BRrJIAVz.mjs} +5 -5
  44. package/dist/{integrations-CB_Ukq2g.mjs → integrations-7-U7nmkh.mjs} +7 -6
  45. package/dist/{invites-BOhuBtoq.mjs → invites-CmGmnUla.mjs} +4 -4
  46. package/dist/{invites.list.handler-C-Wv6E1g.mjs → invites.list.handler-CmkIf-uW.mjs} +1 -1
  47. package/dist/{invites.resend.handler-CI78XlQS.mjs → invites.resend.handler-FZl20yat.mjs} +1 -1
  48. package/dist/{invites.revoke.handler-DigAgNwB.mjs → invites.revoke.handler-D95mrfmB.mjs} +1 -1
  49. package/dist/keystroke.mjs +21 -21
  50. package/dist/{list-enrichment-Cxlq6BB9.mjs → list-enrichment-I4XQaMg0.mjs} +5 -1
  51. package/dist/{list.handler-OiLEylzS.mjs → list.handler-BrTW2viq.mjs} +1 -1
  52. package/dist/{list.handler-CsODcH6e.mjs → list.handler-Cp767f5l.mjs} +1 -1
  53. package/dist/{list.handler-BsyGhXns.mjs → list.handler-DRnHsEa0.mjs} +1 -1
  54. package/dist/{list.handler-B6IByHHB.mjs → list.handler-DXl8igi2.mjs} +13 -5
  55. package/dist/{list.handler-BpVNYShU.mjs → list.handler-DsYyTUhA.mjs} +1 -1
  56. package/dist/{list.handler--a1JEGSD.mjs → list.handler-H8aQSsFM.mjs} +3 -3
  57. package/dist/{list.handler-Dr9Ti-dt.mjs → list.handler-uzC77oIy.mjs} +3 -3
  58. package/dist/{listen-DUPk6cZC.mjs → listen-DckJq0y0.mjs} +2 -2
  59. package/dist/{listen.handler-B5WimrfF.mjs → listen.handler-Bf5MXKPO.mjs} +2 -2
  60. package/dist/{logs-C5_4lh3p.mjs → logs-D_l5BIn2.mjs} +3 -3
  61. package/dist/{logs.handler-CBHPwDuC.mjs → logs.handler-kYO3Uv9t.mjs} +2 -2
  62. package/dist/{members.add.handler-LcQJYBsu.mjs → members.add.handler-C2cppd-9.mjs} +1 -1
  63. package/dist/{members.invite.handler-p279O2aC.mjs → members.invite.handler-DY6kS4LN.mjs} +1 -1
  64. package/dist/{members.list.handler-Cjukjuot.mjs → members.list.handler-CFBG3SBw.mjs} +1 -1
  65. package/dist/{members.remove.handler-CzxPiQFv.mjs → members.remove.handler-LQ61_qip.mjs} +1 -1
  66. package/dist/{members.update.handler-CX5q86e3.mjs → members.update.handler-CqISA1mf.mjs} +1 -1
  67. package/dist/{normalize-path-CojS-CgQ-D_WTiHKw.mjs → normalize-path-CojS-CgQ-D5D0AIHR.mjs} +1 -1
  68. package/dist/{org-CnlKW-Hl.mjs → org-KQ2nD0yN.mjs} +15 -15
  69. package/dist/{orgs.create.handler-DRILhxdn.mjs → orgs.create.handler-Mv5CTGcG.mjs} +1 -1
  70. package/dist/{orgs.get.handler-Cue6stoX.mjs → orgs.get.handler-DvvOhshX.mjs} +1 -1
  71. package/dist/{orgs.list.handler-fuDLNI5X.mjs → orgs.list.handler-wWAg6cKg.mjs} +1 -1
  72. package/dist/{paused.handler-CuOVH4DZ.mjs → paused.handler-CbMkPD9e.mjs} +1 -1
  73. package/dist/{project-config-D9eFU8Jk.mjs → project-config-CJGSh2RQ.mjs} +4 -7
  74. package/dist/{projects-DN7dX6nN.mjs → projects-CWLOF5x4.mjs} +656 -3
  75. package/dist/{projects-DdgHbUpR.mjs → projects-CYqeKQGT.mjs} +4 -4
  76. package/dist/{requirements.handler-CX13XiXT.mjs → requirements.handler-CnDTBcH5.mjs} +5 -5
  77. package/dist/{resolve-project-C6UAOfAG.mjs → resolve-project-bVPMcs-y.mjs} +1 -1
  78. package/dist/{run-polling-1CTIeDea.mjs → run-polling-49w3PYAv.mjs} +3 -3
  79. package/dist/{run.handler-BxLH75WW.mjs → run.handler-Bma88649.mjs} +5 -5
  80. package/dist/{runs-lfE7r6i2.mjs → runs-HJejvQnQ.mjs} +2 -2
  81. package/dist/{schema-BgGlAs8a.mjs → schema-DFJiNWyd.mjs} +2 -1
  82. package/dist/schemas-DodkHgnS.mjs +280 -0
  83. package/dist/{skills-sync.handler-CntKndFm.mjs → skills-sync.handler-Cf74vKJA.mjs} +1 -1
  84. package/dist/{skills.command-X5zZwz2d.mjs → skills.command-KyAwBeST.mjs} +3 -3
  85. package/dist/{source-analysis-CHkWMC40.mjs → source-analysis-CJPymdaA.mjs} +1 -1
  86. package/dist/{source-analysis-DEEChuND-Csu0oOlw.mjs → source-analysis-DTnwNwKq-DoBxUDCg.mjs} +5 -5
  87. package/dist/{src--fCtOxNX.mjs → src-D-dFmoAF.mjs} +1 -1
  88. package/dist/{switch.handler-RaeKZ3ZB.mjs → switch.handler-DfsKVtR6.mjs} +1 -1
  89. package/dist/{sync-C89mJp7Y.mjs → sync-Bi2M_TUK.mjs} +2 -2
  90. package/dist/{sync.handler-BoAHHUQs.mjs → sync.handler-D6YFuVlq.mjs} +6 -6
  91. package/dist/{schedule-BWAI6qLx.mjs → task-BBgEvdG1.mjs} +395 -25
  92. package/dist/{task-target-build-D5IrHqSl.mjs → task-target-build-atWwwnSF.mjs} +8 -8
  93. package/dist/task-target-deploy-CRsrQTOy.mjs +4 -0
  94. package/dist/{task-target-deploy-Bf5i3ox1-2K0hAwzk.mjs → task-target-deploy-CZBGNC0H-BwPSfaJQ.mjs} +2 -2
  95. package/dist/task-target-deploy-runner.mjs +5 -5
  96. package/dist/{test-gPQJRkqa.mjs → test-Ctjy8mwC.mjs} +32 -144
  97. package/dist/{test.handler-B5GF5txS.mjs → test.handler-St9sBXyH.mjs} +1 -1
  98. package/dist/{trigger-artifacts-B3OCTX9K-ME6IVdUB.mjs → trigger-artifacts-RizI57RC-C-yCtEi-.mjs} +9 -9
  99. package/dist/{trigger-manifest-B3Gq1739.mjs → trigger-manifest-D5rnpPkA.mjs} +1 -1
  100. package/dist/{try-deploy.handler-dA_YGWRq.mjs → try-deploy.handler-BMcWQVST.mjs} +9 -9
  101. package/dist/{upgrade-xByIxaYu.mjs → upgrade-YavAf8AC.mjs} +2 -2
  102. package/dist/{upload.handler-BFDM6n_6.mjs → upload.handler-DemogvI1.mjs} +129 -18
  103. package/dist/{users.get.handler-CzaYM2bi.mjs → users.get.handler-B20PMSbl.mjs} +1 -1
  104. package/dist/{users.list.handler-CpOWwzBb.mjs → users.list.handler-BplFTjv3.mjs} +1 -1
  105. package/dist/{users.set-role.handler-BjiSNP2d.mjs → users.set-role.handler-wdmI6o3G.mjs} +1 -1
  106. package/dist/{utils-C_qCshBA.mjs → utils-DpEtybzI.mjs} +2 -2
  107. package/dist/{validate.handler-BtDSKAFY.mjs → validate.handler-DSAvNgns.mjs} +3 -3
  108. package/dist/{workflow-build-Z2_jkOsZ.mjs → workflow-build-Cmu1TOFu.mjs} +32 -32
  109. package/dist/{workflow-manifest-BfL74mjp.mjs → workflow-build-manifest-OPFqFD6f.mjs} +26 -28
  110. package/dist/{workflow-bundler-BzHk73PM-tt09RbIA.mjs → workflow-bundler-BzHk73PM-UJQa7Ubk.mjs} +2 -2
  111. package/dist/{workflows-V09d2r2H.mjs → workflows-DTlypo2t.mjs} +26 -27
  112. package/dist/{writer-CtvttJdP-DZJ0mZCm.mjs → writer-CtvttJdP-BfNsrheU.mjs} +5 -5
  113. package/package.json +11 -9
  114. package/dist/constants-BUgIAu2a.mjs +0 -8
  115. package/dist/credential-requirements-BCW8aQWS.mjs +0 -480
  116. package/dist/credentials-DAQfKqn0.mjs +0 -152025
  117. package/dist/get-intrinsic-BjqiGgLt.mjs +0 -658
  118. package/dist/hosted-action-dispatcher-registry-BWEtn13o.mjs +0 -126
  119. package/dist/schema-B-Wgo4rJ.mjs +0 -81
  120. package/dist/schemas-9FmGqrPT.mjs +0 -42
  121. package/dist/task-1qz1XNq7.mjs +0 -96
  122. package/dist/task-target-deploy-Bzfftyru.mjs +0 -4
  123. /package/dist/{agent-bundle-package-DWV6B_5q-B-qzc3zC.mjs → agent-bundle-package-DWV6B_5q-cB76j6UL.mjs} +0 -0
  124. /package/dist/{browser-CvuyMLhI.mjs → browser-B4K0VW8p.mjs} +0 -0
  125. /package/dist/{clear-cache.handler-D-wboLB6.mjs → clear-cache.handler-Dywqc7TG.mjs} +0 -0
  126. /package/dist/{clear.handler-BC6pz0x-.mjs → clear.handler-ui4e1CnJ.mjs} +0 -0
  127. /package/dist/{concurrency-gXn9Rw8x-CnBnF2cg.mjs → concurrency-gXn9Rw8x-CaI6Vtbu.mjs} +0 -0
  128. /package/dist/{credential-env-map-C23GV6LN.mjs → credential-env-map-D0zgoUl0.mjs} +0 -0
  129. /package/dist/{credential-schema-mismatch-DM9Y91jL.mjs → credential-schema-mismatch-8pqwvswO.mjs} +0 -0
  130. /package/dist/{diff-utils-AATn2n56.mjs → diff-utils-BoXI705D.mjs} +0 -0
  131. /package/dist/{layout-CXkZEsXI.mjs → layout-DRf9qUf8.mjs} +0 -0
  132. /package/dist/{logs.handler-ClIIOeQB.mjs → logs.handler-DxSKmDCq.mjs} +0 -0
  133. /package/dist/{metadata-layout-C6ed-9dl-C6Bylr_z.mjs → metadata-layout-C6ed-9dl-EF5pCtIH.mjs} +0 -0
  134. /package/dist/{options-CIVqkc8V.mjs → options-DFPs-tAB.mjs} +0 -0
  135. /package/dist/{oxc-B3KI3rf_-ghZc3xZ5.mjs → oxc-B3KI3rf_-CHDUXsus.mjs} +0 -0
  136. /package/dist/{read-credential-keys-77a91T8M-B0eiobOd.mjs → read-credential-keys-77a91T8M-CzXPGxdU.mjs} +0 -0
  137. /package/dist/{register.handler-CpP_KB2u.mjs → register.handler-D7ZZAnGP.mjs} +0 -0
  138. /package/dist/{rolldown-runtime-twds-ZHy-RuJszab7.mjs → rolldown-runtime-twds-ZHy-3DMm_Sby.mjs} +0 -0
  139. /package/dist/{run-polling-DDpkIvwy.mjs → run-polling-Cb4ssXIE.mjs} +0 -0
  140. /package/dist/{schema-display-DuWBmkwk.mjs → schema-display-CyCWSgfY.mjs} +0 -0
  141. /package/dist/{skills.handler-CofL4oKs.mjs → skills.handler-C_4VzVmc.mjs} +0 -0
  142. /package/dist/{spinner-progress-Bt8zXPOc.mjs → spinner-progress-CS1BEdNB.mjs} +0 -0
  143. /package/dist/{status.handler-6cuHa0R0.mjs → status.handler-Cm9aNUBn.mjs} +0 -0
  144. /package/dist/{sync-keystroke-agent-skills-D746f2W_.mjs → sync-keystroke-agent-skills-CX9fS5nQ.mjs} +0 -0
  145. /package/dist/{upgrade.handler-DhKeyCy5.mjs → upgrade.handler-C2eZ_tg3.mjs} +0 -0
  146. /package/dist/{upload-C1qFWMm0.mjs → upload-C0kaZu08.mjs} +0 -0
@@ -2,32 +2,32 @@
2
2
 
3
3
  import { N as throwReportedCliExit, a as getProcessEnv, k as CliExitError, n as ui, x as toErrorMessage } from "./keystroke.mjs";
4
4
  import { l as resolveAuthOptions } from "./dist-BF6r1hfv.mjs";
5
- import { t as assertWorkflowProjectRoot } from "./project-config-D9eFU8Jk.mjs";
5
+ import { t as assertWorkflowProjectRoot } from "./project-config-CJGSh2RQ.mjs";
6
6
  import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-CGdYhH0p.mjs";
7
- import { t as createTypedCommand } from "./commander-DcftG6dX.mjs";
8
- import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-1VgRbzr-.mjs";
9
- import { a as readManifestsFromOutDir } from "./dist-DvO0q6Fo.mjs";
10
- import { t as requireWorkflowsDir } from "./resolve-project-C6UAOfAG.mjs";
11
- import { a as registerHostedActionDispatcher, c as registerOperationCredentialResolver, f as registerOperationContext, g as getOfficialIntegrationMetadata, h as registerRuntime, n as clearHostedActionExecutionPolicy, o as registerHostedActionExecutionPolicy, p as clearRuntime, s as clearOperationCredentialResolver, t as clearHostedActionDispatcher, u as clearOperationContext } from "./hosted-action-dispatcher-registry-BWEtn13o.mjs";
12
- import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Z2_jkOsZ.mjs";
13
- import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-B05z0EQa.mjs";
14
- import { n as WorkflowsRunOptionsSchema, t as RUN_OPTIONS_CONFIG } from "./options-CIVqkc8V.mjs";
15
- import { t as handleWorkflowsTryDeploy } from "./try-deploy.handler-dA_YGWRq.mjs";
16
- import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-1CTIeDea.mjs";
7
+ import { t as createTypedCommand } from "./commander-BwtBoukr.mjs";
8
+ import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-DQ4IA0yO.mjs";
9
+ import { a as readManifestsFromOutDir } from "./dist-BMkNN03r.mjs";
10
+ import { t as requireWorkflowsDir } from "./resolve-project-bVPMcs-y.mjs";
11
+ import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Cmu1TOFu.mjs";
12
+ import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-zTmYbUjh.mjs";
13
+ import { n as WorkflowsRunOptionsSchema, t as RUN_OPTIONS_CONFIG } from "./options-DFPs-tAB.mjs";
14
+ import { t as handleWorkflowsTryDeploy } from "./try-deploy.handler-BMcWQVST.mjs";
15
+ import { n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-49w3PYAv.mjs";
17
16
  import { mkdtemp, rm, writeFile } from "node:fs/promises";
18
17
  import { tmpdir } from "node:os";
19
18
  import path from "node:path";
20
19
  import { pathToFileURL } from "node:url";
21
20
  import { z } from "zod";
22
- //#region ../../packages/core/src/test-runtime/credentials/env-resolver.ts
21
+ import { clearOperationContext, clearOperationCredentialResolver, registerOperationContext, registerOperationCredentialResolver } from "@keystrokehq/core/operation/runtime";
22
+ import { clearRuntime, registerRuntime } from "@keystrokehq/core/workflow/runtime";
23
+ //#region ../../packages/testing/src/test-runtime/credentials/env-resolver.ts
23
24
  /**
24
25
  * Computes the env var name for a credential key.
25
- * Uses the credential set's namespace as the prefix if present, otherwise the raw id.
26
- * e.g., namespace='keystroke', key='SLACK_BOT_TOKEN' → 'KEYSTROKE_SLACK_BOT_TOKEN'
27
- * id='my-api', key='API_KEY' → 'MY_API_API_KEY'
26
+ * Uses the credential set id as the prefix.
27
+ * e.g., id='my-api', key='API_KEY' → 'MY_API_API_KEY'
28
28
  */
29
29
  function normalizeEnvVarName(credentialSet, key) {
30
- return `${(credentialSet.namespace ?? credentialSet.id).replace(/[-]/g, "_").toUpperCase()}_${key}`;
30
+ return `${credentialSet.id.replace(/[-]/g, "_").toUpperCase()}_${key}`;
31
31
  }
32
32
  function getCredentialSetKeys(credentialSet) {
33
33
  return Object.keys(credentialSet.auth.shape);
@@ -51,7 +51,7 @@ function resolveCredentialsFromEnv(credentialSet, options = {}) {
51
51
  };
52
52
  }
53
53
  //#endregion
54
- //#region ../../packages/core/src/test-runtime/credentials/cache.ts
54
+ //#region ../../packages/testing/src/test-runtime/credentials/cache.ts
55
55
  function createCredentialCache() {
56
56
  const cache = /* @__PURE__ */ new Map();
57
57
  return { async getOrCreate(key, createValue) {
@@ -66,7 +66,7 @@ function createCredentialCache() {
66
66
  } };
67
67
  }
68
68
  //#endregion
69
- //#region ../../packages/core/src/test-runtime/credentials/server-resolver.ts
69
+ //#region ../../packages/testing/src/test-runtime/credentials/server-resolver.ts
70
70
  async function createServerCredentialResolver(options, dependencies = {
71
71
  fetch: globalThis.fetch,
72
72
  resolveAuthOptions
@@ -80,8 +80,8 @@ async function createServerCredentialResolver(options, dependencies = {
80
80
  if (!resolvedAuth.apiKey || !resolvedAuth.serverUrl) return;
81
81
  const cache = createCredentialCache();
82
82
  return { async resolveCredentialSet(credentialSet, keys) {
83
- const resolvedCredentialSetId = credentialSet.resolvedCredentialSetId;
84
- const cacheKey = `${resolvedCredentialSetId}:${[...keys].sort().join(",")}`;
83
+ const credentialDefinitionId = credentialSet.id;
84
+ const cacheKey = `${credentialDefinitionId}:${[...keys].sort().join(",")}`;
85
85
  return cache.getOrCreate(cacheKey, async () => {
86
86
  const response = await dependencies.fetch(new URL("api/v1/credentials/resolve", resolvedAuth.serverUrl).toString(), {
87
87
  method: "POST",
@@ -90,7 +90,7 @@ async function createServerCredentialResolver(options, dependencies = {
90
90
  "Content-Type": "application/json"
91
91
  },
92
92
  body: JSON.stringify({
93
- credentialSetId: resolvedCredentialSetId,
93
+ credentialSetId: credentialDefinitionId,
94
94
  keys: [...keys]
95
95
  })
96
96
  });
@@ -129,22 +129,15 @@ function humanizeCredentialSetLabel(credentialSet) {
129
129
  return credentialSet.id.split(/[-_]/u).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
130
130
  }
131
131
  //#endregion
132
- //#region ../../packages/core/src/test-runtime/credentials/create-test-credential-resolver.ts
132
+ //#region ../../packages/testing/src/test-runtime/credentials/create-test-credential-resolver.ts
133
133
  function pickMissingCredentialSets(credentialSets, existingCredentials) {
134
134
  return credentialSets.filter((credentialSet) => existingCredentials?.[credentialSet.id] === void 0);
135
135
  }
136
- function createHostedIntegrationCredentialError(integrationId, sourceLabel, guidance, reason) {
137
- const message = `Hosted integration "${integrationId}" cannot resolve credentials locally in ${sourceLabel}. Official hosted integrations must execute through the Keystroke dev server. ${guidance}`;
138
- return reason instanceof Error ? new Error(message, { cause: reason }) : new Error(message);
139
- }
140
- async function createTestCredentialResolver(options, runtimeOptions = {}) {
136
+ async function createTestCredentialResolver(options, _runtimeOptions = {}) {
141
137
  if (options.mode === "off") return;
142
- const sourceLabel = runtimeOptions.sourceLabel ?? "Keystroke test runtime";
143
- const createCredentialGuidance = (integrationId) => (runtimeOptions.credentialGuidance ?? "Run `keystroke auth`, configure server-backed credentials (for example `keystroke connect ${integrationId}` when applicable), then retry.").replaceAll("${integrationId}", integrationId);
144
138
  const serverResolver = options.mode === "env-only" ? void 0 : await createServerCredentialResolver(options);
145
139
  const warnedCredentialSets = /* @__PURE__ */ new Set();
146
140
  return { async resolveOperationCredentials(step, partialContext) {
147
- const hostedIntegrationMetadata = getOfficialIntegrationMetadata(step);
148
141
  const missingCredentialSets = pickMissingCredentialSets(step.credentialSets, partialContext.credentials);
149
142
  if (missingCredentialSets.length === 0) return;
150
143
  const resolvedCredentials = {};
@@ -155,15 +148,6 @@ async function createTestCredentialResolver(options, runtimeOptions = {}) {
155
148
  resolvedCredentials[credentialSet.id] = overrideCredentials;
156
149
  continue;
157
150
  }
158
- if (hostedIntegrationMetadata?.hosted) {
159
- if (!serverResolver) throw createHostedIntegrationCredentialError(hostedIntegrationMetadata.integrationId, sourceLabel, createCredentialGuidance(hostedIntegrationMetadata.integrationId));
160
- try {
161
- resolvedCredentials[credentialSet.id] = await serverResolver.resolveCredentialSet(credentialSet, requiredKeys);
162
- } catch (error) {
163
- throw createHostedIntegrationCredentialError(hostedIntegrationMetadata.integrationId, sourceLabel, createCredentialGuidance(hostedIntegrationMetadata.integrationId), error);
164
- }
165
- continue;
166
- }
167
151
  const envResult = resolveCredentialsFromEnv(credentialSet, { lenient: true });
168
152
  if (Object.keys(envResult.credentials).length > 0 && !warnedCredentialSets.has(credentialSet.id)) {
169
153
  warnedCredentialSets.add(credentialSet.id);
@@ -188,23 +172,11 @@ async function createTestCredentialResolver(options, runtimeOptions = {}) {
188
172
  } };
189
173
  }
190
174
  //#endregion
191
- //#region ../../packages/core/src/test-runtime/credentials/options.ts
175
+ //#region ../../packages/testing/src/test-runtime/credentials/options.ts
192
176
  const DEFAULT_TEST_CREDENTIAL_MODE = "auto";
193
177
  //#endregion
194
- //#region ../../packages/core/src/shared/create-mock-hook.ts
195
- /**
196
- * Creates a Hook that resolves immediately when awaited.
197
- *
198
- * Use when testing workflows that call ctx.createHook() (e.g., human-in-the-loop
199
- * approval steps). Without a mock, the workflow would block waiting for external
200
- * approval. This hook resolves immediately so tests complete without delay.
201
- *
202
- * @example
203
- * const runtime = createTestWorkflowContext({
204
- * createHook: () => createMockHook(),
205
- * });
206
- * await myWorkflow.run(input, runtime);
207
- */
178
+ //#region ../../packages/testing/src/shared/create-mock-hook.ts
179
+ /** Creates a Hook that resolves immediately when awaited. */
208
180
  function createMockHook() {
209
181
  const resolved = Promise.resolve(void 0);
210
182
  return {
@@ -216,7 +188,7 @@ function createMockHook() {
216
188
  };
217
189
  }
218
190
  //#endregion
219
- //#region ../../packages/core/src/test-runtime/helpers/create-test-workflow-context.ts
191
+ //#region ../../packages/testing/src/test-runtime/helpers/create-test-workflow-context.ts
220
192
  function createTestWorkflowContext(options = {}) {
221
193
  return {
222
194
  createHook: options.createHook ?? ((_name) => createMockHook()),
@@ -228,95 +200,15 @@ function createTestWorkflowContext(options = {}) {
228
200
  };
229
201
  }
230
202
  //#endregion
231
- //#region ../../packages/core/src/test-runtime/hosted-actions/create-test-hosted-action-dispatcher.ts
232
- function createHostedDispatchError(integrationId, sourceLabel, detail, cause) {
233
- const message = `Hosted integration "${integrationId}" failed in ${sourceLabel}. ${detail}`;
234
- return cause instanceof Error ? new Error(message, { cause }) : new Error(message);
235
- }
236
- async function createTestHostedActionDispatcher(options, dependencies = {
237
- fetch: globalThis.fetch,
238
- resolveAuthOptions
239
- }) {
240
- if (options.mode !== "auto") return;
241
- const source = options.source ?? "test-runtime";
242
- const sourceLabel = options.sourceLabel ?? "Keystroke test runtime";
243
- let resolvedAuth;
244
- let authResolutionError;
245
- try {
246
- resolvedAuth = await dependencies.resolveAuthOptions({
247
- apiKey: options.apiKey,
248
- serverUrl: options.baseUrl,
249
- credentialsPath: options.credentialsPath
250
- });
251
- } catch (error) {
252
- authResolutionError = error;
253
- }
254
- return { async dispatch(operation, integrationId, input) {
255
- const actionId = `${integrationId}.${operation.id}`;
256
- const publicCredentialSetId = (operation.credentialSets ?? [])[0]?.id ?? integrationId;
257
- if (authResolutionError) throw createHostedDispatchError(integrationId, sourceLabel, "Run `keystroke auth` and ensure the Keystroke dev server URL is configured before retrying.", authResolutionError);
258
- if (!resolvedAuth?.apiKey) throw createHostedDispatchError(integrationId, sourceLabel, "Run `keystroke auth` so the test runtime can authenticate hosted action dispatch.");
259
- if (!resolvedAuth.serverUrl) throw createHostedDispatchError(integrationId, sourceLabel, "Configure the Keystroke dev server URL and retry.");
260
- const { apiKey, serverUrl } = resolvedAuth;
261
- const organizationId = resolvedAuth.activeOrg?.organizationId ?? "local";
262
- try {
263
- const response = await dependencies.fetch(new URL("/api/v1/hosted-actions/dispatch", serverUrl).toString(), {
264
- method: "POST",
265
- headers: {
266
- Authorization: `Bearer ${apiKey}`,
267
- "Content-Type": "application/json"
268
- },
269
- body: JSON.stringify({
270
- version: 1,
271
- actionId,
272
- source,
273
- organizationId,
274
- connection: { publicCredentialSetId },
275
- correlation: { testRunId: crypto.randomUUID() },
276
- input
277
- })
278
- });
279
- if (response.status === 404) throw createHostedDispatchError(integrationId, sourceLabel, "The connected Keystroke server does not support hosted action dispatch for this integration.");
280
- if (response.status === 401 || response.status === 403) throw createHostedDispatchError(integrationId, sourceLabel, "Authentication failed. Run `keystroke auth`, confirm the active organization, and retry.");
281
- if (response.status === 422) {
282
- const text = await response.text().catch(() => "");
283
- throw createHostedDispatchError(integrationId, sourceLabel, "The Keystroke dev server is missing hosted/platform credentials for this integration. Configure the server-side credentials and retry.", new Error(text));
284
- }
285
- if (!response.ok) {
286
- const text = await response.text().catch(() => "");
287
- throw createHostedDispatchError(integrationId, sourceLabel, `Dispatch returned status ${response.status}. ${text}`.trim());
288
- }
289
- const body = await response.json();
290
- if (!body.ok) throw createHostedDispatchError(integrationId, sourceLabel, `Hosted action "${actionId}" failed: [${body.error?.code}] ${body.error?.message}`);
291
- return {
292
- handled: true,
293
- result: body.result
294
- };
295
- } catch (error) {
296
- if (error instanceof TypeError && "cause" in error) throw createHostedDispatchError(integrationId, sourceLabel, "The Keystroke dev server is unreachable. Start the server and retry.", error);
297
- throw error;
298
- }
299
- } };
300
- }
301
- //#endregion
302
- //#region ../../packages/core/src/test-runtime/runtime/create-keystroke-test-runtime.ts
203
+ //#region ../../packages/testing/src/test-runtime/runtime/create-keystroke-test-runtime.ts
303
204
  async function createKeystrokeTestRuntime(options = {}) {
304
- clearHostedActionDispatcher();
305
- clearHostedActionExecutionPolicy();
306
205
  clearOperationCredentialResolver();
307
206
  clearOperationContext();
308
207
  clearRuntime();
309
- const credentials = {
208
+ const credentialResolver = await createTestCredentialResolver({
310
209
  mode: DEFAULT_TEST_CREDENTIAL_MODE,
311
210
  ...options.credentials
312
- };
313
- const sourceLabel = options.sourceLabel ?? "Keystroke test runtime";
314
- const credentialResolver = await createTestCredentialResolver(credentials, { sourceLabel });
315
- const hostedActionDispatcher = await createTestHostedActionDispatcher({
316
- ...credentials,
317
- source: options.source,
318
- sourceLabel
319
- });
211
+ }, { sourceLabel: options.sourceLabel ?? "Keystroke test runtime" });
320
212
  registerRuntime({ getRuntime: () => ({
321
213
  context: createTestWorkflowContext(options),
322
214
  stepContext: options.stepContext
@@ -328,19 +220,15 @@ async function createKeystrokeTestRuntime(options = {}) {
328
220
  stepId: options.stepContext?.stepId ?? "test-step-run",
329
221
  workflowGlobals: options.workflowGlobals
330
222
  }) });
331
- if (credentials.mode !== "off") registerHostedActionExecutionPolicy("strict");
332
223
  if (credentialResolver) registerOperationCredentialResolver(credentialResolver);
333
- if (hostedActionDispatcher) registerHostedActionDispatcher(hostedActionDispatcher);
334
224
  return { dispose() {
335
- clearHostedActionDispatcher();
336
- clearHostedActionExecutionPolicy();
337
225
  clearOperationCredentialResolver();
338
226
  clearOperationContext();
339
227
  clearRuntime();
340
228
  } };
341
229
  }
342
230
  //#endregion
343
- //#region ../../packages/core/src/test-runtime/tools/create-test-tool-context.ts
231
+ //#region ../../packages/testing/src/test-runtime/tools/create-test-tool-context.ts
344
232
  /**
345
233
  * Builds a minimal `OperationRunContext` for tool/step unit tests.
346
234
  *
@@ -357,7 +245,7 @@ function createTestToolContext(options = {}) {
357
245
  };
358
246
  }
359
247
  //#endregion
360
- //#region ../../packages/core/src/test-runtime/tools/run-tool.ts
248
+ //#region ../../packages/testing/src/test-runtime/tools/run-tool.ts
361
249
  async function runTool(tool, input, options) {
362
250
  const ctx = createTestToolContext(options);
363
251
  return tool.run(input, ctx);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { n as ui } from "./keystroke.mjs";
4
- import { a as validateApiKey, i as requireClient } from "./context-1VgRbzr-.mjs";
4
+ import { a as validateApiKey, i as requireClient } from "./context-DQ4IA0yO.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,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { n as readOptionalJsonSchemaKeys } from "./declared-credential-requirements-BtlcsEVn.mjs";
4
- import { t as __exportAll } from "./rolldown-runtime-twds-ZHy-RuJszab7.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-D4o8gRZs.mjs";
3
+ import { n as readOptionalJsonSchemaKeys } from "./declared-credential-requirements-B6h4WRv4.mjs";
4
+ import { t as __exportAll } from "./rolldown-runtime-twds-ZHy-3DMm_Sby.mjs";
5
+ import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-CzXPGxdU.mjs";
6
+ import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-EmkYvbfJ.mjs";
7
7
  import { createHash } from "node:crypto";
8
8
  import { rolldown } from "rolldown";
9
- //#region ../../packages/workflow-builder/dist/trigger-artifacts-B3OCTX9K.mjs
9
+ //#region ../../packages/workflow-builder/dist/trigger-artifacts-RizI57RC.mjs
10
10
  async function bundleTriggerCallbacks(options) {
11
11
  return bundleCallbacks(options.filePath, options.projectRoot, options.exportNames, options.triggerExportName, options.workflowExtraction);
12
12
  }
@@ -214,19 +214,19 @@ function buildTriggerCredentialRequirements(credentialSets, callbacks) {
214
214
  const storedSchema = credentialSet.stored ?? credentialSet.auth;
215
215
  const storedCredentialKeys = readCredentialKeysFromSchemaObject(storedSchema);
216
216
  const optionalStoredCredentialKeys = readOptionalJsonSchemaKeys(storedSchema);
217
- const resolveCacheMs = "resolveCacheMs" in credentialSet && typeof credentialSet.resolveCacheMs === "number" ? credentialSet.resolveCacheMs : void 0;
217
+ const dynamicResolutionCacheMs = "dynamicResolutionCacheMs" in credentialSet && typeof credentialSet.dynamicResolutionCacheMs === "number" ? credentialSet.dynamicResolutionCacheMs : void 0;
218
218
  const topLevelRevoked = "onCredentialRevoked" in credentialSet ? credentialSet.onCredentialRevoked : void 0;
219
219
  return {
220
- credentialSetId: credentialSet.resolvedCredentialSetId,
220
+ credentialSetId: credentialSet.id,
221
221
  credentialKeys: readCredentialKeysFromSchemaObject(credentialSet.auth),
222
222
  ...optionalCredentialKeys.length > 0 ? { optionalCredentialKeys } : {},
223
223
  ...storedCredentialKeys.length > 0 ? { storedCredentialKeys } : {},
224
224
  ...optionalStoredCredentialKeys.length > 0 ? { optionalStoredCredentialKeys } : {},
225
- ...typeof resolveCacheMs === "number" && resolveCacheMs > 0 ? { resolveCacheMs } : {},
225
+ ...typeof dynamicResolutionCacheMs === "number" && dynamicResolutionCacheMs > 0 ? { dynamicResolutionCacheMs } : {},
226
226
  ...topLevelRevoked ? { onCredentialRevoked: topLevelRevoked } : {}
227
227
  };
228
228
  });
229
- const requiredIds = credentialSets.map((credentialSet) => credentialSet.resolvedCredentialSetId);
229
+ const requiredIds = credentialSets.map((credentialSet) => credentialSet.id);
230
230
  const byCallback = {};
231
231
  if (callbacks?.poll) byCallback.callback = entries;
232
232
  if (callbacks?.verify) byCallback.verify = entries;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { c as TriggerTypeSchema, o as TriggerCredentialRequirementsSchema, s as TriggerSourceSchema, u as WebhookMethodSchema } from "./credential-requirements-BCW8aQWS.mjs";
3
+ import { a as TriggerCredentialRequirementsSchema, l as WebhookMethodSchema, o as TriggerSourceSchema, s as TriggerTypeSchema } from "./credential-requirements-FtBk5JVB.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({
@@ -3,15 +3,15 @@
3
3
  import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
4
4
  import { k as CliExitError, n as ui, o as isLocalMode, x as toErrorMessage } from "./keystroke.mjs";
5
5
  import { d as trackProject } from "./dist-BF6r1hfv.mjs";
6
- import { t as assertWorkflowProjectRoot } from "./project-config-D9eFU8Jk.mjs";
7
- import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-1VgRbzr-.mjs";
8
- import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-DvO0q6Fo.mjs";
9
- import { t as requireWorkflowsDir } from "./resolve-project-C6UAOfAG.mjs";
10
- import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-Z2_jkOsZ.mjs";
11
- import { r as isUnknownSchema } from "./schema-display-DuWBmkwk.mjs";
12
- import { t as createBuildProgress } from "./build-progress-DigAP-BN.mjs";
13
- import { t as withErrorBoundary } from "./error-boundary-CpaVvFXk.mjs";
14
- import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-1CTIeDea.mjs";
6
+ import { t as assertWorkflowProjectRoot } from "./project-config-CJGSh2RQ.mjs";
7
+ import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-DQ4IA0yO.mjs";
8
+ import { o as readWorkflowsFromDisk, s as uploadTestBundle } from "./dist-BMkNN03r.mjs";
9
+ import { t as requireWorkflowsDir } from "./resolve-project-bVPMcs-y.mjs";
10
+ import { a as runWorkflowBuild, t as WorkflowNotFoundError } from "./workflow-build-Cmu1TOFu.mjs";
11
+ import { r as isUnknownSchema } from "./schema-display-CyCWSgfY.mjs";
12
+ import { t as createBuildProgress } from "./build-progress-CITED2tv.mjs";
13
+ import { t as withErrorBoundary } from "./error-boundary-B2ZKRkZI.mjs";
14
+ import { a as tryReadExistingInputSchema, n as resolveInput, o as validateInputOrExit, t as pollForCompletion } from "./run-polling-49w3PYAv.mjs";
15
15
  //#region src/lib/format.ts
16
16
  function formatBytes(bytes) {
17
17
  if (bytes < 1024) return `${bytes} B`;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { t as createTypedCommand } from "./commander-DcftG6dX.mjs";
3
+ import { t as createTypedCommand } from "./commander-BwtBoukr.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-DhKeyCy5.mjs")).handleUpgrade
37
+ loadHandler: async () => (await import("./upgrade.handler-C2eZ_tg3.mjs")).handleUpgrade
38
38
  });
39
39
  }
40
40
  //#endregion