@dxos/cli-util 0.8.4-main.fcfe5033a5 → 0.9.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.
- package/LICENSE +102 -5
- package/dist/lib/node-esm/{chunk-6TKUDRM6.mjs → chunk-N5LOOWPE.mjs} +1 -1
- package/dist/lib/node-esm/index.mjs +100 -80
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/types/src/testing/test-console.d.ts.map +1 -1
- package/dist/types/src/testing/test-layer.d.ts +1 -1
- package/dist/types/src/util/form-builder.d.ts.map +1 -1
- package/dist/types/src/util/options.d.ts.map +1 -1
- package/dist/types/src/util/platform.d.ts.map +1 -1
- package/dist/types/src/util/printer.d.ts.map +1 -1
- package/dist/types/src/util/space-format.d.ts +13 -2
- package/dist/types/src/util/space-format.d.ts.map +1 -1
- package/dist/types/src/util/space.d.ts +8 -9
- package/dist/types/src/util/space.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -18
- package/src/util/form-builder.test.ts +10 -10
- package/src/util/space-format.ts +86 -12
- package/src/util/space.ts +37 -37
- /package/dist/lib/node-esm/{chunk-6TKUDRM6.mjs.map → chunk-N5LOOWPE.mjs.map} +0 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2025 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
CommandConfig,
|
|
4
4
|
__export
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N5LOOWPE.mjs";
|
|
6
6
|
|
|
7
7
|
// src/util/form-builder.ts
|
|
8
8
|
var form_builder_exports = {};
|
|
@@ -44,16 +44,16 @@ var calculateDimensions = (entries, prefix) => {
|
|
|
44
44
|
var buildKeyLine = (prefix, key, targetWidth) => {
|
|
45
45
|
return Doc.annotate(Doc.fill(targetWidth)(Doc.text(prefix + key + ": ")), Ansi.blackBright);
|
|
46
46
|
};
|
|
47
|
-
var setImpl = (builder, key,
|
|
48
|
-
if (
|
|
47
|
+
var setImpl = (builder, key, value, color) => {
|
|
48
|
+
if (value !== void 0) {
|
|
49
49
|
let valueDoc;
|
|
50
|
-
if (typeof
|
|
51
|
-
valueDoc =
|
|
50
|
+
if (typeof value === "object" && value !== null) {
|
|
51
|
+
valueDoc = value;
|
|
52
52
|
} else {
|
|
53
|
-
valueDoc = Doc.text(String(
|
|
53
|
+
valueDoc = Doc.text(String(value));
|
|
54
54
|
}
|
|
55
55
|
if (color) {
|
|
56
|
-
const ansi = typeof color === "function" ? color(
|
|
56
|
+
const ansi = typeof color === "function" ? color(value) : color;
|
|
57
57
|
valueDoc = Doc.annotate(valueDoc, ansi);
|
|
58
58
|
}
|
|
59
59
|
builder.entries.push({
|
|
@@ -68,13 +68,13 @@ function set(builderOrKey, keyOrValue, valueOrColor, color) {
|
|
|
68
68
|
if (builderOrKey instanceof FormBuilderImpl) {
|
|
69
69
|
const builder = builderOrKey;
|
|
70
70
|
const key = keyOrValue;
|
|
71
|
-
const
|
|
72
|
-
return setImpl(builder, key,
|
|
71
|
+
const value = valueOrColor;
|
|
72
|
+
return setImpl(builder, key, value, color);
|
|
73
73
|
} else {
|
|
74
74
|
const key = builderOrKey;
|
|
75
|
-
const
|
|
75
|
+
const value = keyOrValue;
|
|
76
76
|
const color2 = valueOrColor;
|
|
77
|
-
return (builder) => setImpl(builder, key,
|
|
77
|
+
return (builder) => setImpl(builder, key, value, color2);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
var nestImpl = (parent, key, builder) => {
|
|
@@ -103,9 +103,9 @@ function nest(parentOrKey, keyOrBuilder, builder) {
|
|
|
103
103
|
return (parent) => nestImpl(parent, key, builder2);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
var optionImpl = (builder, key,
|
|
107
|
-
if (Option.isSome(
|
|
108
|
-
return setImpl(builder, key,
|
|
106
|
+
var optionImpl = (builder, key, value, color) => {
|
|
107
|
+
if (Option.isSome(value)) {
|
|
108
|
+
return setImpl(builder, key, value.value, color);
|
|
109
109
|
}
|
|
110
110
|
return builder;
|
|
111
111
|
};
|
|
@@ -113,30 +113,30 @@ function option(builderOrKey, keyOrValue, valueOrColor, color) {
|
|
|
113
113
|
if (builderOrKey instanceof FormBuilderImpl) {
|
|
114
114
|
const builder = builderOrKey;
|
|
115
115
|
const key = keyOrValue;
|
|
116
|
-
const
|
|
117
|
-
return optionImpl(builder, key,
|
|
116
|
+
const value = valueOrColor;
|
|
117
|
+
return optionImpl(builder, key, value, color);
|
|
118
118
|
} else {
|
|
119
119
|
const key = builderOrKey;
|
|
120
|
-
const
|
|
120
|
+
const value = keyOrValue;
|
|
121
121
|
const color2 = valueOrColor;
|
|
122
|
-
return (builder) => optionImpl(builder, key,
|
|
122
|
+
return (builder) => optionImpl(builder, key, value, color2);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
var nestedOptionImpl = (builder, key,
|
|
126
|
-
if (Option.isSome(
|
|
127
|
-
return nestImpl(builder, key,
|
|
125
|
+
var nestedOptionImpl = (builder, key, value) => {
|
|
126
|
+
if (Option.isSome(value)) {
|
|
127
|
+
return nestImpl(builder, key, value.value);
|
|
128
128
|
}
|
|
129
129
|
return builder;
|
|
130
130
|
};
|
|
131
|
-
function nestedOption(builderOrKey, keyOrValue,
|
|
131
|
+
function nestedOption(builderOrKey, keyOrValue, value) {
|
|
132
132
|
if (builderOrKey instanceof FormBuilderImpl) {
|
|
133
133
|
const builder = builderOrKey;
|
|
134
134
|
const key = keyOrValue;
|
|
135
|
-
return nestedOptionImpl(builder, key,
|
|
135
|
+
return nestedOptionImpl(builder, key, value);
|
|
136
136
|
} else {
|
|
137
137
|
const key = builderOrKey;
|
|
138
|
-
const
|
|
139
|
-
return (builder) => nestedOptionImpl(builder, key,
|
|
138
|
+
const value2 = keyOrValue;
|
|
139
|
+
return (builder) => nestedOptionImpl(builder, key, value2);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
var whenImpl = (builder, condition, ...ops) => {
|
|
@@ -179,18 +179,18 @@ function each(builderOrItems, itemsOrFn, fn3) {
|
|
|
179
179
|
var build = (builder) => {
|
|
180
180
|
const { targetWidth } = calculateDimensions(builder.entries, builder.prefix);
|
|
181
181
|
const entryLines = [];
|
|
182
|
-
builder.entries.forEach(({ key, value
|
|
182
|
+
builder.entries.forEach(({ key, value, isNested }) => {
|
|
183
183
|
const keyLine = buildKeyLine(builder.prefix, key, targetWidth);
|
|
184
184
|
if (isNested) {
|
|
185
185
|
entryLines.push(Doc.hcat([
|
|
186
186
|
keyLine,
|
|
187
187
|
Doc.hardLine,
|
|
188
|
-
|
|
188
|
+
value
|
|
189
189
|
]));
|
|
190
190
|
} else {
|
|
191
191
|
entryLines.push(Doc.hcat([
|
|
192
192
|
keyLine,
|
|
193
|
-
|
|
193
|
+
value
|
|
194
194
|
]));
|
|
195
195
|
}
|
|
196
196
|
});
|
|
@@ -324,13 +324,12 @@ var withTypes = (...types) => Effect2.gen(function* () {
|
|
|
324
324
|
import * as Console from "effect/Console";
|
|
325
325
|
import * as Effect3 from "effect/Effect";
|
|
326
326
|
import * as Layer from "effect/Layer";
|
|
327
|
-
import * as Match from "effect/Match";
|
|
328
327
|
import * as Option2 from "effect/Option";
|
|
329
328
|
import { getPersonalSpace } from "@dxos/app-toolkit";
|
|
330
329
|
import { ClientService as ClientService2 } from "@dxos/client";
|
|
331
|
-
import { Database } from "@dxos/echo";
|
|
330
|
+
import { Database, Feed } from "@dxos/echo";
|
|
331
|
+
import { createFeedServiceLayer } from "@dxos/echo-client";
|
|
332
332
|
import { BaseError } from "@dxos/errors";
|
|
333
|
-
import { QueueService } from "@dxos/functions";
|
|
334
333
|
import { log as log2 } from "@dxos/log";
|
|
335
334
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
336
335
|
import { isBun } from "@dxos/util";
|
|
@@ -352,47 +351,40 @@ var spaceIdWithDefault = (spaceId) => Effect3.gen(function* () {
|
|
|
352
351
|
var spaceLayer = (spaceId$, fallbackToPersonalSpace = false) => {
|
|
353
352
|
const getSpace2 = Effect3.fn(function* () {
|
|
354
353
|
const client = yield* ClientService2;
|
|
355
|
-
const
|
|
356
|
-
|
|
354
|
+
const resolveSpace = () => {
|
|
355
|
+
if (!fallbackToPersonalSpace) {
|
|
356
|
+
return spaceId$.pipe(Option2.flatMap((id) => Option2.fromNullable(client.spaces.get(id))));
|
|
357
|
+
}
|
|
358
|
+
return spaceId$.pipe(Option2.flatMap((id) => Option2.fromNullable(client.spaces.get(id))), Option2.orElse(() => Option2.fromNullable(getPersonalSpace(client))), Option2.orElse(() => Option2.fromNullable(client.spaces.get()[0])));
|
|
359
|
+
};
|
|
360
|
+
const space = resolveSpace().pipe(Option2.getOrUndefined);
|
|
357
361
|
if (space) {
|
|
358
362
|
yield* Effect3.promise(() => space.waitUntilReady());
|
|
359
363
|
}
|
|
360
364
|
return space;
|
|
361
365
|
});
|
|
366
|
+
const NO_DB_STUB = {
|
|
367
|
+
get db() {
|
|
368
|
+
throw new Error("Space not found");
|
|
369
|
+
}
|
|
370
|
+
};
|
|
362
371
|
const db = Layer.scoped(Database.Service, Effect3.acquireRelease(Effect3.gen(function* () {
|
|
363
372
|
const space = yield* getSpace2();
|
|
364
373
|
if (!space) {
|
|
365
|
-
return
|
|
366
|
-
get db() {
|
|
367
|
-
throw new Error("Space not found");
|
|
368
|
-
}
|
|
369
|
-
};
|
|
374
|
+
return NO_DB_STUB;
|
|
370
375
|
}
|
|
371
376
|
return {
|
|
372
377
|
db: space.db
|
|
373
378
|
};
|
|
374
|
-
}), (
|
|
375
|
-
const
|
|
379
|
+
}), (holder) => holder === NO_DB_STUB ? Effect3.void : Effect3.promise(() => holder.db.flush())));
|
|
380
|
+
const feed = Layer.unwrapEffect(Effect3.gen(function* () {
|
|
376
381
|
const space = yield* getSpace2();
|
|
377
382
|
if (!space) {
|
|
378
|
-
return
|
|
379
|
-
queues: {
|
|
380
|
-
get: (_dxn) => {
|
|
381
|
-
throw new Error("Queues not available");
|
|
382
|
-
},
|
|
383
|
-
create: () => {
|
|
384
|
-
throw new Error("Queues not available");
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
queue: void 0
|
|
388
|
-
};
|
|
383
|
+
return Feed.notAvailable;
|
|
389
384
|
}
|
|
390
|
-
return
|
|
391
|
-
queues: space.queues,
|
|
392
|
-
queue: void 0
|
|
393
|
-
};
|
|
385
|
+
return createFeedServiceLayer(space.queues);
|
|
394
386
|
}));
|
|
395
|
-
return Layer.merge(db,
|
|
387
|
+
return Layer.merge(db, feed);
|
|
396
388
|
};
|
|
397
389
|
var waitForSync = Effect3.fn(function* (space) {
|
|
398
390
|
if (!isBun()) {
|
|
@@ -405,12 +397,7 @@ var waitForSync = Effect3.fn(function* (space) {
|
|
|
405
397
|
yield* Effect3.promise(() => space.internal.syncToEdge({
|
|
406
398
|
onProgress: (state) => log2.info("syncing", {
|
|
407
399
|
state: state ?? "no connection to edge"
|
|
408
|
-
}, {
|
|
409
|
-
F: __dxlog_file,
|
|
410
|
-
L: 125,
|
|
411
|
-
S: this,
|
|
412
|
-
C: (f, a) => f(...a)
|
|
413
|
-
})
|
|
400
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 94, S: this })
|
|
414
401
|
}));
|
|
415
402
|
yield* Console.log("Sync complete");
|
|
416
403
|
});
|
|
@@ -432,28 +419,61 @@ var SpaceNotFoundError = class extends BaseError.extend("SpaceNotFoundError", "S
|
|
|
432
419
|
};
|
|
433
420
|
|
|
434
421
|
// src/util/space-format.ts
|
|
422
|
+
import * as Duration from "effect/Duration";
|
|
435
423
|
import * as Effect4 from "effect/Effect";
|
|
436
424
|
import { SpaceState } from "@dxos/client/echo";
|
|
437
|
-
var
|
|
425
|
+
var DEFAULT_OPTIONS = {
|
|
438
426
|
verbose: false,
|
|
439
|
-
truncateKeys: false
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
427
|
+
truncateKeys: false,
|
|
428
|
+
waitSeconds: 0
|
|
429
|
+
};
|
|
430
|
+
var READ_TIMEOUT_SECONDS = 2;
|
|
431
|
+
var tryWithFallback = (label, run, fallback) => Effect4.tryPromise(run).pipe(Effect4.timeoutFail({
|
|
432
|
+
duration: Duration.seconds(READ_TIMEOUT_SECONDS),
|
|
433
|
+
onTimeout: () => new Error(`${label} timed out`)
|
|
434
|
+
}), Effect4.catchAll(() => Effect4.succeed(fallback)));
|
|
435
|
+
var tryWithFallbackSync = (read, fallback) => {
|
|
436
|
+
try {
|
|
437
|
+
return read();
|
|
438
|
+
} catch {
|
|
439
|
+
return fallback;
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
var formatSpace = Effect4.fn(function* (space, options = {}) {
|
|
443
|
+
const { waitSeconds } = {
|
|
444
|
+
...DEFAULT_OPTIONS,
|
|
445
|
+
...options
|
|
446
|
+
};
|
|
447
|
+
if (waitSeconds > 0) {
|
|
448
|
+
yield* Effect4.tryPromise(() => space.waitUntilReady()).pipe(Effect4.timeoutFail({
|
|
449
|
+
duration: Duration.seconds(waitSeconds),
|
|
450
|
+
onTimeout: () => new Error("waitUntilReady timed out")
|
|
451
|
+
}), Effect4.catchAll(() => Effect4.void));
|
|
452
|
+
}
|
|
453
|
+
const state = tryWithFallbackSync(() => space.state.get(), SpaceState.SPACE_INITIALIZING);
|
|
454
|
+
const ready = state === SpaceState.SPACE_READY;
|
|
455
|
+
const metrics = tryWithFallbackSync(() => space.internal.data.metrics, void 0);
|
|
456
|
+
const startup = metrics?.open && metrics?.ready ? metrics.ready.getTime() - metrics.open.getTime() : void 0;
|
|
457
|
+
const pipeline = tryWithFallbackSync(() => space.internal.data.pipeline, void 0);
|
|
445
458
|
const epoch = pipeline?.currentEpoch?.subject.assertion.number;
|
|
446
|
-
const
|
|
459
|
+
const syncStateRaw = yield* tryWithFallback("getSyncState", () => space.internal.db.getSyncState(), {
|
|
460
|
+
peers: {}
|
|
461
|
+
});
|
|
462
|
+
const syncState = aggregateSyncState(syncStateRaw);
|
|
463
|
+
const name = ready ? tryWithFallbackSync(() => space.properties.name, void 0) : "loading...";
|
|
464
|
+
const members = tryWithFallbackSync(() => space.members.get().length, 0);
|
|
465
|
+
const objects = tryWithFallbackSync(() => space.internal.db.getAllObjectIds().length, 0);
|
|
466
|
+
const key = options.truncateKeys ? tryWithFallbackSync(() => space.key.truncate(), "") : tryWithFallbackSync(() => space.key.toHex(), "");
|
|
447
467
|
return {
|
|
448
468
|
id: space.id,
|
|
449
|
-
state: SpaceState[
|
|
450
|
-
name
|
|
451
|
-
members
|
|
452
|
-
objects
|
|
453
|
-
key
|
|
469
|
+
state: SpaceState[state],
|
|
470
|
+
name,
|
|
471
|
+
members,
|
|
472
|
+
objects,
|
|
473
|
+
key,
|
|
454
474
|
epoch,
|
|
455
475
|
startup,
|
|
456
|
-
automergeRoot:
|
|
476
|
+
automergeRoot: pipeline?.spaceRootUrl,
|
|
457
477
|
// appliedEpoch,
|
|
458
478
|
syncState: `${syncState.count} ${getSyncIndicator(syncState.up, syncState.down)} (${syncState.peers} peers)`
|
|
459
479
|
};
|
|
@@ -491,13 +511,13 @@ var printSpace = (spaceData) => make({
|
|
|
491
511
|
|
|
492
512
|
// src/util/timeout.ts
|
|
493
513
|
import * as Config from "effect/Config";
|
|
494
|
-
import * as
|
|
514
|
+
import * as Duration2 from "effect/Duration";
|
|
495
515
|
import * as Effect5 from "effect/Effect";
|
|
496
516
|
import * as Option3 from "effect/Option";
|
|
497
|
-
var withTimeout = Effect5.fnUntraced(function* (
|
|
517
|
+
var withTimeout = Effect5.fnUntraced(function* (effect) {
|
|
498
518
|
const timeout2 = yield* Config.integer("TIMEOUT").pipe(Config.option);
|
|
499
|
-
const duration = timeout2.pipe(Option3.map(
|
|
500
|
-
return yield*
|
|
519
|
+
const duration = timeout2.pipe(Option3.map(Duration2.millis), Option3.getOrElse(() => Duration2.infinity));
|
|
520
|
+
return yield* effect.pipe(Effect5.timeout(duration));
|
|
501
521
|
});
|
|
502
522
|
export {
|
|
503
523
|
CommandConfig,
|