fluncle 0.276.0 → 0.278.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/bin/fluncle.mjs +88 -41
- package/package.json +1 -1
package/bin/fluncle.mjs
CHANGED
|
@@ -62,17 +62,24 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
62
62
|
|
|
63
63
|
// src/output.ts
|
|
64
64
|
import { writeSync } from "node:fs";
|
|
65
|
-
function
|
|
65
|
+
function writeFdSync(fd, text) {
|
|
66
66
|
const buf = Buffer.from(text, "utf8");
|
|
67
67
|
let offset = 0;
|
|
68
68
|
while (offset < buf.length) {
|
|
69
69
|
try {
|
|
70
|
-
offset += writeSync(
|
|
70
|
+
offset += writeSync(fd, buf, offset);
|
|
71
71
|
} catch (error) {
|
|
72
|
-
|
|
72
|
+
const code = error.code;
|
|
73
|
+
if (code === "EAGAIN") {
|
|
74
|
+
if (stopWaitingForReader()) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
Atomics.wait(EAGAIN_WAIT, 0, 0, 1);
|
|
74
78
|
continue;
|
|
75
79
|
}
|
|
80
|
+
if (code === "EPIPE") {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
76
83
|
throw error;
|
|
77
84
|
}
|
|
78
85
|
}
|
|
@@ -81,10 +88,10 @@ function isJsonFailure(value) {
|
|
|
81
88
|
return typeof value === "object" && value !== null && typeof value.code === "string" && typeof value.message === "string";
|
|
82
89
|
}
|
|
83
90
|
function printJson(value) {
|
|
84
|
-
|
|
91
|
+
writeFdSync(1, JSON.stringify(value, null, 2) + `
|
|
85
92
|
`);
|
|
86
93
|
}
|
|
87
|
-
var EAGAIN_WAIT, CliError;
|
|
94
|
+
var EAGAIN_WAIT, stopWaitingForReader = () => false, CliError;
|
|
88
95
|
var init_output = __esm(() => {
|
|
89
96
|
EAGAIN_WAIT = new Int32Array(new SharedArrayBuffer(4));
|
|
90
97
|
CliError = class CliError extends Error {
|
|
@@ -417,7 +424,7 @@ var require_main = __commonJS(function(exports, module) {
|
|
|
417
424
|
});
|
|
418
425
|
|
|
419
426
|
// src/deadline.ts
|
|
420
|
-
function
|
|
427
|
+
function fireDeadlineNow2() {
|
|
421
428
|
state2.fire?.();
|
|
422
429
|
}
|
|
423
430
|
function deadlineAt() {
|
|
@@ -426,17 +433,17 @@ function deadlineAt() {
|
|
|
426
433
|
function deadlineSignal() {
|
|
427
434
|
return state2.controller.signal;
|
|
428
435
|
}
|
|
429
|
-
function
|
|
436
|
+
function remainingDeadlineMs2(now = Date.now) {
|
|
430
437
|
return state2.at === null ? null : state2.at - now();
|
|
431
438
|
}
|
|
432
439
|
function assertBeforeDeadline(doing) {
|
|
433
|
-
const remaining =
|
|
440
|
+
const remaining = remainingDeadlineMs2();
|
|
434
441
|
if (remaining !== null && remaining <= 0) {
|
|
435
|
-
|
|
442
|
+
fireDeadlineNow2();
|
|
436
443
|
throw new CliError("timeout", `the deadline passed while ${doing}`);
|
|
437
444
|
}
|
|
438
445
|
}
|
|
439
|
-
function
|
|
446
|
+
function noteProgress2(note) {
|
|
440
447
|
state2.note = note;
|
|
441
448
|
}
|
|
442
449
|
var state2;
|
|
@@ -496,7 +503,7 @@ function resolveTokenRef() {
|
|
|
496
503
|
return;
|
|
497
504
|
}
|
|
498
505
|
assertBeforeDeadline("reading FLUNCLE_API_TOKEN_REF with op");
|
|
499
|
-
const remaining =
|
|
506
|
+
const remaining = remainingDeadlineMs2();
|
|
500
507
|
const timeout = remaining === null ? OP_READ_TIMEOUT_MS : Math.max(1, Math.min(OP_READ_TIMEOUT_MS, remaining));
|
|
501
508
|
try {
|
|
502
509
|
const secretRef = ref.startsWith("op://") ? ref : `op://${ref}`;
|
|
@@ -695,7 +702,7 @@ function parseVersion(version) {
|
|
|
695
702
|
var currentVersion;
|
|
696
703
|
var init_version = __esm(() => {
|
|
697
704
|
init_output();
|
|
698
|
-
currentVersion = "0.
|
|
705
|
+
currentVersion = "0.278.0".trim() ? "0.278.0".trim() : "0.1.0";
|
|
699
706
|
});
|
|
700
707
|
|
|
701
708
|
// src/update-notifier.ts
|
|
@@ -1376,7 +1383,7 @@ var init_Redactable = __esm(() => {
|
|
|
1376
1383
|
});
|
|
1377
1384
|
|
|
1378
1385
|
// ../../node_modules/effect/dist/Formatter.js
|
|
1379
|
-
function
|
|
1386
|
+
function format2(input, options) {
|
|
1380
1387
|
const space = options?.space ?? 0;
|
|
1381
1388
|
const ancestors = new WeakSet;
|
|
1382
1389
|
const gap = !space ? "" : typeof space === "number" ? " ".repeat(space) : space;
|
|
@@ -1505,7 +1512,7 @@ var init_Inspectable = __esm(() => {
|
|
|
1505
1512
|
return this.toJSON();
|
|
1506
1513
|
},
|
|
1507
1514
|
toString() {
|
|
1508
|
-
return
|
|
1515
|
+
return format2(this.toJSON());
|
|
1509
1516
|
}
|
|
1510
1517
|
};
|
|
1511
1518
|
});
|
|
@@ -1604,7 +1611,7 @@ var EffectTypeId = `~effect/Effect`, ExitTypeId = `~effect/Exit`, effectVariance
|
|
|
1604
1611
|
},
|
|
1605
1612
|
...makePrimitiveProto(options),
|
|
1606
1613
|
toString() {
|
|
1607
|
-
return `${options.op}(${
|
|
1614
|
+
return `${options.op}(${format2(this[args])})`;
|
|
1608
1615
|
},
|
|
1609
1616
|
toJSON() {
|
|
1610
1617
|
return {
|
|
@@ -1678,7 +1685,7 @@ var init_core = __esm(() => {
|
|
|
1678
1685
|
};
|
|
1679
1686
|
},
|
|
1680
1687
|
toString() {
|
|
1681
|
-
return
|
|
1688
|
+
return format2(this.toJSON(), {
|
|
1682
1689
|
ignoreToString: true,
|
|
1683
1690
|
space: 2
|
|
1684
1691
|
});
|
|
@@ -1735,7 +1742,7 @@ var init_core = __esm(() => {
|
|
|
1735
1742
|
};
|
|
1736
1743
|
}
|
|
1737
1744
|
toString() {
|
|
1738
|
-
return `Cause(${
|
|
1745
|
+
return `Cause(${format2(this.reasons)})`;
|
|
1739
1746
|
}
|
|
1740
1747
|
[NodeInspectSymbol]() {
|
|
1741
1748
|
return this.toJSON();
|
|
@@ -1781,7 +1788,7 @@ var init_core = __esm(() => {
|
|
|
1781
1788
|
return pipeArguments(this, arguments);
|
|
1782
1789
|
}
|
|
1783
1790
|
toString() {
|
|
1784
|
-
return
|
|
1791
|
+
return format2(this);
|
|
1785
1792
|
}
|
|
1786
1793
|
[NodeInspectSymbol]() {
|
|
1787
1794
|
return this.toString();
|
|
@@ -1794,7 +1801,7 @@ var init_core = __esm(() => {
|
|
|
1794
1801
|
this.error = error;
|
|
1795
1802
|
}
|
|
1796
1803
|
toString() {
|
|
1797
|
-
return `Fail(${
|
|
1804
|
+
return `Fail(${format2(this.error)})`;
|
|
1798
1805
|
}
|
|
1799
1806
|
toJSON() {
|
|
1800
1807
|
return {
|
|
@@ -1815,7 +1822,7 @@ var init_core = __esm(() => {
|
|
|
1815
1822
|
this.defect = defect;
|
|
1816
1823
|
}
|
|
1817
1824
|
toString() {
|
|
1818
|
-
return `Die(${
|
|
1825
|
+
return `Die(${format2(this.defect)})`;
|
|
1819
1826
|
}
|
|
1820
1827
|
toJSON() {
|
|
1821
1828
|
return {
|
|
@@ -1982,7 +1989,7 @@ var init_option = __esm(() => {
|
|
|
1982
1989
|
return combine(hash(this._tag))(hash(this.value));
|
|
1983
1990
|
},
|
|
1984
1991
|
toString() {
|
|
1985
|
-
return `some(${
|
|
1992
|
+
return `some(${format2(this.value)})`;
|
|
1986
1993
|
},
|
|
1987
1994
|
toJSON() {
|
|
1988
1995
|
return {
|
|
@@ -2055,7 +2062,7 @@ var init_result = __esm(() => {
|
|
|
2055
2062
|
return combine(hash(this._tag))(hash(this.success));
|
|
2056
2063
|
},
|
|
2057
2064
|
toString() {
|
|
2058
|
-
return `success(${
|
|
2065
|
+
return `success(${format2(this.success)})`;
|
|
2059
2066
|
},
|
|
2060
2067
|
toJSON() {
|
|
2061
2068
|
return {
|
|
@@ -2075,7 +2082,7 @@ var init_result = __esm(() => {
|
|
|
2075
2082
|
return combine(hash(this._tag))(hash(this.failure));
|
|
2076
2083
|
},
|
|
2077
2084
|
toString() {
|
|
2078
|
-
return `failure(${
|
|
2085
|
+
return `failure(${format2(this.failure)})`;
|
|
2079
2086
|
},
|
|
2080
2087
|
toJSON() {
|
|
2081
2088
|
return {
|
|
@@ -4252,7 +4259,7 @@ var init_Cron = __esm(() => {
|
|
|
4252
4259
|
return toPojo(this);
|
|
4253
4260
|
},
|
|
4254
4261
|
toString() {
|
|
4255
|
-
return `Cron(${
|
|
4262
|
+
return `Cron(${format2(toPojo(this))})`;
|
|
4256
4263
|
},
|
|
4257
4264
|
toJSON() {
|
|
4258
4265
|
const out = toPojo(this);
|
|
@@ -4562,7 +4569,7 @@ var TypeId11 = "~effect/BigDecimal", BigDecimalProto, isBigDecimal = (u) => hasP
|
|
|
4562
4569
|
}
|
|
4563
4570
|
const powerOfTen = comparisonPowersOfTen[absoluteScaleDifference] ??= bigint102 ** BigInt(absoluteScaleDifference);
|
|
4564
4571
|
return scaleDifference > 0 ? compareBigInt(self.value, that.value * powerOfTen) : compareBigInt(self.value * powerOfTen, that.value);
|
|
4565
|
-
}, sign = (n) => n.value === bigint02 ? 0 : n.value < bigint02 ? -1 : 1,
|
|
4572
|
+
}, sign = (n) => n.value === bigint02 ? 0 : n.value < bigint02 ? -1 : 1, format4 = (n) => {
|
|
4566
4573
|
const normalized = normalize(n);
|
|
4567
4574
|
if (Math.abs(normalized.scale) >= 16) {
|
|
4568
4575
|
return toExponential(normalized);
|
|
@@ -4602,7 +4609,7 @@ var init_BigDecimal = __esm(() => {
|
|
|
4602
4609
|
return isBigDecimal(that) && compare(this, that) === 0;
|
|
4603
4610
|
},
|
|
4604
4611
|
toString() {
|
|
4605
|
-
return `BigDecimal(${
|
|
4612
|
+
return `BigDecimal(${format4(this)})`;
|
|
4606
4613
|
},
|
|
4607
4614
|
toJSON() {
|
|
4608
4615
|
return {
|
|
@@ -4835,7 +4842,7 @@ var init_Chunk = __esm(() => {
|
|
|
4835
4842
|
_A: (_) => _
|
|
4836
4843
|
},
|
|
4837
4844
|
toString() {
|
|
4838
|
-
return `Chunk(${
|
|
4845
|
+
return `Chunk(${format2(toReadonlyArray(this))})`;
|
|
4839
4846
|
},
|
|
4840
4847
|
toJSON() {
|
|
4841
4848
|
return {
|
|
@@ -6273,7 +6280,7 @@ var init_SchemaAST = __esm(() => {
|
|
|
6273
6280
|
constructor(literal, annotations, checks, encoding, context) {
|
|
6274
6281
|
super(annotations, checks, encoding, context);
|
|
6275
6282
|
if (typeof literal === "number" && !globalThis.Number.isFinite(literal)) {
|
|
6276
|
-
throw new Error(`A numeric literal must be finite, got ${
|
|
6283
|
+
throw new Error(`A numeric literal must be finite, got ${format2(literal)}`);
|
|
6277
6284
|
}
|
|
6278
6285
|
this.literal = literal;
|
|
6279
6286
|
}
|
|
@@ -7650,7 +7657,7 @@ function isPattern2(regExp, annotations) {
|
|
|
7650
7657
|
const source = regExp.source;
|
|
7651
7658
|
const flags = regExp.flags;
|
|
7652
7659
|
const canExport = /^[dg]*uy?$/.test(flags);
|
|
7653
|
-
const runtimeRegExp = flags === "" ? `new RegExp(${
|
|
7660
|
+
const runtimeRegExp = flags === "" ? `new RegExp(${format2(source)})` : `new RegExp(${format2(source)}, ${format2(flags)})`;
|
|
7654
7661
|
return isPattern(regExp, {
|
|
7655
7662
|
toJsonSchema: () => canExport ? {
|
|
7656
7663
|
pattern: flags.endsWith("y") ? `^(?:${source})` : source
|
|
@@ -7969,7 +7976,7 @@ var init_MutableHashMap = __esm(() => {
|
|
|
7969
7976
|
return this.backing[Symbol.iterator]();
|
|
7970
7977
|
},
|
|
7971
7978
|
toString() {
|
|
7972
|
-
return `MutableHashMap(${
|
|
7979
|
+
return `MutableHashMap(${format2(Array.from(this))})`;
|
|
7973
7980
|
},
|
|
7974
7981
|
toJSON() {
|
|
7975
7982
|
return {
|
|
@@ -8879,7 +8886,7 @@ var init_MutableHashSet = __esm(() => {
|
|
|
8879
8886
|
return Array.from(this.keyMap).map(([_]) => _)[Symbol.iterator]();
|
|
8880
8887
|
},
|
|
8881
8888
|
toString() {
|
|
8882
|
-
return `MutableHashSet(${
|
|
8889
|
+
return `MutableHashSet(${format2(Array.from(this))})`;
|
|
8883
8890
|
},
|
|
8884
8891
|
toJSON() {
|
|
8885
8892
|
return {
|
|
@@ -9206,7 +9213,7 @@ var init_TxChunk = __esm(() => {
|
|
|
9206
9213
|
return this.toJSON();
|
|
9207
9214
|
},
|
|
9208
9215
|
toString() {
|
|
9209
|
-
return `TxChunk(${
|
|
9216
|
+
return `TxChunk(${format2(toJson(this.ref))})`;
|
|
9210
9217
|
},
|
|
9211
9218
|
toJSON() {
|
|
9212
9219
|
return {
|
|
@@ -9252,7 +9259,7 @@ var init_TxHashMap = __esm(() => {
|
|
|
9252
9259
|
return toJson(this);
|
|
9253
9260
|
},
|
|
9254
9261
|
toString() {
|
|
9255
|
-
return `TxHashMap(${
|
|
9262
|
+
return `TxHashMap(${format2(toJson(this.ref))})`;
|
|
9256
9263
|
},
|
|
9257
9264
|
toJSON() {
|
|
9258
9265
|
return {
|
|
@@ -9278,7 +9285,7 @@ var init_TxHashSet = __esm(() => {
|
|
|
9278
9285
|
return toJson(this);
|
|
9279
9286
|
},
|
|
9280
9287
|
toString() {
|
|
9281
|
-
return `TxHashSet(${
|
|
9288
|
+
return `TxHashSet(${format2(toJson(this.ref))})`;
|
|
9282
9289
|
},
|
|
9283
9290
|
toJSON() {
|
|
9284
9291
|
return {
|
|
@@ -9716,7 +9723,7 @@ function adminHeaders() {
|
|
|
9716
9723
|
}
|
|
9717
9724
|
async function apiRequest(path, init = {}) {
|
|
9718
9725
|
const url = `${getApiBaseUrl()}${path}`;
|
|
9719
|
-
|
|
9726
|
+
noteProgress2(`waiting for the Fluncle API: ${init.method ?? "GET"} ${path}`);
|
|
9720
9727
|
return runPromise2(gen2(function* () {
|
|
9721
9728
|
const { response, text } = yield* tryPromise2({
|
|
9722
9729
|
catch: (cause) => new ApiTransportError({ cause }),
|
|
@@ -11135,7 +11142,7 @@ function parseVersion2(version) {
|
|
|
11135
11142
|
var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
|
|
11136
11143
|
var init_version2 = __esm(() => {
|
|
11137
11144
|
init_output();
|
|
11138
|
-
currentVersion2 = "0.
|
|
11145
|
+
currentVersion2 = "0.278.0".trim() ? "0.278.0".trim() : "0.1.0";
|
|
11139
11146
|
});
|
|
11140
11147
|
|
|
11141
11148
|
// ../../packages/registry/src/index.ts
|
|
@@ -30567,7 +30574,7 @@ function createEvidenceHttp(overrides = {}) {
|
|
|
30567
30574
|
fetch: (url, init) => globalThis.fetch(url, init),
|
|
30568
30575
|
now: () => Date.now(),
|
|
30569
30576
|
policies: SOURCE_POLICIES,
|
|
30570
|
-
progress:
|
|
30577
|
+
progress: noteProgress2,
|
|
30571
30578
|
random: Math.random,
|
|
30572
30579
|
refresh: false,
|
|
30573
30580
|
sleep: (ms) => runPromise2(sleep2(ms)),
|
|
@@ -33884,9 +33891,27 @@ function disarmDeadline() {
|
|
|
33884
33891
|
state.cancel?.();
|
|
33885
33892
|
state.cancel = null;
|
|
33886
33893
|
}
|
|
33894
|
+
function fireDeadlineNow() {
|
|
33895
|
+
state.fire?.();
|
|
33896
|
+
}
|
|
33887
33897
|
function deadlineFired() {
|
|
33888
33898
|
return state.fired;
|
|
33889
33899
|
}
|
|
33900
|
+
function remainingDeadlineMs(now = Date.now) {
|
|
33901
|
+
return state.at === null ? null : state.at - now();
|
|
33902
|
+
}
|
|
33903
|
+
function fireIfPastDeadline(waitingOn) {
|
|
33904
|
+
const remaining = remainingDeadlineMs();
|
|
33905
|
+
if (remaining === null || remaining > 0) {
|
|
33906
|
+
return false;
|
|
33907
|
+
}
|
|
33908
|
+
noteProgress(waitingOn);
|
|
33909
|
+
fireDeadlineNow();
|
|
33910
|
+
return true;
|
|
33911
|
+
}
|
|
33912
|
+
function noteProgress(note) {
|
|
33913
|
+
state.note = note;
|
|
33914
|
+
}
|
|
33890
33915
|
|
|
33891
33916
|
// src/env.ts
|
|
33892
33917
|
var import_dotenv = __toESM(require_main(), 1);
|
|
@@ -33965,22 +33990,43 @@ async function maybePrintLiveCallout(args) {
|
|
|
33965
33990
|
|
|
33966
33991
|
// src/output.ts
|
|
33967
33992
|
import { writeSync as writeSync2 } from "node:fs";
|
|
33993
|
+
import { format } from "node:util";
|
|
33968
33994
|
var EAGAIN_WAIT2 = new Int32Array(new SharedArrayBuffer(4));
|
|
33969
|
-
|
|
33995
|
+
var stopWaitingForReader2 = () => false;
|
|
33996
|
+
function writeFdSync2(fd, text) {
|
|
33970
33997
|
const buf = Buffer.from(text, "utf8");
|
|
33971
33998
|
let offset = 0;
|
|
33972
33999
|
while (offset < buf.length) {
|
|
33973
34000
|
try {
|
|
33974
|
-
offset += writeSync2(
|
|
34001
|
+
offset += writeSync2(fd, buf, offset);
|
|
33975
34002
|
} catch (error) {
|
|
33976
|
-
|
|
34003
|
+
const code = error.code;
|
|
34004
|
+
if (code === "EAGAIN") {
|
|
34005
|
+
if (stopWaitingForReader2()) {
|
|
34006
|
+
return;
|
|
34007
|
+
}
|
|
33977
34008
|
Atomics.wait(EAGAIN_WAIT2, 0, 0, 1);
|
|
33978
34009
|
continue;
|
|
33979
34010
|
}
|
|
34011
|
+
if (code === "EPIPE") {
|
|
34012
|
+
return;
|
|
34013
|
+
}
|
|
33980
34014
|
throw error;
|
|
33981
34015
|
}
|
|
33982
34016
|
}
|
|
33983
34017
|
}
|
|
34018
|
+
function routeConsoleThroughBlockingWrites(pastDeadline) {
|
|
34019
|
+
stopWaitingForReader2 = pastDeadline;
|
|
34020
|
+
const toStdout = (...args) => writeFdSync2(1, `${format(...args)}
|
|
34021
|
+
`);
|
|
34022
|
+
const toStderr = (...args) => writeFdSync2(2, `${format(...args)}
|
|
34023
|
+
`);
|
|
34024
|
+
console.debug = toStdout;
|
|
34025
|
+
console.error = toStderr;
|
|
34026
|
+
console.info = toStdout;
|
|
34027
|
+
console.log = toStdout;
|
|
34028
|
+
console.warn = toStderr;
|
|
34029
|
+
}
|
|
33984
34030
|
class CliError2 extends Error {
|
|
33985
34031
|
code;
|
|
33986
34032
|
constructor(code, message) {
|
|
@@ -33990,7 +34036,7 @@ class CliError2 extends Error {
|
|
|
33990
34036
|
}
|
|
33991
34037
|
}
|
|
33992
34038
|
function printJson2(value) {
|
|
33993
|
-
|
|
34039
|
+
writeFdSync2(1, JSON.stringify(value, null, 2) + `
|
|
33994
34040
|
`);
|
|
33995
34041
|
}
|
|
33996
34042
|
function toJsonFailure(error) {
|
|
@@ -34099,6 +34145,7 @@ ${fluncleAsciiLogo}
|
|
|
34099
34145
|
return program;
|
|
34100
34146
|
}
|
|
34101
34147
|
async function main(args = process.argv.slice(2)) {
|
|
34148
|
+
routeConsoleThroughBlockingWrites(() => fireIfPastDeadline("waiting for the stdout reader to take the output"));
|
|
34102
34149
|
const program = createProgram();
|
|
34103
34150
|
if (args.length === 0) {
|
|
34104
34151
|
program.outputHelp();
|
package/package.json
CHANGED