@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/README.md
CHANGED
|
@@ -41,7 +41,7 @@ Equivalent, and useful when the registry is unreachable. Use a
|
|
|
41
41
|
**version-pinned** URL:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
dsh plugin add https://github.com/dipertq/dsh-openviking-status/releases/download/v0.2.
|
|
44
|
+
dsh plugin add https://github.com/dipertq/dsh-openviking-status/releases/download/v0.2.2/dipertq-dsh-openviking-status-0.2.2.tgz
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Not `/releases/latest/download/…`: that URL keeps its name while its content
|
package/lib/client.cjs
CHANGED
|
@@ -41,6 +41,7 @@ __export(client_exports, {
|
|
|
41
41
|
OpenVikingSettingsSection: () => OpenVikingSettingsSection,
|
|
42
42
|
OpenVikingStatusChip: () => OpenVikingStatusChip,
|
|
43
43
|
OpenVikingStatusPopover: () => OpenVikingStatusPopover,
|
|
44
|
+
PROXY_OPENVIKING_ENDPOINT: () => PROXY_OPENVIKING_ENDPOINT,
|
|
44
45
|
THEME: () => THEME,
|
|
45
46
|
apply: () => apply,
|
|
46
47
|
chatNodesToText: () => chatNodesToText,
|
|
@@ -78,6 +79,7 @@ var import_react_dom = __toESM(require("react-dom"), 1);
|
|
|
78
79
|
|
|
79
80
|
// src/client/api.ts
|
|
80
81
|
var DEFAULT_OPENVIKING_ENDPOINT = "http://127.0.0.1:1933";
|
|
82
|
+
var PROXY_OPENVIKING_ENDPOINT = "/openviking-status/api";
|
|
81
83
|
function resolveEndpoint(endpoint) {
|
|
82
84
|
if (endpoint && endpoint.trim().length > 0) {
|
|
83
85
|
return endpoint.trim().replace(/\/+$/, "");
|
|
@@ -87,6 +89,7 @@ function resolveEndpoint(endpoint) {
|
|
|
87
89
|
if (typeof win.__OPENVIKING_ENDPOINT__ === "string" && win.__OPENVIKING_ENDPOINT__.trim()) {
|
|
88
90
|
return win.__OPENVIKING_ENDPOINT__.trim().replace(/\/+$/, "");
|
|
89
91
|
}
|
|
92
|
+
return PROXY_OPENVIKING_ENDPOINT;
|
|
90
93
|
}
|
|
91
94
|
if (typeof localStorage !== "undefined") {
|
|
92
95
|
try {
|
|
@@ -845,10 +848,10 @@ function formatMemoryLeafName(uri) {
|
|
|
845
848
|
return segments[0] || clean;
|
|
846
849
|
}
|
|
847
850
|
function formatEndpoint(endpoint) {
|
|
848
|
-
if (!endpoint || !endpoint.trim()) {
|
|
851
|
+
if (!endpoint || !endpoint.trim() || endpoint.startsWith("/")) {
|
|
849
852
|
return "127.0.0.1:1933";
|
|
850
853
|
}
|
|
851
|
-
return endpoint.trim().replace(/^https?:\/\//, "");
|
|
854
|
+
return endpoint.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
852
855
|
}
|
|
853
856
|
function truncateSessionId(id, maxLen = 16) {
|
|
854
857
|
if (!id) return "";
|
|
@@ -975,7 +978,7 @@ function OpenVikingStatusPopover({
|
|
|
975
978
|
{
|
|
976
979
|
"data-testid": "endpoint-label",
|
|
977
980
|
style: { ...mutedStyle, ...monoStyle, fontWeight: 400 },
|
|
978
|
-
children: formatEndpoint(endpoint)
|
|
981
|
+
children: formatEndpoint(health?.endpoint || endpoint)
|
|
979
982
|
}
|
|
980
983
|
)
|
|
981
984
|
] }),
|
|
@@ -1151,7 +1154,7 @@ function OpenVikingStatusPopover({
|
|
|
1151
1154
|
marginBottom: "12px",
|
|
1152
1155
|
color: themeVar("labelTertiary")
|
|
1153
1156
|
},
|
|
1154
|
-
children: unauthorized ? "The daemon requires an API key.
|
|
1157
|
+
children: unauthorized ? "The daemon requires an API key. Configure it in DSH Settings \u2192 OpenViking." : "Session counters are unavailable right now."
|
|
1155
1158
|
}
|
|
1156
1159
|
),
|
|
1157
1160
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { marginBottom: "12px" }, children: [
|