@robiteame/dsh-client-ui-session-tree 0.1.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/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // packages/client/ui-session-tree/src/index.ts
2
+ function apply() {
3
+ }
4
+ export {
5
+ apply
6
+ };
@@ -0,0 +1,12 @@
1
+ // packages/client/ui-session-tree/src/invariant.ts
2
+ var PACKAGE_NAME = "@robiteame/dsh-client-ui-session-tree";
3
+ var name = "client-ui-session-tree-invariant";
4
+ var inject = ["invariants"];
5
+ var install = () => {
6
+ };
7
+ var apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
8
+ export {
9
+ apply,
10
+ inject,
11
+ name
12
+ };
@@ -0,0 +1,39 @@
1
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
3
+ import type { JumpView, SessionTreeView } from '@robiteame/dsh-pi-agent-session-tree/client';
4
+ export interface SessionTreeOverlayState {
5
+ open: boolean;
6
+ nativePanel: boolean;
7
+ }
8
+ /** Minimal external store shared by the command listener and the React drawer. */
9
+ export declare class SessionTreeOverlayController {
10
+ private state;
11
+ private readonly listeners;
12
+ readonly getSnapshot: () => SessionTreeOverlayState;
13
+ readonly subscribe: (listener: () => void) => (() => void);
14
+ open(): void;
15
+ close(): void;
16
+ setNativePanel(nativePanel: boolean): void;
17
+ dispose(): void;
18
+ private update;
19
+ }
20
+ export interface SessionTreeRemoteActions {
21
+ load(sessionId: SessionId): Promise<SessionTreeView>;
22
+ jump(sessionId: SessionId, nodeId: string | null): Promise<JumpView>;
23
+ fork(sessionId: SessionId, nodeId: string, branch: string): Promise<{
24
+ cursor: string;
25
+ branch: string;
26
+ forkCount: number;
27
+ }>;
28
+ onRefresh(sessionId: SessionId, callback: () => void): () => void;
29
+ }
30
+ export type SessionTreeOverlayProps = PropsRuntime<'shell.overlay'> & PropsLocale<'session-tree'> & {
31
+ controller: SessionTreeOverlayController;
32
+ remoteActions: SessionTreeRemoteActions;
33
+ };
34
+ /**
35
+ * Render an additive right-side drawer without replacing Harness' Tool details
36
+ * occupant. The root stays mounted as a browser-visible activation marker;
37
+ * only the drawer opts back into pointer events.
38
+ */
39
+ export declare function SessionTreeOverlay({ controller, remoteActions, useSessions, t, }: SessionTreeOverlayProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { SessionTreeViewProps } from './slots.ts';
3
+ export declare function SessionTreePanel({ closeDetails, sessionId, load, jump, select, fork, onRefresh, t }: SessionTreeViewProps & PropsLocale<'session-tree'>): import("react").JSX.Element;
4
+ export declare function SessionTreeDock(props: SessionTreeViewProps & PropsLocale<'session-tree'>): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /** Browser half of the session-tree extension: a right-details-sidebar panel. */
2
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ import type { CommandResult } from '@deepseek-ai/dsh-commands/types';
5
+ declare module '@deepseek-ai/cordis' {
6
+ interface Events {
7
+ 'command/executed'(sessionId: SessionId, name: string, result: CommandResult): void;
8
+ }
9
+ }
10
+ import type { SessionTreeView } from '@robiteame/dsh-pi-agent-session-tree/client';
11
+ import { type SessionTreeKey } from './locales.ts';
12
+ export { SessionTreePanel, SessionTreeDock } from './SessionTreePanel.tsx';
13
+ export { SessionTreeOverlay, SessionTreeOverlayController } from './SessionTreeOverlay.tsx';
14
+ export type { SessionTreeOverlayProps, SessionTreeOverlayState } from './SessionTreeOverlay.tsx';
15
+ export type { SessionTreePanelActions, SessionTreeViewProps } from './slots.ts';
16
+ export type { SessionTreeKey } from './locales.ts';
17
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
18
+ interface LocaleNamespaceMap {
19
+ 'session-tree': SessionTreeKey;
20
+ }
21
+ }
22
+ export declare const inject: string[];
23
+ export declare function apply(ctx: ClientContext): Promise<() => Promise<void>>;
24
+ export type LoadedSessionTreeView = SessionTreeView;
@@ -0,0 +1,51 @@
1
+ /** `session-tree` namespace dictionaries. */
2
+ /** Simplified Chinese dictionary (the key-set source of truth). */
3
+ export declare const zh: {
4
+ 'panel.title': string;
5
+ 'panel.open': string;
6
+ 'panel.close': string;
7
+ 'panel.empty': string;
8
+ 'panel.error': string;
9
+ 'panel.branch': string;
10
+ 'panel.nodes': string;
11
+ 'panel.cursor': string;
12
+ 'panel.selectedHint': string;
13
+ 'panel.select': string;
14
+ 'panel.jump': string;
15
+ 'panel.jump.failed': string;
16
+ 'panel.refresh': string;
17
+ 'panel.head': string;
18
+ 'panel.fork': string;
19
+ 'node.role.system': string;
20
+ 'node.role.user': string;
21
+ 'node.role.assistant': string;
22
+ 'node.role.tool': string;
23
+ 'node.summary': string;
24
+ 'node.noMessage': string;
25
+ };
26
+ /** The session-tree namespace key union. */
27
+ export type SessionTreeKey = keyof typeof zh;
28
+ /** English dictionary, checked complete against the zh key set. */
29
+ export declare const en: {
30
+ 'panel.title': string;
31
+ 'panel.open': string;
32
+ 'panel.close': string;
33
+ 'panel.empty': string;
34
+ 'panel.error': string;
35
+ 'panel.branch': string;
36
+ 'panel.nodes': string;
37
+ 'panel.cursor': string;
38
+ 'panel.selectedHint': string;
39
+ 'panel.select': string;
40
+ 'panel.jump': string;
41
+ 'panel.jump.failed': string;
42
+ 'panel.refresh': string;
43
+ 'panel.head': string;
44
+ 'panel.fork': string;
45
+ 'node.role.system': string;
46
+ 'node.role.user': string;
47
+ 'node.role.assistant': string;
48
+ 'node.role.tool': string;
49
+ 'node.summary': string;
50
+ 'node.noMessage': string;
51
+ };
@@ -0,0 +1,23 @@
1
+ /** Session tree's injected face for the right details-sidebar panel seat. */
2
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
3
+ import type { JumpView, SessionTreeView } from '@robiteame/dsh-pi-agent-session-tree/client';
4
+ export interface SessionTreePanelActions {
5
+ load: (sessionId: SessionId) => Promise<SessionTreeView>;
6
+ jump: (nodeId: string | null) => Promise<JumpView>;
7
+ select?: (nodeId: string) => Promise<{
8
+ nodeId: string;
9
+ }>;
10
+ fork: (nodeId: string, branch: string) => Promise<{
11
+ cursor: string;
12
+ branch: string;
13
+ forkCount: number;
14
+ }>;
15
+ onRefresh?: (callback: () => void) => () => void;
16
+ }
17
+ /** Props the visual tree actually consumes, independent of its slot adapter. */
18
+ export type SessionTreeViewProps = SessionTreePanelActions & {
19
+ sessionId: SessionId;
20
+ panel?: string;
21
+ closeDetails?: () => void;
22
+ t: (key: import('./locales.ts').SessionTreeKey) => string;
23
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Session-tree panel plugin, node half. Pure UI plugin: the empty apply exists
3
+ * so the plugin appears in the host cordis.yml / Loader; the browser half
4
+ * ships via exports["./client"], discovered through the package.json
5
+ * dsh.client declaration.
6
+ */
7
+ /** Host plugin body — no host-side behavior for this surface plugin. */
8
+ export declare function apply(): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Package-owned invariant companion for `@robiteame/dsh-client-ui-session-tree`.
3
+ * @module @robiteame/dsh-client-ui-session-tree/invariant
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "client-ui-session-tree-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@robiteame/dsh-client-ui-session-tree",
3
+ "description": "Session-tree WebUI panel: a native right-details-sidebar dock on patched Harness and an additive right-side overlay on official builds",
4
+ "version": "0.1.0",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/robiteame/dsh-session-tree-extension.git",
11
+ "directory": "packages/client/ui-session-tree"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/robiteame/dsh-session-tree-extension/issues"
15
+ },
16
+ "type": "module",
17
+ "main": "lib/index.js",
18
+ "types": "lib/types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/types/index.d.ts",
22
+ "default": "./lib/index.js"
23
+ },
24
+ "./invariant": {
25
+ "types": "./lib/types/invariant.d.ts",
26
+ "default": "./lib/invariant.js"
27
+ },
28
+ "./client": {
29
+ "types": "./lib/types/client/index.d.ts",
30
+ "default": "./lib/client.js"
31
+ },
32
+ "./package.json": "./package.json"
33
+ },
34
+ "dsh": {
35
+ "client": {
36
+ "inject": [
37
+ "@deepseek-ai/dsh-api-remotes",
38
+ "@deepseek-ai/dsh-client-locale",
39
+ "@deepseek-ai/dsh-client-ui-chat",
40
+ "@deepseek-ai/dsh-client-ui-layout"
41
+ ],
42
+ "platform": "web"
43
+ }
44
+ },
45
+ "scripts": {
46
+ "build": "node ../../../scripts/build.mjs ui",
47
+ "watch": "node ../../../scripts/build.mjs ui"
48
+ },
49
+ "license": "MIT",
50
+ "peerDependencies": {
51
+ "@deepseek-ai/cordis": "^4.0.2"
52
+ },
53
+ "devDependencies": {
54
+ "@robiteame/dsh-pi-agent-session-tree": "^0.1.0",
55
+ "@testing-library/dom": "^10.0.0",
56
+ "@testing-library/react": "^16.1.0",
57
+ "@types/react": "~18.3.1",
58
+ "react": "^18.2.0",
59
+ "react-dom": "^18.2.0"
60
+ },
61
+ "files": [
62
+ "lib/index.js",
63
+ "lib/invariant.js",
64
+ "lib/client.js",
65
+ "lib/types/**/*.d.ts",
66
+ "README.md"
67
+ ],
68
+ "engines": {
69
+ "node": ">=22"
70
+ }
71
+ }