mirror of
https://github.com/zhu1090093659/dsh-web.git
synced 2026-09-28 14:24:03 +08:00
Adapt dsh-web to the experimental @deepseek-ai/dsh-* 0.1.6-alpha.2 cohort in the
same isolated alpha worktree and DSH home, so the accepted 0.1.5-rc.1 stable
environment, its profile tree and the global dsh CLI stay untouched.
Cohort: every consumed range, the plugin scaffold, the root README badges, the
CI and release mount-smoke pins, the desktop runtime pin and its lockfile, both
release-age exclusion lists and the desktop overrides block move to
0.1.6-alpha.2; the declared host floor becomes dsh.engines.dsh >=0.1.6-alpha.2.
cordis, cosmokit and schemastery keep their independent support pins.
@deepseek-ai/dsh-client-ui-workspace joins the repository exclusion list and the
packages that navigate gained it as a devDependency, because the family now
consumes it directly.
Adaptation of the SDK delta - the multi-instance Client Session model:
- SessionListState.current/currentAddress and SessionSummary.completed are gone,
and ISessions.open()/openSubagent()/clear() are removed. View selection now
belongs to the workspace UI, which owns the main-area reference and publishes
it as retainedBy.mainView; navigation is ctx.uiWorkspace.openSession(target).
- shared/client/main-session.ts adds mainViewSessionId(byId), the catalog-level
reading of that marker, and sync-shared copies it into the seven consumers.
Ten call sites across eight packages read the removed faces; two of them
(git-graph auto-isolation, session-archive) type-checked against local
structural doubles and never appeared in the compiler's error list, so the
inventory was built by searching for the removed names rather than by
trusting tsc.
- dsh-task-board's framework-free controller port changes from a list snapshot
to { current(), open(), subscribe() }; the wiring resolves current() from the
marker. dsh-git-graph navigates new worktree sessions through the workspace UI.
dsh-pet, dsh-plugin-manager, dsh-doctor, dsh-liangshen, dsh-session-id and
dsh-session-archive read the marker instead of the removed selection.
Upstream packaging defect: dsh-client-ui-primitives@0.1.6-alpha.2 imports
simple-icons from its emitted lib/index.js while the published manifest still
declares no runtime dependencies; packageExtensions restores it at the exact pin
the official source resolves (16.31.0), beside the existing diff/shiki/micromark
restorations. No installed file is patched.
Native-first: no family row registers the new sidebar panel slots, and the
alpha.1 to alpha.2 slot-key comparison is additive only. dsh-plugin-manager
already extends the official Plugins section through settings.plugins.tab rather
than mounting a parallel page, and that stays the right native extension. The
aggregate declares no external npm plugin, so the new runtime plugin dependency
resolution has no external hard-binding to unmask. The inject contract records
dsh-client-ui-workspace as an approved inject module with its rationale.
Testing: pnpm typecheck, sync-shared:check, skin-center:check, community:check,
libs:check, build, test, test:scripts, test:desktop, runtime-deps:check,
aggregate:check, emoji:check, test:standards, docs:check, i18n:check and
market:check pass, and pnpm install --frozen-lockfile --ignore-scripts resolves
the lockfile. The alpha host in ~/.dsh-alpha is upgraded to 0.1.6-alpha.2 and
every profile @deepseek-ai copy is a symlink into it (235 ok, 0 warn, 0 fail);
dsh --profile alpha-web --dump-config composes the family rows with the retired
ui-settings-unarchive-sessions row.
43 lines
2.0 KiB
TypeScript
43 lines
2.0 KiB
TypeScript
/**
|
|
* Main-view Session derivation for the multi-instance Client Session model.
|
|
*
|
|
* The Client Session Controller carries no global "current" selection: view
|
|
* selection belongs to the workspace UI, which owns the main-area reference and
|
|
* publishes it through the catalog's per-source ownership counts
|
|
* (`SessionSummary.retainedBy.mainView`). A plugin that needs the Session the
|
|
* main view shows derives it from that marker instead of the removed
|
|
* `SessionListState.current` field.
|
|
*
|
|
* The marker describes view ownership, not authority. It is the right input for
|
|
* presentation and for deciding which view a navigation targets; it is not a
|
|
* business fallback, because source counts never imply visibility or success.
|
|
* @module dsh-web/shared/main-session
|
|
*/
|
|
|
|
/** The catalog row subset this helper reads (a `SessionSummary` projection). */
|
|
export interface MainViewOwnedRow<Id extends string = string> {
|
|
/** Catalog row identity. */
|
|
readonly id: Id
|
|
/** Per-source local ownership counts; absent rows are never owned. */
|
|
readonly retainedBy?: Readonly<Partial<Record<string, number>>> | undefined
|
|
}
|
|
|
|
/**
|
|
* Resolve the Session the main view currently shows.
|
|
*
|
|
* Reads the catalog's rows rather than a per-id retain-info source: ownership
|
|
* counts ride the list snapshot, so this neither allocates observers nor opens
|
|
* history, and a subscription to the list still fires when the selection moves.
|
|
* @param byId - the session catalog's rows (`SessionListState.byId`), when available.
|
|
* @returns the main-view session id, or undefined when the main view shows none.
|
|
*/
|
|
export function mainViewSessionId<Id extends string>(
|
|
byId: Readonly<Record<Id, MainViewOwnedRow<Id> | undefined>> | undefined | null,
|
|
): Id | undefined {
|
|
if (byId === undefined || byId === null) return undefined
|
|
for (const row of Object.values<MainViewOwnedRow<Id> | undefined>(byId)) {
|
|
if (row !== undefined && (row.retainedBy?.mainView ?? 0) > 0) return row.id
|
|
}
|
|
return undefined
|
|
}
|