@ghostlytools/cli 1.3.9 → 1.3.10
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/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/{host-DPy0eaH9.js → host-BbDWamRc.js} +106 -7
- package/dist/assets/host-BbDWamRc.js.map +1 -0
- package/dist/assets/{main-Dt7xrqtb.js → main-_q4Fgypp.js} +3 -3
- package/dist/assets/main-_q4Fgypp.js.map +1 -0
- package/dist/assets/{server-p5DJnN7T.js → server-C-EkLCCt.js} +30 -13
- package/dist/assets/server-C-EkLCCt.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/host-DPy0eaH9.js.map +0 -1
- package/dist/assets/main-Dt7xrqtb.js.map +0 -1
- package/dist/assets/server-p5DJnN7T.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bark_ffi_wasm_bg-EY2uc0Bx.js","names":["import.meta.
|
|
1
|
+
{"version":3,"file":"bark_ffi_wasm_bg-EY2uc0Bx.js","names":["import.meta.ROLLDOWN_FILE_URL_FKNdLzKnlftW3t_gzo81yw"],"sources":["../../../../node_modules/@secondts/bark/web/bark_ffi_wasm_bg.wasm?url"],"sourcesContent":["export default import.meta.ROLLDOWN_FILE_URL_FKNdLzKnlftW3t_gzo81yw"],"ignoreList":[0],"mappings":";AAAA,IAAA,2BAAe,IAAA,IAAA,oCAAA,YAAA,GAAmD,CAAA,CAAnDA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoindevkit_bg-B-iLWrmX.js","names":["import.meta.
|
|
1
|
+
{"version":3,"file":"bitcoindevkit_bg-B-iLWrmX.js","names":["import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w"],"sources":["../../../../node_modules/@bitcoindevkit/bdk-wallet-web/bitcoindevkit_bg.wasm?url"],"sourcesContent":["export default import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w"],"ignoreList":[0],"mappings":";AAAA,IAAA,2BAAe,IAAA,IAAA,oCAAA,YAAA,GAAmD,CAAA,CAAnDA"}
|
|
@@ -3397,6 +3397,7 @@ async function openPersistentIndexedDb(dir, options = {}) {
|
|
|
3397
3397
|
const classes = await probeClasses(factory);
|
|
3398
3398
|
dropIndexEntriesByRecord(classes, (a, b) => factory.cmp(a, b));
|
|
3399
3399
|
readWithoutCopy(classes);
|
|
3400
|
+
startInOnePass(classes);
|
|
3400
3401
|
const order = keyOrder((a, b) => factory.cmp(a, b));
|
|
3401
3402
|
const rowsPath = join(dir, ROWS);
|
|
3402
3403
|
const rowsFound = existsSync(rowsPath);
|
|
@@ -3568,11 +3569,7 @@ async function openPersistentIndexedDb(dir, options = {}) {
|
|
|
3568
3569
|
trees?.abort(this._rollbackLog);
|
|
3569
3570
|
}
|
|
3570
3571
|
const dispatched = dispatch.call(this, event);
|
|
3571
|
-
if ((event.type === "complete" || event.type === "abort") && this._state === "finished")
|
|
3572
|
-
const list = this.db._rawDatabase.transactions;
|
|
3573
|
-
const at = list.indexOf(this);
|
|
3574
|
-
if (at >= 0) list.splice(at, 1);
|
|
3575
|
-
}
|
|
3572
|
+
if ((event.type === "complete" || event.type === "abort") && this._state === "finished") dropEnded(this.db._rawDatabase, this);
|
|
3576
3573
|
return dispatched;
|
|
3577
3574
|
};
|
|
3578
3575
|
const deleteDatabase = factory.deleteDatabase.bind(factory);
|
|
@@ -3918,6 +3915,7 @@ async function probeClasses(factory) {
|
|
|
3918
3915
|
ObjectStore: rawStore.constructor,
|
|
3919
3916
|
Index: rawStore.rawIndexes.get("i").constructor,
|
|
3920
3917
|
RecordStore: rawStore.records.constructor,
|
|
3918
|
+
Connection: db.constructor,
|
|
3921
3919
|
constraintError: Error
|
|
3922
3920
|
};
|
|
3923
3921
|
const probe = new classes.RecordStore(true);
|
|
@@ -4029,6 +4027,107 @@ function readWithoutCopy(classes) {
|
|
|
4029
4027
|
return values;
|
|
4030
4028
|
};
|
|
4031
4029
|
}
|
|
4030
|
+
/** Transactions whose last event is out, by database, and dropped from its list at the next turn: all at once. */
|
|
4031
|
+
var ended = /* @__PURE__ */ new WeakMap();
|
|
4032
|
+
/** A finished transaction's place in its database's list, given back: one walk of the list for all that ended in a turn. */
|
|
4033
|
+
function dropEnded(db, transaction) {
|
|
4034
|
+
let gone = ended.get(db);
|
|
4035
|
+
if (gone) {
|
|
4036
|
+
gone.add(transaction);
|
|
4037
|
+
return;
|
|
4038
|
+
}
|
|
4039
|
+
ended.set(db, gone = /* @__PURE__ */ new Set([transaction]));
|
|
4040
|
+
setImmediate(() => {
|
|
4041
|
+
ended.delete(db);
|
|
4042
|
+
const list = db.transactions;
|
|
4043
|
+
let kept = 0;
|
|
4044
|
+
for (const held of list) if (!gone.has(held)) list[kept++] = held;
|
|
4045
|
+
list.length = kept;
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
/** The classes whose scheduler starts every transaction it can in one pass: shared by every store opened. */
|
|
4049
|
+
var onePass = /* @__PURE__ */ new WeakSet();
|
|
4050
|
+
/**
|
|
4051
|
+
* fake-indexeddb's scheduler runs at every transaction's start and end, checks each waiting transaction against every
|
|
4052
|
+
* running one and every one waiting before it, and starts one per pass; and each transaction made looks through every
|
|
4053
|
+
* other one for an upgrade running. A burst of reads (a look at each queued text) cost the square of their number, the
|
|
4054
|
+
* cube with a write waiting among them, and held the event loop all along (2,000 reads around a write: 19 s).
|
|
4055
|
+
*
|
|
4056
|
+
* A pass here walks the transactions once, in order, and starts each one that may run: a write once no running
|
|
4057
|
+
* transaction shares a store with it, a read once no running write does, neither behind a waiting one that shares a
|
|
4058
|
+
* store with it (the order IndexedDB keeps). The passes asked for before one runs are that one, and a transaction's end
|
|
4059
|
+
* asks for none while nothing waits. A transaction made while no upgrade of its database runs skips the look for one.
|
|
4060
|
+
* Databases made before this (the probe's) keep fake-indexeddb's scheduler: each binds the one it is made with.
|
|
4061
|
+
*/
|
|
4062
|
+
function startInOnePass(classes) {
|
|
4063
|
+
const proto = classes.Database.prototype;
|
|
4064
|
+
if (onePass.has(proto)) return;
|
|
4065
|
+
onePass.add(proto);
|
|
4066
|
+
const scheduling = /* @__PURE__ */ new WeakMap();
|
|
4067
|
+
proto.processTransactions = function(event) {
|
|
4068
|
+
let state = scheduling.get(this);
|
|
4069
|
+
if (!state) scheduling.set(this, state = {
|
|
4070
|
+
asked: false,
|
|
4071
|
+
blocked: 0
|
|
4072
|
+
});
|
|
4073
|
+
if (state.asked || event !== void 0 && !state.blocked) return;
|
|
4074
|
+
state.asked = true;
|
|
4075
|
+
setImmediate(() => {
|
|
4076
|
+
state.asked = false;
|
|
4077
|
+
startRunnable(this, state);
|
|
4078
|
+
});
|
|
4079
|
+
};
|
|
4080
|
+
const connection = classes.Connection.prototype;
|
|
4081
|
+
const { transaction } = connection;
|
|
4082
|
+
const upgrades = /* @__PURE__ */ new WeakMap();
|
|
4083
|
+
connection.transaction = function(names, mode, options) {
|
|
4084
|
+
const raw = this._rawDatabase;
|
|
4085
|
+
if (mode === "versionchange") {
|
|
4086
|
+
const made = transaction.call(this, names, mode, options);
|
|
4087
|
+
upgrades.set(raw, (upgrades.get(raw) ?? 0) + 1);
|
|
4088
|
+
const done = () => {
|
|
4089
|
+
upgrades.set(raw, upgrades.get(raw) - 1);
|
|
4090
|
+
};
|
|
4091
|
+
made.addEventListener("complete", done);
|
|
4092
|
+
made.addEventListener("abort", done);
|
|
4093
|
+
return made;
|
|
4094
|
+
}
|
|
4095
|
+
if (upgrades.get(raw)) return transaction.call(this, names, mode, options);
|
|
4096
|
+
const list = raw.transactions;
|
|
4097
|
+
raw.transactions = [];
|
|
4098
|
+
try {
|
|
4099
|
+
return transaction.call(this, names, mode, options);
|
|
4100
|
+
} finally {
|
|
4101
|
+
list.push(...raw.transactions);
|
|
4102
|
+
raw.transactions = list;
|
|
4103
|
+
}
|
|
4104
|
+
};
|
|
4105
|
+
}
|
|
4106
|
+
function startRunnable(db, state) {
|
|
4107
|
+
state.blocked = 0;
|
|
4108
|
+
const writing = /* @__PURE__ */ new Set(), reading = /* @__PURE__ */ new Set(), blocked = /* @__PURE__ */ new Set();
|
|
4109
|
+
const holds = (scope, stores) => {
|
|
4110
|
+
for (const store of scope) if (stores.has(store)) return true;
|
|
4111
|
+
return false;
|
|
4112
|
+
};
|
|
4113
|
+
const take = (transaction) => {
|
|
4114
|
+
for (const store of transaction._scope) (transaction.mode === "readonly" ? reading : writing).add(store);
|
|
4115
|
+
};
|
|
4116
|
+
const list = db.transactions.filter((transaction) => transaction._state !== "finished");
|
|
4117
|
+
for (const transaction of list) if (transaction._started) take(transaction);
|
|
4118
|
+
for (const transaction of list) {
|
|
4119
|
+
if (transaction._started || transaction._state === "finished") continue;
|
|
4120
|
+
if (!(!holds(transaction._scope, blocked) && !holds(transaction._scope, writing) && (transaction.mode === "readonly" || !holds(transaction._scope, reading)))) {
|
|
4121
|
+
for (const store of transaction._scope) blocked.add(store);
|
|
4122
|
+
state.blocked++;
|
|
4123
|
+
continue;
|
|
4124
|
+
}
|
|
4125
|
+
take(transaction);
|
|
4126
|
+
transaction.addEventListener("complete", db.processTransactions);
|
|
4127
|
+
transaction.addEventListener("abort", db.processTransactions);
|
|
4128
|
+
transaction._start();
|
|
4129
|
+
}
|
|
4130
|
+
}
|
|
4032
4131
|
/** Drops from an index the entries of records that left its store, and gives back the ones it dropped. */
|
|
4033
4132
|
function dropEntries(index, records, cmp) {
|
|
4034
4133
|
const dropped = [];
|
|
@@ -4601,7 +4700,7 @@ async function startRuntime(paths, options = {}) {
|
|
|
4601
4700
|
(await import("./ghostly_iroh_web-BsAEFIjl.js")).initSync({ module: irohWasmBytes() });
|
|
4602
4701
|
const [{ registerFileBytes }, { NodeFileBytes }] = await Promise.all([import("./fileBytes-CgbibpbV.js"), import("./fileBytes-CfSXjTFa.js")]);
|
|
4603
4702
|
registerFileBytes("native", async () => new NodeFileBytes(paths.files), true);
|
|
4604
|
-
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./server-
|
|
4703
|
+
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./server-C-EkLCCt.js"), import("./endpoint-BOTFMpfS.js")]);
|
|
4605
4704
|
const network = hyperdhtNetwork();
|
|
4606
4705
|
const dht = mainlineNetwork();
|
|
4607
4706
|
const mainline = dht.off ? null : new (await (import("./mainline-Cld-bKeC.js"))).Mainline({
|
|
@@ -4945,4 +5044,4 @@ function connection(ctx, socket, secret) {
|
|
|
4945
5044
|
//#endregion
|
|
4946
5045
|
export { BASELINE_NEWEST, MAX_LINE, MAX_UNREAD, keepServing, openHost, serve };
|
|
4947
5046
|
|
|
4948
|
-
//# sourceMappingURL=host-
|
|
5047
|
+
//# sourceMappingURL=host-BbDWamRc.js.map
|