@linxin666/dsh-client-ui-task-board 0.4.19 → 0.4.20

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 (43) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +1 -1
  3. package/README.zh.md +1 -1
  4. package/lib/client.js +179 -60
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +457 -70
  7. package/lib/types/client/board/TaskForm.d.ts +3 -1
  8. package/lib/types/client/index.d.ts +7 -1
  9. package/lib/types/client/native-panel.d.ts +1 -1
  10. package/lib/types/client/seats.d.ts +36 -2
  11. package/lib/types/client/settings-form.d.ts +2 -0
  12. package/lib/types/core/controller.d.ts +1 -1
  13. package/lib/types/core/extension.d.ts +135 -1
  14. package/lib/types/core/session-reuse.d.ts +46 -13
  15. package/lib/types/core/tasks.d.ts +2 -2
  16. package/lib/types/host/agent-tools.d.ts +7 -2
  17. package/lib/types/host/extension-registry.d.ts +30 -1
  18. package/lib/types/host-ledger.d.ts +86 -1
  19. package/lib/types/host-runner.d.ts +20 -1
  20. package/lib/types/host-service.d.ts +59 -14
  21. package/lib/types/protocol.d.ts +9 -1
  22. package/package.json +1 -1
  23. package/src/client/board/ExecutionLog.tsx +9 -2
  24. package/src/client/board/NewTaskModal.tsx +88 -3
  25. package/src/client/board/TaskDetail.tsx +18 -11
  26. package/src/client/board/TaskForm.tsx +13 -2
  27. package/src/client/board.module.css +67 -1
  28. package/src/client/index.ts +3 -0
  29. package/src/client/locales.ts +7 -6
  30. package/src/client/native-panel.tsx +2 -1
  31. package/src/client/seats.tsx +32 -4
  32. package/src/client/service.ts +3 -0
  33. package/src/client/settings-form.ts +21 -2
  34. package/src/core/controller.ts +9 -3
  35. package/src/core/extension.ts +138 -1
  36. package/src/core/session-reuse.ts +58 -21
  37. package/src/core/tasks.ts +2 -2
  38. package/src/host/agent-tools.ts +8 -2
  39. package/src/host/extension-registry.ts +121 -2
  40. package/src/host-ledger.ts +252 -18
  41. package/src/host-runner.ts +44 -5
  42. package/src/host-service.ts +180 -37
  43. package/src/protocol.ts +9 -1
@@ -8,10 +8,21 @@ import type { ExecutionSummary, TaskRecord } from './core/tasks.ts';
8
8
  import { type ExecutionFilePart, type ModelInfoResolver, type TaskBoardAttachmentStore } from './host/attachments.ts';
9
9
  /**
10
10
  * Host services needed to validate a task's workspace before creating a
11
- * session, and to resolve the workspace an unpinned card runs in.
11
+ * session, resolve the workspace an unpinned card runs in, and tell a reusable
12
+ * conversation apart from an archived one.
12
13
  */
13
14
  export interface TaskBoardWorkspaceRegistry {
14
15
  list(): readonly Workspace[];
16
+ /**
17
+ * The registry-global archive set, in archive order (issue #2068). A Session
18
+ * in it cannot run a turn, so the reuse rule refuses it and the launch starts
19
+ * a fresh conversation instead of settling as `blocked`.
20
+ *
21
+ * Optional: a deployment whose registry face does not report an archive set
22
+ * offers no archive action to defend against, and reuse keeps its
23
+ * pre-archive-set behavior.
24
+ */
25
+ archivedSessionIds?: readonly string[];
15
26
  }
16
27
  /**
17
28
  * The peer every gateway request names: derived from the public
@@ -114,6 +125,14 @@ export interface PromptDescendant {
114
125
  }
115
126
  /** Execution-shape context appended to the launched task's prompt. */
116
127
  export interface PromptContext {
128
+ /**
129
+ * The launch gate's section: what a provider that kept this run local needs
130
+ * the session to know before it reads the card. Injected on the same path as
131
+ * the tag prefixes and ahead of them, so it opens the prompt. Absent on every
132
+ * run nobody intercepted, which is what keeps the prompt byte-for-byte what
133
+ * it was before the seam existed.
134
+ */
135
+ launchPreamble?: string;
117
136
  /**
118
137
  * The card's outstanding descendants. Present exactly when this run is an
119
138
  * autonomous dispatch: the Host opens no session for them, so this session
@@ -4,8 +4,8 @@ import { HostExecutionRunner, type GatewayPeer, type SessionCommandDispatcher, t
4
4
  import { PowerInhibitor } from './power-inhibitor.ts';
5
5
  import { type TaskBoardAction, type TaskBoardEventPayload, type TaskBoardSnapshot } from './protocol.ts';
6
6
  import type { CardDefaults } from './core/card-defaults.ts';
7
- import { TaskBoardExtensionRegistry } from './host/extension-registry.ts';
8
- import type { TaskBoardExtension } from './core/extension.ts';
7
+ import { TaskBoardExtensionRegistry, type TaskBoardExtensionLogger } from './host/extension-registry.ts';
8
+ import type { TaskBoardExtension, TaskBoardLaunchTrigger } from './core/extension.ts';
9
9
  import { type ScheduleMode } from './core/tasks.ts';
10
10
  import type { ModelCatalogView } from './core/model-catalog.ts';
11
11
  import type { TaskPermission } from './core/handover.ts';
@@ -170,6 +170,13 @@ export declare class TaskBoardHostService {
170
170
  * Absent means "not proven legacy", which keeps the force exactly as it is.
171
171
  */
172
172
  legacyAgentTeams?: () => boolean;
173
+ /**
174
+ * Logging seat the extension registry writes to. Absent keeps the process
175
+ * console, which is what a deployment without an opinion wants; a
176
+ * deployment (or a test) that collects the board's own warnings and errors
177
+ * injects its own.
178
+ */
179
+ extensionLogger?: TaskBoardExtensionLogger;
173
180
  });
174
181
  start(): void;
175
182
  /**
@@ -247,11 +254,11 @@ export declare class TaskBoardHostService {
247
254
  private verifyActionAttachments;
248
255
  apply(requestId: string, action: Extract<TaskBoardAction, {
249
256
  kind: 'extension-action';
250
- }>, initiator?: string): Promise<TaskBoardSnapshot>;
257
+ }>, initiator?: string, trigger?: TaskBoardLaunchTrigger): Promise<TaskBoardSnapshot>;
251
258
  apply(requestId: string, action: Exclude<TaskBoardAction, {
252
259
  kind: 'extension-action';
253
- }>, initiator?: string): TaskBoardSnapshot;
254
- apply(requestId: string, action: TaskBoardAction, initiator?: string): TaskBoardSnapshot | Promise<TaskBoardSnapshot>;
260
+ }>, initiator?: string, trigger?: TaskBoardLaunchTrigger): TaskBoardSnapshot;
261
+ apply(requestId: string, action: TaskBoardAction, initiator?: string, trigger?: TaskBoardLaunchTrigger): TaskBoardSnapshot | Promise<TaskBoardSnapshot>;
255
262
  /**
256
263
  * Apply one board-owned action with every gate intact. Provider capability
257
264
  * calls and the same-origin wire both land here, so the two surfaces can
@@ -312,19 +319,57 @@ export declare class TaskBoardHostService {
312
319
  /**
313
320
  * The session a run may continue in, for a card that opted into reuse
314
321
  * (issue #1419). Reuse requires positive evidence that the previous session
315
- * is present and idle, and that evidence must be read for THIS launch: an
316
- * idle board no longer polls, so a roster cached from an earlier pass could
317
- * be hours old — either refusing a session that has been idle all along, or
318
- * prompting into one that started running since. A card that did not opt in
319
- * reads no roster at all, and a read that fails mints a fresh conversation
320
- * exactly as an unknown roster always did.
322
+ * is present, idle, and not archived, and that evidence must be read for THIS
323
+ * launch: an idle board no longer polls, so a roster cached from an earlier
324
+ * pass could be hours old — either refusing a session that has been idle all
325
+ * along, or prompting into one that started running since. A card that did not
326
+ * opt in reads no roster at all, and a read that fails mints a fresh
327
+ * conversation exactly as an unknown roster always did.
321
328
  * @param task - the task about to run.
322
- * @param force - continue the settled session regardless of the card's own
323
- * opt-in (a rework), which the reuse rule accepts without waiving any of its
324
- * evidence conditions.
325
329
  * @returns the session id to continue in, or undefined for a fresh session.
326
330
  */
327
331
  private reuseSessionFor;
332
+ /**
333
+ * One reuse decision for this launch: the session to continue in, or nothing
334
+ * plus the reason nothing was chosen, so each caller can report it.
335
+ *
336
+ * Reuse never targets a session in the Workspace registry's archive set
337
+ * (issue #2068). The Host's archived-session gate rejects the first step of a
338
+ * turn in an archived session before any model request is issued, so the
339
+ * run would settle as the opaque failure `agent turn ended without
340
+ * completing: blocked` — the fate of every scheduled run of a card whose
341
+ * conversation the user archived while cleaning the sidebar. Starting a fresh
342
+ * conversation is the only safe answer: archiving is a live user decision,
343
+ * and the board must not unarchive a conversation behind the user's back to
344
+ * keep reusing it.
345
+ * @param task - the task about to run.
346
+ * @param force - reuse without the card's own opt-in (a rework).
347
+ * @returns the reuse decision for this launch.
348
+ */
349
+ private reuseDecision;
350
+ /**
351
+ * The archived conversation the reuse rule refused, when it refused one.
352
+ *
353
+ * Reuse skipping an archived conversation is otherwise invisible: the board
354
+ * simply opens a new one, and only the caller knows which outcome it produced.
355
+ * @param task - the task about to run.
356
+ * @param archived - the archive set read for this launch, when reported.
357
+ * @returns the newest settled session id when it is archived, else undefined.
358
+ */
359
+ private archivedReuseTarget;
360
+ /**
361
+ * The Workspace registry's archive set, or undefined when this deployment's
362
+ * registry face cannot report one. An unreportable set is unknown evidence,
363
+ * never proof that nothing is archived: the rule then keeps its pre-archive
364
+ * behavior instead of inventing a refusal, because a registry face without
365
+ * the getter serves no archive action for the board to defend against.
366
+ *
367
+ * Read per launch rather than cached: archiving is a live user action, and an
368
+ * idle board no longer polls, so a set kept from an earlier pass could already
369
+ * claim a session that the user archived a moment ago.
370
+ * @returns the archived session ids, or undefined when unreportable.
371
+ */
372
+ private archivedSessionIds;
328
373
  /**
329
374
  * The session a rework continues, or the refusal that says why it cannot.
330
375
  *
@@ -82,6 +82,13 @@ export interface TaskBoardSnapshot {
82
82
  * The board forwards them verbatim; it never interprets their shape.
83
83
  */
84
84
  extensions?: Record<string, unknown>;
85
+ /**
86
+ * Monotonic counter bumped whenever any extension publishes, updates, or
87
+ * withdraws its summary. Carried on both full snapshots and SSE frames so
88
+ * browsers refetch `/state` when a provider publishes without touching the
89
+ * task ledger revision.
90
+ */
91
+ extensionsRevision?: number;
85
92
  /**
86
93
  * The attachment limits this deployment enforces, so the browser can refuse
87
94
  * an oversized selection before it uploads anything. The board's own caps
@@ -112,9 +119,10 @@ export interface TaskBoardSnapshot {
112
119
  export interface TaskBoardModelCatalog {
113
120
  catalog: ModelCatalogView;
114
121
  }
115
- /** SSE event frame: revision/scheduler/power only, never the task list. */
122
+ /** SSE event frame: revision/scheduler/power (plus extension summary revision), never the task list. */
116
123
  export interface TaskBoardEventPayload {
117
124
  revision: number;
125
+ extensionsRevision?: number;
118
126
  scheduler: TaskBoardSchedulerSnapshot;
119
127
  power: TaskBoardPowerSnapshot;
120
128
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-task-board",
3
3
  "description": "Host-authoritative task board for the DSH Web GUI with real session execution, Host cron scheduling, and optional cross-platform idle-sleep protection; mounted without DSH source changes.",
4
- "version": "0.4.19",
4
+ "version": "0.4.20",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -56,6 +56,13 @@ function ExecutionRow({ execution, timeZone, onOpen }: {
56
56
  // spinner, and a named outside agent instead of the initiating session. The
57
57
  // data attribute keeps the distinction machine-readable too.
58
58
  const external = execution.external === true
59
+ // An external run is closed by the outside agent itself through
60
+ // record-external-outcome, which stores that agent's text on the record's
61
+ // error field. A SUCCEEDED one therefore carries a conclusion, not a failure:
62
+ // it prints verbatim, in the neutral secondary style the row's other metadata
63
+ // uses. A failed or cancelled one still reads as the error it is, and so does
64
+ // every text a Host-run execution recorded.
65
+ const recordedConclusion = external && result === 'succeeded'
59
66
  return (
60
67
  <li
61
68
  className={css.executionRow}
@@ -95,8 +102,8 @@ function ExecutionRow({ execution, timeZone, onOpen }: {
95
102
  </span>
96
103
  )}
97
104
  {execution.error !== undefined && execution.error !== '' && (
98
- <span className={css.executionError}>
99
- {failureText(execution.error)}
105
+ <span className={recordedConclusion ? css.executionTimes : css.executionError}>
106
+ {recordedConclusion ? execution.error : failureText(execution.error)}
100
107
  </span>
101
108
  )}
102
109
  </div>
@@ -2,8 +2,9 @@
2
2
  * New-task modal: title + description + the prompt that execution will send.
3
3
  * Creates through the Host and closes only after the Host confirms it.
4
4
  */
5
- import { useEffect, useRef, useState } from 'react'
5
+ import { useCallback, useEffect, useRef, useState } from 'react'
6
6
  import type { BoardController } from '../../core/controller.ts'
7
+ import { isTaskBoardExtensionPayload, type TaskBoardComposeDraftOptions, type TaskBoardExtensionPayload } from '../../core/extension.ts'
7
8
  import { resolveCardTargets, type CardTargetSource } from '../../core/card-defaults.ts'
8
9
  import { isValidCron, nextRunAtMs } from '../../core/schedule.ts'
9
10
  import { parseFreezeRequest } from '../../core/freeze-snapshot.ts'
@@ -21,6 +22,7 @@ import { readParseModelPreference, writeParseModelPreference } from './parse-mod
21
22
  import { inheritPresetLabel, presetChoiceRows, presetLabel } from './preset-label.ts'
22
23
  import { ReasoningEffortField } from './ReasoningEffortField.tsx'
23
24
  import { modelDisplayLabel, reconcileReasoningEffort } from './model-options.ts'
25
+ import { TaskBoardSeatBoundary, useTaskBoardSeats } from '../seats.tsx'
24
26
  import css from '../board.module.css'
25
27
 
26
28
  export interface NewTaskModalProps {
@@ -93,6 +95,40 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
93
95
  const [reasoningEffort, setReasoningEffort] = useState(seed.reasoningEffort)
94
96
  const inheritedPermission = parentTask === undefined ? undefined : effectiveTaskPermission(parentTask)
95
97
  const [reuseSession, setReuseSession] = useState(initialTask?.reuseSession ?? false)
98
+ // The providers' own create-time configuration. What each of them wants
99
+ // written into the new card's `integrations` is held in a ref, not in state:
100
+ // it is read once, when the card is created, so reporting a draft never
101
+ // re-renders this dialog and the provider's own state stays the one place
102
+ // that says what it currently shows.
103
+ const seats = useTaskBoardSeats()
104
+ const composeDrafts = useRef(new Map<string, TaskBoardExtensionPayload | undefined>())
105
+ const composeErrors = useRef(new Map<string, string>())
106
+ const [composeSummaries, setComposeSummaries] = useState<Record<string, string>>({})
107
+ const [composeError, setComposeError] = useState<string | undefined>(undefined)
108
+ const [submitAttempt, setSubmitAttempt] = useState(0)
109
+ // Stable for the life of the dialog: a provider keys its reporting effect on
110
+ // it, so it must not change identity on every render.
111
+ const contribute = useCallback((extensionId: string, payload: TaskBoardExtensionPayload | undefined, options?: TaskBoardComposeDraftOptions): void => {
112
+ composeDrafts.current.set(extensionId, payload)
113
+ const nextError = options?.error?.trim()
114
+ if (nextError !== undefined && nextError !== '') composeErrors.current.set(extensionId, nextError)
115
+ else composeErrors.current.delete(extensionId)
116
+ if (composeErrors.current.size === 0) {
117
+ setComposeError(prev => {
118
+ if (prev !== undefined) setError(current => (current === prev ? undefined : current))
119
+ return undefined
120
+ })
121
+ }
122
+ const nextSummary = options?.summary?.trim() ?? ''
123
+ setComposeSummaries(current => {
124
+ const prev = current[extensionId] ?? ''
125
+ if (prev === nextSummary) return current
126
+ const next = { ...current }
127
+ if (nextSummary === '') delete next[extensionId]
128
+ else next[extensionId] = nextSummary
129
+ return next
130
+ })
131
+ }, [])
96
132
  const [scheduleEnabled, setScheduleEnabled] = useState(initialTask?.schedule?.enabled ?? false)
97
133
  const [scheduleMode, setScheduleMode] = useState<ScheduleMode>(initialTask?.schedule?.mode ?? 'cron')
98
134
  const [scheduleCron, setScheduleCron] = useState(initialTask?.schedule?.cron ?? '')
@@ -241,6 +277,27 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
241
277
  // Blank rows never reach the wire: the protocol rejects a tag with an
242
278
  // empty name, and an empty list is expressed by omitting the field.
243
279
  const tagList = cleanTags(tags)
280
+ setSubmitAttempt(count => count + 1)
281
+ const blockingError = [...composeErrors.current.values()][0]
282
+ if (blockingError !== undefined) {
283
+ setComposeError(blockingError)
284
+ setError(blockingError)
285
+ return
286
+ }
287
+ setComposeError(undefined)
288
+ // What the providers reported for THIS card, through the board's own payload
289
+ // gate: one unusable entry is dropped and named, never allowed to stop the
290
+ // create, and a dialog no provider feeds sends no `integrations` key at all
291
+ // so its create input is the one it always sent.
292
+ const integrations: Record<string, TaskBoardExtensionPayload> = {}
293
+ for (const [extensionId, draft] of composeDrafts.current) {
294
+ if (draft === undefined) continue
295
+ if (!isTaskBoardExtensionPayload(draft)) {
296
+ console.warn(`[dsh-task-board] dropped the ${extensionId} new-card draft: not an extension payload, or over the size limit`)
297
+ continue
298
+ }
299
+ integrations[extensionId] = draft
300
+ }
244
301
  setPending(true)
245
302
  // The staged files are uploaded NOW, because the card is being saved: the
246
303
  // upload is what turns a local file into a stored object the card can
@@ -277,6 +334,7 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
277
334
  ...(model === '' ? {} : { model }),
278
335
  ...(reasoningEffort === '' ? {} : { reasoningEffort }),
279
336
  ...(reuseSession ? { reuseSession: true } : {}),
337
+ ...(Object.keys(integrations).length === 0 ? {} : { integrations }),
280
338
  ...(tagList.length > 0 ? { tags: tagList } : {}),
281
339
  ...(attachments.persisted.length + uploaded.length > 0
282
340
  // The storage is content-addressed: the same content uploaded twice
@@ -387,7 +445,19 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
387
445
  : t('new.summary.attachmentCount', { count: String(attachmentCount) })
388
446
  const tagCount = cleanTags(tags).length
389
447
  const labelsSummary = tagCount === 0 ? t('new.summary.none') : t('new.summary.labelCount', { count: String(tagCount) })
390
- const runSummary = reuseSession ? t('exec.reuseSession') : t('new.summary.none')
448
+ const runSummaryParts = [
449
+ ...(reuseSession ? [t('exec.reuseSession')] : []),
450
+ ...Object.values(composeSummaries),
451
+ ]
452
+ const runSummary = runSummaryParts.length > 0 ? runSummaryParts.join(' · ') : t('new.summary.none')
453
+ // What the registered providers contribute to this dialog, read once so the
454
+ // run region can tell a deployment without a provider (nothing to wrap) from
455
+ // one that registered rows here.
456
+ const composeSeat = seats.composeSection({
457
+ contribute,
458
+ ...(initialTask?.integrations === undefined ? {} : { initialIntegrations: initialTask.integrations }),
459
+ submitAttempt,
460
+ })
391
461
  const handoverSummary = freezeText.trim() !== '' || handoverText.trim() !== ''
392
462
  ? t('new.summary.filled')
393
463
  : t('new.summary.none')
@@ -609,7 +679,13 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
609
679
  />
610
680
  </CollapsibleSection>
611
681
 
612
- <CollapsibleSection title={t('new.section.run')} summary={runSummary}>
682
+ <CollapsibleSection
683
+ title={t('new.section.run')}
684
+ summary={runSummary}
685
+ defaultOpen={initialTask?.integrations !== undefined && Object.keys(initialTask.integrations).length > 0 && composeSeat !== null && composeSeat !== undefined}
686
+ forceOpen={composeError !== undefined}
687
+ keepMounted={composeSeat !== null && composeSeat !== undefined}
688
+ >
613
689
  <label className={css.scheduleToggle}>
614
690
  <input
615
691
  type="checkbox"
@@ -619,6 +695,15 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
619
695
  <span>{t('exec.reuseSession')}</span>
620
696
  </label>
621
697
  <p className={css.detailText}>{t('exec.reuseSessionHint')}</p>
698
+ {/* A provider's own create-time configuration belongs in the region
699
+ that decides how this card runs, so its rows read after the run
700
+ switches instead of opening a region of the board's own. A page
701
+ whose providers register nothing renders nothing extra, and one
702
+ provider that throws while rendering is isolated here rather than
703
+ taking the dialog's other fields with it. */}
704
+ {composeSeat !== null && composeSeat !== undefined && (
705
+ <TaskBoardSeatBoundary>{composeSeat}</TaskBoardSeatBoundary>
706
+ )}
622
707
  </CollapsibleSection>
623
708
 
624
709
  <CollapsibleSection
@@ -988,8 +988,6 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
988
988
  <p className={css.detailMeta}>{t('detail.handover.bundledAt', { time: formatHostTimestamp(current.handover.bundledAt, timeZone) })}</p>
989
989
  </section>
990
990
  )}
991
-
992
- {seats.detailSection({ task: current, dispatch })}
993
991
  </div>
994
992
 
995
993
  <div className={css.detailColumn} data-detail-column="execution">
@@ -1011,17 +1009,26 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
1011
1009
  blocks around the group keep the panel's 16px rhythm. */}
1012
1010
  <div className={css.detailFolds}>
1013
1011
  {!archived && (
1014
- <>
1015
- <ExecutionSettingsSection
1016
- controller={controller}
1017
- task={current}
1018
- pending={pending}
1019
- executionOptions={snapshot.executionOptions}
1020
- />
1021
- <ScheduleSection controller={controller} task={current} pending={pending} />
1022
- </>
1012
+ <ExecutionSettingsSection
1013
+ controller={controller}
1014
+ task={current}
1015
+ pending={pending}
1016
+ executionOptions={snapshot.executionOptions}
1017
+ />
1023
1018
  )}
1024
1019
 
1020
+ {/* The providers' own task-detail sections are the same decision
1021
+ the pickers above them make — where and how this card runs —
1022
+ so they close the settings block instead of trailing the
1023
+ card's content. The wrapper is the rhythm: a seat is a
1024
+ section, not a fold row, so it keeps the panel's 16px
1025
+ section pitch inside the run stack. */}
1026
+ <div className={css.detailSeat}>
1027
+ {seats.detailSection({ task: current, dispatch })}
1028
+ </div>
1029
+
1030
+ {!archived && <ScheduleSection controller={controller} task={current} pending={pending} />}
1031
+
1025
1032
  <FoldSection title={t('detail.execution')} summary={historySummary}>
1026
1033
  {current.executions.length === 0 ? (
1027
1034
  <p className={css.detailText}>{t('detail.noExecution')}</p>
@@ -98,6 +98,7 @@ export function CollapsibleSection({
98
98
  summary,
99
99
  defaultOpen = false,
100
100
  forceOpen = false,
101
+ keepMounted = false,
101
102
  children,
102
103
  }: {
103
104
  title: string
@@ -107,12 +108,17 @@ export function CollapsibleSection({
107
108
  defaultOpen?: boolean
108
109
  /** Open regardless of the stored state: an error inside must stay visible. */
109
110
  forceOpen?: boolean
111
+ /** Keep children mounted while collapsed so provider seats keep their local state. */
112
+ keepMounted?: boolean
110
113
  children: ReactNode
111
114
  }) {
112
115
  const [open, setOpen] = useState(defaultOpen)
116
+ const [openedOnce, setOpenedOnce] = useState(defaultOpen || forceOpen)
113
117
  const panelId = useId()
114
118
  const expanded = forceOpen || open
119
+ if (expanded && !openedOnce) setOpenedOnce(true)
115
120
  const presence = usePresence(expanded)
121
+ const rendered = presence.mounted || (keepMounted && openedOnce)
116
122
  // The one-line preview is also the row's title, so the line that ellipsizes
117
123
  // in the header stays readable in full (same rule as the panel's folds).
118
124
  const fullLine = summary ?? ''
@@ -132,8 +138,13 @@ export function CollapsibleSection({
132
138
  <span className={css.formSectionSummary}>{summary}</span>
133
139
  )}
134
140
  </button>
135
- {presence.mounted && (
136
- <div className={css.formSectionBody} id={panelId} data-state={presence.phase}>
141
+ {rendered && (
142
+ <div
143
+ className={css.formSectionBody}
144
+ id={panelId}
145
+ data-state={presence.mounted ? presence.phase : 'closed'}
146
+ hidden={!presence.mounted}
147
+ >
137
148
  {children}
138
149
  </div>
139
150
  )}
@@ -1221,6 +1221,10 @@
1221
1221
  border-top: 1px solid var(--dsw-alias-separator-primary);
1222
1222
  }
1223
1223
 
1224
+ .formSectionBody[hidden] {
1225
+ display: none;
1226
+ }
1227
+
1224
1228
  .field {
1225
1229
  display: flex;
1226
1230
  flex-direction: column;
@@ -1288,6 +1292,13 @@
1288
1292
  * The view's whole type scale is three steps: 15 title, 13 body, 12 meta.
1289
1293
  * Hierarchy inside that scale comes from weight and the label colour role,
1290
1294
  * never from a fourth size.
1295
+ *
1296
+ * Scrolling contract: the body is the one scrollport and the action bar is its
1297
+ * following sibling in the same column, so the scroll ends at the bar's top
1298
+ * edge and no content can ever sit behind it — the bar is neither sticky nor
1299
+ * absolute. The drawer itself scrolls only when its own chrome no longer fits
1300
+ * (a viewport shorter than header + bar): clipping there would take the action
1301
+ * bar out of reach, which is the one thing a short viewport must not lose.
1291
1302
  * --------------------------------------------------------------------------- */
1292
1303
 
1293
1304
  .detail {
@@ -1300,7 +1311,9 @@
1300
1311
  border-radius: 14px;
1301
1312
  box-shadow: var(--dsw-shadow-lv3);
1302
1313
  color: var(--dsw-alias-label-primary);
1303
- overflow: hidden;
1314
+ overflow-x: hidden;
1315
+ overflow-y: auto;
1316
+ overscroll-behavior: contain;
1304
1317
  }
1305
1318
 
1306
1319
  .detailHeader {
@@ -1383,6 +1396,22 @@
1383
1396
  min-width: 0;
1384
1397
  }
1385
1398
 
1399
+ /* A provider seat is a section, not a fold row: it carries the panel's own
1400
+ heading level and its 8px inner rhythm. It therefore keeps the 16px section
1401
+ pitch (the group's 8px gap plus its own 8px) instead of the 8px that belongs
1402
+ between two fold rows. */
1403
+ .detailSeat {
1404
+ display: block;
1405
+ min-width: 0;
1406
+ margin-block: 8px;
1407
+ }
1408
+
1409
+ /* A page whose providers contribute nothing keeps the fold pitch untouched: an
1410
+ empty wrapper is no box, so it neither spaces nor separates the rows. */
1411
+ .detailSeat:empty {
1412
+ display: none;
1413
+ }
1414
+
1386
1415
  /* The two tracks only exist while the panel can carry them; below this the
1387
1416
  reading order is the single column above. */
1388
1417
  @media (min-width: 1024px) {
@@ -2170,6 +2199,43 @@
2170
2199
  }
2171
2200
  }
2172
2201
 
2202
+ /* Short viewports: at the panel's normal padding the header and the action bar
2203
+ * together take more than half of a 320px-tall surface, leaving the body a strip
2204
+ * a single row fits in — and under 240px they push the bar past the drawer's own
2205
+ * edge, where the drawer used to clip it. The chrome keeps its one 8px rhythm at
2206
+ * half the block padding, so a short viewport keeps a scrollport a block of
2207
+ * content fits in; below that the drawer's own scroll (.detail) takes over and
2208
+ * the bar still travels into reach. The safe-area insets survive because the
2209
+ * compact values are max()ed with them, exactly like the narrow-screen block
2210
+ * above.
2211
+ * --------------------------------------------------------------------------- */
2212
+
2213
+ @media (max-height: 320px) {
2214
+ .detailHeader {
2215
+ padding-block: max(8px, env(safe-area-inset-top)) 8px;
2216
+ }
2217
+
2218
+ .detailBody {
2219
+ padding-block: 8px 12px;
2220
+ }
2221
+
2222
+ .detailFooter {
2223
+ padding-block: 8px max(8px, env(safe-area-inset-bottom));
2224
+ }
2225
+ }
2226
+
2227
+ /* On the same short surface the drawer keeps a mask margin instead of the 80px
2228
+ * one it reserves for a roomy window: at 320px that reservation alone spent a
2229
+ * quarter of the height the content needs, and below 212px it left less room
2230
+ * than the header and the bar take together. The narrow-screen block above
2231
+ * already gives the drawer the full height, so this ceiling is for the desktop
2232
+ * layout only. */
2233
+ @media (min-width: 769px) and (max-height: 320px) {
2234
+ .detail {
2235
+ max-height: calc(100vh - 16px);
2236
+ }
2237
+ }
2238
+
2173
2239
  /* -----------------------------------------------------------------------------
2174
2240
  * Polish pass: complete interaction states (hover / active / focus-visible /
2175
2241
  * disabled), unified 120ms motion, and reduced-motion fallback.
@@ -43,6 +43,7 @@ import { TaskBoardClientService } from './service.ts'
43
43
  import {
44
44
  TASK_BOARD_SERVICE_NAME,
45
45
  type TaskBoardCardDecorationProps,
46
+ type TaskBoardComposeSectionProps,
46
47
  type TaskBoardDetailSectionProps,
47
48
  type TaskBoardHostFace,
48
49
  type TaskBoardSettingsSectionProps,
@@ -114,6 +115,8 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
114
115
  'task-board.settings.section': { kind: 'list'; scope: 'root'; owner: TaskBoardSettingsSectionProps }
115
116
  /** Provider card decoration; the board declares and renders it. */
116
117
  'task-board.card.decoration': { kind: 'list'; scope: 'root'; owner: TaskBoardCardDecorationProps }
118
+ /** Provider new-card section; the board declares and renders it in the create dialog. */
119
+ 'task-board.compose.section': { kind: 'list'; scope: 'root'; owner: TaskBoardComposeSectionProps }
117
120
  }
118
121
  }
119
122
 
@@ -289,8 +289,8 @@ export const zh = {
289
289
  'exec.reasoning.hint.noEfforts': '该模型没有可选的思考档位,始终沿用模型/宿主的默认值。',
290
290
  'exec.reasoning.hint.inherit': '留空即沿用该模型/宿主的默认档位。',
291
291
  'exec.reuseSession': '在同一对话继续',
292
- 'exec.reuseSessionHint': '开启后,本任务的后续执行在上一次会话里继续(该会话空闲且仍存在时),不再每次新建对话;每次复用时都会重新应用上面钉住的权限与模型。',
293
- 'exec.reuseSessionHint.short': '后续执行复用上一次的空闲会话',
292
+ 'exec.reuseSessionHint': '开启后,本任务的后续执行在上一次会话里继续(该会话空闲、仍存在且未被归档时),不再每次新建对话;该会话被归档时本次改开新对话。每次复用时都会重新应用上面钉住的权限与模型。',
293
+ 'exec.reuseSessionHint.short': '后续执行复用上一次的空闲会话(归档则新开)',
294
294
  'detail.executionSettings': '执行设置',
295
295
  'detail.settings.run': '运行方式',
296
296
  'detail.settings.summary.none': '未开启',
@@ -688,8 +688,8 @@ export const en: Record<keyof typeof zh, string> = {
688
688
  'exec.reasoning.hint.noEfforts': 'This model offers no selectable reasoning effort, so the model or Host default always applies.',
689
689
  'exec.reasoning.hint.inherit': 'Leave it empty to follow the model or Host default.',
690
690
  'exec.reuseSession': 'Continue in the same conversation',
691
- 'exec.reuseSessionHint': 'When on, later runs continue in the previous session (when that session is idle and still exists) instead of starting a new conversation each time; the pinned permission and model above are re-applied on every reuse.',
692
- 'exec.reuseSessionHint.short': 'Later runs reuse the previous idle session',
691
+ 'exec.reuseSessionHint': 'When on, later runs continue in the previous session (when that session is idle, still exists and is not archived) instead of starting a new conversation each time; an archived session makes that run start a fresh conversation. The pinned permission and model above are re-applied on every reuse.',
692
+ 'exec.reuseSessionHint.short': 'Later runs reuse the previous idle session (a fresh one if archived)',
693
693
  'detail.executionSettings': 'Execution Settings',
694
694
  'detail.settings.run': 'Run Mode',
695
695
  'detail.settings.summary.none': 'Not enabled',
@@ -813,8 +813,9 @@ export type SettingsCardKey = TaskBoardKey
813
813
 
814
814
  /** Active dictionary, picked by the document language at call time. */
815
815
  export function dictionary(): Record<TaskBoardKey, string> {
816
- const lang = typeof document !== 'undefined' ? document.documentElement.lang : 'zh'
817
- return lang.toLowerCase().startsWith('en') ? en : zh
816
+ // Chinese keeps the Chinese table; every other UI language falls back to English.
817
+ const lang = (typeof document !== 'undefined' && document.documentElement.lang !== '' ? document.documentElement.lang : 'zh').toLowerCase()
818
+ return lang.startsWith('zh') ? zh : en
818
819
  }
819
820
 
820
821
  /**
@@ -77,7 +77,7 @@ export function TaskBoardPanelIcon({ size }: { size: number; active: boolean }):
77
77
  */
78
78
  export function TaskBoardPanel({ controller, renderSlot }: {
79
79
  controller: BoardController
80
- /** Child-slot renderer the registration declares (detail + card decoration). */
80
+ /** Child-slot renderer the registration declares (detail, card decoration, new-card section). */
81
81
  renderSlot?: SlotRenderBinding
82
82
  }): ReactNode {
83
83
  const seats = useMemo(() => seatsFromRenderSlot(renderSlot), [renderSlot])
@@ -130,6 +130,7 @@ export function registerTaskBoardPanel(ctx: ClientContext, controller: BoardCont
130
130
  children: {
131
131
  'task-board.detail.section': { kind: 'list', scope: 'root' },
132
132
  'task-board.card.decoration': { kind: 'list', scope: 'root' },
133
+ 'task-board.compose.section': { kind: 'list', scope: 'root' },
133
134
  },
134
135
  inject: (): PanelFace => ({ controller }),
135
136
  }, TaskBoardPanel as never)))