@dipertq/dsh-openviking-status 0.2.1 → 0.2.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.
- package/README.md +1 -1
- package/lib/client.cjs +7 -4
- package/lib/client.cjs.map +1 -1
- package/lib/client.d.cts +6 -1
- package/lib/client.js +7 -4
- package/lib/client.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/client.d.cts
CHANGED
|
@@ -12,6 +12,7 @@ interface HealthStatus {
|
|
|
12
12
|
ok: boolean;
|
|
13
13
|
version?: string;
|
|
14
14
|
storage?: string;
|
|
15
|
+
endpoint?: string;
|
|
15
16
|
error?: string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
@@ -79,6 +80,10 @@ type PeerId = string;
|
|
|
79
80
|
* Базовый URL по умолчанию для локального демона OpenViking
|
|
80
81
|
*/
|
|
81
82
|
declare const DEFAULT_OPENVIKING_ENDPOINT = "http://127.0.0.1:1933";
|
|
83
|
+
/**
|
|
84
|
+
* Относительный маршрут хостового прокси на DSH Web Server
|
|
85
|
+
*/
|
|
86
|
+
declare const PROXY_OPENVIKING_ENDPOINT = "/openviking-status/api";
|
|
82
87
|
/**
|
|
83
88
|
* Определение эндпоинта OpenViking из параметров, глобального контекста или localStorage
|
|
84
89
|
*/
|
|
@@ -424,4 +429,4 @@ declare const inject: string[];
|
|
|
424
429
|
*/
|
|
425
430
|
declare function apply(ctx: any): void;
|
|
426
431
|
|
|
427
|
-
export { COMMIT_THRESHOLD, type CommitOptions, type CommitResult, DEFAULT_OPENVIKING_ENDPOINT, type HealthStatus, OpenVikingClient, type OpenVikingConfigData, type OpenVikingHealth, type OpenVikingSessionData, OpenVikingSettingsSection, type OpenVikingSettingsSectionProps, OpenVikingStatusChip, type OpenVikingStatusChipProps, OpenVikingStatusPopover, type OpenVikingStatusPopoverProps, type PeerId, type PendingTokens, type RecalledMemoriesResult, type RecalledMemoryItem, type SessionReadResult, type SessionStatus, THEME, type ThemeRole, type UseChat, apply, chatNodesToText, checkHealth, commitSession, defaultOpenVikingClient, fetchSession, formatDaemonVersion, formatEndpoint, formatMemoryLeafName, formatPendingTokens, formatRelativeTime, formatStatusLabel, formatTooltipTitle, getCategoryBadgeStyle, getProgressBarColor, getProgressBarPercent, getSession, getStatusIndicatorColor, handleEscapeKey, inferCategory, inject, name, parseRecalledMemories, resolveApiKey, resolveEndpoint, themeVar, truncateSessionId };
|
|
432
|
+
export { COMMIT_THRESHOLD, type CommitOptions, type CommitResult, DEFAULT_OPENVIKING_ENDPOINT, type HealthStatus, OpenVikingClient, type OpenVikingConfigData, type OpenVikingHealth, type OpenVikingSessionData, OpenVikingSettingsSection, type OpenVikingSettingsSectionProps, OpenVikingStatusChip, type OpenVikingStatusChipProps, OpenVikingStatusPopover, type OpenVikingStatusPopoverProps, PROXY_OPENVIKING_ENDPOINT, type PeerId, type PendingTokens, type RecalledMemoriesResult, type RecalledMemoryItem, type SessionReadResult, type SessionStatus, THEME, type ThemeRole, type UseChat, apply, chatNodesToText, checkHealth, commitSession, defaultOpenVikingClient, fetchSession, formatDaemonVersion, formatEndpoint, formatMemoryLeafName, formatPendingTokens, formatRelativeTime, formatStatusLabel, formatTooltipTitle, getCategoryBadgeStyle, getProgressBarColor, getProgressBarPercent, getSession, getStatusIndicatorColor, handleEscapeKey, inferCategory, inject, name, parseRecalledMemories, resolveApiKey, resolveEndpoint, themeVar, truncateSessionId };
|
package/lib/client.js
CHANGED
|
@@ -17,6 +17,7 @@ import ReactDOM from "react-dom";
|
|
|
17
17
|
|
|
18
18
|
// src/client/api.ts
|
|
19
19
|
var DEFAULT_OPENVIKING_ENDPOINT = "http://127.0.0.1:1933";
|
|
20
|
+
var PROXY_OPENVIKING_ENDPOINT = "/openviking-status/api";
|
|
20
21
|
function resolveEndpoint(endpoint) {
|
|
21
22
|
if (endpoint && endpoint.trim().length > 0) {
|
|
22
23
|
return endpoint.trim().replace(/\/+$/, "");
|
|
@@ -26,6 +27,7 @@ function resolveEndpoint(endpoint) {
|
|
|
26
27
|
if (typeof win.__OPENVIKING_ENDPOINT__ === "string" && win.__OPENVIKING_ENDPOINT__.trim()) {
|
|
27
28
|
return win.__OPENVIKING_ENDPOINT__.trim().replace(/\/+$/, "");
|
|
28
29
|
}
|
|
30
|
+
return PROXY_OPENVIKING_ENDPOINT;
|
|
29
31
|
}
|
|
30
32
|
if (typeof localStorage !== "undefined") {
|
|
31
33
|
try {
|
|
@@ -784,10 +786,10 @@ function formatMemoryLeafName(uri) {
|
|
|
784
786
|
return segments[0] || clean;
|
|
785
787
|
}
|
|
786
788
|
function formatEndpoint(endpoint) {
|
|
787
|
-
if (!endpoint || !endpoint.trim()) {
|
|
789
|
+
if (!endpoint || !endpoint.trim() || endpoint.startsWith("/")) {
|
|
788
790
|
return "127.0.0.1:1933";
|
|
789
791
|
}
|
|
790
|
-
return endpoint.trim().replace(/^https?:\/\//, "");
|
|
792
|
+
return endpoint.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
791
793
|
}
|
|
792
794
|
function truncateSessionId(id, maxLen = 16) {
|
|
793
795
|
if (!id) return "";
|
|
@@ -914,7 +916,7 @@ function OpenVikingStatusPopover({
|
|
|
914
916
|
{
|
|
915
917
|
"data-testid": "endpoint-label",
|
|
916
918
|
style: { ...mutedStyle, ...monoStyle, fontWeight: 400 },
|
|
917
|
-
children: formatEndpoint(endpoint)
|
|
919
|
+
children: formatEndpoint(health?.endpoint || endpoint)
|
|
918
920
|
}
|
|
919
921
|
)
|
|
920
922
|
] }),
|
|
@@ -1090,7 +1092,7 @@ function OpenVikingStatusPopover({
|
|
|
1090
1092
|
marginBottom: "12px",
|
|
1091
1093
|
color: themeVar("labelTertiary")
|
|
1092
1094
|
},
|
|
1093
|
-
children: unauthorized ? "The daemon requires an API key.
|
|
1095
|
+
children: unauthorized ? "The daemon requires an API key. Configure it in DSH Settings \u2192 OpenViking." : "Session counters are unavailable right now."
|
|
1094
1096
|
}
|
|
1095
1097
|
),
|
|
1096
1098
|
/* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
|
|
@@ -2132,6 +2134,7 @@ export {
|
|
|
2132
2134
|
OpenVikingSettingsSection,
|
|
2133
2135
|
OpenVikingStatusChip,
|
|
2134
2136
|
OpenVikingStatusPopover,
|
|
2137
|
+
PROXY_OPENVIKING_ENDPOINT,
|
|
2135
2138
|
THEME,
|
|
2136
2139
|
apply,
|
|
2137
2140
|
chatNodesToText,
|