@deepseek-ai/dsh-client-ui-primitives 0.1.5-rc.2 → 0.1.6-alpha.2

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.
@@ -1,18 +1,22 @@
1
1
  /**
2
2
  * Shared ranking for `/` menu candidates: the query must be a
3
- * case-insensitive ordered subsequence of the candidate name. Prefix hits
4
- * rank first, then the strongest alignment score, then the source order of
5
- * the input. Decision record:
3
+ * case-insensitive ordered subsequence of the candidate name or, when the
4
+ * candidate carries one, of its display label (a localized title). Prefix
5
+ * hits rank first, then the strongest alignment score over either key, then
6
+ * the source order of the input. Decision record:
6
7
  * .agents/notes/archived/feature/2026-08-04-web-slash-command-fuzzy-discovery.md
7
8
  */
8
9
  /**
9
10
  * Rank named items by a menu query.
10
- * @param items - candidates in source order (a host catalog, then client contributions).
11
+ * @param items - candidates in source order (a host catalog, then client
12
+ * contributions); an item's optional `label` is a second search key beside
13
+ * its name.
11
14
  * @param rawQuery - the text typed after the trigger, matched case-insensitively.
12
15
  * @returns the matching items: prefix hits first, then by alignment score,
13
16
  * then in source order. The input list itself for an empty query.
14
17
  */
15
18
  export declare function rankByName<T extends {
16
19
  readonly name: string;
20
+ readonly label?: string;
17
21
  }>(items: readonly T[], rawQuery: string): readonly T[];
18
22
  //# sourceMappingURL=rank-by-name.d.ts.map
@@ -15,6 +15,13 @@
15
15
  * tokens (`/plan。`) stay plain even for a loaded name.
16
16
  */
17
17
  import type { ReactNode } from 'react';
18
+ /** Optional navigation supplied by consumers that can preview references. */
19
+ export interface UserTextReferences {
20
+ /** Open a file path decoded from an `@` mention. */
21
+ openFile: (path: string) => void;
22
+ /** Open the source of a skill loaded for this message. */
23
+ openSkill: (name: string) => void;
24
+ }
18
25
  /**
19
26
  * Split one sent text into inline plain runs and reference chips.
20
27
  * @param text - the logged model text of the message or queue row.
@@ -23,7 +30,8 @@ import type { ReactNode } from 'react';
23
30
  * host loaded for this message, or the command a command bubble echoes
24
31
  * (unsent queue rows pass none).
25
32
  * @param slashKind - the chip kind those tokens render as.
33
+ * @param references - optional file and skill preview actions; session and command tokens stay labels.
26
34
  * @returns inline nodes covering the whole text.
27
35
  */
28
- export declare function projectUserText(text: string, sessionLabels: readonly string[], slashNames?: readonly string[], slashKind?: 'skill' | 'command'): ReactNode;
36
+ export declare function projectUserText(text: string, sessionLabels: readonly string[], slashNames?: readonly string[], slashKind?: 'skill' | 'command', references?: UserTextReferences): ReactNode;
29
37
  //# sourceMappingURL=user-text.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-primitives",
3
3
  "description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
4
- "version": "0.1.5-rc.2",
4
+ "version": "0.1.6-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,6 +27,7 @@
27
27
  "@types/react-dom": "~18.3.0",
28
28
  "react": "^18.2.0",
29
29
  "clsx": "^2.0.0",
30
+ "diff": "^9.0.0",
30
31
  "react-dom": "^18.2.0",
31
32
  "anser": "^2.3.5",
32
33
  "katex": "^0.16.47",
@@ -45,6 +46,7 @@
45
46
  "mdast-util-math": "^3.0.0",
46
47
  "micromark-extension-gfm": "^3.0.0",
47
48
  "micromark-util-sanitize-uri": "^2.0.1",
49
+ "simple-icons": "16.31.0",
48
50
  "@deepseek-ai/cordis": "^4.0.2"
49
51
  },
50
52
  "files": [