@sparkelf/dsh-plus 0.2.9-alpha.80 → 0.2.9-alpha.81

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 (32) hide show
  1. package/package.json +34 -55
  2. package/patches/approval-allow-policy.patch +3 -3
  3. package/patches/atomic-write-zombie-lock-holder.patch +1 -1
  4. package/patches/bootstrap-exempt-names.patch +6 -6
  5. package/patches/browser-auth-mode.patch +3 -3
  6. package/patches/composer-popover-boundaries.patch +33 -69
  7. package/patches/diagram-preview.patch +3 -3
  8. package/patches/image-offload-hoist-replay.patch +6 -6
  9. package/patches/input-trigger-source-label.patch +4 -4
  10. package/patches/legacy-code-preset.patch +5 -5
  11. package/patches/llm-pi-ai-transport-truncation.patch +4 -4
  12. package/patches/mobile-journal-generation.patch +2 -2
  13. package/patches/office-preview-stable-load.patch +1 -1
  14. package/patches/officecli-deliverables.patch +2 -2
  15. package/patches/ptc-mcp-schema-types.patch +3 -3
  16. package/patches/resource-ref-chip-mentions.patch +34 -32
  17. package/patches/responses-reasoning-status.patch +42 -41
  18. package/patches/session-controller-image-downgrade-and-tool-visibility.patch +16 -14
  19. package/patches/session-envelope-ignorable.patch +57 -28
  20. package/patches/session-export-chinese.patch +11 -11
  21. package/patches/session-format-legacy-restart.patch +1 -1
  22. package/patches/sidebar-right-tab-menu.patch +10 -8
  23. package/patches/state-dot-brand-blue.patch +2 -2
  24. package/patches/ui-schedule-plaza-tab.patch +1 -1
  25. package/patches/ui-settings-compact-phone.patch +2 -9
  26. package/patches/ui-sidebar-right-global-panel.patch +3 -3
  27. package/patches/visibility-filters.patch +10 -10
  28. package/patches/web-runtime-compat.patch +1 -1
  29. package/patches/workspace-hide-group-rooms.patch +2 -2
  30. package/patches/workspace-storage-restore.patch +5 -5
  31. package/patches/wsl-native-open.patch +8 -8
  32. package/patches/session-log-trajectory-toolbar.patch +0 -352
@@ -1,5 +1,5 @@
1
1
  diff --git a/packages/api/session-controller/src/client/contract/session.ts b/packages/api/session-controller/src/client/contract/session.ts
2
- index 9233ac84cb..21ce2a2dad 100644
2
+ index ce060ec4..ea3ce4b6 100644
3
3
  --- a/packages/api/session-controller/src/client/contract/session.ts
4
4
  +++ b/packages/api/session-controller/src/client/contract/session.ts
5
5
  @@ -12,7 +12,7 @@ import type { MessageId } from '@deepseek-ai/dsh-llm/brand'
@@ -20,7 +20,7 @@ index 9233ac84cb..21ce2a2dad 100644
20
20
  /**
21
21
  * Resolve one stored image using this Session's gateway permission scope.
22
22
  diff --git a/packages/api/session-controller/src/client/index.ts b/packages/api/session-controller/src/client/index.ts
23
- index b9600f36a6..d48cb92447 100644
23
+ index b9600f36..d48cb924 100644
24
24
  --- a/packages/api/session-controller/src/client/index.ts
25
25
  +++ b/packages/api/session-controller/src/client/index.ts
26
26
  @@ -28,6 +28,7 @@ export { createScope, scopeOf } from './scope.ts'
@@ -32,7 +32,7 @@ index b9600f36a6..d48cb92447 100644
32
32
  SessionListPhase,
33
33
  SessionListSnapshot,
34
34
  diff --git a/packages/api/session-controller/src/client/sessions/session.ts b/packages/api/session-controller/src/client/sessions/session.ts
35
- index 253da9c463..0d5d4bbf67 100644
35
+ index 60194de5..67459761 100644
36
36
  --- a/packages/api/session-controller/src/client/sessions/session.ts
37
37
  +++ b/packages/api/session-controller/src/client/sessions/session.ts
38
38
  @@ -17,6 +17,7 @@ import type {
@@ -43,7 +43,7 @@ index 253da9c463..0d5d4bbf67 100644
43
43
  } from '../../types.ts'
44
44
  import type {
45
45
  BeginSubmissionInput, PendingSubmissionRetirement, SessionFace, SubmissionHandle,
46
- @@ -263,6 +264,7 @@ export class Session implements SessionFace {
46
+ @@ -272,6 +273,7 @@ export class Session implements SessionFace {
47
47
  mode: 'queue' | 'steer',
48
48
  signal?: AbortSignal,
49
49
  requestId?: SessionRequestId,
@@ -51,7 +51,7 @@ index 253da9c463..0d5d4bbf67 100644
51
51
  ): Promise<RemoteResult<{ accepted: true }>> {
52
52
  this.promptError = null
53
53
  this.lastAgentError = null
54
- @@ -278,6 +280,7 @@ export class Session implements SessionFace {
54
+ @@ -287,6 +289,7 @@ export class Session implements SessionFace {
55
55
  mode,
56
56
  content,
57
57
  clientTimeZone,
@@ -60,10 +60,10 @@ index 253da9c463..0d5d4bbf67 100644
60
60
  } else if (content.some(part => part.type === 'file')) {
61
61
  result = {
62
62
  diff --git a/packages/api/session-controller/src/index.ts b/packages/api/session-controller/src/index.ts
63
- index 94d08c77e3..3d9bf30009 100644
63
+ index 6303340c..a6c253ee 100644
64
64
  --- a/packages/api/session-controller/src/index.ts
65
65
  +++ b/packages/api/session-controller/src/index.ts
66
- @@ -484,6 +484,9 @@ export class SessionController extends TypertRemoteService {
66
+ @@ -487,6 +487,9 @@ export class SessionController extends TypertRemoteService {
67
67
  rpcId: request.requestId,
68
68
  ...(clientTimeZone === undefined ? {} : { clientTimeZone }),
69
69
  ...(principal === undefined ? {} : { principal }),
@@ -74,10 +74,10 @@ index 94d08c77e3..3d9bf30009 100644
74
74
  return this.commands.prompt(request, source)
75
75
  }
76
76
  diff --git a/packages/api/session-controller/src/types.ts b/packages/api/session-controller/src/types.ts
77
- index 9e399d8f3b..46a4507c56 100644
77
+ index 49cd7c0f..12257027 100644
78
78
  --- a/packages/api/session-controller/src/types.ts
79
79
  +++ b/packages/api/session-controller/src/types.ts
80
- @@ -317,6 +317,23 @@ export interface SessionForkValue {
80
+ @@ -320,6 +320,23 @@ export interface SessionForkValue {
81
81
  readonly sessionId: SessionId
82
82
  }
83
83
 
@@ -100,17 +100,17 @@ index 9e399d8f3b..46a4507c56 100644
100
100
  +
101
101
  /** Session prompt request. */
102
102
  export interface SessionPromptRequest {
103
- /** Client-minted identity persisted on the exact accepted user message. */
104
- @@ -325,6 +342,8 @@ export interface SessionPromptRequest {
103
+ /** Client-minted identity persisted on the accepted inbox input, including empty continuation. */
104
+ @@ -328,6 +345,8 @@ export interface SessionPromptRequest {
105
105
  readonly mode: 'queue' | 'steer'
106
- /** At least one non-whitespace text part or attachment. */
106
+ /** Non-whitespace text or attachments; an empty array continues an eligible failed idle Session. */
107
107
  readonly content: readonly PromptContentPart[]
108
108
  + /** Structured mentions the composer declared, in document order. Absent when it carried none. */
109
109
  + readonly mentions?: readonly SessionMentionRef[]
110
110
  readonly clientTimeZone?: string
111
111
  }
112
112
 
113
- @@ -394,7 +413,13 @@ declare module '@deepseek-ai/dsh-llm' {
113
+ @@ -397,7 +416,13 @@ declare module '@deepseek-ai/dsh-llm' {
114
114
  * caller that submitted the prompt. `principal` is written only for a
115
115
  * caller other than the owner, so an absent `principal` means the owner.
116
116
  */
@@ -122,14 +122,14 @@ index 9e399d8f3b..46a4507c56 100644
122
122
  + principal?: Principal
123
123
  + mentions?: readonly SessionMentionRef[]
124
124
  + }
125
+ /** Empty retry user message with browser prompt correlation and caller metadata. */
126
+ 'retry-rpc': { kind: 'retry'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal }
125
127
  }
126
- }
127
-
128
128
  diff --git a/packages/client/ui-conversation/src/client/contract/draft-editor.ts b/packages/client/ui-conversation/src/client/contract/draft-editor.ts
129
- index b305bb3a3c..069ad977dd 100644
129
+ index 86592a82..3ee5ea16 100644
130
130
  --- a/packages/client/ui-conversation/src/client/contract/draft-editor.ts
131
131
  +++ b/packages/client/ui-conversation/src/client/contract/draft-editor.ts
132
- @@ -15,7 +15,12 @@ export interface ReferenceInsert {
132
+ @@ -16,7 +16,12 @@ export interface ReferenceInsert {
133
133
  readonly source: string
134
134
  readonly ref: string
135
135
  readonly label: string
@@ -144,10 +144,10 @@ index b305bb3a3c..069ad977dd 100644
144
144
  }
145
145
 
146
146
  diff --git a/packages/client/ui-conversation/src/client/input/facade.ts b/packages/client/ui-conversation/src/client/input/facade.ts
147
- index 6306216b1c..d8e2233001 100644
147
+ index 1fd208b6..a0155622 100644
148
148
  --- a/packages/client/ui-conversation/src/client/input/facade.ts
149
149
  +++ b/packages/client/ui-conversation/src/client/input/facade.ts
150
- @@ -20,8 +20,10 @@ import type {
150
+ @@ -21,8 +21,10 @@ import type {
151
151
  SessionInput, SubmitAttempt, SubmitAttachment, SubmitOutcome,
152
152
  } from '../contract/input.ts'
153
153
  import type {
@@ -159,7 +159,7 @@ index 6306216b1c..d8e2233001 100644
159
159
  import type { InputSubmitMode, MessageSubmission, MessageSubmissionState } from '../contract/composer-submission.ts'
160
160
  import { serializeDraftPrompt } from './prompt.ts'
161
161
  import { SubmitMachine } from './machine.ts'
162
- @@ -69,6 +71,7 @@ export interface SessionInputDeps {
162
+ @@ -70,6 +72,7 @@ export interface SessionInputDeps {
163
163
  mode: InputSubmitMode,
164
164
  signal: AbortSignal,
165
165
  accept: () => void,
@@ -167,7 +167,7 @@ index 6306216b1c..d8e2233001 100644
167
167
  ): Promise<SubmitOutcome>
168
168
  /** Live Session and composer-block policy for transcript insertion. */
169
169
  quoteInsertionAllowed?: () => boolean
170
- @@ -129,6 +132,29 @@ const EMPTY_LEXICON: ReadonlyMap<'/' | '@', readonly string[]> = new Map()
170
+ @@ -135,6 +138,29 @@ const EMPTY_LEXICON: ReadonlyMap<'/' | '@', readonly string[]> = new Map()
171
171
  * setDraft/submit + the published InputState store, over a shell-owned
172
172
  * Lexical editor.
173
173
  */
@@ -197,10 +197,10 @@ index 6306216b1c..d8e2233001 100644
197
197
  export class SessionInputShell implements SessionInput {
198
198
  /** Published editor projection + submit-plane state + queue overlay (the InputZone currency source). */
199
199
  readonly state: SnapshotStore<InputState>
200
- @@ -726,7 +752,10 @@ export class SessionInputShell implements SessionInput {
201
- })
202
- const send = (text: string): void => {
203
- if (this.dead(attempt)) return
200
+ @@ -742,7 +768,10 @@ export class SessionInputShell implements SessionInput {
201
+ this.settleSink(attempt, Promise.resolve({ kind: 'success' }))
202
+ return
203
+ }
204
204
  - this.settleSink(attempt, this.deps.defaultSink(text, attachmentIds, mode, attempt.signal, () => { this.acceptSink(attempt) }))
205
205
  + const mentions = collectMentions(attempt.occurrences)
206
206
  + this.settleSink(attempt, mentions === undefined
@@ -210,13 +210,13 @@ index 6306216b1c..d8e2233001 100644
210
210
  if (!(prompt instanceof Promise)) { send(prompt); return }
211
211
  void prompt.then(send, (error: unknown) => { this.failSink(attempt, error) })
212
212
  diff --git a/packages/client/ui-conversation/src/client/input/hub.ts b/packages/client/ui-conversation/src/client/input/hub.ts
213
- index 02897a18c6..5f1a3228a4 100644
213
+ index f6e9ce41..7f4354b0 100644
214
214
  --- a/packages/client/ui-conversation/src/client/input/hub.ts
215
215
  +++ b/packages/client/ui-conversation/src/client/input/hub.ts
216
216
  @@ -12,6 +12,7 @@ import type {
217
217
  ISessions, SessionBinding, SessionFace,
218
218
  } from '@deepseek-ai/dsh-api-session-controller/client'
219
- import type { SessionId } from '@deepseek-ai/dsh-session/types'
219
+ import type { SessionId, SessionSeq } from '@deepseek-ai/dsh-session/types'
220
220
  +import type { SessionMentionRef } from '@deepseek-ai/dsh-api-session-controller/client'
221
221
  import type { TranslateNS } from '@deepseek-ai/dsh-client-locale/client'
222
222
  import type { InboxState } from '@deepseek-ai/dsh-agent/types'
@@ -238,13 +238,15 @@ index 02897a18c6..5f1a3228a4 100644
238
238
  quoteRemoveLabel: () => this.t('quote.remove'),
239
239
  quoteInsertionAllowed: () => {
240
240
  const state = session.getSnapshot()
241
- @@ -250,9 +252,13 @@ export class InputHub implements SessionInputResolver {
241
+ @@ -273,11 +275,15 @@ export class InputHub implements SessionInputResolver {
242
242
  mode: InputSubmitMode,
243
243
  signal: AbortSignal,
244
244
  accept: () => void,
245
245
  + mentions?: readonly SessionMentionRef[],
246
246
  ): Promise<SubmitOutcome> {
247
- if (text === '' && attachmentIds.length === 0) return Promise.resolve({ kind: 'success' })
247
+ if (text === '' && attachmentIds.length === 0) {
248
+ return session.prompt([], mode, signal).then(result => result.ok ? { kind: 'success' } : { kind: 'error' })
249
+ }
248
250
  - return this.conversation().sendSession(session, text, attachmentIds, mode, signal, accept)
249
251
  + // A draft that declared mentions takes one extra argument; the ordinary send keeps its shape.
250
252
  + return mentions === undefined || mentions.length === 0
@@ -254,7 +256,7 @@ index 02897a18c6..5f1a3228a4 100644
254
256
 
255
257
  /**
256
258
  diff --git a/packages/client/ui-conversation/src/client/service.ts b/packages/client/ui-conversation/src/client/service.ts
257
- index af19eb7721..4ae2286dcd 100644
259
+ index af19eb77..4ae2286d 100644
258
260
  --- a/packages/client/ui-conversation/src/client/service.ts
259
261
  +++ b/packages/client/ui-conversation/src/client/service.ts
260
262
  @@ -9,6 +9,7 @@
@@ -289,7 +291,7 @@ index af19eb7721..4ae2286dcd 100644
289
291
  // An accepted prompt whose echo already retired unobserved, as when its queue entry was removed.
290
292
  diff --git a/packages/client/ui-conversation/tests/mentions.client.spec.ts b/packages/client/ui-conversation/tests/mentions.client.spec.ts
291
293
  new file mode 100644
292
- index 0000000000..7439cbfff0
294
+ index 00000000..7439cbff
293
295
  --- /dev/null
294
296
  +++ b/packages/client/ui-conversation/tests/mentions.client.spec.ts
295
297
  @@ -0,0 +1,45 @@
@@ -340,7 +342,7 @@ index 0000000000..7439cbfff0
340
342
  +})
341
343
 
342
344
  diff --git a/packages/client/ui-primitives/src/ReferenceIcon.tsx b/packages/client/ui-primitives/src/ReferenceIcon.tsx
343
- index ca566c40f6..7fd75f96a2 100644
345
+ index ca566c40..7fd75f96 100644
344
346
  --- a/packages/client/ui-primitives/src/ReferenceIcon.tsx
345
347
  +++ b/packages/client/ui-primitives/src/ReferenceIcon.tsx
346
348
  @@ -1,12 +1,12 @@
@@ -1,8 +1,8 @@
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
 
@@ -35,10 +35,10 @@ 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'
41
+ @@ -50,6 +50,9 @@ type EditorLayout = 'deepseek' | 'pi-ai' | 'unknown'
42
42
 
43
43
 
44
44
 
@@ -48,7 +48,7 @@ index 262f8c9d55..c1789d7813 100644
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,80 @@ 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
+ index f3f9ac00..f2dad40f 100644
198
199
  --- a/packages/llm/llm-pi-ai/src/adapter.ts
199
200
  +++ b/packages/llm/llm-pi-ai/src/adapter.ts
200
- @@ -123,6 +123,24 @@ export interface PiAiAuthInjection {
201
+ @@ -145,6 +145,24 @@ export interface PiAiAuthInjection {
201
202
  authContext: AuthContext
202
203
  }
203
204
 
@@ -222,7 +223,7 @@ index 9c8b4d3f60..b179b11883 100644
222
223
  /** Copy profile stream knobs into pi-ai's common option vocabulary. */
223
224
  function profileOptions(
224
225
  profile: ResolvedPiAiProviderProfile,
225
- @@ -138,6 +156,7 @@ function profileOptions(
226
+ @@ -160,6 +178,7 @@ function profileOptions(
226
227
  ...profile.transport === undefined ? {} : { transport: profile.transport },
227
228
  ...profile.timeoutMs === undefined ? {} : { timeoutMs: profile.timeoutMs },
228
229
  ...profile.websocketConnectTimeoutMs === undefined ? {} : { websocketConnectTimeoutMs: profile.websocketConnectTimeoutMs },
@@ -231,10 +232,10 @@ index 9c8b4d3f60..b179b11883 100644
231
232
  maxRetries: 0,
232
233
  }
233
234
  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
235
+ index 9de6c441..cd0b062e 100644
235
236
  --- a/packages/llm/llm-pi-ai/src/config.ts
236
237
  +++ b/packages/llm/llm-pi-ai/src/config.ts
237
- @@ -88,6 +88,12 @@ export type {
238
+ @@ -101,6 +101,12 @@ export type {
238
239
  PiAiThinkingFormat,
239
240
  } from './catalog.ts'
240
241
 
@@ -247,7 +248,7 @@ index 3731e1bcc0..c0422f4d6f 100644
247
248
  /** Configuration for one pi-ai provider route; the `providers` dict key IS the route. */
248
249
  export interface PiAiProviderProfile {
249
250
  /** Credential reference (environment-variable name) resolved per request through `ctx.credentials`. */
250
- @@ -125,6 +131,8 @@ export interface PiAiProviderProfile {
251
+ @@ -138,6 +144,8 @@ export interface PiAiProviderProfile {
251
252
  * refused rather than left looking applied.
252
253
  */
253
254
  compat?: PiAiCompatProfile
@@ -256,7 +257,7 @@ index 3731e1bcc0..c0422f4d6f 100644
256
257
  /**
257
258
  * Context capacity for a model this route lists that neither the entry nor
258
259
  * the installed catalog sizes (default 1,000,000). A guess by construction, so
259
- @@ -323,6 +331,10 @@ const modelProfile: z<PiAiModelProfile> = z.object({
260
+ @@ -352,6 +360,10 @@ const modelProfile: z<PiAiModelProfile> = z.object({
260
261
  /** A {@link modelProfile} whose id lives in the `modelOverrides` dict key. */
261
262
  const modelOverride: z<PiAiModelOverride> = z.object(modelFields)
262
263
 
@@ -267,7 +268,7 @@ index 3731e1bcc0..c0422f4d6f 100644
267
268
  const profile = z.object({
268
269
  apiKeyEnv: z.string().role('credential-ref'),
269
270
  displayName: z.string(),
270
- @@ -331,6 +343,7 @@ const profile = z.object({
271
+ @@ -360,6 +372,7 @@ const profile = z.object({
271
272
  models: z.array(modelProfile),
272
273
  modelOverrides: z.dict(modelOverride),
273
274
  compat: compatProfile,
@@ -275,7 +276,7 @@ index 3731e1bcc0..c0422f4d6f 100644
275
276
  defaultContextWindow: z.number().step(1).min(1).default(DEFAULT_CONTEXT_WINDOW),
276
277
  defaultMaxTokens: z.number().step(1).min(1).default(DEFAULT_MAX_TOKENS),
277
278
  defaultInput: z.array(z.union(MODALITIES)).default([...DEFAULT_INPUT]),
278
- @@ -426,6 +439,11 @@ export function resolveProfiles(
279
+ @@ -457,6 +470,11 @@ export function resolveProfiles(
279
280
  throw new Error(`llm-pi-ai: provider "${provider}" has an empty displayName`)
280
281
  }
281
282
  assertValidHeaders(provider, source.headers)
@@ -1,19 +1,22 @@
1
- --- a/packages/api/session-controller/src/commands.ts 2026-11-03 00:40:46.207711920 +0800
2
- +++ b/packages/api/session-controller/src/commands.ts 2026-11-03 00:40:46.209868821 +0800
3
- @@ -83,6 +83,9 @@
1
+ diff --git a/packages/api/session-controller/src/commands.ts b/packages/api/session-controller/src/commands.ts
2
+ index 921d71cd..5e6d7938 100644
3
+ --- a/packages/api/session-controller/src/commands.ts
4
+ +++ b/packages/api/session-controller/src/commands.ts
5
+ @@ -86,6 +86,9 @@ function latestCompletedPrefixBoundary(events: readonly SessionEvent[]): Session
4
6
 
5
7
  /** Implements Session business commands delegated by the Session Controller Remote service. */
6
8
  export class SessionCommandController {
7
9
  + /** 每个 agent 当前生效的工具可见性限制的撤销函数(按模型能力同步)。 */
8
10
  + private readonly toolVisibility = new WeakMap<Agent, () => void>()
9
11
  +
10
- /**
11
- * @param ctx - Host context carrying Agent, model, attachment, title, and Workspace services.
12
- * @param agents - sole owner of create, resume, and Agent composition.
13
- @@ -142,6 +145,31 @@
12
+ /** First-insertion facts cached per exact Session; the log remains the recovery source. */
13
+ private readonly promptReceipts = new WeakMap<Session, {
14
+ offset: SessionLogOffset
15
+ @@ -158,6 +161,31 @@ export class SessionCommandController {
16
+ return { sessionId, ...(created.agentPreset === undefined ? {} : { agentPreset: created.agentPreset }) }
14
17
  }
15
18
 
16
- /**
19
+ + /**
17
20
  + * 按当前模型的输入能力裁剪工具面。
18
21
  + *
19
22
  + * `read_image` 会把像素作为图像内容送进对话;纯文本模型即使被允许调用也消费不了,
@@ -38,11 +41,10 @@
38
41
  + }
39
42
  + }
40
43
  +
41
- + /**
44
+ /**
42
45
  * Validate and record one Session model selection; save the default in the background.
43
46
  * @param request - Session identity and requested model selection.
44
- * @returns the normalized selection recorded for the Session, without waiting for default persistence.
45
- @@ -160,6 +188,7 @@
47
+ @@ -177,6 +205,7 @@ export class SessionCommandController {
46
48
  }
47
49
  await this.ctx.llm.resolveCallConfig(selected)
48
50
  agent.model.select(selected)
@@ -50,10 +52,10 @@
50
52
  void this.ctx.agentDefaultModel.saveSelection(selected).catch((error: unknown) => {
51
53
  this.ctx.logger.warn(
52
54
  `session-controller: model selection changed for the Session but the default was not saved: ${String(error)}`,
53
- @@ -312,20 +341,24 @@
54
- const hasImage = admission.content.some(part => part.type === 'image')
55
+ @@ -346,20 +375,24 @@ export class SessionCommandController {
55
56
  const admit = async (): Promise<SessionPromptValue> => {
56
57
  try {
58
+ if (this.hasPromptRequest(agent.session, request.requestId)) return { accepted: true }
57
59
  + let promptContent = admission.content
58
60
  if (hasImage) {
59
61
  const current = agent.model.current()
@@ -78,6 +80,6 @@
78
80
  }
79
81
  - const content = await this.ctx.attachments.admitPromptContent(admission.content)
80
82
  + const content = await this.ctx.attachments.admitPromptContent(promptContent)
83
+ if (this.hasPromptRequest(agent.session, request.requestId)) return { accepted: true }
81
84
  const message: UserMessage = createUserMessage({ content, source })
82
85
  if (this.ctx.agents.get(agent.id) !== agent) {
83
- throw new RemoteError(
@@ -1,50 +1,79 @@
1
1
  diff --git a/packages/core/session/src/index.ts b/packages/core/session/src/index.ts
2
- index e9baee1b82..fcf26d713a 100644
2
+ index ea6c337f..82d57f11 100644
3
3
  --- a/packages/core/session/src/index.ts
4
4
  +++ b/packages/core/session/src/index.ts
5
5
  @@ -15,7 +15,7 @@ import type { Scoped } from '@deepseek-ai/dsh-scope'
6
6
  import type { Message } from '@deepseek-ai/dsh-llm'
7
7
  import { SESSION_FORMAT_VERSION, SessionLogOffset, SessionSeq } from './types.ts'
8
8
  import type { TypertLookup } from '@deepseek-ai/dsh-typert-protocol'
9
- -import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, SurfaceEventType } from './types.ts'
10
- +import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, EnvelopeIntent, SurfaceEventType } from './types.ts'
9
+ -import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventInput, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, SurfaceEventType } from './types.ts'
10
+ +import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventInput, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, EnvelopeIntent, SurfaceEventType } from './types.ts'
11
11
  import { SurfaceManager, validateSessionEventData, validateSurfaceMetadata } from './surface.ts'
12
12
  import type { SessionSurface, SessionMessageProjection } from './surface.ts'
13
13
  import { foldRequestHeader } from './request-header.ts'
14
- @@ -806,10 +806,13 @@ export class Session {
14
+ @@ -521,11 +521,14 @@ export function pluginRecordOf(event: SessionEvent): PluginRecord | undefined {
15
+ function snapshotAppend(
16
+ type: SessionEventType,
17
+ data: SessionEventMap[SessionEventType] | undefined,
18
+ - opts: SurfaceIntent | undefined,
19
+ + opts: SurfaceIntent | EnvelopeIntent | undefined,
20
+ subject: string,
21
+ ) {
22
+ - const surfaceOp = opts?.surfaceOp
23
+ - const sourceEventSeqs = opts?.sourceEventSeqs
24
+ + // A surface event's option object is a `SurfaceIntent`; a log-only event's is an
25
+ + // `EnvelopeIntent`. The two never share a field, so one object serves both.
26
+ + const intent = opts as (SurfaceIntent & EnvelopeIntent) | undefined
27
+ + const surfaceOp = intent?.surfaceOp
28
+ + const sourceEventSeqs = intent?.sourceEventSeqs
29
+ const dataSnapshot = snapshotJsonValue(data)
30
+ if (dataSnapshot === undefined) throw new Error(`${subject} carries non-JSON-serializable data`)
31
+ const surface = snapshotJsonValue({
32
+ @@ -533,13 +536,19 @@ function snapshotAppend(
33
+ ...surfaceOp === undefined ? {} : { surfaceOp },
34
+ })
35
+ if (surface === undefined) throw new Error(`${subject} carries non-JSON-serializable surface metadata`)
36
+ - return { type, data: dataSnapshot, surface }
37
+ + return { type, data: dataSnapshot, surface, ignorable: intent?.ignorable === true }
38
+ }
39
+
40
+ /** Construct and validate one live event from detached inputs. */
41
+ function createAppendEvent(snapshot: ReturnType<typeof snapshotAppend>, seq: SessionSeq): SessionEvent {
42
+ - const { type, data, surface } = snapshot
43
+ - const event = deepFreeze({ type, seq, time: Date.now(), data, ...surface } as SessionEvent)
44
+ + const { type, data, surface, ignorable } = snapshot
45
+ + // A log-only producer declares that a reader without its event type may skip the record.
46
+ + // Only `true` is admitted: the field's absence means required, and an explicit falsy value
47
+ + // would be indistinguishable from a producer that meant the opposite.
48
+ + const event = deepFreeze({
49
+ + type, seq, time: Date.now(), data, ...surface,
50
+ + ...ignorable ? { ignorable: true } : {},
51
+ + } as SessionEvent)
52
+ validateSessionEventData(event, `session event "${type}" at seq ${seq}`)
53
+ return event
54
+ }
55
+ @@ -853,12 +862,12 @@ export class Session {
15
56
  append<T extends SessionEventType>(
16
57
  type: T,
17
58
  data: SessionEventMap[T],
18
59
  - ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []
19
60
  + ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : [opts?: EnvelopeIntent]
20
- ): SessionEvent<T> {
61
+ ): SessionEvent<T>
62
+ append(
63
+ type: SessionEventType | readonly SessionEventInput[],
64
+ data?: SessionEventMap[SessionEventType],
65
+ - ...opts: [opts?: SurfaceIntent]
66
+ + ...opts: [opts?: SurfaceIntent | EnvelopeIntent]
67
+ ): SessionEvent | readonly SessionEvent[] {
68
+ if (typeof type !== 'string') return this.#appendEvents(type)
21
69
  this.publicationEntry()
22
- - const surfaceOpts: SurfaceIntent | undefined = opts[0]
23
- + // A surface event's single option object is a `SurfaceIntent`; a log-only event's is an
24
- + // `EnvelopeIntent`. The two never share a field, so one object serves both.
25
- + const intent: SurfaceIntent & EnvelopeIntent = (opts[0] ?? {}) as SurfaceIntent & EnvelopeIntent
26
- + const surfaceOpts: SurfaceIntent | undefined = opts[0] as SurfaceIntent | undefined
27
- const surfaceMetadata = {
28
- ...surfaceOpts?.sourceEventSeqs === undefined ? {} : { sourceEventSeqs: surfaceOpts.sourceEventSeqs },
29
- ...surfaceOpts?.surfaceOp === undefined ? {} : { surfaceOp: surfaceOpts.surfaceOp },
30
- @@ -830,6 +833,10 @@ export class Session {
31
- time: Date.now(),
32
- data: dataSnapshot,
33
- ...(surfaceMetadataSnapshot as { surfaceOp?: unknown; sourceEventSeqs?: unknown }),
34
- + // A log-only producer declares that a reader without its event type may skip the record.
35
- + // Only `true` is admitted: the field's absence means required, and an explicit falsy value
36
- + // would be indistinguishable from a producer that meant the opposite.
37
- + ...(intent.ignorable === true ? { ignorable: true } : {}),
38
- } as unknown as SessionEvent<T>)
39
- validateSessionEventData(event, `session event "${type}" at seq ${event.seq}`)
40
- this.commit(event as SessionEvent, entry)
41
70
  diff --git a/packages/core/session/src/types.ts b/packages/core/session/src/types.ts
42
- index 7787dd9bd0..af11a41635 100644
71
+ index 0cf13c86..0f350a41 100644
43
72
  --- a/packages/core/session/src/types.ts
44
73
  +++ b/packages/core/session/src/types.ts
45
- @@ -485,6 +485,18 @@ export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = {
46
- sourceEventSeqs?: SessionSeq[]
47
- })
74
+ @@ -490,6 +490,18 @@ export type SessionEventInput = {
75
+ [K in SessionEventType]: readonly [type: K, data: SessionEventMap[K], ...opts: K extends SurfaceEventType ? [opts: SurfaceIntent<K>] : []]
76
+ }[SessionEventType]
48
77
 
49
78
  +/**
50
79
  + * Envelope markers a log-only event may declare at {@link Session.append}.