@sparkelf/dsh-plus 0.2.8-alpha.50 → 0.2.9-alpha.100

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 (56) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +1 -1
  3. package/README.zh.md +1 -1
  4. package/cordis.patch.yml +29 -7
  5. package/lib/{apply-DmICvIGh.js → apply-CvePS57c.js} +213 -43
  6. package/lib/{apply-08huHfLG.js → apply-DycMqLJO.js} +240 -53
  7. package/lib/apply-c_7SZFSh.js +1193 -0
  8. package/lib/apply.js +2 -2
  9. package/lib/bin.js +20 -319
  10. package/lib/types/apply.d.ts +14 -1
  11. package/lib/types/apply.js +275 -53
  12. package/lib/types/capabilities.js +25 -36
  13. package/lib/types/manifest.d.ts +24 -0
  14. package/lib/types/manifest.js +51 -0
  15. package/lib/types/profile.d.ts +1 -0
  16. package/lib/types/profile.js +14 -3
  17. package/package.json +529 -577
  18. package/patches/approval-allow-policy.patch +3 -3
  19. package/patches/atomic-write-zombie-lock-holder.patch +1 -1
  20. package/patches/bootstrap-exempt-names.patch +6 -6
  21. package/patches/composer-popover-boundaries.patch +41 -283
  22. package/patches/image-offload-hoist-replay.patch +34 -31
  23. package/patches/input-trigger-source-label.patch +63 -0
  24. package/patches/legacy-code-preset.patch +5 -5
  25. package/patches/llm-pi-ai-transport-truncation.patch +4 -4
  26. package/patches/mobile-journal-generation.patch +2 -2
  27. package/patches/office-preview-stable-load.patch +1 -1
  28. package/patches/officecli-deliverables.patch +2 -2
  29. package/patches/ptc-mcp-schema-types.patch +3 -3
  30. package/patches/responses-reasoning-status.patch +197 -48
  31. package/patches/session-controller-image-downgrade-and-tool-visibility.patch +16 -14
  32. package/patches/session-export-chinese.patch +11 -11
  33. package/patches/session-format-legacy-restart.patch +1 -1
  34. package/patches/sidebar-right-tab-menu.patch +119 -0
  35. package/patches/state-dot-brand-blue.patch +2 -2
  36. package/patches/ui-settings-compact-phone.patch +2 -9
  37. package/patches/ui-sidebar-right-global-panel.patch +3 -3
  38. package/patches/workspace-hide-group-rooms.patch +38 -0
  39. package/patches/workspace-storage-restore.patch +21 -5
  40. package/patches/wsl-native-open.patch +8 -8
  41. package/lib/apply-e0aMC4B4.js +0 -601
  42. package/lib/types/standalone-capabilities.d.ts +0 -139
  43. package/lib/types/standalone-capabilities.js +0 -688
  44. package/lib/types/standalone-cli.d.ts +0 -17
  45. package/lib/types/standalone-cli.js +0 -913
  46. package/lib/types/standalone-profile.d.ts +0 -258
  47. package/lib/types/standalone-profile.js +0 -747
  48. package/lib/types/standalone-server.d.ts +0 -70
  49. package/lib/types/standalone-server.js +0 -158
  50. package/patches/browser-auth-mode.patch +0 -127
  51. package/patches/diagram-preview.patch +0 -562
  52. package/patches/dsh-resource-ref-chip.patch +0 -40
  53. package/patches/session-envelope-ignorable.patch +0 -63
  54. package/patches/session-log-trajectory-toolbar.patch +0 -352
  55. package/patches/ui-schedule-plaza-tab.patch +0 -217
  56. package/patches/web-runtime-compat.patch +0 -83
@@ -0,0 +1,63 @@
1
+ diff --git a/packages/client/ui-input-trigger/src/client/MenuView.tsx b/packages/client/ui-input-trigger/src/client/MenuView.tsx
2
+ index da6dccdb..42a77260 100644
3
+ --- a/packages/client/ui-input-trigger/src/client/MenuView.tsx
4
+ +++ b/packages/client/ui-input-trigger/src/client/MenuView.tsx
5
+ @@ -143,7 +143,7 @@ export function MenuView({ menu, headers, onPick, onCrumb, onHover, onDismiss, t
6
+ shows its raw name — hence the cast past the typed key union. */}
7
+ {group.showGroupTitle === false || group.items.some(item => item.section !== undefined)
8
+ ? null
9
+ - : <div className={css.groupTitle} role="presentation" data-source={group.source}>{t(group.source as MenuKey)}</div>}
10
+ + : <div className={css.groupTitle} role="presentation" data-source={group.source}>{group.label ?? t(group.source as MenuKey)}</div>}
11
+ {group.status === 'pending' && group.items.length === 0
12
+ ? (
13
+ <div role="status" aria-label={t('loading')} data-source={group.source}>
14
+ diff --git a/packages/client/ui-input-trigger/src/core/contract.ts b/packages/client/ui-input-trigger/src/core/contract.ts
15
+ index eab79f10..856555ca 100644
16
+ --- a/packages/client/ui-input-trigger/src/core/contract.ts
17
+ +++ b/packages/client/ui-input-trigger/src/core/contract.ts
18
+ @@ -37,6 +37,8 @@ export interface MenuState {
19
+ readonly generation: number
20
+ readonly groups: readonly {
21
+ readonly source: string
22
+ + /** Display title for the group row; absent renders the source id, as it always has. */
23
+ + readonly label?: string
24
+ /** False when candidate section rows own all visible group labeling. */
25
+ readonly showGroupTitle?: boolean
26
+ readonly status: 'pending' | 'ready'
27
+ diff --git a/packages/client/ui-input-trigger/src/core/menu.ts b/packages/client/ui-input-trigger/src/core/menu.ts
28
+ index 85787266..b3e84761 100644
29
+ --- a/packages/client/ui-input-trigger/src/core/menu.ts
30
+ +++ b/packages/client/ui-input-trigger/src/core/menu.ts
31
+ @@ -29,12 +29,13 @@ export const MENU_CLOSED: MenuState = { open: false, hit: null, generation: 0, g
32
+ */
33
+ export function seedGroups(
34
+ state: MenuState,
35
+ - sources: readonly Pick<InputTriggerSource, 'name' | 'showGroupTitle'>[],
36
+ + sources: readonly Pick<InputTriggerSource, 'name' | 'label' | 'showGroupTitle'>[],
37
+ ): MenuState {
38
+ return {
39
+ ...state,
40
+ groups: sources.map(source => ({
41
+ source: source.name,
42
+ + ...(source.label === undefined ? {} : { label: source.label }),
43
+ ...(source.showGroupTitle === false ? { showGroupTitle: false } : {}),
44
+ status: 'pending',
45
+ items: [],
46
+ diff --git a/packages/client/ui-input-trigger/src/types.ts b/packages/client/ui-input-trigger/src/types.ts
47
+ index cd3f6bc5..4b370b51 100644
48
+ --- a/packages/client/ui-input-trigger/src/types.ts
49
+ +++ b/packages/client/ui-input-trigger/src/types.ts
50
+ @@ -161,6 +161,13 @@ export interface InputTriggerSource {
51
+ readonly trigger: TriggerChar
52
+ /** Menu group label; unique per trigger — duplicate registration throws. */
53
+ readonly name: string
54
+ + /**
55
+ + * Menu group display title. The raw `name` is shown when absent, which is why an unregistered
56
+ + * source renders its own id; a plugin whose name is a package path sets this to the words a
57
+ + * reader expects. It never appears in a pick, a reference, or a stored mention -- identity stays
58
+ + * `name`.
59
+ + */
60
+ + readonly label?: string
61
+ /** Menu group display order (lower = higher in the list; default 0). */
62
+ readonly order?: number
63
+ /** Whether the menu renders the source-title row; defaults to true. */
@@ -1,5 +1,5 @@
1
1
  diff --git a/packages/api/session-controller/src/agent.ts b/packages/api/session-controller/src/agent.ts
2
- index d16e041773..41b6b4a0d1 100644
2
+ index 343ad9ba..14b26b46 100644
3
3
  --- a/packages/api/session-controller/src/agent.ts
4
4
  +++ b/packages/api/session-controller/src/agent.ts
5
5
  @@ -13,6 +13,9 @@ import { SessionQueryError, type SessionObservation } from '@deepseek-ai/dsh-ses
@@ -12,7 +12,7 @@ index d16e041773..41b6b4a0d1 100644
12
12
  /** Cold Session identity absent from persistence. */
13
13
  export class ApiSessionNotFound extends Error {}
14
14
 
15
- @@ -273,7 +276,15 @@ export class ApiSessionAgentController {
15
+ @@ -263,7 +266,15 @@ export class ApiSessionAgentController {
16
16
  if (presets === undefined) {
17
17
  return { setup: (agentCtx) => { installModelSelection(agentCtx) } }
18
18
  }
@@ -30,7 +30,7 @@ index d16e041773..41b6b4a0d1 100644
30
30
  agentPreset: resolvedId,
31
31
  setup: async (agentCtx) => {
32
32
  diff --git a/packages/api/session-controller/tests/agent.host.spec.ts b/packages/api/session-controller/tests/agent.host.spec.ts
33
- index aea96d5e04..3a37fcbbc0 100644
33
+ index aea96d5e..3a37fcbb 100644
34
34
  --- a/packages/api/session-controller/tests/agent.host.spec.ts
35
35
  +++ b/packages/api/session-controller/tests/agent.host.spec.ts
36
36
  @@ -10,6 +10,7 @@ import SessionStore, { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/ds
@@ -104,7 +104,7 @@ index aea96d5e04..3a37fcbbc0 100644
104
104
  + })
105
105
  })
106
106
  diff --git a/packages/client/ui-agent-preset/src/client/AgentPresetLabel.tsx b/packages/client/ui-agent-preset/src/client/AgentPresetLabel.tsx
107
- index 26fdcfcbf6..25dd5a95bc 100644
107
+ index 26fdcfcb..25dd5a95 100644
108
108
  --- a/packages/client/ui-agent-preset/src/client/AgentPresetLabel.tsx
109
109
  +++ b/packages/client/ui-agent-preset/src/client/AgentPresetLabel.tsx
110
110
  @@ -19,6 +19,8 @@ import type { AgentPresetSettingsState } from './settings-store.ts'
@@ -130,7 +130,7 @@ index 26fdcfcbf6..25dd5a95bc 100644
130
130
  )
131
131
  }
132
132
  diff --git a/packages/client/ui-agent-preset/tests/components.client.spec.tsx b/packages/client/ui-agent-preset/tests/components.client.spec.tsx
133
- index 79cc930e01..1e9c5f25d2 100644
133
+ index 79cc930e..1e9c5f25 100644
134
134
  --- a/packages/client/ui-agent-preset/tests/components.client.spec.tsx
135
135
  +++ b/packages/client/ui-agent-preset/tests/components.client.spec.tsx
136
136
  @@ -400,6 +400,12 @@ describe('the session-header label', () => {
@@ -1,8 +1,8 @@
1
1
  diff --git a/packages/llm/llm-pi-ai/src/stream.ts b/packages/llm/llm-pi-ai/src/stream.ts
2
- index 30e9c79..0e4df53 100644
2
+ index c3bfc1cd..93fff726 100644
3
3
  --- a/packages/llm/llm-pi-ai/src/stream.ts
4
4
  +++ b/packages/llm/llm-pi-ai/src/stream.ts
5
- @@ -56,6 +56,12 @@ function classifyPiAiError(message: string): string {
5
+ @@ -64,6 +64,12 @@ function classifyPiAiError(message: string): BuiltinLlmFailureCode {
6
6
  // finish_reason`). The connection dropped mid-response, so this is a transport
7
7
  // truncation, not a model-level error.
8
8
  if (/stream ended (?:before|without)\b/i.test(message)) return 'TRANSPORT'
@@ -16,10 +16,10 @@ index 30e9c79..0e4df53 100644
16
16
  || /\b(?:other side closed|HTTP2 request did not get a response|WebSocket closed unexpectedly)\b/i.test(message)
17
17
  // undici renders a mid-stream socket drop as a bare `terminated` (its
18
18
  diff --git a/packages/llm/llm-pi-ai/tests/convert.spec.ts b/packages/llm/llm-pi-ai/tests/convert.spec.ts
19
- index d6c86ba..0e57a35 100644
19
+ index ff5a6587..15dd5b53 100644
20
20
  --- a/packages/llm/llm-pi-ai/tests/convert.spec.ts
21
21
  +++ b/packages/llm/llm-pi-ai/tests/convert.spec.ts
22
- @@ -951,6 +951,11 @@ describe('mapStopReason / mapUsage', () => {
22
+ @@ -965,6 +965,11 @@ describe('mapStopReason / mapUsage', () => {
23
23
  'OpenAI Responses stream ended before a terminal response event',
24
24
  'openrouter stream ended without a terminal event',
25
25
  'Stream ended without finish_reason',
@@ -1,5 +1,5 @@
1
1
  diff --git a/packages/api/gateway/src/client/journal-stream.ts b/packages/api/gateway/src/client/journal-stream.ts
2
- index ab013abdf3..35dcb86255 100644
2
+ index ab013abd..35dcb862 100644
3
3
  --- a/packages/api/gateway/src/client/journal-stream.ts
4
4
  +++ b/packages/api/gateway/src/client/journal-stream.ts
5
5
  @@ -241,6 +241,10 @@ export abstract class RemoteJournalStream<
@@ -14,7 +14,7 @@ index ab013abdf3..35dcb86255 100644
14
14
  continue
15
15
  }
16
16
  diff --git a/packages/api/gateway/tests/journal-stream.client.spec.ts b/packages/api/gateway/tests/journal-stream.client.spec.ts
17
- index 498f5a033b..e6f1b41f69 100644
17
+ index 498f5a03..e6f1b41f 100644
18
18
  --- a/packages/api/gateway/tests/journal-stream.client.spec.ts
19
19
  +++ b/packages/api/gateway/tests/journal-stream.client.spec.ts
20
20
  @@ -788,7 +788,7 @@ describe('RemoteJournalStream', () => {
@@ -1,5 +1,5 @@
1
1
  diff --git a/packages/client/ui-sidebar-documentpreview/src/client/office/OfficeBody.tsx b/packages/client/ui-sidebar-documentpreview/src/client/office/OfficeBody.tsx
2
- index 5d74774e45..f3ef39a610 100644
2
+ index 3215f97a..a6d951b4 100644
3
3
  --- a/packages/client/ui-sidebar-documentpreview/src/client/office/OfficeBody.tsx
4
4
  +++ b/packages/client/ui-sidebar-documentpreview/src/client/office/OfficeBody.tsx
5
5
  @@ -1,5 +1,5 @@
@@ -1,8 +1,8 @@
1
1
  diff --git a/packages/client/ui-deliverables/src/client/turn-deliverables.ts b/packages/client/ui-deliverables/src/client/turn-deliverables.ts
2
- index 7eb765ec2b..806d9e4466 100644
2
+ index d51b54ed..df35a4da 100644
3
3
  --- a/packages/client/ui-deliverables/src/client/turn-deliverables.ts
4
4
  +++ b/packages/client/ui-deliverables/src/client/turn-deliverables.ts
5
- @@ -70,11 +70,37 @@ function mutationPath(name: string, argsRaw: string): string | null {
5
+ @@ -72,11 +72,37 @@ function mutationPath(name: string, argsRaw: string): string | null {
6
6
  return validEditArgs(args) ? pathValue(args.file_path) : null
7
7
  case 'str_replace_editor':
8
8
  return editorMutationPath(args)
@@ -1,5 +1,5 @@
1
1
  diff --git a/packages/core/tool-executor-ptc/src/ts-types.ts b/packages/core/tool-executor-ptc/src/ts-types.ts
2
- index 8026c847d2..4c0f622fc9 100644
2
+ index 8026c847..4c0f622f 100644
3
3
  --- a/packages/core/tool-executor-ptc/src/ts-types.ts
4
4
  +++ b/packages/core/tool-executor-ptc/src/ts-types.ts
5
5
  @@ -8,7 +8,7 @@
@@ -30,7 +30,7 @@ index 8026c847d2..4c0f622fc9 100644
30
30
  } catch {
31
31
  return 'unknown'
32
32
  diff --git a/packages/core/tool-executor-ptc/tests/ts-types.spec.ts b/packages/core/tool-executor-ptc/tests/ts-types.spec.ts
33
- index 2ec79e974c..a345818f06 100644
33
+ index 2ec79e97..a345818f 100644
34
34
  --- a/packages/core/tool-executor-ptc/tests/ts-types.spec.ts
35
35
  +++ b/packages/core/tool-executor-ptc/tests/ts-types.spec.ts
36
36
  @@ -1,6 +1,7 @@
@@ -90,7 +90,7 @@ index 2ec79e974c..a345818f06 100644
90
90
  const cases: unknown[] = [
91
91
  undefined,
92
92
  diff --git a/packages/core/tools/src/json-schema.ts b/packages/core/tools/src/json-schema.ts
93
- index c064fb294c..573cdd69c0 100644
93
+ index c064fb29..573cdd69 100644
94
94
  --- a/packages/core/tools/src/json-schema.ts
95
95
  +++ b/packages/core/tools/src/json-schema.ts
96
96
  @@ -84,6 +84,14 @@ const CONSTRAINT_KEYWORDS = new Set([
@@ -1,11 +1,11 @@
1
1
  diff --git a/packages/client/ui-settings-models/src/client/ModelsSection.module.css b/packages/client/ui-settings-models/src/client/ModelsSection.module.css
2
- index 51995fc1ae..5c2f3a098b 100644
2
+ index a232a690..ff7e7bf4 100644
3
3
  --- a/packages/client/ui-settings-models/src/client/ModelsSection.module.css
4
4
  +++ b/packages/client/ui-settings-models/src/client/ModelsSection.module.css
5
- @@ -463,6 +463,31 @@
5
+ @@ -470,6 +470,31 @@
6
6
  padding-top: 12px;
7
7
  }
8
-
8
+
9
9
  +.settingToggle {
10
10
  + display: flex;
11
11
  + align-items: center;
@@ -35,20 +35,20 @@ index 51995fc1ae..5c2f3a098b 100644
35
35
  position: relative;
36
36
  display: flex;
37
37
  diff --git a/packages/client/ui-settings-models/src/client/ProviderEditor.tsx b/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
38
- index 262f8c9d55..c1789d7813 100644
38
+ index 6dc2fb3b..e99773b8 100644
39
39
  --- a/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
40
40
  +++ b/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
41
- @@ -48,6 +48,9 @@ type EditorLayout = 'deepseek' | 'pi-ai' | 'unknown'
42
-
43
-
44
-
41
+ @@ -50,6 +50,9 @@ type EditorLayout = 'deepseek' | 'pi-ai' | 'unknown'
42
+
43
+
44
+
45
45
  +/** Leaf path of the curated OpenAI Responses compatibility setting. */
46
46
  +const OMIT_REASONING_INPUT_STATUS_PATH = ['responsesCompatibility', 'omitReasoningInputStatus'] as const
47
47
  +
48
48
  /** Props of {@link ProviderEditor}. */
49
49
  export interface ProviderEditorProps {
50
50
  /** Provider route id. */
51
- @@ -195,6 +198,10 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
51
+ @@ -219,6 +222,10 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
52
52
  const root = useMemo(() => schema.rehydrate(namespace.schema), [namespace.schema, schema])
53
53
  const node = useMemo(() => schema.nodeAtPath(root, settingsPath), [root, schema, settingsPath])
54
54
  const fallback = schema.getPath(namespace.value, settingsPath)
@@ -59,7 +59,7 @@ index 262f8c9d55..c1789d7813 100644
59
59
  const disabled = props.readOnly || busy
60
60
  const layout = layoutOf(namespace.ns)
61
61
  const keyRef = refFor(schema, namespace, settingsPath, props.provider)
62
- @@ -211,6 +218,11 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
62
+ @@ -235,6 +242,11 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
63
63
  const value = schema.getPath(source, [key])
64
64
  return typeof value === 'string' && value.trim().length > 0 ? value : undefined
65
65
  }
@@ -71,17 +71,18 @@ index 262f8c9d55..c1789d7813 100644
71
71
  const setField = (key: string, next: string | undefined): void => {
72
72
  // A value of nothing but whitespace is cleared, not stored: `stringAt`
73
73
  // already reports it as absent, so the field would otherwise render empty
74
- @@ -249,6 +261,9 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
75
- // What the form currently shows, which is what an interrogation must ask:
76
- // an edited-but-unsaved endpoint, and a key typed but not yet stored.
77
- const probeApi = stringAt(draft, 'api') ?? stringAt(fallback, 'api')
74
+ @@ -294,7 +306,9 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
75
+ ? 'keyRequired' as const
76
+ : undefined
77
+ const shownKeyFailure = credentialRequiredFailure ?? keyFailure
78
+ - // An edited-but-unsaved endpoint, and a key typed but not yet stored.
78
79
  + const omitReasoningInputStatus = schema.hasPath(draft, OMIT_REASONING_INPUT_STATUS_PATH)
79
80
  + ? schema.getPath(draft, OMIT_REASONING_INPUT_STATUS_PATH) === true
80
81
  + : schema.getPath(fallback, OMIT_REASONING_INPUT_STATUS_PATH) === true
81
82
  const probeBaseURL = stringAt(draft, 'baseURL') ?? stringAt(fallback, 'baseURL')
82
83
  const probe = {
83
84
  settingsNs: namespace.ns,
84
- @@ -497,7 +512,15 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
85
+ @@ -579,7 +593,15 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
85
86
  value={probeApi ?? ''}
86
87
  aria-label={t('customApi')}
87
88
  disabled={disabled}
@@ -98,10 +99,10 @@ index 262f8c9d55..c1789d7813 100644
98
99
  >
99
100
  {/* A profile naming no protocol — hand-written into
100
101
  cordis.patch.yml with no model to need one — selects
101
- @@ -511,6 +534,24 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
102
- </div>
103
- )
104
- : null}
102
+ @@ -611,6 +633,24 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
103
+ }}
104
+ />
105
+ )}
105
106
  + {family === 'pi-ai' && probeApi === 'openai-responses'
106
107
  + ? (
107
108
  + <label className={styles['settingToggle']}>
@@ -124,80 +125,88 @@ index 262f8c9d55..c1789d7813 100644
124
125
  the extras differ — DeepSeek's inherited capacities, pi-ai's
125
126
  endpoint interrogation. */}
126
127
  diff --git a/packages/client/ui-settings-models/src/client/locales.ts b/packages/client/ui-settings-models/src/client/locales.ts
127
- index 533b7aed02..35270a4904 100644
128
+ index 5dec1bda..f596cd47 100644
128
129
  --- a/packages/client/ui-settings-models/src/client/locales.ts
129
130
  +++ b/packages/client/ui-settings-models/src/client/locales.ts
130
- @@ -121,6 +121,7 @@ export const en = {
131
- protocolOpenAiCompletions: 'OpenAI Chat Completions',
131
+ @@ -156,6 +156,7 @@ export const en = {
132
132
  protocolOpenAiResponses: 'OpenAI Responses',
133
133
  protocolAnthropicMessages: 'Anthropic Messages',
134
+ protocolGemini: 'Gemini API',
134
135
  + omitReasoningInputStatus: 'Gateway compatibility mode',
135
136
  customNeedsBaseUrl: 'A custom provider needs a base URL.',
136
137
  customBaseUrlInvalid: 'Enter a valid HTTP or HTTPS URL.',
137
138
  customNeedsModels: 'A custom provider needs at least one model.',
138
- @@ -265,7 +266,8 @@ export const zh: { [Key in keyof typeof en]: string } = {
139
- protocolOpenAiCompletions: 'OpenAI Chat Completions',
139
+ @@ -336,7 +337,8 @@ export const zh: { [Key in keyof typeof en]: string } = {
140
140
  protocolOpenAiResponses: 'OpenAI Responses',
141
141
  protocolAnthropicMessages: 'Anthropic Messages',
142
+ protocolGemini: 'Gemini API',
142
143
  - customNeedsBaseUrl: '自定义模型 API 需要填写 API 地址。',
143
144
  + omitReasoningInputStatus: '中转站兼容模式',
144
145
  + customNeedsBaseUrl: '自定义提供方需要填写 API 地址。',
145
146
  customBaseUrlInvalid: '请输入有效的 HTTP 或 HTTPS 地址。',
146
147
  customNeedsModels: '自定义模型 API 至少需要一个模型。',
147
148
  customBaseUrlPlaceholder: 'https://gateway.example/v1',
148
- @@ -406,6 +408,7 @@ export const ja = {
149
- 'protocolOpenAiCompletions': 'OpenAI Chat Completions',
149
+ @@ -513,6 +515,7 @@ export const ja = {
150
150
  'protocolOpenAiResponses': 'OpenAI Responses',
151
151
  'protocolAnthropicMessages': 'Anthropic Messages',
152
+ 'protocolGemini': 'Gemini API',
152
153
  + 'omitReasoningInputStatus': 'ゲートウェイ互換モード',
153
154
  'customNeedsBaseUrl': 'カスタムプロバイダーにはベースURLが必要です。',
154
155
  'customBaseUrlInvalid': '有効なHTTPまたはHTTPSのURLを入力してください。',
155
156
  'customNeedsModels': 'カスタムプロバイダーには少なくとも1つのモデルが必要です。',
156
- @@ -547,6 +550,7 @@ export const es = {
157
- protocolOpenAiCompletions: 'Finalizaciones del chat OpenAI',
157
+ @@ -690,6 +693,7 @@ export const es = {
158
158
  protocolOpenAiResponses: 'Respuestas de OpenAI',
159
159
  protocolAnthropicMessages: 'Mensajes antrópicos',
160
+ protocolGemini: 'Gemini API',
160
161
  + omitReasoningInputStatus: 'Modo de compatibilidad de la puerta de enlace',
161
162
  customNeedsBaseUrl: 'Un proveedor personalizado necesita una URL base.',
162
163
  customBaseUrlInvalid: 'Ingrese una URL HTTP o HTTPS válida.',
163
164
  customNeedsModels: 'Un proveedor personalizado necesita al menos un modelo.',
164
- @@ -688,6 +692,7 @@ export const fr = {
165
- protocolOpenAiCompletions: 'Achèvements du chat OpenAI',
165
+ @@ -867,6 +871,7 @@ export const fr = {
166
166
  protocolOpenAiResponses: 'Réponses OpenAI',
167
167
  protocolAnthropicMessages: 'Messages anthropiques',
168
+ protocolGemini: 'Gemini API',
168
169
  + omitReasoningInputStatus: 'Mode de compatibilité de la passerelle',
169
170
  customNeedsBaseUrl: "Un fournisseur personnalisé a besoin d'une URL de base.",
170
171
  customBaseUrlInvalid: 'Saisissez une URL HTTP ou HTTPS valide.',
171
172
  customNeedsModels: "Un fournisseur personnalisé a besoin d'au moins un modèle.",
172
- @@ -829,6 +834,7 @@ export const de = {
173
- protocolOpenAiCompletions: 'OpenAI-Chat-Abschlüsse',
173
+ @@ -1044,6 +1049,7 @@ export const de = {
174
174
  protocolOpenAiResponses: 'OpenAI-Antworten',
175
175
  protocolAnthropicMessages: 'Anthropische Botschaften',
176
+ protocolGemini: 'Gemini API',
176
177
  + omitReasoningInputStatus: 'Gateway-Kompatibilitätsmodus',
177
178
  customNeedsBaseUrl: 'Ein benutzerdefinierter Anbieter benötigt eine Basis-URL.',
178
179
  customBaseUrlInvalid: 'Geben Sie eine gültige HTTP- oder HTTPS-URL ein.',
179
180
  customNeedsModels: 'Ein benutzerdefinierter Anbieter benötigt mindestens ein Modell.',
180
- @@ -970,6 +976,7 @@ export const ru = {
181
- protocolOpenAiCompletions: 'Завершения чата OpenAI',
181
+ @@ -1221,6 +1227,7 @@ export const ru = {
182
182
  protocolOpenAiResponses: 'Ответы OpenAI',
183
183
  protocolAnthropicMessages: 'Антропные сообщения',
184
+ protocolGemini: 'Gemini API',
184
185
  + omitReasoningInputStatus: 'Режим совместимости со шлюзом',
185
186
  customNeedsBaseUrl: 'Пользовательскому поставщику нужен базовый URL-адрес.',
186
187
  customBaseUrlInvalid: 'Введите действительный URL-адрес HTTP или HTTPS.',
187
188
  customNeedsModels: 'Пользовательскому поставщику нужна хотя бы одна модель.',
188
- @@ -1111,6 +1118,7 @@ export const pt = {
189
- protocolOpenAiCompletions: 'Conclusões do bate-papo OpenAI',
189
+ @@ -1398,6 +1405,7 @@ export const pt = {
190
190
  protocolOpenAiResponses: 'Respostas OpenAI',
191
191
  protocolAnthropicMessages: 'Mensagens Antrópicas',
192
+ protocolGemini: 'Gemini API',
192
193
  + omitReasoningInputStatus: 'Modo de compatibilidade do gateway',
193
194
  customNeedsBaseUrl: 'Um provedor personalizado precisa de um URL base.',
194
195
  customBaseUrlInvalid: 'Insira um URL HTTP ou HTTPS válido.',
195
196
  customNeedsModels: 'Um provedor personalizado precisa de pelo menos um modelo.',
196
197
  diff --git a/packages/llm/llm-pi-ai/src/adapter.ts b/packages/llm/llm-pi-ai/src/adapter.ts
197
- index 9c8b4d3f60..b179b11883 100644
198
198
  --- a/packages/llm/llm-pi-ai/src/adapter.ts
199
199
  +++ b/packages/llm/llm-pi-ai/src/adapter.ts
200
- @@ -123,6 +123,24 @@ export interface PiAiAuthInjection {
200
+ @@ -58,7 +58,7 @@
201
+ import type { AttachmentStore, ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'
202
+ import { brandString } from '@deepseek-ai/dsh-brand'
203
+ import { idleWatchdog, timeoutOf } from '@deepseek-ai/dsh-timeout'
204
+ -import type { ResolvedPiAiProviderProfile } from './config.ts'
205
+ +import type { PiAiReasoningSummary, ResolvedPiAiProviderProfile } from './config.ts'
206
+ import { requestImageTarget, toPiContext } from './context.ts'
207
+ import { resolveImageRequestBudget } from './image-policy.ts'
208
+ import { conversationUpdates, createModels, getSupportedThinkingLevels } from './models.ts'
209
+ @@ -146,9 +146,76 @@
201
210
  authContext: AuthContext
202
211
  }
203
212
 
@@ -218,26 +227,158 @@ index 9c8b4d3f60..b179b11883 100644
218
227
  + })
219
228
  + return { ...request, input }
220
229
  +}
230
+ +
231
+ +/**
232
+ + * Force one model's `reasoning.summary` to a chosen spelling, or drop it.
233
+ + * @param payload - the request body pi-ai built.
234
+ + * @param summary - the configured spelling, or `omit` to drop the field.
235
+ + * @returns the adjusted body, or undefined to leave the request untouched.
236
+ + */
237
+ +function applyReasoningSummary(payload: unknown, summary: PiAiReasoningSummary): unknown {
238
+ + const request = payload as Record<string, unknown> & { reasoning?: Record<string, unknown> }
239
+ + if (request.reasoning === undefined) return undefined
240
+ + if (summary === 'omit') {
241
+ + const { summary: _summary, ...reasoning } = request.reasoning
242
+ + return { ...request, reasoning }
243
+ + }
244
+ + return { ...request, reasoning: { ...request.reasoning, summary } }
245
+ +}
246
+ +
247
+ +/**
248
+ + * The payload hook a model needs, if any.
249
+ + * @param profile - the resolved route profile.
250
+ + * @param model - the model being called, which may pin its own summary.
251
+ + * @returns the `onPayload` option for this call, or an empty object.
252
+ + */
253
+ +function payloadOptions(
254
+ + profile: ResolvedPiAiProviderProfile,
255
+ + model: Model<Api>,
256
+ +): { onPayload?: (payload: unknown, model: Model<Api>) => unknown } {
257
+ + const hooks: ((payload: unknown) => unknown)[] = []
258
+ + if (profile.responsesCompatibility?.omitReasoningInputStatus === true) hooks.push(omitReasoningInputStatus)
259
+ + const summary = (model as { reasoningSummary?: PiAiReasoningSummary }).reasoningSummary
260
+ + if (summary !== undefined) hooks.push(payload => applyReasoningSummary(payload, summary))
261
+ + const [first, ...rest] = hooks
262
+ + if (first === undefined) return {}
263
+ + if (rest.length === 0) return { onPayload: first }
264
+ + return {
265
+ + onPayload: (payload: unknown): unknown => {
266
+ + let current = payload
267
+ + let changed = false
268
+ + for (const hook of hooks) {
269
+ + const next = hook(current)
270
+ + if (next === undefined) continue
271
+ + current = next
272
+ + changed = true
273
+ + }
274
+ + return changed ? current : undefined
275
+ + },
276
+ + }
277
+ +}
221
278
  +
222
279
  /** Copy profile stream knobs into pi-ai's common option vocabulary. */
223
280
  function profileOptions(
224
281
  profile: ResolvedPiAiProviderProfile,
225
- @@ -138,6 +156,7 @@ function profileOptions(
282
+ + model: Model<Api>,
283
+ reasoning: ModelThinkingLevel | undefined,
284
+ apiKey: string | undefined,
285
+ ): SimpleStreamOptions {
286
+ @@ -161,6 +228,7 @@
226
287
  ...profile.transport === undefined ? {} : { transport: profile.transport },
227
288
  ...profile.timeoutMs === undefined ? {} : { timeoutMs: profile.timeoutMs },
228
289
  ...profile.websocketConnectTimeoutMs === undefined ? {} : { websocketConnectTimeoutMs: profile.websocketConnectTimeoutMs },
229
- + ...profile.responsesCompatibility?.omitReasoningInputStatus === true ? { onPayload: omitReasoningInputStatus } : {},
290
+ + ...payloadOptions(profile, model),
230
291
  // The agent recovery layer owns visible attempts; one adapter call is one SDK attempt.
231
292
  maxRetries: 0,
232
293
  }
294
+ @@ -471,7 +539,7 @@
295
+ this.config.onThinkingOmitted?.({ provider: options.provider, model: options.model, count })
296
+ })
297
+ const events = snapshot.models.streamSimple(model, context, {
298
+ - ...profileOptions(profile, reasoning, apiKey),
299
+ + ...profileOptions(profile, model, reasoning, apiKey),
300
+ ...options.temperature === undefined ? {} : { temperature: options.temperature },
301
+ ...options.maxTokens === undefined ? {} : { maxTokens: options.maxTokens },
302
+ ...options.sessionId === undefined ? {} : { sessionId: String(options.sessionId) },
303
+ diff --git a/packages/llm/llm-pi-ai/src/catalog.ts b/packages/llm/llm-pi-ai/src/catalog.ts
304
+ index b2103095..cd903ab0 100644
305
+ --- a/packages/llm/llm-pi-ai/src/catalog.ts
306
+ +++ b/packages/llm/llm-pi-ai/src/catalog.ts
307
+ @@ -600,6 +600,29 @@ function assertOfferedCompatFields(
308
+ }
309
+ }
310
+
311
+ +/**
312
+ + * How one model's `reasoning.summary` leaves for an OpenAI Responses upstream.
313
+ + *
314
+ + * `auto`, `concise`, and `detailed` are the values the OpenAI Responses schema
315
+ + * accepts, so naming one pins the field. `omit` drops it instead.
316
+ + */
317
+ +export type PiAiReasoningSummary = 'auto' | 'concise' | 'detailed' | 'omit'
318
+ +
319
+ +/**
320
+ + * The `reasoning.summary` spellings a profile may declare. A drift gate like
321
+ + * the modality and thinking-level ones, so a new upstream spelling fails
322
+ + * compilation here until it is classified.
323
+ + */
324
+ +const REASONING_SUMMARY_GATE: Record<PiAiReasoningSummary, true> = {
325
+ + auto: true,
326
+ + concise: true,
327
+ + detailed: true,
328
+ + omit: true,
329
+ +}
330
+ +
331
+ +/** Every `reasoning.summary` spelling a profile may declare. */
332
+ +export const REASONING_SUMMARIES = Object.keys(REASONING_SUMMARY_GATE) as readonly PiAiReasoningSummary[]
333
+ +
334
+ /** One configured model entry: an id plus the catalog fields it overrides. */
335
+ export interface PiAiModelProfile {
336
+ /** Model id sent to the provider and accepted by {@link GenerateOptions.model}. */
337
+ @@ -637,6 +660,16 @@ export interface PiAiModelProfile {
338
+ reasoningEfforts?: false | PiAiReasoningEfforts
339
+ /** pi-ai wire-compatibility switches for this model, winning over the route's per field; one its protocol does not declare is refused. */
340
+ compat?: PiAiCompatProfile
341
+ + /**
342
+ + * How this model's `reasoning.summary` leaves for an OpenAI Responses
343
+ + * upstream. Absent keeps pi-ai's own default (`auto`).
344
+ + *
345
+ + * `omit` is for a gateway that refuses the field outright: pi-ai writes
346
+ + * `summary: options?.reasoningSummary || 'auto'` whenever a Responses model
347
+ + * reasons, so without this knob such a gateway fails every reply from that
348
+ + * model rather than merely losing a summary.
349
+ + */
350
+ + reasoningSummary?: PiAiReasoningSummary
351
+ }
352
+
353
+ /**
354
+ @@ -957,6 +990,7 @@ export function resolveRouteModels(
355
+ maxTokens,
356
+ ...resolveModelReasoning(provider, entry, base),
357
+ ...resolveModelCompat(provider, entry, request.compat, base, api),
358
+ + ...entry.reasoningSummary === undefined ? {} : { reasoningSummary: entry.reasoningSummary },
359
+ }
360
+ }
361
+ const models: Model<Api>[] = []
233
362
  diff --git a/packages/llm/llm-pi-ai/src/config.ts b/packages/llm/llm-pi-ai/src/config.ts
234
- index 3731e1bcc0..c0422f4d6f 100644
363
+ index 9de6c441..3f918b9b 100644
235
364
  --- a/packages/llm/llm-pi-ai/src/config.ts
236
365
  +++ b/packages/llm/llm-pi-ai/src/config.ts
237
- @@ -88,6 +88,12 @@ export type {
366
+ @@ -29,6 +29,7 @@ import {
367
+ MODALITIES,
368
+ PiAiCatalogError,
369
+ resolveRouteModels,
370
+ + REASONING_SUMMARIES,
371
+ SUPPORTED_THINKING_FORMATS,
372
+ THINKING_LEVELS,
373
+ THINKING_TOKEN_BUDGET_FIELDS,
374
+ @@ -98,9 +99,16 @@ export type {
375
+ PiAiModelOverride,
376
+ PiAiModelProfile,
377
+ PiAiReasoningEfforts,
378
+ + PiAiReasoningSummary,
238
379
  PiAiThinkingFormat,
239
380
  } from './catalog.ts'
240
-
381
+
241
382
  +/** OpenAI Responses input-item adjustments for compatible gateways. */
242
383
  +export interface PiAiResponsesCompatibility {
243
384
  + /** Omit response-only status metadata from replayed reasoning input items. */
@@ -247,7 +388,7 @@ index 3731e1bcc0..c0422f4d6f 100644
247
388
  /** Configuration for one pi-ai provider route; the `providers` dict key IS the route. */
248
389
  export interface PiAiProviderProfile {
249
390
  /** Credential reference (environment-variable name) resolved per request through `ctx.credentials`. */
250
- @@ -125,6 +131,8 @@ export interface PiAiProviderProfile {
391
+ @@ -138,6 +146,8 @@ export interface PiAiProviderProfile {
251
392
  * refused rather than left looking applied.
252
393
  */
253
394
  compat?: PiAiCompatProfile
@@ -256,10 +397,18 @@ index 3731e1bcc0..c0422f4d6f 100644
256
397
  /**
257
398
  * Context capacity for a model this route lists that neither the entry nor
258
399
  * the installed catalog sizes (default 1,000,000). A guess by construction, so
259
- @@ -323,6 +331,10 @@ const modelProfile: z<PiAiModelProfile> = z.object({
400
+ @@ -342,6 +352,7 @@ const modelFields = {
401
+ // installed catalog's capability", while `false` disables reasoning.
402
+ reasoningEfforts: z.union([z.const(false), reasoningEfforts]),
403
+ compat: compatProfile,
404
+ + reasoningSummary: z.union(REASONING_SUMMARIES),
405
+ }
406
+
407
+ const modelProfile: z<PiAiModelProfile> = z.object({
408
+ @@ -352,6 +363,10 @@ const modelProfile: z<PiAiModelProfile> = z.object({
260
409
  /** A {@link modelProfile} whose id lives in the `modelOverrides` dict key. */
261
410
  const modelOverride: z<PiAiModelOverride> = z.object(modelFields)
262
-
411
+
263
412
  +const responsesCompatibility: z<PiAiResponsesCompatibility> = z.object({
264
413
  + omitReasoningInputStatus: z.boolean(),
265
414
  +})
@@ -267,7 +416,7 @@ index 3731e1bcc0..c0422f4d6f 100644
267
416
  const profile = z.object({
268
417
  apiKeyEnv: z.string().role('credential-ref'),
269
418
  displayName: z.string(),
270
- @@ -331,6 +343,7 @@ const profile = z.object({
419
+ @@ -360,6 +375,7 @@ const profile = z.object({
271
420
  models: z.array(modelProfile),
272
421
  modelOverrides: z.dict(modelOverride),
273
422
  compat: compatProfile,
@@ -275,7 +424,7 @@ index 3731e1bcc0..c0422f4d6f 100644
275
424
  defaultContextWindow: z.number().step(1).min(1).default(DEFAULT_CONTEXT_WINDOW),
276
425
  defaultMaxTokens: z.number().step(1).min(1).default(DEFAULT_MAX_TOKENS),
277
426
  defaultInput: z.array(z.union(MODALITIES)).default([...DEFAULT_INPUT]),
278
- @@ -426,6 +439,11 @@ export function resolveProfiles(
427
+ @@ -457,6 +473,11 @@ export function resolveProfiles(
279
428
  throw new Error(`llm-pi-ai: provider "${provider}" has an empty displayName`)
280
429
  }
281
430
  assertValidHeaders(provider, source.headers)