@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 1.1.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.
- package/NOTICE +1 -1
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/client.js +4428 -1508
- package/lib/client.js.map +1 -1
- package/lib/index.js +2670 -496
- package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
- package/lib/types/client/PluginSettingsCard.d.ts +130 -19
- package/lib/types/client/RangeBubble.d.ts +46 -0
- package/lib/types/client/SegmentGroup.d.ts +28 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
- package/lib/types/client/board/AttachmentField.d.ts +70 -0
- package/lib/types/client/board/ExecutionLog.d.ts +24 -0
- package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
- package/lib/types/client/board/TaskForm.d.ts +4 -0
- package/lib/types/client/board/VerificationReport.d.ts +2 -15
- package/lib/types/client/board/model-options.d.ts +87 -0
- package/lib/types/client/board/preset-label.d.ts +21 -0
- package/lib/types/client/board/preset-roster.d.ts +45 -0
- package/lib/types/client/board/source-group.d.ts +27 -0
- package/lib/types/client/body-mutations.d.ts +45 -0
- package/lib/types/client/host-api.d.ts +25 -0
- package/lib/types/client/locales.d.ts +87 -9
- package/lib/types/client/pending-verify.d.ts +47 -0
- package/lib/types/client/plugin-card-seat.d.ts +3 -1
- package/lib/types/client/service.d.ts +4 -1
- package/lib/types/client/settings-form.d.ts +73 -51
- package/lib/types/core/attachment.d.ts +132 -0
- package/lib/types/core/card-defaults.d.ts +78 -0
- package/lib/types/core/controller.d.ts +57 -8
- package/lib/types/core/execution-summary.d.ts +52 -0
- package/lib/types/core/extension.d.ts +116 -0
- package/lib/types/core/launch-width.d.ts +31 -0
- package/lib/types/core/reasoning-effort.d.ts +57 -0
- package/lib/types/core/session-reuse.d.ts +7 -1
- package/lib/types/core/spend-budget.d.ts +28 -0
- package/lib/types/core/subtask.d.ts +100 -37
- package/lib/types/core/tasks.d.ts +94 -10
- package/lib/types/core/use-cases/task-create.d.ts +10 -5
- package/lib/types/core/use-cases/task-tag.d.ts +36 -0
- package/lib/types/core/use-cases/task-update.d.ts +22 -1
- package/lib/types/core/wire-projection.d.ts +35 -0
- package/lib/types/core/workspace-target.d.ts +23 -3
- package/lib/types/host/attachments.d.ts +250 -0
- package/lib/types/host/extension-registry.d.ts +40 -0
- package/lib/types/host/launch-admission.d.ts +71 -0
- package/lib/types/host-ledger.d.ts +114 -47
- package/lib/types/host-routes.d.ts +63 -0
- package/lib/types/host-runner.d.ts +164 -18
- package/lib/types/host-service.d.ts +182 -46
- package/lib/types/host-spend.d.ts +52 -0
- package/lib/types/index.d.ts +173 -54
- package/lib/types/loopback.d.ts +41 -1
- package/lib/types/protocol.d.ts +52 -11
- package/lib/types/tool-surface.d.ts +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +35 -28
- package/src/client/CardDefaultPresetField.tsx +101 -0
- package/src/client/PluginSettingsCard.tsx +385 -111
- package/src/client/RangeBubble.tsx +164 -0
- package/src/client/SegmentGroup.tsx +93 -0
- package/src/client/TaskBoardSettingsCard.tsx +332 -37
- package/src/client/board/AttachmentField.tsx +383 -0
- package/src/client/board/EditTaskModal.tsx +63 -0
- package/src/client/board/ExecutionLog.tsx +154 -0
- package/src/client/board/LinkSubtaskModal.tsx +1 -1
- package/src/client/board/NewTaskModal.tsx +154 -45
- package/src/client/board/ReasoningEffortField.tsx +50 -0
- package/src/client/board/TagManagerModal.tsx +151 -2
- package/src/client/board/TaskBoard.tsx +47 -10
- package/src/client/board/TaskCard.tsx +45 -23
- package/src/client/board/TaskDetail.tsx +468 -258
- package/src/client/board/TaskForm.tsx +19 -4
- package/src/client/board/VerificationReport.tsx +143 -104
- package/src/client/board/model-options.ts +208 -0
- package/src/client/board/preset-label.ts +32 -0
- package/src/client/board/preset-roster.ts +58 -0
- package/src/client/board/source-group.ts +94 -0
- package/src/client/board/task-markdown.module.css +11 -8
- package/src/client/board-settings.module.css +35 -7
- package/src/client/board.module.css +1044 -105
- package/src/client/body-mutations.ts +133 -0
- package/src/client/host-api.ts +70 -0
- package/src/client/index.ts +109 -95
- package/src/client/locales.ts +205 -48
- package/src/client/pending-verify.ts +90 -0
- package/src/client/plugin-card-seat.ts +8 -2
- package/src/client/service.ts +24 -0
- package/src/client/settings-card.module.css +466 -89
- package/src/client/settings-entry-form.ts +0 -1
- package/src/client/settings-form.ts +102 -60
- package/src/core/attachment.ts +287 -0
- package/src/core/card-defaults.ts +132 -0
- package/src/core/controller.ts +90 -11
- package/src/core/execution-summary.ts +96 -0
- package/src/core/extension.ts +120 -0
- package/src/core/launch-width.ts +38 -0
- package/src/core/reasoning-effort.ts +92 -0
- package/src/core/session-reuse.ts +7 -1
- package/src/core/spend-budget.ts +35 -0
- package/src/core/store.ts +19 -1
- package/src/core/subtask.ts +144 -68
- package/src/core/tasks.ts +117 -10
- package/src/core/use-cases/task-create.ts +27 -16
- package/src/core/use-cases/task-tag.ts +56 -0
- package/src/core/use-cases/task-update.ts +33 -5
- package/src/core/wire-projection.ts +81 -0
- package/src/core/workspace-target.ts +27 -3
- package/src/host/agent-tools.ts +33 -21
- package/src/host/attachments.ts +650 -0
- package/src/host/extension-registry.ts +150 -5
- package/src/host/launch-admission.ts +139 -0
- package/src/host-ledger.ts +248 -117
- package/src/host-routes.ts +233 -15
- package/src/host-runner.ts +395 -61
- package/src/host-service.ts +512 -139
- package/src/host-spend.ts +105 -0
- package/src/index.ts +312 -92
- package/src/loopback.ts +57 -1
- package/src/protocol.ts +83 -18
- package/src/tool-surface.ts +1 -0
|
@@ -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
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
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:
|
|
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:
|
|
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:
|
|
36
|
-
margin-top:
|
|
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
|
-
/*
|
|
40
|
-
|
|
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:
|
|
90
|
+
gap: var(--task-board-settings-gap);
|
|
63
91
|
list-style: none;
|
|
64
92
|
margin: 0;
|
|
65
93
|
padding: 0;
|