@akterjs/cli 0.0.0-stage → 0.1.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 (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +47 -2
  3. package/dist/Argument-D81dqizB.mjs +57 -0
  4. package/dist/Array-B4kuTQeW.mjs +2323 -0
  5. package/dist/Boolean-kILIvmhE.mjs +26 -0
  6. package/dist/ChildProcess-BCIwxPGc.mjs +577 -0
  7. package/dist/CliError-Cf5xqkkj.mjs +633 -0
  8. package/dist/Command-Dzq9KM-h.mjs +5135 -0
  9. package/dist/Config-B6OND9WR.mjs +854 -0
  10. package/dist/Console-BKHUkH6a.mjs +141 -0
  11. package/dist/Data-CeCULr0-.mjs +251 -0
  12. package/dist/Digest-CBd3uv5B.mjs +348 -0
  13. package/dist/Duration-EH9Vy4U6.mjs +791 -0
  14. package/dist/Effect-CKFpqbmw.mjs +12911 -0
  15. package/dist/FileSystem-4pPcEb_i.mjs +1366 -0
  16. package/dist/HttpClientError-BUeMWx70.mjs +303 -0
  17. package/dist/HttpClientResponse-D5ZKICVV.mjs +855 -0
  18. package/dist/Match-CGPLZYrV.mjs +434 -0
  19. package/dist/MutableHashMap-f8nW8AJR.mjs +376 -0
  20. package/dist/MutableHashSet-_HI572Ya.mjs +155 -0
  21. package/dist/MutableRef-D4Qv592C.mjs +107 -0
  22. package/dist/Number-BvkRkfc-.mjs +137 -0
  23. package/dist/Option-DkxSnBhp.mjs +3967 -0
  24. package/dist/Order-C1JC991I.mjs +481 -0
  25. package/dist/Path-Djdv_eF5.mjs +130 -0
  26. package/dist/Queue-CO5UQ6os.mjs +1394 -0
  27. package/dist/Redacted-RkJrG5Me.mjs +160 -0
  28. package/dist/Ref-BIPOxJNH.mjs +267 -0
  29. package/dist/Runtime-BInIAwK3.mjs +297 -0
  30. package/dist/Schema-MiKt5K1v.mjs +10999 -0
  31. package/dist/SecureRandom-B_U4ysO3.mjs +279 -0
  32. package/dist/Semaphore-DOVJ4ZGS.mjs +177 -0
  33. package/dist/Stdio-KylmOBX_.mjs +74 -0
  34. package/dist/Stream-bK9QIETN.mjs +4012 -0
  35. package/dist/String-q5dcsVe4.mjs +351 -0
  36. package/dist/TerminalCapabilities-w_44MAca.mjs +1769 -0
  37. package/dist/WebCrypto-ZI_GNVlw.mjs +33 -0
  38. package/dist/actor-call.service-CGM_vD9u.mjs +1269 -0
  39. package/dist/actor-client.adapter-Coem7gF1.mjs +3691 -0
  40. package/dist/akter-program.config-C4cXx4Fr.mjs +7034 -0
  41. package/dist/akter.cli.mjs +5 -0
  42. package/dist/app-cli.config.mjs +49 -0
  43. package/dist/app-entry.pure.mjs +31 -0
  44. package/dist/archive/akter-archive.schema.mjs +65 -0
  45. package/dist/archive/akter-archive.service.mjs +309 -0
  46. package/dist/archive/archive-cli.config.mjs +45 -0
  47. package/dist/archive/archive-invalid.errors.mjs +5 -0
  48. package/dist/archive/archived-lineage.pure.mjs +13 -0
  49. package/dist/archive/tar.pure.mjs +291 -0
  50. package/dist/archive/zstd.adapter.mjs +46 -0
  51. package/dist/bench/bench-report.pure.mjs +120 -0
  52. package/dist/bench/bench-runner.pure.mjs +89 -0
  53. package/dist/bench/bench.service.mjs +301 -0
  54. package/dist/cli-runtime.layer-BqK2mmVL.mjs +1191 -0
  55. package/dist/cli-runtime.layer.mjs +1 -0
  56. package/dist/cloud-client.adapter-Cy1BjDbG.mjs +3186 -0
  57. package/dist/cloud-client.adapter-DOVMoYAj.mjs +304 -0
  58. package/dist/command/akter-commands.config.mjs +32 -0
  59. package/dist/command/akter-program.config.mjs +1 -0
  60. package/dist/credentials/credentials.service.mjs +226 -0
  61. package/dist/credentials/keychain.adapter.mjs +92 -0
  62. package/dist/credentials/login.config.mjs +251 -0
  63. package/dist/deploy/auth/api-attempt.service.mjs +30 -0
  64. package/dist/deploy/auth/token-refresh.errors.mjs +4 -0
  65. package/dist/deploy/build-bundle.adapter.mjs +133 -0
  66. package/dist/deploy/build-manifest.pure.mjs +44 -0
  67. package/dist/deploy/cloud-client.adapter.mjs +1 -0
  68. package/dist/deploy/cloud-url.pure.mjs +17 -0
  69. package/dist/deploy/deploy-failed.errors.mjs +17 -0
  70. package/dist/deploy/deploy.service.mjs +156 -0
  71. package/dist/deploy/request-failure.pure.mjs +87 -0
  72. package/dist/dev-runner.pure.mjs +30 -0
  73. package/dist/docs/doc-topics.pure.mjs +21 -0
  74. package/dist/docs/docs.config.mjs +1 -0
  75. package/dist/docs.config-_21Xi6HU.mjs +190 -0
  76. package/dist/export/actor-export.service.mjs +267 -0
  77. package/dist/export/export-failed.errors.mjs +4 -0
  78. package/dist/export/export-failure.pure.mjs +18 -0
  79. package/dist/export/ordered-lines.pure.mjs +43 -0
  80. package/dist/export/ranged-download.pure.mjs +66 -0
  81. package/dist/export/snapshot-download.pure.mjs +86 -0
  82. package/dist/history-runner.pure.mjs +186 -0
  83. package/dist/history-since.pure.mjs +17 -0
  84. package/dist/hosted-runtime.layer-Cx3IPsEd.mjs +16358 -0
  85. package/dist/local/environment-cli.config.mjs +90 -0
  86. package/dist/local/environment-runner.pure.mjs +75 -0
  87. package/dist/local/local-cli.config.mjs +159 -0
  88. package/dist/logs/log-follow.config.mjs +21 -0
  89. package/dist/logs/log-follow.service.mjs +87 -0
  90. package/dist/logs/log-lines.pure.mjs +44 -0
  91. package/dist/migrate-runner.pure.mjs +28 -0
  92. package/dist/operation-input.pure-CS9iUhqK.mjs +1383 -0
  93. package/dist/operation-registry.pure-DVC8EDgj.mjs +283 -0
  94. package/dist/registry/actor-call.service.mjs +1 -0
  95. package/dist/registry/actor-commands.config.mjs +127 -0
  96. package/dist/registry/actor-refusal.pure.mjs +34 -0
  97. package/dist/registry/approval.service.mjs +80 -0
  98. package/dist/registry/cloud-commands.config.mjs +151 -0
  99. package/dist/registry/cloud-served.pure.mjs +31 -0
  100. package/dist/registry/operation-call.service.mjs +262 -0
  101. package/dist/registry/operation-input.pure.mjs +1 -0
  102. package/dist/registry/operation-output.pure.mjs +91 -0
  103. package/dist/registry/served-command.config.mjs +57 -0
  104. package/dist/runner-exited.errors.mjs +10 -0
  105. package/dist/terminal/cli-exit.errors.mjs +38 -0
  106. package/dist/terminal/cli-failure.pure.mjs +31 -0
  107. package/dist/terminal/confirm.adapter.mjs +27 -0
  108. package/package.json +61 -3
@@ -0,0 +1,376 @@
1
+ import { Bt as hash, Ct as NodeInspectSymbol, Et as format, It as equals, On as pipeArguments, S as none, _ as isSome, bn as dual, w as some, wt as toJson } from "./Option-DkxSnBhp.mjs";
2
+ // ../../node_modules/.pnpm/effect@4.1.2_patch_hash=0e61176203bb1256381ce1c5b488d7951983ce38ff698647d3f4617383abbf07/node_modules/effect/dist/MutableHashMap.js
3
+ const TypeId = "~effect/MutableHashMap";
4
+ const MutableHashMapProto = {
5
+ [TypeId]: TypeId,
6
+ [Symbol.iterator]() {
7
+ return this.backing[Symbol.iterator]();
8
+ },
9
+ toString() {
10
+ return `MutableHashMap(${format(Array.from(this))})`;
11
+ },
12
+ toJSON() {
13
+ return {
14
+ _id: "MutableHashMap",
15
+ values: toJson(Array.from(this))
16
+ };
17
+ },
18
+ [NodeInspectSymbol]() {
19
+ return this.toJSON();
20
+ },
21
+ pipe() {
22
+ return pipeArguments(this, arguments);
23
+ }
24
+ };
25
+ /**
26
+ * Creates an empty MutableHashMap.
27
+ *
28
+ * **When to use**
29
+ *
30
+ * Use to create a fresh mutable map before adding entries over time.
31
+ *
32
+ * **Details**
33
+ *
34
+ * Each call returns a new empty map instance.
35
+ *
36
+ * **Example** (Creating an empty map)
37
+ *
38
+ * ```ts import.meta.vitest
39
+ * import { MutableHashMap } from "effect"
40
+ *
41
+ * const map = MutableHashMap.empty<string, number>()
42
+ *
43
+ * // Add some entries
44
+ * MutableHashMap.set(map, "key1", 42)
45
+ * MutableHashMap.set(map, "key2", 100)
46
+ *
47
+ * MutableHashMap.size(map) // => 2
48
+ * ```
49
+ *
50
+ * @see {@link make} for creating a map from explicit entries
51
+ * @see {@link fromIterable} for creating a map from an iterable of entries
52
+ *
53
+ * @stability stable
54
+ * @category constructors
55
+ * @since 2.0.0
56
+ */
57
+ const empty = () => {
58
+ const self = Object.create(MutableHashMapProto);
59
+ self.backing = /* @__PURE__ */ new Map();
60
+ self.buckets = /* @__PURE__ */ new Map();
61
+ return self;
62
+ };
63
+ /**
64
+ * Looks up a key in the `MutableHashMap` safely.
65
+ *
66
+ * **When to use**
67
+ *
68
+ * Use to safely read a `MutableHashMap` value for a key as an `Option`.
69
+ *
70
+ * **Details**
71
+ *
72
+ * Returns `Some(value)` when an equal key is present and `None` when the key is
73
+ * absent.
74
+ *
75
+ * **Example** (Getting a value)
76
+ *
77
+ * ```ts import.meta.vitest
78
+ * import { MutableHashMap, Option } from "effect"
79
+ *
80
+ * const map = MutableHashMap.make(["key1", 42], ["key2", 100])
81
+ *
82
+ * MutableHashMap.get(map, "key1") // => Option.some(42)
83
+ * MutableHashMap.get(map, "key3") // => Option.none()
84
+ *
85
+ * // Pipe-able version
86
+ * MutableHashMap.get("key1")(map) // => Option.some(42)
87
+ * ```
88
+ *
89
+ * @see {@link has} for checking only whether a key is present
90
+ * @see {@link set} for inserting or replacing a value by key
91
+ *
92
+ * @stability stable
93
+ * @category getters
94
+ * @since 2.0.0
95
+ */
96
+ const get = /*#__PURE__*/ dual(2, (self, key) => {
97
+ if (self.backing.has(key)) return some(self.backing.get(key));
98
+ else if (isSimpleKey(key)) return none();
99
+ const hash$2 = hash(key);
100
+ const bucket = self.buckets.get(hash$2);
101
+ if (bucket === void 0) return none();
102
+ return getFromBucket(self, bucket, key);
103
+ });
104
+ const isSimpleKey = (u) => typeof u !== "object" && typeof u !== "function";
105
+ /**
106
+ * Returns an iterable over the values in the `MutableHashMap`.
107
+ *
108
+ * **When to use**
109
+ *
110
+ * Use to iterate over the values currently stored in a mutable hash map.
111
+ *
112
+ * **Example** (Reading values)
113
+ *
114
+ * ```ts import.meta.vitest
115
+ * import { MutableHashMap } from "effect"
116
+ *
117
+ * const map = MutableHashMap.make(
118
+ * ["apple", 1],
119
+ * ["banana", 2],
120
+ * ["cherry", 3]
121
+ * )
122
+ *
123
+ * const allValues = Array.from(MutableHashMap.values(map)) // => [1, 2, 3]
124
+ *
125
+ * // Useful for calculations
126
+ * allValues.reduce((sum, value) => sum + value, 0) // => 6
127
+ *
128
+ * // Filter values
129
+ * allValues.filter((value) => value > 1) // => [2, 3]
130
+ * ```
131
+ *
132
+ * @see {@link keys} for iterating over stored keys
133
+ *
134
+ * @stability stable
135
+ * @category getters
136
+ * @since 3.8.0
137
+ */
138
+ const values = (self) => self.backing.values();
139
+ const getFromBucket = (self, bucket, key) => {
140
+ for (let i = 0, len = bucket.length; i < len; i++) if (equals(key, bucket[i])) {
141
+ const refKey = bucket[i];
142
+ return some(self.backing.get(refKey));
143
+ }
144
+ return none();
145
+ };
146
+ /**
147
+ * Checks whether the MutableHashMap contains the specified key.
148
+ *
149
+ * **When to use**
150
+ *
151
+ * Use to test whether a key is present in a `MutableHashMap` without reading
152
+ * its value.
153
+ *
154
+ * **Example** (Checking for a key)
155
+ *
156
+ * ```ts import.meta.vitest
157
+ * import { MutableHashMap } from "effect"
158
+ *
159
+ * const map = MutableHashMap.make(["key1", 42], ["key2", 100])
160
+ *
161
+ * MutableHashMap.has(map, "key1") // => true
162
+ * MutableHashMap.has(map, "key3") // => false
163
+ *
164
+ * // Pipe-able version
165
+ * MutableHashMap.has("key1")(map) // => true
166
+ * ```
167
+ *
168
+ * @see {@link get} for reading the value as an `Option`
169
+ *
170
+ * @stability stable
171
+ * @category predicates
172
+ * @since 2.0.0
173
+ */
174
+ const has = /*#__PURE__*/ dual(2, (self, key) => isSome(get(self, key)));
175
+ /**
176
+ * Sets a key-value pair in the MutableHashMap, mutating the map in place.
177
+ * If the key already exists, its value is updated.
178
+ *
179
+ * **When to use**
180
+ *
181
+ * Use to insert a new `MutableHashMap` entry or replace an existing entry in
182
+ * place.
183
+ *
184
+ * **Example** (Setting key-value pairs)
185
+ *
186
+ * ```ts import.meta.vitest
187
+ * import { MutableHashMap, Option } from "effect"
188
+ *
189
+ * const map = MutableHashMap.empty<string, number>()
190
+ *
191
+ * // Add new entries
192
+ * MutableHashMap.set(map, "key1", 42)
193
+ * MutableHashMap.set(map, "key2", 100)
194
+ *
195
+ * MutableHashMap.get(map, "key1") // => Option.some(42)
196
+ * MutableHashMap.size(map) // => 2
197
+ *
198
+ * // Update existing entry
199
+ * MutableHashMap.set(map, "key1", 999)
200
+ * MutableHashMap.get(map, "key1") // => Option.some(999)
201
+ *
202
+ * // Pipe-able version
203
+ * MutableHashMap.set("key3", 300)(map)
204
+ * MutableHashMap.size(map) // => 3
205
+ * ```
206
+ *
207
+ * @see {@link modify} for updating an existing value with a function
208
+ * @see {@link modifyAt} for setting or removing based on the current optional value
209
+ * @see {@link remove} for deleting an entry by key
210
+ *
211
+ * @stability stable
212
+ * @category mutations
213
+ * @since 2.0.0
214
+ */
215
+ const set = /*#__PURE__*/ dual(3, (self, key, value) => {
216
+ if (self.backing.has(key) || isSimpleKey(key)) {
217
+ self.backing.set(key, value);
218
+ return self;
219
+ }
220
+ const hash$4 = hash(key);
221
+ const bucket = self.buckets.get(hash$4);
222
+ if (bucket === void 0) {
223
+ self.buckets.set(hash$4, [key]);
224
+ self.backing.set(key, value);
225
+ return self;
226
+ }
227
+ let refKey = getRefKey(bucket, key);
228
+ if (refKey === void 0) {
229
+ bucket.push(key);
230
+ refKey = key;
231
+ }
232
+ self.backing.set(refKey, value);
233
+ return self;
234
+ });
235
+ const getRefKey = (bucket, key) => {
236
+ for (let i = 0, len = bucket.length; i < len; i++) if (equals(key, bucket[i])) return bucket[i];
237
+ };
238
+ /**
239
+ * Removes the specified key from the MutableHashMap, mutating the map in place.
240
+ * If the key doesn't exist, the map remains unchanged.
241
+ *
242
+ * **When to use**
243
+ *
244
+ * Use to delete one key from a mutable hash map in place.
245
+ *
246
+ * **Example** (Removing a key)
247
+ *
248
+ * ```ts import.meta.vitest
249
+ * import { MutableHashMap } from "effect"
250
+ *
251
+ * const map = MutableHashMap.make(
252
+ * ["key1", 42],
253
+ * ["key2", 100],
254
+ * ["key3", 200]
255
+ * )
256
+ *
257
+ * MutableHashMap.size(map) // => 3
258
+ *
259
+ * // Remove existing key
260
+ * MutableHashMap.remove(map, "key2")
261
+ * MutableHashMap.size(map) // => 2
262
+ * MutableHashMap.has(map, "key2") // => false
263
+ *
264
+ * // Remove non-existent key (no effect)
265
+ * MutableHashMap.remove(map, "nonexistent")
266
+ * MutableHashMap.size(map) // => 2
267
+ *
268
+ * // Pipe-able version
269
+ * MutableHashMap.remove("key1")(map)
270
+ * MutableHashMap.size(map) // => 1
271
+ * ```
272
+ *
273
+ * @see {@link clear} for removing all entries
274
+ * @see {@link modifyAt} for conditionally removing based on the current value
275
+ *
276
+ * @stability stable
277
+ * @category mutations
278
+ * @since 2.0.0
279
+ */
280
+ const remove = /*#__PURE__*/ dual(2, (self, key_) => {
281
+ if (isSimpleKey(key_)) {
282
+ self.backing.delete(key_);
283
+ return self;
284
+ }
285
+ const hash$1 = hash(key_);
286
+ const bucket = self.buckets.get(hash$1);
287
+ if (bucket === void 0) return self;
288
+ for (let i = 0, len = bucket.length; i < len; i++) {
289
+ const bkey = bucket[i];
290
+ if (bkey === key_ || equals(key_, bkey)) {
291
+ self.backing.delete(bkey);
292
+ bucket.splice(i, 1);
293
+ break;
294
+ }
295
+ }
296
+ if (bucket.length === 0) self.buckets.delete(hash$1);
297
+ return self;
298
+ });
299
+ /**
300
+ * Removes all key-value pairs from the MutableHashMap, mutating the map in place.
301
+ * The map becomes empty after this operation.
302
+ *
303
+ * **When to use**
304
+ *
305
+ * Use to empty a mutable hash map while keeping the same map instance.
306
+ *
307
+ * **Example** (Clearing all entries)
308
+ *
309
+ * ```ts import.meta.vitest
310
+ * import { MutableHashMap } from "effect"
311
+ *
312
+ * const map = MutableHashMap.make(
313
+ * ["key1", 42],
314
+ * ["key2", 100],
315
+ * ["key3", 200]
316
+ * )
317
+ *
318
+ * MutableHashMap.size(map) // => 3
319
+ *
320
+ * // Clear all entries
321
+ * MutableHashMap.clear(map)
322
+ *
323
+ * MutableHashMap.size(map) // => 0
324
+ * MutableHashMap.has(map, "key1") // => false
325
+ *
326
+ * // Can still add new entries after clearing
327
+ * MutableHashMap.set(map, "new", 999)
328
+ * Array.from(map) // => [["new", 999]]
329
+ * ```
330
+ *
331
+ * @see {@link remove} for deleting one key
332
+ * @see {@link empty} for creating a fresh empty map
333
+ *
334
+ * @stability stable
335
+ * @category mutations
336
+ * @since 2.0.0
337
+ */
338
+ const clear = (self) => {
339
+ self.backing.clear();
340
+ self.buckets.clear();
341
+ return self;
342
+ };
343
+ /**
344
+ * Returns the number of key-value pairs in the MutableHashMap.
345
+ *
346
+ * **When to use**
347
+ *
348
+ * Use to read how many entries are currently stored in the mutable hash map.
349
+ *
350
+ * **Example** (Checking map size)
351
+ *
352
+ * ```ts import.meta.vitest
353
+ * import { MutableHashMap } from "effect"
354
+ *
355
+ * const map = MutableHashMap.empty<string, number>()
356
+ * MutableHashMap.size(map) // => 0
357
+ *
358
+ * MutableHashMap.set(map, "key1", 42)
359
+ * MutableHashMap.set(map, "key2", 100)
360
+ * MutableHashMap.size(map) // => 2
361
+ *
362
+ * MutableHashMap.remove(map, "key1")
363
+ * MutableHashMap.size(map) // => 1
364
+ *
365
+ * MutableHashMap.clear(map)
366
+ * MutableHashMap.size(map) // => 0
367
+ * ```
368
+ *
369
+ * @see {@link isEmpty} for checking whether the map has no entries
370
+ *
371
+ * @stability stable
372
+ * @category getters
373
+ * @since 2.0.0
374
+ */
375
+ const size = (self) => self.backing.size;
376
+ export { remove as a, values as c, has as i, empty as n, set as o, get as r, size as s, clear as t };
@@ -0,0 +1,155 @@
1
+ import { Ct as NodeInspectSymbol, Et as format, On as pipeArguments, bn as dual, wt as toJson } from "./Option-DkxSnBhp.mjs";
2
+ import { i as has$1, n as empty$1, o as set } from "./MutableHashMap-f8nW8AJR.mjs";
3
+ // ../../node_modules/.pnpm/effect@4.1.2_patch_hash=0e61176203bb1256381ce1c5b488d7951983ce38ff698647d3f4617383abbf07/node_modules/effect/dist/MutableHashSet.js
4
+ /**
5
+ * Stores unique values in a mutable hash set.
6
+ *
7
+ * `MutableHashSet` updates the same collection in place and supports fast
8
+ * membership checks, insertion, removal, clearing, and iteration. It is built
9
+ * on `MutableHashMap`: each set value is stored as a map key, so uniqueness
10
+ * follows the same hashing and equality rules as the underlying mutable hash
11
+ * map.
12
+ *
13
+ * @stability stable
14
+ * @since 2.0.0
15
+ */
16
+ const TypeId = "~effect/MutableHashSet";
17
+ const MutableHashSetProto = {
18
+ [TypeId]: TypeId,
19
+ [Symbol.iterator]() {
20
+ return Array.from(this.keyMap).map(([_]) => _)[Symbol.iterator]();
21
+ },
22
+ toString() {
23
+ return `MutableHashSet(${format(Array.from(this))})`;
24
+ },
25
+ toJSON() {
26
+ return {
27
+ _id: "MutableHashSet",
28
+ values: toJson(Array.from(this))
29
+ };
30
+ },
31
+ [NodeInspectSymbol]() {
32
+ return this.toJSON();
33
+ },
34
+ pipe() {
35
+ return pipeArguments(this, arguments);
36
+ }
37
+ };
38
+ const fromHashMap = (keyMap) => {
39
+ const set = Object.create(MutableHashSetProto);
40
+ set.keyMap = keyMap;
41
+ return set;
42
+ };
43
+ /**
44
+ * Creates an empty MutableHashSet.
45
+ *
46
+ * **When to use**
47
+ *
48
+ * Use to create a fresh mutable set before adding values over time.
49
+ *
50
+ * **Details**
51
+ *
52
+ * Each call returns a new empty set backed by an empty `MutableHashMap`.
53
+ *
54
+ * **Example** (Creating an empty set)
55
+ *
56
+ * ```ts import.meta.vitest
57
+ * import { MutableHashSet } from "effect"
58
+ *
59
+ * const set = MutableHashSet.empty<string>()
60
+ *
61
+ * // Add some values
62
+ * MutableHashSet.add(set, "apple")
63
+ * MutableHashSet.add(set, "banana")
64
+ * MutableHashSet.add(set, "apple") // Duplicate, no effect
65
+ *
66
+ * MutableHashSet.size(set) // => 2
67
+ * Array.from(set) // => ["apple", "banana"]
68
+ * ```
69
+ *
70
+ * @see {@link make} for creating a set from explicit values
71
+ * @see {@link fromIterable} for creating a set from an iterable of values
72
+ * @see {@link clear} for emptying an existing mutable set
73
+ *
74
+ * @stability stable
75
+ * @category constructors
76
+ * @since 2.0.0
77
+ */
78
+ const empty = () => fromHashMap(empty$1());
79
+ /**
80
+ * Adds a value to the MutableHashSet, mutating the set in place.
81
+ * If the value already exists, the set remains unchanged.
82
+ *
83
+ * **When to use**
84
+ *
85
+ * Use to insert a value into a mutable set while keeping uniqueness.
86
+ *
87
+ * **Example** (Adding values)
88
+ *
89
+ * ```ts import.meta.vitest
90
+ * import { MutableHashSet } from "effect"
91
+ *
92
+ * const set = MutableHashSet.empty<string>()
93
+ *
94
+ * // Add new values
95
+ * MutableHashSet.add(set, "apple")
96
+ * MutableHashSet.add(set, "banana")
97
+ *
98
+ * MutableHashSet.size(set) // => 2
99
+ * MutableHashSet.has(set, "apple") // => true
100
+ *
101
+ * // Add duplicate (no effect)
102
+ * MutableHashSet.add(set, "apple")
103
+ * MutableHashSet.size(set) // => 2
104
+ *
105
+ * // Pipe-able version
106
+ * const addFruit = MutableHashSet.add("cherry")
107
+ * addFruit(set)
108
+ * MutableHashSet.size(set) // => 3
109
+ * ```
110
+ *
111
+ * @stability stable
112
+ * @category mutations
113
+ * @since 2.0.0
114
+ */
115
+ const add = /*#__PURE__*/ dual(2, (self, key) => (set(self.keyMap, key, true), self));
116
+ /**
117
+ * Checks whether the MutableHashSet contains the specified value.
118
+ *
119
+ * **When to use**
120
+ *
121
+ * Use to test whether a mutable set currently contains a value.
122
+ *
123
+ * **Details**
124
+ *
125
+ * Membership follows the same hashing and equality rules as the underlying
126
+ * `MutableHashMap`.
127
+ *
128
+ * **Example** (Checking for a value)
129
+ *
130
+ * ```ts import.meta.vitest
131
+ * import { MutableHashSet } from "effect"
132
+ *
133
+ * const set = MutableHashSet.make("apple", "banana", "cherry")
134
+ *
135
+ * MutableHashSet.has(set, "apple") // => true
136
+ * MutableHashSet.has(set, "grape") // => false
137
+ *
138
+ * // Pipe-able version
139
+ * const hasApple = MutableHashSet.has("apple")
140
+ * hasApple(set) // => true
141
+ *
142
+ * // Check after adding
143
+ * MutableHashSet.add(set, "grape")
144
+ * MutableHashSet.has(set, "grape") // => true
145
+ * ```
146
+ *
147
+ * @see {@link add} for adding a value to the set
148
+ * @see {@link remove} for removing a value from the set
149
+ *
150
+ * @stability stable
151
+ * @category predicates
152
+ * @since 2.0.0
153
+ */
154
+ const has = /*#__PURE__*/ dual(2, (self, key) => has$1(self.keyMap, key));
155
+ export { empty as n, has as r, add as t };
@@ -0,0 +1,107 @@
1
+ import { F as PipeInspectableProto, bn as dual, wt as toJson } from "./Option-DkxSnBhp.mjs";
2
+ // ../../node_modules/.pnpm/effect@4.1.2_patch_hash=0e61176203bb1256381ce1c5b488d7951983ce38ff698647d3f4617383abbf07/node_modules/effect/dist/MutableRef.js
3
+ const TypeId = "~effect/MutableRef";
4
+ const MutableRefProto = {
5
+ [TypeId]: TypeId,
6
+ ...PipeInspectableProto,
7
+ toJSON() {
8
+ return {
9
+ _id: "MutableRef",
10
+ current: toJson(this.current)
11
+ };
12
+ }
13
+ };
14
+ /**
15
+ * Creates a new MutableRef with the specified initial value.
16
+ *
17
+ * **When to use**
18
+ *
19
+ * Use to create a synchronous `MutableRef` initialized with a value.
20
+ *
21
+ * **Example** (Creating mutable refs)
22
+ *
23
+ * ```ts import.meta.vitest
24
+ * import { MutableRef } from "effect"
25
+ *
26
+ * // Create a counter reference
27
+ * const counter = MutableRef.make(0)
28
+ *
29
+ * MutableRef.get(counter) // => 0
30
+ *
31
+ * // Create a configuration reference
32
+ * const config = MutableRef.make({ debug: false, timeout: 5000 })
33
+ *
34
+ * MutableRef.get(config) // => { debug: false, timeout: 5000 }
35
+ *
36
+ * // Create a string reference
37
+ * const status = MutableRef.make("idle")
38
+ * MutableRef.set(status, "running")
39
+ *
40
+ * MutableRef.get(status) // => "running"
41
+ * ```
42
+ *
43
+ * @stability stable
44
+ * @category constructors
45
+ * @since 2.0.0
46
+ */
47
+ const make = (value) => {
48
+ const ref = Object.create(MutableRefProto);
49
+ ref.current = value;
50
+ return ref;
51
+ };
52
+ /**
53
+ * Sets the MutableRef to a new value and returns the reference.
54
+ *
55
+ * **When to use**
56
+ *
57
+ * Use when you need an in-place `MutableRef` replacement that returns the same
58
+ * `MutableRef`.
59
+ *
60
+ * **Example** (Setting values)
61
+ *
62
+ * ```ts import.meta.vitest
63
+ * import { MutableRef } from "effect"
64
+ *
65
+ * const ref = MutableRef.make("initial")
66
+ *
67
+ * // Set a new value
68
+ * MutableRef.set(ref, "updated")
69
+ *
70
+ * MutableRef.get(ref) // => "updated"
71
+ *
72
+ * // Chain set operations (since it returns the ref)
73
+ * const result = MutableRef.set(ref, "final")
74
+ *
75
+ * result === ref // => true
76
+ * MutableRef.get(ref) // => "final"
77
+ *
78
+ * // Set complex objects
79
+ * const config = MutableRef.make({ debug: false, verbose: false })
80
+ * MutableRef.set(config, { debug: true, verbose: true })
81
+ *
82
+ * MutableRef.get(config) // => { debug: true, verbose: true }
83
+ *
84
+ * // Pipe-able version
85
+ * const setValue = MutableRef.set("new value")
86
+ * setValue(ref)
87
+ *
88
+ * MutableRef.get(ref) // => "new value"
89
+ *
90
+ * // Useful for state management
91
+ * const state = MutableRef.make<"idle" | "loading" | "success" | "error">("idle")
92
+ * MutableRef.set(state, "loading")
93
+ * // ... perform async operation
94
+ * MutableRef.set(state, "success")
95
+ *
96
+ * MutableRef.get(state) // => "success"
97
+ * ```
98
+ *
99
+ * @stability stable
100
+ * @category mutations
101
+ * @since 2.0.0
102
+ */
103
+ const set = /*#__PURE__*/ dual(2, (self, value) => {
104
+ self.current = value;
105
+ return self;
106
+ });
107
+ export { set as n, make as t };