dsh-context 0.56.1 → 0.56.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 +31 -25
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1751,6 +1751,31 @@ window.__ModuleLoader__.load({
1751
1751
  }
1752
1752
  };
1753
1753
  }
1754
+ /**
1755
+ * Jump to one session — the harness's own session-selection verb (issue #90).
1756
+ * Every supported line selects through the view owner (`uiWorkspace`
1757
+ * .openSession, the sidebar row click's own verb); the sessions service's own
1758
+ * `open` is the retired spelling (still served through the 0.1.5 line, gone
1759
+ * since the 0.1.6 selection refactor) and stays as the degradation path for a
1760
+ * composition without the workspace module. Both faces are re-proved per call
1761
+ * (a service can land or be revoked across an HMR reload) and the verb is
1762
+ * invoked bound (the service instance reads its own state); a generation
1763
+ * serving neither, or a hostile face, swallows — the jump is best-effort by
1764
+ * nature.
1765
+ */
1766
+ function openSessionVia(ctx, id) {
1767
+ try {
1768
+ const workspace = asRecord(ctx.get("uiWorkspace"));
1769
+ const open = workspace?.openSession;
1770
+ if (typeof open === "function") {
1771
+ open.call(workspace, id);
1772
+ return;
1773
+ }
1774
+ const sessions = asRecord(ctx.get("sessions"));
1775
+ const legacy = sessions?.open;
1776
+ if (typeof legacy === "function") legacy.call(sessions, id);
1777
+ } catch {}
1778
+ }
1754
1779
  //#endregion
1755
1780
  //#region src/client/historyPage.ts
1756
1781
  /**
@@ -6248,18 +6273,6 @@ window.__ModuleLoader__.load({
6248
6273
  return days;
6249
6274
  }
6250
6275
  /**
6251
- * Jump to one session: the harness's own selection verb (`sessions.open`,
6252
- * the sidebar row click's mechanism). The face is re-proved per call and a
6253
- * hostile or absent service swallows silently — the panel still closes, so
6254
- * the gesture never dead-ends on an error.
6255
- */
6256
- function openSession(ctx, id) {
6257
- try {
6258
- const sessions = ctx.get("sessions");
6259
- if (sessions !== void 0 && typeof sessions.open === "function") sessions.open(id);
6260
- } catch {}
6261
- }
6262
- /**
6263
6276
  * Re-pull the session-list baseline so host-side projection backfills
6264
6277
  * (host/backfill.ts) reach a long-connected browser. Fire-and-forget: the
6265
6278
  * verb is re-proved and every failure swallows — the panel renders off the
@@ -7074,7 +7087,7 @@ window.__ModuleLoader__.load({
7074
7087
  * column (search, group chips, and the card grid); the heatmap keeps its own
7075
7088
  * fixed 8-week window and PINs the list to a picked day (the panel's
7076
7089
  * drill-down gesture). A session card click jumps to that session through
7077
- * the harness's own `sessions.open` and closes the panel.
7090
+ * the harness's own selection verb (openSessionVia) and closes the panel.
7078
7091
  */
7079
7092
  const RANGES = [
7080
7093
  "24h",
@@ -7157,7 +7170,7 @@ window.__ModuleLoader__.load({
7157
7170
  const kpi = kpisOf(ranged, allRows.length, prices, currency);
7158
7171
  const days = aggregateDays(allRows);
7159
7172
  const openOne = (id) => {
7160
- openSession(ctx, id);
7173
+ openSessionVia(ctx, id);
7161
7174
  overviewStore.set(false);
7162
7175
  };
7163
7176
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -9077,13 +9090,6 @@ window.__ModuleLoader__.load({
9077
9090
  });
9078
9091
  return segs;
9079
9092
  }
9080
- /** Session-switch navigation, fail-soft: a stale row (list rebuilt between snapshot and click) loses its open() race and is ignored. */
9081
- function openAgentSession(face, id) {
9082
- if (face === null || typeof face.open !== "function") return;
9083
- try {
9084
- face.open(id);
9085
- } catch {}
9086
- }
9087
9093
  /** Narrow `ctx.get('sessions')` to the card's face (null = harness without the outward sessions service). */
9088
9094
  function sessionsFaceOf(ctx) {
9089
9095
  const rec = asRecord(ctx.get("sessions"));
@@ -9207,7 +9213,7 @@ window.__ModuleLoader__.load({
9207
9213
  for (const n of forest.nodes) totalTokens += n.head !== null ? n.head.tokens : 0;
9208
9214
  const open = (id) => {
9209
9215
  if (id === current.id) return;
9210
- openAgentSession(face, id);
9216
+ openSessionVia(ctx, id);
9211
9217
  };
9212
9218
  const keyOpen = (id) => (ev) => {
9213
9219
  if (ev.key !== "Enter" && ev.key !== " ") return;
@@ -9986,7 +9992,7 @@ window.__ModuleLoader__.load({
9986
9992
  return function PluginInfo() {
9987
9993
  const [latest, setLatest] = (0, react.useState)(null);
9988
9994
  (0, react.useEffect)(() => {
9989
- if ("0.56.1".includes("-dev")) return;
9995
+ if ("0.56.2".includes("-dev")) return;
9990
9996
  let on = true;
9991
9997
  fetchLatestVersion().then((v) => {
9992
9998
  if (on && v) setLatest(v);
@@ -9995,8 +10001,8 @@ window.__ModuleLoader__.load({
9995
10001
  on = false;
9996
10002
  };
9997
10003
  }, []);
9998
- const update = latest !== null && isNewerVersion(latest, "0.56.1") ? latest : null;
9999
- const nameText = "dsh-context (v0.56.1)";
10004
+ const update = latest !== null && isNewerVersion(latest, "0.56.2") ? latest : null;
10005
+ const nameText = "dsh-context (v0.56.2)";
10000
10006
  const nameValue = [nameText];
10001
10007
  if (update) nameValue.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10002
10008
  className: "lc-pi-update",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context",
3
- "version": "0.56.1",
3
+ "version": "0.56.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
  "icon": "icon.svg",
6
6
  "author": "bowenliang123",