@dipertq/dsh-openviking-status 0.1.8 → 0.2.0
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 +5 -13
- package/lib/client.cjs +724 -6
- package/lib/client.cjs.map +1 -1
- package/lib/client.d.cts +39 -11
- package/lib/client.js +724 -6
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +32 -4
- package/lib/index.js +1206 -5
- package/lib/index.js.map +1 -1
- package/package.json +5 -2
package/lib/client.d.cts
CHANGED
|
@@ -91,10 +91,25 @@ declare function resolveApiKey(apiKey?: string): string | undefined;
|
|
|
91
91
|
* Клиент REST API для взаимодействия с сессиями демона OpenViking
|
|
92
92
|
*/
|
|
93
93
|
declare class OpenVikingClient {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
endpoint: string;
|
|
95
|
+
apiKey?: string;
|
|
96
96
|
private resolvedSessionIds;
|
|
97
97
|
constructor(endpoint?: string, apiKey?: string);
|
|
98
|
+
/**
|
|
99
|
+
* Обновление конфигурации клиента на лету (например, после сохранения настроек в UI).
|
|
100
|
+
*/
|
|
101
|
+
updateConfig(config: {
|
|
102
|
+
endpoint?: string;
|
|
103
|
+
apiKey?: string;
|
|
104
|
+
}): void;
|
|
105
|
+
/**
|
|
106
|
+
* Очистить кэш разрешенных идентификаторов сессий.
|
|
107
|
+
*/
|
|
108
|
+
clearResolvedSessions(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Проверка, работает ли клиент через DSH Web Server proxy.
|
|
111
|
+
*/
|
|
112
|
+
private isProxy;
|
|
98
113
|
/**
|
|
99
114
|
* Формирование заголовков запроса, включая опциональный заголовок авторизации
|
|
100
115
|
*/
|
|
@@ -196,6 +211,10 @@ declare const THEME: {
|
|
|
196
211
|
readonly stateWarning: "--dsw-alias-state-warn-primary";
|
|
197
212
|
/** Утопленная поверхность: дорожка прогресс-бара. */
|
|
198
213
|
readonly insetSurface: "--dsw-alias-bg-layer-2";
|
|
214
|
+
/** Заливка основной кнопки действий. */
|
|
215
|
+
readonly buttonPrimaryFill: "--dsw-alias-button-primary-fill";
|
|
216
|
+
/** Цвет текста на основной кнопке действий. */
|
|
217
|
+
readonly buttonPrimaryText: "--dsw-alias-label-primary-inverted";
|
|
199
218
|
/** Моноширинный шрифт для идентификаторов и путей. */
|
|
200
219
|
readonly fontMono: "--dsw-font-markdown-code-font-family";
|
|
201
220
|
};
|
|
@@ -376,6 +395,19 @@ declare function handleEscapeKey(event: {
|
|
|
376
395
|
*/
|
|
377
396
|
declare function OpenVikingStatusPopover({ sessionId, health, sessionData, sessionRead, recalledResult, endpoint, isCommitting, commitError, onCommitNow, onClose, className, style, }: OpenVikingStatusPopoverProps): React.JSX.Element;
|
|
378
397
|
|
|
398
|
+
interface OpenVikingConfigData {
|
|
399
|
+
endpoint: string;
|
|
400
|
+
hasApiKey: boolean;
|
|
401
|
+
source: "env" | "ovcli" | "ov" | "settings" | "default";
|
|
402
|
+
}
|
|
403
|
+
interface OpenVikingSettingsSectionProps {
|
|
404
|
+
initialConfig?: OpenVikingConfigData;
|
|
405
|
+
onConfigSaved?: (config: OpenVikingConfigData) => void;
|
|
406
|
+
className?: string;
|
|
407
|
+
style?: React.CSSProperties;
|
|
408
|
+
}
|
|
409
|
+
declare function OpenVikingSettingsSection({ initialConfig, onConfigSaved, className, style, }: OpenVikingSettingsSectionProps): React.JSX.Element;
|
|
410
|
+
|
|
379
411
|
type OpenVikingSessionData = SessionStatus;
|
|
380
412
|
type OpenVikingHealth = HealthStatus;
|
|
381
413
|
/** Имя пакета, под которым DSH регистрирует клиентскую половину плагина. */
|
|
@@ -385,15 +417,11 @@ declare const inject: string[];
|
|
|
385
417
|
/**
|
|
386
418
|
* Точка входа клиентского плагина DSH.
|
|
387
419
|
*
|
|
388
|
-
* Занимает ячейку в `conversation.composer.dock` —
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* Слот со скоупом сессии, поэтому `sessionId` и `useChat` приходят стандартными
|
|
394
|
-
* пропами. Свой `id` обязателен: чужой занял бы и заменил ячейку соседа, а
|
|
395
|
-
* `order` выше нуля ставит чип после штатной статистики.
|
|
420
|
+
* 1. Занимает ячейку в `conversation.composer.dock` — чип со статусом OpenViking
|
|
421
|
+
* под композером чата.
|
|
422
|
+
* 2. Регистрирует раздел `settings.section` — страницу настроек OpenViking Status
|
|
423
|
+
* в меню настроек DSH Desktop и Web.
|
|
396
424
|
*/
|
|
397
425
|
declare function apply(ctx: any): void;
|
|
398
426
|
|
|
399
|
-
export { COMMIT_THRESHOLD, type CommitOptions, type CommitResult, DEFAULT_OPENVIKING_ENDPOINT, type HealthStatus, OpenVikingClient, type OpenVikingHealth, type OpenVikingSessionData, 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 };
|
|
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 };
|