@hs-x/cli 0.2.7 → 0.3.0

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 (293) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +25 -8
  3. package/dist/audit-interactive.d.ts +29 -0
  4. package/dist/audit-interactive.d.ts.map +1 -0
  5. package/dist/audit-interactive.js +156 -0
  6. package/dist/audit-interactive.js.map +1 -0
  7. package/dist/bin/hs-x.js.map +1 -1
  8. package/dist/checkpoint-interactive.d.ts +24 -0
  9. package/dist/checkpoint-interactive.d.ts.map +1 -0
  10. package/dist/checkpoint-interactive.js +65 -0
  11. package/dist/checkpoint-interactive.js.map +1 -0
  12. package/dist/cli/index.d.ts.map +1 -1
  13. package/dist/cli/index.js +266 -39
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/kit.d.ts +1 -1
  16. package/dist/cli/kit.d.ts.map +1 -1
  17. package/dist/cli/kit.js +19 -3
  18. package/dist/cli/kit.js.map +1 -1
  19. package/dist/cloudflare-auth.d.ts +8 -0
  20. package/dist/cloudflare-auth.d.ts.map +1 -1
  21. package/dist/cloudflare-auth.js +12 -2
  22. package/dist/cloudflare-auth.js.map +1 -1
  23. package/dist/cloudflare-oauth-store.d.ts +9 -1
  24. package/dist/cloudflare-oauth-store.d.ts.map +1 -1
  25. package/dist/cloudflare-oauth-store.js +23 -4
  26. package/dist/cloudflare-oauth-store.js.map +1 -1
  27. package/dist/cloudflare-oauth.d.ts +1 -0
  28. package/dist/cloudflare-oauth.d.ts.map +1 -1
  29. package/dist/cloudflare-oauth.js +6 -2
  30. package/dist/cloudflare-oauth.js.map +1 -1
  31. package/dist/cloudflare-worker-versions.d.ts +184 -0
  32. package/dist/cloudflare-worker-versions.d.ts.map +1 -0
  33. package/dist/cloudflare-worker-versions.js +360 -0
  34. package/dist/cloudflare-worker-versions.js.map +1 -0
  35. package/dist/commands/account.d.ts +24 -9
  36. package/dist/commands/account.d.ts.map +1 -1
  37. package/dist/commands/account.js +219 -69
  38. package/dist/commands/account.js.map +1 -1
  39. package/dist/commands/api.d.ts.map +1 -1
  40. package/dist/commands/api.js +6 -10
  41. package/dist/commands/api.js.map +1 -1
  42. package/dist/commands/completion.d.ts.map +1 -1
  43. package/dist/commands/completion.js +13 -7
  44. package/dist/commands/completion.js.map +1 -1
  45. package/dist/commands/connect.d.ts.map +1 -1
  46. package/dist/commands/connect.js +239 -125
  47. package/dist/commands/connect.js.map +1 -1
  48. package/dist/commands/control-plane-read.d.ts +71 -10
  49. package/dist/commands/control-plane-read.d.ts.map +1 -1
  50. package/dist/commands/control-plane-read.js +1035 -58
  51. package/dist/commands/control-plane-read.js.map +1 -1
  52. package/dist/commands/deploy-promote.d.ts +25 -3
  53. package/dist/commands/deploy-promote.d.ts.map +1 -1
  54. package/dist/commands/deploy-promote.js +314 -38
  55. package/dist/commands/deploy-promote.js.map +1 -1
  56. package/dist/commands/deploy.d.ts +67 -4
  57. package/dist/commands/deploy.d.ts.map +1 -1
  58. package/dist/commands/deploy.js +1333 -255
  59. package/dist/commands/deploy.js.map +1 -1
  60. package/dist/commands/dev.d.ts +5 -1
  61. package/dist/commands/dev.d.ts.map +1 -1
  62. package/dist/commands/dev.js +502 -107
  63. package/dist/commands/dev.js.map +1 -1
  64. package/dist/commands/doctor.d.ts +14 -0
  65. package/dist/commands/doctor.d.ts.map +1 -1
  66. package/dist/commands/doctor.js +131 -20
  67. package/dist/commands/doctor.js.map +1 -1
  68. package/dist/commands/flags.d.ts +108 -6
  69. package/dist/commands/flags.d.ts.map +1 -1
  70. package/dist/commands/flags.js +996 -75
  71. package/dist/commands/flags.js.map +1 -1
  72. package/dist/commands/help-command.d.ts +14 -0
  73. package/dist/commands/help-command.d.ts.map +1 -1
  74. package/dist/commands/help-command.js +144 -44
  75. package/dist/commands/help-command.js.map +1 -1
  76. package/dist/commands/history.js +14 -10
  77. package/dist/commands/history.js.map +1 -1
  78. package/dist/commands/init.d.ts +4 -2
  79. package/dist/commands/init.d.ts.map +1 -1
  80. package/dist/commands/init.js +69 -12
  81. package/dist/commands/init.js.map +1 -1
  82. package/dist/commands/link.d.ts +2 -3
  83. package/dist/commands/link.d.ts.map +1 -1
  84. package/dist/commands/link.js +201 -101
  85. package/dist/commands/link.js.map +1 -1
  86. package/dist/commands/login.d.ts.map +1 -1
  87. package/dist/commands/login.js +22 -5
  88. package/dist/commands/login.js.map +1 -1
  89. package/dist/commands/migrate.d.ts +37 -17
  90. package/dist/commands/migrate.d.ts.map +1 -1
  91. package/dist/commands/migrate.js +500 -73
  92. package/dist/commands/migrate.js.map +1 -1
  93. package/dist/commands/rollback.d.ts +42 -2
  94. package/dist/commands/rollback.d.ts.map +1 -1
  95. package/dist/commands/rollback.js +422 -58
  96. package/dist/commands/rollback.js.map +1 -1
  97. package/dist/commands/secrets.d.ts +76 -3
  98. package/dist/commands/secrets.d.ts.map +1 -1
  99. package/dist/commands/secrets.js +328 -41
  100. package/dist/commands/secrets.js.map +1 -1
  101. package/dist/commands/status.d.ts +13 -2
  102. package/dist/commands/status.d.ts.map +1 -1
  103. package/dist/commands/status.js +154 -17
  104. package/dist/commands/status.js.map +1 -1
  105. package/dist/commands/unlink.d.ts +2 -2
  106. package/dist/commands/unlink.d.ts.map +1 -1
  107. package/dist/commands/unlink.js +2 -2
  108. package/dist/commands/unlink.js.map +1 -1
  109. package/dist/commands/update.d.ts.map +1 -1
  110. package/dist/commands/update.js +4 -3
  111. package/dist/commands/update.js.map +1 -1
  112. package/dist/commands/validate.d.ts +12 -3
  113. package/dist/commands/validate.d.ts.map +1 -1
  114. package/dist/commands/validate.js +70 -8
  115. package/dist/commands/validate.js.map +1 -1
  116. package/dist/constants.d.ts +1 -1
  117. package/dist/constants.js +1 -1
  118. package/dist/control-plane-fetch.d.ts.map +1 -1
  119. package/dist/control-plane-fetch.js +5 -4
  120. package/dist/control-plane-fetch.js.map +1 -1
  121. package/dist/deploy-revision-capture.d.ts +48 -0
  122. package/dist/deploy-revision-capture.d.ts.map +1 -0
  123. package/dist/deploy-revision-capture.js +125 -0
  124. package/dist/deploy-revision-capture.js.map +1 -0
  125. package/dist/dev/event-bus.d.ts +5 -2
  126. package/dist/dev/event-bus.d.ts.map +1 -1
  127. package/dist/dev/event-bus.js +4 -1
  128. package/dist/dev/event-bus.js.map +1 -1
  129. package/dist/dev/hubspot-logs-poller.d.ts +35 -0
  130. package/dist/dev/hubspot-logs-poller.d.ts.map +1 -0
  131. package/dist/dev/hubspot-logs-poller.js +94 -0
  132. package/dist/dev/hubspot-logs-poller.js.map +1 -0
  133. package/dist/dev/invoke.d.ts +9 -1
  134. package/dist/dev/invoke.d.ts.map +1 -1
  135. package/dist/dev/invoke.js +69 -20
  136. package/dist/dev/invoke.js.map +1 -1
  137. package/dist/dev/keyboard.d.ts +31 -0
  138. package/dist/dev/keyboard.d.ts.map +1 -0
  139. package/dist/dev/keyboard.js +143 -0
  140. package/dist/dev/keyboard.js.map +1 -0
  141. package/dist/dev/log-server.d.ts +7 -0
  142. package/dist/dev/log-server.d.ts.map +1 -1
  143. package/dist/dev/log-server.js +68 -31
  144. package/dist/dev/log-server.js.map +1 -1
  145. package/dist/dev/migrated-card.d.ts +17 -0
  146. package/dist/dev/migrated-card.d.ts.map +1 -0
  147. package/dist/dev/migrated-card.js +114 -0
  148. package/dist/dev/migrated-card.js.map +1 -0
  149. package/dist/dev/stream-filter.d.ts +40 -0
  150. package/dist/dev/stream-filter.d.ts.map +1 -0
  151. package/dist/dev/stream-filter.js +93 -0
  152. package/dist/dev/stream-filter.js.map +1 -0
  153. package/dist/dev/stream-renderer.d.ts +34 -0
  154. package/dist/dev/stream-renderer.d.ts.map +1 -1
  155. package/dist/dev/stream-renderer.js +222 -8
  156. package/dist/dev/stream-renderer.js.map +1 -1
  157. package/dist/errors-registry.d.ts.map +1 -1
  158. package/dist/errors-registry.js +280 -36
  159. package/dist/errors-registry.js.map +1 -1
  160. package/dist/errors.d.ts.map +1 -1
  161. package/dist/errors.js.map +1 -1
  162. package/dist/help.d.ts.map +1 -1
  163. package/dist/help.js +8 -0
  164. package/dist/help.js.map +1 -1
  165. package/dist/hubspot-app-logs.d.ts +76 -0
  166. package/dist/hubspot-app-logs.d.ts.map +1 -0
  167. package/dist/hubspot-app-logs.js +323 -0
  168. package/dist/hubspot-app-logs.js.map +1 -0
  169. package/dist/hubspot-auth.d.ts +8 -2
  170. package/dist/hubspot-auth.d.ts.map +1 -1
  171. package/dist/hubspot-auth.js +9 -9
  172. package/dist/hubspot-auth.js.map +1 -1
  173. package/dist/hubspot-developer-client.js +119 -11
  174. package/dist/hubspot-developer-client.js.map +1 -1
  175. package/dist/index.d.ts +1 -0
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +1 -0
  178. package/dist/index.js.map +1 -1
  179. package/dist/init/templates.d.ts +10 -0
  180. package/dist/init/templates.d.ts.map +1 -1
  181. package/dist/init/templates.js +157 -14
  182. package/dist/init/templates.js.map +1 -1
  183. package/dist/link-migration-journal.d.ts +131 -0
  184. package/dist/link-migration-journal.d.ts.map +1 -0
  185. package/dist/link-migration-journal.js +395 -0
  186. package/dist/link-migration-journal.js.map +1 -0
  187. package/dist/link-preflight.d.ts +78 -0
  188. package/dist/link-preflight.d.ts.map +1 -0
  189. package/dist/link-preflight.js +231 -0
  190. package/dist/link-preflight.js.map +1 -0
  191. package/dist/local-project-picker.d.ts +34 -0
  192. package/dist/local-project-picker.d.ts.map +1 -0
  193. package/dist/local-project-picker.js +121 -0
  194. package/dist/local-project-picker.js.map +1 -0
  195. package/dist/logs-interactive.d.ts +37 -0
  196. package/dist/logs-interactive.d.ts.map +1 -0
  197. package/dist/logs-interactive.js +110 -0
  198. package/dist/logs-interactive.js.map +1 -0
  199. package/dist/output-context.d.ts +13 -0
  200. package/dist/output-context.d.ts.map +1 -0
  201. package/dist/output-context.js +46 -0
  202. package/dist/output-context.js.map +1 -0
  203. package/dist/project-context.d.ts +55 -0
  204. package/dist/project-context.d.ts.map +1 -0
  205. package/dist/project-context.js +115 -0
  206. package/dist/project-context.js.map +1 -0
  207. package/dist/project-picker.d.ts +65 -0
  208. package/dist/project-picker.d.ts.map +1 -0
  209. package/dist/project-picker.js +227 -0
  210. package/dist/project-picker.js.map +1 -0
  211. package/dist/prompt.d.ts +8 -0
  212. package/dist/prompt.d.ts.map +1 -1
  213. package/dist/prompt.js +81 -13
  214. package/dist/prompt.js.map +1 -1
  215. package/dist/reporter/human.d.ts +10 -2
  216. package/dist/reporter/human.d.ts.map +1 -1
  217. package/dist/reporter/human.js +82 -14
  218. package/dist/reporter/human.js.map +1 -1
  219. package/dist/reporter/index.d.ts.map +1 -1
  220. package/dist/reporter/index.js +7 -5
  221. package/dist/reporter/index.js.map +1 -1
  222. package/dist/reporter/json.d.ts +2 -1
  223. package/dist/reporter/json.d.ts.map +1 -1
  224. package/dist/reporter/json.js +10 -7
  225. package/dist/reporter/json.js.map +1 -1
  226. package/dist/reporter/style.d.ts +19 -0
  227. package/dist/reporter/style.d.ts.map +1 -1
  228. package/dist/reporter/style.js +126 -6
  229. package/dist/reporter/style.js.map +1 -1
  230. package/dist/reporter/types.d.ts +34 -4
  231. package/dist/reporter/types.d.ts.map +1 -1
  232. package/dist/reporter/types.js.map +1 -1
  233. package/dist/rollback-traffic.d.ts +85 -0
  234. package/dist/rollback-traffic.d.ts.map +1 -0
  235. package/dist/rollback-traffic.js +204 -0
  236. package/dist/rollback-traffic.js.map +1 -0
  237. package/dist/services/account-store.d.ts +3 -1
  238. package/dist/services/account-store.d.ts.map +1 -1
  239. package/dist/services/account-store.js +2 -1
  240. package/dist/services/account-store.js.map +1 -1
  241. package/dist/services/app-paths.d.ts.map +1 -1
  242. package/dist/services/app-paths.js +3 -1
  243. package/dist/services/app-paths.js.map +1 -1
  244. package/dist/services/cloudflare-auth.d.ts +1 -1
  245. package/dist/services/cloudflare-auth.d.ts.map +1 -1
  246. package/dist/services/cloudflare-auth.js +2 -2
  247. package/dist/services/cloudflare-auth.js.map +1 -1
  248. package/dist/services/cloudflare-kv.d.ts.map +1 -1
  249. package/dist/services/cloudflare-kv.js.map +1 -1
  250. package/dist/services/command-history.d.ts.map +1 -1
  251. package/dist/services/command-history.js.map +1 -1
  252. package/dist/services/config.d.ts.map +1 -1
  253. package/dist/services/config.js +1 -1
  254. package/dist/services/config.js.map +1 -1
  255. package/dist/services/control-plane.d.ts.map +1 -1
  256. package/dist/services/control-plane.js +3 -3
  257. package/dist/services/control-plane.js.map +1 -1
  258. package/dist/services/env-loader.d.ts.map +1 -1
  259. package/dist/services/env-loader.js +1 -3
  260. package/dist/services/env-loader.js.map +1 -1
  261. package/dist/services/http.d.ts.map +1 -1
  262. package/dist/services/http.js.map +1 -1
  263. package/dist/services/hubspot-dev-client.d.ts.map +1 -1
  264. package/dist/services/hubspot-dev-client.js +30 -0
  265. package/dist/services/hubspot-dev-client.js.map +1 -1
  266. package/dist/services/live.d.ts +2 -2
  267. package/dist/services/live.d.ts.map +1 -1
  268. package/dist/services/live.js +1 -1
  269. package/dist/services/live.js.map +1 -1
  270. package/dist/services/machine-id.d.ts.map +1 -1
  271. package/dist/services/machine-id.js.map +1 -1
  272. package/dist/services/reporter.d.ts +8 -5
  273. package/dist/services/reporter.d.ts.map +1 -1
  274. package/dist/services/reporter.js +6 -4
  275. package/dist/services/reporter.js.map +1 -1
  276. package/dist/services/tenant-state.d.ts.map +1 -1
  277. package/dist/services/tenant-state.js.map +1 -1
  278. package/dist/state-store.d.ts +4 -0
  279. package/dist/state-store.d.ts.map +1 -1
  280. package/dist/state-store.js +15 -0
  281. package/dist/state-store.js.map +1 -1
  282. package/dist/status-drilldown.d.ts +24 -0
  283. package/dist/status-drilldown.d.ts.map +1 -0
  284. package/dist/status-drilldown.js +50 -0
  285. package/dist/status-drilldown.js.map +1 -0
  286. package/dist/tenant-state.d.ts.map +1 -1
  287. package/dist/tenant-state.js +3 -2
  288. package/dist/tenant-state.js.map +1 -1
  289. package/dist/token-key-custody.d.ts +91 -0
  290. package/dist/token-key-custody.d.ts.map +1 -0
  291. package/dist/token-key-custody.js +375 -0
  292. package/dist/token-key-custody.js.map +1 -0
  293. package/package.json +13 -14
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # @hs-x/cli
2
2
 
3
3
  The command-line tool for HS-X, a type-safe HubSpot app framework that deploys
4
- to Cloudflare Workers. Installing this package puts the `hs-x` command on your
5
- PATH: it scaffolds projects, runs the local dev loop, and deploys to your own
6
- HubSpot developer app and your own Cloudflare account.
4
+ to Cloudflare Workers. Installing this package puts both `hs-x` and its shorter
5
+ `hsx` alias on your PATH: they run the same CLI for scaffolding projects, running
6
+ the local dev loop, and deploying to your own HubSpot developer app and your own
7
+ Cloudflare account.
7
8
 
8
9
  ## Install
9
10
 
@@ -13,8 +14,9 @@ hs-x --version
13
14
  ```
14
15
 
15
16
  Node 20+ and Bun can both run it. The npm package is `@hs-x/cli`; the installed
16
- command is `hs-x`. If you prefer not to install anything globally, every command
17
- also works through `bunx @hs-x/cli <command>`.
17
+ commands are `hs-x` and `hsx`, with `hs-x` used as the canonical spelling in the
18
+ docs. If you prefer not to install anything globally, every command also works
19
+ through `bunx @hs-x/cli <command>`.
18
20
 
19
21
  ## Thirty seconds
20
22
 
@@ -29,9 +31,24 @@ hs-x deploy # deploy to your HubSpot app and your Cloudflare accou
29
31
 
30
32
  The CLI works direct-to-HubSpot out of the box. You provide the HubSpot and
31
33
  Cloudflare credentials, the CLI talks to both platforms directly, and nothing
32
- requires an HS-X platform account. The control plane, dashboard, and billing are
33
- opt-in: `hs-x login` authenticates an HS-X account and `hs-x link` attaches an
34
- already-deployed project to it.
34
+ requires an HS-X platform account.
35
+
36
+ There are exactly three onboarding modes (ADR-025); pick by answering two
37
+ questions — do you want credentials stored locally, and do you want the
38
+ platform?
39
+
40
+ 1. **Env-only unlinked** — credentials supplied via environment variables;
41
+ nothing stored, no HS-X account. The CI/scripting and try-it-fast mode.
42
+ 2. **Stored-direct** — credentials captured by `hs-x connect` and kept in the
43
+ local store; still no HS-X account. The individual-dev steady state for
44
+ people not using the platform.
45
+ 3. **Linked platform** — an HS-X account with the control plane, dashboard,
46
+ teams, hosted billing, and linked deploys. Reached from mode 1 or 2 with
47
+ `hs-x login` (authenticate an HS-X account) and `hs-x link` (attach an
48
+ already-deployed project to it).
49
+
50
+ Modes 1 and 2 need no HS-X account: the platform is opt-in, never a
51
+ prerequisite for building, deploying, or running an app.
35
52
 
36
53
  Deployed Workers run in your Cloudflare account, and the generated
37
54
  `.hs-x/alchemy.run.ts` (checked into your repo) describes the Cloudflare
@@ -0,0 +1,29 @@
1
+ import type { Schema, schemas } from '@hs-x/types';
2
+ import { Effect } from 'effect';
3
+ import type { CliError } from './cli-error.js';
4
+ import type { SelectOptions } from './prompt.js';
5
+ export type AuditRow = Schema.Schema.Type<typeof schemas.AuditRow>;
6
+ export type AuditTimeRange = 60 | 1_440 | 10_080 | 43_200 | 'all';
7
+ type AuditTimeRangeChoice = '60' | '1440' | '10080' | '43200' | 'all';
8
+ export interface AuditFilters {
9
+ readonly action?: string;
10
+ readonly resource?: string;
11
+ readonly actor?: string;
12
+ readonly outcome?: string;
13
+ readonly since?: string;
14
+ readonly limit: number;
15
+ }
16
+ export interface AuditExplorerDependencies<R> {
17
+ readonly interactive?: boolean;
18
+ readonly select?: <T extends string>(options: SelectOptions<T>) => Promise<T | undefined>;
19
+ readonly detail: (row: AuditRow) => Effect.Effect<void, CliError, R>;
20
+ }
21
+ export declare function promptAuditTimeRange(input?: {
22
+ readonly select?: (options: SelectOptions<AuditTimeRangeChoice>) => Promise<AuditTimeRangeChoice | undefined>;
23
+ }): Promise<AuditTimeRange | undefined>;
24
+ export declare function filterAuditRows(rows: readonly AuditRow[], filters: AuditFilters): readonly AuditRow[];
25
+ export declare function auditExplorer<R>(rows: readonly AuditRow[], deps: AuditExplorerDependencies<R>): Effect.Effect<void, CliError, R>;
26
+ export declare function redactAuditDetail(value: unknown, depth?: number): unknown;
27
+ export declare function renderAuditDetail(row: AuditRow): string;
28
+ export {};
29
+ //# sourceMappingURL=audit-interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-interactive.d.ts","sourceRoot":"","sources":["../src/audit-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AACnE,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAClE,KAAK,oBAAoB,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAStE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1F,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;CACtE;AAED,wBAAsB,oBAAoB,CACxC,KAAK,GAAE;IACL,QAAQ,CAAC,MAAM,CAAC,EAAE,CAChB,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,KACzC,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;CAC3C,GACL,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAcrC;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,OAAO,EAAE,YAAY,GACpB,SAAS,QAAQ,EAAE,CAerB;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,IAAI,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAkFlC;AAwBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,OAAO,CAepE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAuBvD"}
@@ -0,0 +1,156 @@
1
+ import { Effect } from 'effect';
2
+ import { isInteractive, promptSelect } from './prompt.js';
3
+ export async function promptAuditTimeRange(input = {}) {
4
+ const selected = await (input.select ?? promptSelect)({
5
+ message: 'How far back should audit search?',
6
+ options: [
7
+ { value: '60', label: 'Last hour' },
8
+ { value: '1440', label: 'Last 24 hours' },
9
+ { value: '10080', label: 'Last 7 days' },
10
+ { value: '43200', label: 'Last 30 days' },
11
+ { value: 'all', label: 'All retained events' },
12
+ ],
13
+ default: '1440',
14
+ });
15
+ if (selected === undefined || selected === 'all')
16
+ return selected;
17
+ return Number(selected);
18
+ }
19
+ export function filterAuditRows(rows, filters) {
20
+ const filtered = rows.filter((row) => {
21
+ if (filters.action && row.action !== filters.action)
22
+ return false;
23
+ if (filters.resource) {
24
+ const resource = `${row.resource.type}/${row.resource.id}`;
25
+ if (row.resource.type !== filters.resource && resource !== filters.resource)
26
+ return false;
27
+ }
28
+ if (filters.actor && row.actorUserId !== filters.actor)
29
+ return false;
30
+ if (filters.outcome && row.outcome !== filters.outcome)
31
+ return false;
32
+ if (filters.since && row.occurredAt < filters.since)
33
+ return false;
34
+ return true;
35
+ });
36
+ return filtered
37
+ .sort((left, right) => left.occurredAt.localeCompare(right.occurredAt))
38
+ .slice(-Math.max(1, filters.limit));
39
+ }
40
+ export function auditExplorer(rows, deps) {
41
+ if (!(deps.interactive ?? isInteractive()))
42
+ return Effect.void;
43
+ const select = deps.select ?? promptSelect;
44
+ return Effect.gen(function* () {
45
+ let action;
46
+ let resource;
47
+ let actor;
48
+ while (true) {
49
+ const visible = rows
50
+ .filter((row) => (!action || row.action === action) &&
51
+ (!resource || row.resource.type === resource) &&
52
+ (!actor || row.actorUserId === actor))
53
+ .sort((left, right) => right.occurredAt.localeCompare(left.occurredAt));
54
+ const activeFilters = [action, resource, actor].filter(Boolean).join(' · ') || 'all events';
55
+ const choice = yield* Effect.promise(() => select({
56
+ message: `Browse audit · ${activeFilters}`,
57
+ options: [
58
+ ...visible.map((row, index) => ({
59
+ value: `event:${index}`,
60
+ label: `${row.action} · ${row.resource.type}/${row.resource.id}`,
61
+ description: `${row.occurredAt} · ${row.actorUserId} · ${row.outcome}`,
62
+ })),
63
+ { value: 'filter-action', label: 'Filter by action' },
64
+ { value: 'filter-resource', label: 'Filter by resource type' },
65
+ { value: 'filter-actor', label: 'Filter by actor' },
66
+ ...(action || resource || actor
67
+ ? [{ value: 'clear', label: 'Clear filters' }]
68
+ : []),
69
+ { value: 'done', label: 'Done' },
70
+ ],
71
+ default: 'done',
72
+ }));
73
+ if (!choice || choice === 'done')
74
+ return;
75
+ if (choice === 'clear') {
76
+ action = undefined;
77
+ resource = undefined;
78
+ actor = undefined;
79
+ continue;
80
+ }
81
+ if (choice.startsWith('event:')) {
82
+ const row = visible[Number(choice.slice('event:'.length))];
83
+ if (row)
84
+ yield* deps.detail(row);
85
+ continue;
86
+ }
87
+ if (choice === 'filter-action') {
88
+ action = yield* Effect.promise(() => chooseFilter(select, 'Which action?', rows.map((row) => row.action), action));
89
+ }
90
+ else if (choice === 'filter-resource') {
91
+ resource = yield* Effect.promise(() => chooseFilter(select, 'Which resource type?', rows.map((row) => row.resource.type), resource));
92
+ }
93
+ else {
94
+ actor = yield* Effect.promise(() => chooseFilter(select, 'Which actor?', rows.map((row) => row.actorUserId), actor));
95
+ }
96
+ }
97
+ });
98
+ }
99
+ async function chooseFilter(select, message, values, current) {
100
+ const unique = [...new Set(values)].sort();
101
+ const selected = await select({
102
+ message,
103
+ options: [
104
+ { value: '__all', label: 'All' },
105
+ ...unique.map((value) => ({ value, label: value })),
106
+ ],
107
+ default: current ?? '__all',
108
+ });
109
+ if (selected === undefined)
110
+ return current;
111
+ return selected === '__all' ? undefined : selected;
112
+ }
113
+ const SECRET_KEY = /(authorization|cookie|credential|password|secret|token|personalaccesskey|privatekey|api[_-]?key|pak)/i;
114
+ export function redactAuditDetail(value, depth = 0) {
115
+ if (depth > 8)
116
+ return '[TRUNCATED]';
117
+ if (typeof value === 'string' &&
118
+ (/^Bearer\s+\S+/i.test(value) || /^(?:pat|hsx_[a-z]+|sk)[-_][A-Za-z0-9_-]{8,}$/i.test(value))) {
119
+ return '[REDACTED]';
120
+ }
121
+ if (Array.isArray(value))
122
+ return value.map((item) => redactAuditDetail(item, depth + 1));
123
+ if (typeof value !== 'object' || value === null)
124
+ return value;
125
+ const output = {};
126
+ for (const [key, entry] of Object.entries(value)) {
127
+ output[key] = SECRET_KEY.test(key) ? '[REDACTED]' : redactAuditDetail(entry, depth + 1);
128
+ }
129
+ return output;
130
+ }
131
+ export function renderAuditDetail(row) {
132
+ const lines = [
133
+ `Audit id: ${row.auditId}`,
134
+ `Occurred: ${row.occurredAt}`,
135
+ `Action: ${row.action}`,
136
+ `Outcome: ${row.outcome}`,
137
+ `Resource: ${row.resource.type}/${row.resource.id}`,
138
+ `Actor: ${row.actorUserId}`,
139
+ ];
140
+ if (row.correlationId)
141
+ lines.push(`Correlation: ${row.correlationId}`);
142
+ if (row.error) {
143
+ lines.push(`Error:\n${JSON.stringify(redactAuditDetail(row.error), null, 2)}`);
144
+ }
145
+ if (row.before !== undefined) {
146
+ lines.push(`Before:\n${JSON.stringify(redactAuditDetail(row.before), null, 2)}`);
147
+ }
148
+ if (row.after !== undefined) {
149
+ lines.push(`After:\n${JSON.stringify(redactAuditDetail(row.after), null, 2)}`);
150
+ }
151
+ if (row.metadata !== undefined) {
152
+ lines.push(`Metadata:\n${JSON.stringify(redactAuditDetail(row.metadata), null, 2)}`);
153
+ }
154
+ return `${lines.join('\n')}\n`;
155
+ }
156
+ //# sourceMappingURL=audit-interactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-interactive.js","sourceRoot":"","sources":["../src/audit-interactive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6B1D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAII,EAAE;IAEN,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC;QACpD,OAAO,EAAE,mCAAmC;QAC5C,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;YACnC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;YACzC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE;YACxC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C,UAAU,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,OAAO,GACX,OAAO,CAAC,GAAG,CAAC,0BAA0B;QACtC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB;YAC5B,CAAC,CAAC,oBAAoB,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACrD,CAAC,CAAC,SAAS,CAAC,CAAC;IACjB,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC;QACzD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,WAAW,EAAE,SAAS;QACtB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B;YACzC,CAAC,CAAC,EAAE,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACpE,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B;YACzC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACvD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Schema, schemas } from '@hs-x/types';
2
+ import { Effect } from 'effect';
3
+ import type { CliError } from './cli-error.js';
4
+ import type { SelectOptions } from './prompt.js';
5
+ export type CheckpointRead = Schema.Schema.Type<typeof schemas.CheckpointPanelRead>;
6
+ export type CheckpointFailure = CheckpointRead['recentFailures'][number];
7
+ export type CheckpointFailureChoice = `failure:${number}` | 'done';
8
+ export type CheckpointFailureAction = 'logs' | 'exemplar' | 'back' | 'done';
9
+ export interface CheckpointDrilldownDependencies<R> {
10
+ readonly interactive?: boolean;
11
+ readonly selectFailure?: (options: SelectOptions<CheckpointFailureChoice>) => Promise<CheckpointFailureChoice | undefined>;
12
+ readonly selectAction?: (options: SelectOptions<CheckpointFailureAction>) => Promise<CheckpointFailureAction | undefined>;
13
+ readonly actions: {
14
+ readonly logs: (failure: CheckpointFailure) => Effect.Effect<void, CliError, R>;
15
+ readonly exemplar: (failure: CheckpointFailure) => Effect.Effect<void, CliError, R>;
16
+ };
17
+ }
18
+ /**
19
+ * Iterative checkpoint investigation flow. Prompting and actions are injected
20
+ * so machine-mode suppression, Back behavior, and dispatch remain testable
21
+ * without a terminal or control-plane request.
22
+ */
23
+ export declare function checkpointDrilldown<R>(checkpoint: CheckpointRead, deps: CheckpointDrilldownDependencies<R>): Effect.Effect<void, CliError, R>;
24
+ //# sourceMappingURL=checkpoint-interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-interactive.d.ts","sourceRoot":"","sources":["../src/checkpoint-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACpF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,uBAAuB,GAAG,WAAW,MAAM,EAAE,GAAG,MAAM,CAAC;AACnE,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5E,MAAM,WAAW,+BAA+B,CAAC,CAAC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,CACvB,OAAO,EAAE,aAAa,CAAC,uBAAuB,CAAC,KAC5C,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;IAClD,QAAQ,CAAC,YAAY,CAAC,EAAE,CACtB,OAAO,EAAE,aAAa,CAAC,uBAAuB,CAAC,KAC5C,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QAChF,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;KACrF,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,+BAA+B,CAAC,CAAC,CAAC,GACvC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAyDlC"}
@@ -0,0 +1,65 @@
1
+ import { Effect } from 'effect';
2
+ import { isInteractive, promptSelect } from './prompt.js';
3
+ /**
4
+ * Iterative checkpoint investigation flow. Prompting and actions are injected
5
+ * so machine-mode suppression, Back behavior, and dispatch remain testable
6
+ * without a terminal or control-plane request.
7
+ */
8
+ export function checkpointDrilldown(checkpoint, deps) {
9
+ if (!(deps.interactive ?? isInteractive()) || checkpoint.recentFailures.length === 0) {
10
+ return Effect.void;
11
+ }
12
+ const selectFailure = deps.selectFailure ?? promptSelect;
13
+ const selectAction = deps.selectAction ?? promptSelect;
14
+ return Effect.gen(function* () {
15
+ while (true) {
16
+ const failureChoice = yield* Effect.promise(() => selectFailure({
17
+ message: 'Inspect a recent failure?',
18
+ options: [
19
+ ...checkpoint.recentFailures.map((failure, index) => ({
20
+ value: `failure:${index}`,
21
+ label: `${failure.errorClass} · ${failure.capabilityId}`,
22
+ description: `${failure.occurrences} occurrence${failure.occurrences === 1 ? '' : 's'} · ${failure.affectedPortals} portal${failure.affectedPortals === 1 ? '' : 's'} · ${failure.fingerprint}`,
23
+ })),
24
+ { value: 'done', label: 'Done' },
25
+ ],
26
+ default: 'done',
27
+ }));
28
+ if (!failureChoice || failureChoice === 'done')
29
+ return;
30
+ const index = Number(failureChoice.slice('failure:'.length));
31
+ const failure = checkpoint.recentFailures[index];
32
+ if (!failure)
33
+ continue;
34
+ while (true) {
35
+ const action = yield* Effect.promise(() => selectAction({
36
+ message: `Investigate ${failure.errorClass}`,
37
+ options: [
38
+ {
39
+ value: 'logs',
40
+ label: 'View matching error logs',
41
+ description: `Workers logs for ${failure.capabilityId} in this checkpoint window`,
42
+ },
43
+ {
44
+ value: 'exemplar',
45
+ label: 'View representative invocation',
46
+ description: 'Redacted input, output, and error captured by Checkpoint',
47
+ },
48
+ { value: 'back', label: 'Back' },
49
+ { value: 'done', label: 'Done' },
50
+ ],
51
+ default: 'back',
52
+ }));
53
+ if (!action || action === 'done')
54
+ return;
55
+ if (action === 'back')
56
+ break;
57
+ if (action === 'logs')
58
+ yield* deps.actions.logs(failure);
59
+ else
60
+ yield* deps.actions.exemplar(failure);
61
+ }
62
+ }
63
+ });
64
+ }
65
+ //# sourceMappingURL=checkpoint-interactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-interactive.js","sourceRoot":"","sources":["../src/checkpoint-interactive.ts"],"names":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C7C,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAmI9C,wBAAsB,MAAM,CAC1B,IAAI,GAAE,SAAS,MAAM,EAA0B,EAC/C,GAAG,SAAgB,GAClB,OAAO,CAAC,SAAS,CAAC,CAuHpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2M9C,wBAAgB,MAAM,CACpB,IAAI,GAAE,SAAS,MAAM,EAA0B,EAC/C,GAAG,SAAgB,GAClB,OAAO,CAAC,SAAS,CAAC,CAwBpB"}