dsh-project-tasks 0.0.0-stage → 0.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/lib/client.js ADDED
@@ -0,0 +1,961 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-project-tasks",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ let react = require("react");
8
+ let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ //#region ../../../source/deepseek-harness/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
11
+ function r(e) {
12
+ var t, f, n = "";
13
+ if ("string" == typeof e || "number" == typeof e) n += e;
14
+ else if ("object" == typeof e) if (Array.isArray(e)) {
15
+ var o = e.length;
16
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
17
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
18
+ return n;
19
+ }
20
+ function clsx() {
21
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
22
+ return n;
23
+ }
24
+ //#endregion
25
+ //#region src/client/api.ts
26
+ /** Path prefix owning every task-board route. */
27
+ const BASE = "/taskboard";
28
+ /** Unwrap the `{ok, ...}` envelope, throwing on a transport or payload error. */
29
+ async function unwrap(pending) {
30
+ const res = await pending;
31
+ let body;
32
+ try {
33
+ body = await res.json();
34
+ } catch {
35
+ throw new Error(`task-board: HTTP ${res.status}`);
36
+ }
37
+ const record = body;
38
+ if (!res.ok || record.ok !== true) throw new Error(record.error ?? `task-board: HTTP ${res.status}`);
39
+ return body;
40
+ }
41
+ const post = (path, body, signal) => fetch(`${BASE}${path}`, {
42
+ method: "POST",
43
+ headers: { "content-type": "application/json" },
44
+ body: JSON.stringify(body),
45
+ ...signal === void 0 ? {} : { signal }
46
+ });
47
+ /** Read the full board snapshot. */
48
+ async function fetchState(signal) {
49
+ return (await unwrap(fetch(`${BASE}/api/state`, signal === void 0 ? {} : { signal }))).state;
50
+ }
51
+ /** Create a task. */
52
+ async function createTask(input) {
53
+ return (await unwrap(post("/api/create", input))).task;
54
+ }
55
+ /** Update a task (title/description/priority/status/doneSummary/doneFiles). */
56
+ async function updateTask(input) {
57
+ return (await unwrap(post("/api/update", input))).task;
58
+ }
59
+ /** Delete a task. */
60
+ async function deleteTask(id) {
61
+ return (await unwrap(post("/api/delete", { id }))).deleted;
62
+ }
63
+ /** Run a lifecycle action (start/verify/reject/block/unblock) on a task. */
64
+ async function taskAction(id, action, reason) {
65
+ return (await unwrap(post("/api/update", {
66
+ id,
67
+ action,
68
+ ...reason === void 0 ? {} : { blockedReason: reason }
69
+ }))).task;
70
+ }
71
+ /** Archive every done task (optionally scoped to a project); returns the count. */
72
+ async function archiveDone(project) {
73
+ return (await unwrap(post("/api/archive-done", project === void 0 ? {} : { project }))).archived;
74
+ }
75
+ /** Enable/disable the background auto-claim poller. */
76
+ async function setAutoClaim(enabled) {
77
+ return (await unwrap(post("/api/auto-claim", { enabled }))).autoClaim;
78
+ }
79
+ /**
80
+ * Subscribe to the board's live state over SSE.
81
+ * @param onState - called with every pushed board state (including the opening one).
82
+ * @returns a function closing the connection.
83
+ */
84
+ function subscribeBoard(onState) {
85
+ const source = new EventSource(`${BASE}/events`);
86
+ source.onmessage = (event) => {
87
+ try {
88
+ const frame = JSON.parse(event.data);
89
+ if (frame.type === "state" && frame.state !== void 0) onState(frame.state);
90
+ } catch {}
91
+ };
92
+ return () => {
93
+ source.close();
94
+ };
95
+ }
96
+ //#endregion
97
+ //#region \0dsh-css:/Users/hyper/Documents/hyper/project/extensions/dsh-task-board/src/client/TaskBoardPage.module.css.mjs
98
+ const css = ".UxClrW_page{background:var(--dsw-alias-bg-base);flex-direction:column;height:100%;display:flex;overflow:hidden}.UxClrW_header{flex:none;justify-content:space-between;align-items:flex-start;gap:16px;padding:24px 28px 0;display:flex}.UxClrW_headerLeft{min-width:0}.UxClrW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:20px;font-weight:600}.UxClrW_subtitle{color:var(--dsw-alias-label-tertiary);margin:3px 0 0;font-size:12.5px}.UxClrW_headerRight{flex:none;align-items:center;gap:8px;display:flex}.UxClrW_projectPicker{align-items:center;gap:6px;display:inline-flex}.UxClrW_projectLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.UxClrW_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);max-width:240px;height:30px;color:var(--dsw-alias-label-secondary);border-radius:8px;padding:0 8px;font-size:12.5px}.UxClrW_refresh,.UxClrW_newBtn,.UxClrW_ghostBtn{cursor:pointer;white-space:nowrap;border-radius:8px;align-items:center;gap:6px;height:30px;padding:0 12px;font-size:12.5px;display:inline-flex}.UxClrW_refresh,.UxClrW_ghostBtn{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary)}.UxClrW_refresh:hover,.UxClrW_ghostBtn:hover{background:var(--dsw-alias-interactive-bg-hover)}.UxClrW_newBtn{background:var(--dsw-alias-button-primary-fill,#2f6feb);color:var(--dsw-alias-label-primary-inverted,#fff);border:none;font-weight:550}.UxClrW_newBtn:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover,#2f6feb)}.UxClrW_newBtn:disabled{opacity:.45;cursor:not-allowed}.UxClrW_error{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);border-radius:8px;margin:12px 28px 0;padding:8px 12px;font-size:12.5px}.UxClrW_draft{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1,#00000005);border-radius:12px;flex-wrap:wrap;align-items:center;gap:8px;margin:14px 28px 0;padding:12px;display:flex}.UxClrW_input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-width:160px;height:30px;color:var(--dsw-alias-label-primary);border-radius:8px;flex:1;padding:0 10px;font-size:12.5px}.UxClrW_input:focus-visible,.UxClrW_select:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#2f6feb);outline-offset:1px}.UxClrW_board{flex:1;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));align-items:start;gap:14px;padding:16px 28px 40px;display:grid;overflow-y:auto}.UxClrW_loading{color:var(--dsw-alias-label-tertiary);flex:1;justify-content:center;align-items:center;font-size:13px;display:flex}.UxClrW_column{background:var(--dsw-alias-bg-layer-1,#00000005);border-radius:14px;flex-direction:column;gap:10px;min-width:0;padding:12px;display:flex}.UxClrW_columnDone{opacity:.96}.UxClrW_columnHeader{align-items:center;gap:8px;padding:2px 4px 6px;display:flex}.UxClrW_columnDot{background:var(--dsw-alias-label-tertiary);border-radius:50%;width:8px;height:8px}.UxClrW_columnDot[data-status=todo]{background:var(--dsw-alias-label-tertiary)}.UxClrW_columnDot[data-status=in_progress]{background:var(--dsw-alias-brand-primary,#2f6feb)}.UxClrW_columnDot[data-status=done]{background:var(--dsw-alias-state-business-primary,#10a37f)}.UxClrW_columnTitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;font-weight:600}.UxClrW_columnCount{min-width:20px;height:18px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;justify-content:center;align-items:center;padding:0 6px;font-size:11px;font-weight:600;display:inline-flex}.UxClrW_columnEmpty{color:var(--dsw-alias-label-tertiary);margin:8px 4px;font-size:12px}.UxClrW_cardList{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.UxClrW_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);border-radius:11px;flex-direction:column;gap:7px;padding:11px 12px;display:flex}.UxClrW_cardHigh{border-color:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#b7791f) 45%, var(--dsw-alias-border-l2))}.UxClrW_cardTop{align-items:baseline;gap:8px;display:flex}.UxClrW_cardTitle{min-width:0;color:var(--dsw-alias-label-primary);word-break:break-word;flex:1;font-size:13px;font-weight:550}.UxClrW_cardAge{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.UxClrW_cardDesc{color:var(--dsw-alias-label-secondary);white-space:pre-wrap;word-break:break-word;margin:0;font-size:12px;line-height:1.45}.UxClrW_cardMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;font-size:11px;display:flex}.UxClrW_projectBadge{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;padding:1px 7px}.UxClrW_priorityBadge{border-radius:6px;padding:1px 7px}.UxClrW_priorityBadge[data-p=high]{color:var(--dsw-alias-state-warn-primary,#b7791f);background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#b7791f) 14%, transparent)}.UxClrW_priorityBadge[data-p=low]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-interactive-bg-hover)}.UxClrW_claimed{color:var(--dsw-alias-label-tertiary)}.UxClrW_doneSummary{border-top:1px dashed var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);word-break:break-word;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;margin:0;padding-top:6px;font-size:11.5px;line-height:1.45;display:-webkit-box;overflow:hidden}.UxClrW_doneSummary:hover,.UxClrW_doneSummary:focus-visible{-webkit-line-clamp:unset;line-clamp:unset;overflow:visible}.UxClrW_cardActions{align-items:center;gap:6px;display:flex}.UxClrW_iconBtn{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-width:26px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:6px;justify-content:center;align-items:center;padding:0 6px;font-size:12px;display:inline-flex}.UxClrW_iconBtn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.UxClrW_iconBtn:disabled{opacity:.35;cursor:not-allowed}.UxClrW_deleteBtn:hover{color:var(--dsw-alias-state-error-primary)}.UxClrW_deleteConfirm{color:var(--dsw-alias-state-error-primary);border-color:var(--dsw-alias-state-error-primary);font-size:11px}@media (width<=900px){.UxClrW_board{grid-template-columns:minmax(0,1fr)}}.UxClrW_autoToggle{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);cursor:pointer;white-space:nowrap;border-radius:8px;align-items:center;gap:7px;height:30px;padding:0 10px;display:inline-flex}.UxClrW_autoInput{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.UxClrW_autoSwitch{background:var(--dsw-alias-border-l3,#c8c8cc);border-radius:999px;flex:none;width:28px;height:16px;transition:background .14s;position:relative}.UxClrW_autoSwitch:after{content:\"\";background:var(--dsw-static-neutral-00,#fff);border-radius:50%;width:12px;height:12px;transition:transform .14s;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #00000040}.UxClrW_autoInput:checked+.UxClrW_autoSwitch{background:var(--dsw-alias-state-business-primary,#2f6feb)}.UxClrW_autoInput:checked+.UxClrW_autoSwitch:after{transform:translate(12px)}.UxClrW_autoInput:focus-visible+.UxClrW_autoSwitch{outline:2px solid var(--dsw-alias-brand-primary,#2f6feb);outline-offset:2px}.UxClrW_autoLabel{color:var(--dsw-alias-label-secondary);font-size:12.5px}.UxClrW_readyToggle{color:var(--dsw-alias-label-secondary);white-space:nowrap;align-items:center;gap:6px;font-size:12px;display:inline-flex}.UxClrW_cardActions{flex-wrap:wrap;align-items:center;gap:6px;margin-top:2px;display:flex}.UxClrW_actionBtn{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:6px;padding:0 9px;font-size:11.5px}.UxClrW_actionBtn:hover{background:var(--dsw-alias-interactive-bg-hover)}.UxClrW_actionPrimary{background:var(--dsw-alias-button-primary-fill,#2f6feb);color:var(--dsw-alias-label-primary-inverted,#fff);border:none;font-weight:550}.UxClrW_actionPrimary:hover{background:var(--dsw-alias-button-primary-hover,#2f6feb)}.UxClrW_actionGhost{color:var(--dsw-alias-label-tertiary)}.UxClrW_columnBlocked{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#d33) 6%, transparent)}.UxClrW_cardBlocked{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#d33) 40%, var(--dsw-alias-border-l2))}.UxClrW_blockReason{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11.5px}.UxClrW_columnDot[data-status=draft]{background:var(--dsw-alias-label-tertiary)}.UxClrW_columnDot[data-status=ready]{background:var(--dsw-alias-state-warn-primary,#b7791f)}.UxClrW_columnDot[data-status=review]{background:var(--dsw-alias-state-business-tertiary,#2f6feb)}.UxClrW_columnDot[data-status=blocked]{background:var(--dsw-alias-state-error-primary,#d33)}.UxClrW_deleteBtn{margin-left:auto}.UxClrW_tabActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.UxClrW_columnAction{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;border-radius:6px;margin-left:auto;padding:0 7px;font-size:10.5px}.UxClrW_columnAction:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.UxClrW_moreBtn{border:1px dashed var(--dsw-alias-border-l2);height:26px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border-radius:8px;align-self:flex-start;margin-top:4px;padding:0 10px;font-size:12px}.UxClrW_moreBtn:hover{color:var(--dsw-alias-label-secondary);border-style:solid}.UxClrW_archivePane{flex:1;max-width:900px;padding:16px 28px 40px;overflow-y:auto}.UxClrW_archiveHead{align-items:center;gap:8px;margin-bottom:12px;display:flex}.UxClrW_archiveTitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:15px;font-weight:600}";
99
+ const tagId = "dsh-project-tasks/TaskBoardPage.module.css";
100
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
101
+ const tag = document.createElement("style");
102
+ tag.dataset.plugin = "dsh-project-tasks";
103
+ tag.dataset.pluginCss = tagId;
104
+ tag.textContent = css;
105
+ document.head.appendChild(tag);
106
+ }
107
+ var TaskBoardPage_module_css_default = {
108
+ "actionBtn": "UxClrW_actionBtn",
109
+ "actionGhost": "UxClrW_actionGhost",
110
+ "actionPrimary": "UxClrW_actionPrimary",
111
+ "archiveHead": "UxClrW_archiveHead",
112
+ "archivePane": "UxClrW_archivePane",
113
+ "archiveTitle": "UxClrW_archiveTitle",
114
+ "autoInput": "UxClrW_autoInput",
115
+ "autoLabel": "UxClrW_autoLabel",
116
+ "autoSwitch": "UxClrW_autoSwitch",
117
+ "autoToggle": "UxClrW_autoToggle",
118
+ "blockReason": "UxClrW_blockReason",
119
+ "board": "UxClrW_board",
120
+ "card": "UxClrW_card",
121
+ "cardActions": "UxClrW_cardActions",
122
+ "cardAge": "UxClrW_cardAge",
123
+ "cardBlocked": "UxClrW_cardBlocked",
124
+ "cardDesc": "UxClrW_cardDesc",
125
+ "cardHigh": "UxClrW_cardHigh",
126
+ "cardList": "UxClrW_cardList",
127
+ "cardMeta": "UxClrW_cardMeta",
128
+ "cardTitle": "UxClrW_cardTitle",
129
+ "cardTop": "UxClrW_cardTop",
130
+ "claimed": "UxClrW_claimed",
131
+ "column": "UxClrW_column",
132
+ "columnAction": "UxClrW_columnAction",
133
+ "columnBlocked": "UxClrW_columnBlocked",
134
+ "columnCount": "UxClrW_columnCount",
135
+ "columnDone": "UxClrW_columnDone",
136
+ "columnDot": "UxClrW_columnDot",
137
+ "columnEmpty": "UxClrW_columnEmpty",
138
+ "columnHeader": "UxClrW_columnHeader",
139
+ "columnTitle": "UxClrW_columnTitle",
140
+ "deleteBtn": "UxClrW_deleteBtn",
141
+ "deleteConfirm": "UxClrW_deleteConfirm",
142
+ "doneSummary": "UxClrW_doneSummary",
143
+ "draft": "UxClrW_draft",
144
+ "error": "UxClrW_error",
145
+ "ghostBtn": "UxClrW_ghostBtn",
146
+ "header": "UxClrW_header",
147
+ "headerLeft": "UxClrW_headerLeft",
148
+ "headerRight": "UxClrW_headerRight",
149
+ "iconBtn": "UxClrW_iconBtn",
150
+ "input": "UxClrW_input",
151
+ "loading": "UxClrW_loading",
152
+ "moreBtn": "UxClrW_moreBtn",
153
+ "newBtn": "UxClrW_newBtn",
154
+ "page": "UxClrW_page",
155
+ "priorityBadge": "UxClrW_priorityBadge",
156
+ "projectBadge": "UxClrW_projectBadge",
157
+ "projectLabel": "UxClrW_projectLabel",
158
+ "projectPicker": "UxClrW_projectPicker",
159
+ "readyToggle": "UxClrW_readyToggle",
160
+ "refresh": "UxClrW_refresh",
161
+ "select": "UxClrW_select",
162
+ "subtitle": "UxClrW_subtitle",
163
+ "tabActive": "UxClrW_tabActive",
164
+ "title": "UxClrW_title"
165
+ };
166
+ //#endregion
167
+ //#region src/client/TaskBoardPage.tsx
168
+ /**
169
+ * DSH Task Board page: a kanban of project tasks across the full lifecycle —
170
+ * Draft · Ready · In progress · Review · Done · Blocked. The human creates and
171
+ * moves tasks; an agent processes a project's ready/in-progress tasks via the
172
+ * `task_board_*` tools; the board stays live over SSE.
173
+ */
174
+ /** Columns in board order. */
175
+ const COLUMNS = [
176
+ "draft",
177
+ "ready",
178
+ "in_progress",
179
+ "review",
180
+ "done",
181
+ "blocked"
182
+ ];
183
+ /** How many done cards show before the Done column collapses. */
184
+ const DONE_COLLAPSED = 10;
185
+ /** Last path segment of a directory. */
186
+ function baseName(path) {
187
+ const parts = path.replace(/\\/g, "/").split("/").filter(Boolean);
188
+ return parts[parts.length - 1] ?? path;
189
+ }
190
+ /** Relative "updated" label. */
191
+ function ageLabel(updatedAt, now, t) {
192
+ const diff = Math.max(0, now - updatedAt);
193
+ const min = 6e4;
194
+ if (diff < min) return t("time.now");
195
+ if (diff < 60 * min) return t("time.minutes", { n: Math.floor(diff / min) });
196
+ if (diff < 1440 * min) return t("time.hours", { n: Math.floor(diff / (60 * min)) });
197
+ return t("time.days", { n: Math.floor(diff / (1440 * min)) });
198
+ }
199
+ /**
200
+ * Render the task board.
201
+ * @param props - injected services and copy.
202
+ * @returns the global task-board page.
203
+ */
204
+ function TaskBoardPage(props) {
205
+ const { useWorkspaces, currentProject, t } = props;
206
+ const workspaceSnapshot = useWorkspaces((state) => state);
207
+ const projects = (0, react.useMemo)(() => {
208
+ const seen = /* @__PURE__ */ new Set();
209
+ const out = [];
210
+ for (const item of workspaceSnapshot.items) {
211
+ if (item.path === "" || seen.has(item.path)) continue;
212
+ seen.add(item.path);
213
+ out.push({
214
+ path: item.path,
215
+ title: item.title
216
+ });
217
+ }
218
+ return out;
219
+ }, [workspaceSnapshot]);
220
+ const [board, setBoard] = (0, react.useState)(void 0);
221
+ const [error, setError] = (0, react.useState)(void 0);
222
+ const [now, setNow] = (0, react.useState)(() => Date.now());
223
+ const [projectFilter, setProjectFilter] = (0, react.useState)("all");
224
+ const [priorityFilter, setPriorityFilter] = (0, react.useState)("all");
225
+ const [drafting, setDrafting] = (0, react.useState)(false);
226
+ const [draftProject, setDraftProject] = (0, react.useState)("");
227
+ const [draftTitle, setDraftTitle] = (0, react.useState)("");
228
+ const [draftDesc, setDraftDesc] = (0, react.useState)("");
229
+ const [draftPriority, setDraftPriority] = (0, react.useState)("normal");
230
+ const [draftReady, setDraftReady] = (0, react.useState)(false);
231
+ const [confirmDeleteId, setConfirmDeleteId] = (0, react.useState)(void 0);
232
+ const [showArchived, setShowArchived] = (0, react.useState)(false);
233
+ const [doneExpanded, setDoneExpanded] = (0, react.useState)(false);
234
+ (0, react.useEffect)(() => {
235
+ const timer = setInterval(() => {
236
+ setNow(Date.now());
237
+ }, 3e4);
238
+ return () => {
239
+ clearInterval(timer);
240
+ };
241
+ }, []);
242
+ (0, react.useEffect)(() => {
243
+ let alive = true;
244
+ fetchState().then((state) => {
245
+ if (alive) {
246
+ setBoard(state);
247
+ setError(void 0);
248
+ }
249
+ }).catch((e) => {
250
+ if (alive) setError(e instanceof Error ? e.message : String(e));
251
+ });
252
+ const close = subscribeBoard((state) => {
253
+ setBoard(state);
254
+ setError(void 0);
255
+ });
256
+ return () => {
257
+ alive = false;
258
+ close();
259
+ };
260
+ }, []);
261
+ const refresh = async () => {
262
+ try {
263
+ setBoard(await fetchState());
264
+ setError(void 0);
265
+ } catch (e) {
266
+ setError(e instanceof Error ? e.message : String(e));
267
+ }
268
+ };
269
+ const run = async (op) => {
270
+ try {
271
+ await op();
272
+ } catch (e) {
273
+ setError(e instanceof Error ? e.message : String(e));
274
+ }
275
+ };
276
+ const defaultProject = currentProject !== void 0 && currentProject !== "" ? currentProject : projects[0]?.path ?? "";
277
+ const openDraft = () => {
278
+ setDrafting(true);
279
+ setDraftProject(defaultProject);
280
+ setDraftTitle("");
281
+ setDraftDesc("");
282
+ setDraftPriority("normal");
283
+ setDraftReady(false);
284
+ };
285
+ const submitDraft = async () => {
286
+ const title = draftTitle.trim();
287
+ if (title === "" || draftProject === "") return;
288
+ await run(async () => {
289
+ await createTask({
290
+ project: draftProject,
291
+ title,
292
+ ...draftDesc.trim() === "" ? {} : { description: draftDesc.trim() },
293
+ priority: draftPriority,
294
+ status: draftReady ? "ready" : "draft"
295
+ });
296
+ setDrafting(false);
297
+ });
298
+ };
299
+ const remove = async (id) => {
300
+ if (confirmDeleteId !== id) {
301
+ setConfirmDeleteId(id);
302
+ return;
303
+ }
304
+ setConfirmDeleteId(void 0);
305
+ await run(() => deleteTask(id));
306
+ };
307
+ const tasks = board?.tasks ?? [];
308
+ const inProject = (task) => projectFilter === "all" || task.project === projectFilter;
309
+ const inPriority = (task) => priorityFilter === "all" || task.priority === priorityFilter;
310
+ const visible = tasks.filter((task) => task.archived !== true && inProject(task) && inPriority(task));
311
+ const archivedTasks = tasks.filter((task) => task.archived === true && inProject(task)).sort((a, b) => b.updatedAt - a.updatedAt);
312
+ const rank = (p) => p === "high" ? 2 : p === "normal" ? 1 : 0;
313
+ const byStatus = (status) => visible.filter((task) => task.status === status).sort((a, b) => rank(b.priority) - rank(a.priority) || b.updatedAt - a.updatedAt);
314
+ const autoClaim = board?.autoClaim === true;
315
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
316
+ className: TaskBoardPage_module_css_default.page,
317
+ "aria-label": t("page.title"),
318
+ "data-testid": "task-board-page",
319
+ children: [
320
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
321
+ className: TaskBoardPage_module_css_default.header,
322
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
323
+ className: TaskBoardPage_module_css_default.headerLeft,
324
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
325
+ className: TaskBoardPage_module_css_default.title,
326
+ children: t("page.title")
327
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
328
+ className: TaskBoardPage_module_css_default.subtitle,
329
+ children: t("page.subtitle")
330
+ })]
331
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
332
+ className: TaskBoardPage_module_css_default.headerRight,
333
+ children: [
334
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
335
+ className: TaskBoardPage_module_css_default.autoToggle,
336
+ title: t("auto.hint"),
337
+ children: [
338
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
339
+ type: "checkbox",
340
+ className: TaskBoardPage_module_css_default.autoInput,
341
+ checked: autoClaim,
342
+ onChange: (e) => {
343
+ run(() => setAutoClaim(e.target.checked));
344
+ }
345
+ }),
346
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
347
+ className: TaskBoardPage_module_css_default.autoSwitch,
348
+ "aria-hidden": "true"
349
+ }),
350
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
351
+ className: TaskBoardPage_module_css_default.autoLabel,
352
+ children: t("auto.label")
353
+ })
354
+ ]
355
+ }),
356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
357
+ className: TaskBoardPage_module_css_default.projectPicker,
358
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
359
+ className: TaskBoardPage_module_css_default.projectLabel,
360
+ children: t("priority.label")
361
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
362
+ className: TaskBoardPage_module_css_default.select,
363
+ value: priorityFilter,
364
+ onChange: (e) => {
365
+ setPriorityFilter(e.target.value);
366
+ },
367
+ children: [
368
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
369
+ value: "all",
370
+ children: t("priority.all")
371
+ }),
372
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
373
+ value: "high",
374
+ children: t("priority.high")
375
+ }),
376
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
377
+ value: "normal",
378
+ children: t("priority.normal")
379
+ }),
380
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
381
+ value: "low",
382
+ children: t("priority.low")
383
+ })
384
+ ]
385
+ })]
386
+ }),
387
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
388
+ className: TaskBoardPage_module_css_default.projectPicker,
389
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
390
+ className: TaskBoardPage_module_css_default.projectLabel,
391
+ children: t("project.label")
392
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
393
+ className: TaskBoardPage_module_css_default.select,
394
+ value: projectFilter,
395
+ onChange: (e) => {
396
+ setProjectFilter(e.target.value);
397
+ },
398
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
399
+ value: "all",
400
+ children: t("project.all")
401
+ }), projects.map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
402
+ value: p.path,
403
+ children: [
404
+ p.title,
405
+ " · ",
406
+ baseName(p.path)
407
+ ]
408
+ }, p.path))]
409
+ })]
410
+ }),
411
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
412
+ type: "button",
413
+ className: TaskBoardPage_module_css_default.refresh,
414
+ "aria-label": t("refresh"),
415
+ onClick: () => {
416
+ refresh();
417
+ },
418
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 13 }), t("refresh")]
419
+ }),
420
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
421
+ type: "button",
422
+ className: clsx(TaskBoardPage_module_css_default.refresh, showArchived && TaskBoardPage_module_css_default.tabActive),
423
+ onClick: () => {
424
+ setShowArchived((v) => !v);
425
+ },
426
+ children: showArchived ? t("archive.back") : t("archive.open")
427
+ }),
428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
429
+ type: "button",
430
+ className: TaskBoardPage_module_css_default.newBtn,
431
+ onClick: openDraft,
432
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 13 }), t("new.action")]
433
+ })
434
+ ]
435
+ })]
436
+ }),
437
+ error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
438
+ className: TaskBoardPage_module_css_default.error,
439
+ role: "alert",
440
+ children: t("error.load", { message: error })
441
+ }),
442
+ drafting && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
443
+ className: TaskBoardPage_module_css_default.draft,
444
+ children: [
445
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
446
+ className: TaskBoardPage_module_css_default.select,
447
+ value: draftProject,
448
+ onChange: (e) => {
449
+ setDraftProject(e.target.value);
450
+ },
451
+ "aria-label": t("new.projectPrompt"),
452
+ children: [projects.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
453
+ value: "",
454
+ children: t("new.projectPrompt")
455
+ }), projects.map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
456
+ value: p.path,
457
+ children: [
458
+ p.title,
459
+ " · ",
460
+ baseName(p.path)
461
+ ]
462
+ }, p.path))]
463
+ }),
464
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
465
+ className: TaskBoardPage_module_css_default.input,
466
+ placeholder: t("new.placeholder.title"),
467
+ value: draftTitle,
468
+ onChange: (e) => {
469
+ setDraftTitle(e.target.value);
470
+ }
471
+ }),
472
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
473
+ className: TaskBoardPage_module_css_default.input,
474
+ placeholder: t("new.placeholder.description"),
475
+ value: draftDesc,
476
+ onChange: (e) => {
477
+ setDraftDesc(e.target.value);
478
+ }
479
+ }),
480
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
481
+ className: TaskBoardPage_module_css_default.select,
482
+ value: draftPriority,
483
+ onChange: (e) => {
484
+ setDraftPriority(e.target.value);
485
+ },
486
+ "aria-label": "priority",
487
+ children: [
488
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
489
+ value: "low",
490
+ children: t("priority.low")
491
+ }),
492
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
493
+ value: "normal",
494
+ children: t("priority.normal")
495
+ }),
496
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
497
+ value: "high",
498
+ children: t("priority.high")
499
+ })
500
+ ]
501
+ }),
502
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
503
+ className: TaskBoardPage_module_css_default.readyToggle,
504
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
505
+ type: "checkbox",
506
+ checked: draftReady,
507
+ onChange: (e) => {
508
+ setDraftReady(e.target.checked);
509
+ }
510
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("new.readyNow") })]
511
+ }),
512
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
513
+ type: "button",
514
+ className: TaskBoardPage_module_css_default.newBtn,
515
+ disabled: draftTitle.trim() === "" || draftProject === "",
516
+ onClick: () => {
517
+ submitDraft();
518
+ },
519
+ children: t("new.submit")
520
+ }),
521
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
522
+ type: "button",
523
+ className: TaskBoardPage_module_css_default.ghostBtn,
524
+ onClick: () => {
525
+ setDrafting(false);
526
+ },
527
+ children: t("new.cancel")
528
+ })
529
+ ]
530
+ }),
531
+ board === void 0 && error === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
532
+ className: TaskBoardPage_module_css_default.loading,
533
+ children: t("loading")
534
+ }) : showArchived ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
535
+ className: TaskBoardPage_module_css_default.archivePane,
536
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
537
+ className: TaskBoardPage_module_css_default.archiveHead,
538
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
539
+ className: TaskBoardPage_module_css_default.archiveTitle,
540
+ children: t("archive.title")
541
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
542
+ className: TaskBoardPage_module_css_default.columnCount,
543
+ children: archivedTasks.length
544
+ })]
545
+ }), archivedTasks.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
546
+ className: TaskBoardPage_module_css_default.columnEmpty,
547
+ children: t("archive.empty")
548
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
549
+ className: TaskBoardPage_module_css_default.cardList,
550
+ children: archivedTasks.map((task) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskCard, {
551
+ task,
552
+ now,
553
+ t,
554
+ confirming: confirmDeleteId === task.id,
555
+ onAction: (action) => {
556
+ run(() => taskAction(task.id, action));
557
+ },
558
+ onStatus: (status2) => {
559
+ run(() => updateTask({
560
+ id: task.id,
561
+ status: status2
562
+ }));
563
+ },
564
+ onDelete: () => {
565
+ remove(task.id);
566
+ }
567
+ }, task.id))
568
+ })]
569
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
570
+ className: TaskBoardPage_module_css_default.board,
571
+ children: COLUMNS.map((status) => {
572
+ const all = byStatus(status);
573
+ const isDone = status === "done";
574
+ const collapsed = isDone && !doneExpanded && all.length > DONE_COLLAPSED;
575
+ const items = collapsed ? all.slice(0, DONE_COLLAPSED) : all;
576
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
577
+ className: clsx(TaskBoardPage_module_css_default.column, status === "blocked" && TaskBoardPage_module_css_default.columnBlocked, isDone && TaskBoardPage_module_css_default.columnDone),
578
+ "aria-label": t(`column.${status}`),
579
+ children: [
580
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
581
+ className: TaskBoardPage_module_css_default.columnHeader,
582
+ children: [
583
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
584
+ className: TaskBoardPage_module_css_default.columnDot,
585
+ "data-status": status,
586
+ "aria-hidden": "true"
587
+ }),
588
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
589
+ className: TaskBoardPage_module_css_default.columnTitle,
590
+ children: t(`column.${status}`)
591
+ }),
592
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
593
+ className: TaskBoardPage_module_css_default.columnCount,
594
+ children: all.length
595
+ }),
596
+ isDone && all.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
597
+ type: "button",
598
+ className: TaskBoardPage_module_css_default.columnAction,
599
+ onClick: () => {
600
+ run(() => archiveDone(projectFilter === "all" ? void 0 : projectFilter));
601
+ },
602
+ children: t("archive.allDone")
603
+ })
604
+ ]
605
+ }),
606
+ items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
607
+ className: TaskBoardPage_module_css_default.columnEmpty,
608
+ children: t(`column.empty.${status}`)
609
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
610
+ className: TaskBoardPage_module_css_default.cardList,
611
+ children: items.map((task) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskCard, {
612
+ task,
613
+ now,
614
+ t,
615
+ confirming: confirmDeleteId === task.id,
616
+ onAction: (action) => {
617
+ run(() => taskAction(task.id, action));
618
+ },
619
+ onStatus: (status2) => {
620
+ run(() => updateTask({
621
+ id: task.id,
622
+ status: status2
623
+ }));
624
+ },
625
+ onDelete: () => {
626
+ remove(task.id);
627
+ }
628
+ }, task.id))
629
+ }),
630
+ collapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
631
+ type: "button",
632
+ className: TaskBoardPage_module_css_default.moreBtn,
633
+ onClick: () => {
634
+ setDoneExpanded(true);
635
+ },
636
+ children: t("archive.showMore", { n: all.length - DONE_COLLAPSED })
637
+ }),
638
+ isDone && doneExpanded && all.length > DONE_COLLAPSED && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
639
+ type: "button",
640
+ className: TaskBoardPage_module_css_default.moreBtn,
641
+ onClick: () => {
642
+ setDoneExpanded(false);
643
+ },
644
+ children: t("archive.showLess")
645
+ })
646
+ ]
647
+ }, status);
648
+ })
649
+ })
650
+ ]
651
+ });
652
+ }
653
+ /** One task card with lifecycle-appropriate actions. */
654
+ function TaskCard(props) {
655
+ const { task, now, confirming, t, onAction, onStatus, onDelete } = props;
656
+ const btn = (label, onClick, cls) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
657
+ type: "button",
658
+ className: clsx(TaskBoardPage_module_css_default.actionBtn, cls),
659
+ onClick,
660
+ children: label
661
+ });
662
+ let actions;
663
+ switch (task.status) {
664
+ case "draft":
665
+ actions = [btn(t("act.confirmReady"), () => {
666
+ onStatus("ready");
667
+ }, TaskBoardPage_module_css_default.actionPrimary)];
668
+ break;
669
+ case "ready":
670
+ actions = [btn(t("act.start"), () => {
671
+ onAction("start");
672
+ }, TaskBoardPage_module_css_default.actionPrimary)];
673
+ break;
674
+ case "in_progress":
675
+ actions = [btn(t("act.complete"), () => {
676
+ onStatus("review");
677
+ }, TaskBoardPage_module_css_default.actionPrimary)];
678
+ break;
679
+ case "review":
680
+ actions = [btn(t("act.verify"), () => {
681
+ onAction("verify");
682
+ }, TaskBoardPage_module_css_default.actionPrimary), btn(t("act.reject"), () => {
683
+ onAction("reject");
684
+ })];
685
+ break;
686
+ case "done":
687
+ actions = [];
688
+ break;
689
+ case "blocked":
690
+ actions = [btn(t("act.unblock"), () => {
691
+ onAction("unblock");
692
+ }, TaskBoardPage_module_css_default.actionPrimary)];
693
+ break;
694
+ }
695
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
696
+ className: clsx(TaskBoardPage_module_css_default.card, task.priority === "high" && TaskBoardPage_module_css_default.cardHigh, task.status === "blocked" && TaskBoardPage_module_css_default.cardBlocked),
697
+ children: [
698
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
699
+ className: TaskBoardPage_module_css_default.cardTop,
700
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
701
+ className: TaskBoardPage_module_css_default.cardTitle,
702
+ children: task.title
703
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
704
+ className: TaskBoardPage_module_css_default.cardAge,
705
+ children: ageLabel(task.updatedAt, now, t)
706
+ })]
707
+ }),
708
+ task.description !== void 0 && task.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
709
+ className: TaskBoardPage_module_css_default.cardDesc,
710
+ children: task.description
711
+ }),
712
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
713
+ className: TaskBoardPage_module_css_default.cardMeta,
714
+ children: [
715
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
716
+ className: TaskBoardPage_module_css_default.projectBadge,
717
+ title: task.project,
718
+ children: baseName(task.project)
719
+ }),
720
+ task.priority !== "normal" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
721
+ className: TaskBoardPage_module_css_default.priorityBadge,
722
+ "data-p": task.priority,
723
+ children: t(`priority.${task.priority}`)
724
+ }),
725
+ task.claimedBy !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
726
+ className: TaskBoardPage_module_css_default.claimed,
727
+ children: t("card.claimedBy", { session: task.claimedBy.sessionId.slice(0, 12) })
728
+ })
729
+ ]
730
+ }),
731
+ task.status === "blocked" && task.blockedReason !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
732
+ className: TaskBoardPage_module_css_default.blockReason,
733
+ children: t("card.blockedReason", { reason: task.blockedReason })
734
+ }),
735
+ (task.status === "review" || task.status === "done") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
736
+ className: TaskBoardPage_module_css_default.doneSummary,
737
+ title: task.doneSummary,
738
+ children: t("card.doneSummary", { summary: task.doneSummary ?? t("card.noSummary") })
739
+ }),
740
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
741
+ className: TaskBoardPage_module_css_default.cardActions,
742
+ children: [
743
+ actions,
744
+ task.archived === true ? btn(t("act.unarchive"), () => {
745
+ onAction("unarchive");
746
+ }) : task.status === "done" ? btn(t("act.archive"), () => {
747
+ onAction("archive");
748
+ }, TaskBoardPage_module_css_default.actionGhost) : task.status !== "blocked" && btn(t("act.block"), () => {
749
+ onAction("block");
750
+ }, TaskBoardPage_module_css_default.actionGhost),
751
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
752
+ type: "button",
753
+ className: clsx(TaskBoardPage_module_css_default.iconBtn, confirming && TaskBoardPage_module_css_default.deleteConfirm),
754
+ "aria-label": confirming ? t("card.confirmDelete") : t("card.delete"),
755
+ onClick: onDelete,
756
+ children: confirming ? t("card.confirmDelete") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 12 })
757
+ })
758
+ ]
759
+ })
760
+ ]
761
+ });
762
+ }
763
+ //#endregion
764
+ //#region src/client/TaskBoardIcon.tsx
765
+ /** Decorative occupant for the Task board sidebar entry. */
766
+ /**
767
+ * Render the checklist glyph at the size the sidebar asks for; the sidebar owns
768
+ * the accessible navigation label.
769
+ * @param props - the sidebar's icon share.
770
+ * @returns decorative checklist icon.
771
+ */
772
+ function TaskBoardIcon({ size }) {
773
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChecklistOutlineRegular, { size });
774
+ }
775
+ //#endregion
776
+ //#region src/client/locales.ts
777
+ /** `taskBoard` namespace dictionaries. */
778
+ /** Dictionary namespace owned by this plugin. */
779
+ const NS = "taskBoard";
780
+ /** Simplified Chinese dictionary (source of truth for keys). */
781
+ const zh = {
782
+ "panel.label": "任务看板",
783
+ "page.title": "任务看板",
784
+ "page.subtitle": "按项目维护任务,交给 agent 领取执行,完成后人工验收",
785
+ "refresh": "刷新",
786
+ "loading": "加载中…",
787
+ "auto.label": "自动认领",
788
+ "auto.hint": "开启后,后台定时把「待处理」的任务自动转到「进行中」(供 agent 拉取执行)",
789
+ "project.label": "项目",
790
+ "project.all": "全部项目",
791
+ "project.unknown": "未知项目",
792
+ "new.action": "新建任务",
793
+ "new.placeholder.title": "任务标题",
794
+ "new.placeholder.description": "描述(可选)",
795
+ "new.projectPrompt": "选择项目",
796
+ "new.readyNow": "直接标记为待处理",
797
+ "new.submit": "创建",
798
+ "new.cancel": "取消",
799
+ "priority.label": "优先级",
800
+ "priority.all": "全部",
801
+ "priority.low": "低",
802
+ "priority.normal": "中",
803
+ "priority.high": "高",
804
+ "column.draft": "待定",
805
+ "column.ready": "待处理",
806
+ "column.in_progress": "进行中",
807
+ "column.review": "待验证",
808
+ "column.done": "已完成",
809
+ "column.blocked": "阻断",
810
+ "column.empty.draft": "没有待定的任务",
811
+ "column.empty.ready": "没有待处理的任务",
812
+ "column.empty.in_progress": "没有进行中的任务",
813
+ "column.empty.review": "没有待验证的任务",
814
+ "column.empty.done": "还没有已完成的任务",
815
+ "column.empty.blocked": "没有被阻断的任务",
816
+ "act.confirmReady": "确认处理",
817
+ "act.start": "▶ 开始",
818
+ "act.complete": "完成待验收",
819
+ "act.verify": "验收通过",
820
+ "act.reject": "退回",
821
+ "act.block": "阻断",
822
+ "act.unblock": "解除阻断",
823
+ "act.archive": "归档",
824
+ "act.unarchive": "取消归档",
825
+ "archive.open": "归档",
826
+ "archive.back": "返回看板",
827
+ "archive.title": "已归档任务",
828
+ "archive.empty": "没有已归档的任务",
829
+ "archive.allDone": "全部归档",
830
+ "archive.showMore": "展开其余 {n} 个",
831
+ "archive.showLess": "收起",
832
+ "card.claimedBy": "由 {session} 领取",
833
+ "card.doneSummary": "完成摘要:{summary}",
834
+ "card.blockedReason": "阻断原因:{reason}",
835
+ "card.delete": "删除任务",
836
+ "card.confirmDelete": "再次点击确认",
837
+ "card.noSummary": "(无摘要)",
838
+ "empty.title": "还没有任务",
839
+ "empty.hint": "点右上角「新建任务」,或在下方选择项目后创建第一个任务。",
840
+ "error.load": "操作失败:{message}",
841
+ "time.now": "刚刚",
842
+ "time.minutes": "{n} 分钟前",
843
+ "time.hours": "{n} 小时前",
844
+ "time.days": "{n} 天前"
845
+ };
846
+ /** English dictionary (must match every key). */
847
+ const en = {
848
+ "panel.label": "Task board",
849
+ "page.title": "Task board",
850
+ "page.subtitle": "Project tasks an agent can pull, execute, and that a human verifies",
851
+ "refresh": "Refresh",
852
+ "loading": "Loading…",
853
+ "auto.label": "Auto-claim",
854
+ "auto.hint": "When on, a background poller moves \"ready\" tasks to \"in progress\" for an agent to pick up.",
855
+ "project.label": "Project",
856
+ "project.all": "All projects",
857
+ "project.unknown": "Unknown project",
858
+ "new.action": "New task",
859
+ "new.placeholder.title": "Task title",
860
+ "new.placeholder.description": "Description (optional)",
861
+ "new.projectPrompt": "Choose a project",
862
+ "new.readyNow": "Mark ready now",
863
+ "new.submit": "Create",
864
+ "new.cancel": "Cancel",
865
+ "priority.label": "Priority",
866
+ "priority.all": "All",
867
+ "priority.low": "Low",
868
+ "priority.normal": "Normal",
869
+ "priority.high": "High",
870
+ "column.draft": "Draft",
871
+ "column.ready": "Ready",
872
+ "column.in_progress": "In progress",
873
+ "column.review": "Review",
874
+ "column.done": "Done",
875
+ "column.blocked": "Blocked",
876
+ "column.empty.draft": "No drafts",
877
+ "column.empty.ready": "Nothing ready",
878
+ "column.empty.in_progress": "Nothing in progress",
879
+ "column.empty.review": "Nothing awaiting review",
880
+ "column.empty.done": "Nothing completed yet",
881
+ "column.empty.blocked": "Nothing blocked",
882
+ "act.confirmReady": "Confirm ready",
883
+ "act.start": "▶ Start",
884
+ "act.complete": "Complete for review",
885
+ "act.verify": "Accept",
886
+ "act.reject": "Reject",
887
+ "act.block": "Block",
888
+ "act.unblock": "Unblock",
889
+ "act.archive": "Archive",
890
+ "act.unarchive": "Restore",
891
+ "archive.open": "Archived",
892
+ "archive.back": "Back to board",
893
+ "archive.title": "Archived tasks",
894
+ "archive.empty": "No archived tasks",
895
+ "archive.allDone": "Archive all",
896
+ "archive.showMore": "Show {n} more",
897
+ "archive.showLess": "Show less",
898
+ "card.claimedBy": "Claimed by {session}",
899
+ "card.doneSummary": "Summary: {summary}",
900
+ "card.blockedReason": "Blocked: {reason}",
901
+ "card.delete": "Delete task",
902
+ "card.confirmDelete": "Click again to confirm",
903
+ "card.noSummary": "(no summary)",
904
+ "empty.title": "No tasks yet",
905
+ "empty.hint": "Use \"New task\" in the header, or pick a project and create the first one.",
906
+ "error.load": "Action failed: {message}",
907
+ "time.now": "just now",
908
+ "time.minutes": "{n}m ago",
909
+ "time.hours": "{n}h ago",
910
+ "time.days": "{n}d ago"
911
+ };
912
+ //#endregion
913
+ //#region src/client/index.ts
914
+ /** Stable main-panel id for the task board page. */
915
+ const PANEL_ID = "taskBoard";
916
+ /**
917
+ * Required services: the slot registry and dictionaries, the layout that owns
918
+ * the main-panel selection, and the workspace list for the project selector.
919
+ */
920
+ const inject = [
921
+ "slots",
922
+ "locale",
923
+ "layout",
924
+ "workspaces"
925
+ ];
926
+ /**
927
+ * Client plugin body: register the dictionaries, the global task board page, and
928
+ * the sidebar entry that selects it.
929
+ * @param ctx - client root context.
930
+ */
931
+ function apply(ctx) {
932
+ ctx.effect(() => ctx.locale.register(NS, {
933
+ zh,
934
+ en
935
+ }), "dsh-task-board: dictionaries");
936
+ const t = ctx.locale.bind(NS);
937
+ ctx.slots.inject("main", () => ctx.slots.register({
938
+ name: "main",
939
+ key: PANEL_ID,
940
+ locale: NS,
941
+ inject: () => ({
942
+ hooks: { workspaces: ctx.workspaces.list },
943
+ currentProject: void 0
944
+ })
945
+ }, TaskBoardPage));
946
+ ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
947
+ name: "sidebar.panellist",
948
+ id: PANEL_ID,
949
+ order: 6,
950
+ locale: NS,
951
+ label: () => t("panel.label")
952
+ }, TaskBoardIcon));
953
+ }
954
+ //#endregion
955
+ exports.apply = apply;
956
+ exports.inject = inject;
957
+ return module.exports;
958
+ }
959
+ });
960
+
961
+ //# sourceMappingURL=client.js.map