dsh-plugin-effort-declare 0.1.4 → 0.1.5

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 (38) hide show
  1. package/CONTRIBUTING.en.md +2 -1
  2. package/CONTRIBUTING.md +1 -0
  3. package/INSTALL.en.md +2 -2
  4. package/INSTALL.md +2 -2
  5. package/README.en.md +4 -2
  6. package/README.md +3 -1
  7. package/lib/client.js +30 -32
  8. package/lib/client.js.map +1 -1
  9. package/lib/types/client/EffortDeclareSection.d.ts +3 -2
  10. package/lib/types/client/EffortDeclareSection.d.ts.map +1 -1
  11. package/lib/types/client/index.d.ts +23 -2
  12. package/lib/types/client/index.d.ts.map +1 -1
  13. package/lib/types/client/load-drafts.d.ts +3 -3
  14. package/lib/types/client/load-drafts.d.ts.map +1 -1
  15. package/lib/types/client/remotes.d.ts +40 -0
  16. package/lib/types/client/remotes.d.ts.map +1 -0
  17. package/lib/types/core/catalog.d.ts +3 -3
  18. package/lib/types/core/catalog.d.ts.map +1 -1
  19. package/lib/types/core/drafts.d.ts +1 -1
  20. package/lib/types/core/drafts.d.ts.map +1 -1
  21. package/lib/types/core/filter.d.ts +1 -1
  22. package/lib/types/core/filter.d.ts.map +1 -1
  23. package/lib/types/core/path-ops.d.ts +1 -1
  24. package/lib/types/core/path-ops.d.ts.map +1 -1
  25. package/package.json +9 -12
  26. package/src/client/EffortDeclareSection.tsx +18 -20
  27. package/src/client/README.en.md +5 -4
  28. package/src/client/README.md +5 -4
  29. package/src/client/index.ts +35 -6
  30. package/src/client/load-drafts.ts +10 -10
  31. package/src/client/locales.ts +2 -2
  32. package/src/client/remotes.ts +39 -0
  33. package/src/core/README.en.md +2 -2
  34. package/src/core/README.md +2 -2
  35. package/src/core/catalog.ts +3 -2
  36. package/src/core/drafts.ts +1 -1
  37. package/src/core/filter.ts +1 -1
  38. package/src/core/path-ops.ts +1 -1
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Client Remote faces this page actually calls (DSH 0.1.2).
3
+ * Shapes match the generated Host descriptors, not the removed IApiClient.
4
+ */
5
+ import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client'
6
+ import type { ProviderDirectoryEntry } from '../core/filter.ts'
7
+ import type { PathOp } from '../core/path-ops.ts'
8
+
9
+ /** Gateway envelope for a successful Remote call. */
10
+ export type RemoteOk<T> = { ok: true; value: T }
11
+
12
+ /** Gateway envelope for a failed Remote call. */
13
+ export type RemoteErr = { ok: false; error: { code: string; message: string } }
14
+
15
+ export type RemoteResult<T> = RemoteOk<T> | RemoteErr
16
+
17
+ /**
18
+ * `llm.listConfigurableProviders` — generated
19
+ * `@deepseek-ai/dsh-llm#llm/listConfigurableProviders`.
20
+ * `value` is the directory array (no `{ providers }` wrapper).
21
+ */
22
+ export interface LlmDirectoryRemote {
23
+ listConfigurableProviders(): Promise<RemoteResult<readonly ProviderDirectoryEntry[]>>
24
+ }
25
+
26
+ type NamespaceView = Parameters<SettingsDescribeFace['acceptView']>[0]
27
+
28
+ /**
29
+ * `settings.mutate` — generated
30
+ * `@deepseek-ai/dsh-api-settings-controller#settings/mutate`.
31
+ * Conflict code is `settings/conflict`.
32
+ */
33
+ export interface SettingsWriteRemote {
34
+ mutate(
35
+ ns: string,
36
+ ops: readonly PathOp[],
37
+ expectedRevision: number | undefined,
38
+ ): Promise<RemoteResult<NamespaceView>>
39
+ }
@@ -9,7 +9,7 @@
9
9
 
10
10
  Domain logic for the plugin: no React, no Cordis service instances. The settings page and Vitest both depend on these pure functions, so reasoning-effort and image-input semantics can regress without booting DSH.
11
11
 
12
- Canonical level names and `thinkingFormat` values follow `@deepseek-ai/dsh-llm-pi-ai` (0.1.0-rc.8; 0.1.1-rc.2 uses the same level set). `thinkingFormat` is pinned to the live-schema snapshot in [`tests/fixtures/pi-ai-thinking-format-union.ts`](../../tests/fixtures/pi-ai-thinking-format-union.ts); effort keys stay a locally pinned whitelist. UI choices come only from the live schema union. Writable `models[].input` modalities are `text` and `image`, matching the official schema.
12
+ Canonical level names and `thinkingFormat` values follow `@deepseek-ai/dsh-llm-pi-ai` (0.1.2-alpha.2; the level set matches rc.8, and `thinkingFormat` adds `baseten`). `thinkingFormat` is pinned to the live-schema snapshot in [`tests/fixtures/pi-ai-thinking-format-union.ts`](../../tests/fixtures/pi-ai-thinking-format-union.ts); effort keys stay a locally pinned whitelist. UI choices come only from the live schema union. Writable `models[].input` modalities are `text` and `image`, matching the official schema.
13
13
 
14
14
  ## What's in this directory
15
15
 
@@ -26,4 +26,4 @@ Canonical level names and `thinkingFormat` values follow `@deepseek-ai/dsh-llm-p
26
26
  | [`validate.ts`](./validate.ts) | Per-row validation: `reasoningEfforts` first, then `input`. |
27
27
  | [`attribution.ts`](./attribution.ts) | Settings footer line: `version © year Stardust`. Start year is 2026; end year is the UTC year at pack time, not the user’s clock when DSH starts. |
28
28
 
29
- An **absent** field means default-off. Do not encode an undeclared effort as `reasoningEfforts: false` — in official semantics `false` strips reasoning from a catalog model. Do not encode “no vision” as `input: []` — the official resolver treats an empty list as absent, but a bad stamp must not be re-saved. Disabling image input must delete the key; do not write `[text]`.
29
+ An **absent** field means default-off. Do not encode an undeclared effort as `reasoningEfforts: false` — in official semantics `false` strips reasoning from a catalog model. Do not encode “no vision” as `input: []` — the official resolver treats an empty list as absent, but a bad stamp must not be re-saved. Disabling image input must delete the key; do not write `['text']`.
@@ -9,7 +9,7 @@
9
9
 
10
10
  本插件的领域逻辑:无 React、无 Cordis 服务实例。设置页与 Vitest 都只依赖这些纯函数,因此推理档位与图片输入语义可以在不启动 DSH 的情况下回归。
11
11
 
12
- 规范键名与 `thinkingFormat` 取值对齐 `@deepseek-ai/dsh-llm-pi-ai`(0.1.0-rc.8;0.1.1-rc.2 档位集合相同)。`thinkingFormat` 由 [`tests/fixtures/pi-ai-thinking-format-union.ts`](../../tests/fixtures/pi-ai-thinking-format-union.ts) 钉现场 schema;档位键由测试钉本地白名单。UI 可选项只来自现场 schema union。`models[].input` 的可写模态为 `text` 与 `image`,与官方 schema 一致。
12
+ 规范键名与 `thinkingFormat` 取值对齐 `@deepseek-ai/dsh-llm-pi-ai`(0.1.2-alpha.2;档位集合与 rc.8 相同,`thinkingFormat` 增加 `baseten`)。`thinkingFormat` 由 [`tests/fixtures/pi-ai-thinking-format-union.ts`](../../tests/fixtures/pi-ai-thinking-format-union.ts) 钉现场 schema;档位键由测试钉本地白名单。UI 可选项只来自现场 schema union。`models[].input` 的可写模态为 `text` 与 `image`,与官方 schema 一致。
13
13
 
14
14
  ## 这个目录里有什么
15
15
 
@@ -26,4 +26,4 @@
26
26
  | [`validate.ts`](./validate.ts) | 对单行先校验 `reasoningEfforts`,再校验 `input`。 |
27
27
  | [`attribution.ts`](./attribution.ts) | 设置页页脚:`version © 年 Stardust`。首年写死 2026,结束年由打包时的 UTC 年注入,不是用户打开 DSH 的日期。 |
28
28
 
29
- **缺席字段**表示默认关闭。不要把「未声明档位」写成 `reasoningEfforts: false`——`false` 在官方语义里是从 catalog 模型上剥掉推理。不要把「未声明视觉」写成 `input: []`——官方把空列表当成缺席,但坏戳记不应被重新保存。取消图片输入必须删除该键,而不是写成 `[text]`。
29
+ **缺席字段**表示默认关闭。不要把「未声明档位」写成 `reasoningEfforts: false`——`false` 在官方语义里是从 catalog 模型上剥掉推理。不要把「未声明视觉」写成 `input: []`——官方把空列表当成缺席,但坏戳记不应被重新保存。取消图片输入必须删除该键,而不是写成 `['text']`。
@@ -2,7 +2,7 @@
2
2
  * Canonical thinking levels and openai-completions thinkingFormat names.
3
3
  *
4
4
  * Levels match `@deepseek-ai/dsh-llm-pi-ai` catalog.ts `THINKING_LEVELS`.
5
- * Formats match `SUPPORTED_THINKING_FORMATS` in the same file (rc.8).
5
+ * Formats match `SUPPORTED_THINKING_FORMATS` in the same file (0.1.2-alpha.2).
6
6
  * Tests pin these lists against a checked-in schema fixture
7
7
  * (`tests/fixtures/pi-ai-thinking-format-union.ts`) and the local level
8
8
  * whitelist. The settings page never offers the handwritten thinkingFormat
@@ -29,7 +29,7 @@ export const THINKING_LEVELS_WITHOUT_OFF = THINKING_LEVELS.filter(
29
29
  )
30
30
 
31
31
  /**
32
- * openai-completions thinkingFormat values from llm-pi-ai catalog.ts rc.8.
32
+ * openai-completions thinkingFormat values from llm-pi-ai catalog.ts 0.1.2-alpha.2.
33
33
  * Test pin only — not a writable UI fallback.
34
34
  */
35
35
  export const FALLBACK_THINKING_FORMATS = [
@@ -37,6 +37,7 @@ export const FALLBACK_THINKING_FORMATS = [
37
37
  'deepseek',
38
38
  'openrouter',
39
39
  'together',
40
+ 'baseten',
40
41
  'zai',
41
42
  'qwen',
42
43
  'chat-template',
@@ -10,7 +10,7 @@ import { cloneModels, cloneObject, isPlainObject } from './paths.ts'
10
10
  export interface RouteDraft {
11
11
  provider: string
12
12
  displayName: string
13
- /** Path inside the llm-pi-ai section (`llm.providers[].settingsPath`). */
13
+ /** Path inside the llm-pi-ai section (`listConfigurableProviders[].settingsPath`). */
14
14
  settingsPath: readonly string[]
15
15
  /** Namespace revision (one value for the whole llm-pi-ai document). */
16
16
  revision: number
@@ -6,7 +6,7 @@ import {
6
6
  } from './catalog.ts'
7
7
  import { getPath, isPlainObject } from './paths.ts'
8
8
 
9
- /** Directory row from `llm.providers()` (the fields v1 filtering reads). */
9
+ /** Directory row from `llm.listConfigurableProviders()` (the fields v1 filtering reads). */
10
10
  export interface ProviderDirectoryEntry {
11
11
  provider: string
12
12
  displayName?: string
@@ -33,7 +33,7 @@ export function pathOps(
33
33
  }
34
34
 
35
35
  export interface SaveSlices {
36
- /** Profile path from `llm.providers[].settingsPath` (not a hardcoded route id). */
36
+ /** Profile path from `listConfigurableProviders[].settingsPath` (not a hardcoded route id). */
37
37
  settingsPath: readonly string[]
38
38
  /** Models array before the edit (user layer). */
39
39
  beforeModels: unknown