@bittersmilezzz/dsh-model-selector 0.2.0 → 0.3.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/lib/client.js +73 -40
- package/lib/client.js.map +1 -1
- package/lib/types/client/ModelSelect.d.ts +3 -4
- package/lib/types/client/ModelSelect.d.ts.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/menuFit.d.ts +7 -1
- package/lib/types/client/menuFit.d.ts.map +1 -1
- package/lib/types/client/styles.d.ts.map +1 -1
- package/package.json +21 -21
|
@@ -16,15 +16,14 @@
|
|
|
16
16
|
import * as react from 'react';
|
|
17
17
|
import { zh as zhDict, en as enDict } from './locales.ts';
|
|
18
18
|
export { zhDict, enDict };
|
|
19
|
-
import type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client';
|
|
19
|
+
import type { ModelDirectoryState, ModelSelectInjected } from '@deepseek-ai/dsh-client-ui-model-selection/client';
|
|
20
20
|
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
21
21
|
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
22
|
-
import type { ModelSelection } from '@deepseek-ai/dsh-api-session-controller/types';
|
|
23
22
|
/** Per-session model directory snapshot (official state shape). */
|
|
24
23
|
type DirectoryState = ModelDirectoryState;
|
|
25
24
|
interface EffortSliderProps {
|
|
26
25
|
state: DirectoryState;
|
|
27
|
-
select:
|
|
26
|
+
select: ModelSelectInjected['select'];
|
|
28
27
|
t: TranslateNS<'modelSelector'>;
|
|
29
28
|
/** 提交失败(超时/拒绝)时回调:让菜单把错误条归到「加载失败」之外(见 renderErrorStrip)。 */
|
|
30
29
|
onSelectFailure: () => void;
|
|
@@ -35,7 +34,7 @@ interface ModelSelectProps {
|
|
|
35
34
|
available: boolean;
|
|
36
35
|
directory: SnapshotStore<ModelDirectoryState>;
|
|
37
36
|
load: () => void;
|
|
38
|
-
select:
|
|
37
|
+
select: ModelSelectInjected['select'];
|
|
39
38
|
t: TranslateNS<'modelSelector'>;
|
|
40
39
|
}
|
|
41
40
|
export declare function ModelSelect({ locked, available, directory, load, select, t }: ModelSelectProps): react.JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelSelect.d.ts","sourceRoot":"","sources":["../../../src/client/ModelSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AASzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAGzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;
|
|
1
|
+
{"version":3,"file":"ModelSelect.d.ts","sourceRoot":"","sources":["../../../src/client/ModelSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AASzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAGzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AACjH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAsBlE,mEAAmE;AACnE,KAAK,cAAc,GAAG,mBAAmB,CAAA;AAKzC,UAAU,iBAAiB;IACzB,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC/B,4DAA4D;IAC5D,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B;AA4BD,eAAO,MAAM,YAAY,oEAA2E,iBAAiB,8BA0SnH,CAAC;AA0GH,UAAU,gBAAgB;IACxB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAC7C,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;CAChC;AACD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,gBAAgB,4BAktB9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAmBnE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,sHAAsH;AACtH,eAAO,MAAM,MAAM,UAOlB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAmBnE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,sHAAsH;AACtH,eAAO,MAAM,MAAM,UAOlB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgD9C"}
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
/** 菜单设计最大高度(px);实际由 useAnchoredMaxHeight 按视口可用空间钳位。
|
|
10
10
|
* 调法:调大允许更高菜单(矮视口下仍会被钳到视口内),调小菜单更矮。 */
|
|
11
11
|
export declare const MENU_MAX_HEIGHT = 420;
|
|
12
|
-
/**
|
|
12
|
+
/** 与视口边缘保留的距离(px);对齐 primitives 里未导出的 MARGIN。
|
|
13
|
+
*
|
|
14
|
+
* 调用 `useAnchoredMaxHeight` 时**显式传这个值**作为 margin 参数(见
|
|
15
|
+
* ModelSelect.tsx 的调用点),而不是靠官方默认值恰好也是 12 的巧合:上游一旦把
|
|
16
|
+
* 默认 MARGIN 改掉,隐式依赖会让本菜单的贴边距离跟着漂,而菜单自身毫无察觉。
|
|
17
|
+
* `test/official-seat-shadow.test.mjs` 反向钉住「两边仍相等」——官方改了会红,
|
|
18
|
+
* 那时再决定是跟随还是显式分叉。
|
|
13
19
|
* 改动同时影响向上/向下弹与水平钳位的边距,需与官方 MARGIN 意图保持一致。 */
|
|
14
20
|
export declare const MENU_VIEWPORT_MARGIN = 12;
|
|
15
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuFit.d.ts","sourceRoot":"","sources":["../../../src/client/menuFit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;uCACuC;AACvC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;
|
|
1
|
+
{"version":3,"file":"menuFit.d.ts","sourceRoot":"","sources":["../../../src/client/menuFit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;uCACuC;AACvC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;;;;;;;8CAO8C;AAC9C,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAEvG;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM3H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/client/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AACF,eAAO,MAAM,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/client/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AACF,eAAO,MAAM,GAAG,EAAE,MA+mBjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bittersmilezzz/dsh-model-selector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "DeepSeek Harness 的增强模型选择器:单层菜单(搜索 + 分组)+ 底部内联推理强度(Effort)滑杆。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -82,17 +82,17 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
85
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.
|
|
86
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.
|
|
87
|
-
"@deepseek-ai/dsh-client-
|
|
88
|
-
"@deepseek-ai/dsh-client-ui-
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-
|
|
85
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.1",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.7-rc.1",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1",
|
|
93
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.1",
|
|
92
94
|
"react": "^18.2.0",
|
|
93
|
-
"react-dom": "^18.2.0"
|
|
94
|
-
"@deepseek-ai/dsh-client-store": "^0.1.6-alpha.1",
|
|
95
|
-
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1"
|
|
95
|
+
"react-dom": "^18.2.0"
|
|
96
96
|
},
|
|
97
97
|
"peerDependenciesMeta": {
|
|
98
98
|
"@deepseek-ai/dsh-client-ui-primitives": {
|
|
@@ -112,16 +112,16 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
116
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.
|
|
117
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.
|
|
118
|
-
"@deepseek-ai/dsh-client-store": "^0.1.
|
|
119
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.
|
|
120
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.
|
|
122
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.
|
|
123
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.
|
|
124
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
115
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
116
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.1",
|
|
117
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1",
|
|
118
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-rc.1",
|
|
119
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.1",
|
|
120
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.7-rc.1",
|
|
121
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1",
|
|
122
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1",
|
|
123
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1",
|
|
124
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.1",
|
|
125
125
|
"@types/node": "^26.2.0",
|
|
126
126
|
"@types/react": "~18.3.31",
|
|
127
127
|
"@types/react-dom": "~18.3.7",
|