@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 2.0.0

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 (125) hide show
  1. package/NOTICE +1 -1
  2. package/README.en.md +6 -4
  3. package/README.md +6 -4
  4. package/README.zh.md +6 -4
  5. package/icon.png +0 -0
  6. package/lib/client.js +4428 -1508
  7. package/lib/client.js.map +1 -1
  8. package/lib/index.js +2670 -496
  9. package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
  10. package/lib/types/client/PluginSettingsCard.d.ts +130 -19
  11. package/lib/types/client/RangeBubble.d.ts +46 -0
  12. package/lib/types/client/SegmentGroup.d.ts +28 -0
  13. package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
  14. package/lib/types/client/board/AttachmentField.d.ts +70 -0
  15. package/lib/types/client/board/ExecutionLog.d.ts +24 -0
  16. package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
  17. package/lib/types/client/board/TaskForm.d.ts +4 -0
  18. package/lib/types/client/board/VerificationReport.d.ts +2 -15
  19. package/lib/types/client/board/model-options.d.ts +87 -0
  20. package/lib/types/client/board/preset-label.d.ts +21 -0
  21. package/lib/types/client/board/preset-roster.d.ts +45 -0
  22. package/lib/types/client/board/source-group.d.ts +27 -0
  23. package/lib/types/client/body-mutations.d.ts +45 -0
  24. package/lib/types/client/host-api.d.ts +25 -0
  25. package/lib/types/client/locales.d.ts +87 -9
  26. package/lib/types/client/pending-verify.d.ts +47 -0
  27. package/lib/types/client/plugin-card-seat.d.ts +3 -1
  28. package/lib/types/client/service.d.ts +4 -1
  29. package/lib/types/client/settings-form.d.ts +73 -51
  30. package/lib/types/core/attachment.d.ts +132 -0
  31. package/lib/types/core/card-defaults.d.ts +78 -0
  32. package/lib/types/core/controller.d.ts +57 -8
  33. package/lib/types/core/execution-summary.d.ts +52 -0
  34. package/lib/types/core/extension.d.ts +116 -0
  35. package/lib/types/core/launch-width.d.ts +31 -0
  36. package/lib/types/core/reasoning-effort.d.ts +57 -0
  37. package/lib/types/core/session-reuse.d.ts +7 -1
  38. package/lib/types/core/spend-budget.d.ts +28 -0
  39. package/lib/types/core/subtask.d.ts +100 -37
  40. package/lib/types/core/tasks.d.ts +94 -10
  41. package/lib/types/core/use-cases/task-create.d.ts +10 -5
  42. package/lib/types/core/use-cases/task-tag.d.ts +36 -0
  43. package/lib/types/core/use-cases/task-update.d.ts +22 -1
  44. package/lib/types/core/wire-projection.d.ts +35 -0
  45. package/lib/types/core/workspace-target.d.ts +23 -3
  46. package/lib/types/host/attachments.d.ts +250 -0
  47. package/lib/types/host/extension-registry.d.ts +40 -0
  48. package/lib/types/host/launch-admission.d.ts +71 -0
  49. package/lib/types/host-ledger.d.ts +114 -47
  50. package/lib/types/host-routes.d.ts +63 -0
  51. package/lib/types/host-runner.d.ts +164 -18
  52. package/lib/types/host-service.d.ts +182 -46
  53. package/lib/types/host-spend.d.ts +52 -0
  54. package/lib/types/index.d.ts +173 -54
  55. package/lib/types/loopback.d.ts +41 -1
  56. package/lib/types/protocol.d.ts +52 -11
  57. package/lib/types/tool-surface.d.ts +1 -0
  58. package/locale/en.json +6 -0
  59. package/locale/zh.json +6 -0
  60. package/package.json +36 -29
  61. package/src/client/CardDefaultPresetField.tsx +101 -0
  62. package/src/client/PluginSettingsCard.tsx +385 -111
  63. package/src/client/RangeBubble.tsx +164 -0
  64. package/src/client/SegmentGroup.tsx +93 -0
  65. package/src/client/TaskBoardSettingsCard.tsx +332 -37
  66. package/src/client/board/AttachmentField.tsx +383 -0
  67. package/src/client/board/EditTaskModal.tsx +63 -0
  68. package/src/client/board/ExecutionLog.tsx +154 -0
  69. package/src/client/board/LinkSubtaskModal.tsx +1 -1
  70. package/src/client/board/NewTaskModal.tsx +154 -45
  71. package/src/client/board/ReasoningEffortField.tsx +50 -0
  72. package/src/client/board/TagManagerModal.tsx +151 -2
  73. package/src/client/board/TaskBoard.tsx +47 -10
  74. package/src/client/board/TaskCard.tsx +45 -23
  75. package/src/client/board/TaskDetail.tsx +468 -258
  76. package/src/client/board/TaskForm.tsx +19 -4
  77. package/src/client/board/VerificationReport.tsx +143 -104
  78. package/src/client/board/model-options.ts +208 -0
  79. package/src/client/board/preset-label.ts +32 -0
  80. package/src/client/board/preset-roster.ts +58 -0
  81. package/src/client/board/source-group.ts +94 -0
  82. package/src/client/board/task-markdown.module.css +11 -8
  83. package/src/client/board-settings.module.css +35 -7
  84. package/src/client/board.module.css +1044 -105
  85. package/src/client/body-mutations.ts +133 -0
  86. package/src/client/host-api.ts +70 -0
  87. package/src/client/index.ts +109 -95
  88. package/src/client/locales.ts +205 -48
  89. package/src/client/pending-verify.ts +90 -0
  90. package/src/client/plugin-card-seat.ts +8 -2
  91. package/src/client/service.ts +24 -0
  92. package/src/client/settings-card.module.css +466 -89
  93. package/src/client/settings-entry-form.ts +0 -1
  94. package/src/client/settings-form.ts +102 -60
  95. package/src/core/attachment.ts +287 -0
  96. package/src/core/card-defaults.ts +132 -0
  97. package/src/core/controller.ts +90 -11
  98. package/src/core/execution-summary.ts +96 -0
  99. package/src/core/extension.ts +120 -0
  100. package/src/core/launch-width.ts +38 -0
  101. package/src/core/reasoning-effort.ts +92 -0
  102. package/src/core/session-reuse.ts +7 -1
  103. package/src/core/spend-budget.ts +35 -0
  104. package/src/core/store.ts +19 -1
  105. package/src/core/subtask.ts +144 -68
  106. package/src/core/tasks.ts +117 -10
  107. package/src/core/use-cases/task-create.ts +27 -16
  108. package/src/core/use-cases/task-tag.ts +56 -0
  109. package/src/core/use-cases/task-update.ts +33 -5
  110. package/src/core/wire-projection.ts +81 -0
  111. package/src/core/workspace-target.ts +27 -3
  112. package/src/host/agent-tools.ts +33 -21
  113. package/src/host/attachments.ts +650 -0
  114. package/src/host/extension-registry.ts +150 -5
  115. package/src/host/launch-admission.ts +139 -0
  116. package/src/host-ledger.ts +248 -117
  117. package/src/host-routes.ts +233 -15
  118. package/src/host-runner.ts +395 -61
  119. package/src/host-service.ts +512 -139
  120. package/src/host-spend.ts +105 -0
  121. package/src/index.ts +312 -92
  122. package/src/loopback.ts +57 -1
  123. package/src/protocol.ts +83 -18
  124. package/src/tool-surface.ts +1 -0
  125. package/icon.svg +0 -3
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Source grouping and fold preferences for the board view. Providers contribute
3
+ * opaque groups through the client contract; this module owns only ordering,
4
+ * local fallback, and browser persistence, never provider metadata semantics.
5
+ */
6
+ import type { TaskBoardGroupingSelector, TaskBoardSourceGroup } from '../../core/extension.ts'
7
+ import type { TaskRecord, TaskStatus } from '../../core/tasks.ts'
8
+
9
+ /** Reserved group for cards no provider claimed. */
10
+ export const LOCAL_SOURCE_GROUP_ID = 'local'
11
+ /** Browser storage key for explicit source-fold overrides. */
12
+ export const SOURCE_GROUP_FOLDS_KEY = 'dsh.taskBoard.sourceGroupFolds.v1'
13
+
14
+ export type SourceGroupView = TaskStatus | 'archived'
15
+ export type SourceGroupFolds = Readonly<Record<string, boolean>>
16
+
17
+ export interface SourceGroupBucket extends TaskBoardSourceGroup {
18
+ items: TaskRecord[]
19
+ local: boolean
20
+ }
21
+
22
+ function compareText(left: string, right: string): number {
23
+ const a = left.toLowerCase()
24
+ const b = right.toLowerCase()
25
+ if (a < b) return -1
26
+ if (a > b) return 1
27
+ return left < right ? -1 : left > right ? 1 : 0
28
+ }
29
+
30
+ /** Group cards in their incoming order, then sort provider groups by full label. */
31
+ export function groupTasksBySource(tasks: readonly TaskRecord[], selectors: readonly TaskBoardGroupingSelector[]): SourceGroupBucket[] {
32
+ const groups = new Map<string, SourceGroupBucket>()
33
+ for (const task of tasks) {
34
+ let source: TaskBoardSourceGroup | undefined
35
+ for (const selector of selectors) {
36
+ try {
37
+ const candidate = selector(task)
38
+ if (candidate === undefined) continue
39
+ const id = candidate.id.trim()
40
+ const label = candidate.label.trim()
41
+ if (id === '' || label === '') continue
42
+ source = { id, label }
43
+ break
44
+ } catch {
45
+ // A faulty provider loses its grouping contribution, not the board.
46
+ }
47
+ }
48
+ const group = source ?? { id: LOCAL_SOURCE_GROUP_ID, label: '' }
49
+ const bucket = groups.get(group.id) ?? { ...group, items: [], local: source === undefined }
50
+ bucket.items.push(task)
51
+ groups.set(group.id, bucket)
52
+ }
53
+ return [...groups.values()].sort((left, right) => {
54
+ if (left.local !== right.local) return left.local ? 1 : -1
55
+ return compareText(left.label, right.label) || compareText(left.id, right.id)
56
+ })
57
+ }
58
+
59
+ /** Compound key keeps a fold choice scoped to one column/view and one source. */
60
+ export function sourceGroupFoldKey(view: SourceGroupView, sourceId: string): string {
61
+ return `${view}:${sourceId}`
62
+ }
63
+
64
+ /** Read explicit overrides; malformed or unavailable storage falls back to defaults. */
65
+ export function readSourceGroupFolds(storage: Pick<Storage, 'getItem'> | undefined): SourceGroupFolds {
66
+ try {
67
+ const raw = storage?.getItem(SOURCE_GROUP_FOLDS_KEY)
68
+ if (raw === null || raw === undefined) return {}
69
+ const parsed: unknown = JSON.parse(raw)
70
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return {}
71
+ const result: Record<string, boolean> = Object.create(null) as Record<string, boolean>
72
+ for (const [key, value] of Object.entries(parsed)) {
73
+ if (key !== '' && typeof value === 'boolean') result[key] = value
74
+ }
75
+ return result
76
+ } catch {
77
+ return {}
78
+ }
79
+ }
80
+
81
+ /** Persist overrides; a storage failure only loses the preference. */
82
+ export function writeSourceGroupFolds(storage: Pick<Storage, 'setItem'> | undefined, folds: SourceGroupFolds): void {
83
+ try {
84
+ storage?.setItem(SOURCE_GROUP_FOLDS_KEY, JSON.stringify(folds))
85
+ } catch {
86
+ // Preference only: the in-memory choice still works.
87
+ }
88
+ }
89
+
90
+ /** Search always reveals matches; otherwise an override beats the column default. */
91
+ export function isSourceGroupFolded(folds: SourceGroupFolds, view: SourceGroupView, sourceId: string, searchActive: boolean): boolean {
92
+ if (searchActive) return false
93
+ return folds[sourceGroupFoldKey(view, sourceId)] ?? view === 'done'
94
+ }
@@ -35,12 +35,15 @@
35
35
  line-height: 1.35;
36
36
  }
37
37
 
38
- .heading1 { font-size: 16px; }
39
- .heading2 { font-size: 15px; }
40
- .heading3 { font-size: 14px; }
41
- .heading4 { font-size: 13px; }
42
- .heading5 { font-size: 12.5px; }
43
- .heading6 { font-size: 12px; }
38
+ /* Two steps only: h1 and h2 are 16px and every level below is the body's
39
+ 13px. What separates the levels is weight and the label colour role, never a
40
+ fourth size. */
41
+ .heading1 { font-size: 16px; font-weight: 700; }
42
+ .heading2 { font-size: 16px; font-weight: 600; }
43
+ .heading3 { font-size: 13px; font-weight: 600; }
44
+ .heading4 { font-size: 13px; font-weight: 600; color: var(--dsw-alias-label-secondary); }
45
+ .heading5 { font-size: 13px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
46
+ .heading6 { font-size: 13px; font-weight: 500; color: var(--dsw-alias-label-tertiary); }
44
47
 
45
48
  .list {
46
49
  margin: 0 0 8px;
@@ -103,7 +106,7 @@
103
106
  .imagePlaceholder {
104
107
  display: inline-block;
105
108
  padding: 2px 6px;
106
- font-size: 11px;
109
+ font-size: 12px;
107
110
  color: var(--dsw-alias-label-secondary, #666);
108
111
  background: var(--dsw-alias-bg-subtle, rgba(0, 0, 0, 0.04));
109
112
  border: 1px dashed var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.15));
@@ -121,7 +124,7 @@
121
124
  border-collapse: collapse;
122
125
  width: 100%;
123
126
  margin: 8px 0;
124
- font-size: 12.5px;
127
+ font-size: 12px;
125
128
  }
126
129
 
127
130
  .table th,
@@ -26,18 +26,46 @@
26
26
  color: var(--dsw-alias-label-secondary);
27
27
  }
28
28
 
29
+ /* One spacing step for this card's own blocks: the topic list and the power
30
+ facts under it read the same value instead of each hard-coding one. */
31
+ .nestedCards,
32
+ .power {
33
+ --task-board-settings-gap: 8px;
34
+ }
35
+
29
36
  /* Live power facts plus the battery caveat, below the topic cards: quiet
30
- small print that follows the disclosures instead of competing with them.
31
- No rule of its own — the last topic card already closes with its border. */
37
+ small print that follows the disclosures instead of competing with them. */
32
38
  .power {
33
39
  display: flex;
34
40
  flex-direction: column;
35
- gap: 2px;
36
- margin-top: 14px;
41
+ gap: var(--task-board-settings-gap);
42
+ margin-top: calc(var(--task-board-settings-gap) * 2);
43
+ }
44
+
45
+ /* The facts themselves: a two-column label/value grid whose labels form one
46
+ quiet column, so the four values start on one left edge. */
47
+ .powerFacts {
48
+ display: grid;
49
+ grid-template-columns: max-content 1fr;
50
+ column-gap: calc(var(--task-board-settings-gap) * 2);
51
+ row-gap: 2px;
52
+ margin: 0;
53
+ font-size: 12px;
54
+ line-height: 1.5;
55
+ color: var(--dsw-alias-label-secondary);
56
+ }
57
+
58
+ .powerTerm,
59
+ .powerValue {
60
+ margin: 0;
61
+ }
62
+
63
+ .powerTerm {
64
+ color: var(--dsw-alias-label-tertiary);
37
65
  }
38
66
 
39
- /* Both the live power line and the battery caveat: secondary ink at the small
40
- size the 12-13px roles use, so neither competes with the topic cards. */
67
+ /* The battery caveat: secondary ink at the small size the 12-13px roles use,
68
+ so it does not compete with the topic cards above it. */
41
69
  .powerLine {
42
70
  margin: 0;
43
71
  font-size: 12px;
@@ -59,7 +87,7 @@
59
87
  .nestedCards {
60
88
  display: flex;
61
89
  flex-direction: column;
62
- gap: 8px;
90
+ gap: var(--task-board-settings-gap);
63
91
  list-style: none;
64
92
  margin: 0;
65
93
  padding: 0;