@keystrokehq/cli 0.0.1 → 0.0.2

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 (151) hide show
  1. package/AGENTS-blurb.md +1 -1
  2. package/LICENSE +0 -21
  3. package/README.md +14 -6
  4. package/dist/accept.handler-DFtM0IuO.mjs +22 -0
  5. package/dist/admin-D_7tenRC.mjs +208 -0
  6. package/dist/{agent-manifest-CDnbkR2f.mjs → agent-manifest-Bfa3DBgc.mjs} +4 -4
  7. package/dist/{agents-CZJGxVqV.mjs → agents-DMEo-6QB.mjs} +8 -8
  8. package/dist/api-keys-BThGvtdn.mjs +58 -0
  9. package/dist/{auth-DN2VusyU.mjs → auth-Byry35LJ.mjs} +7 -11
  10. package/dist/{auth.handler-CT1BQUvu.mjs → auth.handler-BBPObKwk.mjs} +5 -5
  11. package/dist/{build-agents-BmM_AsSd-BGi9wtzt.mjs → build-agents-DfbiMZ_e-CRnzruSu.mjs} +7 -7
  12. package/dist/{build-metadata-BWS7uhd_-DR8gJjTX.mjs → build-metadata-zidV9Cai-RgG4ndIH.mjs} +11 -11
  13. package/dist/{build-progress-DgYKb4hB.mjs → build-progress-Cn2j1LqF.mjs} +1 -1
  14. package/dist/{build-tasks-CdihpudT-D5r5HUHe.mjs → build-tasks-O1jYtlv1-Y65uGWuz.mjs} +4 -5
  15. package/dist/{build-workflows-CfxBnIWh-CdYPv8w2.mjs → build-workflows-3fdvdHHf-DJ_lH1NH.mjs} +9 -9
  16. package/dist/{build.handler-4799CjWH.mjs → build.handler-Tb3IpABI.mjs} +5 -5
  17. package/dist/{clear-cache.handler-B9tqSoSM.mjs → clear-cache.handler-BEbPz5Ej.mjs} +1 -1
  18. package/dist/{clear.handler-BydlX-zE.mjs → clear.handler-CtOZ4aRn.mjs} +1 -1
  19. package/dist/{clear.handler-BTIXXPTJ.mjs → clear.handler-YS8gPriq.mjs} +2 -2
  20. package/dist/{commander-DfTVqQ-3.mjs → commander-DZ3F3CVq.mjs} +6 -5
  21. package/dist/common-BrVAdUyD.mjs +20 -0
  22. package/dist/{connect-BUXkeH0F.mjs → connect-DpQgYg8z.mjs} +3 -3
  23. package/dist/{connect.handler-CYel9cy6.mjs → connect.handler-DuRr_yyN.mjs} +5 -5
  24. package/dist/{context-T7HZuB97.mjs → context-Y1f1hGYy.mjs} +7 -7
  25. package/dist/create.handler-uNG3I4wS.mjs +24 -0
  26. package/dist/credential-requirements-DjDFthio.mjs +480 -0
  27. package/dist/{credential-schema-mismatch-BKo5PjcQ.mjs → credential-schema-mismatch-B-wwbCvw.mjs} +2 -2
  28. package/dist/{credentials-OfVHOtG3.mjs → credentials-DHlK_O4L.mjs} +823 -14
  29. package/dist/{credentials-CvmjU0lK.mjs → credentials-UpgEcaub.mjs} +7 -7
  30. package/dist/{current-deployment-workflow-poHt27i3.mjs → current-deployment-workflow-M8GEIHxv.mjs} +5 -5
  31. package/dist/{current.handler-B8zKzfPp.mjs → current.handler-BqPUKCvn.mjs} +1 -1
  32. package/dist/declared-credential-requirements-Bwlb-KZE.mjs +132 -0
  33. package/dist/default-urls-BS4twrsS.mjs +7 -0
  34. package/dist/{delete.handler-bAu1iXVQ.mjs → delete.handler-CJTHVZaz.mjs} +1 -1
  35. package/dist/{deploy-7Jjls436.mjs → deploy-CdnaZY3s.mjs} +1 -1
  36. package/dist/{deploy-BOPIpRWm.mjs → deploy-Gw0KPrkf.mjs} +2 -2
  37. package/dist/{deploy-progress-BmGUNFKg.mjs → deploy-progress-CZ2rPlOj.mjs} +1 -1
  38. package/dist/{deploy.handler-BAzgiNhd.mjs → deploy.handler-zzFAt7pp.mjs} +18 -18
  39. package/dist/{detect-env-access-CwkOYeYM-D_BCZqV6.mjs → detect-env-access-CwkOYeYM-h2W05D_Q.mjs} +1 -1
  40. package/dist/{diff.handler-Du7SY8K4.mjs → diff.handler--zdSkUnK.mjs} +5 -5
  41. package/dist/{dist-CUK7yBM0.mjs → dist-BF6r1hfv.mjs} +3 -3
  42. package/dist/{dist-BkJUoBiG.mjs → dist-C2Dq_nx3.mjs} +12 -12
  43. package/dist/{env-91KwMKov.mjs → env-YTZGKGIu.mjs} +9 -10
  44. package/dist/{env.handler-BAzBuMzQ.mjs → env.handler-d4sJ706C.mjs} +8 -8
  45. package/dist/{error-boundary-VL-JLfIa.mjs → error-boundary-B9PgBkv8.mjs} +2 -2
  46. package/dist/{file-metadata-D1vm-XY2.mjs → file-metadata-CdFXMMIw.mjs} +1 -1
  47. package/dist/hosted-action-dispatcher-registry-TOVzMhUR.mjs +126 -0
  48. package/dist/iam-command-utils-CNC8JfZ5.mjs +72 -0
  49. package/dist/{import-module-CV84H5fZ-B_CBCmb4.mjs → import-module-DDPnzlJ1-CYJD2n2b.mjs} +395 -10
  50. package/dist/{init-DpMCotSK.mjs → init-C0sps8R7.mjs} +2 -2
  51. package/dist/{init.handler-CPRnif52.mjs → init.handler-DSW6XFZn.mjs} +17 -17
  52. package/dist/{inspect.handler-DT_cD036.mjs → inspect.handler-DbN0ZVTh.mjs} +5 -5
  53. package/dist/{integration-catalog-Bt-L3GjF.mjs → integration-catalog-DFlytKJS.mjs} +2 -2
  54. package/dist/{integrations-DlatPK4W.mjs → integrations-Dcadds2b.mjs} +5 -5
  55. package/dist/invites-DvsxTRAb.mjs +44 -0
  56. package/dist/invites.list.handler-B5quln3m.mjs +43 -0
  57. package/dist/invites.resend.handler-CSpj7bQ5.mjs +23 -0
  58. package/dist/invites.revoke.handler-_hdEkBdO.mjs +28 -0
  59. package/dist/keystroke.mjs +31 -22
  60. package/dist/{list-enrichment-y-cwizLr.mjs → list-enrichment-CTqx0Rk_.mjs} +1 -1
  61. package/dist/{list.handler-CWF_Dj15.mjs → list.handler-08GY-wnx.mjs} +1 -1
  62. package/dist/{list.handler-DWaQkJaR.mjs → list.handler-20v4uRMk.mjs} +2 -2
  63. package/dist/{list.handler-BTWvCyjA.mjs → list.handler-BRq-nScx.mjs} +5 -5
  64. package/dist/{list.handler-lq3ZGAn4.mjs → list.handler-CWO6DExh.mjs} +3 -3
  65. package/dist/{list.handler-CZ6G2x_G.mjs → list.handler-DAiJtW20.mjs} +3 -3
  66. package/dist/list.handler-DLl8ca6F.mjs +42 -0
  67. package/dist/{list.handler-DqbFcBW7.mjs → list.handler-DSPr0OxS.mjs} +7 -7
  68. package/dist/{logs-BEg9L5l8.mjs → logs-D_48skmi.mjs} +3 -3
  69. package/dist/{logs.handler-BD_dXiL1.mjs → logs.handler-4ctMVYMj.mjs} +3 -3
  70. package/dist/{logs.handler-6hoMBzqw.mjs → logs.handler-C3QnSCaH.mjs} +1 -1
  71. package/dist/members.add.handler-Dq_giQ8g.mjs +31 -0
  72. package/dist/members.invite.handler-v404bUsq.mjs +32 -0
  73. package/dist/members.list.handler-D6TE0yp8.mjs +43 -0
  74. package/dist/members.remove.handler-BhQ3cyeR.mjs +28 -0
  75. package/dist/members.update.handler-BVy2cv1K.mjs +28 -0
  76. package/dist/{metadata-layout-GUYIUo0i-_aG2zjue.mjs → metadata-layout-C6ed-9dl-aBmqqvD5.mjs} +2 -2
  77. package/dist/{normalize-path-CojS-CgQ-DLCOvnD1.mjs → normalize-path-CojS-CgQ-BKRFUzWW.mjs} +1 -1
  78. package/dist/org-CkRr-f3S.mjs +234 -0
  79. package/dist/orgs.create.handler-swGnT2ce.mjs +26 -0
  80. package/dist/orgs.get.handler-ClAqYTH0.mjs +28 -0
  81. package/dist/orgs.list.handler-D-ptz8It.mjs +41 -0
  82. package/dist/{paused.handler-BMFm9Cff.mjs → paused.handler-B3aVqw-m.mjs} +2 -2
  83. package/dist/{project-config-D1qsQlO7.mjs → project-config-opj6DsPF.mjs} +2 -2
  84. package/dist/{projects-CHkRE9rS.mjs → projects-Bdl6-Z8l.mjs} +2 -2
  85. package/dist/{projects-Cjb7sovS.mjs → projects-yA9AAaDM.mjs} +5 -5
  86. package/dist/{register.handler-BPCdor1_.mjs → register.handler-WzpvVXHx.mjs} +1 -1
  87. package/dist/{requirements.handler-DPXdSks3.mjs → requirements.handler-coArDE8x.mjs} +7 -7
  88. package/dist/{resolve-project-DDJ29sCF.mjs → resolve-project-DgfftdPm.mjs} +2 -2
  89. package/dist/{runs-D9hNLb9A.mjs → runs-B8mW4PqP.mjs} +3 -3
  90. package/dist/schedule-BRN4hzQM.mjs +505 -0
  91. package/dist/schema-_FQrHcIS.mjs +17 -0
  92. package/dist/schema-kbMHVnhm.mjs +81 -0
  93. package/dist/schemas-DsvCZfF0.mjs +42 -0
  94. package/dist/{skills-sync.handler-DIy8GR16.mjs → skills-sync.handler-C2faeat-.mjs} +2 -2
  95. package/dist/{skills.command-CrjI2dN9.mjs → skills.command-DWxcc3Ui.mjs} +4 -4
  96. package/dist/source-analysis-BspLa3E5.mjs +75 -0
  97. package/dist/{source-analysis-Cj-ADyu--BJQcFPCG.mjs → source-analysis-DEEChuND-eixwPnPP.mjs} +5 -5
  98. package/dist/{src-eHwu-Gfw.mjs → src-J09NGJ6Z.mjs} +42 -6
  99. package/dist/{switch.handler-D_9213Vf.mjs → switch.handler-C4hgbhcH.mjs} +2 -2
  100. package/dist/{sync-BL_Mo5st.mjs → sync-CL6zXiiA.mjs} +2 -2
  101. package/dist/{sync.handler-BUFPdzWz.mjs → sync.handler-D1uF8E8I.mjs} +8 -8
  102. package/dist/{schemas-CDib1RhE.mjs → task-DsrXI6XH.mjs} +10 -39
  103. package/dist/{task-target-build-CBeCKbu2.mjs → task-target-build-DTzz4fpG.mjs} +4 -4
  104. package/dist/task-target-deploy-BPLlP__P.mjs +4 -0
  105. package/dist/{task-target-deploy-CA6elFpF-BEr4gkol.mjs → task-target-deploy-Bf5i3ox1-BU16VPsE.mjs} +2 -3
  106. package/dist/task-target-deploy-runner.mjs +15 -14
  107. package/dist/{test-BHTgR3UA.mjs → test-BsTLXIPB.mjs} +31 -31
  108. package/dist/{test.handler-BcPQ8b74.mjs → test.handler-D25kziPi.mjs} +1 -1
  109. package/dist/{trigger-artifacts-DQPbQNqC-B4yeeFBY.mjs → trigger-artifacts-B3OCTX9K-DG-FGGJT.mjs} +5 -5
  110. package/dist/{trigger-manifest-CY7brZeg.mjs → trigger-manifest-CXD9I7Rb.mjs} +1 -2
  111. package/dist/{try-deploy.handler-DqybNhXx.mjs → try-deploy.handler-2aX5TmLk.mjs} +11 -11
  112. package/dist/{upload.handler-DCtiznQp.mjs → upload.handler-CqProKVJ.mjs} +10 -10
  113. package/dist/users.get.handler-C_d2GWKX.mjs +24 -0
  114. package/dist/users.list.handler-DXAsO8Yk.mjs +36 -0
  115. package/dist/users.set-role.handler-Bn_yV4RI.mjs +27 -0
  116. package/dist/{utils-CywxCDM7.mjs → utils-DlYHjGg9.mjs} +2 -2
  117. package/dist/{validate.handler-DOcTaJL0.mjs → validate.handler-CGD6GttR.mjs} +5 -5
  118. package/dist/{workflow-build-DBQaBfnn.mjs → workflow-build-BcaIdRR6.mjs} +22 -45
  119. package/dist/{workflow-bundler-BPiqVscj-X1PFFAuP.mjs → workflow-bundler-BzHk73PM-Cde7cKiU.mjs} +4 -4
  120. package/dist/{_manifest-JSRE3H8k.mjs → workflow-manifest-CAW5FlX0.mjs} +7 -131
  121. package/dist/{workflows-g9z87AJJ.mjs → workflows-S-gbfw8f.mjs} +16 -15
  122. package/dist/{writer-BG8poUm3-BbXlU2kI.mjs → writer-CtvttJdP-DrJruQgR.mjs} +8 -8
  123. package/package.json +9 -11
  124. package/THIRD_PARTY_NOTICES.md +0 -16
  125. package/dist/api-keys-D2lgguuY.mjs +0 -40
  126. package/dist/org-xLzBtt2_.mjs +0 -41
  127. package/dist/schedule-BXx3uXwr.mjs +0 -1142
  128. package/dist/src-C0X6u_Mw.mjs +0 -1340
  129. package/dist/task-B2sZMaZu.mjs +0 -8
  130. package/dist/task-target-deploy-C5X-USeR.mjs +0 -4
  131. /package/dist/{agent-bundle-package-DWV6B_5q-BtV7Xycc.mjs → agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs} +0 -0
  132. /package/dist/{browser-qwFrUH82.mjs → browser-gddMccBQ.mjs} +0 -0
  133. /package/dist/{concurrency-gXn9Rw8x-DNl2YtrS.mjs → concurrency-gXn9Rw8x-BTlfau8D.mjs} +0 -0
  134. /package/dist/{constants-CPpPdSNg.mjs → constants-DHdiT5hc.mjs} +0 -0
  135. /package/dist/{credential-env-map-CI8yWHVy.mjs → credential-env-map-C8P7uTD-.mjs} +0 -0
  136. /package/dist/{diff-utils-NEfcjqxt.mjs → diff-utils-DWNcRA8g.mjs} +0 -0
  137. /package/dist/{get-intrinsic-zLxwtrLK.mjs → get-intrinsic-ZMBBjBEr.mjs} +0 -0
  138. /package/dist/{layout-CbMtQ2tm.mjs → layout-B95Tku8F.mjs} +0 -0
  139. /package/dist/{options-CeaTcFxP.mjs → options-Dn9t3K4a.mjs} +0 -0
  140. /package/dist/{output-DM4b7KgY.mjs → output-q4KljAhu.mjs} +0 -0
  141. /package/dist/{oxc-B3KI3rf_-n9d1hKNq.mjs → oxc-B3KI3rf_-BeimiQ2U.mjs} +0 -0
  142. /package/dist/{read-credential-keys-77a91T8M-KA0Iw0Z1.mjs → read-credential-keys-77a91T8M-CAJLnMRi.mjs} +0 -0
  143. /package/dist/{rolldown-runtime-twds-ZHy-BWWzu8VG.mjs → rolldown-runtime-twds-ZHy-8uqgIurC.mjs} +0 -0
  144. /package/dist/{run-polling-CAgFRdK3.mjs → run-polling-CTzhTgyN.mjs} +0 -0
  145. /package/dist/{schema-17qMfNyI.mjs → schema-Di90TXoX.mjs} +0 -0
  146. /package/dist/{schema-display-CgmeKigW.mjs → schema-display-D4A1gQEM.mjs} +0 -0
  147. /package/dist/{skills.handler-Bz8bJKql.mjs → skills.handler-8KCSF7wp.mjs} +0 -0
  148. /package/dist/{spinner-progress-DMVwgqO9.mjs → spinner-progress-bvKd1jXc.mjs} +0 -0
  149. /package/dist/{status.handler-BO4nwvWn.mjs → status.handler-D9GBEmao.mjs} +0 -0
  150. /package/dist/{sync-keystroke-agent-skills-Kx_H7UTd.mjs → sync-keystroke-agent-skills-CY9h25_5.mjs} +0 -0
  151. /package/dist/{upload-CkU--iDC.mjs → upload-B8fiWveA.mjs} +0 -0
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { D as throwReportedCliExit, h as toErrorMessage, o as ANSI, s as style, t as ui } from "./keystroke.mjs";
4
- import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DM4b7KgY.mjs";
5
- import { t as createTypedCommand } from "./commander-DfTVqQ-3.mjs";
6
- import { i as requireClient } from "./context-T7HZuB97.mjs";
4
+ import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-q4KljAhu.mjs";
5
+ import { t as createTypedCommand } from "./commander-DZ3F3CVq.mjs";
6
+ import { i as requireClient } from "./context-Y1f1hGYy.mjs";
7
7
  import { z } from "zod";
8
8
  //#region src/commands/runs/inspect-display.ts
9
9
  function renderRunInspect(input) {
@@ -0,0 +1,505 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { z } from "zod";
4
+ //#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/utils.js
5
+ function extractDateElements(date) {
6
+ return {
7
+ second: date.getSeconds(),
8
+ minute: date.getMinutes(),
9
+ hour: date.getHours(),
10
+ day: date.getDate(),
11
+ month: date.getMonth(),
12
+ weekday: date.getDay(),
13
+ year: date.getFullYear()
14
+ };
15
+ }
16
+ function getDaysInMonth(year, month) {
17
+ return new Date(year, month + 1, 0).getDate();
18
+ }
19
+ function getDaysBetweenWeekdays(weekday1, weekday2) {
20
+ if (weekday1 <= weekday2) return weekday2 - weekday1;
21
+ return 6 - weekday1 + weekday2 + 1;
22
+ }
23
+ //#endregion
24
+ //#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron.js
25
+ var Cron = class {
26
+ constructor({ seconds, minutes, hours, days, months, weekdays }) {
27
+ if (!seconds || seconds.size === 0) throw new Error("There must be at least one allowed second.");
28
+ if (!minutes || minutes.size === 0) throw new Error("There must be at least one allowed minute.");
29
+ if (!hours || hours.size === 0) throw new Error("There must be at least one allowed hour.");
30
+ if (!months || months.size === 0) throw new Error("There must be at least one allowed month.");
31
+ if ((!weekdays || weekdays.size === 0) && (!days || days.size === 0)) throw new Error("There must be at least one allowed day or weekday.");
32
+ this.seconds = Array.from(seconds).sort((a, b) => a - b);
33
+ this.minutes = Array.from(minutes).sort((a, b) => a - b);
34
+ this.hours = Array.from(hours).sort((a, b) => a - b);
35
+ this.days = Array.from(days).sort((a, b) => a - b);
36
+ this.months = Array.from(months).sort((a, b) => a - b);
37
+ this.weekdays = Array.from(weekdays).sort((a, b) => a - b);
38
+ const validateData = (name, data, constraint) => {
39
+ 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}`);
40
+ };
41
+ validateData("seconds", this.seconds, {
42
+ min: 0,
43
+ max: 59
44
+ });
45
+ validateData("minutes", this.minutes, {
46
+ min: 0,
47
+ max: 59
48
+ });
49
+ validateData("hours", this.hours, {
50
+ min: 0,
51
+ max: 23
52
+ });
53
+ validateData("days", this.days, {
54
+ min: 1,
55
+ max: 31
56
+ });
57
+ validateData("months", this.months, {
58
+ min: 0,
59
+ max: 11
60
+ });
61
+ validateData("weekdays", this.weekdays, {
62
+ min: 0,
63
+ max: 6
64
+ });
65
+ this.reversed = {
66
+ seconds: this.seconds.map((x) => x).reverse(),
67
+ minutes: this.minutes.map((x) => x).reverse(),
68
+ hours: this.hours.map((x) => x).reverse(),
69
+ days: this.days.map((x) => x).reverse(),
70
+ months: this.months.map((x) => x).reverse(),
71
+ weekdays: this.weekdays.map((x) => x).reverse()
72
+ };
73
+ }
74
+ /**
75
+ * Find the next or previous hour, starting from the given start hour that matches the hour constraint.
76
+ * startHour itself might also be allowed.
77
+ */
78
+ findAllowedHour(dir, startHour) {
79
+ return dir === "next" ? this.hours.find((x) => x >= startHour) : this.reversed.hours.find((x) => x <= startHour);
80
+ }
81
+ /**
82
+ * Find the next or previous minute, starting from the given start minute that matches the minute constraint.
83
+ * startMinute itself might also be allowed.
84
+ */
85
+ findAllowedMinute(dir, startMinute) {
86
+ return dir === "next" ? this.minutes.find((x) => x >= startMinute) : this.reversed.minutes.find((x) => x <= startMinute);
87
+ }
88
+ /**
89
+ * Find the next or previous second, starting from the given start second that matches the second constraint.
90
+ * startSecond itself IS NOT allowed.
91
+ */
92
+ findAllowedSecond(dir, startSecond) {
93
+ return dir === "next" ? this.seconds.find((x) => x > startSecond) : this.reversed.seconds.find((x) => x < startSecond);
94
+ }
95
+ /**
96
+ * Find the next or previous time, starting from the given start time that matches the hour, minute
97
+ * and second constraints. startTime itself might also be allowed.
98
+ */
99
+ findAllowedTime(dir, startTime) {
100
+ let hour = this.findAllowedHour(dir, startTime.hour);
101
+ if (hour !== void 0) if (hour === startTime.hour) {
102
+ let minute = this.findAllowedMinute(dir, startTime.minute);
103
+ if (minute !== void 0) if (minute === startTime.minute) {
104
+ const second = this.findAllowedSecond(dir, startTime.second);
105
+ if (second !== void 0) return {
106
+ hour,
107
+ minute,
108
+ second
109
+ };
110
+ minute = this.findAllowedMinute(dir, dir === "next" ? startTime.minute + 1 : startTime.minute - 1);
111
+ if (minute !== void 0) return {
112
+ hour,
113
+ minute,
114
+ second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
115
+ };
116
+ } else return {
117
+ hour,
118
+ minute,
119
+ second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
120
+ };
121
+ hour = this.findAllowedHour(dir, dir === "next" ? startTime.hour + 1 : startTime.hour - 1);
122
+ if (hour !== void 0) return {
123
+ hour,
124
+ minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
125
+ second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
126
+ };
127
+ } else return {
128
+ hour,
129
+ minute: dir === "next" ? this.minutes[0] : this.reversed.minutes[0],
130
+ second: dir === "next" ? this.seconds[0] : this.reversed.seconds[0]
131
+ };
132
+ }
133
+ /**
134
+ * Find the next or previous day in the given month, starting from the given startDay
135
+ * that matches either the day or the weekday constraint. startDay itself might also be allowed.
136
+ */
137
+ findAllowedDayInMonth(dir, year, month, startDay) {
138
+ var _a, _b;
139
+ if (startDay < 1) throw new Error("startDay must not be smaller than 1.");
140
+ const daysInMonth = getDaysInMonth(year, month);
141
+ const daysRestricted = this.days.length !== 31;
142
+ const weekdaysRestricted = this.weekdays.length !== 7;
143
+ if (!daysRestricted && !weekdaysRestricted) {
144
+ if (startDay > daysInMonth) return dir === "next" ? void 0 : daysInMonth;
145
+ return startDay;
146
+ }
147
+ let allowedDayByDays;
148
+ if (daysRestricted) {
149
+ allowedDayByDays = dir === "next" ? this.days.find((x) => x >= startDay) : this.reversed.days.find((x) => x <= startDay);
150
+ if (allowedDayByDays !== void 0 && allowedDayByDays > daysInMonth) allowedDayByDays = void 0;
151
+ }
152
+ let allowedDayByWeekdays;
153
+ if (weekdaysRestricted) {
154
+ const startWeekday = new Date(year, month, startDay).getDay();
155
+ 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];
156
+ if (nearestAllowedWeekday !== void 0) {
157
+ const daysBetweenWeekdays = dir === "next" ? getDaysBetweenWeekdays(startWeekday, nearestAllowedWeekday) : getDaysBetweenWeekdays(nearestAllowedWeekday, startWeekday);
158
+ allowedDayByWeekdays = dir === "next" ? startDay + daysBetweenWeekdays : startDay - daysBetweenWeekdays;
159
+ if (allowedDayByWeekdays > daysInMonth || allowedDayByWeekdays < 1) allowedDayByWeekdays = void 0;
160
+ }
161
+ }
162
+ if (allowedDayByDays !== void 0 && allowedDayByWeekdays !== void 0) return dir === "next" ? Math.min(allowedDayByDays, allowedDayByWeekdays) : Math.max(allowedDayByDays, allowedDayByWeekdays);
163
+ if (allowedDayByDays !== void 0) return allowedDayByDays;
164
+ if (allowedDayByWeekdays !== void 0) return allowedDayByWeekdays;
165
+ }
166
+ /** Gets the next date starting from the given start date or now. */
167
+ getNextDate(startDate = /* @__PURE__ */ new Date()) {
168
+ const startDateElements = extractDateElements(startDate);
169
+ let minYear = startDateElements.year;
170
+ let startIndexMonth = this.months.findIndex((x) => x >= startDateElements.month);
171
+ if (startIndexMonth === -1) {
172
+ startIndexMonth = 0;
173
+ minYear++;
174
+ }
175
+ const maxIterations = this.months.length * 5;
176
+ for (let i = 0; i < maxIterations; i++) {
177
+ const year = minYear + Math.floor((startIndexMonth + i) / this.months.length);
178
+ const month = this.months[(startIndexMonth + i) % this.months.length];
179
+ const isStartMonth = year === startDateElements.year && month === startDateElements.month;
180
+ let day = this.findAllowedDayInMonth("next", year, month, isStartMonth ? startDateElements.day : 1);
181
+ let isStartDay = isStartMonth && day === startDateElements.day;
182
+ if (day !== void 0 && isStartDay) {
183
+ const nextTime = this.findAllowedTime("next", startDateElements);
184
+ if (nextTime !== void 0) return new Date(year, month, day, nextTime.hour, nextTime.minute, nextTime.second);
185
+ day = this.findAllowedDayInMonth("next", year, month, day + 1);
186
+ isStartDay = false;
187
+ }
188
+ if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.hours[0], this.minutes[0], this.seconds[0]);
189
+ }
190
+ throw new Error("No valid next date was found.");
191
+ }
192
+ /** Gets the specified amount of future dates starting from the given start date or now. */
193
+ getNextDates(amount, startDate) {
194
+ const dates = [];
195
+ let nextDate;
196
+ for (let i = 0; i < amount; i++) {
197
+ nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
198
+ dates.push(nextDate);
199
+ }
200
+ return dates;
201
+ }
202
+ /**
203
+ * Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now.
204
+ * The iterator runs until the optional endDate is reached or forever.
205
+ */
206
+ *getNextDatesIterator(startDate, endDate) {
207
+ let nextDate;
208
+ while (true) {
209
+ nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);
210
+ if (endDate && endDate.getTime() < nextDate.getTime()) return;
211
+ yield nextDate;
212
+ }
213
+ }
214
+ /** Gets the previous date starting from the given start date or now. */
215
+ getPrevDate(startDate = /* @__PURE__ */ new Date()) {
216
+ const startDateElements = extractDateElements(startDate);
217
+ let maxYear = startDateElements.year;
218
+ let startIndexMonth = this.reversed.months.findIndex((x) => x <= startDateElements.month);
219
+ if (startIndexMonth === -1) {
220
+ startIndexMonth = 0;
221
+ maxYear--;
222
+ }
223
+ const maxIterations = this.reversed.months.length * 5;
224
+ for (let i = 0; i < maxIterations; i++) {
225
+ const year = maxYear - Math.floor((startIndexMonth + i) / this.reversed.months.length);
226
+ const month = this.reversed.months[(startIndexMonth + i) % this.reversed.months.length];
227
+ const isStartMonth = year === startDateElements.year && month === startDateElements.month;
228
+ let day = this.findAllowedDayInMonth("prev", year, month, isStartMonth ? startDateElements.day : getDaysInMonth(year, month));
229
+ let isStartDay = isStartMonth && day === startDateElements.day;
230
+ if (day !== void 0 && isStartDay) {
231
+ const prevTime = this.findAllowedTime("prev", startDateElements);
232
+ if (prevTime !== void 0) return new Date(year, month, day, prevTime.hour, prevTime.minute, prevTime.second);
233
+ if (day > 1) {
234
+ day = this.findAllowedDayInMonth("prev", year, month, day - 1);
235
+ isStartDay = false;
236
+ }
237
+ }
238
+ if (day !== void 0 && !isStartDay) return new Date(year, month, day, this.reversed.hours[0], this.reversed.minutes[0], this.reversed.seconds[0]);
239
+ }
240
+ throw new Error("No valid previous date was found.");
241
+ }
242
+ /** Gets the specified amount of previous dates starting from the given start date or now. */
243
+ getPrevDates(amount, startDate) {
244
+ const dates = [];
245
+ let prevDate;
246
+ for (let i = 0; i < amount; i++) {
247
+ prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
248
+ dates.push(prevDate);
249
+ }
250
+ return dates;
251
+ }
252
+ /**
253
+ * Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now.
254
+ * The iterator runs until the optional endDate is reached or forever.
255
+ */
256
+ *getPrevDatesIterator(startDate, endDate) {
257
+ let prevDate;
258
+ while (true) {
259
+ prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);
260
+ if (endDate && endDate.getTime() > prevDate.getTime()) return;
261
+ yield prevDate;
262
+ }
263
+ }
264
+ /** Returns true when there is a cron date at the given date. */
265
+ matchDate(date) {
266
+ const { second, minute, hour, day, month, weekday } = extractDateElements(date);
267
+ if (this.seconds.indexOf(second) === -1 || this.minutes.indexOf(minute) === -1 || this.hours.indexOf(hour) === -1 || this.months.indexOf(month) === -1) return false;
268
+ if (this.days.length !== 31 && this.weekdays.length !== 7) return this.days.indexOf(day) !== -1 || this.weekdays.indexOf(weekday) !== -1;
269
+ return this.days.indexOf(day) !== -1 && this.weekdays.indexOf(weekday) !== -1;
270
+ }
271
+ };
272
+ //#endregion
273
+ //#region ../../node_modules/.pnpm/cron-schedule@6.0.0/node_modules/cron-schedule/dist/cron-parser.js
274
+ const secondConstraint = {
275
+ min: 0,
276
+ max: 59
277
+ };
278
+ const minuteConstraint = {
279
+ min: 0,
280
+ max: 59
281
+ };
282
+ const hourConstraint = {
283
+ min: 0,
284
+ max: 23
285
+ };
286
+ const dayConstraint = {
287
+ min: 1,
288
+ max: 31
289
+ };
290
+ const monthConstraint = {
291
+ min: 1,
292
+ max: 12,
293
+ aliases: {
294
+ jan: "1",
295
+ feb: "2",
296
+ mar: "3",
297
+ apr: "4",
298
+ may: "5",
299
+ jun: "6",
300
+ jul: "7",
301
+ aug: "8",
302
+ sep: "9",
303
+ oct: "10",
304
+ nov: "11",
305
+ dec: "12"
306
+ }
307
+ };
308
+ const weekdayConstraint = {
309
+ min: 0,
310
+ max: 7,
311
+ aliases: {
312
+ mon: "1",
313
+ tue: "2",
314
+ wed: "3",
315
+ thu: "4",
316
+ fri: "5",
317
+ sat: "6",
318
+ sun: "7"
319
+ }
320
+ };
321
+ const timeNicknames = {
322
+ "@yearly": "0 0 1 1 *",
323
+ "@annually": "0 0 1 1 *",
324
+ "@monthly": "0 0 1 * *",
325
+ "@weekly": "0 0 * * 0",
326
+ "@daily": "0 0 * * *",
327
+ "@hourly": "0 * * * *",
328
+ "@minutely": "* * * * *"
329
+ };
330
+ function parseElement(element, constraint) {
331
+ const result = /* @__PURE__ */ new Set();
332
+ if (element === "*") {
333
+ for (let i = constraint.min; i <= constraint.max; i = i + 1) result.add(i);
334
+ return result;
335
+ }
336
+ const listElements = element.split(",");
337
+ if (listElements.length > 1) {
338
+ for (const listElement of listElements) {
339
+ const parsedListElement = parseElement(listElement, constraint);
340
+ for (const x of parsedListElement) result.add(x);
341
+ }
342
+ return result;
343
+ }
344
+ const parseSingleElement = (singleElement) => {
345
+ var _a, _b;
346
+ singleElement = (_b = (_a = constraint.aliases) === null || _a === void 0 ? void 0 : _a[singleElement.toLowerCase()]) !== null && _b !== void 0 ? _b : singleElement;
347
+ const parsedElement = Number.parseInt(singleElement, 10);
348
+ if (Number.isNaN(parsedElement)) throw new Error(`Failed to parse ${element}: ${singleElement} is NaN.`);
349
+ 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}.`);
350
+ return parsedElement;
351
+ };
352
+ const rangeSegments = /^(([0-9a-zA-Z]+)-([0-9a-zA-Z]+)|\*)(\/([0-9]+))?$/.exec(element);
353
+ if (rangeSegments === null) {
354
+ result.add(parseSingleElement(element));
355
+ return result;
356
+ }
357
+ let parsedStart = rangeSegments[1] === "*" ? constraint.min : parseSingleElement(rangeSegments[2]);
358
+ const parsedEnd = rangeSegments[1] === "*" ? constraint.max : parseSingleElement(rangeSegments[3]);
359
+ if (constraint === weekdayConstraint && parsedStart === 7 && parsedEnd !== 7) parsedStart = 0;
360
+ if (parsedStart > parsedEnd) throw new Error(`Failed to parse ${element}: Invalid range (start: ${parsedStart}, end: ${parsedEnd}).`);
361
+ const step = rangeSegments[5];
362
+ let parsedStep = 1;
363
+ if (step !== void 0) {
364
+ parsedStep = Number.parseInt(step, 10);
365
+ if (Number.isNaN(parsedStep)) throw new Error(`Failed to parse step: ${step} is NaN.`);
366
+ if (parsedStep < 1) throw new Error(`Failed to parse step: Expected ${step} to be greater than 0.`);
367
+ }
368
+ for (let i = parsedStart; i <= parsedEnd; i = i + parsedStep) result.add(i);
369
+ return result;
370
+ }
371
+ /** Parses a cron expression into a Cron instance. */
372
+ function parseCronExpression(cronExpression) {
373
+ var _a;
374
+ if (typeof cronExpression !== "string") throw new TypeError("Invalid cron expression: must be of type string.");
375
+ cronExpression = (_a = timeNicknames[cronExpression.toLowerCase()]) !== null && _a !== void 0 ? _a : cronExpression;
376
+ const elements = cronExpression.split(" ").filter((elem) => elem.length > 0);
377
+ if (elements.length < 5 || elements.length > 6) throw new Error("Invalid cron expression: expected 5 or 6 elements.");
378
+ const rawSeconds = elements.length === 6 ? elements[0] : "0";
379
+ const rawMinutes = elements.length === 6 ? elements[1] : elements[0];
380
+ const rawHours = elements.length === 6 ? elements[2] : elements[1];
381
+ const rawDays = elements.length === 6 ? elements[3] : elements[2];
382
+ const rawMonths = elements.length === 6 ? elements[4] : elements[3];
383
+ const rawWeekdays = elements.length === 6 ? elements[5] : elements[4];
384
+ return new Cron({
385
+ seconds: parseElement(rawSeconds, secondConstraint),
386
+ minutes: parseElement(rawMinutes, minuteConstraint),
387
+ hours: parseElement(rawHours, hourConstraint),
388
+ days: parseElement(rawDays, dayConstraint),
389
+ months: new Set(Array.from(parseElement(rawMonths, monthConstraint)).map((x) => x - 1)),
390
+ weekdays: new Set(Array.from(parseElement(rawWeekdays, weekdayConstraint)).map((x) => x % 7))
391
+ });
392
+ }
393
+ //#endregion
394
+ //#region ../../packages/core/src/shared/duration.ts
395
+ const MULTIPLIERS = {
396
+ s: 1e3,
397
+ m: 6e4,
398
+ h: 36e5,
399
+ d: 864e5,
400
+ w: 6048e5,
401
+ y: 31536e6
402
+ };
403
+ /**
404
+ * Convert a {@link Duration} value into milliseconds.
405
+ *
406
+ * Accepts the full Duration union: a positive integer (treated as ms)
407
+ * or a string like "5s", "2m", "1h", "1d", "1w", "1y".
408
+ */
409
+ function parseDurationToMs(duration) {
410
+ if (typeof duration === "number") return duration;
411
+ const match = duration.match(/^(\d+)([smhdwy])$/);
412
+ if (!match?.[1] || !match[2]) throw new Error(`Invalid duration format: "${duration}". Expected a positive integer or a string like "5s", "2m", "1h", "1d", "1w", "1y".`);
413
+ return Number.parseInt(match[1], 10) * MULTIPLIERS[match[2]];
414
+ }
415
+ //#endregion
416
+ //#region ../../packages/core/src/shared/schedule.ts
417
+ /**
418
+ * shared/schedule.ts
419
+ *
420
+ * Unified schedule type that supports both simple intervals and cron expressions.
421
+ * Can be used in both cron and polling triggers for maximum flexibility.
422
+ *
423
+ * Template literal types provide compile-time type safety.
424
+ * Zod schemas with refinements provide runtime validation.
425
+ */
426
+ const DurationSchema = z.union([z.number().int().positive().finite(), z.string().regex(/^[1-9]\d*[smhdwy]$/)]);
427
+ const DurationStringSchema = z.string().refine((val) => /^\d+[smhdwy]$/.test(val), { message: "Invalid duration format. Must be a positive integer followed by s, m, h, d, w, or y (e.g., \"5m\", \"1h\")" }).refine((val) => {
428
+ const match = val.match(/^(\d+)[smhdwy]$/);
429
+ if (!match?.[1]) return false;
430
+ const num = Number.parseInt(match[1], 10);
431
+ return num > 0 && Number.isFinite(num);
432
+ }, { message: "Duration value must be a positive integer greater than 0" });
433
+ const CronExpressionSchema = z.string().superRefine((val, ctx) => {
434
+ try {
435
+ parseCronExpression(val);
436
+ } catch (error) {
437
+ const errorMessage = error instanceof Error ? error.message : "Invalid cron expression format";
438
+ ctx.addIssue({
439
+ code: "custom",
440
+ message: `Invalid cron expression: ${errorMessage}. Must be a valid 5-field cron: minute hour day month weekday (e.g., "0 9 * * *", "*/15 * * * *")`
441
+ });
442
+ }
443
+ });
444
+ const ScheduleSchema = z.union([
445
+ z.number().refine((val) => val > 0, { message: "Duration in milliseconds must be positive" }).refine(Number.isFinite, { message: "Duration in milliseconds must be finite" }).refine(Number.isInteger, { message: "Duration in milliseconds must be an integer" }),
446
+ DurationStringSchema,
447
+ CronExpressionSchema
448
+ ]);
449
+ const IANATimezoneSchema = z.enum([
450
+ "UTC",
451
+ "GMT",
452
+ "Etc/UTC",
453
+ "Etc/GMT",
454
+ "America/New_York",
455
+ "America/Chicago",
456
+ "America/Denver",
457
+ "America/Los_Angeles",
458
+ "America/Phoenix",
459
+ "America/Anchorage",
460
+ "America/Toronto",
461
+ "America/Vancouver",
462
+ "America/Mexico_City",
463
+ "America/Sao_Paulo",
464
+ "America/Buenos_Aires",
465
+ "Europe/London",
466
+ "Europe/Paris",
467
+ "Europe/Berlin",
468
+ "Europe/Rome",
469
+ "Europe/Madrid",
470
+ "Europe/Amsterdam",
471
+ "Europe/Stockholm",
472
+ "Europe/Vienna",
473
+ "Europe/Zurich",
474
+ "Europe/Moscow",
475
+ "Europe/Athens",
476
+ "Europe/Dublin",
477
+ "Asia/Tokyo",
478
+ "Asia/Shanghai",
479
+ "Asia/Hong_Kong",
480
+ "Asia/Singapore",
481
+ "Asia/Seoul",
482
+ "Asia/Dubai",
483
+ "Asia/Kolkata",
484
+ "Asia/Bangkok",
485
+ "Asia/Jakarta",
486
+ "Asia/Manila",
487
+ "Asia/Taipei",
488
+ "Australia/Sydney",
489
+ "Australia/Melbourne",
490
+ "Australia/Brisbane",
491
+ "Australia/Perth",
492
+ "Australia/Adelaide",
493
+ "Pacific/Auckland",
494
+ "Pacific/Honolulu",
495
+ "Africa/Cairo",
496
+ "Africa/Johannesburg",
497
+ "Africa/Lagos",
498
+ "Africa/Nairobi",
499
+ "Asia/Riyadh",
500
+ "Asia/Tehran",
501
+ "Asia/Jerusalem",
502
+ "Asia/Doha"
503
+ ]);
504
+ //#endregion
505
+ export { parseDurationToMs as i, IANATimezoneSchema as n, ScheduleSchema as r, DurationSchema as t };
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { z } from "zod";
4
+ const OrgRoleSchema = z.enum([
5
+ "owner",
6
+ "admin",
7
+ "builder"
8
+ ]);
9
+ z.enum([
10
+ "active",
11
+ "invited",
12
+ "suspended",
13
+ "removed"
14
+ ]);
15
+ z.enum(["admin", "editor"]);
16
+ //#endregion
17
+ export { OrgRoleSchema as t };
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { z } from "zod";
4
+ //#region ../../packages/core/src/shared/schema.ts
5
+ const MAX_JSON_DEPTH = 20;
6
+ function buildJsonValueSchema(depth) {
7
+ const primitives = z.union([
8
+ z.string(),
9
+ z.number(),
10
+ z.boolean(),
11
+ z.null()
12
+ ]);
13
+ if (depth <= 0) return primitives;
14
+ const nested = buildJsonValueSchema(depth - 1);
15
+ return z.union([
16
+ primitives,
17
+ z.array(nested),
18
+ z.record(z.string(), nested)
19
+ ]);
20
+ }
21
+ const jsonValueSchema = buildJsonValueSchema(MAX_JSON_DEPTH);
22
+ const jsonSchemaObject = z.record(z.string(), jsonValueSchema);
23
+ const anyZodSchemaSchema = z.custom((value) => value instanceof z.ZodType, "Expected a Zod schema");
24
+ const zodObjectSchema = z.custom((value) => value instanceof z.ZodObject, "Expected a Zod object schema");
25
+ /**
26
+ * Creates a Zod schema that validates an object structurally by checking
27
+ * for required properties. This avoids `instanceof` checks which fail
28
+ * when class definitions are duplicated across bundle boundaries.
29
+ */
30
+ function createStructuralSchema(requiredKeys, label) {
31
+ return z.custom((value) => value != null && (typeof value === "object" || typeof value === "function") && requiredKeys.every((key) => key in value), `Expected ${label}`);
32
+ }
33
+ function trimmedNonEmptyString(fieldName) {
34
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` });
35
+ }
36
+ /** Trimmed string with at least one character; no upper length limit. */
37
+ function trimmedNonEmptyStringUnbounded(fieldName) {
38
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` });
39
+ }
40
+ /**
41
+ * Non-empty trimmed string restricted to URL-safe characters.
42
+ * Use for IDs (workflow, step, etc.) that must be safe in URLs, env vars, and as object keys.
43
+ */
44
+ function idNoSpacesString(fieldName) {
45
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_-]+$/.test(s), { error: `${fieldName} must only contain letters, numbers, hyphens, and underscores` });
46
+ }
47
+ /**
48
+ * Non-empty trimmed string for RAW credential set IDs and namespace values.
49
+ * Only allows letters, numbers, hyphens, and underscores.
50
+ * Dots and colons are NOT allowed — colons are reserved for the namespace separator
51
+ * in resolved credential set IDs (e.g., `keystroke:slack`).
52
+ */
53
+ function credentialSetIdString(fieldName) {
54
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_-]+$/.test(s), { error: `${fieldName} must only contain letters, numbers, hyphens, and underscores` });
55
+ }
56
+ /**
57
+ * Non-empty trimmed string for RESOLVED credential set IDs.
58
+ * Allows the optional `namespace:id` colon-separated format (e.g., `keystroke:slack`)
59
+ * as well as plain IDs without a namespace (e.g., `internal-crm`).
60
+ * Used in manifest schemas, DB query params, and API response schemas.
61
+ */
62
+ function resolvedCredentialSetIdString(fieldName) {
63
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_-]+(:[a-zA-Z0-9_-]+)?$/.test(s), { error: `${fieldName} must be a valid credential set ID, optionally namespaced (e.g., "slack" or "keystroke:slack")` });
64
+ }
65
+ function optionalTrimmedNonEmptyString(fieldName) {
66
+ return trimmedNonEmptyString(fieldName).optional();
67
+ }
68
+ function descriptionString(fieldName) {
69
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(1024, { error: `${fieldName} cannot exceed 1024 characters` });
70
+ }
71
+ function optionalDescriptionString(fieldName) {
72
+ return descriptionString(fieldName).optional();
73
+ }
74
+ function validateConfig(schema, config) {
75
+ return schema.parse(config);
76
+ }
77
+ function schemaToJsonSchema(schema) {
78
+ return jsonSchemaObject.parse({ ...z.toJSONSchema(schema, { unrepresentable: "any" }) });
79
+ }
80
+ //#endregion
81
+ export { idNoSpacesString as a, optionalDescriptionString as c, schemaToJsonSchema as d, trimmedNonEmptyString as f, zodObjectSchema as h, descriptionString as i, optionalTrimmedNonEmptyString as l, validateConfig as m, createStructuralSchema as n, jsonSchemaObject as o, trimmedNonEmptyStringUnbounded as p, credentialSetIdString as r, jsonValueSchema as s, anyZodSchemaSchema as t, resolvedCredentialSetIdString as u };
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { f as trimmedNonEmptyString, i as descriptionString, n as createStructuralSchema } from "./schema-kbMHVnhm.mjs";
4
+ import { c as TriggerTypeSchema, m as CredentialSetManifestSchema, r as ExecutionIdentityPolicySchema } from "./credential-requirements-DjDFthio.mjs";
5
+ import { z } from "zod";
6
+ //#region ../../packages/core/src/trigger/schemas.ts
7
+ const credentialSetInstanceSchema = createStructuralSchema([
8
+ "id",
9
+ "auth",
10
+ "needsResolve"
11
+ ], "a CredentialSet instance");
12
+ const TriggerModeDefaultSchema = z.enum(["managed", "subscribable"]);
13
+ const TriggerCallbackPresenceSchema = z.object({
14
+ filter: z.boolean(),
15
+ idempotencyKey: z.boolean(),
16
+ poll: z.boolean().optional(),
17
+ transformAllowed: z.boolean(),
18
+ verify: z.boolean().optional()
19
+ });
20
+ const TriggerRuntimeDescriptorSchema = z.object({ callbacks: TriggerCallbackPresenceSchema });
21
+ const TriggerManifestSchema = z.object({
22
+ manifestVersion: z.literal(1),
23
+ type: z.literal("trigger"),
24
+ triggerType: TriggerTypeSchema,
25
+ name: trimmedNonEmptyString("Trigger name"),
26
+ description: descriptionString("Trigger description"),
27
+ enabled: z.boolean(),
28
+ modeDefault: TriggerModeDefaultSchema,
29
+ executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
30
+ credentialSets: z.array(CredentialSetManifestSchema).optional(),
31
+ runtime: TriggerRuntimeDescriptorSchema
32
+ });
33
+ const triggerBaseConfigSchema = z.object({
34
+ credentialSets: z.array(credentialSetInstanceSchema).optional(),
35
+ description: descriptionString("Trigger description"),
36
+ enabled: z.boolean().default(true),
37
+ executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
38
+ modeDefault: TriggerModeDefaultSchema.default("managed"),
39
+ name: trimmedNonEmptyString("Trigger name")
40
+ });
41
+ //#endregion
42
+ export { TriggerRuntimeDescriptorSchema as n, triggerBaseConfigSchema as r, TriggerManifestSchema as t };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { C as CliExitError, t as ui } from "./keystroke.mjs";
4
- import { i as writeJson, r as isJsonMode } from "./output-DM4b7KgY.mjs";
5
- import { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-Kx_H7UTd.mjs";
4
+ import { i as writeJson, r as isJsonMode } from "./output-q4KljAhu.mjs";
5
+ import { t as syncKeystrokeAgentSkills } from "./sync-keystroke-agent-skills-CY9h25_5.mjs";
6
6
  import path from "node:path";
7
7
  //#region src/commands/skills/skills-sync.handler.ts
8
8
  async function handleSkillsSync(options, _ctx) {