Revert "fix: remove redudant export for client plugin"

This reverts commit 48b259100b9cfe2e372eb9fe0924a783988f5a8e.
This commit is contained in:
imccyu
2026-07-22 18:26:48 +08:00
parent 0bd7dbc6b5
commit b649304fe4
18 changed files with 60 additions and 54 deletions

View File

@@ -4,8 +4,6 @@ Sidebar plugin: session multi-level tree (cwd grouping + parentId nesting), sear
`src/client/contract/slots.ts` is the single-domain contract file: `SidebarRootInjected` (the registrant's own injected share — tree hook, current-session hook, actions) and `SidebarRootComponentProps = OwnerOf<'sidebar'> & SidebarRootInjected` (the owner share referenced from ui-layout's slot declaration, never re-stated). `apply` registers SidebarRoot cast-free against that composition; the inject factory binds layout/sessions off `RootBinding<ClientContext>`.
The `/client` export surface is the plugin body (`apply`/`inject`) plus the contract types only — SidebarRoot, the row components, and the tree/store implementation are internal (the slot registration closes over them; tests import src paths directly).
## Model Experience
None, as the sidebar renders the browser session list; nothing here reaches a model request.

View File

@@ -3,10 +3,6 @@
* sidebar slot; tree derivation materialized in a plugin-owned snapshot
* store (pure consumer — no ctx service). Contract: api-contracts v3
* section 6; props composition in contract/slots.ts.
*
* Export discipline: the public surface is the plugin body (apply/inject)
* plus the contract types. Implementation components and derivation live in
* their modules; tests reach them via src paths.
*/
import type { RootBinding } from '@deepseek-ai/dsh-client-ui-slots'
import type { ClientContext, SessionId } from '@deepseek-ai/dsh-client-runtime/client'
@@ -14,6 +10,17 @@ import type { SidebarRootInjected } from './contract/slots.ts'
import { createSidebarTreeStore } from './store.ts'
import { SidebarRoot } from './SidebarRoot.tsx'
export {
deriveRows, formatRelativeTime, projectLabel,
UNGROUPED_KEY, UNGROUPED_LABEL,
type ProjectRow, type SessionRow, type SidebarRow, type TreeView,
} from './tree.ts'
export {
createSidebarTreeStore,
type GroupBy, type SidebarTreeState, type SidebarTreeStore,
} from './store.ts'
export { ProjectRowItem, SessionRowItem } from './Rows.tsx'
export { SidebarRoot } from './SidebarRoot.tsx'
export type {
SidebarActions, SidebarRootComponentProps, SidebarRootInjected, SidebarTreeActions,
} from './contract/slots.ts'

View File

@@ -10,9 +10,10 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import { act } from 'react'
import { createSnapshotStore } from '@deepseek-ai/dsh-client-web-react'
import type { SessionId, SessionListState, SessionSummary } from '@deepseek-ai/dsh-client-runtime/client'
import { createSidebarTreeStore, type SidebarTreeStore } from '../src/client/store.ts'
import { SidebarRoot } from '../src/client/SidebarRoot.tsx'
import type { SidebarActions } from '@deepseek-ai/dsh-client-ui-sidebar/client'
import {
createSidebarTreeStore, SidebarRoot,
type SidebarActions, type SidebarTreeStore,
} from '@deepseek-ai/dsh-client-ui-sidebar/client'
const sid = (s: string) => s as SessionId

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'
import { createSnapshotStore } from '@deepseek-ai/dsh-client-web-react'
import type { SessionId, SessionListState, SessionSummary } from '@deepseek-ai/dsh-client-runtime/client'
import { createSidebarTreeStore } from '../src/client/store.ts'
import { createSidebarTreeStore } from '@deepseek-ai/dsh-client-ui-sidebar/client'
const sid = (s: string) => s as SessionId

View File

@@ -3,7 +3,7 @@ import type { SessionId, SessionListState, SessionSummary } from '@deepseek-ai/d
import {
deriveRows, formatRelativeTime, projectLabel, UNGROUPED_KEY, UNGROUPED_LABEL,
type SessionRow, type TreeView,
} from '../src/client/tree.ts'
} from '@deepseek-ai/dsh-client-ui-sidebar/client'
const sid = (s: string) => s as SessionId