@ghostlytools/cli 1.3.8 → 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.
Files changed (58) hide show
  1. package/dist/assets/{api-Q6QZ0oIy.js → api-BCrwJ57L.js} +9 -9
  2. package/dist/assets/{api-Q6QZ0oIy.js.map → api-BCrwJ57L.js.map} +1 -1
  3. package/dist/assets/{api-CYG-sByy.js → api-Cp9GxjUO.js} +2 -2
  4. package/dist/assets/{apiKit-C9lLXQwt.js → apiKit-B4qhnLQT.js} +2 -2
  5. package/dist/assets/{apiKit-C9lLXQwt.js.map → apiKit-B4qhnLQT.js.map} +1 -1
  6. package/dist/assets/{apps-Bs8xpLGv.js → apps-CpxENMgl.js} +1 -1
  7. package/dist/assets/{apps-tcynvhlC.js → apps-DOH1P_S0.js} +2 -2
  8. package/dist/assets/{apps-tcynvhlC.js.map → apps-DOH1P_S0.js.map} +1 -1
  9. package/dist/assets/{arkade-BgmB0fUk.js → arkade-Cyf5MGxG.js} +2 -2
  10. package/dist/assets/{arkade-BgmB0fUk.js.map → arkade-Cyf5MGxG.js.map} +1 -1
  11. package/dist/assets/{backup-XtMACsQ0.js → backup-CTpFFQ-4.js} +4 -4
  12. package/dist/assets/{backup-XtMACsQ0.js.map → backup-CTpFFQ-4.js.map} +1 -1
  13. package/dist/assets/{backup-OlEHNkqQ.js → backup-CqM-0-2v.js} +1 -1
  14. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
  15. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
  16. package/dist/assets/{buttons-mdl2Gol2.js → buttons-BtxwyM2l.js} +3 -3
  17. package/dist/assets/{buttons-mdl2Gol2.js.map → buttons-BtxwyM2l.js.map} +1 -1
  18. package/dist/assets/buttons-CJqNkG-Q.js +2 -0
  19. package/dist/assets/{envelope-DHf3mrHv.js → envelope-DW8TWKPD.js} +2 -2
  20. package/dist/assets/{envelope-DHf3mrHv.js.map → envelope-DW8TWKPD.js.map} +1 -1
  21. package/dist/assets/{groupFiles-CqrujNN1.js → groupFiles-uxa0U9_n.js} +3 -3
  22. package/dist/assets/{groupFiles-CqrujNN1.js.map → groupFiles-uxa0U9_n.js.map} +1 -1
  23. package/dist/assets/{host-Mz74S9cM.js → host-BbDWamRc.js} +112 -13
  24. package/dist/assets/host-BbDWamRc.js.map +1 -0
  25. package/dist/assets/{hyperdhtRelay-BnqdXvmv.js → hyperdhtRelay-De5FT7Am.js} +2 -2
  26. package/dist/assets/{hyperdhtRelay-BnqdXvmv.js.map → hyperdhtRelay-De5FT7Am.js.map} +1 -1
  27. package/dist/assets/{irohWeb-C8iKFl8d.js → irohWeb-z5QDDWa-.js} +2 -2
  28. package/dist/assets/{irohWeb-C8iKFl8d.js.map → irohWeb-z5QDDWa-.js.map} +1 -1
  29. package/dist/assets/{main-BXwlJall.js → main-_q4Fgypp.js} +14 -14
  30. package/dist/assets/main-_q4Fgypp.js.map +1 -0
  31. package/dist/assets/{mainline-CbrPHUrZ.js → mainline-Cld-bKeC.js} +2 -2
  32. package/dist/assets/{mainline-CbrPHUrZ.js.map → mainline-Cld-bKeC.js.map} +1 -1
  33. package/dist/assets/{networkReason-CrrB031Y.js → networkReason-vUHo6A_C.js} +2 -2
  34. package/dist/assets/{networkReason-CrrB031Y.js.map → networkReason-vUHo6A_C.js.map} +1 -1
  35. package/dist/assets/{nwc-Cu5zwrE8.js → nwc-zXpmd2FN.js} +3 -3
  36. package/dist/assets/{nwc-Cu5zwrE8.js.map → nwc-zXpmd2FN.js.map} +1 -1
  37. package/dist/assets/{nwcProvider-BVVFfJM5.js → nwcProvider-D482SQ1a.js} +2 -2
  38. package/dist/assets/{nwcProvider-BVVFfJM5.js.map → nwcProvider-D482SQ1a.js.map} +1 -1
  39. package/dist/assets/{registry-CshC1EyV.js → registry-CxsDR3c6.js} +1 -1
  40. package/dist/assets/{registry-BKm8N_TI.js → registry-OVx2kY3d.js} +3 -3
  41. package/dist/assets/{registry-BKm8N_TI.js.map → registry-OVx2kY3d.js.map} +1 -1
  42. package/dist/assets/{resolve-DKGaPeMz.js → resolve-CPTAnu-9.js} +2 -2
  43. package/dist/assets/{resolve-DKGaPeMz.js.map → resolve-CPTAnu-9.js.map} +1 -1
  44. package/dist/assets/{server-CaDVxJKy.js → server-C-EkLCCt.js} +41 -24
  45. package/dist/assets/server-C-EkLCCt.js.map +1 -0
  46. package/dist/assets/{src-CVYir6mP.js → src-Dg1bvMNv.js} +29 -14
  47. package/dist/assets/src-Dg1bvMNv.js.map +1 -0
  48. package/dist/assets/{turnRefs-BeWsTX0o.js → turnRefs-WnggXm2T.js} +2 -2
  49. package/dist/assets/{turnRefs-BeWsTX0o.js.map → turnRefs-WnggXm2T.js.map} +1 -1
  50. package/dist/assets/{usdt-C5Q0BWHr.js → usdt-BY5OIIvG.js} +3 -3
  51. package/dist/assets/{usdt-C5Q0BWHr.js.map → usdt-BY5OIIvG.js.map} +1 -1
  52. package/dist/ghostly.mjs +1 -1
  53. package/package.json +1 -1
  54. package/dist/assets/buttons-BoGOYSHb.js +0 -2
  55. package/dist/assets/host-Mz74S9cM.js.map +0 -1
  56. package/dist/assets/main-BXwlJall.js.map +0 -1
  57. package/dist/assets/server-CaDVxJKy.js.map +0 -1
  58. package/dist/assets/src-CVYir6mP.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { $o as extractParamsFromSdp, Ai as isPublicAddress, Jo as RTC_CONFIG, Qo as callSignalHeardAt, Xo as buildSdpFromSignal, Yo as answersOffer, Zo as callRtcConfig, es as parseCallSignal, oi as checkPushEndpoint, qo as CALL_SIGNAL_MAX_AGE_MS, tl as setLinkTraceSink, ts as signalHasVideo, xl as fromBase64Url } from "./src-CVYir6mP.js";
2
- import { a as fedimintSdkOn, r as irohRelayProblem } from "./irohWeb-C8iKFl8d.js";
1
+ import { $o as extractParamsFromSdp, Ai as isPublicAddress, Jo as RTC_CONFIG, Qo as callSignalHeardAt, Xo as buildSdpFromSignal, Yo as answersOffer, Zo as callRtcConfig, es as parseCallSignal, oi as checkPushEndpoint, qo as CALL_SIGNAL_MAX_AGE_MS, tl as setLinkTraceSink, ts as signalHasVideo, xl as fromBase64Url } from "./src-Dg1bvMNv.js";
2
+ import { a as fedimintSdkOn, r as irohRelayProblem } from "./irohWeb-z5QDDWa-.js";
3
3
  import { r as asCliError, t as CliError } from "./errors-B-zMxbcd.js";
4
- import { a as findChat } from "./apiKit-C9lLXQwt.js";
5
- import { _ as flushCardUpdates, c as paymentJson, d as nodeLocalFetch, f as chatJson, g as resumeHolds, h as groupMessageJson, l as reportAppFrames, m as groupJson, p as chatMessageJson, r as callApi, u as servedApps } from "./api-Q6QZ0oIy.js";
4
+ import { a as findChat } from "./apiKit-B4qhnLQT.js";
5
+ import { _ as flushCardUpdates, c as paymentJson, d as nodeLocalFetch, f as chatJson, g as resumeHolds, h as groupMessageJson, l as reportAppFrames, m as groupJson, p as chatMessageJson, r as callApi, u as servedApps } from "./api-BCrwJ57L.js";
6
6
  import { n as RESTORED_MARK, r as acquireLock } from "./profiles-gPCjLOQq.js";
7
7
  import { i as proof, l as privateFolder, n as newDaemonSecret, s as ownFolder } from "./daemonProof-B53VnZ1Z.js";
8
8
  import { createRequire } from "node:module";
@@ -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,14 +4700,14 @@ 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-CaDVxJKy.js"), import("./endpoint-BOTFMpfS.js")]);
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
- const mainline = dht.off ? null : new (await (import("./mainline-CbrPHUrZ.js"))).Mainline({
4706
+ const mainline = dht.off ? null : new (await (import("./mainline-Cld-bKeC.js"))).Mainline({
4608
4707
  bootstrap: dht.bootstrap,
4609
4708
  host: dht.host
4610
4709
  });
4611
- const transport = mainline || pinned ? new (await (import("./mainline-CbrPHUrZ.js"))).RelaysAndDht(mainline, pinned ? { relays: pinned } : {}, !!pinned) : null;
4710
+ const transport = mainline || pinned ? new (await (import("./mainline-Cld-bKeC.js"))).RelaysAndDht(mainline, pinned ? { relays: pinned } : {}, !!pinned) : null;
4612
4711
  const apps = servedApps(paths.dir).length > 0;
4613
4712
  const server = new EngineServer({
4614
4713
  ...transport ? { transport } : {},
@@ -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-Mz74S9cM.js.map
5047
+ //# sourceMappingURL=host-BbDWamRc.js.map