@benz-ai-x/dsh-md-preview 0.3.0 → 0.6.0

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.
@@ -8,7 +8,7 @@ import type { Context } from '@deepseek-ai/cordis';
8
8
  import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
9
9
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
10
10
  import type { Config } from './config.ts';
11
- import type { MdPreviewFile, MdPreviewWriteResult } from './protocol.ts';
11
+ import type { MdPreviewFile, MdPreviewListResult, MdPreviewWriteResult } from './protocol.ts';
12
12
  /** Whether a candidate extension passes the configured allowlist. */
13
13
  export declare function isAllowedExtension(path: string, allowedExtensions: readonly string[]): boolean;
14
14
  /**
@@ -50,6 +50,16 @@ export declare class MdPreviewService extends TypertRemoteService {
50
50
  * @throws RemoteError with a stable MdPreview failure code.
51
51
  */
52
52
  write(sessionId: SessionId, path: string, content: string, fingerprint: string | undefined, force: boolean, signal: AbortSignal): Promise<MdPreviewWriteResult>;
53
+ /**
54
+ * List one workspace directory for the browser face; folders sort first,
55
+ * then entries alphabetize by name. A blank path lists the workspace root.
56
+ * @param sessionId - owning session; its header cwd roots the listing.
57
+ * @param path - directory path as the tree spelled it; blank = root.
58
+ * @param signal - caller cancellation carried through every fs call.
59
+ * @returns the requested path with its workspace-relative entries.
60
+ * @throws RemoteError with a stable MdPreview failure code.
61
+ */
62
+ list(sessionId: SessionId, path: string, signal: AbortSignal): Promise<MdPreviewListResult>;
53
63
  /**
54
64
  * The shared authority preamble of the remote methods: resolve a path to a
55
65
  * live, contained, regular workspace file, or reject it with the stable
@@ -63,5 +73,17 @@ export declare class MdPreviewService extends TypertRemoteService {
63
73
  * @throws RemoteError with a stable MdPreview failure code.
64
74
  */
65
75
  private resolveWorkspaceTarget;
76
+ /**
77
+ * The authority middle shared by every method: session → workspace cwd →
78
+ * root resolve → target resolve (a blank path means the root itself) →
79
+ * containment. Extension and type checks belong to the callers.
80
+ * @param sessionId - owning session; its header cwd roots the resolution.
81
+ * @param path - requested path; blank spells the workspace root.
82
+ * @param signal - caller cancellation carried through every fs call.
83
+ * @param op - calling method name for diagnostic messages.
84
+ * @returns the resolved root, target, and the workspace cwd.
85
+ * @throws RemoteError with a stable MdPreview failure code.
86
+ */
87
+ private resolveContainedTarget;
66
88
  }
67
89
  //# sourceMappingURL=remote.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
2
2
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
3
- import type { MdPreviewFile, MdPreviewWriteResult } from '../protocol.ts';
3
+ import type { MdPreviewFile, MdPreviewListResult, MdPreviewWriteResult } from '../protocol.ts';
4
4
  /** Browser face of the mounted `mdPreview` Remote namespace. */
5
5
  export interface MdPreviewRemote {
6
6
  /** Read one previewable document of a session's workspace. */
@@ -11,6 +11,8 @@ export interface MdPreviewRemote {
11
11
  * overwrite unconditionally (the conflict prompt's override).
12
12
  */
13
13
  write(sessionId: SessionId, path: string, content: string, fingerprint?: string, force?: boolean, signal?: AbortSignal): Promise<RemoteResult<MdPreviewWriteResult>>;
14
+ /** List one workspace directory for the browser face (blank path = root). */
15
+ list(sessionId: SessionId, path: string, signal?: AbortSignal): Promise<RemoteResult<MdPreviewListResult>>;
14
16
  }
15
17
  declare module '@deepseek-ai/dsh-typert-protocol' {
16
18
  interface TypertRemoteNamespaceMap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benz-ai-x/dsh-md-preview",
3
- "version": "0.3.0",
3
+ "version": "0.6.0",
4
4
  "description": "DSH markdown preview: clicking a markdown document in the conversation opens a rendered preview panel docked to the right of the chat.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,9 +13,16 @@
13
13
  "keywords": [
14
14
  "deepseek-harness",
15
15
  "dsh",
16
- "plugin",
16
+ "dsh-plugin",
17
+ "cordis",
17
18
  "markdown",
18
- "preview"
19
+ "markdown-preview",
20
+ "markdown-editor",
21
+ "codemirror",
22
+ "file-browser",
23
+ "workspace",
24
+ "preview-panel",
25
+ "react"
19
26
  ],
20
27
  "type": "module",
21
28
  "main": "./lib/index.js",
@@ -42,7 +49,8 @@
42
49
  "lib/typert/remote-client.js",
43
50
  "lib/types/**/*.d.ts",
44
51
  "cordis.patch.yml",
45
- "README.md"
52
+ "README.md",
53
+ "README.zh.md"
46
54
  ],
47
55
  "dsh": {
48
56
  "bundle": {
@@ -65,7 +73,6 @@
65
73
  "scripts": {
66
74
  "context:check": "node scripts/verify-dsh-context.mjs",
67
75
  "context:check:strict": "node scripts/verify-dsh-context.mjs --require-source",
68
- "context:sync": "node scripts/verify-dsh-context.mjs --sync-links --require-source && pnpm install --no-frozen-lockfile",
69
76
  "typecheck": "tsc -p tsconfig.json --noEmit",
70
77
  "test": "vitest run",
71
78
  "build": "tsc -p tsconfig.json && tsdown",
@@ -75,13 +82,17 @@
75
82
  "built:check": "node scripts/verify-built.mjs",
76
83
  "pack:publishable": "node scripts/pack.mjs",
77
84
  "publish:registry": "node scripts/pack.mjs --publish",
78
- "verify": "pnpm context:check:strict && pnpm typecheck && pnpm test && pnpm build && pnpm built:check"
85
+ "verify": "pnpm context:check:strict && pnpm typecheck && pnpm test && pnpm build && pnpm built:check",
86
+ "prepare": "node scripts/prepare.mjs",
87
+ "context:link": "node scripts/verify-dsh-context.mjs --sync-links --require-source && pnpm install --no-frozen-lockfile"
79
88
  },
80
89
  "dependencies": {
81
- "@deepseek-ai/schemastery": "3.18.1",
90
+ "@deepseek-ai/schemastery": "3.18.2",
91
+ "tsdown": "^0.22.2",
92
+ "typescript": "6.0.3",
82
93
  "zod": "^4.4.3"
83
94
  },
84
95
  "peerDependencies": {
85
- "@deepseek-ai/dsh-typert-protocol": "0.1.2-alpha.3"
96
+ "@deepseek-ai/dsh-typert-protocol": "0.1.2-rc.1"
86
97
  }
87
98
  }