@deepseek-ai/dsh-experimental-session-inspector 0.2.1-alpha.1
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/LICENSE +21 -0
- package/README.i18n.yaml +34 -0
- package/README.md +105 -0
- package/README.zh.md +105 -0
- package/lib/client.js +5444 -0
- package/lib/index.js +6 -0
- package/lib/types/client/index.d.ts +10 -0
- package/lib/types/client/locales.d.ts +69 -0
- package/lib/types/client/views/InspectorDetails.d.ts +17 -0
- package/lib/types/client/views/InspectorObjectTree.d.ts +26 -0
- package/lib/types/client/views/InspectorTable.d.ts +43 -0
- package/lib/types/client/views/TypeFilter.d.ts +15 -0
- package/lib/types/client/views/View.d.ts +42 -0
- package/lib/types/client/views/chat-node/dom.d.ts +28 -0
- package/lib/types/client/views/chat-node/highlight.d.ts +20 -0
- package/lib/types/client/views/chat-node/model.d.ts +52 -0
- package/lib/types/client/views/chat-node/objects.d.ts +24 -0
- package/lib/types/client/views/chat-node/pick-match.d.ts +27 -0
- package/lib/types/client/views/chat-node/picker.d.ts +43 -0
- package/lib/types/client/views/chat-node/reveal-target.d.ts +14 -0
- package/lib/types/client/views/chat-node/reveal.d.ts +25 -0
- package/lib/types/client/views/format.d.ts +11 -0
- package/lib/types/client/views/index.d.ts +8 -0
- package/lib/types/client/views/object-value.d.ts +28 -0
- package/lib/types/client/views/objects.d.ts +39 -0
- package/lib/types/client/views/raw-json.d.ts +11 -0
- package/lib/types/client/views/session-log/chat-target.d.ts +16 -0
- package/lib/types/client/views/session-log/groups.d.ts +18 -0
- package/lib/types/client/views/session-log/model.d.ts +54 -0
- package/lib/types/client/views/session-log/stream.d.ts +37 -0
- package/lib/types/client/views/table-layout.d.ts +56 -0
- package/lib/types/client/views/table-model.d.ts +76 -0
- package/lib/types/client/views/type-filter.d.ts +41 -0
- package/lib/types/index.d.ts +4 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +77 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Browser plugin contributing the Session Inspector Log sidebar tab. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** Services required to register the localized Session-bound sidebar tab. */
|
|
4
|
+
export declare const inject: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Register the Inspector tab for this plugin's lifetime.
|
|
7
|
+
* @param ctx - Client plugin context owning the dictionaries and registrations.
|
|
8
|
+
*/
|
|
9
|
+
export declare function apply(ctx: Context): void;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** Session Inspector tab, table controls, and object navigation labels. */
|
|
2
|
+
/** Namespace owned by the Session Inspector plugin. */
|
|
3
|
+
export declare const NS = "session-inspector";
|
|
4
|
+
/** Simplified Chinese labels and dictionary keys. */
|
|
5
|
+
export declare const zh: {
|
|
6
|
+
readonly 'tab.title': "会话数据诊断";
|
|
7
|
+
readonly 'tab.description': "在侧边栏分析当前会话原始日志和聊天分组数据";
|
|
8
|
+
readonly 'view.presentation': "展示形式";
|
|
9
|
+
readonly 'view.sessionLog': "原始数据";
|
|
10
|
+
readonly 'view.chatNode': "对话分组";
|
|
11
|
+
readonly 'picker.pick': "在对话面板中选取元素";
|
|
12
|
+
readonly 'picker.cancel': "取消选取 (Esc)";
|
|
13
|
+
readonly 'picker.instructions': "在左侧 Chat 中悬停预览,点击选取;Esc 取消。";
|
|
14
|
+
readonly 'picker.noMatch': "当前表格没有匹配记录,请选择其他元素或按 Esc 取消。";
|
|
15
|
+
readonly 'picker.noChat': "请先在主区域打开当前 Session 的 Chat。";
|
|
16
|
+
readonly 'table.id': "序号";
|
|
17
|
+
readonly 'table.type': "类型";
|
|
18
|
+
readonly 'filter.title': "筛选类型";
|
|
19
|
+
readonly 'filter.input': "类型关键词";
|
|
20
|
+
readonly 'filter.placeholder': "输入类型片段,如 delta";
|
|
21
|
+
readonly 'filter.help': "默认包含匹配(*关键词*);Enter 确认,Esc 取消。";
|
|
22
|
+
readonly 'filter.candidates': "类型候选";
|
|
23
|
+
readonly 'filter.loading': "正在查找候选…";
|
|
24
|
+
readonly 'filter.failed': "无法获取类型候选。";
|
|
25
|
+
readonly 'filter.noCandidates': "没有匹配候选,仍可确认当前关键词。";
|
|
26
|
+
readonly 'filter.clear': "清空";
|
|
27
|
+
readonly 'filter.cancel': "取消";
|
|
28
|
+
readonly 'filter.apply': "确认筛选";
|
|
29
|
+
readonly 'filter.context': "匹配记录的父级上下文";
|
|
30
|
+
readonly 'table.location': "T/S";
|
|
31
|
+
readonly 'table.time': "时间 (UTC)";
|
|
32
|
+
readonly 'table.data': "数据";
|
|
33
|
+
readonly 'table.older': "加载更早";
|
|
34
|
+
readonly 'table.loading': "加载中…";
|
|
35
|
+
readonly 'table.latest': "跟踪最新";
|
|
36
|
+
readonly 'table.empty': "暂无记录";
|
|
37
|
+
readonly 'table.raw': "原始数据";
|
|
38
|
+
readonly 'table.rawError': "无法序列化这条记录,可以选择其他记录继续查看。";
|
|
39
|
+
readonly 'table.resizeDetails': "调整原始数据面板高度";
|
|
40
|
+
readonly 'table.close': "关闭";
|
|
41
|
+
readonly 'table.expand': "展开子行";
|
|
42
|
+
readonly 'table.collapse': "收起子行";
|
|
43
|
+
readonly 'table.removed': "该记录已移除或结算,请选择当前记录。";
|
|
44
|
+
readonly 'object.node': "Node";
|
|
45
|
+
readonly 'object.nodeData': "Node Data";
|
|
46
|
+
readonly 'object.group': "Group";
|
|
47
|
+
readonly 'object.groupData': "Group Data";
|
|
48
|
+
readonly 'object.turn': "Turn";
|
|
49
|
+
readonly 'object.turnData': "Turn Data";
|
|
50
|
+
readonly 'object.step': "Step";
|
|
51
|
+
readonly 'object.stepData': "Step Data";
|
|
52
|
+
readonly 'object.accessor': "[Getter / Setter,未执行]";
|
|
53
|
+
readonly 'object.empty': "空";
|
|
54
|
+
readonly 'object.absent': "[空槽]";
|
|
55
|
+
readonly 'object.properties': "其他属性";
|
|
56
|
+
readonly 'object.more': "显示更多";
|
|
57
|
+
readonly 'object.navigation': "原始数据导航";
|
|
58
|
+
};
|
|
59
|
+
/** Dictionary keys accepted by this plugin's translator. */
|
|
60
|
+
export type SessionInspectorKey = keyof typeof zh;
|
|
61
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
62
|
+
interface LocaleNamespaceMap {
|
|
63
|
+
/** Session Inspector tab and table labels. */
|
|
64
|
+
'session-inspector': SessionInspectorKey;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** English labels, checked against the Chinese key set. */
|
|
68
|
+
export declare const en: Record<SessionInspectorKey, string>;
|
|
69
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Locally resizable raw-data panel; pointer capture owns the drag lifetime. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
+
/** Raw text and owner callbacks for one Inspector's detail panel. */
|
|
5
|
+
export type InspectorDetailsProps = PropsLocale<'session-inspector'> & {
|
|
6
|
+
readonly text: string;
|
|
7
|
+
readonly failed?: boolean;
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
readonly close: () => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Resize the raw-data area from its upper edge while keeping the table visible.
|
|
13
|
+
* @param props - Complete raw text, localized labels, and close callback.
|
|
14
|
+
* @returns Detail text with a pointer- and keyboard-operated horizontal separator.
|
|
15
|
+
*/
|
|
16
|
+
export declare function InspectorDetails({ text, failed, children, close, t }: InspectorDetailsProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=InspectorDetails.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Shared value rendering for JSON details and lazy runtime objects with identity links. */
|
|
2
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { InspectorObjects, InspectorObjectReference } from './objects.ts';
|
|
4
|
+
/** Original value and Session-local reference navigation. */
|
|
5
|
+
export type InspectorObjectTreeProps = PropsLocale<'session-inspector'> & {
|
|
6
|
+
readonly value: unknown;
|
|
7
|
+
readonly objects: InspectorObjects;
|
|
8
|
+
readonly navigate: (reference: InspectorObjectReference) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Display serialized Inspector JSON with every container initially expanded and no reference navigation.
|
|
12
|
+
* @param props - Successful inspectorJson output and localized tree labels; empty text represents undefined.
|
|
13
|
+
* @returns The same value tree as Chat details, without collection paging or runtime-object links.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InspectorJsonTree({ text, t }: PropsLocale<'session-inspector'> & {
|
|
16
|
+
readonly text: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Inspect the root and nested Node Data inline; other registered objects remain navigation links.
|
|
20
|
+
* Node Data titles also navigate, while repeated ancestors never expand recursively.
|
|
21
|
+
* Expanded fields are cached until their value or Conversation publication changes.
|
|
22
|
+
* @param props - Original object, weak identity lookup, locale, and reference activation.
|
|
23
|
+
* @returns A lazily expanded, typed tree that retains Map keys and collection identities.
|
|
24
|
+
*/
|
|
25
|
+
export declare function InspectorObjectTree(props: InspectorObjectTreeProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=InspectorObjectTree.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Virtualized raw-data table shared by Session log and Chat structure views. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
4
|
+
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
5
|
+
import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
6
|
+
import { type InspectorRecord, type InspectorRow } from './table-model.ts';
|
|
7
|
+
import type { InspectorChatTarget, InspectorObjects } from './objects.ts';
|
|
8
|
+
/** Framework-bound row sources and Session pagination command. */
|
|
9
|
+
export interface InspectorInjected {
|
|
10
|
+
readonly hooks: {
|
|
11
|
+
readonly rows: ObservableSnapshot<readonly InspectorRow[]>;
|
|
12
|
+
};
|
|
13
|
+
readonly keyedHooks: {
|
|
14
|
+
readonly record: (key: string) => ObservableSnapshot<InspectorRecord | undefined> | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** Load the preceding page through the existing Session reference. */
|
|
17
|
+
readonly loadOlder: () => Promise<void>;
|
|
18
|
+
/** @param key - Loaded row identity. @returns Current type without mounting a row subscription. */
|
|
19
|
+
readonly typeOf: (key: string) => string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Inputs of either Inspector conversation view. */
|
|
22
|
+
export type InspectorTableProps = Pick<ConvViewProps, 'useSession'> & InjectFace<InspectorInjected> & PropsLocale<'session-inspector'> & {
|
|
23
|
+
readonly title: string;
|
|
24
|
+
readonly flash: boolean;
|
|
25
|
+
readonly showTime: boolean;
|
|
26
|
+
readonly modeSelector?: ReactNode;
|
|
27
|
+
readonly objects?: InspectorObjects;
|
|
28
|
+
readonly navigation?: {
|
|
29
|
+
readonly reveal: (target: InspectorChatTarget) => void;
|
|
30
|
+
readonly target: (key: string) => InspectorChatTarget | undefined;
|
|
31
|
+
};
|
|
32
|
+
readonly pickedRow?: {
|
|
33
|
+
readonly key: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
readonly notice?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Render a paged hierarchy with stable virtual row keys and live JSON details.
|
|
39
|
+
* @param props - Framework hooks, pagination, locale, and the view's highlight policy.
|
|
40
|
+
* @returns Virtual table and selected raw data.
|
|
41
|
+
*/
|
|
42
|
+
export declare function InspectorTable({ title, flash, showTime, modeSelector, objects, navigation, pickedRow, notice, useRows, useRecord, useSession, loadOlder, typeOf, t }: InspectorTableProps): import("react").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=InspectorTable.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Anchored type-filter editor with asynchronous suggestions and explicit confirmation. */
|
|
2
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
/** Current confirmed query and an asynchronous candidate source. */
|
|
4
|
+
export type InspectorTypeFilterProps = PropsLocale<'session-inspector'> & {
|
|
5
|
+
readonly value: string;
|
|
6
|
+
readonly suggest: (query: string) => Promise<readonly string[]>;
|
|
7
|
+
readonly apply: (query: string) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Edit a type fragment without filtering until Enter, Apply, or a candidate is selected.
|
|
11
|
+
* @param props - Confirmed query, candidate resolver, commit callback, and localized copy.
|
|
12
|
+
* @returns A header button and its portaled editor; stale responses cannot replace newer suggestions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function TypeFilter({ value, suggest, apply, t }: InspectorTypeFilterProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=TypeFilter.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** One Sidebar Inspector with locally selected Chat and Session-log presentations. */
|
|
2
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { InspectorInjected } from './InspectorTable.tsx';
|
|
4
|
+
import type { InspectorObjects, InspectorChatTarget } from './objects.ts';
|
|
5
|
+
import type { InspectorPickTarget } from './chat-node/pick-match.ts';
|
|
6
|
+
/** Local Inspector presentations; these are not separate Conversation View registrations. */
|
|
7
|
+
export type InspectorPresentation = 'chat-node' | 'session-log';
|
|
8
|
+
/** Both sources remain lazy: only the selected table subscribes. */
|
|
9
|
+
export interface SessionInspectorInjected {
|
|
10
|
+
/** @returns This Session's displayed main Chat column, or undefined without one. */
|
|
11
|
+
readonly chatRoot: () => HTMLElement | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* @param owner - Visible picker button.
|
|
14
|
+
* @param picked - True accepts the target; false keeps picking.
|
|
15
|
+
* @param cancelled - Clear panel state when the gesture is cancelled or replaced.
|
|
16
|
+
* @returns Silent cleanup, or undefined if the plugin is disposed or Chat is unavailable.
|
|
17
|
+
*/
|
|
18
|
+
readonly pickChat: (owner: HTMLElement, picked: (target: InspectorPickTarget) => boolean, cancelled: () => void) => (() => void) | undefined;
|
|
19
|
+
/** @param target - Log or object coordinates. @returns Exact and nearby loaded Chat identities. */
|
|
20
|
+
readonly resolveChatTargets: (target: InspectorChatTarget) => readonly InspectorChatTarget[];
|
|
21
|
+
readonly hooks: {
|
|
22
|
+
readonly chatRows: InspectorInjected['hooks']['rows'];
|
|
23
|
+
readonly logRows: InspectorInjected['hooks']['rows'];
|
|
24
|
+
};
|
|
25
|
+
readonly keyedHooks: {
|
|
26
|
+
readonly chatRecord: InspectorInjected['keyedHooks']['record'];
|
|
27
|
+
readonly logRecord: InspectorInjected['keyedHooks']['record'];
|
|
28
|
+
};
|
|
29
|
+
readonly loadOlder: InspectorInjected['loadOlder'];
|
|
30
|
+
readonly objects: InspectorObjects;
|
|
31
|
+
/** @param key - Row identity. @param mode - Current table. @returns Current raw type for filtering. */
|
|
32
|
+
readonly recordType: (key: string, mode: InspectorPresentation) => string | undefined;
|
|
33
|
+
/** @param key - Selected log row. @returns Its exact or approximate placement in the main Chat. */
|
|
34
|
+
readonly logChatTarget: (key: string) => InspectorChatTarget | undefined;
|
|
35
|
+
/** @param target - Picked Chat identity. @param mode - Current table. @returns Its closest loaded row, when available. */
|
|
36
|
+
readonly pickRow: (target: InspectorPickTarget, mode: InspectorPresentation) => string | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Sidebar Session source and Inspector-owned actions and data. */
|
|
39
|
+
export type SessionInspectorProps = Pick<PropsRuntime<'sidebar.right.pane.tab'>, 'useSession'> & InjectFace<SessionInspectorInjected> & PropsLocale<'session-inspector'>;
|
|
40
|
+
/** @param props - Session-bound sources. @returns One Inspector with an in-toolbar presentation selector. */
|
|
41
|
+
export declare function SessionInspectorView(props: SessionInspectorProps): import("react").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=View.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** DOM lookups owned by the experimental Inspector, using existing Slot and Chat attributes. */
|
|
2
|
+
import type { InspectorChatTarget } from '../objects.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Check an existing element's mounted and ancestor visibility without revealing it.
|
|
5
|
+
* @param element - Candidate element.
|
|
6
|
+
* @returns Whether CSS and hidden ancestors allow it to be displayed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function displayed(element: HTMLElement): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Find the displayed main Chat's outer flow column without entering a Sidebar or nested View.
|
|
11
|
+
* @returns The current Chat column, or undefined while another View is selected.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mainChatRoot(): HTMLElement | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Restrict a DOM match to the selected Chat column and its own Conversation View.
|
|
16
|
+
* @param element - Candidate node, including SVG children.
|
|
17
|
+
* @param root - Main Chat column.
|
|
18
|
+
* @returns Whether the candidate belongs to that occurrence.
|
|
19
|
+
*/
|
|
20
|
+
export declare function inChat(element: Element, root: HTMLElement): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Enumerate exact and approximate occurrences without changing their display state.
|
|
23
|
+
* @param root - Current main Chat column.
|
|
24
|
+
* @param targets - Exact identities followed by nearby loaded Node identities.
|
|
25
|
+
* @returns Unique candidates, with the requested Turn's occurrences before other Turns.
|
|
26
|
+
*/
|
|
27
|
+
export declare function findChatTargets(root: HTMLElement, targets: readonly InspectorChatTarget[]): readonly HTMLElement[];
|
|
28
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Clipping geometry for the Inspector's element-picker overlay outside the Chat subtree. */
|
|
2
|
+
/**
|
|
3
|
+
* Intersect a Chat box with its scrollports and the transcript area above the composer.
|
|
4
|
+
* @param element - Existing Chat Node, call, or Group box.
|
|
5
|
+
* @returns The visible rectangle, or undefined when the target is outside the conversation viewport.
|
|
6
|
+
*/
|
|
7
|
+
export declare function visibleChatRect(element: HTMLElement): {
|
|
8
|
+
readonly left: number;
|
|
9
|
+
readonly top: number;
|
|
10
|
+
readonly width: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Place an Inspector overlay without changing the Chat content box.
|
|
15
|
+
* @param overlay - Inspector-owned fixed-position element.
|
|
16
|
+
* @param element - Existing Chat Node, call, or Group box.
|
|
17
|
+
* @returns Whether any part of the target remains visible after clipping.
|
|
18
|
+
*/
|
|
19
|
+
export declare function placeChatHighlight(overlay: HTMLElement, element: HTMLElement): boolean;
|
|
20
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Chat table order follows root references and group membership, independently of row data. */
|
|
2
|
+
import type { ConversationBinding } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
import { type ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
4
|
+
import { type InspectorRecord, type InspectorRow } from '../table-model.ts';
|
|
5
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
6
|
+
import type { InspectorObjects } from '../objects.ts';
|
|
7
|
+
import { type InspectorPickTarget } from './pick-match.ts';
|
|
8
|
+
/** Observes structural Chat changes while visible rows observe their own Node or Group. */
|
|
9
|
+
export declare class ChatNodeModel implements ObservableSnapshot<readonly InspectorRow[]> {
|
|
10
|
+
private readonly binding;
|
|
11
|
+
private readonly rows;
|
|
12
|
+
private readonly sources;
|
|
13
|
+
private readonly groups;
|
|
14
|
+
private entries;
|
|
15
|
+
private order;
|
|
16
|
+
private keys;
|
|
17
|
+
private anchors;
|
|
18
|
+
private nodeStore;
|
|
19
|
+
private grouped;
|
|
20
|
+
private subscribers;
|
|
21
|
+
private disconnect;
|
|
22
|
+
private queued;
|
|
23
|
+
private readonly targets;
|
|
24
|
+
private readonly objectIndex;
|
|
25
|
+
/** @param binding - Existing target-neutral Conversation binding for the inspected Session. */
|
|
26
|
+
constructor(binding: ConversationBinding);
|
|
27
|
+
/**
|
|
28
|
+
* Bind object references and publication updates to the inspected Session.
|
|
29
|
+
* @param sessionId - Session displayed by this model.
|
|
30
|
+
* @returns Weak object lookup and row navigation for its details.
|
|
31
|
+
*/
|
|
32
|
+
objects(sessionId: SessionId): InspectorObjects;
|
|
33
|
+
/** @returns Stable flattened group/node order. */
|
|
34
|
+
getSnapshot: () => readonly InspectorRow[];
|
|
35
|
+
/**
|
|
36
|
+
* Match a picked Chat object against the current table, including folded children.
|
|
37
|
+
* @param target - Picked Chat identities.
|
|
38
|
+
* @returns Closest current Node or Group row, or undefined without a match.
|
|
39
|
+
*/
|
|
40
|
+
pick(target: InspectorPickTarget): string | undefined;
|
|
41
|
+
/** @param listener - Structural invalidation callback. @returns Its disposer. */
|
|
42
|
+
subscribe: (listener: () => void) => (() => void);
|
|
43
|
+
/**
|
|
44
|
+
* Read a loaded row without adding a subscription.
|
|
45
|
+
* @param key - Stable table position.
|
|
46
|
+
* @returns Cached Node or Group metadata source, or undefined outside the loaded rows.
|
|
47
|
+
*/
|
|
48
|
+
row: (key: string) => ObservableSnapshot<InspectorRecord | undefined> | undefined;
|
|
49
|
+
private refresh;
|
|
50
|
+
private schedule;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Weak identity index for materialized Nodes, Groups, Turn/Step locations, and their Data readers. */
|
|
2
|
+
import type { ConversationBinding } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
import type { InspectorObjectReference } from '../objects.ts';
|
|
4
|
+
type Reference = Omit<InspectorObjectReference, 'rowKey'>;
|
|
5
|
+
/** Indexes each immutable publication once, without retaining its objects or node arrays. */
|
|
6
|
+
export declare class ChatObjectIndex {
|
|
7
|
+
private readonly binding;
|
|
8
|
+
private readonly identities;
|
|
9
|
+
private readonly indexed;
|
|
10
|
+
/** @param binding - Existing Session-owned Conversation reader. */
|
|
11
|
+
constructor(binding: ConversationBinding);
|
|
12
|
+
/**
|
|
13
|
+
* Resolve an original object without retaining replaced publications.
|
|
14
|
+
* @param value - Original object identity.
|
|
15
|
+
* @returns Its named reference, including older identities, or undefined when unregistered.
|
|
16
|
+
*/
|
|
17
|
+
reference(value: object): Reference | undefined;
|
|
18
|
+
private chat;
|
|
19
|
+
private register;
|
|
20
|
+
private location;
|
|
21
|
+
private refresh;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=objects.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Replaceable element-to-record matching rules for the Inspector's Chat picker. */
|
|
2
|
+
import type { InspectorChatTarget } from '../objects.ts';
|
|
3
|
+
/** Chat identities enriched with the Node's loaded log coordinates before row lookup. */
|
|
4
|
+
export interface InspectorPickTarget extends InspectorChatTarget {
|
|
5
|
+
readonly anchorSeq?: number;
|
|
6
|
+
readonly nodeKind?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A visible Chat box and its most specific available identity. */
|
|
9
|
+
export interface InspectorElementMatch {
|
|
10
|
+
readonly element: HTMLElement;
|
|
11
|
+
readonly target: InspectorPickTarget;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Match tool-call boxes and Node parts before Group or Turn containers; never compare rendered text.
|
|
15
|
+
* @param element - Pointer target in the main Chat.
|
|
16
|
+
* @param root - Inspected Session's displayed main Chat column.
|
|
17
|
+
* @returns Candidate identities and the box to preview, or undefined outside matching content.
|
|
18
|
+
*/
|
|
19
|
+
export declare function matchChatElement(element: Element, root: HTMLElement): InspectorElementMatch | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Prefer an exact Node part, then its Node, Group, Step, or Turn table row.
|
|
22
|
+
* @param target - Picked identities.
|
|
23
|
+
* @param rows - Current row identities, including members of folded Inspector groups.
|
|
24
|
+
* @returns The closest materialized table row, or undefined when none matches.
|
|
25
|
+
*/
|
|
26
|
+
export declare function matchChatNodeRow(target: InspectorPickTarget, rows: ReadonlyMap<string, InspectorChatTarget>): string | undefined;
|
|
27
|
+
//# sourceMappingURL=pick-match.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** One-shot Inspector picking through a real click-catching mask over the main Chat. */
|
|
2
|
+
import { type InspectorPickTarget } from './pick-match.ts';
|
|
3
|
+
/** Owns the mask, preview, and geometry observers for one picking gesture. */
|
|
4
|
+
export declare class InspectorChatPicker {
|
|
5
|
+
private readonly getRoot;
|
|
6
|
+
private readonly owner;
|
|
7
|
+
private readonly picked;
|
|
8
|
+
private readonly cancelled;
|
|
9
|
+
private readonly released;
|
|
10
|
+
private mask;
|
|
11
|
+
private overlay;
|
|
12
|
+
private root;
|
|
13
|
+
private observing;
|
|
14
|
+
private resizing;
|
|
15
|
+
/**
|
|
16
|
+
* @param getRoot - Current Session's displayed main Chat.
|
|
17
|
+
* @param owner - Inspector button; hiding or removing it cancels picking.
|
|
18
|
+
* @param picked - True completes selection; false keeps the mask for another pick.
|
|
19
|
+
* @param cancelled - Clear the owning panel's picking state.
|
|
20
|
+
* @param released - Forget this gesture after its DOM resources are released.
|
|
21
|
+
*/
|
|
22
|
+
constructor(getRoot: () => HTMLElement | undefined, owner: HTMLElement, picked: (target: InspectorPickTarget) => boolean, cancelled: () => void, released: () => void);
|
|
23
|
+
/**
|
|
24
|
+
* Begin picking in the visible main Chat.
|
|
25
|
+
* @returns Whether a visible Chat was found and its mask installed.
|
|
26
|
+
*/
|
|
27
|
+
start(): boolean;
|
|
28
|
+
/** Remove the mask and observers without calling panel callbacks during unmount. */
|
|
29
|
+
dispose(): void;
|
|
30
|
+
private currentRoot;
|
|
31
|
+
private readonly position;
|
|
32
|
+
private readonly verify;
|
|
33
|
+
private hit;
|
|
34
|
+
private readonly hide;
|
|
35
|
+
/** Stop the gesture and clear its owning panel's picking state. */
|
|
36
|
+
readonly cancel: () => void;
|
|
37
|
+
private readonly move;
|
|
38
|
+
private readonly suppress;
|
|
39
|
+
private readonly click;
|
|
40
|
+
private readonly wheel;
|
|
41
|
+
private readonly keydown;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=picker.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Precise and nearby Chat reveal candidates from the Inspector's loaded Chat snapshot. */
|
|
2
|
+
import type { InspectorChatTarget } from '../objects.ts';
|
|
3
|
+
import type { ChatConversationViewNode } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
4
|
+
/**
|
|
5
|
+
* Preserve the primary identity or tool/exact/kind/nearest placement, then rank visible neighbors.
|
|
6
|
+
* Explicit-node primaries include missing model coordinates, even when the node is hidden.
|
|
7
|
+
* Request coordinates take precedence over the node's position.
|
|
8
|
+
* Without a known anchor sequence, only the original target is returned.
|
|
9
|
+
* @param target - Object identity or original event coordinates supplied by another View.
|
|
10
|
+
* @param nodes - Current Session's loaded Chat nodes; equal-distance candidates retain input order.
|
|
11
|
+
* @returns Primary target followed by distinct Step, Turn, and Session neighbors with only node coordinates.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveChatRevealTargets(target: InspectorChatTarget, nodes: readonly ChatConversationViewNode[]): readonly InspectorChatTarget[];
|
|
14
|
+
//# sourceMappingURL=reveal-target.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Inspector-owned DOM reveal and native scrolling, without a Conversation request channel. */
|
|
2
|
+
import type { InspectorChatTarget } from '../objects.ts';
|
|
3
|
+
/** Owns one deferred reveal and body-level flash, without modifying Chat content nodes. */
|
|
4
|
+
export declare class InspectorChatRevealer {
|
|
5
|
+
private readonly getRoot;
|
|
6
|
+
private frame;
|
|
7
|
+
private overlay;
|
|
8
|
+
private animation;
|
|
9
|
+
private cancelScroll;
|
|
10
|
+
/** @param getRoot - Current Session's main Chat, or undefined when it is not displayed. */
|
|
11
|
+
constructor(getRoot: () => HTMLElement | undefined);
|
|
12
|
+
/**
|
|
13
|
+
* Reveal the first usable occurrence, falling back to the displayed Chat column.
|
|
14
|
+
* Hidden or empty candidates do not prevent nearby content from being highlighted.
|
|
15
|
+
* The highlight waits for scrolling to settle; reduced-motion mode scrolls immediately without a flash.
|
|
16
|
+
* @param targets - Exact and approximate Node, Group, or Turn identities in preference order.
|
|
17
|
+
*/
|
|
18
|
+
reveal(targets: readonly InspectorChatTarget[]): void;
|
|
19
|
+
/** Cancel pending native scrolling and remove the Inspector-owned overlay. */
|
|
20
|
+
dispose(): void;
|
|
21
|
+
private queueFlash;
|
|
22
|
+
private smoothScroll;
|
|
23
|
+
private flash;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=reveal.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Type-specific horizontal previews without changing raw inspector data. */
|
|
2
|
+
/** Maximum text length of a horizontal row preview. */
|
|
3
|
+
export declare const INSPECTOR_PREVIEW_LIMIT = 240;
|
|
4
|
+
/**
|
|
5
|
+
* Format horizontal data with type-specific delta fields and bounded nesting.
|
|
6
|
+
* @param value - Original row data, which remains unchanged for JSON inspection.
|
|
7
|
+
* @param hiddenRootFields - Additional top-level metadata already displayed in the owning table's columns.
|
|
8
|
+
* @returns A bounded preview omitting type, sequence, top-level time, and singleton field names.
|
|
9
|
+
*/
|
|
10
|
+
export declare function inspectorPreview(value: unknown, hiddenRootFields?: readonly string[]): string;
|
|
11
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Session-scoped Sidebar tab backed by the existing Chat and Session-log models. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/**
|
|
4
|
+
* Register the Session Inspector Sidebar page and its Session-scoped sources.
|
|
5
|
+
* @param ctx - Client plugin context owning the tab registration and Session-bound model cache.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerInspectorTab(ctx: Context): void;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Shallow, typed runtime-object inspection without JSON conversion or implicit getter calls. */
|
|
2
|
+
/** One original field or collection entry, evaluated only when its parent is expanded. */
|
|
3
|
+
export interface InspectorObjectEntry {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly value: unknown;
|
|
7
|
+
readonly accessor?: boolean;
|
|
8
|
+
/** An array slot without an own property, distinct from an explicit undefined value. */
|
|
9
|
+
readonly absent?: boolean;
|
|
10
|
+
/** Synthetic disclosure for non-index collection properties. */
|
|
11
|
+
readonly properties?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Display of one value; child enumeration never recursively visits child values. */
|
|
14
|
+
export declare class InspectorObjectValue {
|
|
15
|
+
private readonly value;
|
|
16
|
+
/** Shallow type or scalar preview; no child getters are evaluated. */
|
|
17
|
+
readonly label: string;
|
|
18
|
+
/** Whether this value permits child enumeration rather than opaque scalar display. */
|
|
19
|
+
readonly expandable: boolean;
|
|
20
|
+
/** @param value - Original runtime value, including Maps, Sets, and class instances. */
|
|
21
|
+
constructor(value: unknown);
|
|
22
|
+
/**
|
|
23
|
+
* Enumerate one level without evaluating accessors or descending into children.
|
|
24
|
+
* @returns Original children; Map keys remain values rather than being coerced to property names.
|
|
25
|
+
*/
|
|
26
|
+
entries(): IterableIterator<InspectorObjectEntry>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=object-value.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Session-local object references used by the Chat Inspector's detail tree. */
|
|
2
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
3
|
+
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
4
|
+
/**
|
|
5
|
+
* Inspector-owned coordinates read from DOM attributes or Chat's string-keyed snapshots.
|
|
6
|
+
* Registry access resolves these strings against current branded references; a DOM value is not itself a validated registry ID.
|
|
7
|
+
*/
|
|
8
|
+
export interface InspectorChatTarget {
|
|
9
|
+
readonly anchorSeq?: number;
|
|
10
|
+
readonly callId?: string;
|
|
11
|
+
readonly rootCallId?: string;
|
|
12
|
+
readonly nodeKey?: string;
|
|
13
|
+
readonly nodeKind?: string;
|
|
14
|
+
readonly groupKey?: string;
|
|
15
|
+
readonly groupPart?: string;
|
|
16
|
+
readonly turn?: number;
|
|
17
|
+
readonly step?: number;
|
|
18
|
+
}
|
|
19
|
+
/** A named object whose current value can be inspected independently. */
|
|
20
|
+
export interface InspectorObjectReference {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly kind: 'node' | 'nodeData' | 'group' | 'groupData' | 'turn' | 'turnData' | 'step' | 'stepData';
|
|
23
|
+
readonly identity: string;
|
|
24
|
+
readonly target: InspectorChatTarget;
|
|
25
|
+
readonly rowKey?: string;
|
|
26
|
+
/** @returns Latest loaded value, or undefined after removal. */
|
|
27
|
+
readonly read: () => unknown;
|
|
28
|
+
}
|
|
29
|
+
/** Object-identity lookup for one inspected Session. */
|
|
30
|
+
export interface InspectorObjects {
|
|
31
|
+
readonly sessionId: SessionId;
|
|
32
|
+
/** Conversation publications invalidate cached fields of identity-stable Data readers. */
|
|
33
|
+
readonly updates: ObservableSnapshot<object>;
|
|
34
|
+
/** @param value - An original runtime object. @returns Its named reference, when indexed. */
|
|
35
|
+
readonly reference: (value: object) => InspectorObjectReference | undefined;
|
|
36
|
+
/** @param key - Inspector table row. @returns Its reference and exact Chat group part. */
|
|
37
|
+
readonly row: (key: string) => InspectorObjectReference | undefined;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=objects.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** JSON inspection of live objects, including cyclic Location stores. */
|
|
2
|
+
/**
|
|
3
|
+
* Serialize raw details without allowing a formatting failure to retire the View.
|
|
4
|
+
* @param value - Original record; Maps/Sets become objects/arrays and bigint becomes an n-suffixed string.
|
|
5
|
+
* @returns JSON with circular references marked, or an error message for the detail panel.
|
|
6
|
+
*/
|
|
7
|
+
export declare function inspectorJson(value: unknown): {
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly failed: boolean;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=raw-json.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Original log coordinates submitted for target-owned Chat reveal. */
|
|
2
|
+
import type { SessionEventLike } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
3
|
+
import type { StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import type { InspectorChatTarget } from '../objects.ts';
|
|
5
|
+
/** Original owning event and, for an Assistant child row, its selected stream chunk. */
|
|
6
|
+
export interface SessionLogAnchor {
|
|
7
|
+
readonly event: SessionEventLike;
|
|
8
|
+
readonly chunk?: StreamChunk;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Describe a log record without reading another View's model or DOM.
|
|
12
|
+
* @param anchor - Original log event and optional selected delta.
|
|
13
|
+
* @returns Original event coordinates and any tool-call or Assistant-part identity.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sessionLogChatTarget(anchor: SessionLogAnchor): InspectorChatTarget;
|
|
16
|
+
//# sourceMappingURL=chat-target.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Turn and Step start/end ranges add ancestry without inventing or reordering log records. */
|
|
2
|
+
import type { SessionEventLike } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
3
|
+
import type { InspectorRow } from '../table-model.ts';
|
|
4
|
+
/** One ordered pass over the loaded log; missing starts do not create synthetic headers. */
|
|
5
|
+
export declare class SessionLogGroups {
|
|
6
|
+
private turn;
|
|
7
|
+
private step;
|
|
8
|
+
/**
|
|
9
|
+
* Place a record inside its open Step or Turn, retaining end records as the final children.
|
|
10
|
+
* Turn and Step headers remain expanded after their end; manual folding stays table-local.
|
|
11
|
+
* @param row - Ungrouped event row.
|
|
12
|
+
* @param event - Original event.
|
|
13
|
+
* @returns The same row identity with range ancestry and depth.
|
|
14
|
+
*/
|
|
15
|
+
append(row: InspectorRow, event: SessionEventLike): InspectorRow;
|
|
16
|
+
private child;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=groups.d.ts.map
|