dsh-more 0.0.5 → 0.0.7

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.
Files changed (32) hide show
  1. package/README.md +15 -7
  2. package/README.zh-CN.md +15 -7
  3. package/dist/client.js +1149 -293
  4. package/dist/index.js +406 -156
  5. package/dist/types/generated/host-settings-schema.d.ts +4 -2
  6. package/dist/types/generated/patch-catalog.d.ts +12 -4
  7. package/dist/types/patches/conversation-markdown-export/client/menu.d.ts +5 -0
  8. package/dist/types/patches/model-capabilities/client/api.d.ts +4 -0
  9. package/dist/types/patches/model-capabilities/client/editor.d.ts +26 -0
  10. package/dist/types/patches/model-capabilities/client/index.d.ts +10 -0
  11. package/dist/types/patches/model-capabilities/client/model-entries.d.ts +15 -0
  12. package/dist/types/patches/model-capabilities/client/styles.d.ts +1 -0
  13. package/dist/types/patches/model-capabilities/host/deepseek.d.ts +11 -0
  14. package/dist/types/patches/{model-reasoning-efforts → model-capabilities}/host/validate.d.ts +3 -2
  15. package/dist/types/patches/model-capabilities/shared.d.ts +38 -0
  16. package/dist/types/patches/projectless-tasks/client/adapter.d.ts +17 -0
  17. package/dist/types/patches/projectless-tasks/client/create-task.d.ts +7 -0
  18. package/dist/types/patches/projectless-tasks/client/draft.d.ts +23 -0
  19. package/dist/types/patches/projectless-tasks/client/group-menu.d.ts +2 -0
  20. package/dist/types/patches/projectless-tasks/client/groups.d.ts +21 -0
  21. package/dist/types/patches/projectless-tasks/client/index.d.ts +2 -0
  22. package/dist/types/patches/projectless-tasks/client/new-session.d.ts +34 -0
  23. package/dist/types/patches/projectless-tasks/client/picker.d.ts +26 -0
  24. package/dist/types/patches/projectless-tasks/groups.d.ts +6 -0
  25. package/dist/types/patches/projectless-tasks/host/groups.d.ts +9 -0
  26. package/dist/types/patches/projectless-tasks/host/index.d.ts +5 -0
  27. package/dist/types/patches/projectless-tasks/shared.d.ts +6 -0
  28. package/dsh.plugin.json +1 -1
  29. package/package.json +1 -1
  30. package/dist/types/patches/model-reasoning-efforts/client/index.d.ts +0 -54
  31. package/dist/types/patches/model-reasoning-efforts/shared.d.ts +0 -51
  32. /package/dist/types/patches/{model-reasoning-efforts → model-capabilities}/host/index.d.ts +0 -0
@@ -4,13 +4,15 @@ export declare const PatchSettingsSchema: z<Schemastery.ObjectS<{
4
4
  "message-delete": z<boolean, boolean>;
5
5
  "session-delete": z<boolean, boolean>;
6
6
  "conversation-markdown-export": z<boolean, boolean>;
7
- "model-reasoning-efforts": z<boolean, boolean>;
7
+ "model-capabilities": z<boolean, boolean>;
8
8
  "session-auto-title": z<boolean, boolean>;
9
+ "projectless-tasks": z<boolean, boolean>;
9
10
  }>, Schemastery.ObjectT<{
10
11
  "message-edit": z<boolean, boolean>;
11
12
  "message-delete": z<boolean, boolean>;
12
13
  "session-delete": z<boolean, boolean>;
13
14
  "conversation-markdown-export": z<boolean, boolean>;
14
- "model-reasoning-efforts": z<boolean, boolean>;
15
+ "model-capabilities": z<boolean, boolean>;
15
16
  "session-auto-title": z<boolean, boolean>;
17
+ "projectless-tasks": z<boolean, boolean>;
16
18
  }>>;
@@ -27,9 +27,9 @@ export declare const PATCH_CATALOG: readonly [{
27
27
  readonly order: 400;
28
28
  readonly clientKind: "standalone";
29
29
  }, {
30
- readonly id: "model-reasoning-efforts";
31
- readonly name: "模型思考强度";
32
- readonly description: "在模型配置界面为每个模型配置支持的思考强度并写入 settings.yaml 的 reasoningEfforts";
30
+ readonly id: "model-capabilities";
31
+ readonly name: "模型能力配置";
32
+ readonly description: "在模型配置页设置每个模型的识图能力、可选思考类型与思考参数格式";
33
33
  readonly defaultEnabled: true;
34
34
  readonly order: 500;
35
35
  readonly clientKind: "standalone";
@@ -40,6 +40,13 @@ export declare const PATCH_CATALOG: readonly [{
40
40
  readonly defaultEnabled: true;
41
41
  readonly order: 600;
42
42
  readonly clientKind: "standalone";
43
+ }, {
44
+ readonly id: "projectless-tasks";
45
+ readonly name: "独立任务";
46
+ readonly description: "在工作区下拉框创建独立任务并保留草稿,也可将未分组会话移入工作区列表";
47
+ readonly defaultEnabled: true;
48
+ readonly order: 700;
49
+ readonly clientKind: "standalone";
43
50
  }];
44
51
  export type PatchId = typeof PATCH_CATALOG[number]['id'];
45
52
  export interface PatchSettings {
@@ -47,8 +54,9 @@ export interface PatchSettings {
47
54
  "message-delete": boolean;
48
55
  "session-delete": boolean;
49
56
  "conversation-markdown-export": boolean;
50
- "model-reasoning-efforts": boolean;
57
+ "model-capabilities": boolean;
51
58
  "session-auto-title": boolean;
59
+ "projectless-tasks": boolean;
52
60
  }
53
61
  export declare const DEFAULT_PATCH_SETTINGS: PatchSettings;
54
62
  export declare function decodePatchSettings(value: unknown): PatchSettings | undefined;
@@ -0,0 +1,5 @@
1
+ /** DSH 0.1.5 owns this menu inside session-log-export, without a child slot. */
2
+ export declare function installMarkdownExportMenu(fallback: HTMLButtonElement, options: {
3
+ busy: boolean;
4
+ download: () => void;
5
+ }): () => void;
@@ -0,0 +1,4 @@
1
+ import { type ModelCapabilitiesSnapshot } from '../shared.js';
2
+ /** A stale Host must never look like an editable model or silently skip save. */
3
+ export declare function decodeSnapshot(value: unknown): ModelCapabilitiesSnapshot;
4
+ export declare function readCapabilities(): Promise<ModelCapabilitiesSnapshot>;
@@ -0,0 +1,26 @@
1
+ import { type ModelSettingsNamespace, type ModelCapabilities, type ModelCapabilitiesSnapshot, type ThinkingLevel } from '../shared.js';
2
+ export interface ModelDraft {
3
+ vision: 'default' | 'yes' | 'no';
4
+ thinking: 'default' | 'disabled' | 'custom';
5
+ levels: Partial<Record<ThinkingLevel, {
6
+ enabled: boolean;
7
+ wire: string;
8
+ }>>;
9
+ thinkingFormat: NonNullable<ModelCapabilities['thinkingFormat']> | 'default';
10
+ }
11
+ export declare function draftFromServer(capabilities: ModelCapabilities): ModelDraft;
12
+ export declare function capabilitiesFromDraft(draft: ModelDraft): ModelCapabilities;
13
+ export declare function summaryLabel(capabilities: ModelCapabilities): string;
14
+ export declare function CapabilitiesEditorBody({ draft, setDraft, disabled, api }: {
15
+ draft: ModelDraft;
16
+ setDraft: (updater: (current: ModelDraft) => ModelDraft) => void;
17
+ disabled: boolean;
18
+ api: string | null;
19
+ }): JSX.Element;
20
+ export declare function CapabilitiesEditorModal({ provider, modelId, namespace, onClose, onSaved }: {
21
+ namespace: ModelSettingsNamespace;
22
+ provider: string;
23
+ modelId: string;
24
+ onClose: () => void;
25
+ onSaved: (snapshot: ModelCapabilitiesSnapshot) => void;
26
+ }): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
2
+ export type {} from '@deepseek-ai/dsh-client-ui-settings';
3
+ import type { PatchActivationSource } from '../../../kernel/client/activation.js';
4
+ import type { ClientPatch } from '../../../kernel/client/patch.js';
5
+ export declare function ModelsPageCapabilitiesPortal({ scope, deepseekScope, activation }: {
6
+ deepseekScope: SettingsScope<unknown>;
7
+ scope: SettingsScope<unknown>;
8
+ activation: PatchActivationSource;
9
+ }): JSX.Element | null;
10
+ export declare const clientPatch: ClientPatch;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Locate every model row of every open model catalog in the shipped Models
3
+ * settings page (the provider editor's 模型目录). The classes are the models
4
+ * package's own CSS-module hashes, stable per build.
5
+ */
6
+ export declare function findModelEntries(): HTMLElement[];
7
+ /**
8
+ * Resolve the provider route for one model entry: the editor header's route
9
+ * span when the route differs from the display name, else the owning provider
10
+ * card's display name (which for such providers equals the route). Returns
11
+ * null for the custom-provider creation card, which has no saved provider yet.
12
+ */
13
+ export declare function providerRouteOf(entry: HTMLElement): string | null;
14
+ /** Resolve the model id from a model entry's first row input (the id field). */
15
+ export declare function modelIdOf(entry: HTMLElement): string | null;
@@ -0,0 +1 @@
1
+ export declare const capabilitiesStyles = "\n.dshmore-capabilities-button { box-sizing: border-box; width: 100%; min-height: 30px; color: var(--dsw-alias-label-secondary); font: inherit; cursor: pointer; background: transparent; border: 1px dashed var(--dsw-alias-border-l3); border-radius: 6px; margin-top: 6px; padding: 5px 10px; font-size: 12px; line-height: 18px; text-align: left; overflow-wrap: anywhere; }\n.dshmore-capabilities-button:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }\n.dshmore-capabilities-dialog, .dshmore-capabilities-fields { display: flex; flex-direction: column; gap: 16px; min-width: 0; }\n.dshmore-capabilities-dialog { max-height: 65vh; overflow-y: auto; }\n.dshmore-capabilities-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dsw-alias-label-secondary); }\n.dshmore-capabilities-fields select, .dshmore-capabilities-level input[type=\"text\"] { box-sizing: border-box; min-width: 0; width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 6px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 13px; }\n.dshmore-capabilities-fields :disabled { opacity: .55; cursor: default; }\n.dshmore-capabilities-fields :focus-visible, .dshmore-capabilities-button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }\n.dshmore-capabilities-levels { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 8px; min-width: 0; }\n.dshmore-capabilities-levels legend { font-size: 12px; color: var(--dsw-alias-label-secondary); }\n.dshmore-capabilities-level { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(120px, 1.4fr); gap: 8px; align-items: center; min-height: 32px; }\n.dshmore-capabilities-level label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dsw-alias-label-secondary); }\n.dshmore-capabilities-level input[type=\"checkbox\"] { accent-color: var(--dsw-alias-state-business-primary); }\n.dshmore-capabilities-level small { color: var(--dsw-alias-label-tertiary); }\n.dshmore-capabilities-advanced { border-top: 1px solid var(--dsw-alias-border-l3); padding-top: 12px; }\n.dshmore-capabilities-advanced summary { cursor: pointer; font-size: 13px; color: var(--dsw-alias-label-secondary); }\n.dshmore-capabilities-advanced[open] summary { margin-bottom: 12px; }\n.dshmore-capabilities-note { color: var(--dsw-alias-label-tertiary); margin: 0; font-size: 12px; line-height: 18px; }\n.dshmore-capabilities-error { padding: 8px 10px; border-radius: 8px; background: rgba(208,58,58,.10); color: var(--dsw-alias-state-error-primary, rgb(220,90,90)); font-size: 12px; line-height: 18px; }\n";
@@ -0,0 +1,11 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type ModelReasoningEfforts } from '../shared.js';
3
+ /** Native DeepSeek accepts only these literal levels, not pi-ai wire aliases. */
4
+ export declare function validateDeepSeekEfforts(efforts: ModelReasoningEfforts | null): void;
5
+ /**
6
+ * DSH 0.1.2-rc.1 persists model extension fields, but its native adapter exposes
7
+ * one shared reasoning list. Adapt public methods on this runtime instance so
8
+ * selectors, prepared calls and direct streams use each model's declaration.
9
+ * Native image handling and transport remain with the registered adapter.
10
+ */
11
+ export declare function installDeepSeekReasoning(ctx: Context): () => void;
@@ -1,8 +1,8 @@
1
- import { type ModelReasoningEfforts } from '../shared.js';
1
+ import { type ModelCapabilities, type ModelReasoningEfforts } from '../shared.js';
2
2
  /**
3
3
  * Validate a client-supplied `reasoningEfforts` payload, mirroring the
4
4
  * pi-ai profile rules the adapter enforces when it resolves a route:
5
- * - `null`/`undefined` means "clear" (fall back to the installed catalog).
5
+ * - `null` means "clear" (fall back to DSH defaults).
6
6
  * - `false` means "this model does not reason".
7
7
  * - otherwise a dict whose keys are known levels, whose non-`off` values are
8
8
  * non-empty wire spellings, and which offers at least one level beyond `off`.
@@ -11,3 +11,4 @@ import { type ModelReasoningEfforts } from '../shared.js';
11
11
  * otherwise store a profile the adapter would refuse on its next resolution.
12
12
  */
13
13
  export declare function validateReasoningEfforts(raw: unknown): ModelReasoningEfforts | null;
14
+ export declare function validateCapabilities(raw: Record<string, unknown>): ModelCapabilities;
@@ -0,0 +1,38 @@
1
+ export declare const MODEL_CAPABILITIES_PATCH_ID = "model-capabilities";
2
+ export declare const LLM_PI_AI_SETTINGS_NAMESPACE = "llm-pi-ai";
3
+ export declare const LLM_DEEPSEEK_SETTINGS_NAMESPACE = "llm-deepseek";
4
+ export declare const DEEPSEEK_PROVIDER = "deepseek-official";
5
+ export declare const CAPABILITIES_PROTOCOL_VERSION = 2;
6
+ export type ModelSettingsNamespace = typeof LLM_PI_AI_SETTINGS_NAMESPACE | typeof LLM_DEEPSEEK_SETTINGS_NAMESPACE;
7
+ export declare const DEEPSEEK_THINKING_LEVELS: readonly ["off", "low", "high", "max"];
8
+ export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
9
+ export type ThinkingLevel = typeof THINKING_LEVELS[number];
10
+ export type ModelReasoningEfforts = false | Partial<Record<ThinkingLevel, string | null>>;
11
+ export declare const THINKING_FORMATS: readonly ["openai", "deepseek", "openrouter", "together", "baseten", "zai", "qwen", "chat-template", "qwen-chat-template", "string-thinking", "ant-ling"];
12
+ export type ThinkingFormat = typeof THINKING_FORMATS[number];
13
+ export interface ModelCapabilities {
14
+ /** null removes the model declaration and uses DSH's defaults. */
15
+ vision: boolean | null;
16
+ reasoningEfforts: ModelReasoningEfforts | null;
17
+ thinkingFormat: ThinkingFormat | null;
18
+ }
19
+ export interface ModelCapabilitiesRow extends ModelCapabilities {
20
+ namespace: ModelSettingsNamespace;
21
+ revision: number;
22
+ provider: string;
23
+ providerName: string;
24
+ modelId: string;
25
+ api: string | null;
26
+ }
27
+ export interface ModelCapabilitiesSnapshot {
28
+ protocolVersion: typeof CAPABILITIES_PROTOCOL_VERSION;
29
+ rows: readonly ModelCapabilitiesRow[];
30
+ writable: boolean;
31
+ revision: number | null;
32
+ }
33
+ export interface SaveModelCapabilitiesPayload extends ModelCapabilities {
34
+ namespace: ModelSettingsNamespace;
35
+ provider: string;
36
+ modelId: string;
37
+ expectedRevision: number;
38
+ }
@@ -0,0 +1,17 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ComposerBarOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
3
+ import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
4
+ import type { PatchActivationSource } from '../../../kernel/client/activation.js';
5
+ /** Host and Client merge different ctx.sessions types into Cordis. Validate this seam. */
6
+ export declare function clientSessionActions(ctx: Context): Pick<ISessions, 'create' | 'open'>;
7
+ /** Only the native workspace gate is removed; loading and business blocks stay native. */
8
+ export declare function unlockComposer(owner: ComposerBarOwnerProps, independent: boolean, block: ComposerBarOwnerProps['blocked']): ComposerBarOwnerProps;
9
+ /**
10
+ * DSH 0.1.2-rc.1 compatibility seam. Keep the native registration identity,
11
+ * children, stores and render authorizations; adapt only its owner props.
12
+ * A dormant fallback registration invalidates the public slot subscription
13
+ * on install/uninstall, including an already mounted Web client.
14
+ */
15
+ export declare const CONVERSATION_SLOTS: readonly ["conversation", "main.conversation"];
16
+ export declare function conversationSlot(name: typeof CONVERSATION_SLOTS[number]): 'conversation';
17
+ export declare function installConversationAdapter(ctx: Context, activation: PatchActivationSource, name?: typeof CONVERSATION_SLOTS[number]): () => void;
@@ -0,0 +1,7 @@
1
+ import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
2
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
3
+ /** One shared flight for selection/clear; retries adopt the same native Session. */
4
+ export declare function createTaskStarter(sessions: Pick<ISessions, 'create' | 'open'>): {
5
+ start(beforeOpen?: (id: SessionId) => boolean | void): Promise<void>;
6
+ dispose(): void;
7
+ };
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { DraftAttachmentId } from '@deepseek-ai/dsh-client-ui-conversation/client';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ interface Draft {
5
+ state: {
6
+ getSnapshot(): {
7
+ phase: string;
8
+ draft: string;
9
+ imageIds?: readonly DraftAttachmentId[];
10
+ attachmentIds?: readonly DraftAttachmentId[];
11
+ };
12
+ };
13
+ setDraft(text: string): void;
14
+ addImages?(ids: DraftAttachmentId[]): boolean;
15
+ removeImage?(id: DraftAttachmentId): unknown;
16
+ addAttachments?(ids: readonly DraftAttachmentId[]): boolean;
17
+ removeAttachment?(id: DraftAttachmentId): unknown;
18
+ }
19
+ /** Move only after all target admission checks pass; never overwrite another draft. */
20
+ export declare function transferDraft(source: Draft, target: Draft, rebind?: (ids: readonly DraftAttachmentId[]) => void): void;
21
+ /** Validate the Client-only service methods where Cordis Host types overlap. */
22
+ export declare function transferBeforeOpen(ctx: Context, sourceId: SessionId | undefined, targetId: SessionId): boolean;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Extend the native session menu; the owning sidebar adapter supplies the exact id. */
2
+ export declare function installMoveMenu(onMove: (archive: HTMLButtonElement) => void): () => void;
@@ -0,0 +1,21 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
5
+ import type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
6
+ import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
7
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
8
+ import type { PatchActivationSource } from '../../../kernel/client/activation.js';
9
+ import { type SessionGroups } from '../groups.js';
10
+ /** Only the sidebar receives grouping metadata; execution and workspace selection use native cwd. */
11
+ export declare function projectSessionGroups(workspaces: WorkspaceSnapshot, sessions: SessionListState, groups: SessionGroups): WorkspaceSnapshot;
12
+ type SidebarProps = PropsRuntime<'sidebar'> & {
13
+ archiveSession(id: SessionId): Promise<void>;
14
+ };
15
+ interface Lifetime {
16
+ subscribe(listener: () => void): () => void;
17
+ getSnapshot(): boolean;
18
+ }
19
+ export declare function extendGroupedSidebar(original: ComponentType<SidebarProps>, activation: PatchActivationSource, source: SettingsScope<SessionGroups>, lifetime?: Lifetime): ComponentType<SidebarProps>;
20
+ export declare function installSessionGrouping(ctx: Context, activation: PatchActivationSource): void;
21
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ClientPatch } from '../../../kernel/client/patch.js';
2
+ export declare const clientPatch: ClientPatch;
@@ -0,0 +1,34 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ISessions, SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
3
+ import type { IWorkspaces, WorkspaceId, WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
4
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
5
+ import type { PatchActivationSource } from '../../../kernel/client/activation.js';
6
+ interface Navigation {
7
+ startSession(workspaceId?: WorkspaceId): void;
8
+ }
9
+ type Sessions = Pick<ISessions, 'list' | 'create' | 'open'>;
10
+ type Activation = Pick<PatchActivationSource, 'getSnapshot' | 'subscribe'>;
11
+ type NewSessionTarget = {
12
+ kind: 'workspace';
13
+ workspaceId: WorkspaceId;
14
+ } | {
15
+ kind: 'independent';
16
+ sourceId: SessionId;
17
+ } | {
18
+ kind: 'native';
19
+ } | {
20
+ kind: 'pending';
21
+ };
22
+ /** Explicit destinations win; otherwise follow the current page, never project recency. */
23
+ export declare function newSessionTarget(list: SessionListState, workspaces: WorkspaceSnapshot, explicit?: WorkspaceId): NewSessionTarget;
24
+ /** One reversible service wrapper covers sidebar, brand and native New Session callers. */
25
+ export declare function bindNewSessionNavigation({ navigation, sessions, workspaces, activation, reportError }: {
26
+ navigation: Navigation;
27
+ sessions: Sessions;
28
+ workspaces: Pick<IWorkspaces, 'list'>;
29
+ activation: Activation;
30
+ reportError(sourceId: SessionId, error: unknown): void;
31
+ }): () => void;
32
+ /** Keep the untyped native service seam local, validated and injection-owned. */
33
+ export declare function installNewSessionNavigation(ctx: Context, activation: Activation): () => void;
34
+ export {};
@@ -0,0 +1,26 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import type { EmptyWorkspaceOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
4
+ import type { WorkspaceId, WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
5
+ import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
6
+ export declare const INDEPENDENT_CHOICE_ID: WorkspaceId;
7
+ interface ChoiceState {
8
+ independent: boolean;
9
+ busy: boolean;
10
+ chooseIndependent(): void;
11
+ }
12
+ export declare function withIndependentChoice(snapshot: WorkspaceSnapshot): WorkspaceSnapshot;
13
+ /** Patch just the native chip label; its button, anchor and menu stay mounted. */
14
+ export declare function labelIndependentChip(anchor: HTMLElement): () => void;
15
+ export declare function WorkspaceChoice({ owner, state, error, children }: {
16
+ owner: EmptyWorkspaceOwnerProps;
17
+ state: ChoiceState;
18
+ error: string | undefined;
19
+ children: ReactNode;
20
+ }): JSX.Element;
21
+ type NativePickerProps = PropsRuntime<'conversation.hero.workspace'>;
22
+ /** Preserve the native menu, keyboard selection, Add workspace and directory flow. */
23
+ export declare function extendWorkspacePicker(original: ComponentType<NativePickerProps>): ComponentType<NativePickerProps>;
24
+ /** Same guarded registration seam as the Conversation adapter, with full teardown. */
25
+ export declare function installPickerAdapter(ctx: Context): () => void;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const SESSION_GROUPS_NAMESPACE = "dsh-more-session-groups";
2
+ export interface SessionGroups {
3
+ assignments: Record<string, string>;
4
+ }
5
+ export declare const EMPTY_GROUPS: SessionGroups;
6
+ export declare function decodeSessionGroups(value: unknown): SessionGroups | undefined;
@@ -0,0 +1,9 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import z from '@deepseek-ai/schemastery';
3
+ import { type SessionGroups } from '../groups.js';
4
+ export declare const SessionGroupsSchema: z<SessionGroups>;
5
+ /** Persist presentation membership only. Immutable cwd and native accounts stay authoritative. */
6
+ export declare function moveSessionGroup(ctx: Context, payload: unknown): Promise<{
7
+ sessionId: string;
8
+ workspaceId: string | null;
9
+ }>;
@@ -0,0 +1,5 @@
1
+ import type { HostPatch } from '../../../kernel/host/patch.js';
2
+ import { type TaskLocation } from '../shared.js';
3
+ /** Preparation is read-only. The native Session API owns mkdir and creation. */
4
+ export declare function prepareTask(payload: unknown, homeDirectory?: string): TaskLocation;
5
+ export declare const hostPatch: HostPatch;
@@ -0,0 +1,6 @@
1
+ export declare const PROJECTLESS_TASKS_PATCH_ID = "projectless-tasks";
2
+ export declare const TASK_ID_PATTERN: RegExp;
3
+ export interface TaskLocation {
4
+ sessionId: string;
5
+ cwd: string;
6
+ }
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-more",
3
3
  "description": "Practical patches for missing DSH Web context and history controls",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "entry": {
6
6
  "name": "dsh-more",
7
7
  "inject": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-more",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Practical patches for missing DeepSeek Harness Web context and history controls.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,54 +0,0 @@
1
- import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
2
- import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
3
- export type {} from '@deepseek-ai/dsh-client-ui-settings';
4
- import type { PatchActivationSource } from '../../../kernel/client/activation.js';
5
- import type { ClientPatch } from '../../../kernel/client/patch.js';
6
- import { type ThinkingLevel } from '../shared.js';
7
- type OverlayProps = PropsRuntime<'shell.overlay'>;
8
- /** One level's editing state inside a model's draft. */
9
- interface LevelDraft {
10
- enabled: boolean;
11
- wire: string;
12
- }
13
- /** One model's in-progress reasoning-effort draft. */
14
- export interface ModelDraft {
15
- nonReasoning: boolean;
16
- levels: Partial<Record<ThinkingLevel, LevelDraft>>;
17
- }
18
- /**
19
- * Locate every model row of every open model catalog in the shipped Models
20
- * settings page (the provider editor's 模型目录). The classes are the models
21
- * package's own CSS-module hashes, stable per build.
22
- */
23
- export declare function findModelEntries(): HTMLElement[];
24
- /**
25
- * Resolve the provider route for one model entry: the editor header's route
26
- * span when the route differs from the display name, else the owning provider
27
- * card's display name (which for such providers equals the route). Returns
28
- * null for the custom-provider creation card, which has no saved provider yet.
29
- */
30
- export declare function providerRouteOf(entry: HTMLElement): string | null;
31
- /** Resolve the model id from a model entry's first row input (the id field). */
32
- export declare function modelIdOf(entry: HTMLElement): string | null;
33
- /**
34
- * The level toggles + wire-value inputs shared by the editor modal. Draft
35
- * state lives in the caller so the modal survives models-page re-renders.
36
- */
37
- export declare function EffortEditorBody({ draft, setDraft, writable, busy }: {
38
- draft: ModelDraft;
39
- setDraft: (updater: (current: ModelDraft) => ModelDraft) => void;
40
- writable: boolean;
41
- busy: boolean;
42
- }): JSX.Element;
43
- /**
44
- * Persistent frame entry that drops a reasoning-effort button into every model
45
- * row of the shipped Models page model catalog and owns the editor modal. The
46
- * buttons are plain DOM (stateless) re-synced by a MutationObserver, so the
47
- * models page can re-render freely; the modal's state lives in this component,
48
- * which the slot system never unmounts.
49
- */
50
- export declare function ModelsPageEffortPortal(props: OverlayProps & {
51
- scope: SettingsScope<unknown>;
52
- activation: PatchActivationSource;
53
- }): JSX.Element | null;
54
- export declare const clientPatch: ClientPatch;
@@ -1,51 +0,0 @@
1
- export declare const MODEL_REASONING_EFFORTS_PATCH_ID = "model-reasoning-efforts";
2
- /**
3
- * The llm-pi-ai settings namespace this patch reads and writes. The shipped
4
- * Models settings page writes custom providers into the same namespace, so a
5
- * profile stored there is exactly what this patch annotates with
6
- * `reasoningEfforts`.
7
- */
8
- export declare const LLM_PI_AI_SETTINGS_NAMESPACE = "llm-pi-ai";
9
- /**
10
- * Every pi-ai thinking level a model may offer, in escalation order. Mirror of
11
- * the `THINKING_LEVELS` the installed `dsh-llm-pi-ai` adapter accepts; a level
12
- * absent from a model's dict is simply not offered.
13
- */
14
- export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
15
- export type ThinkingLevel = typeof THINKING_LEVELS[number];
16
- /**
17
- * The reasoning-effort set auto-filled onto a model that has none. DSH does
18
- * not expose a model's true supported levels for custom providers (the pi-ai
19
- * catalog lives behind the adapter, and `resolveModelInfo` does not surface
20
- * reasoning for custom routes), so the patch fills a common default which the
21
- * user can adjust per model. A model with no `reasoningEfforts` at all is
22
- * treated as non-reasoning by the adapter, so this override is what makes a
23
- * freshly fetched model think.
24
- */
25
- export declare const DEFAULT_REASONING_EFFORTS: Partial<Record<ThinkingLevel, string>>;
26
- /**
27
- * One model's reasoning-effort capability as stored in `settings.yaml`:
28
- * `false` means the model does not reason at all; a dict maps each offered
29
- * level to the wire spelling dispatch should send for it (`off` may leave its
30
- * spelling empty — "supported, send nothing").
31
- */
32
- export type ModelReasoningEfforts = false | Partial<Record<ThinkingLevel, string | null>>;
33
- /** One configured model's reasoning-effort state; `null` = not configured (falls back to the installed catalog). */
34
- export interface ModelReasoningEffortsRow {
35
- provider: string;
36
- providerName: string;
37
- modelId: string;
38
- reasoningEfforts: ModelReasoningEfforts | null;
39
- }
40
- /** What the settings page renders from, returned by the `read` route. */
41
- export interface ModelReasoningEffortsSnapshot {
42
- rows: readonly ModelReasoningEffortsRow[];
43
- writable: boolean;
44
- documentPath: string | undefined;
45
- }
46
- /** The `save` route payload; `reasoningEfforts: null` clears the field. */
47
- export interface SaveModelReasoningEffortsPayload {
48
- provider: string;
49
- modelId: string;
50
- reasoningEfforts: ModelReasoningEfforts | null;
51
- }