@linxin666/dsh-client-ui-task-board 0.4.22 → 0.4.23

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 (40) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +6 -6
  3. package/README.zh.md +6 -6
  4. package/lib/client.js +410 -37
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +45 -27
  7. package/lib/types/client/TaskBoardSettingsCard.d.ts +1 -1
  8. package/lib/types/client/board/NewTaskModal.d.ts +4 -2
  9. package/lib/types/client/board/TaskBoard.d.ts +16 -1
  10. package/lib/types/client/board/model-options.d.ts +2 -2
  11. package/lib/types/client/index.d.ts +1 -1
  12. package/lib/types/client/locales.d.ts +3 -0
  13. package/lib/types/client/native-panel.d.ts +19 -1
  14. package/lib/types/client/session-activity.d.ts +36 -0
  15. package/lib/types/client/user-message-action.d.ts +46 -0
  16. package/lib/types/core/controller.d.ts +16 -0
  17. package/lib/types/core/model-catalog.d.ts +1 -1
  18. package/lib/types/dsh-home.d.ts +13 -3
  19. package/lib/types/host-routes.d.ts +2 -6
  20. package/lib/types/tool-surface.d.ts +6 -2
  21. package/package.json +33 -33
  22. package/src/client/TaskBoardSettingsCard.tsx +2 -2
  23. package/src/client/board/NewTaskModal.tsx +8 -6
  24. package/src/client/board/TaskBoard.tsx +59 -13
  25. package/src/client/board/model-options.ts +18 -8
  26. package/src/client/board.module.css +32 -0
  27. package/src/client/index.ts +31 -19
  28. package/src/client/locales.ts +6 -0
  29. package/src/client/native-panel.tsx +85 -5
  30. package/src/client/session-activity.tsx +163 -0
  31. package/src/client/user-message-action.tsx +211 -0
  32. package/src/core/controller.ts +30 -0
  33. package/src/core/model-catalog.ts +1 -1
  34. package/src/dsh-home.ts +35 -12
  35. package/src/host/agent-tools.ts +8 -0
  36. package/src/host-routes.ts +7 -16
  37. package/src/host-runner.ts +4 -4
  38. package/src/host-service.ts +6 -1
  39. package/src/index.ts +2 -3
  40. package/src/tool-surface.ts +17 -2
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.22",
4
+ "version": "0.4.23",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dsh": {
24
24
  "engines": {
25
- "dsh": ">=0.2.3-alpha.2"
25
+ "dsh": ">=0.2.3-alpha.4"
26
26
  },
27
27
  "bundle": {
28
28
  "patch": "./cordis.patch.yml"
@@ -42,45 +42,45 @@
42
42
  }
43
43
  },
44
44
  "peerDependencies": {
45
- "@deepseek-ai/dsh": ">=0.2.3-alpha.2",
46
- "react": "^18.2.0"
45
+ "@deepseek-ai/dsh": ">=0.2.3-alpha.4",
46
+ "react": "^19.3.1"
47
47
  },
48
48
  "dependencies": {
49
- "@deepseek-ai/schemastery": "~3.20.0-alpha.1",
49
+ "@deepseek-ai/schemastery": "~3.20.0-alpha.3",
50
50
  "marked": "^18.0.14"
51
51
  },
52
52
  "devDependencies": {
53
- "@deepseek-ai/cordis": "~4.2.0-alpha.1",
54
- "@deepseek-ai/dsh-agent": "^0.2.3-alpha.2",
55
- "@deepseek-ai/dsh-agent-preset-registry": "^0.2.3-alpha.2",
56
- "@deepseek-ai/dsh-attachment": "^0.2.3-alpha.2",
57
- "@deepseek-ai/dsh-api-gateway": "^0.2.3-alpha.2",
58
- "@deepseek-ai/dsh-api-remotes": "^0.2.3-alpha.2",
59
- "@deepseek-ai/dsh-api-session-controller": "^0.2.3-alpha.2",
60
- "@deepseek-ai/dsh-api-workspace-controller": "^0.2.3-alpha.2",
61
- "@deepseek-ai/dsh-client-connection": "^0.2.3-alpha.2",
62
- "@deepseek-ai/dsh-client-locale": "^0.2.3-alpha.2",
63
- "@deepseek-ai/dsh-client-store": "^0.2.3-alpha.2",
64
- "@deepseek-ai/dsh-client-ui-layout": "^0.2.3-alpha.2",
65
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.3-alpha.2",
66
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.3-alpha.2",
67
- "@deepseek-ai/dsh-client-ui-sidebar": "^0.2.3-alpha.2",
68
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.3-alpha.2",
69
- "@deepseek-ai/dsh-client-ui-workspace": "^0.2.3-alpha.2",
70
- "@deepseek-ai/dsh-commands": "^0.2.3-alpha.2",
71
- "@deepseek-ai/dsh-host-webserver": "^0.2.3-alpha.2",
72
- "@deepseek-ai/dsh-llm": "^0.2.3-alpha.2",
73
- "@deepseek-ai/dsh-settings": "^0.2.3-alpha.2",
74
- "@deepseek-ai/dsh-system-prompt": "^0.2.3-alpha.2",
75
- "@deepseek-ai/dsh-tools": "^0.2.3-alpha.2",
76
- "@deepseek-ai/dsh-workspace": "^0.2.3-alpha.2",
53
+ "@deepseek-ai/cordis": "~4.2.0-alpha.3",
54
+ "@deepseek-ai/dsh-agent": "^0.2.3-alpha.4",
55
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.3-alpha.4",
56
+ "@deepseek-ai/dsh-attachment": "^0.2.3-alpha.4",
57
+ "@deepseek-ai/dsh-api-gateway": "^0.2.3-alpha.4",
58
+ "@deepseek-ai/dsh-api-remotes": "^0.2.3-alpha.4",
59
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.3-alpha.4",
60
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.2.3-alpha.4",
61
+ "@deepseek-ai/dsh-client-connection": "^0.2.3-alpha.4",
62
+ "@deepseek-ai/dsh-client-locale": "^0.2.3-alpha.4",
63
+ "@deepseek-ai/dsh-client-store": "^0.2.3-alpha.4",
64
+ "@deepseek-ai/dsh-client-ui-layout": "^0.2.3-alpha.4",
65
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.3-alpha.4",
66
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.3-alpha.4",
67
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.2.3-alpha.4",
68
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.3-alpha.4",
69
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.2.3-alpha.4",
70
+ "@deepseek-ai/dsh-commands": "^0.2.3-alpha.4",
71
+ "@deepseek-ai/dsh-host-webserver": "^0.2.3-alpha.4",
72
+ "@deepseek-ai/dsh-llm": "^0.2.3-alpha.4",
73
+ "@deepseek-ai/dsh-settings": "^0.2.3-alpha.4",
74
+ "@deepseek-ai/dsh-system-prompt": "^0.2.3-alpha.4",
75
+ "@deepseek-ai/dsh-tools": "^0.2.3-alpha.4",
76
+ "@deepseek-ai/dsh-workspace": "^0.2.3-alpha.4",
77
77
  "@types/node": "^22.20.0",
78
- "@types/react": "~18.3.1",
79
- "@types/react-dom": "^18.3.5",
78
+ "@types/react": "~19.3.2",
79
+ "@types/react-dom": "~19.3.0",
80
80
  "@vitest/coverage-v8": "^4.1.11",
81
81
  "jsdom": "^25.0.0",
82
- "react": "^18.3.1",
83
- "react-dom": "^18.3.1",
82
+ "react": "^19.3.1",
83
+ "react-dom": "^19.3.1",
84
84
  "tsdown": "0.22.2",
85
85
  "typescript": "~5.7.2",
86
86
  "vitest": "^4.1.11"
@@ -4,7 +4,7 @@
4
4
  * the Web UI plugin group renders, bound to the `task-board` namespace.
5
5
  */
6
6
 
7
- import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
7
+ import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
8
8
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store'
9
9
  import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client'
10
10
  import { useEffect, useState } from 'react'
@@ -374,7 +374,7 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
374
374
  invalidLabel: t('settings.invalidNumber'),
375
375
  disabled,
376
376
  }
377
- // The new-card-defaults topic reads the SAME catalog the create dialog reads (session/modelCatalog, served here through the
377
+ // The new-card-defaults topic reads the SAME catalog the create dialog reads (models/catalog, served here through the
378
378
  // model-catalog payload), normalized once into the roster the reasoning
379
379
  // helpers below consume, so the default level can only offer levels the
380
380
  // chosen default model really declares.
@@ -3,7 +3,7 @@
3
3
  * Creates through the Host and closes only after the Host confirms it.
4
4
  */
5
5
  import { useCallback, useEffect, useRef, useState } from 'react'
6
- import type { BoardController } from '../../core/controller.ts'
6
+ import type { BoardController, ComposeTaskDraft } from '../../core/controller.ts'
7
7
  import { isTaskBoardExtensionPayload, type TaskBoardComposeDraftOptions, type TaskBoardExtensionPayload } from '../../core/extension.ts'
8
8
  import { resolveCardTargets, type CardTargetSource } from '../../core/card-defaults.ts'
9
9
  import { isValidCron, nextRunAtMs } from '../../core/schedule.ts'
@@ -30,6 +30,8 @@ export interface NewTaskModalProps {
30
30
  onClose: () => void
31
31
  /** Optional task template to clone/duplicate from. */
32
32
  initialTask?: TaskRecord
33
+ /** Optional prefilled draft (creates a fresh card, not a duplicate). */
34
+ initialDraft?: ComposeTaskDraft
33
35
  /**
34
36
  * Workspace the board's project filter has selected (#1536): a task created
35
37
  * while a project is open belongs to that project unless the user changes it.
@@ -62,11 +64,11 @@ function markStaged(
62
64
  }
63
65
 
64
66
  /** New-task form overlay. */
65
- export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps) {
67
+ export function NewTaskModal({ controller, onClose, initialTask, initialDraft, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps) {
66
68
  const isDuplicate = initialTask !== undefined
67
- const [title, setTitle] = useState(initialTask?.title ?? '')
68
- const [description, setDescription] = useState(initialTask?.description ?? '')
69
- const [prompt, setPrompt] = useState(initialTask?.prompt ?? '')
69
+ const [title, setTitle] = useState(initialTask?.title ?? initialDraft?.title ?? '')
70
+ const [description, setDescription] = useState(initialTask?.description ?? initialDraft?.description ?? '')
71
+ const [prompt, setPrompt] = useState(initialTask?.prompt ?? initialDraft?.prompt ?? '')
70
72
  // The four execution targets this dialog opens on, resolved by the one rule
71
73
  // the Host create path also uses (core/card-defaults.ts): what the card is
72
74
  // created from (a duplicate's source, a subtask's parent) first, the board's
@@ -85,7 +87,7 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
85
87
  // what makes the Host inherit the parent's binding together with its human
86
88
  // confirmation, while picking a value pins this card's own binding and
87
89
  // re-arms the gate. A parent's permission never travels here at all.
88
- const [workspaceId, setWorkspaceId] = useState(initialTask?.workspaceId ?? parentTask?.workspaceId ?? defaultWorkspaceId ?? '')
90
+ const [workspaceId, setWorkspaceId] = useState(initialTask?.workspaceId ?? parentTask?.workspaceId ?? initialDraft?.workspaceId ?? defaultWorkspaceId ?? '')
89
91
  const [mode, setMode] = useState(seed.mode)
90
92
  const [permission, setPermission] = useState(seed.permission)
91
93
  const [model, setModel] = useState(seed.model)
@@ -3,8 +3,8 @@
3
3
  * active. Cards open the task detail (never execute directly); the header
4
4
  * offers filter, new-task, and a back-to-chat escape.
5
5
  */
6
- import { memo, useCallback, useEffect, useRef, useState } from 'react'
7
- import { selectedTaskOf, type BoardController } from '../../core/controller.ts'
6
+ import { memo, useCallback, useEffect, useRef, useState, type ReactNode } from 'react'
7
+ import { selectedTaskOf, type BoardController, type ComposeTaskDraft } from '../../core/controller.ts'
8
8
  import { COLUMNS, MANUAL_STATUSES, canMoveTask, collectKnownTags, hasOpenExecution, tagTone, type TaskRecord, type TaskStatus } from '../../core/tasks.ts'
9
9
  import { t } from '../locales.ts'
10
10
  import css from '../board.module.css'
@@ -124,8 +124,20 @@ export const COLUMN_FOLD_THRESHOLD = 30
124
124
  /** Column key of the archive view in the fold-open set. */
125
125
  const ARCHIVE_COLUMN = 'archived'
126
126
 
127
+ /** Props accepted by the optional `directory.browser.dialog` slot factory wrapper. */
128
+ export interface ProjectDirectoryDialogProps {
129
+ readonly open: boolean
130
+ readonly busy: boolean
131
+ readonly onOpen: (path: string) => void
132
+ readonly onClose: () => void
133
+ }
134
+
127
135
  /** Board component; subscribes to the controller snapshot. */
128
- export function TaskBoard({ controller }: { controller: BoardController }) {
136
+ export function TaskBoard({ controller, renderDirectoryDialog }: {
137
+ controller: BoardController
138
+ /** Optional shell `directory.browser.dialog` factory renderer for choosing a project folder. */
139
+ renderDirectoryDialog?: (props: ProjectDirectoryDialogProps) => ReactNode
140
+ }) {
129
141
  const [snapshot, setSnapshot] = useState(controller.getSnapshot())
130
142
  useEffect(
131
143
  () => controller.subscribe(() => setSnapshot(controller.getSnapshot())),
@@ -146,14 +158,24 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
146
158
  // Grouped columns whose folded "earlier" group the user expanded this visit.
147
159
  const [unfolded, setUnfolded] = useState<string[]>([])
148
160
  const [showNew, setShowNew] = useState(false)
161
+ const [newTaskDraft, setNewTaskDraft] = useState<ComposeTaskDraft | undefined>(undefined)
162
+ const [newTaskDraftSeq, setNewTaskDraftSeq] = useState(0)
149
163
  const [showTagManager, setShowTagManager] = useState(false)
150
164
  // Project partition (#1536): '' means "all projects". A selected project
151
165
  // narrows the board and becomes the new-task form's default workspace.
152
166
  const [projectId, setProjectId] = useState('')
153
167
  const [showNewProject, setShowNewProject] = useState(false)
168
+ const [browseProjectOpen, setBrowseProjectOpen] = useState(false)
154
169
  const [newProjectPath, setNewProjectPath] = useState('')
155
170
  const [newProjectError, setNewProjectError] = useState<string | undefined>(undefined)
156
171
  const [newProjectPending, setNewProjectPending] = useState(false)
172
+ useEffect(() => {
173
+ const draft = controller.consumeComposeDraft?.()
174
+ if (draft === undefined) return
175
+ setNewTaskDraft(draft)
176
+ setNewTaskDraftSeq(seq => seq + 1)
177
+ setShowNew(true)
178
+ }, [controller, snapshot])
157
179
  const selected = selectedTaskOf(snapshot)
158
180
  const archiveView = snapshot.archiveView
159
181
  // Overlay lifecycle: both the detail view and the create dialog keep the
@@ -413,7 +435,7 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
413
435
  <button
414
436
  type="button"
415
437
  className={css.primaryButton}
416
- onClick={() => { setShowNew(true) }}
438
+ onClick={() => { setNewTaskDraft(undefined); setNewTaskDraftSeq(seq => seq + 1); setShowNew(true) }}
417
439
  >
418
440
  <IconPlus size={15} />
419
441
  {t('board.new')}
@@ -425,20 +447,32 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
425
447
  <div className={css.projectDialog} data-dsh-part="project-dialog">
426
448
  <label className={css.field}>
427
449
  <span className={css.fieldLabel}>{t('board.projectNewPath')}</span>
428
- <input
429
- className={css.input}
430
- value={newProjectPath}
431
- placeholder={t('board.projectNewPathPlaceholder')}
432
- spellCheck={false}
433
- onChange={event => { setNewProjectPath(event.target.value); setNewProjectError(undefined) }}
434
- />
450
+ <div className={css.projectPathRow}>
451
+ <input
452
+ className={css.input}
453
+ value={newProjectPath}
454
+ placeholder={t('board.projectNewPathPlaceholder')}
455
+ spellCheck={false}
456
+ onChange={event => { setNewProjectPath(event.target.value); setNewProjectError(undefined) }}
457
+ />
458
+ {renderDirectoryDialog !== undefined && (
459
+ <button
460
+ type="button"
461
+ className={css.ghostButton}
462
+ disabled={newProjectPending}
463
+ onClick={() => { setBrowseProjectOpen(true) }}
464
+ >
465
+ {t('board.projectBrowse')}
466
+ </button>
467
+ )}
468
+ </div>
435
469
  </label>
436
470
  {newProjectError !== undefined && <p className={css.formError}>{t('board.projectCreateFailed', { error: newProjectError })}</p>}
437
471
  <div className={css.projectDialogActions}>
438
472
  <button
439
473
  type="button"
440
474
  className={css.ghostButton}
441
- onClick={() => { setShowNewProject(false); setNewProjectError(undefined) }}
475
+ onClick={() => { setBrowseProjectOpen(false); setShowNewProject(false); setNewProjectError(undefined) }}
442
476
  >
443
477
  {t('new.cancel')}
444
478
  </button>
@@ -451,6 +485,16 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
451
485
  {t('board.projectCreate')}
452
486
  </button>
453
487
  </div>
488
+ {browseProjectOpen && renderDirectoryDialog !== undefined && renderDirectoryDialog({
489
+ open: true,
490
+ busy: newProjectPending,
491
+ onOpen: (picked) => {
492
+ setNewProjectPath(picked)
493
+ setNewProjectError(undefined)
494
+ setBrowseProjectOpen(false)
495
+ },
496
+ onClose: () => { setBrowseProjectOpen(false) },
497
+ })}
454
498
  </div>
455
499
  )}
456
500
 
@@ -577,9 +621,11 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
577
621
  )}
578
622
  {newTaskPresence.mounted && (
579
623
  <NewTaskModal
624
+ key={newTaskDraftSeq}
580
625
  controller={controller}
626
+ {...(newTaskDraft === undefined ? {} : { initialDraft: newTaskDraft })}
581
627
  {...(projectId === '' ? {} : { defaultWorkspaceId: projectId })}
582
- onClose={() => { setShowNew(false) }}
628
+ onClose={() => { setShowNew(false); setNewTaskDraft(undefined) }}
583
629
  phase={newTaskPresence.phase}
584
630
  />
585
631
  )}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Execution model options: the picker rows built from the official
3
- * `session/modelCatalog` reply, and the reasoning-effort derivation both
3
+ * `models/catalog` reply, and the reasoning-effort derivation both
4
4
  * execution-target editors read off them (the create dialog and the detail
5
5
  * page share one contract here, so they cannot promise different levels).
6
6
  *
@@ -22,6 +22,12 @@ import type { TaskBoardKey } from '../locales.ts'
22
22
  /** One model's declared reasoning capability, as a picker row carries it. */
23
23
  type ModelReasoning = NonNullable<ExecutionModelOption['reasoning']>
24
24
 
25
+ /**
26
+ * Providers whose own routes still accept `off` in requests but hide it from
27
+ * pickers unless the model declares `off` as its default effort (DSH #9860).
28
+ */
29
+ const OFF_HIDDEN_PROVIDERS: ReadonlySet<string> = new Set(['deepseek-account', 'deepseek-official'])
30
+
25
31
  /** A plain JSON object, or undefined for anything else (including arrays). */
26
32
  function record(value: unknown): Record<string, unknown> | undefined {
27
33
  return typeof value === 'object' && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : undefined
@@ -32,12 +38,16 @@ function text(value: unknown): string | undefined {
32
38
  return typeof value === 'string' && value !== '' ? value : undefined
33
39
  }
34
40
 
35
- /** The effort ids an adapter published for one model, in catalog order. */
36
- function effortIdsOf(reasoning: Record<string, unknown>): string[] {
41
+ /** The effort ids an adapter published for one model, filtered for picker display in catalog order. */
42
+ function effortIdsOf(reasoning: Record<string, unknown>, provider: string | undefined): string[] {
43
+ const hidesOff = provider !== undefined && OFF_HIDDEN_PROVIDERS.has(provider)
44
+ const defaultEffort = text(reasoning.defaultEffort)
37
45
  const efforts: string[] = []
38
46
  for (const entry of Array.isArray(reasoning.efforts) ? reasoning.efforts : []) {
39
47
  const id = text(record(entry)?.id)
40
- if (id !== undefined && !efforts.includes(id)) efforts.push(id)
48
+ if (id === undefined || efforts.includes(id)) continue
49
+ if (hidesOff && id === 'off' && id !== defaultEffort) continue
50
+ efforts.push(id)
41
51
  }
42
52
  return efforts
43
53
  }
@@ -48,10 +58,10 @@ function effortIdsOf(reasoning: Record<string, unknown>): string[] {
48
58
  * without one is declared to have none. A model the reply never described at
49
59
  * all is a different state, expressed by the row carrying no capability.
50
60
  */
51
- function reasoningOf(model: Record<string, unknown>): ModelReasoning {
61
+ function reasoningOf(model: Record<string, unknown>, provider: string | undefined): ModelReasoning {
52
62
  const reasoning = record(model.reasoning)
53
63
  if (reasoning === undefined) return { supported: false }
54
- const efforts = effortIdsOf(reasoning)
64
+ const efforts = effortIdsOf(reasoning, provider)
55
65
  return { supported: true, ...(efforts.length === 0 ? {} : { efforts }) }
56
66
  }
57
67
 
@@ -63,7 +73,7 @@ function reasoningOf(model: Record<string, unknown>): ModelReasoning {
63
73
  function rowOf(model: Record<string, unknown>, provider: string | undefined, withCapability: boolean): ExecutionModelOption | undefined {
64
74
  const id = text(model.id)
65
75
  if (id === undefined) return undefined
66
- const reasoning = withCapability ? reasoningOf(model) : undefined
76
+ const reasoning = withCapability ? reasoningOf(model, provider) : undefined
67
77
  return {
68
78
  id: provider === undefined ? id : `${provider}/${id}`,
69
79
  name: text(model.name) ?? id,
@@ -73,7 +83,7 @@ function rowOf(model: Record<string, unknown>, provider: string | undefined, wit
73
83
  }
74
84
 
75
85
  /**
76
- * Normalize a `session/modelCatalog` reply into picker rows: one row per model
86
+ * Normalize a `models/catalog` reply into picker rows: one row per model
77
87
  * of every provider group, keyed by the qualified route an execution pins.
78
88
  * @param value - the raw catalog reply.
79
89
  * @returns the rows, empty when the reply is unreadable.
@@ -2606,12 +2606,44 @@
2606
2606
  border-radius: 10px;
2607
2607
  }
2608
2608
 
2609
+ .projectPathRow {
2610
+ display: flex;
2611
+ align-items: center;
2612
+ gap: 6px;
2613
+ }
2614
+
2615
+ .projectPathRow .input {
2616
+ flex: 1;
2617
+ min-width: 0;
2618
+ }
2619
+
2609
2620
  .projectDialogActions {
2610
2621
  display: flex;
2611
2622
  justify-content: flex-end;
2612
2623
  gap: 8px;
2613
2624
  }
2614
2625
 
2626
+ .chatUserAction {
2627
+ display: inline-flex;
2628
+ align-items: center;
2629
+ justify-content: center;
2630
+ width: calc(28px + var(--dsh-content-font-delta, 0px));
2631
+ height: calc(28px + var(--dsh-content-font-delta, 0px));
2632
+ padding: 6px;
2633
+ border: none;
2634
+ border-radius: var(--dsw-radius-sm, 6px);
2635
+ background: transparent;
2636
+ color: var(--dsw-alias-label-tertiary);
2637
+ cursor: pointer;
2638
+ }
2639
+
2640
+ @media (hover: hover) {
2641
+ .chatUserAction:hover {
2642
+ background: var(--dsw-alias-interactive-bg-hover);
2643
+ color: var(--dsw-alias-label-secondary);
2644
+ }
2645
+ }
2646
+
2615
2647
  /* --- AI parse of pasted text (#1540) ------------------------------------------ */
2616
2648
 
2617
2649
  .aiParse {
@@ -15,7 +15,7 @@ import type { IWorkspaces } from '@deepseek-ai/dsh-api-workspace-controller/clie
15
15
  import type { ConfigForm, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client'
16
16
  import type {} from '@deepseek-ai/dsh-api-remotes/client'
17
17
  import type {} from '@deepseek-ai/dsh-client-ui-renderer/client'
18
- import type {} from '@deepseek-ai/dsh-client-ui-slots'
18
+ import type {} from '@deepseek-ai/dsh-client-ui-slots/client'
19
19
  // Type-only: pulls the locale plugin's Context merge (ctx.locale) and its
20
20
  // LocaleNamespaceMap merge table.
21
21
  import type {} from '@deepseek-ai/dsh-client-locale/client'
@@ -32,6 +32,8 @@ import { LocalStorageTaskStore } from '../core/store.ts'
32
32
  import { hasOpenExecution } from '../core/tasks.ts'
33
33
  import { claimTaskboardApply, releaseTaskboardApply } from './apply-guard.ts'
34
34
  import { registerTaskBoardPanel } from './native-panel.tsx'
35
+ import { registerTaskBoardSessionActivity } from './session-activity.tsx'
36
+ import { registerUserMessageTaskAction } from './user-message-action.tsx'
35
37
  import { TaskBoardSettingsCard, TaskBoardSettingsCardController, type TaskBoardSettings } from './TaskBoardSettingsCard.tsx'
36
38
  import { en, zh, setRuntimeTranslate, type TaskBoardKey } from './locales.ts'
37
39
  import { HttpTaskBoardHostTransport } from './host-api.ts'
@@ -94,7 +96,7 @@ export interface SettingsFormBinder {
94
96
  bind<T>(spec: SettingsFormSpec<T>): ConfigForm<T>
95
97
  }
96
98
 
97
- declare module '@deepseek-ai/dsh-client-ui-slots' {
99
+ declare module '@deepseek-ai/dsh-client-ui-slots/client' {
98
100
  interface LocaleNamespaceMap {
99
101
  /** Task-board surface copy. */
100
102
  'task-board': TaskBoardKey
@@ -353,25 +355,27 @@ export function apply(ctx: ClientContext): void {
353
355
  const created = await workspaces.create({ path })
354
356
  return { workspaceId: created.workspaceId }
355
357
  })
356
- const pushModelOptions = async (): Promise<void> => {
358
+ type ModelsCatalogRemote = { catalog?: () => Promise<{ ok: boolean; value?: unknown }> }
359
+ const pushModelOptions = async (scopedModels?: ModelsCatalogRemote): Promise<void> => {
357
360
  try {
358
361
  let models: ExecutionModelOption[] = []
359
- let sessionRemote: ClientRemote['session'] | undefined
360
- try {
361
- sessionRemote = (remote as Partial<ClientRemote>).session
362
- } catch {
363
- sessionRemote = undefined
362
+ let modelsRemote: ModelsCatalogRemote | undefined = scopedModels
363
+ if (modelsRemote === undefined) {
364
+ try {
365
+ modelsRemote = (remote as unknown as { models?: ModelsCatalogRemote }).models
366
+ } catch {
367
+ modelsRemote = undefined
368
+ }
364
369
  }
365
- if (typeof sessionRemote?.modelCatalog === 'function') {
366
- const res = await sessionRemote.modelCatalog()
370
+ if (typeof modelsRemote?.catalog === 'function') {
371
+ const res = await modelsRemote.catalog()
367
372
  if (res.ok) models = modelOptionsFromCatalog(res.value)
368
373
  }
369
374
  if (models.length === 0) {
370
375
  const conn = ctx.get('connection') as {
371
376
  api?: {
372
377
  llm?: { discoverModels?: () => Promise<unknown> }
373
- sessions?: { modelCatalog?: () => Promise<unknown> }
374
- session?: { modelCatalog?: () => Promise<unknown> }
378
+ models?: { catalog?: () => Promise<unknown> }
375
379
  }
376
380
  } | undefined
377
381
  if (conn?.api) {
@@ -379,13 +383,8 @@ export function apply(ctx: ClientContext): void {
379
383
  const res = await conn.api.llm.discoverModels() as { result?: { value?: { models?: unknown } } }
380
384
  models = modelOptionsFromDiscoveredModels(res?.result?.value?.models)
381
385
  }
382
- const catalogFn = typeof conn.api.session?.modelCatalog === 'function'
383
- ? conn.api.session.modelCatalog
384
- : typeof conn.api.sessions?.modelCatalog === 'function'
385
- ? conn.api.sessions.modelCatalog
386
- : undefined
387
- if (models.length === 0 && catalogFn !== undefined) {
388
- const res = await catalogFn() as { result?: { value?: unknown } }
386
+ if (models.length === 0 && typeof conn.api.models?.catalog === 'function') {
387
+ const res = await conn.api.models.catalog() as { result?: { value?: unknown } }
389
388
  models = modelOptionsFromCatalog(res?.result?.value)
390
389
  }
391
390
  }
@@ -397,6 +396,13 @@ export function apply(ctx: ClientContext): void {
397
396
  console.error('[dsh-task-board] model options read failed', error)
398
397
  }
399
398
  }
399
+ const modelsCatalogFeed = ctx.inject(['remote.models' as never], (inner) => {
400
+ const modelsRemote = inner.get('remote.models' as never) as ModelsCatalogRemote | undefined
401
+ if (modelsRemote === undefined) return
402
+ void pushModelOptions(modelsRemote)
403
+ return inner.on('connection/reset', () => { void pushModelOptions(modelsRemote) })
404
+ })
405
+ disposers.push(() => { void modelsCatalogFeed.dispose() })
400
406
  void pushModelOptions()
401
407
  disposers.push(ctx.on('connection/reset', () => { void pushModelOptions() }))
402
408
  // Native panel surfaces: one sidebar row and one center-column page, both
@@ -405,6 +411,12 @@ export function apply(ctx: ClientContext): void {
405
411
  // view state follows the user clicking another panel row.
406
412
  try {
407
413
  disposers.push(registerTaskBoardPanel(ctx, controller))
414
+ disposers.push(registerTaskBoardSessionActivity(ctx, controller))
415
+ disposers.push(registerUserMessageTaskAction(ctx, controller, (sessionId) => {
416
+ const cwd = sessions.list.getSnapshot().byId[sessionId as never]?.cwd
417
+ if (cwd === undefined || cwd === '') return undefined
418
+ return workspaces.list.getSnapshot().items.find(item => item.path === cwd)?.workspaceId
419
+ }))
408
420
  const layoutFace = ctx.get('layout') as { panelInfo?: { subscribe(listener: () => void): () => void; getSnapshot(): { activePanelId: unknown } } } | undefined
409
421
  if (layoutFace?.panelInfo !== undefined) {
410
422
  const sync = (): void => {
@@ -8,6 +8,7 @@
8
8
  /** zh dictionary (key-set source of truth). */
9
9
  export const zh = {
10
10
  'entry.label': '任务看板',
11
+ 'activity.title': '任务看板',
11
12
  'board.title': '任务看板',
12
13
  'board.close': '返回会话',
13
14
  'board.new': '新建任务',
@@ -42,8 +43,10 @@ export const zh = {
42
43
  'board.projectNew': '新建项目…',
43
44
  'board.projectNewPath': '项目目录(宿主上的绝对路径)',
44
45
  'board.projectNewPathPlaceholder': '例如 C:\\work\\my-project 或 /home/me/project',
46
+ 'board.projectBrowse': '浏览…',
45
47
  'board.projectCreate': '创建项目',
46
48
  'board.projectCreateFailed': '创建项目失败:{error}',
49
+ 'chat.turnIntoTask': '转为任务卡片',
47
50
  'new.aiParse': 'AI 解析',
48
51
  'new.aiParseHint': '把从别处复制的一段话粘进来,让模型整理成标题、描述和执行 Prompt;解析结果只填进下面的表单,你可以先改再创建。',
49
52
  'new.aiParsePlaceholder': '粘贴要变成任务的内容…',
@@ -408,6 +411,7 @@ export const zh = {
408
411
  /** en dictionary, complete against the zh key set. */
409
412
  export const en: Record<keyof typeof zh, string> = {
410
413
  'entry.label': 'Task Board',
414
+ 'activity.title': 'Task Board',
411
415
  'board.title': 'Task Board',
412
416
  'board.close': 'Back to chat',
413
417
  'board.new': 'New Task',
@@ -442,8 +446,10 @@ export const en: Record<keyof typeof zh, string> = {
442
446
  'board.projectNew': 'New project…',
443
447
  'board.projectNewPath': 'Project directory (absolute path on the Host)',
444
448
  'board.projectNewPathPlaceholder': 'e.g. C:\\work\\my-project or /home/me/project',
449
+ 'board.projectBrowse': 'Browse…',
445
450
  'board.projectCreate': 'Create project',
446
451
  'board.projectCreateFailed': 'Could not create the project: {error}',
452
+ 'chat.turnIntoTask': 'Turn into task card',
447
453
  'new.aiParse': 'Parse with AI',
448
454
  'new.aiParseHint': 'Paste text copied from somewhere else and let a model turn it into a title, description, and run prompt; the result only fills the form below, so you can edit it before creating the task.',
449
455
  'new.aiParsePlaceholder': 'Paste the content to turn into a task…',