mouliangyu/dsh-plugins--packages-session-control1

dsh-session-control

DeepSeek Harness 的全局会话与工作区管理插件

AI 分析

核心用途是向模型暴露会话创建、项目切换等工具,实现模型自主的会话与工作区控制。适合需要构建多任务、跨项目自主协作 Agent 的高级开发者。

套件
dsh-session-control
版本
0.1.0
授權
MIT
最近更新
2026年8月17日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mouliangyu/dsh-plugins#3732024834904914ee5dc4ed0ee39c0185d7b31b&path:packages/session-control

dsh-session-control

English | 中文

Model-facing session and top-level project management for DeepSeek Harness. The Cordis plugin id is session_control; the Web settings title is Session & Workspace Control.

Global access is enabled by default. Turn it off in Settings > Plugins > Plugin configuration > Session & Workspace Control to restrict operations to the caller's current workspace.

Tool Contract

ToolAction
session_createCreate a related session in the caller's or a selected workspace and queue its initial task.
session_listList all accessible sessions with id, location, title, and live status.
session_sendResume a persisted session when needed and queue more work.
session_stopStop a live target session while preserving queued input.
session_archiveOptional. Archive a completed target session after explicit user authorization.
workspace_listList accessible projects with stable ids, paths, status, and session counts.
workspace_createRegister an existing directory as a top-level DSH project.
workspace_renameChange a project's display title without moving its directory.
workspace_removeRemove only the DSH project registration; files and session logs are retained.
workspace_sessionsList sessions belonging to one project.

session_list labels every result with its workspace title or unassigned. Pass a workspace_id returned by workspace_list to session_create to create the session in another project. Without it, creation uses the caller's current workspace so the new session has a concrete filesystem identity.

New sessions are ordinary DSH workspace sessions. They appear in the existing Web sidebar and use its normal live status, title, and persistence behavior.

Install

This package includes prebuilt Host and Web client bundles. Local link: installation persists across DSH restarts because the profile records the package dependency and bundle layer.

cd deepseek-harness
pnpm dsh plugin --profile web add link:/absolute/path/to/dsh-plugins/packages/session-control
pnpm dsh web

The package declares its DSH bundle in cordis.patch.yml, so installation does not require a source build.

Development

From the repository root:

pnpm install
pnpm run check
pnpm --filter dsh-session-control pack --pack-destination ./artifacts

The source layout follows DSH hybrid Host/Web packages: src/index.ts is the Host entry, src/client/index.tsx is the Web entry, and src/invariant.ts is the invariant companion. Generated declarations are written under lib/types/; distributable bundles are lib/index.js, lib/invariant.js, and lib/client.js.

Upstream's published client package dependency closure is currently incomplete, so this external repository uses narrow compile-time declarations for DSH services and ships verified bundles. DSH packages remain runtime peer dependencies supplied by the active profile.

The behavior suite invokes the tools registered by the production apply() entry and covers lifecycle, authorization, project management, cleanup, and the settings HTTP boundary. See TESTING.md for the release matrix and manual DSH smoke procedure.

Safety Model

Global access is enabled by default. The UI switch writes the durable session-control.allowGlobalAccess user setting and takes effect immediately. Set it to false to require every target session and project to belong to the caller's current workspace; project creation is disabled in restricted mode. Archiving is disabled by default because it changes the user's visible history. Set allowArchive: true only together with a user-confirmation policy in the deployment.

Current Limitations

  • Remote execution belongs to a separate plugin and is not implemented here.
  • It does not delete session logs.
  • Session titles are produced by the normal DSH title pipeline and may initially appear as untitled.
  • The package targets the upstream developer preview and must be checked against the installed DSH version before production use.