@dreamboard-games/cli 0.1.30-alpha.3 → 0.1.30-alpha.31

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 (173) hide show
  1. package/README.md +27 -108
  2. package/dist/agent-verifier/agent-workspace-verifier.mjs +1988 -57
  3. package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -1
  4. package/dist/agent-verifier/{chunk-XQXDOBYB.mjs → chunk-4I2WWAPK.mjs} +27 -10
  5. package/dist/agent-verifier/chunk-4I2WWAPK.mjs.map +1 -0
  6. package/dist/agent-verifier/{chunk-O4YCPU7C.mjs → chunk-BWBN2TDJ.mjs} +539 -641
  7. package/dist/agent-verifier/chunk-BWBN2TDJ.mjs.map +1 -0
  8. package/dist/agent-verifier/{chunk-TAEQKBJB.mjs → chunk-GWRZRWCF.mjs} +1 -1
  9. package/dist/agent-verifier/chunk-GWRZRWCF.mjs.map +1 -0
  10. package/dist/agent-verifier/chunk-H6XDQJ3N.mjs +11 -0
  11. package/dist/agent-verifier/chunk-HUBV22JQ.mjs +89 -0
  12. package/dist/agent-verifier/chunk-HUBV22JQ.mjs.map +1 -0
  13. package/dist/agent-verifier/{chunk-VS573ERH.mjs → chunk-JZTH3EMV.mjs} +2 -2
  14. package/dist/agent-verifier/{chunk-XGWCY624.mjs → chunk-KDAQ4CZY.mjs} +34 -27
  15. package/dist/agent-verifier/chunk-KDAQ4CZY.mjs.map +1 -0
  16. package/dist/agent-verifier/{chunk-IAYRNVUC.mjs → chunk-LMW66VBH.mjs} +2 -13
  17. package/dist/agent-verifier/{chunk-IAYRNVUC.mjs.map → chunk-LMW66VBH.mjs.map} +1 -1
  18. package/dist/agent-verifier/{chunk-776W3UGV.mjs → chunk-M6YNQZCC.mjs} +4 -13
  19. package/dist/agent-verifier/chunk-M6YNQZCC.mjs.map +1 -0
  20. package/dist/agent-verifier/{chunk-H76MT5UR.mjs → chunk-M7UVBANQ.mjs} +2 -1
  21. package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
  22. package/dist/agent-verifier/{chunk-SH5JKYOB.mjs → chunk-MIRGCMUC.mjs} +112 -26
  23. package/dist/agent-verifier/chunk-MIRGCMUC.mjs.map +1 -0
  24. package/dist/agent-verifier/{chunk-NAK77WXW.mjs → chunk-MYMVXTZT.mjs} +4 -5
  25. package/dist/agent-verifier/chunk-MYMVXTZT.mjs.map +1 -0
  26. package/dist/agent-verifier/{chunk-7WWGFAAU.mjs → chunk-NBRUEJUK.mjs} +215 -223
  27. package/dist/agent-verifier/chunk-NBRUEJUK.mjs.map +1 -0
  28. package/dist/agent-verifier/chunk-OJFZVGEL.mjs +492 -0
  29. package/dist/agent-verifier/chunk-OJFZVGEL.mjs.map +1 -0
  30. package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs → chunk-QD4SQNUP.mjs} +4 -8
  31. package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs.map → chunk-QD4SQNUP.mjs.map} +1 -1
  32. package/dist/agent-verifier/chunk-TTB7AIHZ.mjs +214 -0
  33. package/dist/agent-verifier/chunk-TTB7AIHZ.mjs.map +1 -0
  34. package/dist/agent-verifier/{chunk-F2DIOJJZ.mjs → chunk-XCQQIPCO.mjs} +5 -46
  35. package/dist/agent-verifier/chunk-XCQQIPCO.mjs.map +1 -0
  36. package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs → global-config-2NUESNEQ.mjs} +6 -6
  37. package/dist/agent-verifier/{keychain-backend-SPQWGKZN.mjs → keychain-backend-FF4I6ODB.mjs} +12 -7
  38. package/dist/agent-verifier/keychain-backend-FF4I6ODB.mjs.map +1 -0
  39. package/dist/agent-verifier/{local-files-JFOQQZDL.mjs → local-files-OF4QFISU.mjs} +10 -10
  40. package/dist/agent-verifier/{chunk-UIOLGH4A.mjs → local-typecheck-DHVLM37Z.mjs} +4 -4
  41. package/dist/agent-verifier/local-typecheck-DHVLM37Z.mjs.map +1 -0
  42. package/dist/agent-verifier/{materialize-workspace-ZAVGQQSF.mjs → materialize-workspace-MAGKDMK5.mjs} +23 -22
  43. package/dist/agent-verifier/materialize-workspace-MAGKDMK5.mjs.map +1 -0
  44. package/dist/agent-verifier/{project-state-K576C2TE.mjs → project-state-XKUSCFSV.mjs} +2 -2
  45. package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs → prompt-VKHMCQT6.mjs} +2 -2
  46. package/dist/agent-verifier/{chunk-A64ZZUZV.mjs → reducer-bundle-preflight-GLUJKTWU.mjs} +76 -25
  47. package/dist/agent-verifier/reducer-bundle-preflight-GLUJKTWU.mjs.map +1 -0
  48. package/dist/agent-verifier/{chunk-JGT4P4UD.mjs → reducer-contract-preflight-WVQQPW5F.mjs} +7 -6
  49. package/dist/agent-verifier/reducer-contract-preflight-WVQQPW5F.mjs.map +1 -0
  50. package/dist/agent-verifier/{chunk-E7SSWJXJ.mjs → reducer-native-test-harness-UFMSNNDY.mjs} +463 -686
  51. package/dist/agent-verifier/reducer-native-test-harness-UFMSNNDY.mjs.map +1 -0
  52. package/dist/agent-verifier/static-scaffold-CLRRWXON.mjs +24 -0
  53. package/dist/agent-verifier/workspace-codegen-SPPVHURX.mjs +10 -0
  54. package/dist/agent-verifier/{workspace-dependencies-NOOQBK6I.mjs → workspace-dependencies-5HEEKZFP.mjs} +6 -4
  55. package/dist/authoring-compatibility-internal.js +12 -0
  56. package/dist/chunk-2H7UOFLK.js +11 -0
  57. package/dist/chunk-6NYVJYN4.js +313 -0
  58. package/dist/chunk-6NYVJYN4.js.map +1 -0
  59. package/dist/chunk-EQNBQVIW.js +204 -0
  60. package/dist/chunk-EQNBQVIW.js.map +1 -0
  61. package/dist/chunk-X244CUU4.js +3815 -0
  62. package/dist/chunk-X244CUU4.js.map +1 -0
  63. package/dist/{chunk-TAQKH67O.js → chunk-YNJVKC2T.js} +2587 -7278
  64. package/dist/chunk-YNJVKC2T.js.map +1 -0
  65. package/dist/{global-config-S4ZIPECE.js → global-config-RBMW7IVA.js} +4 -3
  66. package/dist/index.js +3099 -6187
  67. package/dist/index.js.map +1 -1
  68. package/dist/internal.js +36 -10
  69. package/dist/internal.js.map +1 -1
  70. package/dist/{keychain-backend-HDF4TZDL.js → keychain-backend-FSNTNTZE.js} +12 -7
  71. package/dist/keychain-backend-FSNTNTZE.js.map +1 -0
  72. package/dist/{prompt-NDV3AE5L.js → prompt-GMZABCJC.js} +2 -2
  73. package/package.json +9 -19
  74. package/release/authoring-release-set.json +38 -0
  75. package/skills/dreamboard/SKILL.md +30 -28
  76. package/skills/dreamboard/references/building-your-first-game.md +15 -15
  77. package/skills/dreamboard/references/cli.md +46 -47
  78. package/skills/dreamboard/references/manifest-authoring.md +11 -3
  79. package/skills/dreamboard/references/quickstart.md +16 -13
  80. package/skills/dreamboard/references/testing.md +6 -13
  81. package/dist/agent-verifier/chunk-3UKQVWLV.mjs +0 -1744
  82. package/dist/agent-verifier/chunk-3UKQVWLV.mjs.map +0 -1
  83. package/dist/agent-verifier/chunk-776W3UGV.mjs.map +0 -1
  84. package/dist/agent-verifier/chunk-7WWGFAAU.mjs.map +0 -1
  85. package/dist/agent-verifier/chunk-A64ZZUZV.mjs.map +0 -1
  86. package/dist/agent-verifier/chunk-E7SSWJXJ.mjs.map +0 -1
  87. package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +0 -1
  88. package/dist/agent-verifier/chunk-G42BGGG2.mjs +0 -70
  89. package/dist/agent-verifier/chunk-G42BGGG2.mjs.map +0 -1
  90. package/dist/agent-verifier/chunk-H76MT5UR.mjs.map +0 -1
  91. package/dist/agent-verifier/chunk-HGMUAL33.mjs +0 -39
  92. package/dist/agent-verifier/chunk-HGMUAL33.mjs.map +0 -1
  93. package/dist/agent-verifier/chunk-JGT4P4UD.mjs.map +0 -1
  94. package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +0 -1
  95. package/dist/agent-verifier/chunk-O4YCPU7C.mjs.map +0 -1
  96. package/dist/agent-verifier/chunk-S34FRJHS.mjs +0 -222
  97. package/dist/agent-verifier/chunk-S34FRJHS.mjs.map +0 -1
  98. package/dist/agent-verifier/chunk-SH5JKYOB.mjs.map +0 -1
  99. package/dist/agent-verifier/chunk-SKI2ESE5.mjs +0 -44
  100. package/dist/agent-verifier/chunk-TAEQKBJB.mjs.map +0 -1
  101. package/dist/agent-verifier/chunk-UIOLGH4A.mjs.map +0 -1
  102. package/dist/agent-verifier/chunk-UIZNWRM6.mjs +0 -2432
  103. package/dist/agent-verifier/chunk-UIZNWRM6.mjs.map +0 -1
  104. package/dist/agent-verifier/chunk-W3N3QJ4V.mjs +0 -624
  105. package/dist/agent-verifier/chunk-W3N3QJ4V.mjs.map +0 -1
  106. package/dist/agent-verifier/chunk-XGWCY624.mjs.map +0 -1
  107. package/dist/agent-verifier/chunk-XQXDOBYB.mjs.map +0 -1
  108. package/dist/agent-verifier/compile-TEQVA46V.mjs +0 -312
  109. package/dist/agent-verifier/compile-TEQVA46V.mjs.map +0 -1
  110. package/dist/agent-verifier/keychain-backend-SPQWGKZN.mjs.map +0 -1
  111. package/dist/agent-verifier/local-typecheck-XVGWI75X.mjs +0 -10
  112. package/dist/agent-verifier/materialize-workspace-ZAVGQQSF.mjs.map +0 -1
  113. package/dist/agent-verifier/reducer-bundle-preflight-LXNJUBKL.mjs +0 -20
  114. package/dist/agent-verifier/reducer-contract-preflight-TUMQ43JV.mjs +0 -11
  115. package/dist/agent-verifier/reducer-native-test-harness-CHX5MBL5.mjs +0 -50
  116. package/dist/agent-verifier/static-scaffold-R7SVDRQI.mjs +0 -27
  117. package/dist/agent-verifier/sync-THAI546U.mjs +0 -588
  118. package/dist/agent-verifier/sync-THAI546U.mjs.map +0 -1
  119. package/dist/agent-verifier/test-AFAQFKOB.mjs +0 -353
  120. package/dist/agent-verifier/test-AFAQFKOB.mjs.map +0 -1
  121. package/dist/agent-verifier/workspace-codegen-2ZMQRIKJ.mjs +0 -10
  122. package/dist/agent-verifier/workspace-dependencies-NOOQBK6I.mjs.map +0 -1
  123. package/dist/chunk-N7XPNNUI.js +0 -432
  124. package/dist/chunk-N7XPNNUI.js.map +0 -1
  125. package/dist/chunk-SEGVTWSK.js +0 -44
  126. package/dist/chunk-SEGVTWSK.js.map +0 -1
  127. package/dist/chunk-TAQKH67O.js.map +0 -1
  128. package/dist/dev-host/components/drawer.tsx +0 -132
  129. package/dist/dev-host/components/input.tsx +0 -21
  130. package/dist/dev-host/dev-api-proxy-plugin.ts +0 -328
  131. package/dist/dev-host/dev-author-dom-warnings.ts +0 -100
  132. package/dist/dev-host/dev-diagnostics.ts +0 -62
  133. package/dist/dev-host/dev-fallback-stylesheet.ts +0 -53
  134. package/dist/dev-host/dev-hmr-guard-plugin.ts +0 -47
  135. package/dist/dev-host/dev-host-controller.ts +0 -674
  136. package/dist/dev-host/dev-host-player-query.ts +0 -17
  137. package/dist/dev-host/dev-host-session-transport.ts +0 -52
  138. package/dist/dev-host/dev-host-storage.ts +0 -56
  139. package/dist/dev-host/dev-log-relay-plugin.ts +0 -510
  140. package/dist/dev-host/dev-runtime-config.ts +0 -14
  141. package/dist/dev-host/dev-runtime-platform.ts +0 -335
  142. package/dist/dev-host/dev-virtual-modules-plugin.ts +0 -64
  143. package/dist/dev-host/host-main.css +0 -224
  144. package/dist/dev-host/host-main.tsx +0 -948
  145. package/dist/dev-host/index.html +0 -56
  146. package/dist/dev-host/lib/utils.ts +0 -6
  147. package/dist/dev-host/plugin-main.ts +0 -61
  148. package/dist/dev-host/plugin.html +0 -24
  149. package/dist/dev-host/shared-styles.css +0 -144
  150. package/dist/dev-host/start-dev-server.ts +0 -140
  151. package/dist/dev-host/virtual-modules.d.ts +0 -27
  152. package/dist/global-config-S4ZIPECE.js.map +0 -1
  153. package/dist/keychain-backend-HDF4TZDL.js.map +0 -1
  154. package/skills/dreamboard/scripts/events-extract.mjs +0 -218
  155. /package/dist/agent-verifier/{chunk-SKI2ESE5.mjs.map → chunk-H6XDQJ3N.mjs.map} +0 -0
  156. /package/dist/agent-verifier/{chunk-VS573ERH.mjs.map → chunk-JZTH3EMV.mjs.map} +0 -0
  157. /package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs.map → global-config-2NUESNEQ.mjs.map} +0 -0
  158. /package/dist/agent-verifier/{local-files-JFOQQZDL.mjs.map → local-files-OF4QFISU.mjs.map} +0 -0
  159. /package/dist/agent-verifier/{local-typecheck-XVGWI75X.mjs.map → project-state-XKUSCFSV.mjs.map} +0 -0
  160. /package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs.map → prompt-VKHMCQT6.mjs.map} +0 -0
  161. /package/dist/agent-verifier/{project-state-K576C2TE.mjs.map → static-scaffold-CLRRWXON.mjs.map} +0 -0
  162. /package/dist/agent-verifier/{reducer-bundle-preflight-LXNJUBKL.mjs.map → workspace-codegen-SPPVHURX.mjs.map} +0 -0
  163. /package/dist/agent-verifier/{reducer-contract-preflight-TUMQ43JV.mjs.map → workspace-dependencies-5HEEKZFP.mjs.map} +0 -0
  164. /package/dist/{agent-verifier/reducer-native-test-harness-CHX5MBL5.mjs.map → authoring-compatibility-internal.js.map} +0 -0
  165. /package/dist/{agent-verifier/static-scaffold-R7SVDRQI.mjs.map → chunk-2H7UOFLK.js.map} +0 -0
  166. /package/dist/{agent-verifier/workspace-codegen-2ZMQRIKJ.mjs.map → global-config-RBMW7IVA.js.map} +0 -0
  167. /package/dist/{prompt-NDV3AE5L.js.map → prompt-GMZABCJC.js.map} +0 -0
  168. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.framework.json +0 -0
  169. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.json +0 -0
  170. /package/{dist/scaffold → scaffold}/assets/static/ui/index.tsx +0 -0
  171. /package/{dist/scaffold → scaffold}/assets/static/ui/style.css +0 -0
  172. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.framework.json +0 -0
  173. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.json +0 -0
@@ -1,19 +1,1985 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- assertCompilerPortableDependencies,
4
- consola,
5
- resolveProjectContext
6
- } from "./chunk-3UKQVWLV.mjs";
7
- import "./chunk-SH5JKYOB.mjs";
8
- import "./chunk-776W3UGV.mjs";
9
- import "./chunk-NAK77WXW.mjs";
10
- import "./chunk-TAEQKBJB.mjs";
11
- import "./chunk-IAYRNVUC.mjs";
12
- import "./chunk-H76MT5UR.mjs";
13
- import "./chunk-SKI2ESE5.mjs";
3
+ findProjectRoot,
4
+ loadProjectConfig
5
+ } from "./chunk-M6YNQZCC.mjs";
6
+ import {
7
+ getStoredSession,
8
+ loadGlobalConfig,
9
+ withCredentialLock
10
+ } from "./chunk-MIRGCMUC.mjs";
11
+ import "./chunk-GWRZRWCF.mjs";
12
+ import {
13
+ readJsonFile,
14
+ readTextFileIfExists
15
+ } from "./chunk-LMW66VBH.mjs";
16
+ import {
17
+ client
18
+ } from "./chunk-MYMVXTZT.mjs";
19
+ import {
20
+ DEFAULT_API_BASE_URL,
21
+ DEFAULT_WEB_BASE_URL,
22
+ ENVIRONMENT_CONFIGS
23
+ } from "./chunk-M7UVBANQ.mjs";
24
+ import "./chunk-H6XDQJ3N.mjs";
14
25
 
15
26
  // src/agent-verifier/agent-workspace-verifier.ts
16
27
  import { readFile } from "fs/promises";
28
+
29
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
30
+ var LogLevels = {
31
+ silent: Number.NEGATIVE_INFINITY,
32
+ fatal: 0,
33
+ error: 0,
34
+ warn: 1,
35
+ log: 2,
36
+ info: 3,
37
+ success: 3,
38
+ fail: 3,
39
+ ready: 3,
40
+ start: 3,
41
+ box: 3,
42
+ debug: 4,
43
+ trace: 5,
44
+ verbose: Number.POSITIVE_INFINITY
45
+ };
46
+ var LogTypes = {
47
+ // Silent
48
+ silent: {
49
+ level: -1
50
+ },
51
+ // Level 0
52
+ fatal: {
53
+ level: LogLevels.fatal
54
+ },
55
+ error: {
56
+ level: LogLevels.error
57
+ },
58
+ // Level 1
59
+ warn: {
60
+ level: LogLevels.warn
61
+ },
62
+ // Level 2
63
+ log: {
64
+ level: LogLevels.log
65
+ },
66
+ // Level 3
67
+ info: {
68
+ level: LogLevels.info
69
+ },
70
+ success: {
71
+ level: LogLevels.success
72
+ },
73
+ fail: {
74
+ level: LogLevels.fail
75
+ },
76
+ ready: {
77
+ level: LogLevels.info
78
+ },
79
+ start: {
80
+ level: LogLevels.info
81
+ },
82
+ box: {
83
+ level: LogLevels.info
84
+ },
85
+ // Level 4
86
+ debug: {
87
+ level: LogLevels.debug
88
+ },
89
+ // Level 5
90
+ trace: {
91
+ level: LogLevels.trace
92
+ },
93
+ // Verbose
94
+ verbose: {
95
+ level: LogLevels.verbose
96
+ }
97
+ };
98
+ function isPlainObject$1(value) {
99
+ if (value === null || typeof value !== "object") {
100
+ return false;
101
+ }
102
+ const prototype = Object.getPrototypeOf(value);
103
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
104
+ return false;
105
+ }
106
+ if (Symbol.iterator in value) {
107
+ return false;
108
+ }
109
+ if (Symbol.toStringTag in value) {
110
+ return Object.prototype.toString.call(value) === "[object Module]";
111
+ }
112
+ return true;
113
+ }
114
+ function _defu(baseObject, defaults, namespace = ".", merger) {
115
+ if (!isPlainObject$1(defaults)) {
116
+ return _defu(baseObject, {}, namespace, merger);
117
+ }
118
+ const object = Object.assign({}, defaults);
119
+ for (const key in baseObject) {
120
+ if (key === "__proto__" || key === "constructor") {
121
+ continue;
122
+ }
123
+ const value = baseObject[key];
124
+ if (value === null || value === void 0) {
125
+ continue;
126
+ }
127
+ if (merger && merger(object, key, value, namespace)) {
128
+ continue;
129
+ }
130
+ if (Array.isArray(value) && Array.isArray(object[key])) {
131
+ object[key] = [...value, ...object[key]];
132
+ } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
133
+ object[key] = _defu(
134
+ value,
135
+ object[key],
136
+ (namespace ? `${namespace}.` : "") + key.toString(),
137
+ merger
138
+ );
139
+ } else {
140
+ object[key] = value;
141
+ }
142
+ }
143
+ return object;
144
+ }
145
+ function createDefu(merger) {
146
+ return (...arguments_) => (
147
+ // eslint-disable-next-line unicorn/no-array-reduce
148
+ arguments_.reduce((p, c2) => _defu(p, c2, "", merger), {})
149
+ );
150
+ }
151
+ var defu = createDefu();
152
+ function isPlainObject(obj) {
153
+ return Object.prototype.toString.call(obj) === "[object Object]";
154
+ }
155
+ function isLogObj(arg) {
156
+ if (!isPlainObject(arg)) {
157
+ return false;
158
+ }
159
+ if (!arg.message && !arg.args) {
160
+ return false;
161
+ }
162
+ if (arg.stack) {
163
+ return false;
164
+ }
165
+ return true;
166
+ }
167
+ var paused = false;
168
+ var queue = [];
169
+ var Consola = class _Consola {
170
+ options;
171
+ _lastLog;
172
+ _mockFn;
173
+ /**
174
+ * Creates an instance of Consola with specified options or defaults.
175
+ *
176
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
177
+ */
178
+ constructor(options = {}) {
179
+ const types = options.types || LogTypes;
180
+ this.options = defu(
181
+ {
182
+ ...options,
183
+ defaults: { ...options.defaults },
184
+ level: _normalizeLogLevel(options.level, types),
185
+ reporters: [...options.reporters || []]
186
+ },
187
+ {
188
+ types: LogTypes,
189
+ throttle: 1e3,
190
+ throttleMin: 5,
191
+ formatOptions: {
192
+ date: true,
193
+ colors: false,
194
+ compact: true
195
+ }
196
+ }
197
+ );
198
+ for (const type in types) {
199
+ const defaults = {
200
+ type,
201
+ ...this.options.defaults,
202
+ ...types[type]
203
+ };
204
+ this[type] = this._wrapLogFn(defaults);
205
+ this[type].raw = this._wrapLogFn(
206
+ defaults,
207
+ true
208
+ );
209
+ }
210
+ if (this.options.mockFn) {
211
+ this.mockTypes();
212
+ }
213
+ this._lastLog = {};
214
+ }
215
+ /**
216
+ * Gets the current log level of the Consola instance.
217
+ *
218
+ * @returns {number} The current log level.
219
+ */
220
+ get level() {
221
+ return this.options.level;
222
+ }
223
+ /**
224
+ * Sets the minimum log level that will be output by the instance.
225
+ *
226
+ * @param {number} level - The new log level to set.
227
+ */
228
+ set level(level) {
229
+ this.options.level = _normalizeLogLevel(
230
+ level,
231
+ this.options.types,
232
+ this.options.level
233
+ );
234
+ }
235
+ /**
236
+ * Displays a prompt to the user and returns the response.
237
+ * Throw an error if `prompt` is not supported by the current configuration.
238
+ *
239
+ * @template T
240
+ * @param {string} message - The message to display in the prompt.
241
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
242
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
243
+ */
244
+ prompt(message, opts) {
245
+ if (!this.options.prompt) {
246
+ throw new Error("prompt is not supported!");
247
+ }
248
+ return this.options.prompt(message, opts);
249
+ }
250
+ /**
251
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
252
+ *
253
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
254
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
255
+ */
256
+ create(options) {
257
+ const instance = new _Consola({
258
+ ...this.options,
259
+ ...options
260
+ });
261
+ if (this._mockFn) {
262
+ instance.mockTypes(this._mockFn);
263
+ }
264
+ return instance;
265
+ }
266
+ /**
267
+ * Creates a new Consola instance with the specified default log object properties.
268
+ *
269
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
270
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
271
+ */
272
+ withDefaults(defaults) {
273
+ return this.create({
274
+ ...this.options,
275
+ defaults: {
276
+ ...this.options.defaults,
277
+ ...defaults
278
+ }
279
+ });
280
+ }
281
+ /**
282
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
283
+ *
284
+ * @param {string} tag - The tag to include in each log of the new instance.
285
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
286
+ */
287
+ withTag(tag) {
288
+ return this.withDefaults({
289
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
290
+ });
291
+ }
292
+ /**
293
+ * Adds a custom reporter to the Consola instance.
294
+ * Reporters will be called for each log message, depending on their implementation and log level.
295
+ *
296
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
297
+ * @returns {Consola} The current Consola instance.
298
+ */
299
+ addReporter(reporter) {
300
+ this.options.reporters.push(reporter);
301
+ return this;
302
+ }
303
+ /**
304
+ * Removes a custom reporter from the Consola instance.
305
+ * If no reporter is specified, all reporters will be removed.
306
+ *
307
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
308
+ * @returns {Consola} The current Consola instance.
309
+ */
310
+ removeReporter(reporter) {
311
+ if (reporter) {
312
+ const i2 = this.options.reporters.indexOf(reporter);
313
+ if (i2 !== -1) {
314
+ return this.options.reporters.splice(i2, 1);
315
+ }
316
+ } else {
317
+ this.options.reporters.splice(0);
318
+ }
319
+ return this;
320
+ }
321
+ /**
322
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
323
+ *
324
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
325
+ * @returns {Consola} The current Consola instance.
326
+ */
327
+ setReporters(reporters) {
328
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
329
+ return this;
330
+ }
331
+ wrapAll() {
332
+ this.wrapConsole();
333
+ this.wrapStd();
334
+ }
335
+ restoreAll() {
336
+ this.restoreConsole();
337
+ this.restoreStd();
338
+ }
339
+ /**
340
+ * Overrides console methods with Consola logging methods for consistent logging.
341
+ */
342
+ wrapConsole() {
343
+ for (const type in this.options.types) {
344
+ if (!console["__" + type]) {
345
+ console["__" + type] = console[type];
346
+ }
347
+ console[type] = this[type].raw;
348
+ }
349
+ }
350
+ /**
351
+ * Restores the original console methods, removing Consola overrides.
352
+ */
353
+ restoreConsole() {
354
+ for (const type in this.options.types) {
355
+ if (console["__" + type]) {
356
+ console[type] = console["__" + type];
357
+ delete console["__" + type];
358
+ }
359
+ }
360
+ }
361
+ /**
362
+ * Overrides standard output and error streams to redirect them through Consola.
363
+ */
364
+ wrapStd() {
365
+ this._wrapStream(this.options.stdout, "log");
366
+ this._wrapStream(this.options.stderr, "log");
367
+ }
368
+ _wrapStream(stream, type) {
369
+ if (!stream) {
370
+ return;
371
+ }
372
+ if (!stream.__write) {
373
+ stream.__write = stream.write;
374
+ }
375
+ stream.write = (data) => {
376
+ this[type].raw(String(data).trim());
377
+ };
378
+ }
379
+ /**
380
+ * Restores the original standard output and error streams, removing the Consola redirection.
381
+ */
382
+ restoreStd() {
383
+ this._restoreStream(this.options.stdout);
384
+ this._restoreStream(this.options.stderr);
385
+ }
386
+ _restoreStream(stream) {
387
+ if (!stream) {
388
+ return;
389
+ }
390
+ if (stream.__write) {
391
+ stream.write = stream.__write;
392
+ delete stream.__write;
393
+ }
394
+ }
395
+ /**
396
+ * Pauses logging, queues incoming logs until resumed.
397
+ */
398
+ pauseLogs() {
399
+ paused = true;
400
+ }
401
+ /**
402
+ * Resumes logging, processing any queued logs.
403
+ */
404
+ resumeLogs() {
405
+ paused = false;
406
+ const _queue = queue.splice(0);
407
+ for (const item of _queue) {
408
+ item[0]._logFn(item[1], item[2]);
409
+ }
410
+ }
411
+ /**
412
+ * Replaces logging methods with mocks if a mock function is provided.
413
+ *
414
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
415
+ */
416
+ mockTypes(mockFn) {
417
+ const _mockFn = mockFn || this.options.mockFn;
418
+ this._mockFn = _mockFn;
419
+ if (typeof _mockFn !== "function") {
420
+ return;
421
+ }
422
+ for (const type in this.options.types) {
423
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
424
+ this[type].raw = this[type];
425
+ }
426
+ }
427
+ _wrapLogFn(defaults, isRaw) {
428
+ return (...args) => {
429
+ if (paused) {
430
+ queue.push([this, defaults, args, isRaw]);
431
+ return;
432
+ }
433
+ return this._logFn(defaults, args, isRaw);
434
+ };
435
+ }
436
+ _logFn(defaults, args, isRaw) {
437
+ if ((defaults.level || 0) > this.level) {
438
+ return false;
439
+ }
440
+ const logObj = {
441
+ date: /* @__PURE__ */ new Date(),
442
+ args: [],
443
+ ...defaults,
444
+ level: _normalizeLogLevel(defaults.level, this.options.types)
445
+ };
446
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
447
+ Object.assign(logObj, args[0]);
448
+ } else {
449
+ logObj.args = [...args];
450
+ }
451
+ if (logObj.message) {
452
+ logObj.args.unshift(logObj.message);
453
+ delete logObj.message;
454
+ }
455
+ if (logObj.additional) {
456
+ if (!Array.isArray(logObj.additional)) {
457
+ logObj.additional = logObj.additional.split("\n");
458
+ }
459
+ logObj.args.push("\n" + logObj.additional.join("\n"));
460
+ delete logObj.additional;
461
+ }
462
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
463
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
464
+ const resolveLog = (newLog = false) => {
465
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
466
+ if (this._lastLog.object && repeated > 0) {
467
+ const args2 = [...this._lastLog.object.args];
468
+ if (repeated > 1) {
469
+ args2.push(`(repeated ${repeated} times)`);
470
+ }
471
+ this._log({ ...this._lastLog.object, args: args2 });
472
+ this._lastLog.count = 1;
473
+ }
474
+ if (newLog) {
475
+ this._lastLog.object = logObj;
476
+ this._log(logObj);
477
+ }
478
+ };
479
+ clearTimeout(this._lastLog.timeout);
480
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
481
+ this._lastLog.time = logObj.date;
482
+ if (diffTime < this.options.throttle) {
483
+ try {
484
+ const serializedLog = JSON.stringify([
485
+ logObj.type,
486
+ logObj.tag,
487
+ logObj.args
488
+ ]);
489
+ const isSameLog = this._lastLog.serialized === serializedLog;
490
+ this._lastLog.serialized = serializedLog;
491
+ if (isSameLog) {
492
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
493
+ if (this._lastLog.count > this.options.throttleMin) {
494
+ this._lastLog.timeout = setTimeout(
495
+ resolveLog,
496
+ this.options.throttle
497
+ );
498
+ return;
499
+ }
500
+ }
501
+ } catch {
502
+ }
503
+ }
504
+ resolveLog(true);
505
+ }
506
+ _log(logObj) {
507
+ for (const reporter of this.options.reporters) {
508
+ reporter.log(logObj, {
509
+ options: this.options
510
+ });
511
+ }
512
+ }
513
+ };
514
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
515
+ if (input === void 0) {
516
+ return defaultLevel;
517
+ }
518
+ if (typeof input === "number") {
519
+ return input;
520
+ }
521
+ if (types[input] && types[input].level !== void 0) {
522
+ return types[input].level;
523
+ }
524
+ return defaultLevel;
525
+ }
526
+ Consola.prototype.add = Consola.prototype.addReporter;
527
+ Consola.prototype.remove = Consola.prototype.removeReporter;
528
+ Consola.prototype.clear = Consola.prototype.removeReporter;
529
+ Consola.prototype.withScope = Consola.prototype.withTag;
530
+ Consola.prototype.mock = Consola.prototype.mockTypes;
531
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
532
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
533
+ function createConsola(options = {}) {
534
+ return new Consola(options);
535
+ }
536
+
537
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
538
+ import { formatWithOptions } from "util";
539
+ import { sep } from "path";
540
+ function parseStack(stack, message) {
541
+ const cwd = process.cwd() + sep;
542
+ const lines = stack.split("\n").splice(message.split("\n").length).map((l2) => l2.trim().replace("file://", "").replace(cwd, ""));
543
+ return lines;
544
+ }
545
+ function writeStream(data, stream) {
546
+ const write = stream.__write || stream.write;
547
+ return write.call(stream, data);
548
+ }
549
+ var bracket = (x) => x ? `[${x}]` : "";
550
+ var BasicReporter = class {
551
+ formatStack(stack, message, opts) {
552
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
553
+ return indent + parseStack(stack, message).join(`
554
+ ${indent}`);
555
+ }
556
+ formatError(err, opts) {
557
+ const message = err.message ?? formatWithOptions(opts, err);
558
+ const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
559
+ const level = opts?.errorLevel || 0;
560
+ const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
561
+ const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
562
+ return causedPrefix + message + "\n" + stack + causedError;
563
+ }
564
+ formatArgs(args, opts) {
565
+ const _args = args.map((arg) => {
566
+ if (arg && typeof arg.stack === "string") {
567
+ return this.formatError(arg, opts);
568
+ }
569
+ return arg;
570
+ });
571
+ return formatWithOptions(opts, ..._args);
572
+ }
573
+ formatDate(date, opts) {
574
+ return opts.date ? date.toLocaleTimeString() : "";
575
+ }
576
+ filterAndJoin(arr) {
577
+ return arr.filter(Boolean).join(" ");
578
+ }
579
+ formatLogObj(logObj, opts) {
580
+ const message = this.formatArgs(logObj.args, opts);
581
+ if (logObj.type === "box") {
582
+ return "\n" + [
583
+ bracket(logObj.tag),
584
+ logObj.title && logObj.title,
585
+ ...message.split("\n")
586
+ ].filter(Boolean).map((l2) => " > " + l2).join("\n") + "\n";
587
+ }
588
+ return this.filterAndJoin([
589
+ bracket(logObj.type),
590
+ bracket(logObj.tag),
591
+ message
592
+ ]);
593
+ }
594
+ log(logObj, ctx) {
595
+ const line = this.formatLogObj(logObj, {
596
+ columns: ctx.options.stdout.columns || 0,
597
+ ...ctx.options.formatOptions
598
+ });
599
+ return writeStream(
600
+ line + "\n",
601
+ logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
602
+ );
603
+ }
604
+ };
605
+
606
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
607
+ import g$1 from "process";
608
+
609
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
610
+ import * as tty from "tty";
611
+ var {
612
+ env = {},
613
+ argv = [],
614
+ platform = ""
615
+ } = typeof process === "undefined" ? {} : process;
616
+ var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
617
+ var isForced = "FORCE_COLOR" in env || argv.includes("--color");
618
+ var isWindows = platform === "win32";
619
+ var isDumbTerminal = env.TERM === "dumb";
620
+ var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
621
+ var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
622
+ var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
623
+ function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
624
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
625
+ }
626
+ function clearBleed(index, string, open, close, replace) {
627
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
628
+ }
629
+ function filterEmpty(open, close, replace = open, at = open.length + 1) {
630
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(
631
+ ("" + string).indexOf(close, at),
632
+ string,
633
+ open,
634
+ close,
635
+ replace
636
+ ) : "";
637
+ }
638
+ function init(open, close, replace) {
639
+ return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
640
+ }
641
+ var colorDefs = {
642
+ reset: init(0, 0),
643
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
644
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
645
+ italic: init(3, 23),
646
+ underline: init(4, 24),
647
+ inverse: init(7, 27),
648
+ hidden: init(8, 28),
649
+ strikethrough: init(9, 29),
650
+ black: init(30, 39),
651
+ red: init(31, 39),
652
+ green: init(32, 39),
653
+ yellow: init(33, 39),
654
+ blue: init(34, 39),
655
+ magenta: init(35, 39),
656
+ cyan: init(36, 39),
657
+ white: init(37, 39),
658
+ gray: init(90, 39),
659
+ bgBlack: init(40, 49),
660
+ bgRed: init(41, 49),
661
+ bgGreen: init(42, 49),
662
+ bgYellow: init(43, 49),
663
+ bgBlue: init(44, 49),
664
+ bgMagenta: init(45, 49),
665
+ bgCyan: init(46, 49),
666
+ bgWhite: init(47, 49),
667
+ blackBright: init(90, 39),
668
+ redBright: init(91, 39),
669
+ greenBright: init(92, 39),
670
+ yellowBright: init(93, 39),
671
+ blueBright: init(94, 39),
672
+ magentaBright: init(95, 39),
673
+ cyanBright: init(96, 39),
674
+ whiteBright: init(97, 39),
675
+ bgBlackBright: init(100, 49),
676
+ bgRedBright: init(101, 49),
677
+ bgGreenBright: init(102, 49),
678
+ bgYellowBright: init(103, 49),
679
+ bgBlueBright: init(104, 49),
680
+ bgMagentaBright: init(105, 49),
681
+ bgCyanBright: init(106, 49),
682
+ bgWhiteBright: init(107, 49)
683
+ };
684
+ function createColors(useColor = isColorSupported) {
685
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
686
+ }
687
+ var colors = createColors();
688
+ function getColor(color, fallback = "reset") {
689
+ return colors[color] || colors[fallback];
690
+ }
691
+ var ansiRegex = [
692
+ String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
693
+ String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
694
+ ].join("|");
695
+ function stripAnsi(text) {
696
+ return text.replace(new RegExp(ansiRegex, "g"), "");
697
+ }
698
+ var boxStylePresets = {
699
+ solid: {
700
+ tl: "\u250C",
701
+ tr: "\u2510",
702
+ bl: "\u2514",
703
+ br: "\u2518",
704
+ h: "\u2500",
705
+ v: "\u2502"
706
+ },
707
+ double: {
708
+ tl: "\u2554",
709
+ tr: "\u2557",
710
+ bl: "\u255A",
711
+ br: "\u255D",
712
+ h: "\u2550",
713
+ v: "\u2551"
714
+ },
715
+ doubleSingle: {
716
+ tl: "\u2553",
717
+ tr: "\u2556",
718
+ bl: "\u2559",
719
+ br: "\u255C",
720
+ h: "\u2500",
721
+ v: "\u2551"
722
+ },
723
+ doubleSingleRounded: {
724
+ tl: "\u256D",
725
+ tr: "\u256E",
726
+ bl: "\u2570",
727
+ br: "\u256F",
728
+ h: "\u2500",
729
+ v: "\u2551"
730
+ },
731
+ singleThick: {
732
+ tl: "\u250F",
733
+ tr: "\u2513",
734
+ bl: "\u2517",
735
+ br: "\u251B",
736
+ h: "\u2501",
737
+ v: "\u2503"
738
+ },
739
+ singleDouble: {
740
+ tl: "\u2552",
741
+ tr: "\u2555",
742
+ bl: "\u2558",
743
+ br: "\u255B",
744
+ h: "\u2550",
745
+ v: "\u2502"
746
+ },
747
+ singleDoubleRounded: {
748
+ tl: "\u256D",
749
+ tr: "\u256E",
750
+ bl: "\u2570",
751
+ br: "\u256F",
752
+ h: "\u2550",
753
+ v: "\u2502"
754
+ },
755
+ rounded: {
756
+ tl: "\u256D",
757
+ tr: "\u256E",
758
+ bl: "\u2570",
759
+ br: "\u256F",
760
+ h: "\u2500",
761
+ v: "\u2502"
762
+ }
763
+ };
764
+ var defaultStyle = {
765
+ borderColor: "white",
766
+ borderStyle: "rounded",
767
+ valign: "center",
768
+ padding: 2,
769
+ marginLeft: 1,
770
+ marginTop: 1,
771
+ marginBottom: 1
772
+ };
773
+ function box(text, _opts = {}) {
774
+ const opts = {
775
+ ..._opts,
776
+ style: {
777
+ ...defaultStyle,
778
+ ..._opts.style
779
+ }
780
+ };
781
+ const textLines = text.split("\n");
782
+ const boxLines = [];
783
+ const _color = getColor(opts.style.borderColor);
784
+ const borderStyle = {
785
+ ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
786
+ };
787
+ if (_color) {
788
+ for (const key in borderStyle) {
789
+ borderStyle[key] = _color(
790
+ borderStyle[key]
791
+ );
792
+ }
793
+ }
794
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
795
+ const height = textLines.length + paddingOffset;
796
+ const width = Math.max(
797
+ ...textLines.map((line) => stripAnsi(line).length),
798
+ opts.title ? stripAnsi(opts.title).length : 0
799
+ ) + paddingOffset;
800
+ const widthOffset = width + paddingOffset;
801
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
802
+ if (opts.style.marginTop > 0) {
803
+ boxLines.push("".repeat(opts.style.marginTop));
804
+ }
805
+ if (opts.title) {
806
+ const title = _color ? _color(opts.title) : opts.title;
807
+ const left = borderStyle.h.repeat(
808
+ Math.floor((width - stripAnsi(opts.title).length) / 2)
809
+ );
810
+ const right = borderStyle.h.repeat(
811
+ width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
812
+ );
813
+ boxLines.push(
814
+ `${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
815
+ );
816
+ } else {
817
+ boxLines.push(
818
+ `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
819
+ );
820
+ }
821
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
822
+ for (let i2 = 0; i2 < height; i2++) {
823
+ if (i2 < valignOffset || i2 >= valignOffset + textLines.length) {
824
+ boxLines.push(
825
+ `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
826
+ );
827
+ } else {
828
+ const line = textLines[i2 - valignOffset];
829
+ const left = " ".repeat(paddingOffset);
830
+ const right = " ".repeat(width - stripAnsi(line).length);
831
+ boxLines.push(
832
+ `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
833
+ );
834
+ }
835
+ }
836
+ boxLines.push(
837
+ `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
838
+ );
839
+ if (opts.style.marginBottom > 0) {
840
+ boxLines.push("".repeat(opts.style.marginBottom));
841
+ }
842
+ return boxLines.join("\n");
843
+ }
844
+
845
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
846
+ import "util";
847
+ import "path";
848
+ import "tty";
849
+ var r = /* @__PURE__ */ Object.create(null);
850
+ var i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis);
851
+ var o = new Proxy(r, { get(e, s2) {
852
+ return i()[s2] ?? r[s2];
853
+ }, has(e, s2) {
854
+ const E = i();
855
+ return s2 in E || s2 in r;
856
+ }, set(e, s2, E) {
857
+ const B = i(true);
858
+ return B[s2] = E, true;
859
+ }, deleteProperty(e, s2) {
860
+ if (!s2) return false;
861
+ const E = i(true);
862
+ return delete E[s2], true;
863
+ }, ownKeys() {
864
+ const e = i(true);
865
+ return Object.keys(e);
866
+ } });
867
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
868
+ var f = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", { ci: true }], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", { ci: false }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", { ci: false }], ["VERCEL", "VERCEL_ENV", { ci: false }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }], ["CODESANDBOX", "CODESANDBOX_HOST", { ci: false }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", { ci: true }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", { ci: true }]];
869
+ function b() {
870
+ if (globalThis.process?.env) for (const e of f) {
871
+ const s2 = e[1] || e[0];
872
+ if (globalThis.process?.env[s2]) return { name: e[0].toLowerCase(), ...e[2] };
873
+ }
874
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? { name: "stackblitz", ci: false } : { name: "", ci: false };
875
+ }
876
+ var l = b();
877
+ l.name;
878
+ function n(e) {
879
+ return e ? e !== "false" : false;
880
+ }
881
+ var I = globalThis.process?.platform || "";
882
+ var T = n(o.CI) || l.ci !== false;
883
+ var a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
884
+ var g = n(o.DEBUG);
885
+ var R = t === "test" || n(o.TEST);
886
+ n(o.MINIMAL) || T || R || !a;
887
+ var A = /^win/i.test(I);
888
+ !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM !== "dumb" || T);
889
+ var C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
890
+ Number(C?.split(".")[0]) || null;
891
+ var y = globalThis.process || /* @__PURE__ */ Object.create(null);
892
+ var _ = { versions: {} };
893
+ new Proxy(y, { get(e, s2) {
894
+ if (s2 === "env") return o;
895
+ if (s2 in e) return e[s2];
896
+ if (s2 in _) return _[s2];
897
+ } });
898
+ var c = globalThis.process?.release?.name === "node";
899
+ var O = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
900
+ var D = !!globalThis.Deno;
901
+ var L = !!globalThis.fastly;
902
+ var S = !!globalThis.Netlify;
903
+ var u = !!globalThis.EdgeRuntime;
904
+ var N = globalThis.navigator?.userAgent === "Cloudflare-Workers";
905
+ var F = [[S, "netlify"], [u, "edge-light"], [N, "workerd"], [L, "fastly"], [D, "deno"], [O, "bun"], [c, "node"]];
906
+ function G() {
907
+ const e = F.find((s2) => s2[0]);
908
+ if (e) return { name: e[1] };
909
+ }
910
+ var P = G();
911
+ P?.name || "";
912
+ function ansiRegex2({ onlyFirst = false } = {}) {
913
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
914
+ const pattern = [
915
+ `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
916
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
917
+ ].join("|");
918
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
919
+ }
920
+ var regex = ansiRegex2();
921
+ function stripAnsi2(string) {
922
+ if (typeof string !== "string") {
923
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
924
+ }
925
+ return string.replace(regex, "");
926
+ }
927
+ function isAmbiguous(x) {
928
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
929
+ }
930
+ function isFullWidth(x) {
931
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
932
+ }
933
+ function isWide(x) {
934
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
935
+ }
936
+ function validate(codePoint) {
937
+ if (!Number.isSafeInteger(codePoint)) {
938
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
939
+ }
940
+ }
941
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
942
+ validate(codePoint);
943
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
944
+ return 2;
945
+ }
946
+ return 1;
947
+ }
948
+ var emojiRegex = () => {
949
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
950
+ };
951
+ var segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
952
+ var defaultIgnorableCodePointRegex = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
953
+ function stringWidth$1(string, options = {}) {
954
+ if (typeof string !== "string" || string.length === 0) {
955
+ return 0;
956
+ }
957
+ const {
958
+ ambiguousIsNarrow = true,
959
+ countAnsiEscapeCodes = false
960
+ } = options;
961
+ if (!countAnsiEscapeCodes) {
962
+ string = stripAnsi2(string);
963
+ }
964
+ if (string.length === 0) {
965
+ return 0;
966
+ }
967
+ let width = 0;
968
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
969
+ for (const { segment: character } of segmenter.segment(string)) {
970
+ const codePoint = character.codePointAt(0);
971
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
972
+ continue;
973
+ }
974
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
975
+ continue;
976
+ }
977
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
978
+ continue;
979
+ }
980
+ if (codePoint >= 55296 && codePoint <= 57343) {
981
+ continue;
982
+ }
983
+ if (codePoint >= 65024 && codePoint <= 65039) {
984
+ continue;
985
+ }
986
+ if (defaultIgnorableCodePointRegex.test(character)) {
987
+ continue;
988
+ }
989
+ if (emojiRegex().test(character)) {
990
+ width += 2;
991
+ continue;
992
+ }
993
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
994
+ }
995
+ return width;
996
+ }
997
+ function isUnicodeSupported() {
998
+ const { env: env2 } = g$1;
999
+ const { TERM, TERM_PROGRAM } = env2;
1000
+ if (g$1.platform !== "win32") {
1001
+ return TERM !== "linux";
1002
+ }
1003
+ return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1004
+ }
1005
+ var TYPE_COLOR_MAP = {
1006
+ info: "cyan",
1007
+ fail: "red",
1008
+ success: "green",
1009
+ ready: "green",
1010
+ start: "magenta"
1011
+ };
1012
+ var LEVEL_COLOR_MAP = {
1013
+ 0: "red",
1014
+ 1: "yellow"
1015
+ };
1016
+ var unicode = isUnicodeSupported();
1017
+ var s = (c2, fallback) => unicode ? c2 : fallback;
1018
+ var TYPE_ICONS = {
1019
+ error: s("\u2716", "\xD7"),
1020
+ fatal: s("\u2716", "\xD7"),
1021
+ ready: s("\u2714", "\u221A"),
1022
+ warn: s("\u26A0", "\u203C"),
1023
+ info: s("\u2139", "i"),
1024
+ success: s("\u2714", "\u221A"),
1025
+ debug: s("\u2699", "D"),
1026
+ trace: s("\u2192", "\u2192"),
1027
+ fail: s("\u2716", "\xD7"),
1028
+ start: s("\u25D0", "o"),
1029
+ log: ""
1030
+ };
1031
+ function stringWidth(str) {
1032
+ const hasICU = typeof Intl === "object";
1033
+ if (!hasICU || !Intl.Segmenter) {
1034
+ return stripAnsi(str).length;
1035
+ }
1036
+ return stringWidth$1(str);
1037
+ }
1038
+ var FancyReporter = class extends BasicReporter {
1039
+ formatStack(stack, message, opts) {
1040
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
1041
+ return `
1042
+ ${indent}` + parseStack(stack, message).map(
1043
+ (line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_2, m) => `(${colors.cyan(m)})`)
1044
+ ).join(`
1045
+ ${indent}`);
1046
+ }
1047
+ formatType(logObj, isBadge, opts) {
1048
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1049
+ if (isBadge) {
1050
+ return getBgColor(typeColor)(
1051
+ colors.black(` ${logObj.type.toUpperCase()} `)
1052
+ );
1053
+ }
1054
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1055
+ return _type ? getColor2(typeColor)(_type) : "";
1056
+ }
1057
+ formatLogObj(logObj, opts) {
1058
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
1059
+ "\n"
1060
+ );
1061
+ if (logObj.type === "box") {
1062
+ return box(
1063
+ characterFormat(
1064
+ message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
1065
+ ),
1066
+ {
1067
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
1068
+ style: logObj.style
1069
+ }
1070
+ );
1071
+ }
1072
+ const date = this.formatDate(logObj.date, opts);
1073
+ const coloredDate = date && colors.gray(date);
1074
+ const isBadge = logObj.badge ?? logObj.level < 2;
1075
+ const type = this.formatType(logObj, isBadge, opts);
1076
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1077
+ let line;
1078
+ const left = this.filterAndJoin([type, characterFormat(message)]);
1079
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1080
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1081
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1082
+ line += characterFormat(
1083
+ additional.length > 0 ? "\n" + additional.join("\n") : ""
1084
+ );
1085
+ if (logObj.type === "trace") {
1086
+ const _err = new Error("Trace: " + logObj.message);
1087
+ line += this.formatStack(_err.stack || "", _err.message);
1088
+ }
1089
+ return isBadge ? "\n" + line + "\n" : line;
1090
+ }
1091
+ };
1092
+ function characterFormat(str) {
1093
+ return str.replace(/`([^`]+)`/gm, (_2, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_2, m) => ` ${colors.underline(m)} `);
1094
+ }
1095
+ function getColor2(color = "white") {
1096
+ return colors[color] || colors.white;
1097
+ }
1098
+ function getBgColor(color = "bgWhite") {
1099
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1100
+ }
1101
+ function createConsola2(options = {}) {
1102
+ let level = _getDefaultLogLevel();
1103
+ if (process.env.CONSOLA_LEVEL) {
1104
+ level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1105
+ }
1106
+ const consola2 = createConsola({
1107
+ level,
1108
+ defaults: { level },
1109
+ stdout: process.stdout,
1110
+ stderr: process.stderr,
1111
+ prompt: (...args) => import("./prompt-VKHMCQT6.mjs").then((m) => m.prompt(...args)),
1112
+ reporters: options.reporters || [
1113
+ options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()
1114
+ ],
1115
+ ...options
1116
+ });
1117
+ return consola2;
1118
+ }
1119
+ function _getDefaultLogLevel() {
1120
+ if (g) {
1121
+ return LogLevels.debug;
1122
+ }
1123
+ if (R) {
1124
+ return LogLevels.warn;
1125
+ }
1126
+ return LogLevels.info;
1127
+ }
1128
+ var consola = createConsola2();
1129
+
1130
+ // src/build-target.ts
1131
+ var injectedBuildChannel = true ? "development" : void 0;
1132
+ var BUILD_CHANNEL = injectedBuildChannel === "published" ? "published" : "development";
1133
+ var IS_PUBLISHED_BUILD = BUILD_CHANNEL === "published";
1134
+ var PUBLISHED_ENVIRONMENT = "prod";
1135
+
1136
+ // src/auth/refresh-error.ts
1137
+ function classifyRefreshError(error) {
1138
+ const message = error.message?.toLowerCase() ?? "";
1139
+ if (error.status === 400 || error.status === 401 || message.includes("invalid_grant") || message.includes("refresh token") || message.includes("expired") || message.includes("revoked")) {
1140
+ return { kind: "permanent_invalid", reason: error.message };
1141
+ }
1142
+ if (error.status === 408 || error.status === 429 || typeof error.status === "number" && error.status >= 500 || message.includes("timeout") || message.includes("network") || message.includes("fetch failed")) {
1143
+ return { kind: "transient", reason: error.message };
1144
+ }
1145
+ return { kind: "unknown", reason: error.message };
1146
+ }
1147
+
1148
+ // src/auth/clerk-oauth.ts
1149
+ import crypto from "crypto";
1150
+ async function refreshClerkOAuthToken(input) {
1151
+ const { clientId, tokenUrl } = assertConfigured(input.config);
1152
+ const body = new URLSearchParams({
1153
+ grant_type: "refresh_token",
1154
+ client_id: clientId,
1155
+ refresh_token: input.refreshToken
1156
+ });
1157
+ return requestClerkToken(tokenUrl, body);
1158
+ }
1159
+ function assertConfigured(config) {
1160
+ const issuer = config.issuer?.trim().replace(/\/$/, "");
1161
+ const clientId = config.clientId?.trim();
1162
+ if (!issuer || !clientId) {
1163
+ throw new Error(
1164
+ [
1165
+ "Clerk OAuth CLI is not configured for this environment.",
1166
+ "The CLI expects first-party environments to be configured in its built-in registry.",
1167
+ "If this environment has no registered public Clerk OAuth client, create one and release a CLI with its client id.",
1168
+ "For emergency overrides, set the environment-specific DREAMBOARD_<ENV>_CLERK_OAUTH_* variables or DREAMBOARD_CLERK_OAUTH_*.",
1169
+ "For local harness auth, use `pnpm auth:local` or the auto-bootstrapped local harness flows instead."
1170
+ ].join(" ")
1171
+ );
1172
+ }
1173
+ return {
1174
+ issuer,
1175
+ clientId,
1176
+ tokenUrl: config.tokenUrl?.trim() || new URL("/oauth/token", issuer).toString(),
1177
+ scope: config.scope?.trim() || void 0
1178
+ };
1179
+ }
1180
+ async function requestClerkToken(tokenUrl, body) {
1181
+ const response = await fetch(tokenUrl, {
1182
+ method: "POST",
1183
+ headers: {
1184
+ "Content-Type": "application/x-www-form-urlencoded",
1185
+ Accept: "application/json"
1186
+ },
1187
+ body
1188
+ });
1189
+ if (!response.ok) {
1190
+ const detail = await response.text();
1191
+ throw new Error(
1192
+ `Clerk OAuth token request failed (${response.status}): ${detail}`
1193
+ );
1194
+ }
1195
+ const payload = await response.json();
1196
+ if (typeof payload.access_token !== "string") {
1197
+ throw new Error("Clerk OAuth token response did not include access_token.");
1198
+ }
1199
+ if (typeof payload.refresh_token !== "string") {
1200
+ throw new Error(
1201
+ "Clerk OAuth token response did not include refresh_token."
1202
+ );
1203
+ }
1204
+ const expiresAt = typeof payload.expires_in === "number" ? new Date(Date.now() + payload.expires_in * 1e3).toISOString() : void 0;
1205
+ return {
1206
+ accessToken: payload.access_token,
1207
+ refreshToken: payload.refresh_token,
1208
+ expiresAt,
1209
+ tokenUrl
1210
+ };
1211
+ }
1212
+
1213
+ // src/auth/token-exchange.ts
1214
+ async function exchangeDreamboardUserToken(input) {
1215
+ const fetchImpl = input.fetchImpl ?? globalThis.fetch.bind(globalThis);
1216
+ const response = await fetchImpl(
1217
+ new URL("/api/auth/token-exchange", input.apiBaseUrl),
1218
+ {
1219
+ method: "POST",
1220
+ headers: {
1221
+ Authorization: `Bearer ${input.clerkAccessToken}`,
1222
+ "Content-Type": "application/json",
1223
+ Accept: "application/json"
1224
+ },
1225
+ body: JSON.stringify({ audience: input.audience })
1226
+ }
1227
+ );
1228
+ if (!response.ok) {
1229
+ throw new Error(
1230
+ `Dreamboard token exchange failed (${response.status}). Run \`dreamboard auth login\` to authenticate again.`
1231
+ );
1232
+ }
1233
+ const payload = await response.json();
1234
+ if (typeof payload.accessToken !== "string" || payload.accessToken === "") {
1235
+ throw new Error("Dreamboard token exchange response omitted accessToken.");
1236
+ }
1237
+ if (payload.tokenType !== "Bearer") {
1238
+ throw new Error(
1239
+ "Dreamboard token exchange response had invalid tokenType."
1240
+ );
1241
+ }
1242
+ if (payload.audience !== input.audience) {
1243
+ throw new Error("Dreamboard token exchange response had wrong audience.");
1244
+ }
1245
+ const expiresIn = typeof payload.expiresIn === "number" && Number.isFinite(payload.expiresIn) ? payload.expiresIn : void 0;
1246
+ return {
1247
+ accessToken: payload.accessToken,
1248
+ tokenType: "Bearer",
1249
+ audience: input.audience,
1250
+ expiresIn,
1251
+ expiresAt: expiresIn === void 0 ? void 0 : new Date(Date.now() + expiresIn * 1e3).toISOString()
1252
+ };
1253
+ }
1254
+
1255
+ // src/auth/user-session-manager.ts
1256
+ var DEFAULT_TOKEN_MIN_VALIDITY_MS = 60 * 1e3;
1257
+ function createUserSessionManager(config) {
1258
+ return {
1259
+ async establishRefreshableSession(session) {
1260
+ return withCredentialLock(async (ops) => {
1261
+ const credentials = credentialsFromRefreshableSession(session);
1262
+ await ops.writeFull(credentials);
1263
+ const exchanged = await exchangeDreamboardUserToken({
1264
+ apiBaseUrl: config.apiBaseUrl,
1265
+ clerkAccessToken: credentials.accessToken,
1266
+ audience: "dreamboard-api"
1267
+ });
1268
+ const apiToken = toAccessToken(exchanged);
1269
+ await ops.writeFull(withApiToken(credentials, apiToken));
1270
+ return apiToken;
1271
+ });
1272
+ },
1273
+ async establishAccessOnlySession(accessToken) {
1274
+ await withCredentialLock((ops) => ops.writeAccessOnly(accessToken));
1275
+ },
1276
+ async resolveApiToken(options) {
1277
+ const localOrInjected = resolveNonStoredToken(config, "dreamboard-api");
1278
+ if (localOrInjected) return localOrInjected;
1279
+ if (!usesStoredSession(config)) return null;
1280
+ const minValidityMs = options?.minValiditySeconds === void 0 ? DEFAULT_TOKEN_MIN_VALIDITY_MS : Math.max(0, options.minValiditySeconds * 1e3);
1281
+ return withCredentialLock(async (ops) => {
1282
+ const stored = await ops.read();
1283
+ return resolveStoredApiToken(ops, config, stored, minValidityMs);
1284
+ });
1285
+ },
1286
+ async resolveGitToken() {
1287
+ const localOrInjected = resolveNonStoredToken(config, "dreamboard-git");
1288
+ if (localOrInjected) return localOrInjected;
1289
+ if (!usesStoredSession(config)) {
1290
+ throw missingSessionError();
1291
+ }
1292
+ return withCredentialLock(async (ops) => {
1293
+ const stored = await ops.read();
1294
+ const clerk = await resolveFreshClerkSession(ops, config, stored);
1295
+ return toAccessToken(
1296
+ await exchangeDreamboardUserToken({
1297
+ apiBaseUrl: config.apiBaseUrl,
1298
+ clerkAccessToken: clerk.accessToken,
1299
+ audience: "dreamboard-git"
1300
+ })
1301
+ );
1302
+ });
1303
+ },
1304
+ async inspectSession() {
1305
+ const localOrInjected = resolveNonStoredToken(config, "dreamboard-api");
1306
+ if (localOrInjected) {
1307
+ return inspectAccessOnlyToken(localOrInjected);
1308
+ }
1309
+ if (!usesStoredSession(config)) {
1310
+ return { kind: "none" };
1311
+ }
1312
+ return withCredentialLock(async (ops) => {
1313
+ const stored = await ops.read();
1314
+ if (!stored) return { kind: "none" };
1315
+ const cached = freshStoredApiToken(
1316
+ stored,
1317
+ DEFAULT_TOKEN_MIN_VALIDITY_MS
1318
+ );
1319
+ if (cached) {
1320
+ return activeStatus("refreshable", cached, false);
1321
+ }
1322
+ try {
1323
+ const token = await resolveStoredApiToken(
1324
+ ops,
1325
+ config,
1326
+ stored,
1327
+ DEFAULT_TOKEN_MIN_VALIDITY_MS
1328
+ );
1329
+ return activeStatus("refreshable", token, true);
1330
+ } catch (error) {
1331
+ return failedRefreshableStatus(error);
1332
+ }
1333
+ });
1334
+ },
1335
+ async logout() {
1336
+ await withCredentialLock((ops) => ops.clear("logout_command"));
1337
+ }
1338
+ };
1339
+ }
1340
+ async function resolveStoredApiToken(ops, config, stored, minValidityMs) {
1341
+ const cached = freshStoredApiToken(stored, minValidityMs);
1342
+ if (cached) return cached;
1343
+ const clerk = await resolveFreshClerkSession(ops, config, stored);
1344
+ const exchanged = await exchangeDreamboardUserToken({
1345
+ apiBaseUrl: config.apiBaseUrl,
1346
+ clerkAccessToken: clerk.accessToken,
1347
+ audience: "dreamboard-api"
1348
+ });
1349
+ const apiToken = toAccessToken(exchanged);
1350
+ await ops.writeFull(withApiToken(clerk, apiToken));
1351
+ return apiToken;
1352
+ }
1353
+ async function resolveFreshClerkSession(ops, config, stored) {
1354
+ if (!stored) {
1355
+ throw missingSessionError();
1356
+ }
1357
+ if (!stored.refreshToken) {
1358
+ throw new Error(
1359
+ "Stored Dreamboard session is missing its refresh token. Run `dreamboard auth login` to authenticate again."
1360
+ );
1361
+ }
1362
+ if (stored.accessToken && isFresh(
1363
+ stored.tokenExpiresAt,
1364
+ stored.accessToken,
1365
+ DEFAULT_TOKEN_MIN_VALIDITY_MS
1366
+ )) {
1367
+ return credentialsFromStored(config, stored);
1368
+ }
1369
+ const payload = await refreshClerkOAuthToken({
1370
+ config: {
1371
+ issuer: stored.clerkOAuthIssuer ?? config.clerkOAuthIssuer,
1372
+ clientId: stored.clerkOAuthClientId ?? config.clerkOAuthClientId,
1373
+ tokenUrl: stored.clerkOAuthTokenUrl ?? config.clerkOAuthTokenUrl
1374
+ },
1375
+ refreshToken: stored.refreshToken
1376
+ });
1377
+ const refreshed = {
1378
+ accessToken: payload.accessToken,
1379
+ refreshToken: payload.refreshToken,
1380
+ tokenExpiresAt: payload.expiresAt,
1381
+ dreamboardApiToken: stored.dreamboardApiToken,
1382
+ dreamboardApiExpiresAt: stored.dreamboardApiExpiresAt,
1383
+ clerkOAuthIssuer: stored.clerkOAuthIssuer ?? config.clerkOAuthIssuer,
1384
+ clerkOAuthClientId: stored.clerkOAuthClientId ?? config.clerkOAuthClientId,
1385
+ clerkOAuthTokenUrl: payload.tokenUrl,
1386
+ environment: stored.environment ?? config.environment
1387
+ };
1388
+ await ops.writeFull(refreshed);
1389
+ return refreshed;
1390
+ }
1391
+ function credentialsFromStored(config, stored) {
1392
+ if (!stored.accessToken || !stored.refreshToken) {
1393
+ throw missingSessionError();
1394
+ }
1395
+ return {
1396
+ accessToken: stored.accessToken,
1397
+ refreshToken: stored.refreshToken,
1398
+ tokenExpiresAt: stored.tokenExpiresAt,
1399
+ dreamboardApiToken: stored.dreamboardApiToken,
1400
+ dreamboardApiExpiresAt: stored.dreamboardApiExpiresAt,
1401
+ clerkOAuthIssuer: stored.clerkOAuthIssuer ?? config.clerkOAuthIssuer,
1402
+ clerkOAuthClientId: stored.clerkOAuthClientId ?? config.clerkOAuthClientId,
1403
+ clerkOAuthTokenUrl: stored.clerkOAuthTokenUrl ?? config.clerkOAuthTokenUrl,
1404
+ environment: stored.environment ?? config.environment
1405
+ };
1406
+ }
1407
+ function credentialsFromRefreshableSession(session) {
1408
+ return {
1409
+ accessToken: session.clerkAccessToken,
1410
+ refreshToken: session.refreshToken,
1411
+ tokenExpiresAt: session.clerkAccessExpiresAt,
1412
+ clerkOAuthIssuer: session.clerkOAuthIssuer,
1413
+ clerkOAuthClientId: session.clerkOAuthClientId,
1414
+ clerkOAuthTokenUrl: session.clerkOAuthTokenUrl,
1415
+ environment: session.environment
1416
+ };
1417
+ }
1418
+ function withApiToken(credentials, token) {
1419
+ return {
1420
+ ...credentials,
1421
+ dreamboardApiToken: token.token,
1422
+ dreamboardApiExpiresAt: token.expiresAt
1423
+ };
1424
+ }
1425
+ function toAccessToken(token) {
1426
+ return {
1427
+ token: token.accessToken,
1428
+ expiresAt: token.expiresAt,
1429
+ audience: token.audience
1430
+ };
1431
+ }
1432
+ function resolveNonStoredToken(config, audience) {
1433
+ if (usesStoredSession(config)) return null;
1434
+ if (!config.authToken) return null;
1435
+ return {
1436
+ token: config.authToken,
1437
+ expiresAt: config.tokenExpiresAt,
1438
+ audience
1439
+ };
1440
+ }
1441
+ function freshStoredApiToken(stored, minValidityMs) {
1442
+ if (!stored?.dreamboardApiToken) return null;
1443
+ if (isFresh(
1444
+ stored.dreamboardApiExpiresAt,
1445
+ stored.dreamboardApiToken,
1446
+ minValidityMs
1447
+ )) {
1448
+ return {
1449
+ token: stored.dreamboardApiToken,
1450
+ expiresAt: stored.dreamboardApiExpiresAt,
1451
+ audience: "dreamboard-api"
1452
+ };
1453
+ }
1454
+ return null;
1455
+ }
1456
+ function inspectAccessOnlyToken(token) {
1457
+ const expiry = resolveExpiry(token.expiresAt, token.token);
1458
+ if (expiry && expiry.getTime() <= Date.now()) {
1459
+ return {
1460
+ kind: "invalid",
1461
+ sessionKind: "access-only",
1462
+ message: "Stored Dreamboard access token is expired. Run `dreamboard auth login` to authenticate again."
1463
+ };
1464
+ }
1465
+ return activeStatus("access-only", token, false);
1466
+ }
1467
+ function failedRefreshableStatus(error) {
1468
+ const message = error instanceof Error ? error.message : String(error);
1469
+ const errorStatus = typeof error === "object" && error !== null && "status" in error ? error.status : void 0;
1470
+ const classification = classifyRefreshError({
1471
+ message,
1472
+ status: typeof errorStatus === "number" ? errorStatus : void 0
1473
+ });
1474
+ if (classification.kind === "permanent_invalid") {
1475
+ return {
1476
+ kind: "invalid",
1477
+ sessionKind: "refreshable",
1478
+ message
1479
+ };
1480
+ }
1481
+ return {
1482
+ kind: "degraded",
1483
+ sessionKind: "refreshable",
1484
+ message
1485
+ };
1486
+ }
1487
+ function activeStatus(sessionKind, apiToken, repaired) {
1488
+ return {
1489
+ kind: "active",
1490
+ sessionKind,
1491
+ apiToken,
1492
+ repaired
1493
+ };
1494
+ }
1495
+ function missingSessionError() {
1496
+ return new Error(
1497
+ "Missing Dreamboard session. Run `dreamboard auth login` to authenticate."
1498
+ );
1499
+ }
1500
+ function isFresh(expiresAt, token, minValidityMs) {
1501
+ const expiry = resolveExpiry(expiresAt, token);
1502
+ return expiry !== null && Number.isFinite(expiry.getTime()) && expiry.getTime() > Date.now() + minValidityMs;
1503
+ }
1504
+ function resolveExpiry(expiresAt, token) {
1505
+ if (expiresAt) {
1506
+ const parsed = new Date(expiresAt);
1507
+ return Number.isFinite(parsed.getTime()) ? parsed : null;
1508
+ }
1509
+ return getJwtExpiry(token);
1510
+ }
1511
+ function getJwtExpiry(accessToken) {
1512
+ if (!accessToken) return null;
1513
+ const parts = accessToken.split(".");
1514
+ if (parts.length !== 3) return null;
1515
+ try {
1516
+ const payload = JSON.parse(
1517
+ Buffer.from(parts[1], "base64url").toString("utf8")
1518
+ );
1519
+ if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp)) {
1520
+ return null;
1521
+ }
1522
+ return new Date(payload.exp * 1e3);
1523
+ } catch {
1524
+ return null;
1525
+ }
1526
+ }
1527
+ function usesStoredSession(config) {
1528
+ return config.refreshTokenSource === "global";
1529
+ }
1530
+
1531
+ // src/config/local-harness-auth.ts
1532
+ import { createHmac, randomUUID } from "crypto";
1533
+ var DEFAULT_SUBJECT = "harness-smoke-local@dreamboard.local";
1534
+ var DEFAULT_ISSUER = "dreamboard-local-harness";
1535
+ var DEFAULT_SECRET = "dreamboard-local-harness-token-secret";
1536
+ var LOCAL_AWS_ISSUER = "dreamboard-local-aws-harness";
1537
+ var LOCAL_AWS_SECRET = "dreamboard-local-aws-harness-token-secret";
1538
+ var DEFAULT_TTL_SECONDS = 8 * 60 * 60;
1539
+ var mintedTokens = /* @__PURE__ */ new Map();
1540
+ function resolveLocalHarnessAccessToken(config) {
1541
+ if (IS_PUBLISHED_BUILD || config.environment !== "local") {
1542
+ return void 0;
1543
+ }
1544
+ const profile = inferLocalHarnessProfile(config);
1545
+ if (config.authToken && (profile !== "local-aws" || isExplicitTokenSource(config.authTokenSource))) {
1546
+ return void 0;
1547
+ }
1548
+ const cacheKey = [
1549
+ profile,
1550
+ process.env.LOCAL_HARNESS_TOKEN_ISSUER ?? "",
1551
+ process.env.LOCAL_HARNESS_TOKEN_SECRET ?? "",
1552
+ process.env.LOCAL_HARNESS_SUBJECT ?? "",
1553
+ process.env.HARNESS_USER_EMAIL ?? "",
1554
+ process.env.LOCAL_HARNESS_EMAIL ?? "",
1555
+ process.env.LOCAL_HARNESS_TOKEN_TTL_SECONDS ?? ""
1556
+ ].join("\0");
1557
+ const cached = mintedTokens.get(cacheKey);
1558
+ if (cached) return cached;
1559
+ const token = mintLocalHarnessToken(profile);
1560
+ mintedTokens.set(cacheKey, token);
1561
+ return token;
1562
+ }
1563
+ function isExplicitTokenSource(source) {
1564
+ return source === "flag" || source === "env" || source === "agent-env";
1565
+ }
1566
+ function inferLocalHarnessProfile(config) {
1567
+ return isLocalAwsUrl(config.apiBaseUrl) || isLocalAwsUrl(config.webBaseUrl) ? "local-aws" : "local";
1568
+ }
1569
+ function mintLocalHarnessToken(profile) {
1570
+ const subject = envValue(process.env.LOCAL_HARNESS_SUBJECT) ?? envValue(process.env.HARNESS_USER_EMAIL) ?? DEFAULT_SUBJECT;
1571
+ const email = envValue(process.env.LOCAL_HARNESS_EMAIL) ?? (subject.includes("@") ? subject : void 0);
1572
+ const issuer = envValue(process.env.LOCAL_HARNESS_TOKEN_ISSUER) ?? (profile === "local-aws" ? LOCAL_AWS_ISSUER : DEFAULT_ISSUER);
1573
+ const secret = envValue(process.env.LOCAL_HARNESS_TOKEN_SECRET) ?? (profile === "local-aws" ? LOCAL_AWS_SECRET : DEFAULT_SECRET);
1574
+ const ttlSeconds = Number(
1575
+ envValue(process.env.LOCAL_HARNESS_TOKEN_TTL_SECONDS) ?? String(DEFAULT_TTL_SECONDS)
1576
+ );
1577
+ if (!Number.isFinite(ttlSeconds) || ttlSeconds <= 0) {
1578
+ throw new Error(
1579
+ "LOCAL_HARNESS_TOKEN_TTL_SECONDS must be a positive number."
1580
+ );
1581
+ }
1582
+ const now = Math.floor(Date.now() / 1e3);
1583
+ const payload = {
1584
+ typ: "local_harness_access",
1585
+ dreamboard_provider: "local-harness",
1586
+ dreamboard_provider_subject: subject,
1587
+ ...email ? { email } : {},
1588
+ iss: issuer,
1589
+ sub: subject,
1590
+ iat: now,
1591
+ exp: now + Math.floor(ttlSeconds),
1592
+ jti: randomUUID()
1593
+ };
1594
+ const headerPart = base64UrlJson({ alg: "HS256", typ: "JWT" });
1595
+ const payloadPart = base64UrlJson(payload);
1596
+ const signature = createHmac("sha256", secret).update(`${headerPart}.${payloadPart}`).digest("base64url");
1597
+ return `${headerPart}.${payloadPart}.${signature}`;
1598
+ }
1599
+ function base64UrlJson(value) {
1600
+ return Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
1601
+ }
1602
+ function envValue(raw) {
1603
+ return typeof raw === "string" && raw.trim().length > 0 ? raw.trim() : void 0;
1604
+ }
1605
+ function isLocalAwsUrl(rawUrl) {
1606
+ if (!rawUrl) return false;
1607
+ try {
1608
+ const url = new URL(rawUrl);
1609
+ return (url.hostname === "localhost" || url.hostname === "127.0.0.1") && (url.port === "18080" || url.port === "8088");
1610
+ } catch {
1611
+ return false;
1612
+ }
1613
+ }
1614
+
1615
+ // src/config/resolve.ts
1616
+ var TRANSIENT_READ_RETRY_DELAYS_MS = [100, 300];
1617
+ function resolveConfig(globalConfig, flags, project, credentials) {
1618
+ if (IS_PUBLISHED_BUILD) {
1619
+ assertPublicRuntimeFlags(flags);
1620
+ }
1621
+ const envEnvironment = IS_PUBLISHED_BUILD ? void 0 : environmentFromProcess();
1622
+ const projectEnvironment = IS_PUBLISHED_BUILD ? void 0 : project?.environment;
1623
+ const environment = IS_PUBLISHED_BUILD ? PUBLISHED_ENVIRONMENT : flags.env || envEnvironment || projectEnvironment || globalConfig.environment || "staging";
1624
+ const envConfig = ENVIRONMENT_CONFIGS[environment];
1625
+ const publishedEnvConfig = ENVIRONMENT_CONFIGS[PUBLISHED_ENVIRONMENT];
1626
+ const hasExplicitEnvironmentOverride = !IS_PUBLISHED_BUILD && Boolean(flags.env || envEnvironment || projectEnvironment);
1627
+ const resolvedApiBaseUrl = IS_PUBLISHED_BUILD ? publishedEnvConfig?.apiBaseUrl ?? DEFAULT_API_BASE_URL : hasExplicitEnvironmentOverride ? projectLocalBaseUrl(project?.apiBaseUrl, environment) || envConfig?.apiBaseUrl || DEFAULT_API_BASE_URL : project?.apiBaseUrl || envConfig?.apiBaseUrl || DEFAULT_API_BASE_URL;
1628
+ const apiBaseUrl = valueOrUndefined(process.env.DREAMBOARD_API_BASE_URL) ?? resolvedApiBaseUrl;
1629
+ const resolvedWebBaseUrl = IS_PUBLISHED_BUILD ? publishedEnvConfig?.webBaseUrl ?? DEFAULT_WEB_BASE_URL : hasExplicitEnvironmentOverride ? projectLocalBaseUrl(project?.webBaseUrl, environment) || envConfig?.webBaseUrl || DEFAULT_WEB_BASE_URL : project?.webBaseUrl || envConfig?.webBaseUrl || DEFAULT_WEB_BASE_URL;
1630
+ const webBaseUrl = valueOrUndefined(process.env.DREAMBOARD_WEB_BASE_URL) ?? resolvedWebBaseUrl;
1631
+ const snapshot = buildCredentialSnapshot(flags, credentials, environment);
1632
+ const oauthConfig = resolveEnvironmentOAuthConfig(environment, envConfig);
1633
+ return {
1634
+ environment,
1635
+ apiBaseUrl,
1636
+ webBaseUrl,
1637
+ authToken: snapshot.dreamboardApiToken ?? (snapshot.refreshToken ? void 0 : snapshot.accessToken),
1638
+ refreshToken: snapshot.refreshToken,
1639
+ tokenExpiresAt: snapshot.dreamboardApiExpiresAt ?? (snapshot.refreshToken ? void 0 : snapshot.tokenExpiresAt),
1640
+ clerkAccessToken: snapshot.accessToken,
1641
+ clerkAccessExpiresAt: snapshot.tokenExpiresAt,
1642
+ dreamboardApiToken: snapshot.dreamboardApiToken,
1643
+ dreamboardApiExpiresAt: snapshot.dreamboardApiExpiresAt,
1644
+ clerkOAuthIssuer: snapshot.clerkOAuthIssuer ?? oauthConfig.issuer,
1645
+ clerkOAuthClientId: snapshot.clerkOAuthClientId ?? oauthConfig.clientId,
1646
+ clerkOAuthTokenUrl: snapshot.clerkOAuthTokenUrl ?? oauthConfig.tokenUrl,
1647
+ clerkOAuthScope: oauthConfig.scope,
1648
+ authTokenSource: snapshot.authTokenSource,
1649
+ refreshTokenSource: snapshot.refreshTokenSource
1650
+ };
1651
+ }
1652
+ function resolveEnvironmentOAuthConfig(environment, envConfig) {
1653
+ const prefix = environment.toUpperCase();
1654
+ return {
1655
+ issuer: valueOrUndefined(
1656
+ process.env[`DREAMBOARD_${prefix}_CLERK_OAUTH_ISSUER`]
1657
+ ) ?? valueOrUndefined(process.env.DREAMBOARD_CLERK_OAUTH_ISSUER) ?? envConfig?.clerkOAuthIssuer,
1658
+ clientId: valueOrUndefined(
1659
+ process.env[`DREAMBOARD_${prefix}_CLERK_OAUTH_CLIENT_ID`]
1660
+ ) ?? valueOrUndefined(process.env.DREAMBOARD_CLERK_OAUTH_CLIENT_ID) ?? envConfig?.clerkOAuthClientId,
1661
+ tokenUrl: valueOrUndefined(
1662
+ process.env[`DREAMBOARD_${prefix}_CLERK_OAUTH_TOKEN_URL`]
1663
+ ) ?? valueOrUndefined(process.env.DREAMBOARD_CLERK_OAUTH_TOKEN_URL) ?? envConfig?.clerkOAuthTokenUrl,
1664
+ scope: valueOrUndefined(process.env[`DREAMBOARD_${prefix}_CLERK_OAUTH_SCOPE`]) ?? valueOrUndefined(process.env.DREAMBOARD_CLERK_OAUTH_SCOPE) ?? envConfig?.clerkOAuthScope
1665
+ };
1666
+ }
1667
+ function buildCredentialSnapshot(flags, storedCredentials, environment) {
1668
+ const flagToken = valueOrUndefined(flags.token);
1669
+ const agentEnvToken = valueOrUndefined(process.env.DREAMBOARD_AGENT_TOKEN);
1670
+ const envToken = valueOrUndefined(process.env.DREAMBOARD_TOKEN);
1671
+ const environmentScopedStoredCredentials = storedCredentials?.environment && environment && storedCredentials.environment !== environment ? null : storedCredentials ?? null;
1672
+ if (IS_PUBLISHED_BUILD) {
1673
+ const stored = environmentScopedStoredCredentials;
1674
+ if (agentEnvToken) {
1675
+ return {
1676
+ accessToken: agentEnvToken,
1677
+ refreshToken: void 0,
1678
+ tokenExpiresAt: void 0,
1679
+ authTokenSource: "agent-env",
1680
+ refreshTokenSource: "none"
1681
+ };
1682
+ }
1683
+ return {
1684
+ accessToken: stored?.accessToken,
1685
+ refreshToken: stored?.refreshToken,
1686
+ tokenExpiresAt: stored?.tokenExpiresAt,
1687
+ dreamboardApiToken: stored?.dreamboardApiToken,
1688
+ dreamboardApiExpiresAt: stored?.dreamboardApiExpiresAt,
1689
+ clerkOAuthIssuer: stored?.clerkOAuthIssuer,
1690
+ clerkOAuthClientId: stored?.clerkOAuthClientId,
1691
+ clerkOAuthTokenUrl: stored?.clerkOAuthTokenUrl,
1692
+ environment: stored?.environment,
1693
+ authTokenSource: stored?.dreamboardApiToken || stored?.accessToken && !stored.refreshToken ? "global" : "none",
1694
+ refreshTokenSource: stored?.refreshToken ? "global" : "none"
1695
+ };
1696
+ }
1697
+ const accessToken = flagToken || agentEnvToken || envToken || environmentScopedStoredCredentials?.accessToken;
1698
+ const refreshToken = environmentScopedStoredCredentials?.refreshToken;
1699
+ const authTokenSource = flagToken ? "flag" : agentEnvToken ? "agent-env" : envToken ? "env" : environmentScopedStoredCredentials?.accessToken ? "global" : "none";
1700
+ const refreshTokenSource = environmentScopedStoredCredentials?.refreshToken ? "global" : "none";
1701
+ return {
1702
+ accessToken,
1703
+ refreshToken,
1704
+ tokenExpiresAt: environmentScopedStoredCredentials?.tokenExpiresAt,
1705
+ dreamboardApiToken: environmentScopedStoredCredentials?.dreamboardApiToken,
1706
+ dreamboardApiExpiresAt: environmentScopedStoredCredentials?.dreamboardApiExpiresAt,
1707
+ clerkOAuthIssuer: environmentScopedStoredCredentials?.clerkOAuthIssuer,
1708
+ clerkOAuthClientId: environmentScopedStoredCredentials?.clerkOAuthClientId,
1709
+ clerkOAuthTokenUrl: environmentScopedStoredCredentials?.clerkOAuthTokenUrl,
1710
+ environment: environmentScopedStoredCredentials?.environment,
1711
+ authTokenSource,
1712
+ refreshTokenSource
1713
+ };
1714
+ }
1715
+ function environmentFromProcess() {
1716
+ const value = valueOrUndefined(process.env.DREAMBOARD_ENV);
1717
+ if (!value) return void 0;
1718
+ if (value === "local" || value === "staging" || value === "prod") {
1719
+ return value;
1720
+ }
1721
+ throw new Error(
1722
+ `Invalid DREAMBOARD_ENV '${value}'. Valid options: local, staging, prod`
1723
+ );
1724
+ }
1725
+ function projectLocalBaseUrl(rawUrl, environment) {
1726
+ if (environment !== "local" || !rawUrl) return void 0;
1727
+ try {
1728
+ const url = new URL(rawUrl);
1729
+ return url.hostname === "localhost" || url.hostname === "127.0.0.1" ? rawUrl : void 0;
1730
+ } catch {
1731
+ return void 0;
1732
+ }
1733
+ }
1734
+ function assertPublicRuntimeFlags(flags) {
1735
+ const argv2 = process.argv.slice(2);
1736
+ if (flags.env || argv2.includes("--env")) {
1737
+ throw new Error(
1738
+ "The published Dreamboard CLI is production-only and does not accept `--env`."
1739
+ );
1740
+ }
1741
+ if (valueOrUndefined(flags.token) || argv2.includes("--token")) {
1742
+ throw new Error(
1743
+ "Direct JWT injection is not supported in the published Dreamboard CLI. Use `dreamboard auth login` so the CLI can store and refresh your session."
1744
+ );
1745
+ }
1746
+ if (process.env.DREAMBOARD_TOKEN) {
1747
+ throw new Error(
1748
+ "The published Dreamboard CLI ignores direct token environment variables. Use `dreamboard auth login` so the CLI can manage refreshable credentials."
1749
+ );
1750
+ }
1751
+ }
1752
+ async function configureClient(config) {
1753
+ const localHarnessToken = resolveLocalHarnessAccessToken(config);
1754
+ const resolvedToken = localHarnessToken ? { token: localHarnessToken } : await createUserSessionManager(config).resolveApiToken();
1755
+ const effectiveAccessToken = resolvedToken?.token;
1756
+ client.setConfig({
1757
+ baseUrl: config.apiBaseUrl,
1758
+ fetch: createRetryingReadFetch(globalThis.fetch.bind(globalThis)),
1759
+ headers: effectiveAccessToken ? { Authorization: `Bearer ${effectiveAccessToken}` } : {}
1760
+ });
1761
+ }
1762
+ function createRetryingReadFetch(fetchImpl) {
1763
+ return (async (input, init2) => {
1764
+ const method = resolveFetchMethod(input, init2);
1765
+ if (method !== "GET" && method !== "HEAD") {
1766
+ return fetchImpl(input, init2);
1767
+ }
1768
+ let lastError;
1769
+ for (let attempt = 0; attempt <= TRANSIENT_READ_RETRY_DELAYS_MS.length; attempt += 1) {
1770
+ try {
1771
+ return await fetchImpl(input, init2);
1772
+ } catch (error) {
1773
+ lastError = error;
1774
+ if (attempt >= TRANSIENT_READ_RETRY_DELAYS_MS.length || !isTransientFetchError(error)) {
1775
+ throw error;
1776
+ }
1777
+ await sleep(TRANSIENT_READ_RETRY_DELAYS_MS[attempt]);
1778
+ }
1779
+ }
1780
+ throw lastError;
1781
+ });
1782
+ }
1783
+ function resolveFetchMethod(input, init2) {
1784
+ const method = init2?.method ?? (typeof Request !== "undefined" && input instanceof Request ? input.method : void 0);
1785
+ return (method ?? "GET").toUpperCase();
1786
+ }
1787
+ function isTransientFetchError(error) {
1788
+ const message = error instanceof Error ? error.message : typeof error === "object" && error !== null && "message" in error ? String(error.message) : String(error);
1789
+ const normalized = message.toLowerCase();
1790
+ return normalized.includes("fetch failed") || normalized.includes("network") || normalized.includes("timeout") || normalized.includes("econnreset") || normalized.includes("econnrefused") || normalized.includes("socket");
1791
+ }
1792
+ function sleep(ms) {
1793
+ return new Promise((resolve) => setTimeout(resolve, ms));
1794
+ }
1795
+ function requireAuth(config) {
1796
+ if (!config.authToken && !config.refreshToken && !resolveLocalHarnessAccessToken(config)) {
1797
+ throw new Error(
1798
+ "Missing Dreamboard session. Run `dreamboard auth login` to authenticate."
1799
+ );
1800
+ }
1801
+ }
1802
+ function valueOrUndefined(value) {
1803
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
1804
+ }
1805
+ async function loadProjectContextCredentials(requireAuth2, loadCredentials = getStoredSession) {
1806
+ return requireAuth2 ? loadCredentials() : void 0;
1807
+ }
1808
+ async function resolveProjectContext(flags, opts) {
1809
+ const projectRoot = await findProjectRoot(process.cwd());
1810
+ if (!projectRoot) {
1811
+ throw new Error(
1812
+ "Not inside a dreamboard project (missing .dreamboard/project.json)."
1813
+ );
1814
+ }
1815
+ const projectConfig = await loadProjectConfig(projectRoot);
1816
+ const requireAuthForContext = opts?.requireAuth !== false;
1817
+ const [globalConfig, credentials] = await Promise.all([
1818
+ loadGlobalConfig(),
1819
+ loadProjectContextCredentials(requireAuthForContext)
1820
+ ]);
1821
+ const config = resolveConfig(globalConfig, flags, projectConfig, credentials);
1822
+ if (requireAuthForContext) {
1823
+ requireAuth(config);
1824
+ await configureClient(config);
1825
+ }
1826
+ return { projectRoot, projectConfig, config };
1827
+ }
1828
+
1829
+ // src/services/project/dependency-portability.ts
1830
+ import path from "path";
1831
+ var DEPENDENCY_FIELDS = [
1832
+ "dependencies",
1833
+ "devDependencies",
1834
+ "optionalDependencies",
1835
+ "peerDependencies"
1836
+ ];
1837
+ var UNPORTABLE_SPECIFIER_PATTERN = /^(file|link|portal|workspace):/;
1838
+ async function buildSourceDependencyProfile(options) {
1839
+ const packageJson = await readProjectPackageJson(options.projectRoot);
1840
+ const packages = collectDreamboardPackageSpecifiers(packageJson);
1841
+ const hasLocalSnapshotPackage = Object.values(packages).some(
1842
+ (value) => value.includes("-local.")
1843
+ );
1844
+ const localMaintainerRegistry = hasLocalSnapshotPackage ? options.projectConfig?.localMaintainerRegistry : void 0;
1845
+ return {
1846
+ kind: "npm-registry",
1847
+ packageManager: packageJson.packageManager,
1848
+ dreamboardRegistryUrl: await readDreamboardRegistryFromNpmrc(options.projectRoot) ?? localMaintainerRegistry?.registryUrl,
1849
+ localSnapshotId: localMaintainerRegistry?.snapshotId,
1850
+ packages
1851
+ };
1852
+ }
1853
+ async function assertCompilerPortableDependencies(options) {
1854
+ const packageJson = await readProjectPackageJson(options.projectRoot);
1855
+ const legacyProblems = collectLegacyDreamboardSpecifiers(packageJson);
1856
+ if (legacyProblems.length > 0) {
1857
+ throwLegacyDreamboardPackageError(legacyProblems);
1858
+ }
1859
+ const problems = collectUnportableDreamboardSpecifiers(packageJson);
1860
+ if (problems.length > 0) {
1861
+ const details = problems.map(
1862
+ (problem) => `${problem.location} ${problem.packageName} -> ${problem.specifier}`
1863
+ ).join("; ");
1864
+ throw new Error(
1865
+ [
1866
+ "Compiler-bound workspaces must install Dreamboard packages from a registry.",
1867
+ `Found unportable Dreamboard dependency specifier(s): ${details}.`,
1868
+ "Use a workspace created or cloned with the current Dreamboard CLI so @dreamboard-games/* and dreamboard versions are registry-pinned before building."
1869
+ ].join(" ")
1870
+ );
1871
+ }
1872
+ const profile = await buildSourceDependencyProfile(options);
1873
+ const hasLocalSnapshotPackage = Object.values(profile.packages).some(
1874
+ (value) => value.includes("-local.")
1875
+ );
1876
+ if (hasLocalSnapshotPackage && !profile.dreamboardRegistryUrl) {
1877
+ throw new Error(
1878
+ "This workspace references local Dreamboard snapshot versions but has no @dreamboard registry configured. Recreate or reclone the workspace with the local registry configuration before building."
1879
+ );
1880
+ }
1881
+ return profile;
1882
+ }
1883
+ async function readProjectPackageJson(projectRoot) {
1884
+ return readJsonFile(
1885
+ path.join(projectRoot, "package.json")
1886
+ );
1887
+ }
1888
+ function collectDreamboardPackageSpecifiers(packageJson) {
1889
+ const packages = {};
1890
+ for (const field of DEPENDENCY_FIELDS) {
1891
+ const dependencies = packageJson[field];
1892
+ if (!dependencies) continue;
1893
+ for (const [packageName, specifier] of Object.entries(dependencies)) {
1894
+ if (isPortableDreamboardPackage(packageName)) {
1895
+ packages[packageName] = specifier;
1896
+ }
1897
+ }
1898
+ }
1899
+ const overrides = packageJson.pnpm?.overrides;
1900
+ if (overrides) {
1901
+ for (const [packageName, specifier] of Object.entries(overrides)) {
1902
+ if (isPortableDreamboardPackage(packageName) && typeof specifier === "string" && packages[packageName] === void 0) {
1903
+ packages[packageName] = specifier;
1904
+ }
1905
+ }
1906
+ }
1907
+ return packages;
1908
+ }
1909
+ function collectUnportableDreamboardSpecifiers(packageJson) {
1910
+ const problems = [];
1911
+ for (const field of DEPENDENCY_FIELDS) {
1912
+ const dependencies = packageJson[field];
1913
+ if (!dependencies) continue;
1914
+ for (const [packageName, specifier] of Object.entries(dependencies)) {
1915
+ if (isPortableDreamboardPackage(packageName) && UNPORTABLE_SPECIFIER_PATTERN.test(specifier)) {
1916
+ problems.push({ location: field, packageName, specifier });
1917
+ }
1918
+ }
1919
+ }
1920
+ const overrides = packageJson.pnpm?.overrides;
1921
+ if (overrides) {
1922
+ for (const [packageName, specifier] of Object.entries(overrides)) {
1923
+ if (isPortableDreamboardPackage(packageName) && typeof specifier === "string" && UNPORTABLE_SPECIFIER_PATTERN.test(specifier)) {
1924
+ problems.push({
1925
+ location: "pnpm.overrides",
1926
+ packageName,
1927
+ specifier
1928
+ });
1929
+ }
1930
+ }
1931
+ }
1932
+ return problems;
1933
+ }
1934
+ function collectLegacyDreamboardSpecifiers(packageJson) {
1935
+ const problems = [];
1936
+ for (const field of DEPENDENCY_FIELDS) {
1937
+ const dependencies = packageJson[field];
1938
+ if (!dependencies) continue;
1939
+ for (const packageName of Object.keys(dependencies)) {
1940
+ if (isLegacyDreamboardPackage(packageName)) {
1941
+ problems.push({ location: field, packageName });
1942
+ }
1943
+ }
1944
+ }
1945
+ const overrides = packageJson.pnpm?.overrides;
1946
+ if (overrides) {
1947
+ for (const packageName of Object.keys(overrides)) {
1948
+ if (isLegacyDreamboardPackage(packageName)) {
1949
+ problems.push({ location: "pnpm.overrides", packageName });
1950
+ }
1951
+ }
1952
+ }
1953
+ return problems;
1954
+ }
1955
+ function throwLegacyDreamboardPackageError(problems) {
1956
+ const details = problems.map((problem) => `${problem.location} ${problem.packageName}`).join("; ");
1957
+ throw new Error(
1958
+ [
1959
+ "Legacy @dreamboard/* package dependencies are no longer supported in compiler-bound workspaces.",
1960
+ `Found ${details}.`,
1961
+ "Repin to the public @dreamboard-games/* packages and rerun the command."
1962
+ ].join(" ")
1963
+ );
1964
+ }
1965
+ function isPortableDreamboardPackage(packageName) {
1966
+ return packageName === "dreamboard" || packageName.startsWith("@dreamboard-games/");
1967
+ }
1968
+ function isLegacyDreamboardPackage(packageName) {
1969
+ return packageName.startsWith("@dreamboard/");
1970
+ }
1971
+ async function readDreamboardRegistryFromNpmrc(projectRoot) {
1972
+ const npmrc = await readTextFileIfExists(path.join(projectRoot, ".npmrc"));
1973
+ if (!npmrc) return void 0;
1974
+ for (const line of npmrc.split(/\r?\n/)) {
1975
+ const trimmed = line.trim();
1976
+ if (!trimmed.startsWith("@dreamboard-games:registry=")) continue;
1977
+ return trimmed.slice("@dreamboard-games:registry=".length).trim() || void 0;
1978
+ }
1979
+ return void 0;
1980
+ }
1981
+
1982
+ // src/agent-verifier/agent-workspace-verifier.ts
17
1983
  main().catch((error) => {
18
1984
  console.error(error instanceof Error ? error.message : String(error));
19
1985
  process.exit(1);
@@ -46,10 +2012,8 @@ Usage:
46
2012
  }
47
2013
  async function materializePreparedWorkspace(args) {
48
2014
  const inputPath = readRequiredOption(args, "--input");
49
- const { materializeWorkspaceProject } = await import("./materialize-workspace-ZAVGQQSF.mjs");
50
- const input = JSON.parse(
51
- await readFile(inputPath, "utf8")
52
- );
2015
+ const { materializeWorkspaceProject } = await import("./materialize-workspace-MAGKDMK5.mjs");
2016
+ const input = JSON.parse(await readFile(inputPath, "utf8"));
53
2017
  await materializeWorkspaceProject({
54
2018
  ...input,
55
2019
  agentManaged: true,
@@ -68,10 +2032,6 @@ async function verifyAgentWorkspace(rawMode, args) {
68
2032
  consola.success("Agent workspace preflight passed.");
69
2033
  return;
70
2034
  }
71
- if (process.env.DREAMBOARD_AGENT_FINAL_SYNC_VERIFY === "1") {
72
- await runFullBackendConnectedVerification(parsedFlags);
73
- return;
74
- }
75
2035
  if (requestedMode === "cloud-local" || requestedMode === "verify" || requestedMode === "fin") {
76
2036
  await runCloudLocalVerification(projectRoot, projectConfig, config);
77
2037
  return;
@@ -80,34 +2040,6 @@ async function verifyAgentWorkspace(rawMode, args) {
80
2040
  "Agent workspaces now run cloud-local verification directly. Use `fin` only through the generated wrapper."
81
2041
  );
82
2042
  }
83
- async function runFullBackendConnectedVerification(parsedFlags) {
84
- const [{ default: cmdSync }, { default: cmdCompile }, { default: cmdTest }] = await Promise.all([
85
- import("./sync-THAI546U.mjs"),
86
- import("./compile-TEQVA46V.mjs"),
87
- import("./test-AFAQFKOB.mjs")
88
- ]);
89
- await runCommandDefinition(cmdSync, { ...parsedFlags, force: true });
90
- await runCommandDefinition(cmdCompile, parsedFlags);
91
- await runCommandDefinition(
92
- resolveTestSubCommand(cmdTest, "generate"),
93
- parsedFlags
94
- );
95
- await runCommandDefinition(resolveTestSubCommand(cmdTest, "run"), parsedFlags);
96
- }
97
- async function runCommandDefinition(command, args) {
98
- if (!command.run) {
99
- throw new Error("Verifier command is missing a runnable step.");
100
- }
101
- await command.run({ args, rawArgs: [], cmd: command });
102
- }
103
- function resolveTestSubCommand(cmdTest, name) {
104
- const subCommands = cmdTest.subCommands;
105
- const command = subCommands?.[name];
106
- if (!command) {
107
- throw new Error(`Verifier command is missing test ${name}.`);
108
- }
109
- return command;
110
- }
111
2043
  function parseVerificationMode(value) {
112
2044
  if (value === "preflight" || value === "verify" || value === "fin" || value === "cloud-local") {
113
2045
  return value;
@@ -148,12 +2080,12 @@ async function runCloudLocalVerification(projectRoot, projectConfig, config) {
148
2080
  { assertReducerContractPreflight },
149
2081
  { getProjectLocalMaintainerRegistry }
150
2082
  ] = await Promise.all([
151
- import("./static-scaffold-R7SVDRQI.mjs"),
152
- import("./local-files-JFOQQZDL.mjs"),
153
- import("./workspace-codegen-2ZMQRIKJ.mjs"),
154
- import("./workspace-dependencies-NOOQBK6I.mjs"),
155
- import("./reducer-contract-preflight-TUMQ43JV.mjs"),
156
- import("./project-state-K576C2TE.mjs")
2083
+ import("./static-scaffold-CLRRWXON.mjs"),
2084
+ import("./local-files-OF4QFISU.mjs"),
2085
+ import("./workspace-codegen-SPPVHURX.mjs"),
2086
+ import("./workspace-dependencies-5HEEKZFP.mjs"),
2087
+ import("./reducer-contract-preflight-WVQQPW5F.mjs"),
2088
+ import("./project-state-XKUSCFSV.mjs")
157
2089
  ]);
158
2090
  consola.start("Refreshing static scaffold...");
159
2091
  await scaffoldStaticWorkspace(projectRoot, "update", {
@@ -167,8 +2099,8 @@ async function runCloudLocalVerification(projectRoot, projectConfig, config) {
167
2099
  consola.start("Validating reducer contract...");
168
2100
  await assertReducerContractPreflight(projectRoot);
169
2101
  const [{ runLocalTypecheck }, { assertReducerBundleSmoke }] = await Promise.all([
170
- import("./local-typecheck-XVGWI75X.mjs"),
171
- import("./reducer-bundle-preflight-LXNJUBKL.mjs")
2102
+ import("./local-typecheck-DHVLM37Z.mjs"),
2103
+ import("./reducer-bundle-preflight-GLUJKTWU.mjs")
172
2104
  ]);
173
2105
  consola.start("Running local typecheck...");
174
2106
  const typecheckResult = await runLocalTypecheck(projectRoot);
@@ -186,7 +2118,7 @@ async function runCloudLocalVerification(projectRoot, projectConfig, config) {
186
2118
  generateReducerNativeArtifacts,
187
2119
  isReducerNativeTestingWorkspace,
188
2120
  runReducerNativeScenarios
189
- } = await import("./reducer-native-test-harness-CHX5MBL5.mjs");
2121
+ } = await import("./reducer-native-test-harness-UFMSNNDY.mjs");
190
2122
  if (await isReducerNativeTestingWorkspace(projectRoot)) {
191
2123
  const { bases } = await generateReducerNativeArtifacts({
192
2124
  projectRoot,
@@ -197,7 +2129,6 @@ async function runCloudLocalVerification(projectRoot, projectConfig, config) {
197
2129
  projectRoot,
198
2130
  projectConfig,
199
2131
  resolvedConfig: config,
200
- runner: "reducer",
201
2132
  gameId: projectConfig.gameId,
202
2133
  compiledResultId: projectConfig.compile?.latestSuccessful?.resultId
203
2134
  });