dsh-context 0.54.1 → 0.54.2

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 (2) hide show
  1. package/lib/client.js +19 -8
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -6267,6 +6267,14 @@ window.__ModuleLoader__.load({
6267
6267
  let cached$1 = null;
6268
6268
  /** The route read in flight, so a second open joins it instead of starting one. */
6269
6269
  let refreshing = null;
6270
+ /**
6271
+ * The landing callbacks of every open riding the in-flight read — all
6272
+ * notified when it lands, so an open that JOINS mid-flight (a fast
6273
+ * close-reopen, a second capsule) settles on the live figure too, exactly
6274
+ * as this function's contract promises (issue #82). Cleared when the read
6275
+ * settles: the next open starts a fresh read and a fresh set.
6276
+ */
6277
+ const landingCallbacks = /* @__PURE__ */ new Set();
6270
6278
  /** The storage this module reads and writes; swapped in tests. */
6271
6279
  let storage;
6272
6280
  function storageFn() {
@@ -6313,20 +6321,23 @@ window.__ModuleLoader__.load({
6313
6321
  * capsule paints the remembered total immediately and settles on the live
6314
6322
  * one. `refreshing` is assigned before anything awaits, so an open arriving
6315
6323
  * while a read is still in flight joins it rather than starting a second one;
6316
- * it paints the remembered figure and takes the in-flight read's landing for
6317
- * its own. A failed or absent read notifies nobody and keeps serving the
6318
- * remembered figure, so an offline open never trades a number for a blank
6319
- * pill; `null` (whether pending, absent, or failed) means nothing to show yet.
6324
+ * its callback joins the landing set, so the read's landing reports to EVERY
6325
+ * open riding it — the joiner included (issue #82). A failed or absent read
6326
+ * notifies nobody and keeps serving the remembered figure, so an offline open
6327
+ * never trades a number for a blank pill; `null` (whether pending, absent, or
6328
+ * failed) means nothing to show yet.
6320
6329
  */
6321
6330
  function readPlatformBalance(onRefresh) {
6331
+ landingCallbacks.add(onRefresh);
6322
6332
  if (refreshing === null) refreshing = (async () => {
6323
6333
  const value = await readRoute();
6324
6334
  if (value === null) return;
6325
6335
  cached$1 = value;
6326
6336
  rememberBalance(value);
6327
- onRefresh(value);
6337
+ for (const waiter of landingCallbacks) waiter(value);
6328
6338
  })().finally(() => {
6329
6339
  refreshing = null;
6340
+ landingCallbacks.clear();
6330
6341
  });
6331
6342
  return cached$1 ?? storedBalance();
6332
6343
  }
@@ -9685,7 +9696,7 @@ window.__ModuleLoader__.load({
9685
9696
  return function PluginInfo() {
9686
9697
  const [latest, setLatest] = (0, react.useState)(null);
9687
9698
  (0, react.useEffect)(() => {
9688
- if ("0.54.1".includes("-dev")) return;
9699
+ if ("0.54.2".includes("-dev")) return;
9689
9700
  let on = true;
9690
9701
  fetchLatestVersion().then((v) => {
9691
9702
  if (on && v) setLatest(v);
@@ -9694,8 +9705,8 @@ window.__ModuleLoader__.load({
9694
9705
  on = false;
9695
9706
  };
9696
9707
  }, []);
9697
- const update = latest !== null && isNewerVersion(latest, "0.54.1") ? latest : null;
9698
- const nameText = "dsh-context (v0.54.1)";
9708
+ const update = latest !== null && isNewerVersion(latest, "0.54.2") ? latest : null;
9709
+ const nameText = "dsh-context (v0.54.2)";
9699
9710
  const nameValue = [nameText];
9700
9711
  if (update) nameValue.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9701
9712
  className: "lc-pi-update",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context",
3
- "version": "0.54.1",
3
+ "version": "0.54.2",
4
4
  "description": "A DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.",
5
5
  "author": "bowenliang123",
6
6
  "repository": {