dsh-mnemon-source-skills 0.5.4 → 0.5.5

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 +16 -10
  2. package/package.json +2 -2
package/lib/client.js CHANGED
@@ -43,7 +43,7 @@ window.__ModuleLoader__.load({
43
43
  * carries its own precondition, so retrying never applies one twice.
44
44
  */
45
45
  function skillsPageClient(management) {
46
- const read = async (operation, input = null) => (await management.read(operation, json(input))).value;
46
+ const read = async (operation, input = null, coalesce = false) => (await management.read(operation, json(input), { coalesce })).value;
47
47
  const fresh = async () => (await management.read("revision", null)).revision;
48
48
  const retry = async (attempt) => {
49
49
  for (let count = 1;; count++) try {
@@ -71,22 +71,22 @@ window.__ModuleLoader__.load({
71
71
  return key !== void 0 && Object.hasOwn(overrides, key) ? overrides[key] : slot === "draft" ? preferences.model : preferences.runModel;
72
72
  };
73
73
  return {
74
- overview: () => read("overview"),
75
- catalog: () => read("catalog"),
74
+ overview: () => read("overview", null, true),
75
+ catalog: () => read("catalog", null, true),
76
76
  skill: (key) => read("skill", { key }),
77
77
  version: (key, id) => read("version", {
78
78
  key,
79
79
  id
80
80
  }),
81
- suggestions: (status) => read("suggestions", status === void 0 ? {} : { status }),
81
+ suggestions: (status) => read("suggestions", status === void 0 ? {} : { status }, true),
82
82
  suggestion: (id) => read("suggestion", { id }),
83
- trajectories: (filter) => read("trajectories", filter ?? {}),
83
+ trajectories: (filter) => read("trajectories", filter ?? {}, true),
84
84
  trajectory: (id) => read("trajectory", { id }),
85
- cases: (skill) => read("cases", skill === void 0 ? {} : { skill }),
86
- runs: (skill) => read("runs", skill === void 0 ? {} : { skill }),
85
+ cases: (skill) => read("cases", skill === void 0 ? {} : { skill }, true),
86
+ runs: (skill) => read("runs", skill === void 0 ? {} : { skill }, true),
87
87
  run: (id) => read("run", { id }),
88
88
  draft: (id) => read("draft", { id }),
89
- reviews: (filter) => read("reviews", filter ?? {}),
89
+ reviews: (filter) => read("reviews", filter ?? {}, true),
90
90
  evidencePack: (input) => read("evidence-pack", input),
91
91
  createSkill: (input) => mutate("skill-create", input),
92
92
  saveSkill: (key, content, expectedHash) => mutate("skill-save", {
@@ -6079,13 +6079,19 @@ window.__ModuleLoader__.load({
6079
6079
  const busy = overview !== null && (overview.counts.runsRunning > 0 || overview.counts.drafting > 0);
6080
6080
  const wasBusy = (0, react.useRef)(false);
6081
6081
  (0, react.useEffect)(() => {
6082
+ if (props.active === false) return;
6082
6083
  if (wasBusy.current && !busy) refresh();
6083
6084
  wasBusy.current = busy;
6084
6085
  if (!busy) return;
6085
6086
  const timer = setInterval(refresh, POLL_MS);
6086
6087
  return () => clearInterval(timer);
6087
- }, [busy, refresh]);
6088
+ }, [
6089
+ busy,
6090
+ refresh,
6091
+ props.active
6092
+ ]);
6088
6093
  (0, react.useEffect)(() => {
6094
+ if (props.active === false) return;
6089
6095
  const resume = () => {
6090
6096
  if (document.visibilityState !== "hidden") refresh();
6091
6097
  };
@@ -6095,7 +6101,7 @@ window.__ModuleLoader__.load({
6095
6101
  window.removeEventListener("focus", resume);
6096
6102
  document.removeEventListener("visibilitychange", resume);
6097
6103
  };
6098
- }, [refresh]);
6104
+ }, [refresh, props.active]);
6099
6105
  (0, react.useEffect)(() => {
6100
6106
  if (notice === null) return;
6101
6107
  const timer = setTimeout(() => setNotice(null), NOTICE_MS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mnemon-source-skills",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Skills Source for Composable View Memory: DSH skill management, evolution suggestions, evidence trajectories and eval sets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -62,7 +62,7 @@
62
62
  "@types/node": "^22.0.0",
63
63
  "@types/react": "^18.3.0",
64
64
  "@types/react-dom": "^18.3.0",
65
- "dsh-mnemon": "^0.5.37",
65
+ "dsh-mnemon": "^0.5.38",
66
66
  "jsdom": "^26.0.0",
67
67
  "react": "^18.2.0",
68
68
  "react-dom": "^18.2.0",