dsh-more 0.0.4 → 0.0.6

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 (34) hide show
  1. package/README.md +15 -7
  2. package/README.zh-CN.md +15 -7
  3. package/dist/client.js +794 -698
  4. package/dist/index.js +425 -135
  5. package/dist/types/generated/host-settings-schema.d.ts +6 -4
  6. package/dist/types/generated/patch-catalog.d.ts +16 -8
  7. package/dist/types/patches/model-capabilities/client/api.d.ts +4 -0
  8. package/dist/types/patches/model-capabilities/client/editor.d.ts +26 -0
  9. package/dist/types/patches/model-capabilities/client/index.d.ts +10 -0
  10. package/dist/types/patches/model-capabilities/client/model-entries.d.ts +15 -0
  11. package/dist/types/patches/model-capabilities/client/styles.d.ts +1 -0
  12. package/dist/types/patches/model-capabilities/host/deepseek.d.ts +11 -0
  13. package/dist/types/patches/{model-reasoning-efforts → model-capabilities}/host/validate.d.ts +3 -2
  14. package/dist/types/patches/model-capabilities/shared.d.ts +38 -0
  15. package/dist/types/patches/projectless-tasks/client/adapter.d.ts +15 -0
  16. package/dist/types/patches/projectless-tasks/client/create-task.d.ts +7 -0
  17. package/dist/types/patches/projectless-tasks/client/draft.d.ts +9 -0
  18. package/dist/types/patches/projectless-tasks/client/index.d.ts +2 -0
  19. package/dist/types/patches/projectless-tasks/client/new-session.d.ts +34 -0
  20. package/dist/types/patches/projectless-tasks/client/picker.d.ts +26 -0
  21. package/dist/types/patches/projectless-tasks/host/index.d.ts +5 -0
  22. package/dist/types/patches/projectless-tasks/shared.d.ts +6 -0
  23. package/dist/types/patches/session-auto-title/client/index.d.ts +2 -0
  24. package/dist/types/patches/session-auto-title/host/generate.d.ts +6 -0
  25. package/dist/types/patches/session-auto-title/shared.d.ts +2 -0
  26. package/dsh.plugin.json +1 -1
  27. package/package.json +5 -3
  28. package/dist/types/patches/conversation-quick-navigation/client/index.d.ts +0 -27
  29. package/dist/types/patches/conversation-quick-navigation/client/navigation.d.ts +0 -26
  30. package/dist/types/patches/conversation-quick-navigation/shared.d.ts +0 -1
  31. package/dist/types/patches/model-reasoning-efforts/client/index.d.ts +0 -54
  32. package/dist/types/patches/model-reasoning-efforts/shared.d.ts +0 -51
  33. /package/dist/types/patches/{conversation-quick-navigation → model-capabilities}/host/index.d.ts +0 -0
  34. /package/dist/types/patches/{model-reasoning-efforts → session-auto-title}/host/index.d.ts +0 -0
@@ -27,19 +27,26 @@ 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";
36
36
  }, {
37
- readonly id: "conversation-quick-navigation";
38
- readonly name: "对话快速导航";
39
- readonly description: "自动加载完整记录,并用常驻目录快速定位当前会话中的每一轮提问";
37
+ readonly id: "session-auto-title";
38
+ readonly name: "会话自动命名";
39
+ readonly description: "新会话首条需求后,使用当前模型生成「类型 · 具体任务」标题;保留手动命名,失败时保留原有标题";
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;
51
- "conversation-quick-navigation": boolean;
57
+ "model-capabilities": boolean;
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,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,15 @@
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 function installConversationAdapter(ctx: Context, activation: PatchActivationSource): () => 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,9 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { SessionInput } from '@deepseek-ai/dsh-client-ui-conversation/client';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ type Draft = Pick<SessionInput, 'state' | 'setDraft' | 'addImages' | 'removeImage'>;
5
+ /** Move only after all target admission checks pass; never overwrite another draft. */
6
+ export declare function transferDraft(source: Draft, target: Draft): void;
7
+ /** Validate the Client-only service methods where Cordis Host types overlap. */
8
+ export declare function transferBeforeOpen(ctx: Context, sourceId: SessionId | undefined, targetId: SessionId): boolean;
9
+ 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,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
+ }
@@ -0,0 +1,2 @@
1
+ import type { ClientPatch } from '../../../kernel/client/patch.js';
2
+ export declare const clientPatch: ClientPatch;
@@ -0,0 +1,6 @@
1
+ import { type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm';
2
+ import type { SessionTitleProviderRequest, SessionTitleProviderResult } from '@deepseek-ai/dsh-session-title';
3
+ export declare const TITLE_SYSTEM_PROMPT: string;
4
+ export type TitleStream = (options: GenerateOptions) => AsyncIterable<StreamChunk>;
5
+ export declare function parseTitle(raw: string): string;
6
+ export declare function generateTitle(stream: TitleStream, request: SessionTitleProviderRequest): Promise<SessionTitleProviderResult>;
@@ -0,0 +1,2 @@
1
+ export declare const SESSION_AUTO_TITLE_PATCH_ID = "session-auto-title";
2
+ export declare const TITLE_TYPES: readonly ["开发", "修复", "排查", "重构", "测试", "研究", "设计", "文档", "配置", "任务"];
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.4",
4
+ "version": "0.0.6",
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.4",
3
+ "version": "0.0.6",
4
4
  "description": "Practical patches for missing DeepSeek Harness Web context and history controls.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -116,7 +116,8 @@
116
116
  "@deepseek-ai/dsh-client-ui-session": "^0.1.2-rc.1",
117
117
  "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
118
118
  "@deepseek-ai/dsh-client-store": "^0.1.2-rc.1",
119
- "@deepseek-ai/dsh-llm-retry": "^0.1.2-rc.1"
119
+ "@deepseek-ai/dsh-llm-retry": "^0.1.2-rc.1",
120
+ "@deepseek-ai/dsh-session-title": "^0.1.2-rc.1"
120
121
  },
121
122
  "devDependencies": {
122
123
  "@deepseek-ai/cordis": "4.0.2",
@@ -155,6 +156,7 @@
155
156
  "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
156
157
  "@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
157
158
  "@deepseek-ai/dsh-llm-retry": "0.1.2-rc.1",
158
- "happy-dom": "20.14.0"
159
+ "happy-dom": "20.14.0",
160
+ "@deepseek-ai/dsh-session-title": "0.1.2-rc.1"
159
161
  }
160
162
  }
@@ -1,27 +0,0 @@
1
- import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
- import type { PatchActivationSource } from '../../../kernel/client/activation.js';
3
- import type { ClientPatch } from '../../../kernel/client/patch.js';
4
- import { type ConversationTurnSummary } from './navigation.js';
5
- type HeaderUtilityProps = PropsRuntime<'conversation.session.header.utilities'>;
6
- export declare function conversationRow(root: HTMLElement, key: string): HTMLElement | null;
7
- export declare function sessionRoot(marker: HTMLElement | null): HTMLElement | null;
8
- export declare function conversationScrollport(marker: HTMLElement | null): HTMLElement | null;
9
- /** The native pre-row paging control owns DSH's reader-position anchoring. */
10
- export declare function nativeLoadOlderButton(scrollport: HTMLElement): HTMLButtonElement | null;
11
- export declare function ConversationNavigationMenu({ turns, activeKey, hasMore, loadingOlder, autoLoadPaused, collapsed, onRetry, onToggleCollapsed, onJump, listRef, }: {
12
- turns: readonly ConversationTurnSummary[];
13
- activeKey: string | null;
14
- hasMore: boolean;
15
- loadingOlder: boolean;
16
- autoLoadPaused: boolean;
17
- collapsed: boolean;
18
- onRetry: () => void;
19
- onToggleCollapsed: () => void;
20
- onJump: (key: string) => void;
21
- listRef: React.RefObject<HTMLDivElement>;
22
- }): JSX.Element;
23
- export declare function ConversationQuickNavigation(props: HeaderUtilityProps & {
24
- activation: PatchActivationSource;
25
- }): JSX.Element | null;
26
- export declare const clientPatch: ClientPatch;
27
- export {};
@@ -1,26 +0,0 @@
1
- import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
2
- export interface ConversationTurnSummary {
3
- key: string;
4
- seq: number;
5
- label: string;
6
- }
7
- export interface TurnPosition {
8
- key: string;
9
- top: number;
10
- }
11
- export interface AutoLoadOlderState {
12
- enabled: boolean;
13
- surfaceAvailable: boolean;
14
- hasMore: boolean;
15
- loadingOlder: boolean;
16
- paused: boolean;
17
- }
18
- /** Select stable user-authored turn summaries without observing assistant streaming frames. */
19
- export declare function createConversationTurnSelector(): (snapshot: ChatSnapshot) => readonly ConversationTurnSummary[];
20
- /** Stable evidence that an older history page prepended visible conversation material. */
21
- export declare function historyWindowSignature(snapshot: ChatSnapshot): string;
22
- export declare function shouldAutoLoadOlder(state: AutoLoadOlderState): boolean;
23
- /** Pick the last turn at or above the reading line, falling back to the first turn. */
24
- export declare function activeTurnAt(positions: readonly TurnPosition[], readingLine: number): string | null;
25
- /** Translate a row's viewport coordinate into a bounded scrollport offset. */
26
- export declare function scrollOffsetForRow(currentScrollTop: number, scrollportTop: number, rowTop: number, topInset?: number): number;
@@ -1 +0,0 @@
1
- export declare const CONVERSATION_QUICK_NAVIGATION_PATCH_ID = "conversation-quick-navigation";
@@ -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
- }