dsh-context 0.49.0 → 0.49.1

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 +79 -32
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -10,7 +10,7 @@ window.__ModuleLoader__.load({
10
10
  //#region src/client/i18n.ts
11
11
  const DICT_ZH = {
12
12
  "tab": "上下文",
13
- "sidebar.guideDescription": "查看这个会话的上下文构成、每步变化与消息列表。",
13
+ "sidebar.guideDescription": "查看上下文的构成、统计、演变。",
14
14
  "cat.system": "系统提示词",
15
15
  "cat.tools": "工具定义",
16
16
  "cat.user": "用户消息",
@@ -302,7 +302,7 @@ window.__ModuleLoader__.load({
302
302
  };
303
303
  const DICT_EN = {
304
304
  "tab": "Context",
305
- "sidebar.guideDescription": "Inspect this session's context composition, per-step history, and messages.",
305
+ "sidebar.guideDescription": "Inspect context composition, stats, and evolution.",
306
306
  "cat.system": "System Prompt",
307
307
  "cat.tools": "Tool Schemas",
308
308
  "cat.user": "User Messages",
@@ -6634,7 +6634,7 @@ window.__ModuleLoader__.load({
6634
6634
  return function PluginInfo() {
6635
6635
  const [latest, setLatest] = (0, react.useState)(null);
6636
6636
  (0, react.useEffect)(() => {
6637
- if ("0.49.0".includes("-dev")) return;
6637
+ if ("0.49.1".includes("-dev")) return;
6638
6638
  let on = true;
6639
6639
  fetchLatestVersion().then((v) => {
6640
6640
  if (on && v) setLatest(v);
@@ -6643,8 +6643,8 @@ window.__ModuleLoader__.load({
6643
6643
  on = false;
6644
6644
  };
6645
6645
  }, []);
6646
- const update = latest !== null && isNewerVersion(latest, "0.49.0") ? latest : null;
6647
- const nameText = "dsh-context (v0.49.0)";
6646
+ const update = latest !== null && isNewerVersion(latest, "0.49.1") ? latest : null;
6647
+ const nameText = "dsh-context (v0.49.1)";
6648
6648
  const nameValue = [nameText];
6649
6649
  if (update) nameValue.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6650
6650
  className: "lc-pi-update",
@@ -8750,6 +8750,58 @@ window.__ModuleLoader__.load({
8750
8750
  };
8751
8751
  }
8752
8752
  //#endregion
8753
+ //#region src/client/icon.tsx
8754
+ /** The sheet's strokes, in paint order, as `[path, fill]` pairs. */
8755
+ const SHEET_PATHS = [
8756
+ ["M899.984 19.873h-3.452c-26.123 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.173 47.298 47.296 47.298h3.452c26.119 0 47.297-21.171 47.297-47.298V67.169c0-26.124-21.177-47.296-47.297-47.296z", "#4A5699"],
8757
+ ["M132.643 19.873h-3.449c-26.12 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.177 47.298 47.296 47.298h3.449c26.123 0 47.299-21.171 47.299-47.298V67.169c0-26.124-21.176-47.296-47.299-47.296z", "#C45FA0"],
8758
+ ["M899.463 19.873H129.194c-26.12 0-47.296 21.172-47.296 47.296v3.377c0 26.12 21.177 47.299 47.296 47.299h770.269c26.123 0 47.296-21.179 47.296-47.299v-3.377c0-26.124-21.173-47.296-47.296-47.296z", "#6277BA"],
8759
+ ["M899.463 905.006H129.194c-26.12 0-47.296 21.17-47.296 47.29v3.381c0 26.127 21.177 47.298 47.296 47.298h770.269c26.123 0 47.296-21.171 47.296-47.298v-3.381c0-26.12-21.173-47.29-47.296-47.29z", "#C45FA0"],
8760
+ ["M717.962 543.153H542.047c-26.121 0-47.298 21.175-47.298 47.297v3.724c0 26.123 21.177 47.293 47.298 47.293h175.915c26.121 0 47.297-21.17 47.297-47.293v-3.724c0-26.122-21.176-47.297-47.297-47.297z", "#E5594F"],
8761
+ ["M689.268 198.849H513.355c-26.122 0-47.298 21.175-47.298 47.297v3.722c0 26.12 21.176 47.297 47.298 47.297h175.912c26.122 0 47.298-21.177 47.298-47.297v-3.722c0-26.122-21.175-47.297-47.297-47.297z", "#F0D043"],
8762
+ ["M757.789 353.081H261.17c-26.121 0-47.297 21.172-47.297 47.296v3.377c0 26.121 21.177 47.299 47.297 47.299h496.619c26.121 0 47.296-21.178 47.296-47.299v-3.377c0-26.125-21.175-47.296-47.296-47.296z", "#E5594F"],
8763
+ ["M762.638 726.225h-496.62c-26.12 0-47.294 21.18-47.294 47.301v3.377c0 26.12 21.174 47.3 47.294 47.3h496.62c26.122 0 47.296-21.18 47.296-47.3v-3.377c0-26.122-21.174-47.301-47.296-47.301z", "#6277BA"],
8764
+ ["M355.734 543.328H281.41c-26.122 0-47.297 21.17-47.297 47.293v3.378c0 26.118 21.175 47.297 47.297 47.297h74.324c26.123 0 47.296-21.179 47.296-47.297v-3.378c0-26.123-21.174-47.293-47.296-47.293z", "#F39A2B"],
8765
+ ["M334.85 248.006m-48.986 0a48.986 48.986 0 1 0 97.972 0 48.986 48.986 0 1 0-97.972 0Z", "#F39A2B"]
8766
+ ];
8767
+ /** The colourful document sheet at the requested square edge. */
8768
+ function ContextIcon({ size = 20, className }) {
8769
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
8770
+ width: size,
8771
+ height: size,
8772
+ viewBox: "0 0 1024 1024",
8773
+ className,
8774
+ "aria-hidden": "true",
8775
+ xmlns: "http://www.w3.org/2000/svg",
8776
+ children: SHEET_PATHS.map(([d, fill]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
8777
+ d,
8778
+ fill
8779
+ }, d))
8780
+ });
8781
+ }
8782
+ /**
8783
+ * The tab chip's title seat (`sidebar.right.pane.tab.title`): the emblem before
8784
+ * the label, so the chip reads as the files chip does. The label comes from the
8785
+ * plugin's own bound translate — read at render, so the chip follows the active
8786
+ * locale — rather than the tab-information hook, which a foreign or
8787
+ * not-yet-committed tab record can throw on. It carries a trailing gutter
8788
+ * (`.lc-title-label`) so the active chip's fade lands past the text, never on
8789
+ * the last glyphs.
8790
+ * @param t - the plugin-namespace translate bound in `apply`.
8791
+ * @returns the title component to register under the tab type's id.
8792
+ */
8793
+ function makeContextTabTitle(t) {
8794
+ return function ContextTabTitle() {
8795
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextIcon, {
8796
+ size: 16,
8797
+ className: "lc-title-icon"
8798
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8799
+ className: "lc-title-label",
8800
+ children: t("tab")
8801
+ })] });
8802
+ };
8803
+ }
8804
+ //#endregion
8753
8805
  //#region src/client/sidebar.ts
8754
8806
  /**
8755
8807
  * The right Sidebar's Context tab (dsh 0.1.5-rc.1+).
@@ -8761,7 +8813,8 @@ window.__ModuleLoader__.load({
8761
8813
  * one component with one data path. The tab type contributes a guide entry, so
8762
8814
  * the sidebar's guide page offers "Context" and picking it opens the panel —
8763
8815
  * the product's own path, exactly as the shipped Files type does: a capsule of
8764
- * glyph, title, and description line.
8816
+ * glyph, title, and description line, plus the chip-title seat that puts the
8817
+ * same glyph beside the label once the tab is open (`icon.tsx`).
8765
8818
  *
8766
8819
  * OPTIONAL BY CONTRACT. `ctx.sidebarRightTabs` and the seat ship only on the
8767
8820
  * 0.1.5 line (0.1.5-rc.1+ supported); the registration therefore rides a
@@ -8785,22 +8838,8 @@ window.__ModuleLoader__.load({
8785
8838
  /** The guide capsule's position: after the shipped Files entry (order 10). */
8786
8839
  const GUIDE_ORDER = 20;
8787
8840
  /**
8788
- * The guide capsule's glyph, read defensively: the icon is OPTIONAL in the
8789
- * entry, and a primitives module that does not serve it or whose namespace
8790
- * THROWS on the read (an interop/mock shape does exactly that) — must cost the
8791
- * glyph, never the whole tab.
8792
- * @returns the icon component, or undefined to register the tab without one.
8793
- */
8794
- function guideIcon() {
8795
- try {
8796
- return _deepseek_ai_dsh_client_ui_primitives.IconContextInjectionOutline16;
8797
- } catch {
8798
- return;
8799
- }
8800
- }
8801
- /**
8802
- * Register the Context tab type and its body on the right Sidebar, if — and
8803
- * only if — this harness serves the sidebar tab registry.
8841
+ * Register the Context tab type, its body, and its chip title on the right
8842
+ * Sidebar, if and only if this harness serves the sidebar tab registry.
8804
8843
  * @param ctx - client root context carrying `slots` and the locale service.
8805
8844
  * @param view - the Context view component factory result (the same one the
8806
8845
  * conversation tab mounts).
@@ -8812,10 +8851,14 @@ window.__ModuleLoader__.load({
8812
8851
  function watchSidebarContextTab(ctx, view, t, ns) {
8813
8852
  ctx.inject(["sidebarRightTabs"], (raw) => {
8814
8853
  const injected = raw;
8854
+ const disposers = [];
8855
+ const own = (result) => {
8856
+ if (typeof result === "function") disposers.push(result);
8857
+ };
8815
8858
  try {
8816
8859
  const tabs = injected.sidebarRightTabs;
8817
8860
  if (tabs === void 0 || typeof tabs.register !== "function") return;
8818
- const disposeType = tabs.register({
8861
+ own(tabs.register({
8819
8862
  id: SIDEBAR_CONTEXT_ID,
8820
8863
  kind: SIDEBAR_CONTEXT_KIND,
8821
8864
  title: () => t("tab"),
@@ -8823,24 +8866,28 @@ window.__ModuleLoader__.load({
8823
8866
  order: GUIDE_ORDER,
8824
8867
  title: () => t("tab"),
8825
8868
  description: () => t("sidebar.guideDescription"),
8826
- icon: guideIcon()
8869
+ icon: ContextIcon
8827
8870
  }]
8828
- });
8829
- const disposeBody = injected.slots.inject("sidebar.right.pane.tab", () => injected.slots.register({
8871
+ }));
8872
+ own(injected.slots.inject("sidebar.right.pane.tab", () => injected.slots.register({
8830
8873
  name: "sidebar.right.pane.tab",
8831
8874
  key: SIDEBAR_CONTEXT_ID,
8832
8875
  locale: ns
8833
8876
  }, (props) => view({
8834
8877
  ...props,
8835
8878
  host: "sidebar"
8836
- })));
8837
- return () => {
8838
- disposeType();
8839
- if (typeof disposeBody === "function") disposeBody();
8840
- };
8879
+ }))));
8880
+ own(injected.slots.inject("sidebar.right.pane.tab.title", () => injected.slots.register({
8881
+ name: "sidebar.right.pane.tab.title",
8882
+ key: SIDEBAR_CONTEXT_ID
8883
+ }, makeContextTabTitle(t))));
8841
8884
  } catch {
8885
+ for (const dispose of disposers) dispose();
8842
8886
  return;
8843
8887
  }
8888
+ return () => {
8889
+ for (const dispose of disposers) dispose();
8890
+ };
8844
8891
  });
8845
8892
  }
8846
8893
  //#endregion
@@ -8860,7 +8907,7 @@ window.__ModuleLoader__.load({
8860
8907
  }
8861
8908
  //#endregion
8862
8909
  //#region \0dsh-global-css:/home/runner/work/dsh-context/dsh-context/src/client/styles/base.css.mjs
8863
- const css$13 = ".lc-root{box-sizing:border-box;height:100%;color:var(--dsw-alias-label-primary);padding:16px 20px 32px;font-size:13px;overflow-y:auto}[data-sidebar-right-open] .lc-root,[data-sidebar-right-float-host] .lc-root{height:auto;padding:12px;overflow:visible}.lc-card{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;margin-bottom:14px;padding:14px 16px}.lc-root .lc-card{margin-bottom:7px;padding:7px 8px;container:lc-card/inline-size}.lc-root .lc-cols{gap:7px;margin-bottom:7px}.lc-card-title{flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:10px;font-weight:600;display:flex}.lc-card-title-text{white-space:nowrap;flex:none}.lc-gran,.lc-kinds{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;gap:2px;margin-left:auto;padding:1px;display:flex}.lc-trend-ctl{align-items:center;gap:6px;margin-left:auto;display:flex}.lc-trend-ctl .lc-gran{margin-left:0}.lc-trend-adaptive{flex:none;margin-left:0}.lc-gran-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;padding:3px 8px;font-family:inherit;font-size:11px;line-height:1}.lc-gran-btn:hover{color:var(--dsw-alias-label-primary)}.lc-gran-on,.lc-gran-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.lc-tip{z-index:6;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-shadow-lv3,0 2px 8px #0000002e);pointer-events:none;opacity:0;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:6px 10px;font-size:12px;position:absolute}.lc-events,.lc-fa-list{flex-direction:column;gap:2px;height:320px;display:flex;overflow-y:auto}.lc-cols{flex-wrap:wrap;gap:14px;margin-bottom:14px;display:flex}.lc-col{flex:1;min-width:min(360px,100%)}.lc-cols>.lc-card,.lc-col>.lc-card:last-child{margin-bottom:0}.lc-col-browser{flex-direction:column;display:flex}.lc-col-browser>.lc-card{flex:1}.lc-head{container:lc-head-row/inline-size}.lc-head>.lc-card{flex:1 1 0;min-width:0}@container lc-head-row (width<=1045px){.lc-head>.lc-card{flex-basis:40%}}@container lc-head-row (width<=480px){.lc-head>.lc-card{flex-basis:100%}}.lc-head>.lc-card:first-child{flex-direction:column;display:flex}.lc-head>.lc-card:first-child .lc-stats{flex:1;align-content:stretch}.lc-head>.lc-card:first-child .lc-stat{justify-content:center}.lc-empty{color:var(--dsw-alias-label-secondary);text-align:center;padding:18px 0}.lc-error{flex-direction:column;align-items:center;gap:8px;padding:40px 16px;display:flex}.lc-error-msg{font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);overflow-wrap:anywhere;border-radius:6px;max-width:100%;padding:4px 8px;font-size:12px}.lc-error-retry{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:4px 14px;font-size:12px}.lc-error-retry:hover{border-color:var(--dsw-alias-label-primary)}.lc-foot{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px}[data-conversation-scroll]:has(.lc-root)>[data-composer-seat]:not(:has([data-approval-key],[data-question-key],[data-plan-review-key])),[data-conversation-scroll]:has(.lc-root,.lc-modal-backdrop)~[data-width-handle]{display:none}";
8910
+ const css$13 = ".lc-root{box-sizing:border-box;height:100%;color:var(--dsw-alias-label-primary);padding:16px 20px 32px;font-size:13px;overflow-y:auto}[data-sidebar-right-open] .lc-root,[data-sidebar-right-float-host] .lc-root{height:auto;padding:12px;overflow:visible}.lc-title-icon{flex:none}.lc-title-label{padding-right:30px}.lc-card{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;margin-bottom:14px;padding:14px 16px}.lc-root .lc-card{margin-bottom:7px;padding:7px 8px;container:lc-card/inline-size}.lc-root .lc-cols{gap:7px;margin-bottom:7px}.lc-card-title{flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:10px;font-weight:600;display:flex}.lc-card-title-text{white-space:nowrap;flex:none}.lc-gran,.lc-kinds{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;gap:2px;margin-left:auto;padding:1px;display:flex}.lc-trend-ctl{align-items:center;gap:6px;margin-left:auto;display:flex}.lc-trend-ctl .lc-gran{margin-left:0}.lc-trend-adaptive{flex:none;margin-left:0}.lc-gran-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;padding:3px 8px;font-family:inherit;font-size:11px;line-height:1}.lc-gran-btn:hover{color:var(--dsw-alias-label-primary)}.lc-gran-on,.lc-gran-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.lc-tip{z-index:6;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-shadow-lv3,0 2px 8px #0000002e);pointer-events:none;opacity:0;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:6px 10px;font-size:12px;position:absolute}.lc-events,.lc-fa-list{flex-direction:column;gap:2px;height:320px;display:flex;overflow-y:auto}.lc-cols{flex-wrap:wrap;gap:14px;margin-bottom:14px;display:flex}.lc-col{flex:1;min-width:min(360px,100%)}.lc-cols>.lc-card,.lc-col>.lc-card:last-child{margin-bottom:0}.lc-col-browser{flex-direction:column;display:flex}.lc-col-browser>.lc-card{flex:1}.lc-head{container:lc-head-row/inline-size}.lc-head>.lc-card{flex:1 1 0;min-width:0}@container lc-head-row (width<=1045px){.lc-head>.lc-card{flex-basis:40%}}@container lc-head-row (width<=480px){.lc-head>.lc-card{flex-basis:100%}}.lc-head>.lc-card:first-child{flex-direction:column;display:flex}.lc-head>.lc-card:first-child .lc-stats{flex:1;align-content:stretch}.lc-head>.lc-card:first-child .lc-stat{justify-content:center}.lc-empty{color:var(--dsw-alias-label-secondary);text-align:center;padding:18px 0}.lc-error{flex-direction:column;align-items:center;gap:8px;padding:40px 16px;display:flex}.lc-error-msg{font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);overflow-wrap:anywhere;border-radius:6px;max-width:100%;padding:4px 8px;font-size:12px}.lc-error-retry{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:4px 14px;font-size:12px}.lc-error-retry:hover{border-color:var(--dsw-alias-label-primary)}.lc-foot{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px}[data-conversation-scroll]:has(.lc-root)>[data-composer-seat]:not(:has([data-approval-key],[data-question-key],[data-plan-review-key])),[data-conversation-scroll]:has(.lc-root,.lc-modal-backdrop)~[data-width-handle]{display:none}";
8864
8911
  const tagId$13 = "dsh-context/base.css";
8865
8912
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$13) + "]") === null) {
8866
8913
  const tag = document.createElement("style");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
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": {