dsh-mnemon-source-memory-spaces 0.5.9 → 0.5.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.
- package/lib/client.js +37 -10
- package/lib/types/client/pages.d.ts +1 -0
- package/package.json +2 -2
- package/presentation/sidebar.module.css +8 -2
package/lib/client.js
CHANGED
|
@@ -875,7 +875,7 @@ window.__ModuleLoader__.load({
|
|
|
875
875
|
};
|
|
876
876
|
//#endregion
|
|
877
877
|
//#region \0source-css:/home/runner/work/dsh-mnemon/dsh-mnemon/plugins/dsh-mnemon-source-memory-spaces/presentation/sidebar.module.css.mjs
|
|
878
|
-
const css$1 = "._Bh55G_shell ._Bh55G_memoryWorkspace{border-bottom:1px solid var(--dsw-alias-border-l1);background:var(--mn-surface);flex:none;padding:
|
|
878
|
+
const css$1 = "._Bh55G_shell ._Bh55G_memoryWorkspace{z-index:12;border-bottom:1px solid var(--dsw-alias-border-l1);background:var(--mn-surface);flex:none;margin:-14px -16px 12px;padding:14px 16px 0;position:sticky;top:0}._Bh55G_shell ._Bh55G_memoryWorkspace>[class*=pageHeader]{margin-bottom:8px}._Bh55G_shell [class*=relatedPane],._Bh55G_shell [class*=entityRail]{position:static}._Bh55G_shell ._Bh55G_memoryNavigation{flex:none;align-items:flex-end;gap:12px;min-width:0;padding:0;display:flex}._Bh55G_shell ._Bh55G_memoryTabs{scrollbar-width:none;flex:1;gap:2px;min-width:0;display:flex;overflow-x:auto}._Bh55G_shell ._Bh55G_memoryTabs::-webkit-scrollbar{display:none}._Bh55G_shell ._Bh55G_memoryTabs button{min-width:max-content;min-height:0;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;border-radius:6px 6px 0 0;padding:6px 12px;font-size:13px}._Bh55G_shell ._Bh55G_memoryTabs button:hover{background:var(--dsw-alias-interactive-bg-hover)}._Bh55G_shell ._Bh55G_memoryTabs button[data-active]{border-bottom-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary);font-weight:600}._Bh55G_shell ._Bh55G_memoryWriteButton{flex:none}._Bh55G_shell ._Bh55G_modal section[class*=supervisedComposer]{overflow:visible}._Bh55G_shell ._Bh55G_modal form[class*=supervisedForm]{padding:0}._Bh55G_shell ._Bh55G_modal [class*=supervisedHeading]{margin-bottom:10px}._Bh55G_shell ._Bh55G_modal [class*=supervisedHeading] h3{display:none}._Bh55G_shell ._Bh55G_modal details[class*=advancedWrite]{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;margin-top:14px;overflow:hidden}._Bh55G_shell [class*=inspectorEye],._Bh55G_shell [class*=inspectorHeading] button{width:26px;height:26px;min-height:0;color:var(--dsw-alias-label-secondary);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;padding:0;font-size:13px;display:inline-flex}._Bh55G_shell [class*=inspectorEye]:hover:not(:disabled),._Bh55G_shell [class*=inspectorHeading] button:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover);border:0}._Bh55G_shell [class*=inspectorEye],._Bh55G_shell [class*=inspectorHeading] button{cursor:pointer;transition:background-color .12s,color .12s,border-color .12s,outline-color .12s,box-shadow .12s,transform .12s}._Bh55G_shell [class*=inspectorEye]:active:not(:disabled),._Bh55G_shell [class*=inspectorHeading] button:active:not(:disabled){transform:translateY(1px)}._Bh55G_shell [class*=inspectorEye]:disabled{cursor:default;opacity:.45}._Bh55G_shell [class*=searchControls] label,._Bh55G_shell [class*=fieldWide]{color:var(--dsw-alias-label-secondary);gap:5px;font-size:12px;font-weight:500}._Bh55G_shell [class*=searchControls] select,._Bh55G_shell [class*=listToolbar] input,._Bh55G_shell [class*=listToolbar] select,._Bh55G_shell [class*=entitySearch] input{border:1px solid var(--dsw-alias-border-l2);min-height:34px;color:var(--dsw-alias-label-primary);background:var(--dsw-specific-input-major);border-radius:8px;padding:7px 10px;font-size:13px;font-weight:400}._Bh55G_shell [class*=entityHeading]>span,._Bh55G_shell [class*=inspectorHeading]>span{letter-spacing:.06em;font-size:11px}._Bh55G_shell [class*=bodyDirectoryHeader] p,._Bh55G_shell [class*=bodyCard]>p,._Bh55G_shell [class*=graphToolbar],._Bh55G_shell [class*=graphFooter],._Bh55G_shell [class*=manualActions] p{font-size:12px}._Bh55G_shell [class*=bodyDirectoryPath],._Bh55G_shell [class*=bodyCard] footer,._Bh55G_shell [class*=bodyHealth],._Bh55G_shell [class*=badge],._Bh55G_shell [class*=entities] span{font-size:11px}._Bh55G_shell [class*=bodySwitch],._Bh55G_shell [class*=graphCanvasControls] button,._Bh55G_shell [class*=advancedWrite] summary small{font-size:12px}._Bh55G_shell [class*=inspectorMeta] dd{font-size:13px}._Bh55G_shell [class*=bodyGrid]{grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr))}._Bh55G_shell article[class*=bodyCard]{border-color:var(--mn-line);background:linear-gradient(90deg, color-mix(in srgb, var(--mn-provider-color) 5%, var(--mn-layer-1)), var(--mn-layer-1) 34%);height:100%;box-shadow:inset 3px 0 0 color-mix(in srgb, var(--mn-provider-color) 68%, transparent);border-radius:8px;flex-direction:column;padding:11px 11px 11px 14px;display:flex}._Bh55G_shell article[class*=bodyCard][data-active]{border-color:var(--mn-line);box-shadow:inset 3px 0 0 color-mix(in srgb, var(--mn-provider-color) 78%, transparent)}._Bh55G_shell ._Bh55G_bodyCardHeader{justify-content:space-between;align-items:flex-start;gap:12px;min-width:0;display:flex}._Bh55G_shell ._Bh55G_bodyDirectoryActions{flex:none;align-items:center;gap:8px;display:flex}._Bh55G_shell ._Bh55G_bodyDirectoryActions>strong{color:var(--dsw-alias-state-business-primary);background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 8%, transparent);white-space:nowrap;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:600}._Bh55G_shell ._Bh55G_bodyCardIdentity{flex:1;align-items:flex-start;gap:8px;min-width:0;display:flex}._Bh55G_shell ._Bh55G_bodyCardIdentity>[class*=bodySignal]{flex:none;width:6px;height:6px;margin-top:7px}._Bh55G_shell article[class*=bodyCard][data-reconnecting] ._Bh55G_bodyCardIdentity>[class*=bodySignal]{width:6px;height:6px}._Bh55G_shell ._Bh55G_bodyCardIdentity>div{flex:1;gap:2px;min-width:0;display:grid}._Bh55G_shell ._Bh55G_bodyCardIdentity strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px;overflow:hidden}._Bh55G_shell ._Bh55G_bodyCardMeta{flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0;display:flex}._Bh55G_shell ._Bh55G_bodyCardMeta code{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}._Bh55G_shell ._Bh55G_bodyCardMeta [class*=bodyHealth]{letter-spacing:0;flex:none;font-size:11px}._Bh55G_shell ._Bh55G_bodyCardHeader>[class*=bodySwitch]{flex:none;min-height:24px}._Bh55G_shell article[class*=bodyCard]>p{-webkit-line-clamp:4;-webkit-box-orient:vertical;min-height:6.2em;max-height:6.2em;margin:12px 0;line-height:1.55;display:-webkit-box;overflow:hidden}._Bh55G_shell ._Bh55G_bodyCardFooter{white-space:nowrap;grid-template-columns:minmax(0,1fr) max-content;align-items:center;gap:10px;min-width:0;margin-top:auto;padding-top:9px;display:grid}._Bh55G_shell ._Bh55G_bodyCardStats{flex-wrap:nowrap;align-items:center;gap:10px;min-width:0;display:flex;overflow:hidden}._Bh55G_shell ._Bh55G_bodyCardFooter [class*=bodyCardActions]{flex-wrap:nowrap;flex:none;align-items:center;gap:6px;display:flex}._Bh55G_shell [class*=cardActions]{gap:6px}._Bh55G_shell ._Bh55G_inspectorGlyph{border:1px solid var(--dsw-alias-border-l1);width:44px;height:44px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-1);font:20px/1 var(--mn-code);opacity:1;border-radius:10px;place-items:center;margin-bottom:10px;display:grid}@media (width<=760px){._Bh55G_shell ._Bh55G_memoryWorkspace{margin-inline:-12px;padding-inline:12px}._Bh55G_shell ._Bh55G_memoryTabs button{padding-inline:10px}}@media (width<=520px){._Bh55G_shell ._Bh55G_memoryTabs button{padding-inline:8px;font-size:12px}}@media (prefers-reduced-motion:reduce){._Bh55G_shell [class*=inspectorEye],._Bh55G_shell [class*=inspectorHeading] button{transition:none}}";
|
|
879
879
|
const id = "dsh-mnemon-source-memory-spaces/presentation/sidebar.module.css";
|
|
880
880
|
if (typeof document !== "undefined") {
|
|
881
881
|
let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]");
|
|
@@ -2955,6 +2955,7 @@ window.__ModuleLoader__.load({
|
|
|
2955
2955
|
const [searched, setSearched] = (0, react.useState)(false);
|
|
2956
2956
|
const [error, setError] = (0, react.useState)(null);
|
|
2957
2957
|
const [relatedTo, setRelatedTo] = (0, react.useState)(null);
|
|
2958
|
+
const relatedPaneRef = (0, react.useRef)(null);
|
|
2958
2959
|
const [related, setRelated] = (0, react.useState)([]);
|
|
2959
2960
|
const [relatedLoading, setRelatedLoading] = (0, react.useState)(false);
|
|
2960
2961
|
const [visibleResultLimit, setVisibleResultLimit] = (0, react.useState)(pageSize);
|
|
@@ -2963,6 +2964,24 @@ window.__ModuleLoader__.load({
|
|
|
2963
2964
|
(0, react.useEffect)(() => {
|
|
2964
2965
|
if (props.seed !== "") setQuery(props.seed);
|
|
2965
2966
|
}, [props.seed]);
|
|
2967
|
+
(0, react.useEffect)(() => {
|
|
2968
|
+
if (relatedTo === null || props.onRevealElement === void 0) return;
|
|
2969
|
+
const reveal = () => {
|
|
2970
|
+
if (relatedPaneRef.current !== null && relatedRequests.isCurrent(relatedTo.request)) props.onRevealElement?.(relatedPaneRef.current);
|
|
2971
|
+
};
|
|
2972
|
+
if (typeof window.requestAnimationFrame !== "function") {
|
|
2973
|
+
reveal();
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
const frame = window.requestAnimationFrame(reveal);
|
|
2977
|
+
return () => {
|
|
2978
|
+
if (typeof window.cancelAnimationFrame === "function") window.cancelAnimationFrame(frame);
|
|
2979
|
+
};
|
|
2980
|
+
}, [
|
|
2981
|
+
relatedTo,
|
|
2982
|
+
relatedRequests,
|
|
2983
|
+
props.onRevealElement
|
|
2984
|
+
]);
|
|
2966
2985
|
const runSearch = async (withAgent) => {
|
|
2967
2986
|
if (query.trim() === "") return;
|
|
2968
2987
|
relatedRequests.begin();
|
|
@@ -3010,15 +3029,14 @@ window.__ModuleLoader__.load({
|
|
|
3010
3029
|
const searching = searchKind !== null;
|
|
3011
3030
|
const showRelated = async (insight) => {
|
|
3012
3031
|
const request = relatedRequests.begin();
|
|
3013
|
-
setRelatedTo(
|
|
3032
|
+
setRelatedTo({
|
|
3033
|
+
insight,
|
|
3034
|
+
request
|
|
3035
|
+
});
|
|
3014
3036
|
setRelated([]);
|
|
3015
3037
|
setRelatedLoading(true);
|
|
3016
3038
|
setError(null);
|
|
3017
3039
|
setVisibleRelatedLimit(pageSize);
|
|
3018
|
-
if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(() => document.getElementById("mnemon-related-pane")?.scrollIntoView?.({
|
|
3019
|
-
block: "nearest",
|
|
3020
|
-
behavior: "smooth"
|
|
3021
|
-
}));
|
|
3022
3040
|
try {
|
|
3023
3041
|
const response = await props.client.related(insight.id, insight.memoryBodyId);
|
|
3024
3042
|
if (relatedRequests.isCurrent(request)) setRelated(response);
|
|
@@ -3032,7 +3050,7 @@ window.__ModuleLoader__.load({
|
|
|
3032
3050
|
await props.onForget(insight);
|
|
3033
3051
|
setResults((items) => items.filter((item) => insightKey(item) !== insightKey(insight)));
|
|
3034
3052
|
setRelated((items) => items.filter((item) => insightKey(item) !== insightKey(insight)));
|
|
3035
|
-
if (relatedTo !== null && insightKey(relatedTo) === insightKey(insight)) setRelatedTo(null);
|
|
3053
|
+
if (relatedTo !== null && insightKey(relatedTo.insight) === insightKey(insight)) setRelatedTo(null);
|
|
3036
3054
|
};
|
|
3037
3055
|
const visibleResults = results.slice(0, visibleResultLimit);
|
|
3038
3056
|
const visibleRelated = related.slice(0, visibleRelatedLimit);
|
|
@@ -3175,7 +3193,7 @@ window.__ModuleLoader__.load({
|
|
|
3175
3193
|
})
|
|
3176
3194
|
]
|
|
3177
3195
|
}), relatedTo !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
3178
|
-
|
|
3196
|
+
ref: relatedPaneRef,
|
|
3179
3197
|
className: css.relatedPane,
|
|
3180
3198
|
children: [
|
|
3181
3199
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3193,7 +3211,7 @@ window.__ModuleLoader__.load({
|
|
|
3193
3211
|
}),
|
|
3194
3212
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3195
3213
|
className: css.relatedSource,
|
|
3196
|
-
children: relatedTo.content
|
|
3214
|
+
children: relatedTo.insight.content
|
|
3197
3215
|
}),
|
|
3198
3216
|
relatedLoading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3199
3217
|
className: css.loading,
|
|
@@ -4150,6 +4168,10 @@ window.__ModuleLoader__.load({
|
|
|
4150
4168
|
const [rememberOpen, setRememberOpen] = (0, react.useState)(props.page === "remember");
|
|
4151
4169
|
const [strategyOpen, setStrategyOpen] = (0, react.useState)(false);
|
|
4152
4170
|
const [error, setError] = (0, react.useState)(null);
|
|
4171
|
+
const headerRef = (0, react.useRef)(null);
|
|
4172
|
+
const revealElement = (0, react.useCallback)((element) => {
|
|
4173
|
+
props.onRevealElement?.(element, (headerRef.current?.getBoundingClientRect().height ?? 0) + 14);
|
|
4174
|
+
}, [props.onRevealElement]);
|
|
4153
4175
|
const refresh = (0, react.useCallback)(() => {
|
|
4154
4176
|
setRevision((value) => value + 1);
|
|
4155
4177
|
props.onRefresh?.();
|
|
@@ -4163,6 +4185,9 @@ window.__ModuleLoader__.load({
|
|
|
4163
4185
|
(0, react.useEffect)(() => {
|
|
4164
4186
|
if (props.management !== void 0) rememberedPages.set(props.management, page);
|
|
4165
4187
|
}, [props.management, page]);
|
|
4188
|
+
(0, react.useLayoutEffect)(() => {
|
|
4189
|
+
props.onResetScroll?.();
|
|
4190
|
+
}, [page, props.onResetScroll]);
|
|
4166
4191
|
(0, react.useEffect)(() => {
|
|
4167
4192
|
let active = true;
|
|
4168
4193
|
setError(null);
|
|
@@ -4201,6 +4226,7 @@ window.__ModuleLoader__.load({
|
|
|
4201
4226
|
}),
|
|
4202
4227
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4203
4228
|
className: sidebarCss.memoryWorkspace,
|
|
4229
|
+
ref: headerRef,
|
|
4204
4230
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(dsh_mnemon_client.PageHeader, {
|
|
4205
4231
|
title: t("nav.spaces"),
|
|
4206
4232
|
description: t("overview.description"),
|
|
@@ -4260,7 +4286,8 @@ window.__ModuleLoader__.load({
|
|
|
4260
4286
|
status,
|
|
4261
4287
|
seed,
|
|
4262
4288
|
writeEnabled: writable,
|
|
4263
|
-
onForget: forget
|
|
4289
|
+
onForget: forget,
|
|
4290
|
+
onRevealElement: revealElement
|
|
4264
4291
|
}),
|
|
4265
4292
|
page === "entities" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntitiesPage, {
|
|
4266
4293
|
client,
|
|
@@ -36,6 +36,7 @@ export declare function ExplorePage(props: {
|
|
|
36
36
|
seed: string;
|
|
37
37
|
writeEnabled: boolean;
|
|
38
38
|
onForget: (insight: Insight) => Promise<void>;
|
|
39
|
+
onRevealElement?(element: HTMLElement): void;
|
|
39
40
|
}): JSX.Element;
|
|
40
41
|
export declare function EntitiesPage(props: {
|
|
41
42
|
client: MemorySpacesPageClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-memory-spaces",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Memory Spaces Source and its private Provider SDK.",
|
|
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.
|
|
65
|
+
"dsh-mnemon": "^0.5.16",
|
|
66
66
|
"dsh-mnemon-provider-byterover": "^0.5.4",
|
|
67
67
|
"dsh-mnemon-provider-hindsight": "^0.5.4",
|
|
68
68
|
"dsh-mnemon-provider-holographic": "^0.5.4",
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
.shell .memoryWorkspace {
|
|
2
|
+
position: sticky;
|
|
3
|
+
z-index: 12;
|
|
4
|
+
top: 0;
|
|
2
5
|
flex: 0 0 auto;
|
|
3
|
-
|
|
6
|
+
margin: -14px -16px 12px;
|
|
7
|
+
padding: 14px 16px 0;
|
|
4
8
|
border-bottom: 1px solid var(--dsw-alias-border-l1);
|
|
5
9
|
background: var(--mn-surface);
|
|
6
10
|
}
|
|
7
11
|
.shell .memoryWorkspace > [class*='pageHeader'] { margin-bottom: 8px; }
|
|
12
|
+
/* Keep secondary controls in flow beneath the one pinned Source header. */
|
|
13
|
+
.shell [class*='relatedPane'], .shell [class*='entityRail'] { position: static; }
|
|
8
14
|
|
|
9
15
|
.shell .memoryNavigation {
|
|
10
16
|
display: flex;
|
|
@@ -270,7 +276,7 @@
|
|
|
270
276
|
}
|
|
271
277
|
|
|
272
278
|
@media (max-width: 760px) {
|
|
273
|
-
.shell .
|
|
279
|
+
.shell .memoryWorkspace { margin-inline: -12px; padding-inline: 12px; }
|
|
274
280
|
.shell .memoryTabs button { padding-inline: 10px; }
|
|
275
281
|
}
|
|
276
282
|
|