dsh-more 0.0.1
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.
- package/CONTRIBUTING.md +349 -0
- package/LICENSE +21 -0
- package/README.md +232 -0
- package/README.zh-CN.md +232 -0
- package/cordis.patch.yml +4 -0
- package/dist/client.js +954 -0
- package/dist/index.js +937 -0
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/generated/client-registry.d.ts +3 -0
- package/dist/types/generated/host-registry.d.ts +2 -0
- package/dist/types/generated/host-settings-schema.d.ts +10 -0
- package/dist/types/generated/patch-catalog.d.ts +30 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/kernel/client/activation.d.ts +19 -0
- package/dist/types/kernel/client/config-card.d.ts +11 -0
- package/dist/types/kernel/client/message-actions.d.ts +14 -0
- package/dist/types/kernel/client/patch.d.ts +16 -0
- package/dist/types/kernel/host/activation.d.ts +14 -0
- package/dist/types/kernel/host/patch.d.ts +12 -0
- package/dist/types/kernel/host/settings.d.ts +5 -0
- package/dist/types/kernel/message-visibility.d.ts +6 -0
- package/dist/types/patches/message-delete/client/index.d.ts +5 -0
- package/dist/types/patches/message-delete/host/index.d.ts +2 -0
- package/dist/types/patches/message-delete/host/message-selection.d.ts +7 -0
- package/dist/types/patches/message-delete/host/projection.d.ts +8 -0
- package/dist/types/patches/message-delete/host/rebuild.d.ts +9 -0
- package/dist/types/patches/message-delete/shared.d.ts +6 -0
- package/dist/types/patches/message-edit/client/index.d.ts +5 -0
- package/dist/types/patches/message-edit/host/edit-continuation.d.ts +15 -0
- package/dist/types/patches/message-edit/host/index.d.ts +2 -0
- package/dist/types/patches/message-edit/shared.d.ts +7 -0
- package/dist/types/patches/session-delete/client/index.d.ts +4 -0
- package/dist/types/patches/session-delete/host/index.d.ts +2 -0
- package/dist/types/patches/session-delete/host/live-session-handles.d.ts +7 -0
- package/dist/types/patches/session-delete/host/session-deletion.d.ts +6 -0
- package/dist/types/patches/session-delete/shared.d.ts +1 -0
- package/dist/types/platform/dsh/client/api.d.ts +6 -0
- package/dist/types/platform/dsh/client/message-content.d.ts +2 -0
- package/dist/types/platform/dsh/client/message-targets.d.ts +2 -0
- package/dist/types/platform/dsh/client/runtime.d.ts +7 -0
- package/dist/types/platform/dsh/client/session-sync.d.ts +18 -0
- package/dist/types/platform/dsh/client/styles.d.ts +1 -0
- package/dist/types/platform/dsh/host/agent-session.d.ts +6 -0
- package/dist/types/platform/dsh/host/api-router.d.ts +3 -0
- package/dist/types/platform/dsh/host/confirmation.d.ts +14 -0
- package/dist/types/platform/dsh/host/error.d.ts +6 -0
- package/dist/types/platform/dsh/host/runtime-context.d.ts +4 -0
- package/dist/types/platform/dsh/host/session-history.d.ts +8 -0
- package/dist/types/platform/dsh/host/trust.d.ts +3 -0
- package/dist/types/platform/dsh/host/wire.d.ts +6 -0
- package/dist/types/platform/dsh/identity.d.ts +4 -0
- package/docs/assets/dsh-more-architecture.jpg +0 -0
- package/docs/assets/dsh-more-architecture.zh-CN.jpg +0 -0
- package/docs/assets/dsh-more-safe-mutation-flow.jpg +0 -0
- package/docs/assets/dsh-more-safe-mutation-flow.zh-CN.jpg +0 -0
- package/dsh.plugin.json +12 -0
- package/package.json +140 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from '@deepseek-ai/schemastery';
|
|
2
|
+
export declare const PatchSettingsSchema: z<Schemastery.ObjectS<{
|
|
3
|
+
"message-edit": z<boolean, boolean>;
|
|
4
|
+
"message-delete": z<boolean, boolean>;
|
|
5
|
+
"session-delete": z<boolean, boolean>;
|
|
6
|
+
}>, Schemastery.ObjectT<{
|
|
7
|
+
"message-edit": z<boolean, boolean>;
|
|
8
|
+
"message-delete": z<boolean, boolean>;
|
|
9
|
+
"session-delete": z<boolean, boolean>;
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const PATCH_CATALOG: readonly [{
|
|
2
|
+
readonly id: "message-edit";
|
|
3
|
+
readonly name: "编辑并重新开始";
|
|
4
|
+
readonly description: "编辑用户消息并丢弃该消息之后的历史";
|
|
5
|
+
readonly defaultEnabled: true;
|
|
6
|
+
readonly order: 100;
|
|
7
|
+
readonly clientKind: "message-action";
|
|
8
|
+
}, {
|
|
9
|
+
readonly id: "message-delete";
|
|
10
|
+
readonly name: "单条消息删除";
|
|
11
|
+
readonly description: "删除指定消息并保留前后历史记录";
|
|
12
|
+
readonly defaultEnabled: true;
|
|
13
|
+
readonly order: 200;
|
|
14
|
+
readonly clientKind: "message-action";
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: "session-delete";
|
|
17
|
+
readonly name: "永久删除会话";
|
|
18
|
+
readonly description: "停止目标会话并从磁盘永久删除,不影响原生归档";
|
|
19
|
+
readonly defaultEnabled: true;
|
|
20
|
+
readonly order: 300;
|
|
21
|
+
readonly clientKind: "standalone";
|
|
22
|
+
}];
|
|
23
|
+
export type PatchId = typeof PATCH_CATALOG[number]['id'];
|
|
24
|
+
export interface PatchSettings {
|
|
25
|
+
"message-edit": boolean;
|
|
26
|
+
"message-delete": boolean;
|
|
27
|
+
"session-delete": boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const DEFAULT_PATCH_SETTINGS: PatchSettings;
|
|
30
|
+
export declare function decodePatchSettings(value: unknown): PatchSettings | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SettingsScope, SettingsScopeSnapshot } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import { type PatchId, type PatchSettings } from '../../generated/patch-catalog.js';
|
|
3
|
+
export interface PatchActivationSource {
|
|
4
|
+
getSnapshot(): PatchSettings;
|
|
5
|
+
getSettingsSnapshot(): SettingsScopeSnapshot<PatchSettings>;
|
|
6
|
+
subscribe(listener: () => void): () => void;
|
|
7
|
+
set(id: PatchId, enabled: boolean): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/** Stable client projection over the Host settings namespace. */
|
|
10
|
+
export declare class ClientPatchActivation implements PatchActivationSource {
|
|
11
|
+
private readonly scope;
|
|
12
|
+
private lastScope;
|
|
13
|
+
private lastValue;
|
|
14
|
+
constructor(scope: SettingsScope<PatchSettings>);
|
|
15
|
+
getSnapshot: () => PatchSettings;
|
|
16
|
+
getSettingsSnapshot: () => SettingsScopeSnapshot<PatchSettings>;
|
|
17
|
+
subscribe: (listener: () => void) => (() => void);
|
|
18
|
+
set: (id: PatchId, enabled: boolean) => Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { PatchActivationSource } from './activation.js';
|
|
4
|
+
type CardProps = PropsRuntime<'settings.plugin.item'>;
|
|
5
|
+
export interface PatchConfigCardProps extends CardProps {
|
|
6
|
+
activation: PatchActivationSource;
|
|
7
|
+
initiallyOpen?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function PatchConfigCard({ activation, initiallyOpen }: PatchConfigCardProps): JSX.Element | null;
|
|
10
|
+
export declare function installPatchConfigCard(ctx: ClientContext, activation: PatchActivationSource): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
export type ConversationHeaderProps = PropsRuntime<'conversation.session.header.utilities'>;
|
|
4
|
+
export interface MessageTarget {
|
|
5
|
+
key: string;
|
|
6
|
+
seq: number;
|
|
7
|
+
kind: 'user' | 'assistant';
|
|
8
|
+
text: string;
|
|
9
|
+
host: HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
export interface MessageActions {
|
|
12
|
+
renderAction(target: MessageTarget): ReactNode;
|
|
13
|
+
overlay: ReactNode;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { PatchActivationSource } from './activation.js';
|
|
3
|
+
import type { ConversationHeaderProps, MessageActions } from './message-actions.js';
|
|
4
|
+
/** A self-contained client-side patch contributed to the umbrella plugin. */
|
|
5
|
+
export interface ClientPatch {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
install(ctx: ClientContext, activation: PatchActivationSource): void;
|
|
8
|
+
}
|
|
9
|
+
/** One patch contributing controls to the shared conversation action row. */
|
|
10
|
+
export interface MessageActionPatch {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly order: number;
|
|
13
|
+
useActions(props: ConversationHeaderProps & {
|
|
14
|
+
ctx: ClientContext;
|
|
15
|
+
}, enabled: boolean): MessageActions;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type PatchSettings } from '../../generated/patch-catalog.js';
|
|
3
|
+
import type { HostPatch } from './patch.js';
|
|
4
|
+
/** Own the independently disposable Host setup of every enabled patch. */
|
|
5
|
+
export declare class HostPatchActivation {
|
|
6
|
+
private readonly ctx;
|
|
7
|
+
private readonly byId;
|
|
8
|
+
private readonly disposers;
|
|
9
|
+
private settings;
|
|
10
|
+
constructor(ctx: Context, patches: readonly HostPatch[]);
|
|
11
|
+
apply(next: PatchSettings): void;
|
|
12
|
+
isEnabled(id: string): boolean;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
export type PatchApiHandler = (payload: unknown) => unknown | Promise<unknown>;
|
|
3
|
+
export interface HostPatchRuntime {
|
|
4
|
+
ctx: Context;
|
|
5
|
+
confirmationSecret: Uint8Array;
|
|
6
|
+
}
|
|
7
|
+
/** A self-contained host-side patch contributed to the umbrella plugin. */
|
|
8
|
+
export interface HostPatch {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
setup?(ctx: Context): () => void;
|
|
11
|
+
routes(runtime: HostPatchRuntime): Readonly<Record<string, PatchApiHandler>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { HostPatchActivation } from './activation.js';
|
|
3
|
+
export declare const PATCH_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
|
|
4
|
+
/** Bind persisted DSH settings to live Host patch activation. */
|
|
5
|
+
export declare function installPatchSettings(ctx: Context, activation: HostPatchActivation): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Shared projection contract used to suppress message surfaces removed by a patch. */
|
|
2
|
+
export declare const MESSAGE_VISIBILITY_PROJECTION_KEY = "dshMoreMessageDelete";
|
|
3
|
+
export interface MessageVisibilityProjection {
|
|
4
|
+
deletedSeqs: number[];
|
|
5
|
+
hiddenTrajectoryKeys: string[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { ConversationHeaderProps, MessageActions } from '../../../kernel/client/message-actions.js';
|
|
3
|
+
export declare function useMessageActions(props: ConversationHeaderProps & {
|
|
4
|
+
ctx: ClientContext;
|
|
5
|
+
}, enabled: boolean): MessageActions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Session } from '@deepseek-ai/dsh-session';
|
|
2
|
+
export interface MessageDeletionSelection {
|
|
3
|
+
targetSeq: number;
|
|
4
|
+
shadowedSeqs: readonly number[];
|
|
5
|
+
}
|
|
6
|
+
/** Expand only as far as needed to keep tool call/result pairing valid. */
|
|
7
|
+
export declare function selectMessageDeletion(session: Session, targetSeq: number): MessageDeletionSelection;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProjectionDefinition } from '@deepseek-ai/dsh-session-projection';
|
|
2
|
+
import { MESSAGE_VISIBILITY_PROJECTION_KEY, type MessageVisibilityProjection } from '../../../kernel/message-visibility.js';
|
|
3
|
+
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
4
|
+
interface SessionProjectionMap {
|
|
5
|
+
dshMoreMessageDelete: MessageVisibilityProjection;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const messageDeleteProjection: ProjectionDefinition<typeof MESSAGE_VISIBILITY_PROJECTION_KEY, MessageVisibilityProjection>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { Session, SessionId, type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { MessageDeletionSelection } from './message-selection.js';
|
|
5
|
+
/** Rebuild only the surviving model surface into ordinary, balanced turns and steps. */
|
|
6
|
+
export declare function buildCleanSeed(source: Session, selection: MessageDeletionSelection): readonly SessionEvent[];
|
|
7
|
+
export declare function createDeletedContinuation(ctx: Context, sourceAgent: Agent, selection: MessageDeletionSelection, childId?: SessionId): Promise<{
|
|
8
|
+
sessionId: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { ConversationHeaderProps, MessageActions } from '../../../kernel/client/message-actions.js';
|
|
3
|
+
export declare function useMessageActions(props: ConversationHeaderProps & {
|
|
4
|
+
ctx: ClientContext;
|
|
5
|
+
}, enabled: boolean): MessageActions;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { SessionId, type Session } from '@deepseek-ai/dsh-session';
|
|
4
|
+
export interface EditCut {
|
|
5
|
+
targetSeq: number;
|
|
6
|
+
turn: number;
|
|
7
|
+
turnStartSeq: number;
|
|
8
|
+
laterTurnCount: number;
|
|
9
|
+
contentDigest: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function textDigest(text: string): string;
|
|
12
|
+
export declare function inspectEditCut(session: Session, targetSeq: number, editedText: string): EditCut;
|
|
13
|
+
export declare function createEditedContinuation(ctx: Context, sourceAgent: Agent, cut: EditCut, editedText: string, childId?: SessionId): Promise<{
|
|
14
|
+
sessionId: string;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ClientPatch } from '../../../kernel/client/patch.js';
|
|
2
|
+
/** Add a separate permanent-delete row beside the native archive row. */
|
|
3
|
+
export declare function installSessionDeleteMenuItems(onDelete: (archiveButton: HTMLButtonElement) => void): () => void;
|
|
4
|
+
export declare const clientPatch: ClientPatch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { AgentHandle } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
4
|
+
/** Track public Agent handles so one live Session can be cleanly unloaded before disk deletion. */
|
|
5
|
+
export declare function installLiveSessionHandleTracker(ctx: Context): () => void;
|
|
6
|
+
/** Return the exact live handle when this plugin observed its creation or resume. */
|
|
7
|
+
export declare function getLiveSessionHandle(ctx: Context, sessionId: SessionId): AgentHandle | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** Stop/unload a Session, then recursively remove its exact persistence directory. */
|
|
3
|
+
export declare function deleteSessionPermanently(ctx: Context, rawSessionId: string): Promise<{
|
|
4
|
+
sessionId: string;
|
|
5
|
+
deletedPath: string;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SESSION_DELETE_PATCH_ID = "session-delete";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class DshMoreApiError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
constructor(code: string, message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function callPatchApi<T>(patchId: string, action: string, payload: unknown): Promise<T>;
|
|
6
|
+
export declare function apiErrorText(error: unknown): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ConversationHeaderProps, MessageTarget } from '../../../kernel/client/message-actions.js';
|
|
2
|
+
export declare function useMessageTargets(props: ConversationHeaderProps, hiddenSeqs: ReadonlySet<number>, hiddenTrajectoryKeys: ReadonlySet<string>): readonly MessageTarget[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ISessions, IWorkspaces } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
export interface RefreshableSessions extends ISessions {
|
|
3
|
+
refresh(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export interface RefreshableWorkspaces extends IWorkspaces {
|
|
6
|
+
refresh(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SessionId, SessionListState, WorkspaceListState } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { RefreshableSessions, RefreshableWorkspaces } from './runtime.js';
|
|
3
|
+
/** Switch synchronously so a following archive/removal frame cannot expose the empty view. */
|
|
4
|
+
export declare function openSessionWithoutGap(sessions: RefreshableSessions, sessionId: SessionId): void;
|
|
5
|
+
export interface SessionHandoff {
|
|
6
|
+
finish(returnedSessionId: string): Promise<void>;
|
|
7
|
+
cancel(): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Follow the Host's session-added frame and navigate before the source session's
|
|
11
|
+
* later archive frame can clear the current view. A baseline refresh is only a
|
|
12
|
+
* fallback for a delayed or missing incremental frame.
|
|
13
|
+
*/
|
|
14
|
+
export declare function followSessionHandoff(sessions: RefreshableSessions, targetSessionId: SessionId): SessionHandoff;
|
|
15
|
+
/** Prefer push-frame convergence after deletion; re-pull both baselines only as a fallback. */
|
|
16
|
+
export declare function settleSessionRemoval(sessions: RefreshableSessions, workspaces: RefreshableWorkspaces, sessionId: SessionId): Promise<void>;
|
|
17
|
+
/** Pick the nearest non-archived row so deleting the current session never exposes a blank gap. */
|
|
18
|
+
export declare function adjacentVisibleSession(sessions: SessionListState, workspaces: WorkspaceListState, deletingSessionId: SessionId): SessionId | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles = "\n.dshmore-inline-actions { display: inline-flex; align-items: center; gap: 10px; }\n.dshmore-inline-button { width: 28px; height: 28px; color: var(--dsw-alias-label-tertiary); cursor: pointer; background: transparent; border: 0; border-radius: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 6px; }\n.dshmore-inline-button:hover { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-interactive-bg-hover); }\n.dshmore-edit-modal { box-sizing: border-box; width: min(620px, calc(100vw - 32px)) !important; max-width: min(620px, calc(100vw - 32px)) !important; }\n.dshmore-dialog-body { box-sizing: border-box; display: grid; gap: 12px; width: 100%; min-width: 0; overflow: hidden; }\n.dshmore-message-preview { box-sizing: border-box; width: 100%; min-width: 0; max-height: 132px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; padding: 12px; border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); font-size: 13px; line-height: 1.55; }\n.dshmore-editor { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; resize: vertical; min-height: 150px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 10px; outline: none; padding: 12px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1); font: inherit; line-height: 1.55; overflow-x: hidden; overflow-wrap: anywhere; word-break: break-word; }\n.dshmore-editor:focus { border-color: var(--dsw-alias-state-business-primary); }\n.dshmore-warning { padding: 10px 12px; border: 1px solid rgba(220,138,40,.35); border-radius: 10px; background: rgba(220,138,40,.09); color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 1.5; }\n.dshmore-danger { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: rgba(208,58,58,.10); color: var(--dsw-alias-state-error-primary, rgb(220,90,90)); font-size: 12px; line-height: 1.5; }\n.dshmore-error { padding: 10px 12px; border-radius: 10px; background: rgba(208,58,58,.10); color: var(--dsw-alias-state-error-primary, rgb(220,90,90)); font-size: 12px; line-height: 1.5; }\n@media (max-width: 620px) { .dshmore-edit-modal { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; } }\n.dshmore-action-contribution { display: inline-flex; align-items: center; order: var(--dshmore-action-order); }\n.dshmore-config-card { box-sizing: border-box; list-style: none; border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px; background: var(--dsw-alias-bg-layer-3); overflow: hidden; transition: border-color .16s, background .16s; }\n.dshmore-config-card:hover { border-color: var(--dsw-alias-label-dimmed); }\n.dshmore-config-card-open { border-color: var(--dsw-alias-label-dimmed); background: var(--dsw-alias-bg-layer-2); }\n.dshmore-config-heading { appearance: none; box-sizing: border-box; width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; background: transparent; border: 0; border-radius: 12px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }\n.dshmore-config-heading:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }\n.dshmore-config-heading-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }\n.dshmore-config-heading-copy strong { color: var(--dsw-alias-label-primary); font-size: 15px; line-height: 1.4; }\n.dshmore-config-heading-copy > span, .dshmore-config-copy span, .dshmore-config-note { color: var(--dsw-alias-label-tertiary); font-size: 13px; line-height: 1.5; }\n.dshmore-config-chevron { flex: none; color: var(--dsw-alias-label-tertiary); }\n.dshmore-config-chevron-open { transform: rotate(180deg); }\n.dshmore-config-body { margin: 0 16px; padding-bottom: 8px; border-top: 1px solid var(--dsw-alias-border-l2); }\n.dshmore-config-list { display: grid; }\n.dshmore-config-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }\n.dshmore-config-row + .dshmore-config-row { border-top: 1px solid var(--dsw-alias-border-l1); }\n.dshmore-config-row:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dshmore-config-copy { min-width: 0; display: grid; gap: 2px; }\n.dshmore-config-copy strong { color: var(--dsw-alias-label-primary); font-size: 13px; }\n.dshmore-config-row input { width: 34px; height: 18px; flex: none; cursor: pointer; accent-color: var(--dsw-alias-state-business-primary); }\n.dshmore-config-row input:disabled { cursor: default; opacity: .5; }\n.dshmore-config-note, .dshmore-config-error { margin: 0; padding: 10px 0; border-top: 1px solid var(--dsw-alias-border-l1); }\n.dshmore-config-error { color: var(--dsw-alias-state-error-primary, rgb(220,90,90)); font-size: 12px; }\n@media (prefers-reduced-motion: no-preference) { .dshmore-config-chevron { transition: transform .16s; } }\n";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { type Session } from '@deepseek-ai/dsh-session';
|
|
4
|
+
export declare function requireLiveSession(ctx: Context, sessionId: string): Session;
|
|
5
|
+
export declare function requireIdleAgent(ctx: Context, sessionId: string, session: Session): Agent;
|
|
6
|
+
export declare function runAgentMaintenance<T>(agent: Agent, task: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { HostPatch } from '../../../kernel/host/patch.js';
|
|
3
|
+
export declare function registerPatchApi(ctx: Context, patches: readonly HostPatch[], confirmationSecret: Uint8Array, isEnabled: (patchId: string) => boolean): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ConfirmationFacts {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
startTurn: number;
|
|
4
|
+
endTurn: number;
|
|
5
|
+
logRevision: number;
|
|
6
|
+
replaceGeneration: number;
|
|
7
|
+
shadowedSeqs: readonly number[];
|
|
8
|
+
operation?: 'delete-message' | 'edit-message';
|
|
9
|
+
targetSeq?: number;
|
|
10
|
+
contentDigest?: string;
|
|
11
|
+
continuationSessionId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createConfirmationToken(secret: Uint8Array, facts: ConfirmationFacts, now?: number, ttlMs?: number): string;
|
|
14
|
+
export declare function verifyConfirmationToken(secret: Uint8Array, token: string, expected: ConfirmationFacts, now?: number): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type DshMoreErrorCode = 'bad-request' | 'forbidden' | 'method-not-allowed' | 'not-found' | 'session-not-live' | 'session-busy' | 'invalid-turn-range' | 'selection-empty' | 'stale-preview' | 'patch-disabled' | 'internal';
|
|
2
|
+
export declare class DshMoreError extends Error {
|
|
3
|
+
readonly code: DshMoreErrorCode;
|
|
4
|
+
readonly status: number;
|
|
5
|
+
constructor(code: DshMoreErrorCode, message: string, status?: number);
|
|
6
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
3
|
+
/** Keep one continuation turn prefix-stable without appending a prompt snapshot. */
|
|
4
|
+
export declare function replaySeedRuntimeContext(agentCtx: Context, seed: readonly SessionEvent[]): () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
2
|
+
export interface CompletedTurn {
|
|
3
|
+
turn: number;
|
|
4
|
+
startSeq: number;
|
|
5
|
+
endSeq: number;
|
|
6
|
+
}
|
|
7
|
+
/** Return only turns with a durable start/end pair, in log order. */
|
|
8
|
+
export declare function completedTurns(events: readonly SessionEvent[]): CompletedTurn[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
export declare function readJson(req: IncomingMessage): Promise<unknown>;
|
|
3
|
+
export declare function requireString(value: unknown, key: string): string;
|
|
4
|
+
export declare function requireInteger(value: unknown, key: string): number;
|
|
5
|
+
export declare function writeOk(res: ServerResponse, value: unknown): void;
|
|
6
|
+
export declare function writeError(res: ServerResponse, error: unknown): void;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dsh.plugin.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-more",
|
|
3
|
+
"description": "Practical patches for missing DSH Web context and history controls",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"entry": {
|
|
6
|
+
"name": "dsh-more",
|
|
7
|
+
"inject": ["webServer", "webRuntime", "agents", "sessions", "sessionPersistence", "sessionProjections", "workspaceRegistry", "agentPresets", "settings"]
|
|
8
|
+
},
|
|
9
|
+
"client": {
|
|
10
|
+
"platform": "web"
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-more",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Practical patches for missing DeepSeek Harness Web context and history controls.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/SodaZheng/dsh-more.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/SodaZheng/dsh-more/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/SodaZheng/dsh-more#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"deepseek",
|
|
17
|
+
"deepseek-harness",
|
|
18
|
+
"dsh",
|
|
19
|
+
"dsh-plugin"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.19"
|
|
23
|
+
},
|
|
24
|
+
"packageManager": "pnpm@11.6.0",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
29
|
+
"main": "dist/index.js",
|
|
30
|
+
"types": "dist/types/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/types/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./client": {
|
|
37
|
+
"types": "./dist/types/client/index.d.ts",
|
|
38
|
+
"default": "./dist/client.js"
|
|
39
|
+
},
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"cordis.patch.yml",
|
|
45
|
+
"dsh.plugin.json",
|
|
46
|
+
"README.md",
|
|
47
|
+
"README.zh-CN.md",
|
|
48
|
+
"CONTRIBUTING.md",
|
|
49
|
+
"docs/assets",
|
|
50
|
+
"LICENSE"
|
|
51
|
+
],
|
|
52
|
+
"dsh": {
|
|
53
|
+
"bundle": {
|
|
54
|
+
"patch": "./cordis.patch.yml"
|
|
55
|
+
},
|
|
56
|
+
"client": {
|
|
57
|
+
"platform": "web",
|
|
58
|
+
"inject": [
|
|
59
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-primitives",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"generate": "node scripts/generate-patch-registry.mjs",
|
|
70
|
+
"build": "node build.mjs",
|
|
71
|
+
"typecheck": "npm run generate && tsc --noEmit",
|
|
72
|
+
"test": "npm run generate && vitest run",
|
|
73
|
+
"check": "npm run typecheck && npm run test && npm run build",
|
|
74
|
+
"package": "npm pack",
|
|
75
|
+
"package:check": "npm pack --dry-run",
|
|
76
|
+
"release": "node scripts/release.mjs",
|
|
77
|
+
"release:dry-run": "node scripts/release.mjs --dry-run",
|
|
78
|
+
"release:patch": "node scripts/release.mjs patch",
|
|
79
|
+
"release:minor": "node scripts/release.mjs minor",
|
|
80
|
+
"release:major": "node scripts/release.mjs major",
|
|
81
|
+
"prepack": "npm run check"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
85
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
|
|
86
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
92
|
+
"@deepseek-ai/dsh-compaction": "^0.1.0-rc.7",
|
|
93
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.7",
|
|
94
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
95
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.7",
|
|
96
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.7",
|
|
97
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.0-rc.7",
|
|
98
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.0-rc.7",
|
|
99
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
100
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.7",
|
|
101
|
+
"@deepseek-ai/dsh-workspace": "^0.1.0-rc.7",
|
|
102
|
+
"@deepseek-ai/dsh-web-app": "^0.1.0-rc.7",
|
|
103
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
104
|
+
"react": "^18.2.0",
|
|
105
|
+
"react-dom": "^18.2.0",
|
|
106
|
+
"zod": "^4.4.3"
|
|
107
|
+
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
110
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.7",
|
|
111
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.0-rc.7",
|
|
112
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.7",
|
|
113
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.1.0-rc.7",
|
|
114
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.7",
|
|
115
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.7",
|
|
116
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.0-rc.7",
|
|
117
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.7",
|
|
118
|
+
"@deepseek-ai/dsh-compaction": "0.1.0-rc.7",
|
|
119
|
+
"@deepseek-ai/dsh-agent-presets": "0.1.0-rc.7",
|
|
120
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.7",
|
|
121
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.7",
|
|
122
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.7",
|
|
123
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.0-rc.7",
|
|
124
|
+
"@deepseek-ai/dsh-session-projection": "0.1.0-rc.7",
|
|
125
|
+
"@deepseek-ai/dsh-settings": "0.1.0-rc.7",
|
|
126
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.0-rc.7",
|
|
127
|
+
"@deepseek-ai/dsh-workspace": "0.1.0-rc.7",
|
|
128
|
+
"@deepseek-ai/dsh-web-app": "0.1.0-rc.7",
|
|
129
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
130
|
+
"@types/node": "^24.0.0",
|
|
131
|
+
"@types/react": "~18.3.0",
|
|
132
|
+
"@types/react-dom": "~18.3.0",
|
|
133
|
+
"esbuild": "^0.25.0",
|
|
134
|
+
"react": "18.3.1",
|
|
135
|
+
"react-dom": "18.3.1",
|
|
136
|
+
"typescript": "^5.9.2",
|
|
137
|
+
"vitest": "^4.0.0",
|
|
138
|
+
"zod": "4.4.3"
|
|
139
|
+
}
|
|
140
|
+
}
|