@sundaeswap/sprinkles 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/cjs/Sprinkle/__tests__/action-integration.test.js +590 -0
  2. package/dist/cjs/Sprinkle/__tests__/action-integration.test.js.map +1 -0
  3. package/dist/cjs/Sprinkle/__tests__/action-registry.test.js +193 -0
  4. package/dist/cjs/Sprinkle/__tests__/action-registry.test.js.map +1 -0
  5. package/dist/cjs/Sprinkle/__tests__/action-runner.test.js +304 -0
  6. package/dist/cjs/Sprinkle/__tests__/action-runner.test.js.map +1 -0
  7. package/dist/cjs/Sprinkle/__tests__/builtin-actions.test.js +1110 -0
  8. package/dist/cjs/Sprinkle/__tests__/builtin-actions.test.js.map +1 -0
  9. package/dist/cjs/Sprinkle/__tests__/cli-adapter.test.js +722 -0
  10. package/dist/cjs/Sprinkle/__tests__/cli-adapter.test.js.map +1 -0
  11. package/dist/cjs/Sprinkle/__tests__/mcp-adapter.test.js +713 -0
  12. package/dist/cjs/Sprinkle/__tests__/mcp-adapter.test.js.map +1 -0
  13. package/dist/cjs/Sprinkle/__tests__/tui-helpers.test.js +334 -0
  14. package/dist/cjs/Sprinkle/__tests__/tui-helpers.test.js.map +1 -0
  15. package/dist/cjs/Sprinkle/__tests__/wallet-transaction-actions.test.js +749 -0
  16. package/dist/cjs/Sprinkle/__tests__/wallet-transaction-actions.test.js.map +1 -0
  17. package/dist/cjs/Sprinkle/actions/builtin/blaze-helper.js +61 -0
  18. package/dist/cjs/Sprinkle/actions/builtin/blaze-helper.js.map +1 -0
  19. package/dist/cjs/Sprinkle/actions/builtin/index.js +117 -0
  20. package/dist/cjs/Sprinkle/actions/builtin/index.js.map +1 -0
  21. package/dist/cjs/Sprinkle/actions/builtin/profile-actions.js +202 -0
  22. package/dist/cjs/Sprinkle/actions/builtin/profile-actions.js.map +1 -0
  23. package/dist/cjs/Sprinkle/actions/builtin/settings-actions.js +87 -0
  24. package/dist/cjs/Sprinkle/actions/builtin/settings-actions.js.map +1 -0
  25. package/dist/cjs/Sprinkle/actions/builtin/transaction-actions.js +345 -0
  26. package/dist/cjs/Sprinkle/actions/builtin/transaction-actions.js.map +1 -0
  27. package/dist/cjs/Sprinkle/actions/builtin/wallet-actions.js +212 -0
  28. package/dist/cjs/Sprinkle/actions/builtin/wallet-actions.js.map +1 -0
  29. package/dist/cjs/Sprinkle/actions/cli-adapter.js +372 -0
  30. package/dist/cjs/Sprinkle/actions/cli-adapter.js.map +1 -0
  31. package/dist/cjs/Sprinkle/actions/index.js +127 -0
  32. package/dist/cjs/Sprinkle/actions/index.js.map +1 -0
  33. package/dist/cjs/Sprinkle/actions/mcp-adapter.js +415 -0
  34. package/dist/cjs/Sprinkle/actions/mcp-adapter.js.map +1 -0
  35. package/dist/cjs/Sprinkle/actions/registry.js +92 -0
  36. package/dist/cjs/Sprinkle/actions/registry.js.map +1 -0
  37. package/dist/cjs/Sprinkle/actions/runner.js +190 -0
  38. package/dist/cjs/Sprinkle/actions/runner.js.map +1 -0
  39. package/dist/cjs/Sprinkle/actions/tui-helpers.js +96 -0
  40. package/dist/cjs/Sprinkle/actions/tui-helpers.js.map +1 -0
  41. package/dist/cjs/Sprinkle/actions/types.js +68 -0
  42. package/dist/cjs/Sprinkle/actions/types.js.map +1 -0
  43. package/dist/cjs/Sprinkle/index.js +412 -1
  44. package/dist/cjs/Sprinkle/index.js.map +1 -1
  45. package/dist/cjs/Sprinkle/prompts.js +12 -7
  46. package/dist/cjs/Sprinkle/prompts.js.map +1 -1
  47. package/dist/cjs/Sprinkle/type-guards.js +7 -1
  48. package/dist/cjs/Sprinkle/type-guards.js.map +1 -1
  49. package/dist/esm/Sprinkle/__tests__/action-integration.test.js +588 -0
  50. package/dist/esm/Sprinkle/__tests__/action-integration.test.js.map +1 -0
  51. package/dist/esm/Sprinkle/__tests__/action-registry.test.js +192 -0
  52. package/dist/esm/Sprinkle/__tests__/action-registry.test.js.map +1 -0
  53. package/dist/esm/Sprinkle/__tests__/action-runner.test.js +302 -0
  54. package/dist/esm/Sprinkle/__tests__/action-runner.test.js.map +1 -0
  55. package/dist/esm/Sprinkle/__tests__/builtin-actions.test.js +1107 -0
  56. package/dist/esm/Sprinkle/__tests__/builtin-actions.test.js.map +1 -0
  57. package/dist/esm/Sprinkle/__tests__/cli-adapter.test.js +720 -0
  58. package/dist/esm/Sprinkle/__tests__/cli-adapter.test.js.map +1 -0
  59. package/dist/esm/Sprinkle/__tests__/mcp-adapter.test.js +712 -0
  60. package/dist/esm/Sprinkle/__tests__/mcp-adapter.test.js.map +1 -0
  61. package/dist/esm/Sprinkle/__tests__/tui-helpers.test.js +332 -0
  62. package/dist/esm/Sprinkle/__tests__/tui-helpers.test.js.map +1 -0
  63. package/dist/esm/Sprinkle/__tests__/wallet-transaction-actions.test.js +747 -0
  64. package/dist/esm/Sprinkle/__tests__/wallet-transaction-actions.test.js.map +1 -0
  65. package/dist/esm/Sprinkle/actions/builtin/blaze-helper.js +55 -0
  66. package/dist/esm/Sprinkle/actions/builtin/blaze-helper.js.map +1 -0
  67. package/dist/esm/Sprinkle/actions/builtin/index.js +32 -0
  68. package/dist/esm/Sprinkle/actions/builtin/index.js.map +1 -0
  69. package/dist/esm/Sprinkle/actions/builtin/profile-actions.js +197 -0
  70. package/dist/esm/Sprinkle/actions/builtin/profile-actions.js.map +1 -0
  71. package/dist/esm/Sprinkle/actions/builtin/settings-actions.js +81 -0
  72. package/dist/esm/Sprinkle/actions/builtin/settings-actions.js.map +1 -0
  73. package/dist/esm/Sprinkle/actions/builtin/transaction-actions.js +340 -0
  74. package/dist/esm/Sprinkle/actions/builtin/transaction-actions.js.map +1 -0
  75. package/dist/esm/Sprinkle/actions/builtin/wallet-actions.js +207 -0
  76. package/dist/esm/Sprinkle/actions/builtin/wallet-actions.js.map +1 -0
  77. package/dist/esm/Sprinkle/actions/cli-adapter.js +361 -0
  78. package/dist/esm/Sprinkle/actions/cli-adapter.js.map +1 -0
  79. package/dist/esm/Sprinkle/actions/index.js +12 -0
  80. package/dist/esm/Sprinkle/actions/index.js.map +1 -0
  81. package/dist/esm/Sprinkle/actions/mcp-adapter.js +407 -0
  82. package/dist/esm/Sprinkle/actions/mcp-adapter.js.map +1 -0
  83. package/dist/esm/Sprinkle/actions/registry.js +85 -0
  84. package/dist/esm/Sprinkle/actions/registry.js.map +1 -0
  85. package/dist/esm/Sprinkle/actions/runner.js +182 -0
  86. package/dist/esm/Sprinkle/actions/runner.js.map +1 -0
  87. package/dist/esm/Sprinkle/actions/tui-helpers.js +91 -0
  88. package/dist/esm/Sprinkle/actions/tui-helpers.js.map +1 -0
  89. package/dist/esm/Sprinkle/actions/types.js +61 -0
  90. package/dist/esm/Sprinkle/actions/types.js.map +1 -0
  91. package/dist/esm/Sprinkle/index.js +260 -1
  92. package/dist/esm/Sprinkle/index.js.map +1 -1
  93. package/dist/esm/Sprinkle/prompts.js +12 -7
  94. package/dist/esm/Sprinkle/prompts.js.map +1 -1
  95. package/dist/esm/Sprinkle/type-guards.js +3 -0
  96. package/dist/esm/Sprinkle/type-guards.js.map +1 -1
  97. package/dist/types/Sprinkle/actions/builtin/blaze-helper.d.ts +39 -0
  98. package/dist/types/Sprinkle/actions/builtin/blaze-helper.d.ts.map +1 -0
  99. package/dist/types/Sprinkle/actions/builtin/index.d.ts +26 -0
  100. package/dist/types/Sprinkle/actions/builtin/index.d.ts.map +1 -0
  101. package/dist/types/Sprinkle/actions/builtin/profile-actions.d.ts +55 -0
  102. package/dist/types/Sprinkle/actions/builtin/profile-actions.d.ts.map +1 -0
  103. package/dist/types/Sprinkle/actions/builtin/settings-actions.d.ts +32 -0
  104. package/dist/types/Sprinkle/actions/builtin/settings-actions.d.ts.map +1 -0
  105. package/dist/types/Sprinkle/actions/builtin/transaction-actions.d.ts +70 -0
  106. package/dist/types/Sprinkle/actions/builtin/transaction-actions.d.ts.map +1 -0
  107. package/dist/types/Sprinkle/actions/builtin/wallet-actions.d.ts +50 -0
  108. package/dist/types/Sprinkle/actions/builtin/wallet-actions.d.ts.map +1 -0
  109. package/dist/types/Sprinkle/actions/cli-adapter.d.ts +104 -0
  110. package/dist/types/Sprinkle/actions/cli-adapter.d.ts.map +1 -0
  111. package/dist/types/Sprinkle/actions/index.d.ts +12 -0
  112. package/dist/types/Sprinkle/actions/index.d.ts.map +1 -0
  113. package/dist/types/Sprinkle/actions/mcp-adapter.d.ts +92 -0
  114. package/dist/types/Sprinkle/actions/mcp-adapter.d.ts.map +1 -0
  115. package/dist/types/Sprinkle/actions/registry.d.ts +42 -0
  116. package/dist/types/Sprinkle/actions/registry.d.ts.map +1 -0
  117. package/dist/types/Sprinkle/actions/runner.d.ts +45 -0
  118. package/dist/types/Sprinkle/actions/runner.d.ts.map +1 -0
  119. package/dist/types/Sprinkle/actions/tui-helpers.d.ts +53 -0
  120. package/dist/types/Sprinkle/actions/tui-helpers.d.ts.map +1 -0
  121. package/dist/types/Sprinkle/actions/types.d.ts +76 -0
  122. package/dist/types/Sprinkle/actions/types.d.ts.map +1 -0
  123. package/dist/types/Sprinkle/index.d.ts +81 -1
  124. package/dist/types/Sprinkle/index.d.ts.map +1 -1
  125. package/dist/types/Sprinkle/prompts.d.ts.map +1 -1
  126. package/dist/types/Sprinkle/type-guards.d.ts +4 -1
  127. package/dist/types/Sprinkle/type-guards.d.ts.map +1 -1
  128. package/dist/types/tsconfig.build.tsbuildinfo +1 -1
  129. package/package.json +9 -2
  130. package/src/Sprinkle/__tests__/action-integration.test.ts +558 -0
  131. package/src/Sprinkle/__tests__/action-registry.test.ts +187 -0
  132. package/src/Sprinkle/__tests__/action-runner.test.ts +324 -0
  133. package/src/Sprinkle/__tests__/builtin-actions.test.ts +1022 -0
  134. package/src/Sprinkle/__tests__/cli-adapter.test.ts +715 -0
  135. package/src/Sprinkle/__tests__/mcp-adapter.test.ts +718 -0
  136. package/src/Sprinkle/__tests__/tui-helpers.test.ts +325 -0
  137. package/src/Sprinkle/__tests__/wallet-transaction-actions.test.ts +695 -0
  138. package/src/Sprinkle/actions/builtin/blaze-helper.ts +89 -0
  139. package/src/Sprinkle/actions/builtin/index.ts +86 -0
  140. package/src/Sprinkle/actions/builtin/profile-actions.ts +229 -0
  141. package/src/Sprinkle/actions/builtin/settings-actions.ts +99 -0
  142. package/src/Sprinkle/actions/builtin/transaction-actions.ts +381 -0
  143. package/src/Sprinkle/actions/builtin/wallet-actions.ts +233 -0
  144. package/src/Sprinkle/actions/cli-adapter.ts +430 -0
  145. package/src/Sprinkle/actions/index.ts +32 -0
  146. package/src/Sprinkle/actions/mcp-adapter.ts +463 -0
  147. package/src/Sprinkle/actions/registry.ts +97 -0
  148. package/src/Sprinkle/actions/runner.ts +200 -0
  149. package/src/Sprinkle/actions/tui-helpers.ts +114 -0
  150. package/src/Sprinkle/actions/types.ts +91 -0
  151. package/src/Sprinkle/index.ts +351 -0
  152. package/src/Sprinkle/prompts.ts +118 -72
  153. package/src/Sprinkle/type-guards.ts +9 -0
@@ -0,0 +1,722 @@
1
+ "use strict";
2
+
3
+ var _bunTest = require("bun:test");
4
+ var _typebox = require("@sinclair/typebox");
5
+ var _index = require("../actions/index.js");
6
+ // ---------------------------------------------------------------------------
7
+ // Helpers
8
+ // ---------------------------------------------------------------------------
9
+
10
+ // Minimal Sprinkle-shaped mock for runCli tests
11
+ function makeMockSprinkle(actions) {
12
+ const map = new Map(actions.map(a => [a.name, a]));
13
+ return {
14
+ getAction: name => map.get(name),
15
+ listActions: () => actions
16
+ };
17
+ }
18
+
19
+ // Lightweight stub context (runCli forwards it to executeAction)
20
+ const fakeContext = {};
21
+
22
+ // ---------------------------------------------------------------------------
23
+ // camelToKebab
24
+ // ---------------------------------------------------------------------------
25
+
26
+ (0, _bunTest.describe)("camelToKebab", () => {
27
+ (0, _bunTest.test)("converts simple camelCase to kebab-case", () => {
28
+ (0, _bunTest.expect)((0, _index.camelToKebab)("myFlagName")).toBe("my-flag-name");
29
+ });
30
+ (0, _bunTest.test)("converts single transition", () => {
31
+ (0, _bunTest.expect)((0, _index.camelToKebab)("getBalance")).toBe("get-balance");
32
+ });
33
+ (0, _bunTest.test)("leaves already-lowercase string unchanged", () => {
34
+ (0, _bunTest.expect)((0, _index.camelToKebab)("transfer")).toBe("transfer");
35
+ });
36
+ (0, _bunTest.test)("returns empty string unchanged", () => {
37
+ (0, _bunTest.expect)((0, _index.camelToKebab)("")).toBe("");
38
+ });
39
+ (0, _bunTest.test)("handles a single uppercase letter at start", () => {
40
+ // Leading dash is stripped
41
+ (0, _bunTest.expect)((0, _index.camelToKebab)("X")).toBe("x");
42
+ });
43
+ (0, _bunTest.test)("handles consecutive uppercase letters", () => {
44
+ // Each uppercase letter gets its own dash
45
+ (0, _bunTest.expect)((0, _index.camelToKebab)("URL")).toBe("u-r-l");
46
+ });
47
+ (0, _bunTest.test)("handles single lowercase character", () => {
48
+ (0, _bunTest.expect)((0, _index.camelToKebab)("a")).toBe("a");
49
+ });
50
+ (0, _bunTest.test)("handles string with digit (no conversion on digits)", () => {
51
+ (0, _bunTest.expect)((0, _index.camelToKebab)("action2Name")).toBe("action2-name");
52
+ });
53
+ });
54
+
55
+ // ---------------------------------------------------------------------------
56
+ // kebabToCamel
57
+ // ---------------------------------------------------------------------------
58
+
59
+ (0, _bunTest.describe)("kebabToCamel", () => {
60
+ (0, _bunTest.test)("converts simple kebab-case to camelCase", () => {
61
+ (0, _bunTest.expect)((0, _index.kebabToCamel)("my-flag-name")).toBe("myFlagName");
62
+ });
63
+ (0, _bunTest.test)("converts single segment", () => {
64
+ (0, _bunTest.expect)((0, _index.kebabToCamel)("transfer")).toBe("transfer");
65
+ });
66
+ (0, _bunTest.test)("returns empty string unchanged", () => {
67
+ (0, _bunTest.expect)((0, _index.kebabToCamel)("")).toBe("");
68
+ });
69
+ (0, _bunTest.test)("converts digit after dash to uppercase... no: digit stays", () => {
70
+ // Digits after dash: char stays as-is (toUpperCase of a digit is itself)
71
+ (0, _bunTest.expect)((0, _index.kebabToCamel)("action-2-name")).toBe("action2Name");
72
+ });
73
+ (0, _bunTest.test)("is inverse of camelToKebab for simple identifiers", () => {
74
+ const original = "myFlagName";
75
+ (0, _bunTest.expect)((0, _index.kebabToCamel)((0, _index.camelToKebab)(original))).toBe(original);
76
+ });
77
+ });
78
+
79
+ // ---------------------------------------------------------------------------
80
+ // coerceValue
81
+ // ---------------------------------------------------------------------------
82
+
83
+ (0, _bunTest.describe)("coerceValue", () => {
84
+ // Number
85
+ (0, _bunTest.test)("coerces string to number", () => {
86
+ (0, _bunTest.expect)((0, _index.coerceValue)("3.14", _typebox.Type.Number())).toBe(3.14);
87
+ });
88
+ (0, _bunTest.test)("passes through numeric value unchanged", () => {
89
+ (0, _bunTest.expect)((0, _index.coerceValue)(42, _typebox.Type.Number())).toBe(42);
90
+ });
91
+ (0, _bunTest.test)("returns non-numeric string as-is for Number schema", () => {
92
+ (0, _bunTest.expect)((0, _index.coerceValue)("abc", _typebox.Type.Number())).toBe("abc");
93
+ });
94
+
95
+ // Integer
96
+ (0, _bunTest.test)("coerces string to integer via parseInt", () => {
97
+ (0, _bunTest.expect)((0, _index.coerceValue)("7", _typebox.Type.Integer())).toBe(7);
98
+ });
99
+ (0, _bunTest.test)("truncates float number to integer", () => {
100
+ (0, _bunTest.expect)((0, _index.coerceValue)(3.9, _typebox.Type.Integer())).toBe(3);
101
+ });
102
+ (0, _bunTest.test)("returns non-numeric string as-is for Integer schema", () => {
103
+ (0, _bunTest.expect)((0, _index.coerceValue)("xyz", _typebox.Type.Integer())).toBe("xyz");
104
+ });
105
+
106
+ // Boolean
107
+ (0, _bunTest.test)("coerces string 'true' to boolean true", () => {
108
+ (0, _bunTest.expect)((0, _index.coerceValue)("true", _typebox.Type.Boolean())).toBe(true);
109
+ });
110
+ (0, _bunTest.test)("coerces string 'false' to boolean false", () => {
111
+ (0, _bunTest.expect)((0, _index.coerceValue)("false", _typebox.Type.Boolean())).toBe(false);
112
+ });
113
+ (0, _bunTest.test)("passes through boolean true unchanged", () => {
114
+ (0, _bunTest.expect)((0, _index.coerceValue)(true, _typebox.Type.Boolean())).toBe(true);
115
+ });
116
+ (0, _bunTest.test)("passes through boolean false unchanged", () => {
117
+ (0, _bunTest.expect)((0, _index.coerceValue)(false, _typebox.Type.Boolean())).toBe(false);
118
+ });
119
+ (0, _bunTest.test)("returns non-boolean string as-is for Boolean schema", () => {
120
+ (0, _bunTest.expect)((0, _index.coerceValue)("yes", _typebox.Type.Boolean())).toBe("yes");
121
+ });
122
+
123
+ // BigInt
124
+ (0, _bunTest.test)("coerces string to BigInt", () => {
125
+ (0, _bunTest.expect)((0, _index.coerceValue)("12345", _typebox.Type.BigInt())).toBe(BigInt("12345"));
126
+ });
127
+ (0, _bunTest.test)("coerces number to BigInt", () => {
128
+ (0, _bunTest.expect)((0, _index.coerceValue)(99, _typebox.Type.BigInt())).toBe(BigInt(99));
129
+ });
130
+ (0, _bunTest.test)("passes through BigInt unchanged", () => {
131
+ (0, _bunTest.expect)((0, _index.coerceValue)(BigInt(42), _typebox.Type.BigInt())).toBe(BigInt(42));
132
+ });
133
+ (0, _bunTest.test)("returns invalid BigInt string as-is", () => {
134
+ (0, _bunTest.expect)((0, _index.coerceValue)("not-a-number", _typebox.Type.BigInt())).toBe("not-a-number");
135
+ });
136
+
137
+ // String
138
+ (0, _bunTest.test)("passes through string value unchanged", () => {
139
+ (0, _bunTest.expect)((0, _index.coerceValue)("hello", _typebox.Type.String())).toBe("hello");
140
+ });
141
+ (0, _bunTest.test)("converts number to string for String schema", () => {
142
+ (0, _bunTest.expect)((0, _index.coerceValue)(42, _typebox.Type.String())).toBe("42");
143
+ });
144
+
145
+ // Array
146
+ (0, _bunTest.test)("wraps single value in array", () => {
147
+ (0, _bunTest.expect)((0, _index.coerceValue)("a", _typebox.Type.Array(_typebox.Type.String()))).toEqual(["a"]);
148
+ });
149
+ (0, _bunTest.test)("passes through existing array", () => {
150
+ (0, _bunTest.expect)((0, _index.coerceValue)(["a", "b"], _typebox.Type.Array(_typebox.Type.String()))).toEqual(["a", "b"]);
151
+ });
152
+ (0, _bunTest.test)("coerces items in existing array against item schema", () => {
153
+ const result = (0, _index.coerceValue)(["1", "2"], _typebox.Type.Array(_typebox.Type.Integer()));
154
+ (0, _bunTest.expect)(result).toEqual([1, 2]);
155
+ });
156
+ (0, _bunTest.test)("coerces single value and applies item schema", () => {
157
+ const result = (0, _index.coerceValue)("5", _typebox.Type.Array(_typebox.Type.Number()));
158
+ (0, _bunTest.expect)(result).toEqual([5]);
159
+ });
160
+
161
+ // Object
162
+ (0, _bunTest.test)("parses JSON string for Object schema", () => {
163
+ const result = (0, _index.coerceValue)('{"id":"abc","count":3}', _typebox.Type.Object({
164
+ id: _typebox.Type.String(),
165
+ count: _typebox.Type.Number()
166
+ }));
167
+ (0, _bunTest.expect)(result).toEqual({
168
+ id: "abc",
169
+ count: 3
170
+ });
171
+ });
172
+ (0, _bunTest.test)("passes through non-JSON string for Object schema", () => {
173
+ (0, _bunTest.expect)((0, _index.coerceValue)("not-json", _typebox.Type.Object({
174
+ x: _typebox.Type.String()
175
+ }))).toBe("not-json");
176
+ });
177
+ (0, _bunTest.test)("returns already-parsed object as-is for Object schema", () => {
178
+ const obj = {
179
+ x: 1
180
+ };
181
+ (0, _bunTest.expect)((0, _index.coerceValue)(obj, _typebox.Type.Object({
182
+ x: _typebox.Type.Number()
183
+ }))).toBe(obj);
184
+ });
185
+ (0, _bunTest.test)("returns malformed JSON string as-is for Object schema", () => {
186
+ (0, _bunTest.expect)((0, _index.coerceValue)("{bad", _typebox.Type.Object({
187
+ x: _typebox.Type.String()
188
+ }))).toBe("{bad");
189
+ });
190
+
191
+ // Null / undefined passthrough
192
+ (0, _bunTest.test)("returns null as-is regardless of schema", () => {
193
+ (0, _bunTest.expect)((0, _index.coerceValue)(null, _typebox.Type.String())).toBeNull();
194
+ });
195
+ (0, _bunTest.test)("returns undefined as-is regardless of schema", () => {
196
+ (0, _bunTest.expect)((0, _index.coerceValue)(undefined, _typebox.Type.Number())).toBeUndefined();
197
+ });
198
+
199
+ // Optional wrapper: TypeBox Optional<T> does not change Kind
200
+ (0, _bunTest.test)("coerces value correctly for Optional-wrapped schema", () => {
201
+ (0, _bunTest.expect)((0, _index.coerceValue)("42", _typebox.Type.Optional(_typebox.Type.Integer()))).toBe(42);
202
+ });
203
+
204
+ // Union: passthrough
205
+ (0, _bunTest.test)("passes through value for Union schema", () => {
206
+ const result = (0, _index.coerceValue)("hello", _typebox.Type.Union([_typebox.Type.String(), _typebox.Type.Number()]));
207
+ (0, _bunTest.expect)(result).toBe("hello");
208
+ });
209
+ });
210
+
211
+ // ---------------------------------------------------------------------------
212
+ // parseArgvWithSchema
213
+ // ---------------------------------------------------------------------------
214
+
215
+ (0, _bunTest.describe)("parseArgvWithSchema", () => {
216
+ const schema = _typebox.Type.Object({
217
+ name: _typebox.Type.String(),
218
+ count: _typebox.Type.Integer(),
219
+ active: _typebox.Type.Boolean()
220
+ });
221
+ (0, _bunTest.test)("coerces string args according to schema types", () => {
222
+ const result = (0, _index.parseArgvWithSchema)({
223
+ name: "alice",
224
+ count: "5",
225
+ active: "true"
226
+ }, schema);
227
+ (0, _bunTest.expect)(result.name).toBe("alice");
228
+ (0, _bunTest.expect)(result.count).toBe(5);
229
+ (0, _bunTest.expect)(result.active).toBe(true);
230
+ });
231
+ (0, _bunTest.test)("maps kebab-case arg names to camelCase property names", () => {
232
+ const s = _typebox.Type.Object({
233
+ myFlag: _typebox.Type.String()
234
+ });
235
+ const result = (0, _index.parseArgvWithSchema)({
236
+ "my-flag": "hello"
237
+ }, s);
238
+ (0, _bunTest.expect)(result.myFlag).toBe("hello");
239
+ });
240
+ (0, _bunTest.test)("prefers camelCase lookup over kebab-case when both present", () => {
241
+ const s = _typebox.Type.Object({
242
+ myFlag: _typebox.Type.String()
243
+ });
244
+ const result = (0, _index.parseArgvWithSchema)({
245
+ myFlag: "camel",
246
+ "my-flag": "kebab"
247
+ }, s);
248
+ (0, _bunTest.expect)(result.myFlag).toBe("camel");
249
+ });
250
+ (0, _bunTest.test)("applies TypeBox defaults for omitted optional fields", () => {
251
+ const s = _typebox.Type.Object({
252
+ name: _typebox.Type.String(),
253
+ retries: _typebox.Type.Optional(_typebox.Type.Integer({
254
+ default: 3
255
+ }))
256
+ });
257
+ const result = (0, _index.parseArgvWithSchema)({
258
+ name: "test"
259
+ }, s);
260
+ (0, _bunTest.expect)(result.retries).toBe(3);
261
+ });
262
+ (0, _bunTest.test)("omits field with no default when not supplied", () => {
263
+ const s = _typebox.Type.Object({
264
+ name: _typebox.Type.String(),
265
+ extra: _typebox.Type.Optional(_typebox.Type.String())
266
+ });
267
+ const result = (0, _index.parseArgvWithSchema)({
268
+ name: "hello"
269
+ }, s);
270
+ (0, _bunTest.expect)("extra" in result).toBe(false);
271
+ });
272
+ (0, _bunTest.test)("returns raw args unchanged for non-object schema", () => {
273
+ const raw = {
274
+ foo: "bar"
275
+ };
276
+ const result = (0, _index.parseArgvWithSchema)(raw, _typebox.Type.String());
277
+ (0, _bunTest.expect)(result).toBe(raw);
278
+ });
279
+ (0, _bunTest.test)("coerces BigInt field from string", () => {
280
+ const s = _typebox.Type.Object({
281
+ amount: _typebox.Type.BigInt()
282
+ });
283
+ const result = (0, _index.parseArgvWithSchema)({
284
+ amount: "999"
285
+ }, s);
286
+ (0, _bunTest.expect)(result.amount).toBe(BigInt(999));
287
+ });
288
+ (0, _bunTest.test)("coerces array field from single string value", () => {
289
+ const s = _typebox.Type.Object({
290
+ tags: _typebox.Type.Array(_typebox.Type.String())
291
+ });
292
+ const result = (0, _index.parseArgvWithSchema)({
293
+ tags: "alpha"
294
+ }, s);
295
+ (0, _bunTest.expect)(result.tags).toEqual(["alpha"]);
296
+ });
297
+ (0, _bunTest.test)("passes through already-array value", () => {
298
+ const s = _typebox.Type.Object({
299
+ ids: _typebox.Type.Array(_typebox.Type.String())
300
+ });
301
+ const result = (0, _index.parseArgvWithSchema)({
302
+ ids: ["a", "b"]
303
+ }, s);
304
+ (0, _bunTest.expect)(result.ids).toEqual(["a", "b"]);
305
+ });
306
+ });
307
+
308
+ // ---------------------------------------------------------------------------
309
+ // generateActionHelp
310
+ // ---------------------------------------------------------------------------
311
+
312
+ (0, _bunTest.describe)("generateActionHelp", () => {
313
+ const action = {
314
+ name: "send-tx",
315
+ description: "Send a transaction",
316
+ inputSchema: _typebox.Type.Object({
317
+ recipient: _typebox.Type.String({
318
+ description: "Target address"
319
+ }),
320
+ amount: _typebox.Type.Integer(),
321
+ memo: _typebox.Type.Optional(_typebox.Type.String({
322
+ default: ""
323
+ }))
324
+ }),
325
+ outputSchema: _typebox.Type.Object({
326
+ txId: _typebox.Type.String()
327
+ }),
328
+ execute: async () => ({
329
+ txId: "abc"
330
+ })
331
+ };
332
+ (0, _bunTest.test)("includes usage line with action name", () => {
333
+ const help = (0, _index.generateActionHelp)(action);
334
+ (0, _bunTest.expect)(help).toContain("Usage: app send-tx [options]");
335
+ });
336
+ (0, _bunTest.test)("uses custom appName in usage line when provided", () => {
337
+ const help = (0, _index.generateActionHelp)(action, "my-cli");
338
+ (0, _bunTest.expect)(help).toContain("Usage: my-cli send-tx [options]");
339
+ });
340
+ (0, _bunTest.test)("includes action description", () => {
341
+ const help = (0, _index.generateActionHelp)(action);
342
+ (0, _bunTest.expect)(help).toContain("Send a transaction");
343
+ });
344
+ (0, _bunTest.test)("lists required field as --flag-name with required label", () => {
345
+ const help = (0, _index.generateActionHelp)(action);
346
+ (0, _bunTest.expect)(help).toContain("--recipient");
347
+ (0, _bunTest.expect)(help).toContain("(required)");
348
+ });
349
+ (0, _bunTest.test)("lists optional field with optional label", () => {
350
+ const help = (0, _index.generateActionHelp)(action);
351
+ (0, _bunTest.expect)(help).toContain("--memo");
352
+ (0, _bunTest.expect)(help).toContain("(optional)");
353
+ });
354
+ (0, _bunTest.test)("converts camelCase property names to kebab-case flags", () => {
355
+ const a = {
356
+ ...action,
357
+ inputSchema: _typebox.Type.Object({
358
+ myValue: _typebox.Type.String()
359
+ })
360
+ };
361
+ const help = (0, _index.generateActionHelp)(a);
362
+ (0, _bunTest.expect)(help).toContain("--my-value");
363
+ });
364
+ (0, _bunTest.test)("includes type labels for each flag", () => {
365
+ const help = (0, _index.generateActionHelp)(action);
366
+ (0, _bunTest.expect)(help).toContain("<string>");
367
+ (0, _bunTest.expect)(help).toContain("<integer>");
368
+ });
369
+ (0, _bunTest.test)("includes --help at the end", () => {
370
+ const help = (0, _index.generateActionHelp)(action);
371
+ (0, _bunTest.expect)(help).toContain("--help");
372
+ });
373
+ (0, _bunTest.test)("shows field description when provided", () => {
374
+ const help = (0, _index.generateActionHelp)(action);
375
+ (0, _bunTest.expect)(help).toContain("Target address");
376
+ });
377
+ (0, _bunTest.test)("includes BigInt type label", () => {
378
+ const a = {
379
+ ...action,
380
+ inputSchema: _typebox.Type.Object({
381
+ amount: _typebox.Type.BigInt()
382
+ })
383
+ };
384
+ (0, _bunTest.expect)((0, _index.generateActionHelp)(a)).toContain("<bigint>");
385
+ });
386
+ (0, _bunTest.test)("includes boolean type label", () => {
387
+ const a = {
388
+ ...action,
389
+ inputSchema: _typebox.Type.Object({
390
+ dryRun: _typebox.Type.Boolean()
391
+ })
392
+ };
393
+ (0, _bunTest.expect)((0, _index.generateActionHelp)(a)).toContain("<boolean>");
394
+ });
395
+ (0, _bunTest.test)("array type label mentions repeatable", () => {
396
+ const a = {
397
+ ...action,
398
+ inputSchema: _typebox.Type.Object({
399
+ tags: _typebox.Type.Array(_typebox.Type.String())
400
+ })
401
+ };
402
+ (0, _bunTest.expect)((0, _index.generateActionHelp)(a)).toContain("repeatable");
403
+ });
404
+ (0, _bunTest.test)("object type label shows <json>", () => {
405
+ const a = {
406
+ ...action,
407
+ inputSchema: _typebox.Type.Object({
408
+ opts: _typebox.Type.Object({
409
+ x: _typebox.Type.String()
410
+ })
411
+ })
412
+ };
413
+ (0, _bunTest.expect)((0, _index.generateActionHelp)(a)).toContain("<json>");
414
+ });
415
+ });
416
+
417
+ // ---------------------------------------------------------------------------
418
+ // generateAppHelp
419
+ // ---------------------------------------------------------------------------
420
+
421
+ (0, _bunTest.describe)("generateAppHelp", () => {
422
+ const actions = [{
423
+ name: "send-tx",
424
+ description: "Send a transaction",
425
+ category: "wallet",
426
+ inputSchema: _typebox.Type.Object({}),
427
+ outputSchema: _typebox.Type.Object({}),
428
+ execute: async () => ({})
429
+ }, {
430
+ name: "get-balance",
431
+ description: "Get balance",
432
+ category: "wallet",
433
+ inputSchema: _typebox.Type.Object({}),
434
+ outputSchema: _typebox.Type.Object({}),
435
+ execute: async () => ({})
436
+ }, {
437
+ name: "list-pools",
438
+ description: "List pools",
439
+ inputSchema: _typebox.Type.Object({}),
440
+ outputSchema: _typebox.Type.Object({}),
441
+ execute: async () => ({})
442
+ }];
443
+ (0, _bunTest.test)("includes usage line with app name", () => {
444
+ const help = (0, _index.generateAppHelp)(actions);
445
+ (0, _bunTest.expect)(help).toContain("Usage: app <action> [options]");
446
+ });
447
+ (0, _bunTest.test)("uses custom appName in usage line", () => {
448
+ const help = (0, _index.generateAppHelp)(actions, "my-app");
449
+ (0, _bunTest.expect)(help).toContain("Usage: my-app <action> [options]");
450
+ });
451
+ (0, _bunTest.test)("lists all action names", () => {
452
+ const help = (0, _index.generateAppHelp)(actions);
453
+ (0, _bunTest.expect)(help).toContain("send-tx");
454
+ (0, _bunTest.expect)(help).toContain("get-balance");
455
+ (0, _bunTest.expect)(help).toContain("list-pools");
456
+ });
457
+ (0, _bunTest.test)("lists all action descriptions", () => {
458
+ const help = (0, _index.generateAppHelp)(actions);
459
+ (0, _bunTest.expect)(help).toContain("Send a transaction");
460
+ (0, _bunTest.expect)(help).toContain("Get balance");
461
+ (0, _bunTest.expect)(help).toContain("List pools");
462
+ });
463
+ (0, _bunTest.test)("includes global options section", () => {
464
+ const help = (0, _index.generateAppHelp)(actions);
465
+ (0, _bunTest.expect)(help).toContain("Global options:");
466
+ (0, _bunTest.expect)(help).toContain("--help");
467
+ (0, _bunTest.expect)(help).toContain("--profile");
468
+ });
469
+ (0, _bunTest.test)("groups categorized actions under category heading", () => {
470
+ const help = (0, _index.generateAppHelp)(actions);
471
+ (0, _bunTest.expect)(help).toContain("wallet:");
472
+ });
473
+ (0, _bunTest.test)("shows 'No actions registered.' for empty actions list", () => {
474
+ const help = (0, _index.generateAppHelp)([]);
475
+ (0, _bunTest.expect)(help).toContain("No actions registered.");
476
+ });
477
+ (0, _bunTest.test)("does not show a category heading for 'default' category", () => {
478
+ const uncategorized = [{
479
+ name: "do-thing",
480
+ description: "Does a thing",
481
+ inputSchema: _typebox.Type.Object({}),
482
+ outputSchema: _typebox.Type.Object({}),
483
+ execute: async () => ({})
484
+ }];
485
+ const help = (0, _index.generateAppHelp)(uncategorized);
486
+ (0, _bunTest.expect)(help).not.toContain("default:");
487
+ });
488
+ });
489
+
490
+ // ---------------------------------------------------------------------------
491
+ // runCli
492
+ // ---------------------------------------------------------------------------
493
+
494
+ (0, _bunTest.describe)("runCli", () => {
495
+ let logSpy;
496
+ let errorSpy;
497
+ let exitSpy;
498
+ const echoAction = {
499
+ name: "echo",
500
+ description: "Echoes input",
501
+ inputSchema: _typebox.Type.Object({
502
+ message: _typebox.Type.String()
503
+ }),
504
+ outputSchema: _typebox.Type.Object({
505
+ message: _typebox.Type.String()
506
+ }),
507
+ execute: async input => ({
508
+ message: input.message
509
+ })
510
+ };
511
+ (0, _bunTest.beforeEach)(() => {
512
+ logSpy = (0, _bunTest.spyOn)(console, "log").mockImplementation(() => {});
513
+ errorSpy = (0, _bunTest.spyOn)(console, "error").mockImplementation(() => {});
514
+ exitSpy = (0, _bunTest.spyOn)(process, "exit").mockImplementation(() => {});
515
+ });
516
+ (0, _bunTest.afterEach)(() => {
517
+ logSpy.mockRestore();
518
+ errorSpy.mockRestore();
519
+ exitSpy.mockRestore();
520
+ });
521
+
522
+ // Success path
523
+ (0, _bunTest.test)("logs JSON success output to stdout on valid input", async () => {
524
+ const sprinkle = makeMockSprinkle([echoAction]);
525
+ await (0, _index.runCli)(sprinkle, "echo", {
526
+ message: "hello"
527
+ }, fakeContext);
528
+ (0, _bunTest.expect)(logSpy).toHaveBeenCalledTimes(1);
529
+ const output = JSON.parse(String(logSpy.mock.calls[0][0]));
530
+ (0, _bunTest.expect)(output.success).toBe(true);
531
+ (0, _bunTest.expect)(output.data).toEqual({
532
+ message: "hello"
533
+ });
534
+ });
535
+ (0, _bunTest.test)("does not call process.exit on success", async () => {
536
+ const sprinkle = makeMockSprinkle([echoAction]);
537
+ await (0, _index.runCli)(sprinkle, "echo", {
538
+ message: "hi"
539
+ }, fakeContext);
540
+ (0, _bunTest.expect)(exitSpy).not.toHaveBeenCalled();
541
+ });
542
+
543
+ // Failure path: action not found
544
+ // Note: process.exit() is mocked to throw a sentinel error so that execution
545
+ // does not continue past the exit call (matching real runtime behaviour).
546
+ (0, _bunTest.test)("logs JSON error to stderr when action not found", async () => {
547
+ exitSpy.mockImplementation(() => {
548
+ throw new Error("process.exit called");
549
+ });
550
+ const sprinkle = makeMockSprinkle([]);
551
+ await (0, _bunTest.expect)((0, _index.runCli)(sprinkle, "unknown-action", {}, fakeContext)).rejects.toThrow("process.exit called");
552
+ (0, _bunTest.expect)(errorSpy).toHaveBeenCalledTimes(1);
553
+ const output = JSON.parse(String(errorSpy.mock.calls[0][0]));
554
+ (0, _bunTest.expect)(output.success).toBe(false);
555
+ (0, _bunTest.expect)(output.error.code).toBe("ACTION_NOT_FOUND");
556
+ });
557
+ (0, _bunTest.test)("calls process.exit(1) when action not found", async () => {
558
+ exitSpy.mockImplementation(() => {
559
+ throw new Error("process.exit called");
560
+ });
561
+ const sprinkle = makeMockSprinkle([]);
562
+ await (0, _bunTest.expect)((0, _index.runCli)(sprinkle, "ghost", {}, fakeContext)).rejects.toThrow("process.exit called");
563
+ (0, _bunTest.expect)(exitSpy).toHaveBeenCalledWith(1);
564
+ });
565
+ (0, _bunTest.test)("error message lists available actions when action not found", async () => {
566
+ exitSpy.mockImplementation(() => {
567
+ throw new Error("process.exit called");
568
+ });
569
+ const sprinkle = makeMockSprinkle([echoAction]);
570
+ await (0, _bunTest.expect)((0, _index.runCli)(sprinkle, "nope", {}, fakeContext)).rejects.toThrow("process.exit called");
571
+ const output = JSON.parse(String(errorSpy.mock.calls[0][0]));
572
+ (0, _bunTest.expect)(output.error.message).toContain("echo");
573
+ });
574
+ (0, _bunTest.test)("error message shows (none) when no actions registered", async () => {
575
+ exitSpy.mockImplementation(() => {
576
+ throw new Error("process.exit called");
577
+ });
578
+ const sprinkle = makeMockSprinkle([]);
579
+ await (0, _bunTest.expect)((0, _index.runCli)(sprinkle, "ghost", {}, fakeContext)).rejects.toThrow("process.exit called");
580
+ const output = JSON.parse(String(errorSpy.mock.calls[0][0]));
581
+ (0, _bunTest.expect)(output.error.message).toContain("(none)");
582
+ });
583
+
584
+ // Failure path: validation error
585
+ (0, _bunTest.test)("logs JSON error to stderr and exits on validation failure", async () => {
586
+ const sprinkle = makeMockSprinkle([echoAction]);
587
+ // Missing required 'message' field
588
+ await (0, _index.runCli)(sprinkle, "echo", {}, fakeContext);
589
+ (0, _bunTest.expect)(errorSpy).toHaveBeenCalledTimes(1);
590
+ const output = JSON.parse(String(errorSpy.mock.calls[0][0]));
591
+ (0, _bunTest.expect)(output.success).toBe(false);
592
+ (0, _bunTest.expect)(output.error.code).toBe("VALIDATION_ERROR");
593
+ (0, _bunTest.expect)(exitSpy).toHaveBeenCalledWith(1);
594
+ });
595
+ (0, _bunTest.test)("does not write to stdout on validation failure", async () => {
596
+ const sprinkle = makeMockSprinkle([echoAction]);
597
+ await (0, _index.runCli)(sprinkle, "echo", {}, fakeContext);
598
+ (0, _bunTest.expect)(logSpy).not.toHaveBeenCalled();
599
+ });
600
+
601
+ // Help flag
602
+ (0, _bunTest.test)("prints action help to stdout when --help is in rawArgs", async () => {
603
+ const sprinkle = makeMockSprinkle([echoAction]);
604
+ await (0, _index.runCli)(sprinkle, "echo", {
605
+ help: true
606
+ }, fakeContext);
607
+ (0, _bunTest.expect)(logSpy).toHaveBeenCalledTimes(1);
608
+ const output = String(logSpy.mock.calls[0][0]);
609
+ (0, _bunTest.expect)(output).toContain("Usage:");
610
+ (0, _bunTest.expect)(output).toContain("echo");
611
+ });
612
+ (0, _bunTest.test)("does not exit when --help flag is set", async () => {
613
+ const sprinkle = makeMockSprinkle([echoAction]);
614
+ await (0, _index.runCli)(sprinkle, "echo", {
615
+ help: true
616
+ }, fakeContext);
617
+ (0, _bunTest.expect)(exitSpy).not.toHaveBeenCalled();
618
+ });
619
+ (0, _bunTest.test)("does not call stderr when --help flag is set", async () => {
620
+ const sprinkle = makeMockSprinkle([echoAction]);
621
+ await (0, _index.runCli)(sprinkle, "echo", {
622
+ help: true
623
+ }, fakeContext);
624
+ (0, _bunTest.expect)(errorSpy).not.toHaveBeenCalled();
625
+ });
626
+
627
+ // BigInt in output
628
+ (0, _bunTest.test)("serializes BigInt values in output using bigIntReplacer", async () => {
629
+ const bigIntAction = {
630
+ name: "big-action",
631
+ description: "Returns a BigInt",
632
+ inputSchema: _typebox.Type.Object({}),
633
+ outputSchema: _typebox.Type.Object({
634
+ amount: _typebox.Type.BigInt()
635
+ }),
636
+ execute: async () => ({
637
+ amount: BigInt("9007199254740993")
638
+ })
639
+ };
640
+ const sprinkle = makeMockSprinkle([bigIntAction]);
641
+ await (0, _index.runCli)(sprinkle, "big-action", {}, fakeContext);
642
+ (0, _bunTest.expect)(logSpy).toHaveBeenCalledTimes(1);
643
+ const rawOutput = String(logSpy.mock.calls[0][0]);
644
+ // BigInt should appear as a string in JSON (bigIntReplacer converts it)
645
+ (0, _bunTest.expect)(rawOutput).toContain("9007199254740993");
646
+ });
647
+
648
+ // Custom appName in help
649
+ (0, _bunTest.test)("uses custom appName in action help output", async () => {
650
+ const sprinkle = makeMockSprinkle([echoAction]);
651
+ await (0, _index.runCli)(sprinkle, "echo", {
652
+ help: true
653
+ }, fakeContext, "my-cli");
654
+ const output = String(logSpy.mock.calls[0][0]);
655
+ (0, _bunTest.expect)(output).toContain("my-cli");
656
+ });
657
+
658
+ // Execution error from action
659
+ (0, _bunTest.test)("logs JSON error to stderr when action execute throws", async () => {
660
+ const failAction = {
661
+ name: "fail-action",
662
+ description: "Always fails",
663
+ inputSchema: _typebox.Type.Object({}),
664
+ outputSchema: _typebox.Type.Object({}),
665
+ execute: async () => {
666
+ throw new Error("something broke");
667
+ }
668
+ };
669
+ const sprinkle = makeMockSprinkle([failAction]);
670
+ await (0, _index.runCli)(sprinkle, "fail-action", {}, fakeContext);
671
+ (0, _bunTest.expect)(errorSpy).toHaveBeenCalledTimes(1);
672
+ const output = JSON.parse(String(errorSpy.mock.calls[0][0]));
673
+ (0, _bunTest.expect)(output.success).toBe(false);
674
+ (0, _bunTest.expect)(output.error.code).toBe("EXECUTION_ERROR");
675
+ (0, _bunTest.expect)(output.error.message).toContain("something broke");
676
+ (0, _bunTest.expect)(exitSpy).toHaveBeenCalledWith(1);
677
+ });
678
+
679
+ // Schema-driven coercion through runCli
680
+ (0, _bunTest.test)("coerces string args to correct types via schema before execution", async () => {
681
+ let captured;
682
+ const intAction = {
683
+ name: "int-action",
684
+ description: "Takes an integer",
685
+ inputSchema: _typebox.Type.Object({
686
+ count: _typebox.Type.Integer()
687
+ }),
688
+ outputSchema: _typebox.Type.Object({
689
+ count: _typebox.Type.Integer()
690
+ }),
691
+ execute: async input => {
692
+ captured = input;
693
+ return input;
694
+ }
695
+ };
696
+ const sprinkle = makeMockSprinkle([intAction]);
697
+ await (0, _index.runCli)(sprinkle, "int-action", {
698
+ count: "7"
699
+ }, fakeContext);
700
+ (0, _bunTest.expect)(captured.count).toBe(7);
701
+ });
702
+ });
703
+
704
+ // ---------------------------------------------------------------------------
705
+ // parseCliArgs repeated flag support (tested via action-runner, but verifying
706
+ // that the repeated-flag array output integrates with coerceValue)
707
+ // ---------------------------------------------------------------------------
708
+
709
+ (0, _bunTest.describe)("coerceValue with repeated flag arrays", () => {
710
+ (0, _bunTest.test)("passes already-array through Array schema and coerces each item", () => {
711
+ // Simulates what parseCliArgs produces for --tag a --tag b
712
+ const raw = ["a", "b", "c"];
713
+ const result = (0, _index.coerceValue)(raw, _typebox.Type.Array(_typebox.Type.String()));
714
+ (0, _bunTest.expect)(result).toEqual(["a", "b", "c"]);
715
+ });
716
+ (0, _bunTest.test)("coerces repeated numeric string flags to integer array", () => {
717
+ const raw = ["1", "2", "3"];
718
+ const result = (0, _index.coerceValue)(raw, _typebox.Type.Array(_typebox.Type.Integer()));
719
+ (0, _bunTest.expect)(result).toEqual([1, 2, 3]);
720
+ });
721
+ });
722
+ //# sourceMappingURL=cli-adapter.test.js.map