@yankeguo/dsh-client-ui-devlead 0.4.1 → 0.4.2-rc.10

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 CHANGED
@@ -29,6 +29,7 @@ window.__ModuleLoader__.load({
29
29
  inject: () => inject
30
30
  });
31
31
  module.exports = __toCommonJS(index_exports);
32
+ var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
32
33
 
33
34
  // packages/client-ui/src/client/DevLeadBar.tsx
34
35
  var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
@@ -115,6 +116,236 @@ window.__ModuleLoader__.load({
115
116
  return `${who} \u2014 report ${kind}${suffix}`;
116
117
  }
117
118
 
119
+ // packages/protocol/src/board.ts
120
+ var import_zod = require("zod");
121
+ var DEVLEAD_BOARD_SCHEMA_VERSION = 1;
122
+ var DEVLEAD_BOARD_DIR_SEGMENTS = [".dsh", "devlead"];
123
+ var DEVLEAD_BOARD_FILE_NAME = "board.json";
124
+ var DEVLEAD_BOARD_MAX_BYTES = 256 * 1024;
125
+ var DEVLEAD_BOARD_READ_MAX_BYTES = 64 * 1024;
126
+ var DEVLEAD_BOARD_MAX_PROJECTS = 50;
127
+ var DEVLEAD_BOARD_MAX_TASKS = 200;
128
+ var DEVLEAD_BOARD_MAX_BLOCKERS = 50;
129
+ var DEVLEAD_BOARD_TEXT_MAX = 4e3;
130
+ var DEVLEAD_BOARD_ID_MAX = 128;
131
+ var DEVLEAD_BOARD_TITLE_MAX = 200;
132
+ var DEVLEAD_BOARD_PATH_MAX = 4096;
133
+ var DEVLEAD_BOARD_TIMESTAMP_MAX = 64;
134
+ function pointerSegment(value) {
135
+ return String(value).replaceAll("~", "~0").replaceAll("/", "~1");
136
+ }
137
+ function devLeadBoardIssuePointer(path) {
138
+ return path.length === 0 ? "" : `/${path.map(pointerSegment).join("/")}`;
139
+ }
140
+ function devLeadBoardIssueViews(issues) {
141
+ return issues.map((issue) => ({
142
+ pointer: devLeadBoardIssuePointer(issue.path),
143
+ message: issue.message
144
+ }));
145
+ }
146
+ var idSchema = import_zod.z.string().min(1).max(DEVLEAD_BOARD_ID_MAX);
147
+ var titleSchema = import_zod.z.string().min(1).max(DEVLEAD_BOARD_TITLE_MAX);
148
+ var textSchema = import_zod.z.string().max(DEVLEAD_BOARD_TEXT_MAX);
149
+ var timestampSchema = import_zod.z.string().max(DEVLEAD_BOARD_TIMESTAMP_MAX).pipe(import_zod.z.iso.datetime());
150
+ var blockerSchema = import_zod.z.object({
151
+ id: idSchema,
152
+ text: import_zod.z.string().min(1).max(DEVLEAD_BOARD_TEXT_MAX),
153
+ since: timestampSchema,
154
+ sessionId: idSchema.optional()
155
+ }).strict();
156
+ var taskSchema = import_zod.z.object({
157
+ id: idSchema,
158
+ title: import_zod.z.string().min(1).max(DEVLEAD_BOARD_TEXT_MAX),
159
+ status: import_zod.z.enum(["todo", "doing", "blocked", "done"]),
160
+ ownerSessionId: idSchema.optional(),
161
+ updatedAt: timestampSchema
162
+ }).strict();
163
+ function createDevLeadBoardSchema(isAbsolutePath) {
164
+ const projectSchema2 = import_zod.z.object({
165
+ id: idSchema,
166
+ workspace: import_zod.z.object({
167
+ path: import_zod.z.string().min(1).max(DEVLEAD_BOARD_PATH_MAX).refine(isAbsolutePath, {
168
+ message: "workspace path must be absolute"
169
+ }),
170
+ title: titleSchema
171
+ }).strict(),
172
+ status: import_zod.z.enum(["active", "blocked", "paused", "done"]),
173
+ priority: import_zod.z.enum(["low", "medium", "high"]),
174
+ goal: textSchema,
175
+ focus: textSchema,
176
+ next: textSchema,
177
+ blockers: import_zod.z.array(blockerSchema).max(DEVLEAD_BOARD_MAX_BLOCKERS),
178
+ tasks: import_zod.z.array(taskSchema).max(DEVLEAD_BOARD_MAX_TASKS),
179
+ updatedAt: timestampSchema
180
+ }).strict();
181
+ const boardSchema = import_zod.z.object({
182
+ schemaVersion: import_zod.z.literal(DEVLEAD_BOARD_SCHEMA_VERSION),
183
+ revision: import_zod.z.number().int().nonnegative().safe(),
184
+ updatedAt: timestampSchema,
185
+ updatedBy: import_zod.z.object({ sessionId: idSchema, title: titleSchema }).strict(),
186
+ projects: import_zod.z.array(projectSchema2).max(DEVLEAD_BOARD_MAX_PROJECTS)
187
+ }).strict().superRefine((board, context) => {
188
+ const projectIds = /* @__PURE__ */ new Set();
189
+ const workspacePaths = /* @__PURE__ */ new Set();
190
+ board.projects.forEach((project, projectIndex) => {
191
+ if (projectIds.has(project.id)) {
192
+ context.addIssue({
193
+ code: "custom",
194
+ path: ["projects", projectIndex, "id"],
195
+ message: `duplicate project id "${project.id}"`
196
+ });
197
+ }
198
+ projectIds.add(project.id);
199
+ if (workspacePaths.has(project.workspace.path)) {
200
+ context.addIssue({
201
+ code: "custom",
202
+ path: ["projects", projectIndex, "workspace", "path"],
203
+ message: `duplicate workspace path "${project.workspace.path}"`
204
+ });
205
+ }
206
+ workspacePaths.add(project.workspace.path);
207
+ for (const [field, entries] of [["blockers", project.blockers], ["tasks", project.tasks]]) {
208
+ const ids = /* @__PURE__ */ new Set();
209
+ entries.forEach((entry, entryIndex) => {
210
+ if (ids.has(entry.id)) {
211
+ context.addIssue({
212
+ code: "custom",
213
+ path: ["projects", projectIndex, field, entryIndex, "id"],
214
+ message: `duplicate ${field} id "${entry.id}"`
215
+ });
216
+ }
217
+ ids.add(entry.id);
218
+ });
219
+ }
220
+ });
221
+ });
222
+ return boardSchema;
223
+ }
224
+
225
+ // packages/protocol/src/notes.ts
226
+ var import_zod2 = require("zod");
227
+ var DEVLEAD_NOTES_SCHEMA_VERSION = 1;
228
+ var DEVLEAD_NOTES_DIR_NAME = "notes";
229
+ var DEVLEAD_NOTES_INDEX_FILE_NAME = "index.json";
230
+ var DEVLEAD_NOTES_INDEX_MAX_BYTES = 128 * 1024;
231
+ var DEVLEAD_NOTES_NOTE_MAX_BYTES = 256 * 1024;
232
+ var DEVLEAD_NOTES_MAX_PROJECTS = 50;
233
+ var DEVLEAD_NOTES_MAX_PER_PROJECT = 100;
234
+ var DEVLEAD_NOTES_ID_MAX = 128;
235
+ var DEVLEAD_NOTES_DIRECTORY_MAX = 128;
236
+ var DEVLEAD_NOTES_TITLE_MAX = 200;
237
+ var DEVLEAD_NOTES_SUMMARY_MAX = 500;
238
+ var DEVLEAD_NOTES_PATH_MAX = 512;
239
+ var DEVLEAD_NOTES_TIMESTAMP_MAX = 64;
240
+ var timestampSchema2 = import_zod2.z.string().max(DEVLEAD_NOTES_TIMESTAMP_MAX).pipe(import_zod2.z.iso.datetime());
241
+ var projectIdSchema = import_zod2.z.string().min(1).max(DEVLEAD_NOTES_ID_MAX);
242
+ var titleSchema2 = import_zod2.z.string().min(1).max(DEVLEAD_NOTES_TITLE_MAX);
243
+ var summarySchema = import_zod2.z.string().max(DEVLEAD_NOTES_SUMMARY_MAX);
244
+ var WINDOWS_RESERVED_NAMES = /* @__PURE__ */ new Set([
245
+ "CON",
246
+ "PRN",
247
+ "AUX",
248
+ "NUL",
249
+ ...Array.from({ length: 9 }, (_, index) => `COM${index + 1}`),
250
+ ...Array.from({ length: 9 }, (_, index) => `LPT${index + 1}`)
251
+ ]);
252
+ function isWindowsReservedName(value) {
253
+ const normalized = value.replace(/[. ]+$/gu, "");
254
+ const basename = normalized.split(".", 1)[0]?.replace(/ +$/gu, "").toUpperCase() ?? "";
255
+ return WINDOWS_RESERVED_NAMES.has(basename);
256
+ }
257
+ var noteIdSchema = projectIdSchema.regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/u, {
258
+ message: "note id must start with an alphanumeric and contain only alphanumerics, dot, underscore, or dash"
259
+ }).refine((value) => !isWindowsReservedName(value), {
260
+ message: "note id must not be a Windows reserved device name"
261
+ });
262
+ var directorySchema = import_zod2.z.string().min(1).max(DEVLEAD_NOTES_DIRECTORY_MAX).regex(/^[a-z0-9][a-z0-9._-]*$/u, {
263
+ message: "directory must be a sanitized lowercase POSIX segment"
264
+ }).refine((value) => value !== "." && value !== "..", {
265
+ message: "directory must not be a traversal segment"
266
+ }).refine((value) => !isWindowsReservedName(value), {
267
+ message: "directory must not be a Windows reserved device name"
268
+ });
269
+ var relativePathSchema = import_zod2.z.string().min(1).max(DEVLEAD_NOTES_PATH_MAX).refine((value) => !value.includes("\\"), { message: "note path must use POSIX separators" }).refine((value) => !value.startsWith("/"), { message: "note path must be relative to the notes root" }).refine((value) => value.split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== ".."), {
270
+ message: "note path must not contain empty or traversal segments"
271
+ });
272
+ var noteSchema = import_zod2.z.object({
273
+ id: noteIdSchema,
274
+ title: titleSchema2,
275
+ summary: summarySchema,
276
+ updatedAt: timestampSchema2,
277
+ bytes: import_zod2.z.number().int().nonnegative().max(DEVLEAD_NOTES_NOTE_MAX_BYTES),
278
+ path: relativePathSchema
279
+ }).strict();
280
+ var projectSchema = import_zod2.z.object({
281
+ id: projectIdSchema,
282
+ directory: directorySchema,
283
+ notes: import_zod2.z.array(noteSchema).max(DEVLEAD_NOTES_MAX_PER_PROJECT)
284
+ }).strict();
285
+ var indexSchema = import_zod2.z.object({
286
+ schemaVersion: import_zod2.z.literal(DEVLEAD_NOTES_SCHEMA_VERSION),
287
+ revision: import_zod2.z.number().int().nonnegative().safe(),
288
+ updatedAt: timestampSchema2,
289
+ projects: import_zod2.z.array(projectSchema).max(DEVLEAD_NOTES_MAX_PROJECTS)
290
+ }).strict().superRefine((index, context) => {
291
+ const projectIds = /* @__PURE__ */ new Set();
292
+ const directories = /* @__PURE__ */ new Set();
293
+ const paths = /* @__PURE__ */ new Set();
294
+ index.projects.forEach((project, projectIndex) => {
295
+ if (projectIds.has(project.id)) {
296
+ context.addIssue({
297
+ code: "custom",
298
+ path: ["projects", projectIndex, "id"],
299
+ message: `duplicate project id "${project.id}"`
300
+ });
301
+ }
302
+ projectIds.add(project.id);
303
+ if (directories.has(project.directory)) {
304
+ context.addIssue({
305
+ code: "custom",
306
+ path: ["projects", projectIndex, "directory"],
307
+ message: `duplicate project directory "${project.directory}"`
308
+ });
309
+ }
310
+ directories.add(project.directory);
311
+ const noteIds = /* @__PURE__ */ new Set();
312
+ project.notes.forEach((note, noteIndex) => {
313
+ const portableId = note.id.toLowerCase();
314
+ if (noteIds.has(portableId)) {
315
+ context.addIssue({
316
+ code: "custom",
317
+ path: ["projects", projectIndex, "notes", noteIndex, "id"],
318
+ message: `duplicate note id "${note.id}" ignoring case`
319
+ });
320
+ }
321
+ noteIds.add(portableId);
322
+ const expectedPath = `${project.directory}/${note.id}.md`;
323
+ if (note.path !== expectedPath) {
324
+ context.addIssue({
325
+ code: "custom",
326
+ path: ["projects", projectIndex, "notes", noteIndex, "path"],
327
+ message: `note path must be "${expectedPath}"`
328
+ });
329
+ }
330
+ const portablePath = note.path.toLowerCase();
331
+ if (paths.has(portablePath)) {
332
+ context.addIssue({
333
+ code: "custom",
334
+ path: ["projects", projectIndex, "notes", noteIndex, "path"],
335
+ message: `duplicate note path "${note.path}" ignoring case`
336
+ });
337
+ }
338
+ paths.add(portablePath);
339
+ });
340
+ });
341
+ });
342
+ function createDevLeadNotesIndexSchema() {
343
+ return indexSchema;
344
+ }
345
+ function parseDevLeadNotesIndex(value) {
346
+ return createDevLeadNotesIndexSchema().parse(value);
347
+ }
348
+
118
349
  // packages/client-ui/src/client/format.ts
119
350
  var TRANSITION_LABEL_KEYS = {
120
351
  completed: "transition.completed",
@@ -399,191 +630,9 @@ window.__ModuleLoader__.load({
399
630
  );
400
631
  }
401
632
 
402
- // packages/client-ui/src/client/DevLeadIconToggle.tsx
403
- var import_react2 = require("react");
633
+ // packages/client-ui/src/client/DevLeadBoardButton.tsx
404
634
  var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
405
635
 
406
- // packages/client-ui/src/client/results.ts
407
- function presentMessage(value) {
408
- if (value === void 0) return void 0;
409
- const trimmed = value.trim();
410
- return trimmed.length === 0 ? void 0 : trimmed;
411
- }
412
- function commandFailure(result) {
413
- if (!result.ok) {
414
- const message2 = presentMessage(result.error.message);
415
- return {
416
- kind: "transport",
417
- ...message2 === void 0 ? {} : { message: message2 },
418
- code: result.error.code
419
- };
420
- }
421
- const outcome = result.value?.result;
422
- if (outcome === void 0 || outcome.kind !== "error") return void 0;
423
- const message = presentMessage(outcome.text);
424
- return { kind: "rejected", ...message === void 0 ? {} : { message } };
425
- }
426
- function unexpectedFailure(error) {
427
- const message = error instanceof Error ? presentMessage(error.message) : void 0;
428
- return { kind: "unexpected", ...message === void 0 ? {} : { message } };
429
- }
430
- async function admitCommand(executeCommand, line) {
431
- try {
432
- const result = await executeCommand(line);
433
- if (result.ok && result.value === void 0) return { kind: "unresolved", line };
434
- return commandFailure(result);
435
- } catch (error) {
436
- return unexpectedFailure(error);
437
- }
438
- }
439
- var FAILURE_FALLBACK_KEYS = {
440
- transport: "error.fallback.transport",
441
- rejected: "error.fallback.rejected",
442
- unexpected: "error.fallback.unknown"
443
- };
444
- var ALREADY_ACTIVE_PREFIX = "Another Session is already in DevLead mode: ";
445
- var ALREADY_ACTIVE_INSTRUCTION = ". Run /devlead off there first";
446
- var ALREADY_ACTIVE_TAIL = `${ALREADY_ACTIVE_INSTRUCTION}, then enable this Session.`;
447
- function alreadyActiveDetails(message) {
448
- if (!message.startsWith(ALREADY_ACTIVE_PREFIX)) return void 0;
449
- const rest = message.slice(ALREADY_ACTIVE_PREFIX.length);
450
- const end = rest.lastIndexOf(ALREADY_ACTIVE_INSTRUCTION);
451
- if (end <= 0) return void 0;
452
- if (rest.slice(end) !== ALREADY_ACTIVE_TAIL) return void 0;
453
- const session = rest.slice(0, end).trim();
454
- return session.length === 0 ? void 0 : { session };
455
- }
456
- function failureMessage(failure, t) {
457
- if (failure.kind === "unresolved") return t("error.fallback.unresolved");
458
- if (failure.kind === "rejected" && failure.message !== void 0) {
459
- const active = alreadyActiveDetails(failure.message);
460
- if (active !== void 0) {
461
- return t("error.alreadyActive", { session: active.session });
462
- }
463
- }
464
- return failure.message ?? t(FAILURE_FALLBACK_KEYS[failure.kind]);
465
- }
466
- function createDevLeadAdmissionGate() {
467
- let entered = false;
468
- return {
469
- tryEnter: () => {
470
- if (entered) return false;
471
- entered = true;
472
- return true;
473
- },
474
- leave: () => {
475
- entered = false;
476
- }
477
- };
478
- }
479
- var DEVLEAD_ADMISSION_IDLE = { pending: false, failure: null };
480
- function devLeadAdmissionReducer(state, action) {
481
- switch (action.type) {
482
- case "begin":
483
- return state.pending && state.failure === null ? state : { pending: true, failure: null };
484
- case "settle":
485
- return state.pending || state.failure !== action.failure ? { pending: false, failure: action.failure } : state;
486
- case "reset":
487
- return state.failure === null ? state : { pending: state.pending, failure: null };
488
- }
489
- }
490
-
491
- // packages/client-ui/src/client/useDevLeadAdmission.ts
492
- var import_react = require("react");
493
- function useDevLeadAdmission(executeCommand, resetKey) {
494
- const [state, dispatch] = (0, import_react.useReducer)(devLeadAdmissionReducer, DEVLEAD_ADMISSION_IDLE);
495
- const [gate] = (0, import_react.useState)(createDevLeadAdmissionGate);
496
- const aliveRef = (0, import_react.useRef)(true);
497
- (0, import_react.useEffect)(() => {
498
- aliveRef.current = true;
499
- return () => {
500
- aliveRef.current = false;
501
- };
502
- }, []);
503
- const resetKeyRef = (0, import_react.useRef)(resetKey);
504
- (0, import_react.useEffect)(() => {
505
- resetKeyRef.current = resetKey;
506
- dispatch({ type: "reset" });
507
- }, [resetKey]);
508
- const run = (line) => {
509
- if (!gate.tryEnter()) return;
510
- const admittedKey = resetKeyRef.current;
511
- dispatch({ type: "begin" });
512
- void admitCommand(executeCommand, line).then((failure) => {
513
- gate.leave();
514
- if (!aliveRef.current) return;
515
- const stale = resetKeyRef.current !== admittedKey;
516
- dispatch({ type: "settle", failure: stale ? null : failure ?? null });
517
- });
518
- };
519
- return { pending: state.pending, failure: state.failure, run };
520
- }
521
-
522
- // packages/client-ui/src/client/DevLeadIconToggle.tsx
523
- var import_jsx_runtime2 = require("react/jsx-runtime");
524
- function DevLeadIconToggle({ useSession, useProjection, executeCommand, t }) {
525
- const subagent = useSession((snapshot) => snapshot.subagent !== null) ?? false;
526
- const projection = useProjection(DEVLEAD_PROJECTION_KEY);
527
- const enabled = projection?.enabled ?? false;
528
- const { pending, failure, run } = useDevLeadAdmission(executeCommand, enabled);
529
- const [attempt, setAttempt] = (0, import_react2.useState)("on");
530
- if (subagent) return null;
531
- if (projection === void 0) return null;
532
- const direction = enabled ? "off" : "on";
533
- const failureText = failure === null ? null : failureMessage(failure, t);
534
- const actionLabel = enabled ? t("toggle.disable") : t("toggle.enable");
535
- const failureLabel = failureText === null ? null : t(
536
- attempt === "off" ? "toggle.failed.disable" : "toggle.failed",
537
- { message: failureText }
538
- );
539
- const label = failureLabel ?? (pending ? t("toggle.pending") : actionLabel);
540
- const status = failureText === null ? null : t(
541
- attempt === "off" ? "toggle.failed.status.disable" : "toggle.failed.status",
542
- { message: failureText }
543
- );
544
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
545
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
546
- import_dsh_client_ui_primitives2.Tooltip,
547
- {
548
- label,
549
- side: "top",
550
- delayMs: 300,
551
- maxWidth: 300,
552
- portal: true,
553
- openOnClick: failure !== null,
554
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
555
- import_dsh_client_ui_primitives2.Button,
556
- {
557
- variant: "ghost",
558
- size: "sm",
559
- className: "devlead-toggle",
560
- "aria-label": label,
561
- "aria-busy": pending,
562
- "aria-pressed": enabled,
563
- disabled: pending,
564
- "data-devlead-toggle": "true",
565
- "data-devlead-enabled": enabled ? "true" : "false",
566
- "data-devlead-pending": pending ? "true" : "false",
567
- "data-devlead-failed": failure === null ? "false" : "true",
568
- onClick: () => {
569
- setAttempt(direction);
570
- run(`/${DEVLEAD_COMMAND_NAME} ${direction}`);
571
- },
572
- children: [
573
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconUsersOutlineRegular, { size: 16 }),
574
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "devlead-toggle-label", children: t("toggle.label") })
575
- ]
576
- }
577
- )
578
- }
579
- ),
580
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "devlead-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: status })
581
- ] });
582
- }
583
-
584
- // packages/client-ui/src/client/DevLeadSessionHoverMark.tsx
585
- var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
586
-
587
636
  // packages/client-ui/src/client/sessionMark.ts
588
637
  function devLeadRowEnabled(summary) {
589
638
  return summary?.projectionValues?.[DEVLEAD_MODE_PROJECTION_KEY]?.enabled === true;
@@ -613,566 +662,3533 @@ window.__ModuleLoader__.load({
613
662
  return watchedIdsOf(byId).has(sessionId);
614
663
  }
615
664
 
616
- // packages/client-ui/src/client/DevLeadSessionHoverMark.tsx
617
- var import_jsx_runtime3 = require("react/jsx-runtime");
618
- function DevLeadSessionHoverMark({ sessionId, useSessions, t }) {
619
- const enabled = useSessions((state) => devLeadRowEnabled(devLeadRowSummaryOf(state.byId, sessionId)));
620
- const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
621
- if (enabled) {
622
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", children: [
623
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-active-dot" }) }),
624
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("row.hover.enabled") })
625
- ] });
665
+ // packages/client-ui/src/client/board.ts
666
+ var DEVLEAD_BOARD_GLOBAL = "__DSH_DEVLEAD_BOARD__";
667
+ var DEVLEAD_BOARD_TAB_KIND = "devlead-board";
668
+ var DEVLEAD_BOARD_TAB_ID = "@yankeguo/dsh-client-ui-devlead/board";
669
+ function isAbsoluteWorkspacePath(value, platform) {
670
+ if (platform === "win32") {
671
+ return /^(?:[\\/]|[A-Za-z]:[\\/])/u.test(value);
626
672
  }
627
- if (!watched) return null;
628
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", "data-devlead-row-watched": "true", children: [
629
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.IconGoalOutlineRegular, { size: 14 }) }),
630
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("row.hover.watched") })
631
- ] });
673
+ return value.startsWith("/");
632
674
  }
633
-
634
- // packages/client-ui/src/client/DevLeadSessionMark.tsx
635
- var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
636
- var import_jsx_runtime4 = require("react/jsx-runtime");
637
- function DevLeadSessionMark({ sessionId, useSessions, t }) {
638
- const enabled = useSessions((state) => devLeadRowEnabled(devLeadRowSummaryOf(state.byId, sessionId)));
639
- const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
640
- if (enabled) {
641
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
642
- "span",
643
- {
644
- className: "devlead-sr-only",
645
- role: "img",
646
- "aria-label": t("row.mark.aria"),
647
- "data-devlead-active-mark": "true"
648
- }
649
- );
675
+ var schemas = /* @__PURE__ */ new Map();
676
+ function devLeadBoardSchemaFor(platform = "posix") {
677
+ const cached = schemas.get(platform);
678
+ if (cached !== void 0) return cached;
679
+ const schema = createDevLeadBoardSchema((value) => isAbsoluteWorkspacePath(value, platform));
680
+ schemas.set(platform, schema);
681
+ return schema;
682
+ }
683
+ var devLeadBoardSchema = devLeadBoardSchemaFor();
684
+ var DevLeadBoardParseError = class extends Error {
685
+ constructor(message, options) {
686
+ super(message, options);
687
+ this.name = "DevLeadBoardParseError";
650
688
  }
651
- if (!watched) return null;
652
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
653
- "span",
654
- {
655
- className: "devlead-row-mark devlead-row-mark-watched",
656
- role: "img",
657
- "aria-label": t("row.watched.aria"),
658
- "data-devlead-row-mark": "watched",
659
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconGoalOutlineRegular, { size: 13 })
689
+ };
690
+ function readDevLeadBoardConfig(value) {
691
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
692
+ const record = value;
693
+ if (record.schemaVersion !== DEVLEAD_BOARD_SCHEMA_VERSION) return void 0;
694
+ if (record.pathPlatform !== "posix" && record.pathPlatform !== "win32") return void 0;
695
+ if (typeof record.boardPath !== "string" || record.boardPath.trim().length === 0) return void 0;
696
+ if (record.boardPath.length > DEVLEAD_BOARD_PATH_MAX || !isAbsoluteWorkspacePath(record.boardPath, record.pathPlatform)) return void 0;
697
+ if (record.leadSessionId !== void 0) {
698
+ if (typeof record.leadSessionId !== "string" || record.leadSessionId.length === 0) return void 0;
699
+ }
700
+ if (record.override !== void 0 && typeof record.override !== "boolean") return void 0;
701
+ return {
702
+ boardPath: record.boardPath,
703
+ schemaVersion: DEVLEAD_BOARD_SCHEMA_VERSION,
704
+ pathPlatform: record.pathPlatform,
705
+ ...record.leadSessionId === void 0 ? {} : { leadSessionId: record.leadSessionId },
706
+ ...record.override === void 0 ? {} : { override: record.override }
707
+ };
708
+ }
709
+ function currentDevLeadBoardConfig() {
710
+ return readDevLeadBoardConfig(globalThis[DEVLEAD_BOARD_GLOBAL]);
711
+ }
712
+ function detectDevLeadBoardPathPlatform(cwd) {
713
+ if (cwd.startsWith("/")) return "posix";
714
+ if (cwd.startsWith("\\") || /^[A-Za-z]:/u.test(cwd)) return "win32";
715
+ return void 0;
716
+ }
717
+ function joinDevLeadBoardPath(cwd, platform) {
718
+ const segments = [...DEVLEAD_BOARD_DIR_SEGMENTS, DEVLEAD_BOARD_FILE_NAME];
719
+ return platform === "win32" ? joinWin32Path(cwd, segments) : joinPosixPath(cwd, segments);
720
+ }
721
+ function joinPosixPath(cwd, segments) {
722
+ const parts = [];
723
+ for (const part of `${cwd}/${segments.join("/")}`.split("/")) {
724
+ if (part.length === 0 || part === ".") continue;
725
+ if (part === "..") {
726
+ parts.pop();
727
+ continue;
660
728
  }
661
- );
729
+ parts.push(part);
730
+ }
731
+ return `/${parts.join("/")}`;
662
732
  }
663
-
664
- // packages/client-ui/src/client/locales.ts
665
- var zh = {
666
- "meta.title": "DevLead \u754C\u9762",
667
- "meta.description": "DevLead \u6A21\u5F0F\u7684 Web \u754C\u9762\uFF1A\u8F93\u5165\u6846\u5DE5\u5177\u6761\u7684 DevLead \u5F00\u5173\uFF08\u4E24\u6001\u5747\u53EF\u5207\u6362\uFF09\u3001\u6A21\u5F0F\u5F00\u542F\u540E\u663E\u793A\u7684\u72B6\u6001\u6761\uFF0C\u4EE5\u53CA\u4FA7\u8FB9\u680F\u4E2D\u6FC0\u6D3B DevLead \u884C\u4E0E\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u7684\u6807\u8BB0\u3002",
668
- "bar.aria": "DevLead \u72B6\u6001\u680F",
669
- "label": "DevLead",
670
- "hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u7684\u8F6E\u6B21\u7ED3\u675F\u4E0E\u4E2D\u9014\u6C47\u62A5\u4F1A\u901A\u77E5\u672C\u4F1A\u8BDD\uFF1B\u963B\u585E/\u5F85\u51B3\u7B56/\u63D0\u95EE\u4F1A\u8BF7\u6C42\u5524\u9192\uFF0C\u8FDB\u5EA6/\u544A\u77E5\u4EC5\u4F5C\u80CC\u666F\u3001\u4E0D\u5524\u9192\u3002",
671
- "count.watched": "\u5DF2\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD",
672
- "count.running": "\u8FD0\u884C\u4E2D {count}",
673
- "count.missing": "{count} \u4E2A\u5DF2\u4E0D\u53EF\u7528",
674
- "row.mark.aria": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD",
675
- "row.watched.aria": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8",
676
- "row.hover.enabled": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD\uFF1A\u53EF\u8C03\u5EA6\u5E76\u5173\u6CE8\u5176\u4ED6\u4F1A\u8BDD\u3002",
677
- "row.hover.watched": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8\uFF1A\u5B83\u7684\u8F6E\u6B21\u7ED3\u675F\u4E0E\u4E2D\u9014\u6C47\u62A5\u4F1A\u901A\u77E5 lead\uFF1B\u963B\u585E/\u5F85\u51B3\u7B56/\u63D0\u95EE\u4F1A\u8BF7\u6C42\u5524\u9192\uFF0C\u8FDB\u5EA6/\u544A\u77E5\u4EC5\u4F5C\u80CC\u666F\u3001\u4E0D\u5524\u9192\u3002",
678
- "toggle.label": "DevLead",
679
- "toggle.enable": "\u5F00\u542F DevLead \u6A21\u5F0F",
680
- "toggle.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
681
- "toggle.pending": "\u6B63\u5728\u6267\u884C DevLead \u547D\u4EE4\u2026",
682
- "toggle.failed": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
683
- "toggle.failed.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
684
- "toggle.failed.status": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
685
- "toggle.failed.status.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
686
- "notification.turn": "\u7B2C {turn} \u8F6E",
687
- "report.kind.progress": "\u8FDB\u5EA6",
688
- "report.kind.blocked": "\u963B\u585E",
689
- "report.kind.decision": "\u5F85\u51B3\u7B56",
690
- "report.kind.question": "\u63D0\u95EE",
691
- "report.kind.fyi": "\u544A\u77E5",
692
- "report.kind.unknown": "\u62A5\u544A",
693
- "report.question.open": "\u5F85\u56DE\u7B54",
694
- "report.question.answered": "\u5DF2\u56DE\u7B54",
695
- "report.question.expired": "\u5DF2\u8FC7\u671F",
696
- "report.question.cancelled": "\u5DF2\u53D6\u6D88",
697
- "report.question.unknown": "\u72B6\u6001\u672A\u77E5",
698
- "report.question.provisional": "\u6682\u5B9A",
699
- "report.answer.admitted": "\u5DF2\u63A5\u6536",
700
- "report.answer.claimed": "\u5DF2\u8BA4\u9886",
701
- "report.answer.presented": "\u5DF2\u5448\u73B0",
702
- "report.answer.discarded": "\u5DF2\u4E22\u5F03",
703
- "report.answer.failed": "\u6295\u9012\u5931\u8D25",
704
- "report.answer.unknown": "\u72B6\u6001\u672A\u77E5",
705
- "notification.wake.suppressed": "\u5E76\u5165\u62A5\u544A\u5524\u9192",
706
- "notification.wake.merged": "\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\u5DF2\u5E76\u5165\u5C1A\u672A\u53D1\u9001\u7684\u9700\u5904\u7406\u62A5\u544A\u5524\u9192\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
707
- "notification.wake.included": "\u5DF2\u53D1\u9001\u7684\u9700\u5904\u7406\u62A5\u544A\u5524\u9192\u5DF2\u5305\u542B\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
708
- "notification.wake.unknown": "\u9700\u5904\u7406\u62A5\u544A\u7684\u5524\u9192\u5DF2\u8986\u76D6\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
709
- "transition.completed": "\u5B8C\u6210",
710
- "transition.error": "\u5931\u8D25",
711
- "transition.blocked": "\u963B\u585E",
712
- "transition.aborted": "\u5DF2\u53D6\u6D88",
713
- "transition.max-tokens": "\u8D85\u51FA\u8F93\u51FA\u4E0A\u9650",
714
- "transition.interrupted": "\u5DF2\u4E2D\u65AD",
715
- "transition.forked": "\u5DF2\u5206\u53C9",
716
- "transition.unknown": "\u672A\u77E5\u72B6\u6001",
717
- "error.alreadyActive": "\u53E6\u4E00\u4E2A\u4F1A\u8BDD\u5DF2\u5904\u4E8E DevLead \u6A21\u5F0F\uFF1A{session}\u3002\u8BF7\u5148\u5728\u90A3\u91CC\u6267\u884C /devlead off\uFF0C\u518D\u5F00\u542F\u672C\u4F1A\u8BDD\u3002",
718
- "error.fallback.transport": "\u547D\u4EE4\u5931\u8D25",
719
- "error.fallback.rejected": "\u547D\u4EE4\u88AB\u62D2\u7EDD",
720
- "error.fallback.unknown": "\u672A\u77E5\u9519\u8BEF",
721
- "error.fallback.unresolved": "Host \u672A\u8BC6\u522B\u8BE5\u547D\u4EE4"
722
- };
723
- var en = {
724
- "meta.title": "DevLead UI",
725
- "meta.description": "Web UI for DevLead mode: the composer-toolbar toggle that switches the mode on or off, the status strip shown while the mode is on, and the active-DevLead and watched-session marks in the sidebar.",
726
- "bar.aria": "DevLead status bar",
727
- "label": "DevLead",
728
- "hint.enabled": "DevLead is on: watched-session turn ends and mid-turn reports notify this session; blocked/decision reports and questions request a wake, while progress/fyi are background context and do not wake.",
729
- "count.watched": "{count} watched",
730
- "count.running": "{count} running",
731
- "count.missing": "{count} unavailable",
732
- "row.mark.aria": "Active DevLead Session",
733
- "row.watched.aria": "Watched by the active DevLead",
734
- "row.hover.enabled": "Active DevLead Session: this session can dispatch and watch other Sessions.",
735
- "row.hover.watched": "Watched by the active DevLead: its turn ends and mid-turn reports notify the lead; blocked/decision reports and questions request a wake, while progress/fyi are background context and do not wake.",
736
- "toggle.label": "DevLead",
737
- "toggle.enable": "Turn on DevLead mode",
738
- "toggle.disable": "Turn off DevLead mode",
739
- "toggle.pending": "Running the DevLead command\u2026",
740
- "toggle.failed": "Could not turn on DevLead mode: {message}",
741
- "toggle.failed.disable": "Could not turn off DevLead mode: {message}",
742
- "toggle.failed.status": "Could not turn on DevLead mode: {message}",
743
- "toggle.failed.status.disable": "Could not turn off DevLead mode: {message}",
744
- "notification.turn": "turn {turn}",
745
- "report.kind.progress": "progress",
746
- "report.kind.blocked": "blocked",
747
- "report.kind.decision": "decision",
748
- "report.kind.question": "question",
749
- "report.kind.fyi": "fyi",
750
- "report.kind.unknown": "report",
751
- "report.question.open": "open",
752
- "report.question.answered": "answered",
753
- "report.question.expired": "expired",
754
- "report.question.cancelled": "cancelled",
755
- "report.question.unknown": "unknown status",
756
- "report.question.provisional": "provisional",
757
- "report.answer.admitted": "admitted",
758
- "report.answer.claimed": "claimed",
759
- "report.answer.presented": "presented",
760
- "report.answer.discarded": "discarded",
761
- "report.answer.failed": "failed",
762
- "report.answer.unknown": "unknown status",
763
- "notification.wake.suppressed": "wake merged",
764
- "notification.wake.merged": "This turn end was merged into a pending action-required report wake; no separate wake was sent.",
765
- "notification.wake.included": "The sent action-required report wake already included this turn end; no separate wake was sent.",
766
- "notification.wake.unknown": "An action-required report wake covers this turn end; no separate wake was sent.",
767
- "transition.completed": "completed",
768
- "transition.error": "failed",
769
- "transition.blocked": "blocked",
770
- "transition.aborted": "cancelled",
771
- "transition.max-tokens": "hit the token limit",
772
- "transition.interrupted": "interrupted",
773
- "transition.forked": "forked",
774
- "transition.unknown": "unknown state",
775
- "error.alreadyActive": "Another Session is already in DevLead mode: {session}. Run /devlead off there first, then enable this Session.",
776
- "error.fallback.transport": "command failed",
777
- "error.fallback.rejected": "command rejected",
778
- "error.fallback.unknown": "unknown error",
779
- "error.fallback.unresolved": "the Host did not recognize the command"
733
+ function joinWin32Path(cwd, segments) {
734
+ const path = `${cwd.replaceAll("/", "\\")}\\${segments.join("\\")}`;
735
+ let prefix;
736
+ let rest;
737
+ const drive = /^[A-Za-z]:\\/u.exec(path);
738
+ if (drive !== null) {
739
+ prefix = drive[0];
740
+ rest = path.slice(3);
741
+ } else if (path.startsWith("\\\\")) {
742
+ prefix = "\\\\";
743
+ rest = path.slice(2);
744
+ } else {
745
+ prefix = "\\";
746
+ rest = path.slice(1);
747
+ }
748
+ const parts = [];
749
+ for (const part of rest.split("\\")) {
750
+ if (part.length === 0 || part === ".") continue;
751
+ if (part === "..") {
752
+ parts.pop();
753
+ continue;
754
+ }
755
+ parts.push(part);
756
+ }
757
+ return `${prefix}${parts.join("\\")}`;
758
+ }
759
+ function boardConfigOf(global) {
760
+ return {
761
+ boardPath: global.boardPath,
762
+ schemaVersion: DEVLEAD_BOARD_SCHEMA_VERSION,
763
+ pathPlatform: global.pathPlatform
764
+ };
765
+ }
766
+ function resolveDevLeadBoardConfig({ sessionId, cwd, global }) {
767
+ if (global !== void 0) {
768
+ if (global.override === true) return boardConfigOf(global);
769
+ if (global.leadSessionId !== void 0) {
770
+ if (global.leadSessionId === sessionId) return boardConfigOf(global);
771
+ } else if (global.override === void 0) {
772
+ return boardConfigOf(global);
773
+ }
774
+ }
775
+ const root = cwd?.trim() ?? "";
776
+ if (root.length === 0) return void 0;
777
+ const platform = global?.pathPlatform ?? detectDevLeadBoardPathPlatform(root);
778
+ if (platform === void 0 || !isAbsoluteWorkspacePath(root, platform)) return void 0;
779
+ return {
780
+ boardPath: joinDevLeadBoardPath(root, platform),
781
+ schemaVersion: DEVLEAD_BOARD_SCHEMA_VERSION,
782
+ pathPlatform: platform
783
+ };
784
+ }
785
+ function resolveDevLeadBoardSessionConfig(sessionId, row, global) {
786
+ if (row === void 0 || row.origin === "subagent" || !devLeadRowEnabled(row)) return void 0;
787
+ return resolveDevLeadBoardConfig({ sessionId, cwd: row.cwd, global });
788
+ }
789
+ function parseDevLeadBoardBytes(bytes, pathPlatform = "posix") {
790
+ if (bytes.byteLength > DEVLEAD_BOARD_MAX_BYTES) {
791
+ throw new DevLeadBoardParseError(`board file exceeds ${DEVLEAD_BOARD_MAX_BYTES} bytes`);
792
+ }
793
+ let text;
794
+ try {
795
+ text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
796
+ } catch (error) {
797
+ throw new DevLeadBoardParseError("board file is not valid UTF-8", { cause: error });
798
+ }
799
+ return parseDevLeadBoard(text, pathPlatform);
800
+ }
801
+ function parseDevLeadBoard(text, pathPlatform = "posix") {
802
+ let value;
803
+ try {
804
+ value = JSON.parse(text);
805
+ } catch (error) {
806
+ throw new DevLeadBoardParseError("board file is not valid JSON", { cause: error });
807
+ }
808
+ const parsed = devLeadBoardSchemaFor(pathPlatform).safeParse(value);
809
+ if (!parsed.success) {
810
+ const first = devLeadBoardIssueViews(parsed.error.issues)[0];
811
+ const pointer = first === void 0 || first.pointer.length === 0 ? "/" : first.pointer;
812
+ throw new DevLeadBoardParseError(
813
+ `board schema v1 validation failed at ${pointer}: ${first?.message ?? "unknown issue"}`,
814
+ { cause: parsed.error }
815
+ );
816
+ }
817
+ return parsed.data;
818
+ }
819
+ var STATUS_ORDER = ["blocked", "active", "paused", "done"];
820
+ var PRIORITY_RANK = { high: 0, medium: 1, low: 2 };
821
+ function compareDevLeadBoardProjects(left, right) {
822
+ return PRIORITY_RANK[left.priority] - PRIORITY_RANK[right.priority] || Date.parse(right.updatedAt) - Date.parse(left.updatedAt) || left.id.localeCompare(right.id);
823
+ }
824
+ function groupDevLeadBoardProjects(board) {
825
+ return STATUS_ORDER.flatMap((status) => {
826
+ const projects = board.projects.filter((project) => project.status === status).sort(compareDevLeadBoardProjects);
827
+ return projects.length === 0 ? [] : [{ status, projects }];
828
+ });
829
+ }
830
+ function summarizeDevLeadBoardProjects(board) {
831
+ const groups = groupDevLeadBoardProjects(board);
832
+ const counts = { active: 0, blocked: 0, paused: 0, done: 0 };
833
+ for (const group of groups) counts[group.status] = group.projects.length;
834
+ return { groups, counts };
835
+ }
836
+ function projectStatusTone(status) {
837
+ switch (status) {
838
+ case "blocked":
839
+ return "warning";
840
+ case "active":
841
+ return "info";
842
+ case "done":
843
+ return "success";
844
+ case "paused":
845
+ return "neutral";
846
+ }
847
+ }
848
+ function taskStatusTone(status) {
849
+ switch (status) {
850
+ case "blocked":
851
+ return "warning";
852
+ case "doing":
853
+ return "info";
854
+ case "done":
855
+ return "success";
856
+ case "todo":
857
+ return "quiet";
858
+ }
859
+ }
860
+ function taskProgress(project) {
861
+ return { done: project.tasks.filter((task) => task.status === "done").length, total: project.tasks.length };
862
+ }
863
+ function truncateSessionId(value) {
864
+ const characters = Array.from(value);
865
+ return characters.length <= 18 ? value : `${characters.slice(0, 10).join("")}\u2026${characters.slice(-5).join("")}`;
866
+ }
867
+ function normalizedWorkspacePath(value, platform) {
868
+ let normalized = platform === "win32" ? value.replaceAll("\\", "/").toLowerCase() : value;
869
+ const root = platform === "win32" ? /^(?:[a-z]:\/|\/+)$/u.test(normalized) : normalized === "/";
870
+ if (!root) normalized = normalized.replace(/\/+$/u, "");
871
+ return normalized;
872
+ }
873
+ function unlistedDevLeadWorkspaces(board, workspaces, sessions, pathPlatform = "posix") {
874
+ const listedPaths = new Set(board.projects.map((project) => normalizedWorkspacePath(project.workspace.path, pathPlatform)));
875
+ return workspaces.filter((workspace) => !listedPaths.has(normalizedWorkspacePath(workspace.path, pathPlatform))).map((workspace) => {
876
+ let latest = Number.NEGATIVE_INFINITY;
877
+ for (const sessionId of workspace.sessionIds) {
878
+ const updatedAt = sessions[sessionId]?.updatedAt;
879
+ if (typeof updatedAt === "number" && Number.isFinite(updatedAt)) latest = Math.max(latest, updatedAt);
880
+ }
881
+ return {
882
+ ...workspace,
883
+ sessionCount: workspace.sessionIds.length,
884
+ ...Number.isFinite(latest) ? { lastActivityAt: new Date(latest).toISOString() } : {}
885
+ };
886
+ }).sort((left, right) => {
887
+ const leftTime = left.lastActivityAt === void 0 ? Number.NEGATIVE_INFINITY : Date.parse(left.lastActivityAt);
888
+ const rightTime = right.lastActivityAt === void 0 ? Number.NEGATIVE_INFINITY : Date.parse(right.lastActivityAt);
889
+ return rightTime - leftTime || left.title.localeCompare(right.title) || left.workspaceId.localeCompare(right.workspaceId);
890
+ });
891
+ }
892
+ function boardRelativeTime(iso, now) {
893
+ const elapsed = Math.max(0, now - Date.parse(iso));
894
+ if (elapsed < 6e4) return { unit: "now", n: 0 };
895
+ if (elapsed < 36e5) return { unit: "minutes", n: Math.floor(elapsed / 6e4) };
896
+ if (elapsed < 864e5) return { unit: "hours", n: Math.floor(elapsed / 36e5) };
897
+ return { unit: "days", n: Math.floor(elapsed / 864e5) };
898
+ }
899
+
900
+ // packages/client-ui/src/client/DevLeadBoardButton.tsx
901
+ var import_jsx_runtime2 = require("react/jsx-runtime");
902
+ function DevLeadBoardTitle({ t }) {
903
+ return t("board.title");
904
+ }
905
+ function DevLeadBoardButton({ onOpen, sessionId, useSessions, t }) {
906
+ const visible = useSessions((snapshot) => resolveDevLeadBoardSessionConfig(sessionId, snapshot.byId[sessionId], currentDevLeadBoardConfig()) !== void 0);
907
+ const label = t("board.open");
908
+ if (!visible) return null;
909
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tooltip, { label, side: "bottom", delayMs: 300, maxWidth: 240, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
910
+ import_dsh_client_ui_primitives2.Button,
911
+ {
912
+ variant: "ghost",
913
+ size: "sm",
914
+ className: "devlead-board-open",
915
+ "aria-label": label,
916
+ "data-devlead-board-open": "true",
917
+ onClick: onOpen,
918
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconGaugeOutlineRegular, { size: 18 })
919
+ }
920
+ ) });
921
+ }
922
+
923
+ // packages/client-ui/src/client/DevLeadBoardPanel.tsx
924
+ var import_react5 = require("react");
925
+ var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
926
+
927
+ // packages/client-ui/src/client/useBoardFile.ts
928
+ var import_react2 = require("react");
929
+
930
+ // packages/client-ui/src/client/useWorkspaceFile.ts
931
+ var import_react = require("react");
932
+ var DISABLED = { status: "disabled", refreshing: false };
933
+ function initialState(config) {
934
+ return config === void 0 ? DISABLED : { status: "loading", refreshing: false };
935
+ }
936
+ function errorMessage(error) {
937
+ return error instanceof Error ? error.message : String(error);
938
+ }
939
+ function isNotFound(result) {
940
+ return !result.ok && result.error.code === "workspace-file/not-found";
941
+ }
942
+ function panelPageActive() {
943
+ if (typeof document === "undefined") return true;
944
+ return document.visibilityState !== "hidden" && (typeof document.hasFocus !== "function" || document.hasFocus());
945
+ }
946
+ function useWorkspaceFile({
947
+ sessionId,
948
+ config,
949
+ files,
950
+ visible = true,
951
+ debounceMs = 120,
952
+ pollMs = 5e3,
953
+ pollMaxMs = 3e4,
954
+ readTimeoutMs = 1e4,
955
+ now = Date.now
956
+ }) {
957
+ const [state, setState] = (0, import_react.useState)(() => initialState(config));
958
+ const [watch, setWatch] = (0, import_react.useState)(config === void 0 ? "disabled" : "connecting");
959
+ const [autoRefresh, setAutoRefresh] = (0, import_react.useState)(() => config === void 0 ? "disabled" : visible && panelPageActive() ? "active" : "paused");
960
+ const [watchGeneration, setWatchGeneration] = (0, import_react.useState)(0);
961
+ const generation = (0, import_react.useRef)(0);
962
+ const readAbort = (0, import_react.useRef)(void 0);
963
+ const readTimeout = (0, import_react.useRef)(void 0);
964
+ const trailingRead = (0, import_react.useRef)(false);
965
+ const refreshRead = (0, import_react.useCallback)((force = false, queueTrailing = false) => {
966
+ if (config === void 0) {
967
+ if (readTimeout.current !== void 0) {
968
+ clearTimeout(readTimeout.current);
969
+ readTimeout.current = void 0;
970
+ }
971
+ generation.current += 1;
972
+ readAbort.current?.abort();
973
+ readAbort.current = void 0;
974
+ setState(DISABLED);
975
+ return;
976
+ }
977
+ if (!force && readAbort.current !== void 0 && !readAbort.current.signal.aborted) {
978
+ if (queueTrailing) trailingRead.current = true;
979
+ return;
980
+ }
981
+ if (readTimeout.current !== void 0) {
982
+ clearTimeout(readTimeout.current);
983
+ readTimeout.current = void 0;
984
+ }
985
+ const request = ++generation.current;
986
+ trailingRead.current = false;
987
+ readAbort.current?.abort();
988
+ const controller = new AbortController();
989
+ readAbort.current = controller;
990
+ const timeout = setTimeout(() => {
991
+ if (readTimeout.current === timeout) readTimeout.current = void 0;
992
+ if (generation.current !== request || controller.signal.aborted) return;
993
+ fail("read", new Error(`${config.fileLabel} read timed out after ${readTimeoutMs} ms`));
994
+ controller.abort();
995
+ }, readTimeoutMs);
996
+ readTimeout.current = timeout;
997
+ setState((previous) => ({
998
+ ...previous,
999
+ status: previous.status === "disabled" ? "loading" : previous.status,
1000
+ refreshing: true
1001
+ }));
1002
+ const settle = (next) => {
1003
+ if (generation.current !== request || controller.signal.aborted) return;
1004
+ setState(next);
1005
+ };
1006
+ const fail = (kind, error) => {
1007
+ if (generation.current !== request || controller.signal.aborted) return;
1008
+ setState((previous) => ({
1009
+ status: "error",
1010
+ error: { kind, message: errorMessage(error) },
1011
+ ...previous.lastSuccessAt === void 0 ? {} : { lastSuccessAt: previous.lastSuccessAt },
1012
+ refreshing: false
1013
+ }));
1014
+ };
1015
+ void (async () => {
1016
+ try {
1017
+ const metadata = await files.stat(sessionId, config.path, controller.signal);
1018
+ if (generation.current !== request || controller.signal.aborted) return;
1019
+ if (!metadata.ok) {
1020
+ if (isNotFound(metadata)) settle({ status: "empty", refreshing: false });
1021
+ else fail("read", metadata.error);
1022
+ return;
1023
+ }
1024
+ const observedAt = new Date(now()).toISOString();
1025
+ if (metadata.value.bytes !== void 0 && metadata.value.bytes > config.maxBytes) {
1026
+ fail("parse", config.parseError(`${config.fileLabel} exceeds ${config.maxBytes} bytes`));
1027
+ return;
1028
+ }
1029
+ const content = await files.readBytes(sessionId, config.path, {}, controller.signal);
1030
+ if (generation.current !== request || controller.signal.aborted) return;
1031
+ if (!content.ok) {
1032
+ if (isNotFound(content)) settle({ status: "empty", refreshing: false });
1033
+ else fail("read", content.error);
1034
+ return;
1035
+ }
1036
+ if (!content.value.eof || content.value.data.byteLength > config.maxBytes) {
1037
+ fail("parse", config.parseError(`${config.fileLabel} is truncated or too large`));
1038
+ return;
1039
+ }
1040
+ let value;
1041
+ try {
1042
+ value = config.parse(content.value.data);
1043
+ } catch (error) {
1044
+ fail("parse", error);
1045
+ return;
1046
+ }
1047
+ settle({
1048
+ status: "ready",
1049
+ value,
1050
+ valuePath: config.path,
1051
+ lastSuccessAt: new Date(now()).toISOString(),
1052
+ observedAt,
1053
+ ...metadata.value.bytes === void 0 ? {} : { observedBytes: metadata.value.bytes },
1054
+ refreshing: false
1055
+ });
1056
+ } catch (error) {
1057
+ if (generation.current !== request || controller.signal.aborted) return;
1058
+ fail("read", error);
1059
+ } finally {
1060
+ clearTimeout(timeout);
1061
+ if (readTimeout.current === timeout) readTimeout.current = void 0;
1062
+ if (readAbort.current === controller) {
1063
+ readAbort.current = void 0;
1064
+ if (trailingRead.current && generation.current === request && !controller.signal.aborted) {
1065
+ trailingRead.current = false;
1066
+ queueMicrotask(() => {
1067
+ if (generation.current === request && !controller.signal.aborted) refreshRead();
1068
+ });
1069
+ }
1070
+ }
1071
+ }
1072
+ })();
1073
+ }, [config, files, now, readTimeoutMs, sessionId]);
1074
+ (0, import_react.useEffect)(() => {
1075
+ if (config === void 0) {
1076
+ setState(DISABLED);
1077
+ setWatch("disabled");
1078
+ return;
1079
+ }
1080
+ setWatch("connecting");
1081
+ let disposed = false;
1082
+ let timer;
1083
+ const watcher = new AbortController();
1084
+ const schedule = () => {
1085
+ if (timer !== void 0) clearTimeout(timer);
1086
+ timer = setTimeout(() => {
1087
+ timer = void 0;
1088
+ refreshRead(false, true);
1089
+ }, debounceMs);
1090
+ };
1091
+ const pump = async () => {
1092
+ try {
1093
+ const stream = files.changes(sessionId, config.path, watcher.signal);
1094
+ try {
1095
+ for await (const frame of stream) {
1096
+ if (disposed) return;
1097
+ if (frame.kind === "ready") {
1098
+ setWatch("live");
1099
+ refreshRead(false, true);
1100
+ } else if (frame.kind === "change") schedule();
1101
+ }
1102
+ } finally {
1103
+ stream.dispose();
1104
+ }
1105
+ } catch {
1106
+ } finally {
1107
+ if (!disposed) setWatch("ended");
1108
+ }
1109
+ };
1110
+ void pump();
1111
+ refreshRead();
1112
+ return () => {
1113
+ disposed = true;
1114
+ if (timer !== void 0) clearTimeout(timer);
1115
+ generation.current += 1;
1116
+ watcher.abort();
1117
+ if (readTimeout.current !== void 0) {
1118
+ clearTimeout(readTimeout.current);
1119
+ readTimeout.current = void 0;
1120
+ }
1121
+ readAbort.current?.abort();
1122
+ };
1123
+ }, [config, debounceMs, files, refreshRead, sessionId, watchGeneration]);
1124
+ (0, import_react.useEffect)(() => {
1125
+ if (config === void 0) {
1126
+ setAutoRefresh("disabled");
1127
+ return;
1128
+ }
1129
+ if (!visible) {
1130
+ setAutoRefresh("paused");
1131
+ return;
1132
+ }
1133
+ if (typeof document === "undefined") {
1134
+ setAutoRefresh("active");
1135
+ refreshRead();
1136
+ return;
1137
+ }
1138
+ const sync = (resume) => {
1139
+ const active = resume && panelPageActive();
1140
+ setAutoRefresh(active ? "active" : "paused");
1141
+ if (active) refreshRead();
1142
+ };
1143
+ const onVisibility = () => {
1144
+ sync(document.visibilityState !== "hidden");
1145
+ };
1146
+ const onFocus = () => {
1147
+ sync(true);
1148
+ };
1149
+ const onBlur = () => {
1150
+ setAutoRefresh("paused");
1151
+ };
1152
+ sync(panelPageActive());
1153
+ document.addEventListener("visibilitychange", onVisibility);
1154
+ window.addEventListener("focus", onFocus);
1155
+ window.addEventListener("blur", onBlur);
1156
+ return () => {
1157
+ document.removeEventListener("visibilitychange", onVisibility);
1158
+ window.removeEventListener("focus", onFocus);
1159
+ window.removeEventListener("blur", onBlur);
1160
+ };
1161
+ }, [config, refreshRead, visible]);
1162
+ (0, import_react.useEffect)(() => {
1163
+ if (config === void 0 || autoRefresh !== "active") return;
1164
+ let delay = pollMs;
1165
+ let timer;
1166
+ const schedule = () => {
1167
+ timer = setTimeout(() => {
1168
+ timer = void 0;
1169
+ refreshRead();
1170
+ if (state.status === "empty" || state.status === "error") delay = Math.min(delay * 2, pollMaxMs);
1171
+ schedule();
1172
+ }, delay);
1173
+ };
1174
+ schedule();
1175
+ return () => {
1176
+ if (timer !== void 0) clearTimeout(timer);
1177
+ };
1178
+ }, [autoRefresh, config, pollMs, pollMaxMs, refreshRead, state.status]);
1179
+ const refresh = (0, import_react.useCallback)(() => {
1180
+ refreshRead(true);
1181
+ if (config !== void 0) setWatchGeneration((current) => current + 1);
1182
+ }, [config, refreshRead]);
1183
+ const staleValue = config !== void 0 && state.valuePath !== void 0 && state.valuePath !== config.path;
1184
+ const currentState = staleValue ? { status: "loading", refreshing: true } : state;
1185
+ return { ...currentState, watch, autoRefresh, refresh };
1186
+ }
1187
+
1188
+ // packages/client-ui/src/client/useBoardFile.ts
1189
+ function useBoardFile({
1190
+ sessionId,
1191
+ config,
1192
+ files,
1193
+ visible = true,
1194
+ debounceMs = 120,
1195
+ pollMs = 5e3,
1196
+ pollMaxMs = 3e4,
1197
+ readTimeoutMs = 1e4,
1198
+ now = Date.now
1199
+ }) {
1200
+ const fileConfig = (0, import_react2.useMemo)(() => config === void 0 ? void 0 : {
1201
+ path: config.boardPath,
1202
+ maxBytes: DEVLEAD_BOARD_MAX_BYTES,
1203
+ fileLabel: "board file",
1204
+ parse: (bytes) => parseDevLeadBoardBytes(bytes, config.pathPlatform),
1205
+ parseError: (message, options) => new DevLeadBoardParseError(message, options)
1206
+ }, [config]);
1207
+ const { value, watch, autoRefresh, refresh, ...state } = useWorkspaceFile({
1208
+ sessionId,
1209
+ config: fileConfig,
1210
+ files,
1211
+ visible,
1212
+ debounceMs,
1213
+ pollMs,
1214
+ pollMaxMs,
1215
+ readTimeoutMs,
1216
+ now
1217
+ });
1218
+ return {
1219
+ ...state,
1220
+ ...value === void 0 ? {} : { board: value },
1221
+ watch,
1222
+ autoRefresh,
1223
+ refresh
1224
+ };
1225
+ }
1226
+
1227
+ // packages/client-ui/src/client/notes.ts
1228
+ var import_react3 = require("react");
1229
+ var DevLeadNotesParseError = class extends Error {
1230
+ constructor(message, options) {
1231
+ super(message, options);
1232
+ this.name = "DevLeadNotesParseError";
1233
+ }
780
1234
  };
1235
+ function decodeUtf8(bytes, label) {
1236
+ try {
1237
+ return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
1238
+ } catch (error) {
1239
+ throw new DevLeadNotesParseError(`${label} is not valid UTF-8`, { cause: error });
1240
+ }
1241
+ }
1242
+ function parseDevLeadNotesIndexBytes(bytes) {
1243
+ if (bytes.byteLength > DEVLEAD_NOTES_INDEX_MAX_BYTES) {
1244
+ throw new DevLeadNotesParseError(`notes index exceeds ${DEVLEAD_NOTES_INDEX_MAX_BYTES} bytes`);
1245
+ }
1246
+ let value;
1247
+ try {
1248
+ value = JSON.parse(decodeUtf8(bytes, "notes index"));
1249
+ } catch (error) {
1250
+ if (error instanceof DevLeadNotesParseError) throw error;
1251
+ throw new DevLeadNotesParseError("notes index is not valid JSON", { cause: error });
1252
+ }
1253
+ try {
1254
+ return parseDevLeadNotesIndex(value);
1255
+ } catch (error) {
1256
+ throw new DevLeadNotesParseError("notes schema v1 validation failed", { cause: error });
1257
+ }
1258
+ }
1259
+ function parseDevLeadNoteBytes(bytes) {
1260
+ if (bytes.byteLength > DEVLEAD_NOTES_NOTE_MAX_BYTES) {
1261
+ throw new DevLeadNotesParseError(`note file exceeds ${DEVLEAD_NOTES_NOTE_MAX_BYTES} bytes`);
1262
+ }
1263
+ return { markdown: decodeUtf8(bytes, "note file") };
1264
+ }
1265
+ function deriveDevLeadNotesPaths(config) {
1266
+ const separator = config.pathPlatform === "win32" ? "\\" : "/";
1267
+ const alternate = config.pathPlatform === "win32" ? "/" : "\\";
1268
+ const cut = Math.max(config.boardPath.lastIndexOf(separator), config.boardPath.lastIndexOf(alternate));
1269
+ let directory = config.boardPath.slice(0, Math.max(0, cut));
1270
+ if (directory.length === 0 && config.pathPlatform === "posix") directory = "/";
1271
+ const root = `${directory}${directory.endsWith(separator) ? "" : separator}${DEVLEAD_NOTES_DIR_NAME}`;
1272
+ return { root, indexPath: `${root}${separator}${DEVLEAD_NOTES_INDEX_FILE_NAME}`, pathPlatform: config.pathPlatform };
1273
+ }
1274
+ function resolveDevLeadNotePath(paths, metadata) {
1275
+ if (metadata.path.length === 0 || metadata.path.includes("\0") || metadata.path.includes("\\") || metadata.path.startsWith("/") || metadata.path.split("/").some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
1276
+ throw new DevLeadNotesParseError("note metadata path escapes the notes root");
1277
+ }
1278
+ const separator = paths.pathPlatform === "win32" ? "\\" : "/";
1279
+ return `${paths.root}${metadata.path.split("/").map((segment) => `${separator}${segment}`).join("")}`;
1280
+ }
1281
+ function devLeadNotesForProject(index, project) {
1282
+ return index.projects.find((candidate) => candidate.id === project.id);
1283
+ }
1284
+ function sortDevLeadNotes(notes) {
1285
+ return [...notes].sort((left, right) => Date.parse(right.updatedAt) - Date.parse(left.updatedAt) || left.id.localeCompare(right.id));
1286
+ }
1287
+ function useDevLeadNotesIndex({ sessionId, config, files, visible = true, debounceMs = 120, pollMs = 5e3, pollMaxMs = 3e4, now = Date.now }) {
1288
+ const paths = (0, import_react3.useMemo)(() => config === void 0 ? void 0 : deriveDevLeadNotesPaths(config), [config]);
1289
+ const fileConfig = (0, import_react3.useMemo)(() => paths === void 0 ? void 0 : {
1290
+ path: paths.indexPath,
1291
+ maxBytes: DEVLEAD_NOTES_INDEX_MAX_BYTES,
1292
+ fileLabel: "notes index",
1293
+ parse: parseDevLeadNotesIndexBytes,
1294
+ parseError: (message, options) => new DevLeadNotesParseError(message, options)
1295
+ }, [paths]);
1296
+ return useWorkspaceFile({ sessionId, config: fileConfig, files, visible, debounceMs, pollMs, pollMaxMs, now });
1297
+ }
1298
+ function useDevLeadNote({ sessionId, paths, metadata, files, visible = true, debounceMs = 120, pollMs = 5e3, pollMaxMs = 3e4, now = Date.now }) {
1299
+ const fileConfig = (0, import_react3.useMemo)(() => {
1300
+ if (paths === void 0 || metadata === void 0) return void 0;
1301
+ return {
1302
+ path: resolveDevLeadNotePath(paths, metadata),
1303
+ maxBytes: DEVLEAD_NOTES_NOTE_MAX_BYTES,
1304
+ fileLabel: "note file",
1305
+ parse: parseDevLeadNoteBytes,
1306
+ parseError: (message, options) => new DevLeadNotesParseError(message, options)
1307
+ };
1308
+ }, [metadata?.id, metadata?.path, paths?.root, paths?.pathPlatform]);
1309
+ return useWorkspaceFile({ sessionId, config: fileConfig, files, visible: visible && metadata !== void 0, debounceMs, pollMs, pollMaxMs, now });
1310
+ }
1311
+
1312
+ // packages/client-ui/src/client/Markdown.tsx
1313
+ var import_react4 = require("react");
1314
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1315
+ function safeDevLeadMarkdownHref(destination) {
1316
+ try {
1317
+ const url = new URL(destination);
1318
+ return url.protocol === "https:" || url.protocol === "http:" ? url.href : void 0;
1319
+ } catch {
1320
+ return void 0;
1321
+ }
1322
+ }
1323
+ function inline(text, context) {
1324
+ if (context.depth > 12) return [text];
1325
+ const nodes = [];
1326
+ let plain = "";
1327
+ let position = 0;
1328
+ let sequence = 0;
1329
+ const flush = () => {
1330
+ if (plain.length === 0) return;
1331
+ nodes.push(plain);
1332
+ plain = "";
1333
+ };
1334
+ const key = (kind) => `${context.prefix}-${kind}-${sequence++}`;
1335
+ const nested = (value, kind) => inline(value, {
1336
+ depth: context.depth + 1,
1337
+ prefix: key(kind)
1338
+ });
1339
+ while (position < text.length) {
1340
+ const rest = text.slice(position);
1341
+ if (rest.startsWith("`")) {
1342
+ const end = text.indexOf("`", position + 1);
1343
+ if (end > position + 1) {
1344
+ flush();
1345
+ nodes.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("code", { children: text.slice(position + 1, end) }, key("code")));
1346
+ position = end + 1;
1347
+ continue;
1348
+ }
1349
+ }
1350
+ if (rest.startsWith("[")) {
1351
+ const match = /^\[([^\]\n]+)\]\(([^)\n]+)\)/u.exec(rest);
1352
+ if (match !== null) {
1353
+ flush();
1354
+ const label = match[1] ?? "";
1355
+ const destination = (match[2] ?? "").trim();
1356
+ const href = safeDevLeadMarkdownHref(destination);
1357
+ if (href === void 0) {
1358
+ nodes.push(match[0]);
1359
+ } else {
1360
+ nodes.push(
1361
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href, target: "_blank", rel: "noreferrer noopener", children: nested(label, "link") }, key("link"))
1362
+ );
1363
+ }
1364
+ position += match[0].length;
1365
+ continue;
1366
+ }
1367
+ }
1368
+ const delimiter = rest.startsWith("**") || rest.startsWith("__") ? rest.slice(0, 2) : rest.startsWith("~~") ? "~~" : rest.startsWith("*") || rest.startsWith("_") ? rest[0] ?? "" : "";
1369
+ if (delimiter.length > 0) {
1370
+ const end = text.indexOf(delimiter, position + delimiter.length);
1371
+ if (end > position + delimiter.length) {
1372
+ const content = text.slice(position + delimiter.length, end);
1373
+ flush();
1374
+ if (delimiter === "**" || delimiter === "__") nodes.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: nested(content, "strong") }, key("strong")));
1375
+ else if (delimiter === "~~") nodes.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("del", { children: nested(content, "del") }, key("del")));
1376
+ else nodes.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("em", { children: nested(content, "em") }, key("em")));
1377
+ position = end + delimiter.length;
1378
+ continue;
1379
+ }
1380
+ }
1381
+ plain += text[position] ?? "";
1382
+ position += 1;
1383
+ }
1384
+ flush();
1385
+ return nodes;
1386
+ }
1387
+ var LIST_PATTERN = /^ {0,3}([-+*]|\d+[.)])\s+(.+)$/u;
1388
+ var HEADING_PATTERN = /^ {0,3}(#{1,6})\s+(.+)$/u;
1389
+ var FENCE_PATTERN = /^ {0,3}(`{3,}|~{3,})(.*)$/u;
1390
+ function blockStart(line) {
1391
+ return HEADING_PATTERN.test(line) || FENCE_PATTERN.test(line) || LIST_PATTERN.test(line) || /^ {0,3}>/u.test(line);
1392
+ }
1393
+ function blocks(source, depth, prefix) {
1394
+ if (depth > 8) return [/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: source }, `${prefix}-deep`)];
1395
+ const lines = source.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n");
1396
+ const output = [];
1397
+ let index = 0;
1398
+ let sequence = 0;
1399
+ const key = (kind) => `${prefix}-${kind}-${sequence++}`;
1400
+ while (index < lines.length) {
1401
+ const line = lines[index] ?? "";
1402
+ if (line.trim().length === 0) {
1403
+ index += 1;
1404
+ continue;
1405
+ }
1406
+ const fence = FENCE_PATTERN.exec(line);
1407
+ if (fence !== null) {
1408
+ const marker = fence[1] ?? "```";
1409
+ const info = (fence[2] ?? "").trim();
1410
+ const content = [];
1411
+ index += 1;
1412
+ while (index < lines.length) {
1413
+ const candidate = lines[index] ?? "";
1414
+ const closing = FENCE_PATTERN.exec(candidate);
1415
+ if (closing !== null && (closing[1] ?? "")[0] === marker[0] && (closing[1] ?? "").length >= marker.length) {
1416
+ index += 1;
1417
+ break;
1418
+ }
1419
+ content.push(candidate);
1420
+ index += 1;
1421
+ }
1422
+ output.push(
1423
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { "data-language": info.length > 0 ? info : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("code", { children: [
1424
+ content.join("\n"),
1425
+ content.length > 0 ? "\n" : ""
1426
+ ] }) }, key("pre"))
1427
+ );
1428
+ continue;
1429
+ }
1430
+ const heading = HEADING_PATTERN.exec(line);
1431
+ if (heading !== null) {
1432
+ const level = Math.min(6, (heading[1] ?? "#").length);
1433
+ output.push((0, import_react4.createElement)(`h${level}`, { key: key("heading") }, ...inline(heading[2] ?? "", {
1434
+ depth: 0,
1435
+ prefix: key("inline")
1436
+ })));
1437
+ index += 1;
1438
+ continue;
1439
+ }
1440
+ if (/^ {0,3}>/u.test(line)) {
1441
+ const quoted = [];
1442
+ while (index < lines.length && /^ {0,3}>/u.test(lines[index] ?? "")) {
1443
+ quoted.push((lines[index] ?? "").replace(/^ {0,3}> ?/u, ""));
1444
+ index += 1;
1445
+ }
1446
+ output.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("blockquote", { children: blocks(quoted.join("\n"), depth + 1, key("quoted")) }, key("quote")));
1447
+ continue;
1448
+ }
1449
+ const list = LIST_PATTERN.exec(line);
1450
+ if (list !== null) {
1451
+ const ordered = /^\d/u.test(list[1] ?? "");
1452
+ const items = [];
1453
+ let start = ordered ? Number.parseInt(list[1] ?? "1", 10) : 1;
1454
+ while (index < lines.length) {
1455
+ const item = LIST_PATTERN.exec(lines[index] ?? "");
1456
+ if (item === null || /^\d/u.test(item[1] ?? "") !== ordered) break;
1457
+ items.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: inline(item[2] ?? "", { depth: 0, prefix: key("item-inline") }) }, key("item")));
1458
+ index += 1;
1459
+ }
1460
+ output.push((0, import_react4.createElement)(ordered ? "ol" : "ul", {
1461
+ key: key("list"),
1462
+ ...ordered && start !== 1 ? { start } : {}
1463
+ }, ...items));
1464
+ continue;
1465
+ }
1466
+ const paragraph = [line];
1467
+ index += 1;
1468
+ while (index < lines.length) {
1469
+ const candidate = lines[index] ?? "";
1470
+ if (candidate.trim().length === 0 || blockStart(candidate)) break;
1471
+ paragraph.push(candidate);
1472
+ index += 1;
1473
+ }
1474
+ output.push(
1475
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: paragraph.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react4.Fragment, { children: [
1476
+ partIndex > 0 && "\n",
1477
+ inline(part, { depth: 0, prefix: key("inline") })
1478
+ ] }, key("line"))) }, key("paragraph"))
1479
+ );
1480
+ }
1481
+ return output;
1482
+ }
1483
+ function DevLeadMarkdown({ markdown, className = "devlead-markdown" }) {
1484
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children: blocks(markdown, 0, "md") });
1485
+ }
1486
+
1487
+ // packages/client-ui/src/client/DevLeadBoardPanel.tsx
1488
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1489
+ function DevLeadBoardPanel({ sessionId, files, useWorkspaces, useSessions, useTabInfo, t }) {
1490
+ const sessions = useSessions((snapshot) => snapshot);
1491
+ const visible = useTabInfo().tab.visible;
1492
+ const summary = sessions.byId[sessionId];
1493
+ const resolved = resolveDevLeadBoardSessionConfig(sessionId, summary, currentDevLeadBoardConfig());
1494
+ const config = (0, import_react5.useMemo)(() => resolved, [resolved?.boardPath, resolved?.pathPlatform]);
1495
+ const { refresh, watch, autoRefresh, ...state } = useBoardFile({ sessionId, config, files, visible });
1496
+ const notesPaths = (0, import_react5.useMemo)(() => config === void 0 ? void 0 : deriveDevLeadNotesPaths(config), [config]);
1497
+ const notesIndex = useDevLeadNotesIndex({ sessionId, config, files, visible });
1498
+ const [selection, setSelection] = (0, import_react5.useState)();
1499
+ (0, import_react5.useEffect)(() => {
1500
+ setSelection(void 0);
1501
+ }, [config?.boardPath]);
1502
+ const readerProjectId = selection?.projectId;
1503
+ const previousReaderProject = (0, import_react5.useRef)(void 0);
1504
+ (0, import_react5.useEffect)(() => {
1505
+ if (typeof document === "undefined") return;
1506
+ if (readerProjectId !== void 0) {
1507
+ document.querySelector(".devlead-notes-back")?.focus();
1508
+ } else if (previousReaderProject.current !== void 0) {
1509
+ const trigger = previousReaderProject.current;
1510
+ for (const button of document.querySelectorAll("[data-devlead-notes-chip]")) {
1511
+ if (button.dataset.devleadNotesChip === trigger) {
1512
+ button.focus();
1513
+ break;
1514
+ }
1515
+ }
1516
+ }
1517
+ previousReaderProject.current = readerProjectId;
1518
+ }, [readerProjectId]);
1519
+ const boardProject = selection === void 0 || state.board === void 0 ? void 0 : state.board.projects.find((project) => project.id === selection.projectId);
1520
+ const notesProject = boardProject === void 0 || notesIndex.value === void 0 ? void 0 : devLeadNotesForProject(notesIndex.value, boardProject);
1521
+ const projectNotes = sortDevLeadNotes(notesProject?.notes ?? []);
1522
+ const metadata = projectNotes.find((note2) => note2.id === selection?.noteId) ?? projectNotes[0];
1523
+ const note = useDevLeadNote({ sessionId, paths: notesPaths, metadata, files, visible: visible && selection !== void 0 });
1524
+ const workspaces = useWorkspaces((snapshot) => snapshot);
1525
+ const [now, setNow] = (0, import_react5.useState)(() => Date.now());
1526
+ (0, import_react5.useEffect)(() => {
1527
+ const timer = setInterval(() => {
1528
+ setNow(Date.now());
1529
+ }, 6e4);
1530
+ return () => {
1531
+ clearInterval(timer);
1532
+ };
1533
+ }, []);
1534
+ const unlisted = state.status === "ready" && state.board !== void 0 ? unlistedDevLeadWorkspaces(state.board, workspaces.items, sessions.byId, config?.pathPlatform) : [];
1535
+ const openNotes = (projectId) => {
1536
+ const project = state.board?.projects.find((candidate) => candidate.id === projectId);
1537
+ if (project === void 0 || notesIndex.value === void 0) return;
1538
+ const latest = sortDevLeadNotes(devLeadNotesForProject(notesIndex.value, project)?.notes ?? [])[0];
1539
+ if (latest !== void 0) setSelection({ projectId, noteId: latest.id });
1540
+ };
1541
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1542
+ DevLeadBoardPanelView,
1543
+ {
1544
+ state,
1545
+ onRefresh: refresh,
1546
+ now,
1547
+ t,
1548
+ unlisted,
1549
+ workspacePhase: workspaces.phase,
1550
+ workspaceError: workspaces.state === "error",
1551
+ sessionPhase: sessions.phase,
1552
+ watch,
1553
+ autoRefresh,
1554
+ notes: notesPaths === void 0 ? void 0 : {
1555
+ paths: notesPaths,
1556
+ index: notesIndex,
1557
+ note,
1558
+ selection,
1559
+ onOpen: openNotes,
1560
+ onSelect: (noteId) => {
1561
+ setSelection((current) => current === void 0 ? current : { ...current, noteId });
1562
+ },
1563
+ onClose: () => {
1564
+ setSelection(void 0);
1565
+ }
1566
+ }
1567
+ }
1568
+ );
1569
+ }
1570
+ function RelativeTime({ iso, now, t, label }) {
1571
+ const relative = boardRelativeTime(iso, now);
1572
+ const text = relative.unit === "now" ? t("board.time.now") : t(`board.time.${relative.unit}`, { count: relative.n });
1573
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("time", { dateTime: iso, title: label === void 0 ? iso : `${label}: ${iso}`, "aria-label": label === void 0 ? void 0 : `${label} ${text}`, children: text });
1574
+ }
1575
+ function ProjectField({ label, text, section, className = "", arrow }) {
1576
+ const empty = text.trim().length === 0;
1577
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1578
+ "div",
1579
+ {
1580
+ className: `devlead-board-field ${className}`.trim(),
1581
+ "data-devlead-board-section": section,
1582
+ "data-empty": empty ? "true" : "false",
1583
+ "aria-label": empty ? void 0 : label,
1584
+ "aria-hidden": empty ? true : void 0,
1585
+ children: [
1586
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-sr-only", children: label }),
1587
+ arrow !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-field-arrow", "aria-hidden": "true", children: arrow }),
1588
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { title: text, children: text })
1589
+ ]
1590
+ }
1591
+ );
1592
+ }
1593
+ function ProjectStatusIcon({ status }) {
1594
+ switch (status) {
1595
+ case "active":
1596
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconPlayOutlineRegular, { size: 13 });
1597
+ case "blocked":
1598
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconWarningOutlineRegular, { size: 13 });
1599
+ case "paused":
1600
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconPauseOutlineRegular, { size: 13 });
1601
+ case "done":
1602
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconCheckCircleOutlineRegular, { size: 13 });
1603
+ }
1604
+ }
1605
+ function ProjectPriorityIcon({ priority, t }) {
1606
+ const label = t(`board.priority.${priority}`);
1607
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label, side: "left", delayMs: 300, openOnClick: true, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1608
+ "span",
1609
+ {
1610
+ className: "devlead-board-priority",
1611
+ "data-devlead-board-priority": priority,
1612
+ role: "img",
1613
+ "aria-label": label,
1614
+ title: label,
1615
+ tabIndex: 0,
1616
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-priority-glyph", "aria-hidden": "true", children: priority === "low" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronDownOutlineRegular, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1617
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronUpOutlineRegular, { size: 14 }),
1618
+ priority === "high" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronUpOutlineRegular, { size: 14 })
1619
+ ] }) })
1620
+ }
1621
+ ) });
1622
+ }
1623
+ function ProjectCard({ project, now, t, notesProject, onOpenNotes }) {
1624
+ const idPrefix = (0, import_react5.useId)();
1625
+ const [tasksOpen, setTasksOpen] = (0, import_react5.useState)(false);
1626
+ const progress = taskProgress(project);
1627
+ const progressText = t("board.tasks.progress", { done: progress.done, total: progress.total });
1628
+ const latestNote = sortDevLeadNotes(notesProject?.notes ?? [])[0];
1629
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1630
+ "article",
1631
+ {
1632
+ className: "devlead-board-card",
1633
+ "data-devlead-board-project": project.id,
1634
+ "data-status": project.status,
1635
+ "data-priority": project.priority,
1636
+ "aria-labelledby": `${idPrefix}-title`,
1637
+ children: [
1638
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "devlead-board-card-header", "data-devlead-board-section": "title", children: [
1639
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-card-heading", children: [
1640
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h5", { id: `${idPrefix}-title`, title: project.workspace.title, children: project.workspace.title }),
1641
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { className: "devlead-board-project-id", title: project.id, children: project.id })
1642
+ ] }),
1643
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectPriorityIcon, { priority: project.priority, t })
1644
+ ] }),
1645
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { className: "devlead-board-workspace", "data-devlead-board-section": "workspace", title: project.workspace.path, children: project.workspace.path }),
1646
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "devlead-board-card-badges", "data-devlead-board-section": "meta", children: latestNote !== void 0 && onOpenNotes !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1647
+ "button",
1648
+ {
1649
+ type: "button",
1650
+ className: "devlead-board-notes-chip",
1651
+ "data-devlead-notes-chip": project.id,
1652
+ "aria-label": t("board.notes.open", { count: notesProject?.notes.length ?? 0, title: latestNote.title }),
1653
+ title: t("board.notes.open", { count: notesProject?.notes.length ?? 0, title: latestNote.title }),
1654
+ onClick: () => {
1655
+ onOpenNotes(project.id);
1656
+ },
1657
+ children: [
1658
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconPlanOutlineRegular, { size: 13 }),
1659
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-notes-chip-label", children: t("board.notes.short") }),
1660
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: notesProject?.notes.length ?? 0 }),
1661
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { title: latestNote.title, children: latestNote.title })
1662
+ ]
1663
+ }
1664
+ ) }),
1665
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectField, { label: t("board.field.focus"), text: project.focus, section: "focus", className: "devlead-board-field-focus" }),
1666
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectField, { label: t("board.field.next"), text: project.next, section: "next", className: "devlead-board-field-next", arrow: "\u2192" }),
1667
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectField, { label: t("board.field.goal"), text: project.goal, section: "goal", className: "devlead-board-field-goal" }),
1668
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "devlead-board-blockers-slot", "data-devlead-board-section": "blockers", "data-empty": project.blockers.length === 0 ? "true" : "false", children: project.blockers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "devlead-board-blockers", "aria-label": t("board.blockers"), children: [
1669
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("h6", { children: [
1670
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconWarningOutlineRegular, { size: 14 }),
1671
+ t("board.blockers")
1672
+ ] }),
1673
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: project.blockers.map((blocker) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1674
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { title: blocker.text, children: blocker.text }),
1675
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-blocker-since", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: blocker.since, now, t, label: t("board.blocker.since") }) })
1676
+ ] }, blocker.id)) })
1677
+ ] }) }),
1678
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-progress", "data-devlead-board-section": "progress", title: progressText, children: [
1679
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-sr-only", children: progressText }),
1680
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1681
+ "progress",
1682
+ {
1683
+ "data-devlead-board-progress": project.id,
1684
+ max: Math.max(1, progress.total),
1685
+ value: progress.done,
1686
+ "aria-label": progressText,
1687
+ "aria-valuetext": progressText
1688
+ }
1689
+ )
1690
+ ] }),
1691
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1692
+ "details",
1693
+ {
1694
+ className: "devlead-board-tasks",
1695
+ "data-devlead-board-section": "tasks",
1696
+ "data-devlead-board-tasks": project.id,
1697
+ "aria-labelledby": `${idPrefix}-tasks`,
1698
+ open: tasksOpen,
1699
+ onToggle: (event) => {
1700
+ setTasksOpen(event.currentTarget.open);
1701
+ },
1702
+ children: [
1703
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("summary", { id: `${idPrefix}-tasks`, "aria-label": t("board.tasks.summary", { done: progress.done, total: progress.total }), children: [
1704
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("board.tasks.details") }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: t("board.tasks.count", { done: progress.done, total: progress.total }) })
1706
+ ] }),
1707
+ project.tasks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "devlead-board-muted", children: t("board.tasks.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: project.tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-task-status": task.status, children: [
1708
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-task-heading", children: [
1709
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-task-title", title: task.title, children: task.title }),
1710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tag, { tone: taskStatusTone(task.status), children: t(`board.task.status.${task.status}`) })
1711
+ ] }),
1712
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-task-meta", children: [
1713
+ task.ownerSessionId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { title: task.ownerSessionId, "aria-label": t("board.task.owner"), children: truncateSessionId(task.ownerSessionId) }),
1714
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: task.updatedAt, now, t })
1715
+ ] })
1716
+ ] }, task.id)) })
1717
+ ]
1718
+ }
1719
+ ),
1720
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { className: "devlead-board-card-footer", "data-devlead-board-section": "footer", children: [
1721
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconClockOutlineRegular, { size: 12 }),
1722
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: project.updatedAt, now, t, label: t("board.project.updated") })
1723
+ ] })
1724
+ ]
1725
+ }
1726
+ );
1727
+ }
1728
+ function ProjectGroup({ group, idPrefix, now, t, notes }) {
1729
+ const headingId = `${idPrefix}-group-${group.status}`;
1730
+ const secondary = group.status === "paused" || group.status === "done";
1731
+ const cards = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "devlead-board-cards", children: group.projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1732
+ ProjectCard,
1733
+ {
1734
+ project,
1735
+ now,
1736
+ t,
1737
+ notesProject: notes?.index.value === void 0 ? void 0 : devLeadNotesForProject(notes.index.value, project),
1738
+ onOpenNotes: notes?.onOpen
1739
+ },
1740
+ project.id
1741
+ )) });
1742
+ if (secondary) {
1743
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { className: "devlead-board-group devlead-board-secondary", "data-board-group": group.status, "aria-labelledby": headingId, children: [
1744
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("h4", { id: headingId, children: [
1745
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t(`board.status.${group.status}`) }),
1746
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tag, { tone: projectStatusTone(group.status), children: group.projects.length })
1747
+ ] }) }),
1748
+ cards
1749
+ ] });
1750
+ }
1751
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "devlead-board-group", "data-board-group": group.status, "aria-labelledby": headingId, children: [
1752
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "devlead-board-group-header", children: [
1753
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { id: headingId, children: t(`board.status.${group.status}`) }),
1754
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tag, { tone: projectStatusTone(group.status), children: group.projects.length })
1755
+ ] }),
1756
+ cards
1757
+ ] });
1758
+ }
1759
+ function NotesState({ kind, t, message }) {
1760
+ const error = kind === "error";
1761
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-notes-state", "data-devlead-notes-state": kind, role: error ? "alert" : "status", children: [
1762
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-state-mark", "aria-hidden": "true", children: error ? "!" : kind === "loading" ? "\xB7\xB7\xB7" : "\u25CB" }),
1763
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: t(`board.notes.${kind}`) }),
1764
+ message !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { title: message, children: message })
1765
+ ] });
1766
+ }
1767
+ function NoteList({ notes, selected, now, t, onSelect }) {
1768
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "devlead-notes-list", "aria-label": t("board.notes.list"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1769
+ "button",
1770
+ {
1771
+ type: "button",
1772
+ "data-devlead-note": note.id,
1773
+ "aria-current": note.id === selected ? "page" : void 0,
1774
+ onClick: () => {
1775
+ onSelect(note.id);
1776
+ },
1777
+ children: [
1778
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: note.title, children: note.title }),
1779
+ note.summary.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { title: note.summary, children: note.summary }),
1780
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: note.updatedAt, now, t })
1781
+ ]
1782
+ }
1783
+ ) }, note.id)) }) });
1784
+ }
1785
+ function DevLeadNotesReader({ project, notesProject, notes, now, t }) {
1786
+ const idPrefix = (0, import_react5.useId)();
1787
+ const sorted = sortDevLeadNotes(notesProject?.notes ?? []);
1788
+ const metadata = sorted.find((note) => note.id === notes.selection?.noteId) ?? sorted[0];
1789
+ const expectedPath = metadata === void 0 ? void 0 : resolveDevLeadNotePath(notes.paths, metadata);
1790
+ const documentReady = notes.note.status === "ready" && notes.note.value !== void 0 && notes.note.valuePath === expectedPath;
1791
+ const liveObservedAt = documentReady ? notes.note.observedAt : void 0;
1792
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "devlead-notes-reader", "data-devlead-notes-reader": project.id, "aria-labelledby": `${idPrefix}-title`, children: [
1793
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "devlead-notes-reader-header", children: [
1794
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label: t("board.notes.back"), side: "right", delayMs: 300, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "ghost", size: "sm", className: "devlead-notes-back", "aria-label": t("board.notes.back"), onClick: notes.onClose, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronLeftOutlineRegular, { size: 16 }) }) }),
1795
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1796
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { id: `${idPrefix}-title`, title: project.workspace.title, children: project.workspace.title }),
1797
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("board.notes.count", { count: sorted.length }) })
1798
+ ] })
1799
+ ] }),
1800
+ notes.index.status === "loading" || notes.index.status === "disabled" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "loading", t }) : notes.index.status === "empty" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "empty", t }) : notes.index.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "error", t, message: notes.index.error?.message }) : metadata === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "empty", t }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-notes-reader-body", children: [
1801
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NoteList, { notes: sorted, selected: metadata.id, now, t, onSelect: notes.onSelect }),
1802
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "devlead-note-document", "data-devlead-note-document": metadata.id, children: [
1803
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1804
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { title: metadata.title, children: metadata.title }),
1805
+ metadata.summary.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: metadata.summary }),
1806
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: liveObservedAt ?? metadata.updatedAt, now, t, label: t("board.project.updated") })
1807
+ ] }),
1808
+ notes.note.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "error", t, message: notes.note.error?.message }) : notes.note.status === "empty" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "note-empty", t }) : !documentReady ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NotesState, { kind: "loading", t }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DevLeadMarkdown, { markdown: notes.note.value?.markdown ?? "" })
1809
+ ] })
1810
+ ] })
1811
+ ] });
1812
+ }
1813
+ function DevLeadBoardPanelView({
1814
+ state,
1815
+ onRefresh,
1816
+ now,
1817
+ t,
1818
+ unlisted = [],
1819
+ workspacePhase = "ready",
1820
+ workspaceError = false,
1821
+ sessionPhase = "ready",
1822
+ watch = "live",
1823
+ autoRefresh = "active",
1824
+ notes
1825
+ }) {
1826
+ const idPrefix = (0, import_react5.useId)();
1827
+ if (state.status === "disabled") return null;
1828
+ const board = state.board;
1829
+ const summary = board === void 0 ? void 0 : summarizeDevLeadBoardProjects(board);
1830
+ const groups = summary?.groups ?? [];
1831
+ const counts = summary?.counts ?? { active: 0, blocked: 0, paused: 0, done: 0 };
1832
+ const blocked = counts.blocked;
1833
+ const refreshState = state.status === "error" ? "error" : autoRefresh === "paused" || watch === "ended" ? "warning" : state.refreshing || state.status === "loading" || watch === "connecting" ? "ongoing" : autoRefresh === "active" && state.status === "ready" ? "done" : "idle";
1834
+ const endedKey = autoRefresh === "active" ? "board.watch.ended" : autoRefresh === "paused" ? "board.watch.ended.paused" : "board.watch.ended.disabled";
1835
+ const statusText = state.status === "error" ? t("board.refresh.error") : watch === "ended" ? t(endedKey) : autoRefresh === "paused" ? t("board.autoRefresh.paused") : state.refreshing || state.status === "loading" ? t("board.refresh.loading") : watch === "connecting" ? t("board.watch.connecting") : t(`board.autoRefresh.${autoRefresh}`);
1836
+ const announcementText = state.status === "error" ? t("board.refresh.error") : watch === "ended" ? t(endedKey) : autoRefresh === "paused" ? t("board.autoRefresh.paused") : watch === "connecting" ? t("board.watch.connecting") : t(`board.autoRefresh.${autoRefresh}`);
1837
+ const readerProject = notes?.selection === void 0 || board === void 0 ? void 0 : board.projects.find((project) => project.id === notes.selection?.projectId);
1838
+ const readerNotesProject = readerProject === void 0 || notes?.index.value === void 0 ? void 0 : devLeadNotesForProject(notes.index.value, readerProject);
1839
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board", "data-devlead-board": "true", "data-state": state.status, "aria-label": t("board.title"), children: [
1840
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "devlead-board-header", children: [
1841
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-header-strip", children: [
1842
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-live", "data-auto-refresh": autoRefresh, title: `${t("board.live")}: ${statusText}`, children: [
1843
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.StateDot, { state: refreshState, size: 8 }),
1844
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-live-label", "aria-hidden": "true", children: t("board.live") }),
1845
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-live-status", "aria-hidden": "true", children: statusText }),
1846
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1847
+ "span",
1848
+ {
1849
+ className: "devlead-sr-only",
1850
+ "data-devlead-board-live-announcement": "true",
1851
+ role: "status",
1852
+ "aria-live": "polite",
1853
+ "aria-atomic": "true",
1854
+ children: announcementText
1855
+ }
1856
+ )
1857
+ ] }),
1858
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-header-actions", children: [
1859
+ board !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-meta", children: [
1860
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "devlead-board-updated", title: `${t("board.updated")}: ${board.updatedAt}`, children: [
1861
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconClockOutlineRegular, { size: 11 }),
1862
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: board.updatedAt, now, t, label: t("board.updated") })
1863
+ ] }),
1864
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-revision", title: t("board.revision.full", { revision: board.revision }), children: t("board.revision", { revision: board.revision }) })
1865
+ ] }),
1866
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label: t("board.refresh.action"), side: "left", delayMs: 300, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1867
+ import_dsh_client_ui_primitives3.Button,
1868
+ {
1869
+ variant: "ghost",
1870
+ size: "sm",
1871
+ className: "devlead-board-refresh",
1872
+ "aria-label": t("board.refresh.action"),
1873
+ "aria-busy": state.refreshing,
1874
+ disabled: state.refreshing,
1875
+ onClick: onRefresh,
1876
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconRefreshOutlineRegular, { size: 15 })
1877
+ }
1878
+ ) })
1879
+ ] })
1880
+ ] }),
1881
+ board !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dl", { className: "devlead-board-kpis", "aria-label": t("board.kpi.aria"), tabIndex: 0, children: ["blocked", "active", "paused", "done"].map((status) => {
1882
+ const count = counts[status];
1883
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1884
+ "div",
1885
+ {
1886
+ "data-devlead-board-kpi": status,
1887
+ "data-tone": status,
1888
+ "data-empty": count === 0 ? "true" : "false",
1889
+ "data-emphasis": status === "blocked" && count > 0 ? "true" : "false",
1890
+ children: [
1891
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("dt", { children: [
1892
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-kpi-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectStatusIcon, { status }) }),
1893
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t(`board.status.${status}`) })
1894
+ ] }),
1895
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { "aria-label": t("board.kpi.value", { status: t(`board.status.${status}`), count }), children: count })
1896
+ ]
1897
+ },
1898
+ status
1899
+ );
1900
+ }) })
1901
+ ] }),
1902
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-content", children: [
1903
+ state.status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-placeholder", role: "status", "data-devlead-board-loading": "true", children: [
1904
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-state-mark", "aria-hidden": "true", children: "\xB7\xB7\xB7" }),
1905
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: t("board.loading") }),
1906
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.loading.description") })
1907
+ ] }),
1908
+ state.status === "empty" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-placeholder", "data-devlead-board-empty": "file", children: [
1909
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-state-mark", "aria-hidden": "true", children: "\u25CB" }),
1910
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: t("board.empty.title") }),
1911
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.empty.description") })
1912
+ ] }),
1913
+ state.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-error", role: "alert", "data-devlead-board-error": state.error?.kind ?? "read", children: [
1914
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-state-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconWarningOutlineRegular, { size: 20 }) }),
1915
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: t(state.error?.kind === "parse" ? "board.error.parse" : "board.error.read") }),
1916
+ state.lastSuccessAt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1917
+ t("board.lastSuccess"),
1918
+ " ",
1919
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: state.lastSuccessAt, now, t })
1920
+ ] }),
1921
+ state.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { className: "devlead-board-error-detail", title: state.error.message, children: state.error.message }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: onRefresh, disabled: state.refreshing, children: [
1923
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconRefreshOutlineRegular, { size: 14 }),
1924
+ t("board.retry")
1925
+ ] })
1926
+ ] }),
1927
+ state.status === "ready" && board !== void 0 && readerProject !== void 0 && notes !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DevLeadNotesReader, { project: readerProject, notesProject: readerNotesProject, notes, now, t }),
1928
+ state.status === "ready" && board !== void 0 && readerProject === void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1929
+ blocked > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-blocked-notice", role: "status", children: [
1930
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconWarningOutlineRegular, { size: 16 }),
1931
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: t("board.blocked.notice", { count: blocked }) })
1932
+ ] }),
1933
+ notes?.index.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-notes-notice", role: "status", title: notes.index.error?.message, children: [
1934
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconListPenOutlineRegular, { size: 13 }),
1935
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("board.notes.unavailable") })
1936
+ ] }),
1937
+ board.projects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-placeholder", "data-devlead-board-empty": "projects", children: [
1938
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "devlead-board-state-mark", "aria-hidden": "true", children: "\u2713" }),
1939
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: t("board.emptyProjects.title") }),
1940
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.emptyProjects.description") })
1941
+ ] }),
1942
+ groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProjectGroup, { group, idPrefix, now, t, notes }, group.status))
1943
+ ] }),
1944
+ readerProject === void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { className: "devlead-board-unlisted devlead-board-secondary", "data-devlead-board-unlisted": "true", "aria-labelledby": `${idPrefix}-unlisted`, children: [
1945
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("summary", { id: `${idPrefix}-unlisted`, children: [
1946
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("board.unlisted.title") }),
1947
+ unlisted.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.Tag, { tone: "quiet", children: unlisted.length })
1948
+ ] }),
1949
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "devlead-board-unlisted-body", children: [
1950
+ state.status !== "ready" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.unlisted.unavailable") }),
1951
+ state.status === "ready" && workspaceError && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { role: "alert", children: t("board.unlisted.error") }),
1952
+ state.status === "ready" && !workspaceError && workspacePhase === "pending" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.unlisted.pending") }),
1953
+ state.status === "ready" && !workspaceError && workspacePhase === "ready" && unlisted.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("board.unlisted.empty") }),
1954
+ state.status === "ready" && !workspaceError && workspacePhase === "ready" && unlisted.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "devlead-board-unlisted-list", children: unlisted.map((workspace) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-devlead-board-unlisted-project": workspace.workspaceId, children: [
1955
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: workspace.title, children: workspace.title }),
1956
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { title: workspace.path, children: workspace.path }),
1957
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1958
+ t("board.unlisted.sessions", { count: workspace.sessionCount }),
1959
+ " \xB7 ",
1960
+ sessionPhase === "pending" && workspace.sessionCount > 0 ? t("board.unlisted.activityPending") : workspace.lastActivityAt === void 0 ? t("board.unlisted.noActivity") : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RelativeTime, { iso: workspace.lastActivityAt, now, t })
1961
+ ] })
1962
+ ] }, workspace.workspaceId)) })
1963
+ ] })
1964
+ ] })
1965
+ ] })
1966
+ ] });
1967
+ }
1968
+
1969
+ // packages/client-ui/src/client/DevLeadIconToggle.tsx
1970
+ var import_react7 = require("react");
1971
+ var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
1972
+
1973
+ // packages/client-ui/src/client/results.ts
1974
+ function presentMessage(value) {
1975
+ if (value === void 0) return void 0;
1976
+ const trimmed = value.trim();
1977
+ return trimmed.length === 0 ? void 0 : trimmed;
1978
+ }
1979
+ function commandFailure(result) {
1980
+ if (!result.ok) {
1981
+ const message2 = presentMessage(result.error.message);
1982
+ return {
1983
+ kind: "transport",
1984
+ ...message2 === void 0 ? {} : { message: message2 },
1985
+ code: result.error.code
1986
+ };
1987
+ }
1988
+ const outcome = result.value?.result;
1989
+ if (outcome === void 0 || outcome.kind !== "error") return void 0;
1990
+ const message = presentMessage(outcome.text);
1991
+ return { kind: "rejected", ...message === void 0 ? {} : { message } };
1992
+ }
1993
+ function unexpectedFailure(error) {
1994
+ const message = error instanceof Error ? presentMessage(error.message) : void 0;
1995
+ return { kind: "unexpected", ...message === void 0 ? {} : { message } };
1996
+ }
1997
+ async function admitCommand(executeCommand, line) {
1998
+ try {
1999
+ const result = await executeCommand(line);
2000
+ if (result.ok && result.value === void 0) return { kind: "unresolved", line };
2001
+ return commandFailure(result);
2002
+ } catch (error) {
2003
+ return unexpectedFailure(error);
2004
+ }
2005
+ }
2006
+ var FAILURE_FALLBACK_KEYS = {
2007
+ transport: "error.fallback.transport",
2008
+ rejected: "error.fallback.rejected",
2009
+ unexpected: "error.fallback.unknown"
2010
+ };
2011
+ var ALREADY_ACTIVE_PREFIX = "Another Session is already in DevLead mode: ";
2012
+ var ALREADY_ACTIVE_INSTRUCTION = ". Run /devlead off there first";
2013
+ var ALREADY_ACTIVE_TAIL = `${ALREADY_ACTIVE_INSTRUCTION}, then enable this Session.`;
2014
+ function alreadyActiveDetails(message) {
2015
+ if (!message.startsWith(ALREADY_ACTIVE_PREFIX)) return void 0;
2016
+ const rest = message.slice(ALREADY_ACTIVE_PREFIX.length);
2017
+ const end = rest.lastIndexOf(ALREADY_ACTIVE_INSTRUCTION);
2018
+ if (end <= 0) return void 0;
2019
+ if (rest.slice(end) !== ALREADY_ACTIVE_TAIL) return void 0;
2020
+ const session = rest.slice(0, end).trim();
2021
+ return session.length === 0 ? void 0 : { session };
2022
+ }
2023
+ function failureMessage(failure, t) {
2024
+ if (failure.kind === "unresolved") return t("error.fallback.unresolved");
2025
+ if (failure.kind === "rejected" && failure.message !== void 0) {
2026
+ const active = alreadyActiveDetails(failure.message);
2027
+ if (active !== void 0) {
2028
+ return t("error.alreadyActive", { session: active.session });
2029
+ }
2030
+ }
2031
+ return failure.message ?? t(FAILURE_FALLBACK_KEYS[failure.kind]);
2032
+ }
2033
+ function createDevLeadAdmissionGate() {
2034
+ let entered = false;
2035
+ return {
2036
+ tryEnter: () => {
2037
+ if (entered) return false;
2038
+ entered = true;
2039
+ return true;
2040
+ },
2041
+ leave: () => {
2042
+ entered = false;
2043
+ }
2044
+ };
2045
+ }
2046
+ var DEVLEAD_ADMISSION_IDLE = { pending: false, failure: null };
2047
+ function devLeadAdmissionReducer(state, action) {
2048
+ switch (action.type) {
2049
+ case "begin":
2050
+ return state.pending && state.failure === null ? state : { pending: true, failure: null };
2051
+ case "settle":
2052
+ return state.pending || state.failure !== action.failure ? { pending: false, failure: action.failure } : state;
2053
+ case "reset":
2054
+ return state.failure === null ? state : { pending: state.pending, failure: null };
2055
+ }
2056
+ }
2057
+
2058
+ // packages/client-ui/src/client/useDevLeadAdmission.ts
2059
+ var import_react6 = require("react");
2060
+ function useDevLeadAdmission(executeCommand, resetKey) {
2061
+ const [state, dispatch] = (0, import_react6.useReducer)(devLeadAdmissionReducer, DEVLEAD_ADMISSION_IDLE);
2062
+ const [gate] = (0, import_react6.useState)(createDevLeadAdmissionGate);
2063
+ const aliveRef = (0, import_react6.useRef)(true);
2064
+ (0, import_react6.useEffect)(() => {
2065
+ aliveRef.current = true;
2066
+ return () => {
2067
+ aliveRef.current = false;
2068
+ };
2069
+ }, []);
2070
+ const resetKeyRef = (0, import_react6.useRef)(resetKey);
2071
+ (0, import_react6.useEffect)(() => {
2072
+ resetKeyRef.current = resetKey;
2073
+ dispatch({ type: "reset" });
2074
+ }, [resetKey]);
2075
+ const run = (line) => {
2076
+ if (!gate.tryEnter()) return;
2077
+ const admittedKey = resetKeyRef.current;
2078
+ dispatch({ type: "begin" });
2079
+ void admitCommand(executeCommand, line).then((failure) => {
2080
+ gate.leave();
2081
+ if (!aliveRef.current) return;
2082
+ const stale = resetKeyRef.current !== admittedKey;
2083
+ dispatch({ type: "settle", failure: stale ? null : failure ?? null });
2084
+ });
2085
+ };
2086
+ return { pending: state.pending, failure: state.failure, run };
2087
+ }
2088
+
2089
+ // packages/client-ui/src/client/DevLeadIconToggle.tsx
2090
+ var import_jsx_runtime5 = require("react/jsx-runtime");
2091
+ function DevLeadIconToggle({ useSession, useProjection, executeCommand, t }) {
2092
+ const subagent = useSession((snapshot) => snapshot.subagent !== null) ?? false;
2093
+ const projection = useProjection(DEVLEAD_PROJECTION_KEY);
2094
+ const enabled = projection?.enabled ?? false;
2095
+ const { pending, failure, run } = useDevLeadAdmission(executeCommand, enabled);
2096
+ const [attempt, setAttempt] = (0, import_react7.useState)("on");
2097
+ if (subagent) return null;
2098
+ if (projection === void 0) return null;
2099
+ const direction = enabled ? "off" : "on";
2100
+ const failureText = failure === null ? null : failureMessage(failure, t);
2101
+ const actionLabel = enabled ? t("toggle.disable") : t("toggle.enable");
2102
+ const failureLabel = failureText === null ? null : t(
2103
+ attempt === "off" ? "toggle.failed.disable" : "toggle.failed",
2104
+ { message: failureText }
2105
+ );
2106
+ const label = failureLabel ?? (pending ? t("toggle.pending") : actionLabel);
2107
+ const status = failureText === null ? null : t(
2108
+ attempt === "off" ? "toggle.failed.status.disable" : "toggle.failed.status",
2109
+ { message: failureText }
2110
+ );
2111
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2112
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2113
+ import_dsh_client_ui_primitives4.Tooltip,
2114
+ {
2115
+ label,
2116
+ side: "top",
2117
+ delayMs: 300,
2118
+ maxWidth: 300,
2119
+ portal: true,
2120
+ openOnClick: failure !== null,
2121
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2122
+ import_dsh_client_ui_primitives4.Button,
2123
+ {
2124
+ variant: "ghost",
2125
+ size: "sm",
2126
+ className: "devlead-toggle",
2127
+ "aria-label": label,
2128
+ "aria-busy": pending,
2129
+ "aria-pressed": enabled,
2130
+ disabled: pending,
2131
+ "data-devlead-toggle": "true",
2132
+ "data-devlead-enabled": enabled ? "true" : "false",
2133
+ "data-devlead-pending": pending ? "true" : "false",
2134
+ "data-devlead-failed": failure === null ? "false" : "true",
2135
+ onClick: () => {
2136
+ setAttempt(direction);
2137
+ run(`/${DEVLEAD_COMMAND_NAME} ${direction}`);
2138
+ },
2139
+ children: [
2140
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconUsersOutlineRegular, { size: 16 }),
2141
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "devlead-toggle-label", children: t("toggle.label") })
2142
+ ]
2143
+ }
2144
+ )
2145
+ }
2146
+ ),
2147
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "devlead-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: status })
2148
+ ] });
2149
+ }
2150
+
2151
+ // packages/client-ui/src/client/DevLeadSessionAccessibleMark.tsx
2152
+ var import_jsx_runtime6 = require("react/jsx-runtime");
2153
+ function DevLeadSessionAccessibleMark({ sessionId, useSessions, t }) {
2154
+ const enabled = useSessions((state) => devLeadRowEnabled(devLeadRowSummaryOf(state.byId, sessionId)));
2155
+ if (!enabled) return null;
2156
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "devlead-sr-only", "data-devlead-row-accessible": "lead", children: t("row.hover.enabled") });
2157
+ }
2158
+
2159
+ // packages/client-ui/src/client/DevLeadSessionHoverMark.tsx
2160
+ var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
2161
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2162
+ function DevLeadSessionHoverMark({ sessionId, useSessions, t }) {
2163
+ const enabled = useSessions((state) => devLeadRowEnabled(devLeadRowSummaryOf(state.byId, sessionId)));
2164
+ const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
2165
+ if (enabled) {
2166
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", children: [
2167
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "devlead-row-hover-active-dot" }) }),
2168
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t("row.hover.enabled") })
2169
+ ] });
2170
+ }
2171
+ if (!watched) return null;
2172
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "devlead-row-hover", "data-devlead-row-hover": "true", "data-devlead-row-watched": "true", children: [
2173
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "devlead-row-hover-glyph", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.IconGoalOutlineRegular, { size: 14 }) }),
2174
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t("row.hover.watched") })
2175
+ ] });
2176
+ }
2177
+
2178
+ // packages/client-ui/src/client/DevLeadSessionMark.tsx
2179
+ var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
2180
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2181
+ function DevLeadSessionMark({ sessionId, useSessions, t }) {
2182
+ const enabled = useSessions((state) => devLeadRowEnabled(devLeadRowSummaryOf(state.byId, sessionId)));
2183
+ const watched = useSessions((state) => devLeadRowWatched(sessionId, state.byId));
2184
+ if (enabled) {
2185
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2186
+ "span",
2187
+ {
2188
+ className: "devlead-row-mark devlead-row-mark-lead",
2189
+ role: "img",
2190
+ "aria-label": t("row.mark.aria"),
2191
+ title: t("row.mark.aria"),
2192
+ "data-devlead-active-mark": "true",
2193
+ "data-devlead-row-mark": "lead",
2194
+ children: [
2195
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.IconSparkleRegular, { size: 10 }),
2196
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "devlead-row-mark-lead-label", "aria-hidden": "true", children: t("row.mark.short") })
2197
+ ]
2198
+ }
2199
+ );
2200
+ }
2201
+ if (!watched) return null;
2202
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2203
+ "span",
2204
+ {
2205
+ className: "devlead-row-mark devlead-row-mark-watched",
2206
+ role: "img",
2207
+ "aria-label": t("row.watched.aria"),
2208
+ "data-devlead-row-mark": "watched",
2209
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.IconGoalOutlineRegular, { size: 13 })
2210
+ }
2211
+ );
2212
+ }
2213
+
2214
+ // packages/client-ui/src/client/locales.ts
2215
+ var zh = {
2216
+ "meta.title": "DevLead \u754C\u9762",
2217
+ "meta.description": "DevLead \u6A21\u5F0F\u7684 Web \u754C\u9762\uFF1A\u6A21\u5F0F\u5F00\u5173\u4E0E\u72B6\u6001\u6761\u3001\u4FA7\u8FB9\u680F\u4F1A\u8BDD\u6807\u8BB0\uFF0C\u4EE5\u53CA\u53EA\u8BFB\u9879\u76EE\u770B\u677F\u3002",
2218
+ "bar.aria": "DevLead \u72B6\u6001\u680F",
2219
+ "label": "DevLead",
2220
+ "hint.enabled": "DevLead \u5DF2\u5F00\u542F\uFF1A\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u7684\u8F6E\u6B21\u7ED3\u675F\u4E0E\u4E2D\u9014\u6C47\u62A5\u4F1A\u901A\u77E5\u672C\u4F1A\u8BDD\uFF1B\u963B\u585E/\u5F85\u51B3\u7B56/\u63D0\u95EE\u4F1A\u8BF7\u6C42\u5524\u9192\uFF0C\u8FDB\u5EA6/\u544A\u77E5\u4EC5\u4F5C\u80CC\u666F\u3001\u4E0D\u5524\u9192\u3002",
2221
+ "count.watched": "\u5DF2\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD",
2222
+ "count.running": "\u8FD0\u884C\u4E2D {count}",
2223
+ "count.missing": "{count} \u4E2A\u5DF2\u4E0D\u53EF\u7528",
2224
+ "row.mark.aria": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD",
2225
+ "row.mark.short": "LEAD",
2226
+ "row.watched.aria": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8",
2227
+ "row.hover.enabled": "\u5F53\u524D\u6FC0\u6D3B\u7684 DevLead \u4F1A\u8BDD\uFF1A\u53EF\u8C03\u5EA6\u5E76\u5173\u6CE8\u5176\u4ED6\u4F1A\u8BDD\u3002",
2228
+ "row.hover.watched": "\u88AB\u5F53\u524D DevLead \u5173\u6CE8\uFF1A\u5B83\u7684\u8F6E\u6B21\u7ED3\u675F\u4E0E\u4E2D\u9014\u6C47\u62A5\u4F1A\u901A\u77E5 lead\uFF1B\u963B\u585E/\u5F85\u51B3\u7B56/\u63D0\u95EE\u4F1A\u8BF7\u6C42\u5524\u9192\uFF0C\u8FDB\u5EA6/\u544A\u77E5\u4EC5\u4F5C\u80CC\u666F\u3001\u4E0D\u5524\u9192\u3002",
2229
+ "toggle.label": "DevLead",
2230
+ "toggle.enable": "\u5F00\u542F DevLead \u6A21\u5F0F",
2231
+ "toggle.disable": "\u5173\u95ED DevLead \u6A21\u5F0F",
2232
+ "toggle.pending": "\u6B63\u5728\u6267\u884C DevLead \u547D\u4EE4\u2026",
2233
+ "toggle.failed": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
2234
+ "toggle.failed.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
2235
+ "toggle.failed.status": "\u5F00\u542F DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
2236
+ "toggle.failed.status.disable": "\u5173\u95ED DevLead \u6A21\u5F0F\u5931\u8D25\uFF1A{message}",
2237
+ "notification.turn": "\u7B2C {turn} \u8F6E",
2238
+ "report.kind.progress": "\u8FDB\u5EA6",
2239
+ "report.kind.blocked": "\u963B\u585E",
2240
+ "report.kind.decision": "\u5F85\u51B3\u7B56",
2241
+ "report.kind.question": "\u63D0\u95EE",
2242
+ "report.kind.fyi": "\u544A\u77E5",
2243
+ "report.kind.unknown": "\u62A5\u544A",
2244
+ "report.question.open": "\u5F85\u56DE\u7B54",
2245
+ "report.question.answered": "\u5DF2\u56DE\u7B54",
2246
+ "report.question.expired": "\u5DF2\u8FC7\u671F",
2247
+ "report.question.cancelled": "\u5DF2\u53D6\u6D88",
2248
+ "report.question.unknown": "\u72B6\u6001\u672A\u77E5",
2249
+ "report.question.provisional": "\u6682\u5B9A",
2250
+ "report.answer.admitted": "\u5DF2\u63A5\u6536",
2251
+ "report.answer.claimed": "\u5DF2\u8BA4\u9886",
2252
+ "report.answer.presented": "\u5DF2\u5448\u73B0",
2253
+ "report.answer.discarded": "\u5DF2\u4E22\u5F03",
2254
+ "report.answer.failed": "\u6295\u9012\u5931\u8D25",
2255
+ "report.answer.unknown": "\u72B6\u6001\u672A\u77E5",
2256
+ "notification.wake.suppressed": "\u5E76\u5165\u62A5\u544A\u5524\u9192",
2257
+ "notification.wake.merged": "\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\u5DF2\u5E76\u5165\u5C1A\u672A\u53D1\u9001\u7684\u9700\u5904\u7406\u62A5\u544A\u5524\u9192\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
2258
+ "notification.wake.included": "\u5DF2\u53D1\u9001\u7684\u9700\u5904\u7406\u62A5\u544A\u5524\u9192\u5DF2\u5305\u542B\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
2259
+ "notification.wake.unknown": "\u9700\u5904\u7406\u62A5\u544A\u7684\u5524\u9192\u5DF2\u8986\u76D6\u672C\u6B21\u8F6E\u6B21\u7ED3\u675F\uFF0C\u4E0D\u518D\u5355\u72EC\u5524\u9192\u3002",
2260
+ "transition.completed": "\u5B8C\u6210",
2261
+ "transition.error": "\u5931\u8D25",
2262
+ "transition.blocked": "\u963B\u585E",
2263
+ "transition.aborted": "\u5DF2\u53D6\u6D88",
2264
+ "transition.max-tokens": "\u8D85\u51FA\u8F93\u51FA\u4E0A\u9650",
2265
+ "transition.interrupted": "\u5DF2\u4E2D\u65AD",
2266
+ "transition.forked": "\u5DF2\u5206\u53C9",
2267
+ "transition.unknown": "\u672A\u77E5\u72B6\u6001",
2268
+ "board.title": "\u9879\u76EE\u770B\u677F",
2269
+ "board.open": "\u6253\u5F00\u9879\u76EE\u770B\u677F",
2270
+ "board.guide": "\u67E5\u770B lead \u7EF4\u62A4\u7684\u9879\u76EE\u72B6\u6001\u3001\u7126\u70B9\u3001\u963B\u585E\u4E0E\u4EFB\u52A1\uFF1B\u7528\u6237\u53EA\u8BFB\u3002",
2271
+ "board.readonly": "\u53EA\u8BFB",
2272
+ "board.revision": "r{revision}",
2273
+ "board.revision.full": "\u770B\u677F\u4FEE\u8BA2\u7248\u672C {revision}",
2274
+ "board.updated": "\u770B\u677F\u66F4\u65B0\u4E8E",
2275
+ "board.live": "Live",
2276
+ "board.autoRefresh.active": "\u81EA\u52A8\u5237\u65B0\u5DF2\u5F00\u542F",
2277
+ "board.autoRefresh.paused": "\u81EA\u52A8\u5237\u65B0\u5DF2\u6682\u505C",
2278
+ "board.autoRefresh.disabled": "\u81EA\u52A8\u5237\u65B0\u5DF2\u5173\u95ED",
2279
+ "board.kpi.aria": "\u9879\u76EE\u72B6\u6001\u6982\u89C8",
2280
+ "board.kpi.value": "{status}\uFF1A{count} \u4E2A\u9879\u76EE",
2281
+ "board.refresh.action": "\u5237\u65B0\u9879\u76EE\u770B\u677F",
2282
+ "board.refresh.loading": "\u6B63\u5728\u8BFB\u53D6\u6700\u65B0\u5185\u5BB9",
2283
+ "board.refresh.error": "\u8BFB\u53D6\u5931\u8D25",
2284
+ "board.refresh.ready": "\u6B63\u5E38",
2285
+ "board.refresh.empty": "\u6682\u65E0\u6570\u636E",
2286
+ "board.watch.connecting": "\u6B63\u5728\u8FDE\u63A5\u6587\u4EF6\u76D1\u542C\uFF0C\u81EA\u52A8\u8F6E\u8BE2\u5DF2\u5F00\u542F",
2287
+ "board.watch.ended": "\u6587\u4EF6\u76D1\u542C\u65AD\u5F00\uFF0C\u81EA\u52A8\u8F6E\u8BE2\u4ECD\u5F00\u542F",
2288
+ "board.watch.ended.paused": "\u6587\u4EF6\u76D1\u542C\u65AD\u5F00\uFF0C\u81EA\u52A8\u8F6E\u8BE2\u5DF2\u6682\u505C",
2289
+ "board.watch.ended.disabled": "\u6587\u4EF6\u76D1\u542C\u65AD\u5F00\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0",
2290
+ "board.time.now": "\u521A\u521A",
2291
+ "board.time.minutes": "{count} \u5206\u949F\u524D",
2292
+ "board.time.hours": "{count} \u5C0F\u65F6\u524D",
2293
+ "board.time.days": "{count} \u5929\u524D",
2294
+ "board.status.active": "\u8FDB\u884C\u4E2D",
2295
+ "board.status.blocked": "\u5DF2\u963B\u585E",
2296
+ "board.status.paused": "\u5DF2\u6682\u505C",
2297
+ "board.status.done": "\u5DF2\u5B8C\u6210",
2298
+ "board.priority.low": "\u4F4E\u4F18\u5148\u7EA7",
2299
+ "board.priority.medium": "\u4E2D\u4F18\u5148\u7EA7",
2300
+ "board.priority.high": "\u9AD8\u4F18\u5148\u7EA7",
2301
+ "board.field.goal": "\u76EE\u6807",
2302
+ "board.field.focus": "\u5F53\u524D\u7126\u70B9",
2303
+ "board.field.next": "\u4E0B\u4E00\u6B65",
2304
+ "board.blockers": "\u963B\u585E\u9879",
2305
+ "board.blocker.since": "\u59CB\u4E8E",
2306
+ "board.tasks.label": "\u4EFB\u52A1\u8FDB\u5EA6",
2307
+ "board.tasks.count": "{done}/{total}",
2308
+ "board.tasks.progress": "\u4EFB\u52A1\u8FDB\u5EA6\uFF1A{total} \u9879\u4E2D\u5DF2\u5B8C\u6210 {done} \u9879",
2309
+ "board.tasks.summary": "\u67E5\u770B\u4EFB\u52A1\u8BE6\u60C5\uFF08{done}/{total} \u5DF2\u5B8C\u6210\uFF09",
2310
+ "board.tasks.details": "\u4EFB\u52A1",
2311
+ "board.tasks.empty": "\u8FD8\u6CA1\u6709\u4EFB\u52A1",
2312
+ "board.notes.open": "\u6253\u5F00\u9879\u76EE\u7B14\u8BB0\uFF0C\u5171 {count} \u7BC7\uFF0C\u6700\u8FD1\uFF1A{title}",
2313
+ "board.notes.short": "\u7B14\u8BB0",
2314
+ "board.notes.count": "{count} \u7BC7\u7B14\u8BB0",
2315
+ "board.notes.list": "\u9879\u76EE\u7B14\u8BB0\u5217\u8868",
2316
+ "board.notes.back": "\u8FD4\u56DE\u9879\u76EE\u770B\u677F",
2317
+ "board.notes.loading": "\u6B63\u5728\u8BFB\u53D6\u9879\u76EE\u7B14\u8BB0\u2026",
2318
+ "board.notes.empty": "\u8FD9\u4E2A\u9879\u76EE\u8FD8\u6CA1\u6709\u7B14\u8BB0",
2319
+ "board.notes.error": "\u9879\u76EE\u7B14\u8BB0\u8BFB\u53D6\u5931\u8D25",
2320
+ "board.notes.note-empty": "\u8FD9\u7BC7\u7B14\u8BB0\u6682\u65F6\u4E0D\u53EF\u7528",
2321
+ "board.notes.unavailable": "\u7B14\u8BB0\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u770B\u677F\u4E0D\u53D7\u5F71\u54CD",
2322
+ "board.task.owner": "\u8D1F\u8D23\u4F1A\u8BDD",
2323
+ "board.task.status.todo": "\u5F85\u529E",
2324
+ "board.task.status.doing": "\u8FDB\u884C\u4E2D",
2325
+ "board.task.status.blocked": "\u5DF2\u963B\u585E",
2326
+ "board.task.status.done": "\u5DF2\u5B8C\u6210",
2327
+ "board.project.updated": "\u66F4\u65B0\u4E8E",
2328
+ "board.loading": "\u6B63\u5728\u8BFB\u53D6\u9879\u76EE\u770B\u677F\u2026",
2329
+ "board.loading.description": "\u6B63\u5728\u540C\u6B65\u9879\u76EE\u3001\u4EFB\u52A1\u4E0E\u963B\u585E\u72B6\u6001\uFF0C\u8BF7\u7A0D\u5019\u3002",
2330
+ "board.empty.title": "\u8FD8\u6CA1\u6709\u770B\u677F\u6570\u636E",
2331
+ "board.empty.description": "lead AI \u9996\u6B21\u901A\u8FC7\u770B\u677F\u5DE5\u5177\u5199\u5165\u540E\uFF0C\u9879\u76EE\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002",
2332
+ "board.emptyProjects.title": "\u770B\u677F\u4E2D\u8FD8\u6CA1\u6709\u9879\u76EE",
2333
+ "board.emptyProjects.description": "\u770B\u677F\u6587\u4EF6\u5DF2\u5C31\u7EEA\uFF1Blead AI \u6DFB\u52A0\u9879\u76EE\u540E\u4F1A\u81EA\u52A8\u5237\u65B0\u3002",
2334
+ "board.error.parse": "\u770B\u677F\u6587\u4EF6\u89E3\u6790\u5931\u8D25",
2335
+ "board.error.read": "\u770B\u677F\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",
2336
+ "board.lastSuccess": "\u6700\u540E\u6210\u529F\u8BFB\u53D6\uFF1A",
2337
+ "board.retry": "\u91CD\u8BD5",
2338
+ "board.blocked.notice": "{count} \u4E2A\u9879\u76EE\u5DF2\u963B\u585E\uFF0C\u8BF7\u4F18\u5148\u5904\u7406\u3002",
2339
+ "board.unlisted.title": "\u672A\u5728\u770B\u677F\u4E2D\u7684\u9879\u76EE",
2340
+ "board.unlisted.empty": "\u6240\u6709\u5DF2\u6CE8\u518C workspace \u90FD\u5DF2\u5728\u770B\u677F\u4E2D\u3002",
2341
+ "board.unlisted.pending": "\u6B63\u5728\u8BFB\u53D6\u5DF2\u6CE8\u518C workspace\u2026",
2342
+ "board.unlisted.error": "\u5DF2\u6CE8\u518C workspace \u6E05\u5355\u8BFB\u53D6\u5931\u8D25\uFF1B\u8BF7\u7A0D\u540E\u91CD\u65B0\u6253\u5F00\u9762\u677F\u91CD\u8BD5\u3002",
2343
+ "board.unlisted.unavailable": "\u770B\u677F\u6587\u4EF6\u5C31\u7EEA\u540E\uFF0C\u8FD9\u91CC\u4F1A\u5217\u51FA\u672A\u5728\u770B\u677F\u4E2D\u7684\u5DF2\u6CE8\u518C workspace\u3002",
2344
+ "board.unlisted.sessions": "{count} \u4E2A\u4F1A\u8BDD",
2345
+ "board.unlisted.activityPending": "\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6D3B\u52A8",
2346
+ "board.unlisted.noActivity": "\u6682\u65E0\u4F1A\u8BDD\u6D3B\u52A8",
2347
+ "error.alreadyActive": "\u53E6\u4E00\u4E2A\u4F1A\u8BDD\u5DF2\u5904\u4E8E DevLead \u6A21\u5F0F\uFF1A{session}\u3002\u8BF7\u5148\u5728\u90A3\u91CC\u6267\u884C /devlead off\uFF0C\u518D\u5F00\u542F\u672C\u4F1A\u8BDD\u3002",
2348
+ "error.fallback.transport": "\u547D\u4EE4\u5931\u8D25",
2349
+ "error.fallback.rejected": "\u547D\u4EE4\u88AB\u62D2\u7EDD",
2350
+ "error.fallback.unknown": "\u672A\u77E5\u9519\u8BEF",
2351
+ "error.fallback.unresolved": "Host \u672A\u8BC6\u522B\u8BE5\u547D\u4EE4"
2352
+ };
2353
+ var en = {
2354
+ "meta.title": "DevLead UI",
2355
+ "meta.description": "Web UI for DevLead mode: the mode toggle and status strip, sidebar Session marks, and the read-only project board.",
2356
+ "bar.aria": "DevLead status bar",
2357
+ "label": "DevLead",
2358
+ "hint.enabled": "DevLead is on: watched-session turn ends and mid-turn reports notify this session; blocked/decision reports and questions request a wake, while progress/fyi are background context and do not wake.",
2359
+ "count.watched": "{count} watched",
2360
+ "count.running": "{count} running",
2361
+ "count.missing": "{count} unavailable",
2362
+ "row.mark.aria": "Active DevLead Session",
2363
+ "row.mark.short": "LEAD",
2364
+ "row.watched.aria": "Watched by the active DevLead",
2365
+ "row.hover.enabled": "Active DevLead Session: this session can dispatch and watch other Sessions.",
2366
+ "row.hover.watched": "Watched by the active DevLead: its turn ends and mid-turn reports notify the lead; blocked/decision reports and questions request a wake, while progress/fyi are background context and do not wake.",
2367
+ "toggle.label": "DevLead",
2368
+ "toggle.enable": "Turn on DevLead mode",
2369
+ "toggle.disable": "Turn off DevLead mode",
2370
+ "toggle.pending": "Running the DevLead command\u2026",
2371
+ "toggle.failed": "Could not turn on DevLead mode: {message}",
2372
+ "toggle.failed.disable": "Could not turn off DevLead mode: {message}",
2373
+ "toggle.failed.status": "Could not turn on DevLead mode: {message}",
2374
+ "toggle.failed.status.disable": "Could not turn off DevLead mode: {message}",
2375
+ "notification.turn": "turn {turn}",
2376
+ "report.kind.progress": "progress",
2377
+ "report.kind.blocked": "blocked",
2378
+ "report.kind.decision": "decision",
2379
+ "report.kind.question": "question",
2380
+ "report.kind.fyi": "fyi",
2381
+ "report.kind.unknown": "report",
2382
+ "report.question.open": "open",
2383
+ "report.question.answered": "answered",
2384
+ "report.question.expired": "expired",
2385
+ "report.question.cancelled": "cancelled",
2386
+ "report.question.unknown": "unknown status",
2387
+ "report.question.provisional": "provisional",
2388
+ "report.answer.admitted": "admitted",
2389
+ "report.answer.claimed": "claimed",
2390
+ "report.answer.presented": "presented",
2391
+ "report.answer.discarded": "discarded",
2392
+ "report.answer.failed": "failed",
2393
+ "report.answer.unknown": "unknown status",
2394
+ "notification.wake.suppressed": "wake merged",
2395
+ "notification.wake.merged": "This turn end was merged into a pending action-required report wake; no separate wake was sent.",
2396
+ "notification.wake.included": "The sent action-required report wake already included this turn end; no separate wake was sent.",
2397
+ "notification.wake.unknown": "An action-required report wake covers this turn end; no separate wake was sent.",
2398
+ "transition.completed": "completed",
2399
+ "transition.error": "failed",
2400
+ "transition.blocked": "blocked",
2401
+ "transition.aborted": "cancelled",
2402
+ "transition.max-tokens": "hit the token limit",
2403
+ "transition.interrupted": "interrupted",
2404
+ "transition.forked": "forked",
2405
+ "transition.unknown": "unknown state",
2406
+ "board.title": "Project board",
2407
+ "board.open": "Open project board",
2408
+ "board.guide": "Read lead-maintained project status, focus, blockers, and tasks. Read-only for people.",
2409
+ "board.readonly": "Read-only",
2410
+ "board.revision": "r{revision}",
2411
+ "board.revision.full": "Board revision {revision}",
2412
+ "board.updated": "Board updated",
2413
+ "board.live": "Live",
2414
+ "board.autoRefresh.active": "Auto refresh on",
2415
+ "board.autoRefresh.paused": "Auto refresh paused",
2416
+ "board.autoRefresh.disabled": "Auto refresh off",
2417
+ "board.kpi.aria": "Project status overview",
2418
+ "board.kpi.value": "{status}: {count} project(s)",
2419
+ "board.refresh.action": "Refresh project board",
2420
+ "board.refresh.loading": "Reading the latest content",
2421
+ "board.refresh.error": "Read failed",
2422
+ "board.refresh.ready": "Up to date",
2423
+ "board.refresh.empty": "No data",
2424
+ "board.watch.connecting": "Connecting file watch; automatic polling is on",
2425
+ "board.watch.ended": "File watch disconnected; automatic polling is still on",
2426
+ "board.watch.ended.paused": "File watch disconnected; automatic polling is paused",
2427
+ "board.watch.ended.disabled": "File watch disconnected; refresh manually",
2428
+ "board.time.now": "just now",
2429
+ "board.time.minutes": "{count} min ago",
2430
+ "board.time.hours": "{count} hr ago",
2431
+ "board.time.days": "{count} d ago",
2432
+ "board.status.active": "Active",
2433
+ "board.status.blocked": "Blocked",
2434
+ "board.status.paused": "Paused",
2435
+ "board.status.done": "Done",
2436
+ "board.priority.low": "Low priority",
2437
+ "board.priority.medium": "Medium priority",
2438
+ "board.priority.high": "High priority",
2439
+ "board.field.goal": "Goal",
2440
+ "board.field.focus": "Focus",
2441
+ "board.field.next": "Next",
2442
+ "board.blockers": "Blockers",
2443
+ "board.blocker.since": "since",
2444
+ "board.tasks.label": "Task progress",
2445
+ "board.tasks.count": "{done}/{total}",
2446
+ "board.tasks.progress": "Task progress: {done} of {total} complete",
2447
+ "board.tasks.summary": "View task details ({done}/{total} done)",
2448
+ "board.tasks.details": "Tasks",
2449
+ "board.tasks.empty": "No tasks yet",
2450
+ "board.notes.open": "Open project notes: {count} note(s), latest: {title}",
2451
+ "board.notes.short": "Notes",
2452
+ "board.notes.count": "{count} note(s)",
2453
+ "board.notes.list": "Project notes",
2454
+ "board.notes.back": "Back to project board",
2455
+ "board.notes.loading": "Reading project notes\u2026",
2456
+ "board.notes.empty": "This project has no notes yet",
2457
+ "board.notes.error": "Could not read project notes",
2458
+ "board.notes.note-empty": "This note is temporarily unavailable",
2459
+ "board.notes.unavailable": "Notes are temporarily unavailable; the board is unaffected",
2460
+ "board.task.owner": "Owner",
2461
+ "board.task.status.todo": "To do",
2462
+ "board.task.status.doing": "Doing",
2463
+ "board.task.status.blocked": "Blocked",
2464
+ "board.task.status.done": "Done",
2465
+ "board.project.updated": "Updated",
2466
+ "board.loading": "Reading the project board\u2026",
2467
+ "board.loading.description": "Syncing projects, tasks, and blockers. This will only take a moment.",
2468
+ "board.empty.title": "No board data yet",
2469
+ "board.empty.description": "Projects appear here after the lead AI first writes through the board tool.",
2470
+ "board.emptyProjects.title": "No projects on the board yet",
2471
+ "board.emptyProjects.description": "The board file is ready; it refreshes after the lead AI adds a project.",
2472
+ "board.error.parse": "Could not parse the board file",
2473
+ "board.error.read": "Could not read the board file",
2474
+ "board.lastSuccess": "Last successful read:",
2475
+ "board.retry": "Retry",
2476
+ "board.blocked.notice": "{count} project(s) blocked. Prioritize these projects.",
2477
+ "board.unlisted.title": "Projects not on the board",
2478
+ "board.unlisted.empty": "Every registered workspace is already on the board.",
2479
+ "board.unlisted.pending": "Reading registered workspaces\u2026",
2480
+ "board.unlisted.error": "Could not read registered workspaces; reopen the panel later to retry.",
2481
+ "board.unlisted.unavailable": "Once the board file is ready, registered workspaces absent from it appear here.",
2482
+ "board.unlisted.sessions": "{count} session(s)",
2483
+ "board.unlisted.activityPending": "Reading Session activity",
2484
+ "board.unlisted.noActivity": "No Session activity",
2485
+ "error.alreadyActive": "Another Session is already in DevLead mode: {session}. Run /devlead off there first, then enable this Session.",
2486
+ "error.fallback.transport": "command failed",
2487
+ "error.fallback.rejected": "command rejected",
2488
+ "error.fallback.unknown": "unknown error",
2489
+ "error.fallback.unresolved": "the Host did not recognize the command"
2490
+ };
2491
+
2492
+ // packages/client-ui/src/client/styles.ts
2493
+ var STYLE_ATTRIBUTE = "data-plugin-css";
2494
+ var STYLE_KEY = "devlead";
2495
+ var styles = `
2496
+ /* Composer-tool row control: the users glyph plus a visible DevLead label. It
2497
+ keeps the 28px control height of the toolbar and sizes horizontally from its
2498
+ content, rather than occupying a fixed square glyph seat. The transparent
2499
+ 1px border is part of the base box (with 1px less padding), so enabling the
2500
+ accent border changes colour only, never the control's size or the toolbar
2501
+ layout. */
2502
+ .devlead-toggle {
2503
+ flex: none;
2504
+ width: auto;
2505
+ height: 28px;
2506
+ padding: 0 9px;
2507
+ border: 1px solid transparent;
2508
+ border-radius: 999px;
2509
+ gap: 6px;
2510
+ color: var(--dsw-alias-label-secondary, GrayText);
2511
+ }
2512
+
2513
+ .devlead-toggle-label {
2514
+ flex: none;
2515
+ font-weight: 500;
2516
+ white-space: nowrap;
2517
+ }
2518
+
2519
+ @media (hover: hover) {
2520
+ .devlead-toggle:hover:not(:disabled):not([data-devlead-failed="true"]) {
2521
+ color: var(--dsw-alias-label-primary, CanvasText);
2522
+ }
2523
+ }
2524
+
2525
+ /* While the mode is on the same button stays in place and reads at full label
2526
+ color, with the business accent as a real border plus a very light halo.
2527
+ The halo is a box-shadow so it cannot add layout width; the border was
2528
+ already reserved (transparent) in the base rule. The failed rule below has
2529
+ the same specificity and wins the colour, so an error never leaves a blue
2530
+ accent behind. */
2531
+ .devlead-toggle[data-devlead-enabled="true"] {
2532
+ color: var(--dsw-alias-label-primary, CanvasText);
2533
+ border-color: var(--dsw-alias-state-business-primary, #4176e6);
2534
+ box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
2535
+ }
2536
+
2537
+ .devlead-toggle[data-devlead-failed="true"] {
2538
+ color: var(--dsw-alias-label-error, #c0392b);
2539
+ border-color: var(--dsw-alias-label-error, #c0392b);
2540
+ box-shadow: none;
2541
+ }
2542
+
2543
+ /* The shell marks an active toolbar control with a subtle fill; the mode is a
2544
+ pressed toggle, not only a colour change, so mirror that affordance. */
2545
+ .devlead-toggle[aria-pressed="true"] {
2546
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
2547
+ }
2548
+
2549
+ /* On a narrow viewport the visible label and the stale-watch warning would
2550
+ squeeze the composer toolbar and the status notice. The toggle keeps its
2551
+ accessible name and icon; the bar keeps the watched/running counts. */
2552
+ @media (max-width: 480px) {
2553
+ .devlead-toggle {
2554
+ padding: 0 7px;
2555
+ gap: 0;
2556
+ }
2557
+
2558
+ .devlead-toggle-label,
2559
+ .devlead-label,
2560
+ .devlead-missing {
2561
+ display: none;
2562
+ }
2563
+
2564
+ .devlead-bar {
2565
+ gap: 6px;
2566
+ padding: 4px 10px;
2567
+ }
2568
+
2569
+ .devlead-meta {
2570
+ gap: 6px;
2571
+ }
2572
+ }
2573
+
2574
+ .devlead-dock {
2575
+ box-sizing: border-box;
2576
+ width: calc(
2577
+ 100% -
2578
+ var(--dsh-composer-side-clearance, 16px) -
2579
+ var(--dsh-composer-side-clearance, 16px) -
2580
+ var(--dsh-composer-dock-inset, 8px) -
2581
+ var(--dsh-composer-dock-inset, 8px) -
2582
+ var(--dsh-composer-dock-inset, 8px) -
2583
+ var(--dsh-composer-dock-inset, 8px)
2584
+ );
2585
+ max-width: calc(var(--dsh-composer-card-max-width, 952px) - 4 * var(--dsh-composer-dock-inset, 8px));
2586
+ margin: 0 auto;
2587
+ }
2588
+
2589
+ /* Menu-surface card: the composer context-stack geometry and elevation triple
2590
+ (stroke + soft light) rather than an extra CSS border, which would double the
2591
+ hairline and add layout width; the blur needs the surface on a background
2592
+ layer, so it is painted by the pseudo-element behind the content. */
2593
+ .devlead-bar {
2594
+ position: relative;
2595
+ isolation: isolate;
2596
+ box-sizing: border-box;
2597
+ display: flex;
2598
+ align-items: center;
2599
+ gap: 8px;
2600
+ width: 100%;
2601
+ min-width: 0;
2602
+ min-height: 34px;
2603
+ margin: 0 auto;
2604
+ padding: 4px 12px;
2605
+ overflow: hidden;
2606
+ border: 0;
2607
+ --dsw-elevation-stroke-color: var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
2608
+ border-radius: var(--dsw-radius-lg, 12px);
2609
+ box-shadow: var(--dsw-elevation-panel, 0 1px 2px rgba(0, 0, 0, 0.08));
2610
+ color: var(--dsw-alias-label-primary, CanvasText);
2611
+ font-size: 13px;
2612
+ line-height: 20px;
2613
+ font-family: inherit;
2614
+ }
2615
+
2616
+ .devlead-bar::before {
2617
+ position: absolute;
2618
+ z-index: -1;
2619
+ inset: 0;
2620
+ border-radius: inherit;
2621
+ background: var(--dsw-specific-menu, Canvas);
2622
+ backdrop-filter: var(--dsw-menu-backdrop-filter, none);
2623
+ content: '';
2624
+ pointer-events: none;
2625
+ }
2626
+
2627
+ .devlead-glyph {
2628
+ display: inline-flex;
2629
+ flex: none;
2630
+ align-items: center;
2631
+ color: var(--dsw-alias-label-tertiary, GrayText);
2632
+ }
2633
+
2634
+ .devlead-label {
2635
+ flex: none;
2636
+ font-weight: 500;
2637
+ color: var(--dsw-alias-label-primary, CanvasText);
2638
+ white-space: nowrap;
2639
+ }
2640
+
2641
+ .devlead-meta {
2642
+ display: inline-flex;
2643
+ flex: none;
2644
+ align-items: center;
2645
+ gap: 10px;
2646
+ color: var(--dsw-alias-label-secondary, GrayText);
2647
+ font-variant-numeric: tabular-nums;
2648
+ white-space: nowrap;
2649
+ }
2650
+
2651
+ .devlead-watched {
2652
+ flex: none;
2653
+ }
2654
+
2655
+ .devlead-running {
2656
+ display: inline-flex;
2657
+ align-items: center;
2658
+ gap: 5px;
2659
+ }
2660
+
2661
+ .devlead-dot {
2662
+ flex: none;
2663
+ width: 6px;
2664
+ height: 6px;
2665
+ border-radius: 999px;
2666
+ background: var(--dsw-alias-label-tertiary, GrayText);
2667
+ }
2668
+
2669
+ .devlead-dot[data-active="true"] {
2670
+ background: var(--dsw-alias-state-success-primary, #2e7d32);
2671
+ }
2672
+
2673
+ .devlead-missing {
2674
+ color: var(--dsw-alias-label-secondary, GrayText);
2675
+ }
2676
+
2677
+ /* One stable live region wrapping the hint or the latest-notification chip so
2678
+ assistive technology announces a new notification as a content change of an
2679
+ existing region, not as a freshly inserted one. */
2680
+ .devlead-notice {
2681
+ display: inline-flex;
2682
+ flex: 1 1 auto;
2683
+ align-items: center;
2684
+ min-width: 0;
2685
+ overflow: hidden;
2686
+ white-space: nowrap;
2687
+ }
2688
+
2689
+ .devlead-hint {
2690
+ flex: 1 1 auto;
2691
+ min-width: 0;
2692
+ overflow: hidden;
2693
+ color: var(--dsw-alias-label-tertiary, GrayText);
2694
+ font-size: 12px;
2695
+ text-overflow: ellipsis;
2696
+ white-space: nowrap;
2697
+ }
2698
+
2699
+ .devlead-notification {
2700
+ display: inline-flex;
2701
+ flex: 1 1 auto;
2702
+ align-items: center;
2703
+ gap: 6px;
2704
+ min-width: 0;
2705
+ overflow: hidden;
2706
+ color: var(--dsw-alias-label-secondary, GrayText);
2707
+ white-space: nowrap;
2708
+ }
2709
+
2710
+ .devlead-notification-dot {
2711
+ flex: none;
2712
+ width: 6px;
2713
+ height: 6px;
2714
+ border-radius: 999px;
2715
+ background: var(--dsw-alias-label-tertiary, GrayText);
2716
+ }
2717
+
2718
+ .devlead-notification-dot[data-transition="completed"] {
2719
+ background: var(--dsw-alias-state-success-primary, #2e7d32);
2720
+ }
2721
+
2722
+ .devlead-notification-dot[data-transition="error"] {
2723
+ background: var(--dsw-alias-state-error-primary, #c0392b);
2724
+ }
2725
+
2726
+ .devlead-notification-dot[data-transition="blocked"],
2727
+ .devlead-notification-dot[data-transition="max-tokens"] {
2728
+ background: var(--dsw-alias-state-warn-primary, #a15c00);
2729
+ }
2730
+
2731
+ /* Report dots follow the delivery lane: the action-required kinds (blocked/
2732
+ decision/question) share the warning ink \u2014 a blocked report is a scheduling
2733
+ fact, not a Host failure, so it must not wear the error red. Background
2734
+ kinds (progress/fyi) keep the default tertiary dot: a non-urgent update
2735
+ reads quieter than a settled outcome. */
2736
+ .devlead-notification-dot[data-report-kind="blocked"],
2737
+ .devlead-notification-dot[data-report-kind="decision"],
2738
+ .devlead-notification-dot[data-report-kind="question"] {
2739
+ background: var(--dsw-alias-state-warn-primary, #a15c00);
2740
+ }
2741
+
2742
+ /* Action-required chips wear the warning ink on the kind label so the strip
2743
+ reads "the lead must act" at a glance; colour only, never layout. */
2744
+ .devlead-notification[data-lane="action-required"] .devlead-notification-label {
2745
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
2746
+ }
2747
+
2748
+ /* Background chips are non-urgent: one uniform opacity step weakens the whole
2749
+ chip (dot, who, label, detail) without touching any box, mirroring the
2750
+ watched-row mark's quieter-ink idiom. */
2751
+ .devlead-notification[data-lane="background"] {
2752
+ opacity: 0.72;
2753
+ }
2754
+
2755
+ .devlead-notification-who {
2756
+ flex: 0 1 auto;
2757
+ min-width: 0;
2758
+ overflow: hidden;
2759
+ color: var(--dsw-alias-label-primary-dimmed, rgba(127, 127, 127, 0.9));
2760
+ text-overflow: ellipsis;
2761
+ }
2762
+
2763
+ .devlead-notification-turn,
2764
+ .devlead-notification-label {
2765
+ flex: none;
2766
+ }
2767
+
2768
+ /* Fold-derived question/answer lifecycle suffix ("answered \xB7 presented"):
2769
+ compact neutral copy \u2014 the kind dot and label carry the urgency, the suffix
2770
+ only states the lifecycle fact. */
2771
+ .devlead-notification-status {
2772
+ flex: none;
2773
+ color: var(--dsw-alias-label-secondary, GrayText);
2774
+ }
2775
+
2776
+ /* A suppressed turn-end wake keeps its transition row; only this marker is
2777
+ weakened. Tertiary ink at the detail size reads as an annotation, and the
2778
+ marker's title carries the localized explanation of which merge rule hit. */
2779
+ .devlead-notification-wake {
2780
+ flex: none;
2781
+ color: var(--dsw-alias-label-tertiary, GrayText);
2782
+ font-size: 12px;
2783
+ }
2784
+
2785
+ /* A turn failure excerpt keeps the error ink; a report's summary/message
2786
+ detail is neutral copy \u2014 the kind dot and localized label carry the
2787
+ semantics, so progress/fyi/question text must not read as a failure. */
2788
+ .devlead-notification-error,
2789
+ .devlead-notification-detail {
2790
+ flex: 0 1 auto;
2791
+ min-width: 0;
2792
+ overflow: hidden;
2793
+ font-size: 12px;
2794
+ text-overflow: ellipsis;
2795
+ }
2796
+
2797
+ .devlead-notification-error {
2798
+ color: var(--dsw-alias-label-error, #c0392b);
2799
+ }
2800
+
2801
+ .devlead-notification-detail {
2802
+ color: var(--dsw-alias-label-secondary, GrayText);
2803
+ }
2804
+
2805
+ /* Visually hidden but announced: the compact toolbar surface has no inline
2806
+ error seat, so its failure text is mirrored into a live region through this
2807
+ class (the shipped visually-hidden idiom used by the chat surfaces). */
2808
+ .devlead-sr-only {
2809
+ position: absolute;
2810
+ width: 1px;
2811
+ height: 1px;
2812
+ overflow: hidden;
2813
+ clip: rect(0 0 0 0);
2814
+ white-space: nowrap;
2815
+ }
2816
+
2817
+ /* Sidebar Session-row marks never change the shell row's border, background,
2818
+ padding, height, position, or selection/focus treatment. Both marks share the
2819
+ trailing seat's inline flex layout: the time label naturally moves left for
2820
+ the active lead's small right-side badge, while hover/focus replaces the whole
2821
+ resting seat with the separate action strip. No absolute positioning means a
2822
+ badge cannot paint over either shell-owned neighbour. */
2823
+ .devlead-row-mark {
2824
+ display: inline-flex;
2825
+ flex: none;
2826
+ align-items: center;
2827
+ color: var(--dsw-alias-label-secondary, GrayText);
2828
+ }
2829
+
2830
+ .devlead-row-mark-lead {
2831
+ gap: 2px;
2832
+ min-height: 12px;
2833
+ padding: 0 3px;
2834
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 68%, transparent);
2835
+ border-radius: 999px;
2836
+ background: var(--dsw-specific-menu, Canvas);
2837
+ color: var(--dsw-alias-state-business-primary, #4176e6);
2838
+ font-size: 7px;
2839
+ font-weight: 700;
2840
+ line-height: 10px;
2841
+ letter-spacing: 0.04em;
2842
+ pointer-events: none;
2843
+ }
2844
+
2845
+ .devlead-row-mark-lead > svg {
2846
+ flex: none;
2847
+ }
2848
+
2849
+ @media (max-width: 480px) {
2850
+ .devlead-row-mark-lead-label {
2851
+ display: none;
2852
+ }
2853
+ }
2854
+
2855
+ /* A watched row uses a quieter target than the active lead's badge: secondary
2856
+ ink at reduced opacity stays legible without competing with selection. */
2857
+ .devlead-row-mark-watched {
2858
+ color: var(--dsw-alias-label-secondary, GrayText);
2859
+ opacity: 0.62;
2860
+ }
2861
+
2862
+ /* Hover-card line explaining the mark; mirrors the shell's hover status rows
2863
+ (12px text on a 20px line) so the card keeps one rhythm. */
2864
+ .devlead-row-hover-active-dot {
2865
+ display: inline-block;
2866
+ flex: none;
2867
+ box-sizing: border-box;
2868
+ width: 8px;
2869
+ height: 8px;
2870
+ border: 1px solid var(--dsw-alias-state-business-primary, #4176e6);
2871
+ border-radius: 999px;
2872
+ }
2873
+
2874
+ .devlead-row-hover {
2875
+ display: flex;
2876
+ align-items: center;
2877
+ gap: 8px;
2878
+ font-size: 12px;
2879
+ line-height: 20px;
2880
+ color: var(--dsw-alias-label-secondary, GrayText);
2881
+ }
2882
+
2883
+ .devlead-row-hover-glyph {
2884
+ display: inline-flex;
2885
+ flex: none;
2886
+ align-items: center;
2887
+ }
2888
+
2889
+ /* Read-only board: quiet operational typography, no decorative gradients.
2890
+ Container queries follow the actual pane: 1 / 2 / 3 columns as room allows. */
2891
+ .devlead-board-open {
2892
+ display: inline-flex;
2893
+ flex: none;
2894
+ align-items: center;
2895
+ justify-content: center;
2896
+ width: 28px;
2897
+ height: 28px;
2898
+ padding: 0;
2899
+ color: var(--dsw-alias-label-primary, CanvasText);
2900
+ }
2901
+
2902
+ .devlead-board-open > svg {
2903
+ flex: none;
2904
+ }
2905
+
2906
+ .devlead-board,
2907
+ .devlead-board * {
2908
+ box-sizing: border-box;
2909
+ }
2910
+
2911
+ .devlead-board {
2912
+ container: devlead-board / inline-size;
2913
+ display: flex;
2914
+ flex-direction: column;
2915
+ width: 100%;
2916
+ max-width: 100%;
2917
+ min-width: 0;
2918
+ height: 100%;
2919
+ overflow: hidden;
2920
+ background: var(--dsw-specific-menu, Canvas);
2921
+ color: var(--dsw-alias-label-primary, CanvasText);
2922
+ font-family: inherit;
2923
+ font-size: 13px;
2924
+ line-height: 19px;
2925
+ }
2926
+
2927
+ .devlead-board-header {
2928
+ flex: none;
2929
+ min-width: 0;
2930
+ padding: 10px 11px 9px;
2931
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
2932
+ background: var(--dsw-specific-menu, Canvas);
2933
+ }
2934
+
2935
+ .devlead-board-header-strip,
2936
+ .devlead-board-header-actions,
2937
+ .devlead-board-live,
2938
+ .devlead-board-meta,
2939
+ .devlead-board-card-header,
2940
+ .devlead-board-card-badges,
2941
+ .devlead-board-task-heading,
2942
+ .devlead-board-task-meta,
2943
+ .devlead-board-progress-heading {
2944
+ display: flex;
2945
+ min-width: 0;
2946
+ align-items: center;
2947
+ }
2948
+
2949
+ .devlead-board-card-heading h5,
2950
+ .devlead-board-group h4,
2951
+ .devlead-board-placeholder h4,
2952
+ .devlead-board-error h4,
2953
+ .devlead-board-blockers h6,
2954
+ .devlead-notes-state h4 {
2955
+ min-width: 0;
2956
+ margin: 0;
2957
+ font: inherit;
2958
+ font-weight: 650;
2959
+ }
2960
+
2961
+ .devlead-board-refresh,
2962
+ .devlead-notes-back {
2963
+ flex: none;
2964
+ width: 28px;
2965
+ border-radius: var(--dsw-radius-md, 8px);
2966
+ color: var(--dsw-alias-label-secondary, GrayText);
2967
+ transition: color 120ms ease, background-color 120ms ease;
2968
+ }
2969
+
2970
+ .devlead-board-refresh[aria-busy="true"] > svg {
2971
+ animation: devlead-board-spin 1s linear infinite;
2972
+ }
2973
+
2974
+ @keyframes devlead-board-spin {
2975
+ to { transform: rotate(360deg); }
2976
+ }
2977
+
2978
+ .devlead-board-header-strip {
2979
+ flex-wrap: wrap;
2980
+ justify-content: space-between;
2981
+ gap: 3px 10px;
2982
+ }
2983
+
2984
+ .devlead-board-header-actions {
2985
+ flex: 0 1 auto;
2986
+ justify-content: flex-end;
2987
+ gap: 5px;
2988
+ margin-left: auto;
2989
+ }
2990
+
2991
+ .devlead-board-live {
2992
+ flex: 1 1 180px;
2993
+ gap: 5px;
2994
+ overflow: hidden;
2995
+ color: var(--dsw-alias-label-secondary, GrayText);
2996
+ font-size: 10px;
2997
+ line-height: 16px;
2998
+ }
2999
+
3000
+ .devlead-board-live-label {
3001
+ flex: none;
3002
+ color: var(--dsw-alias-label-primary, CanvasText);
3003
+ font-size: 9px;
3004
+ font-weight: 700;
3005
+ letter-spacing: 0.06em;
3006
+ text-transform: uppercase;
3007
+ }
3008
+
3009
+ .devlead-board-live-status {
3010
+ min-width: 0;
3011
+ overflow: hidden;
3012
+ text-overflow: ellipsis;
3013
+ white-space: nowrap;
3014
+ }
3015
+
3016
+ .devlead-board-live[data-auto-refresh="paused"] {
3017
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3018
+ }
3019
+
3020
+ .devlead-board-meta {
3021
+ flex: 0 1 auto;
3022
+ justify-content: flex-end;
3023
+ gap: 7px;
3024
+ color: var(--dsw-alias-label-tertiary, GrayText);
3025
+ font-size: 10px;
3026
+ line-height: 16px;
3027
+ }
3028
+
3029
+ .devlead-board-updated {
3030
+ display: inline-flex;
3031
+ min-width: 0;
3032
+ align-items: center;
3033
+ gap: 3px;
3034
+ white-space: nowrap;
3035
+ }
3036
+
3037
+ .devlead-board-revision {
3038
+ flex: none;
3039
+ padding: 0 5px;
3040
+ border-radius: var(--dsw-radius-sm, 4px);
3041
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
3042
+ color: var(--dsw-alias-label-secondary, GrayText);
3043
+ font-variant-numeric: tabular-nums;
3044
+ }
3045
+
3046
+ .devlead-board-kpis {
3047
+ display: flex;
3048
+ min-width: 0;
3049
+ gap: 6px;
3050
+ margin: 8px 0 0;
3051
+ overflow-x: auto;
3052
+ scrollbar-width: none;
3053
+ }
3054
+
3055
+ .devlead-board-kpis::-webkit-scrollbar {
3056
+ display: none;
3057
+ }
3058
+
3059
+ .devlead-board-kpis:focus-visible {
3060
+ outline: 2px solid var(--dsw-alias-state-business-primary, #4176e6);
3061
+ outline-offset: 2px;
3062
+ }
3063
+
3064
+ /* One status vocabulary across KPI, banner, and card: active=business blue,
3065
+ blocked=warning amber, paused=neutral, done=success green. Priority never
3066
+ selects these colors. Empty counts retreat to neutral ink; only a non-zero
3067
+ blocked count earns the stronger fill and halo. */
3068
+ .devlead-board-kpis > div {
3069
+ display: inline-flex;
3070
+ flex: 1 0 auto;
3071
+ min-width: 0;
3072
+ min-height: 28px;
3073
+ align-items: center;
3074
+ justify-content: center;
3075
+ gap: 7px;
3076
+ margin: 0;
3077
+ padding: 3px 9px;
3078
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3079
+ border-radius: 999px;
3080
+ background: color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 2%, transparent);
3081
+ }
3082
+
3083
+ .devlead-board-kpis dt {
3084
+ display: inline-flex;
3085
+ min-width: 0;
3086
+ align-items: center;
3087
+ gap: 4px;
3088
+ overflow: hidden;
3089
+ color: var(--dsw-alias-label-secondary, GrayText);
3090
+ font-size: 11px;
3091
+ line-height: 18px;
3092
+ white-space: nowrap;
3093
+ }
3094
+
3095
+ .devlead-board-kpi-icon {
3096
+ display: inline-flex;
3097
+ flex: none;
3098
+ align-items: center;
3099
+ }
3100
+
3101
+ .devlead-board-kpis dd {
3102
+ flex: none;
3103
+ margin: 0;
3104
+ color: var(--dsw-alias-label-primary, CanvasText);
3105
+ font-size: 14px;
3106
+ line-height: 18px;
3107
+ font-variant-numeric: tabular-nums;
3108
+ font-weight: 700;
3109
+ }
3110
+
3111
+ .devlead-board-kpis > div[data-tone="active"] {
3112
+ border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 42%, transparent);
3113
+ background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 5%, transparent);
3114
+ }
3115
+
3116
+ .devlead-board-kpis > div[data-tone="active"] dd,
3117
+ .devlead-board-kpis > div[data-tone="active"] .devlead-board-kpi-icon {
3118
+ color: var(--dsw-alias-state-business-primary, #4176e6);
3119
+ }
3120
+
3121
+ .devlead-board-kpis > div[data-tone="blocked"] {
3122
+ border-color: var(--dsw-alias-state-warn-primary, #a15c00);
3123
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 6%, transparent);
3124
+ }
3125
+
3126
+ .devlead-board-kpis > div[data-tone="blocked"] dd,
3127
+ .devlead-board-kpis > div[data-tone="blocked"] dt {
3128
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3129
+ }
3130
+
3131
+ .devlead-board-kpis > div[data-tone="blocked"][data-emphasis="true"] {
3132
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 12%, transparent);
3133
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 12%, transparent);
3134
+ }
3135
+
3136
+ .devlead-board-kpis > div[data-tone="done"] {
3137
+ border-color: color-mix(in srgb, var(--dsw-alias-state-success-primary, #2e7d32) 38%, transparent);
3138
+ }
3139
+
3140
+ .devlead-board-kpis > div[data-tone="done"] dd,
3141
+ .devlead-board-kpis > div[data-tone="done"] .devlead-board-kpi-icon {
3142
+ color: var(--dsw-alias-state-success-primary, #2e7d32);
3143
+ }
3144
+
3145
+ .devlead-board-kpis > div[data-empty="true"] {
3146
+ border-color: var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3147
+ background: transparent;
3148
+ box-shadow: none;
3149
+ }
3150
+
3151
+ .devlead-board-kpis > div[data-empty="true"] dt,
3152
+ .devlead-board-kpis > div[data-empty="true"] dd,
3153
+ .devlead-board-kpis > div[data-empty="true"] .devlead-board-kpi-icon {
3154
+ color: var(--dsw-alias-label-tertiary, GrayText);
3155
+ }
3156
+
3157
+ .devlead-board-content {
3158
+ flex: 1 1 auto;
3159
+ min-width: 0;
3160
+ min-height: 0;
3161
+ padding: 9px;
3162
+ overflow-x: hidden;
3163
+ overflow-y: auto;
3164
+ overscroll-behavior: contain;
3165
+ }
3166
+
3167
+ .devlead-board-placeholder,
3168
+ .devlead-board-error,
3169
+ .devlead-notes-state {
3170
+ display: flex;
3171
+ align-items: center;
3172
+ max-width: 100%;
3173
+ min-height: 150px;
3174
+ margin: 5px 0;
3175
+ padding: 24px 16px;
3176
+ overflow: hidden;
3177
+ border: 1px dashed var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3178
+ border-radius: var(--dsw-radius-lg, 12px);
3179
+ color: var(--dsw-alias-label-secondary, GrayText);
3180
+ text-align: center;
3181
+ flex-direction: column;
3182
+ justify-content: center;
3183
+ }
3184
+
3185
+ .devlead-board-state-mark {
3186
+ display: inline-flex;
3187
+ align-items: center;
3188
+ justify-content: center;
3189
+ width: 34px;
3190
+ height: 34px;
3191
+ margin-bottom: 8px;
3192
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3193
+ border-radius: 999px;
3194
+ color: var(--dsw-alias-label-secondary, GrayText);
3195
+ font-size: 17px;
3196
+ line-height: 1;
3197
+ }
3198
+
3199
+ .devlead-board-placeholder p,
3200
+ .devlead-board-error p,
3201
+ .devlead-board-unlisted-body p {
3202
+ max-width: 42ch;
3203
+ margin: 5px 0 0;
3204
+ overflow-wrap: anywhere;
3205
+ }
3206
+
3207
+ .devlead-board-error {
3208
+ border-style: solid;
3209
+ border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary, #c0392b) 60%, transparent);
3210
+ color: var(--dsw-alias-label-error, #c0392b);
3211
+ }
3212
+
3213
+ .devlead-board-error-detail,
3214
+ .devlead-notes-state code {
3215
+ display: -webkit-box;
3216
+ max-width: 100%;
3217
+ margin: 9px 0;
3218
+ overflow: hidden;
3219
+ overflow-wrap: anywhere;
3220
+ color: var(--dsw-alias-label-secondary, GrayText);
3221
+ font-family: inherit;
3222
+ font-size: 11px;
3223
+ white-space: pre-wrap;
3224
+ -webkit-box-orient: vertical;
3225
+ -webkit-line-clamp: 4;
3226
+ }
3227
+
3228
+ .devlead-board-blocked-notice {
3229
+ display: flex;
3230
+ align-items: flex-start;
3231
+ gap: 7px;
3232
+ margin-bottom: 9px;
3233
+ padding: 8px 10px;
3234
+ border: 1px solid var(--dsw-alias-state-warn-primary, #a15c00);
3235
+ border-radius: var(--dsw-radius-md, 8px);
3236
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 10%, transparent);
3237
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3238
+ }
3239
+
3240
+ .devlead-board-blocked-notice > svg {
3241
+ flex: none;
3242
+ margin-top: 2px;
3243
+ }
3244
+
3245
+ .devlead-board-blocked-notice > strong {
3246
+ overflow-wrap: anywhere;
3247
+ font-weight: 650;
3248
+ }
3249
+
3250
+ .devlead-board-notes-notice {
3251
+ display: flex;
3252
+ align-items: center;
3253
+ gap: 5px;
3254
+ margin: 0 2px 8px;
3255
+ color: var(--dsw-alias-label-tertiary, GrayText);
3256
+ font-size: 11px;
3257
+ }
3258
+
3259
+ .devlead-board-group {
3260
+ min-width: 0;
3261
+ max-width: 100%;
3262
+ }
3263
+
3264
+ .devlead-board-group + .devlead-board-group {
3265
+ margin-top: 12px;
3266
+ }
3267
+
3268
+ .devlead-board-group-header {
3269
+ display: flex;
3270
+ align-items: center;
3271
+ justify-content: space-between;
3272
+ gap: 7px;
3273
+ margin: 0 2px 6px;
3274
+ color: var(--dsw-alias-label-secondary, GrayText);
3275
+ }
3276
+
3277
+ .devlead-board-group-header h4 {
3278
+ overflow: hidden;
3279
+ font-size: 11px;
3280
+ letter-spacing: 0.045em;
3281
+ text-overflow: ellipsis;
3282
+ text-transform: uppercase;
3283
+ white-space: nowrap;
3284
+ }
3285
+
3286
+ .devlead-board-group[data-board-group="blocked"] > .devlead-board-group-header h4 {
3287
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3288
+ }
3289
+
3290
+ .devlead-board-cards {
3291
+ display: grid;
3292
+ grid-template-columns: minmax(0, 1fr);
3293
+ grid-auto-rows: 1fr;
3294
+ gap: 8px;
3295
+ min-width: 0;
3296
+ }
3297
+
3298
+ .devlead-board-card {
3299
+ position: relative;
3300
+ display: flex;
3301
+ flex-direction: column;
3302
+ min-width: 0;
3303
+ max-width: 100%;
3304
+ height: 100%;
3305
+ padding: 9px 10px 8px;
3306
+ overflow: hidden;
3307
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3308
+ border-radius: var(--dsw-radius-md, 8px);
3309
+ background: var(--dsw-specific-menu, Canvas);
3310
+ transition: box-shadow 120ms ease;
3311
+ }
3312
+
3313
+ /* The complete four-side border and tinted surface belong to status alone.
3314
+ The existing priority Tag is the independent priority cue; no data-priority
3315
+ selector may recolor a card. */
3316
+ .devlead-board-card[data-status="active"] {
3317
+ border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 62%, transparent);
3318
+ background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 4%, var(--dsw-specific-menu, Canvas));
3319
+ }
3320
+
3321
+ .devlead-board-card[data-status="blocked"] {
3322
+ border-color: var(--dsw-alias-state-warn-primary, #a15c00);
3323
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 7%, var(--dsw-specific-menu, Canvas));
3324
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 12%, transparent);
3325
+ }
3326
+
3327
+ .devlead-board-card[data-status="paused"] {
3328
+ border-color: color-mix(in srgb, var(--dsw-alias-label-secondary, GrayText) 46%, transparent);
3329
+ background: color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 2%, var(--dsw-specific-menu, Canvas));
3330
+ }
3331
+
3332
+ .devlead-board-card[data-status="done"] {
3333
+ border-color: color-mix(in srgb, var(--dsw-alias-state-success-primary, #2e7d32) 52%, transparent);
3334
+ background: color-mix(in srgb, var(--dsw-alias-state-success-primary, #2e7d32) 3%, var(--dsw-specific-menu, Canvas));
3335
+ }
3336
+
3337
+ .devlead-board-card-header {
3338
+ align-items: center;
3339
+ gap: 6px;
3340
+ }
3341
+
3342
+ .devlead-board-card-heading {
3343
+ display: grid;
3344
+ flex: 1 1 auto;
3345
+ grid-template-columns: minmax(0, auto) minmax(0, 1fr);
3346
+ align-items: center;
3347
+ gap: 5px;
3348
+ min-width: 0;
3349
+ }
3350
+
3351
+ .devlead-board-priority {
3352
+ display: inline-flex;
3353
+ flex: none;
3354
+ align-items: center;
3355
+ justify-content: center;
3356
+ width: 16px;
3357
+ height: 19px;
3358
+ color: var(--dsw-alias-label-tertiary, GrayText);
3359
+ }
3360
+
3361
+ .devlead-board-priority-glyph {
3362
+ display: inline-flex;
3363
+ flex-direction: column;
3364
+ align-items: center;
3365
+ justify-content: center;
3366
+ width: 16px;
3367
+ height: 19px;
3368
+ }
3369
+
3370
+ .devlead-board-priority-glyph > svg {
3371
+ flex: none;
3372
+ }
3373
+
3374
+ .devlead-board-priority-glyph > svg + svg {
3375
+ margin-top: -9px;
3376
+ }
3377
+
3378
+ .devlead-board-priority[data-devlead-board-priority="high"] {
3379
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3380
+ }
3381
+
3382
+ .devlead-board-priority[data-devlead-board-priority="medium"] {
3383
+ color: var(--dsw-alias-state-business-primary, #4176e6);
3384
+ }
3385
+
3386
+ .devlead-board-card-heading h5 {
3387
+ overflow: hidden;
3388
+ font-size: 13px;
3389
+ line-height: 19px;
3390
+ text-overflow: ellipsis;
3391
+ white-space: nowrap;
3392
+ }
3393
+
3394
+ .devlead-board-project-id {
3395
+ overflow: hidden;
3396
+ color: var(--dsw-alias-label-tertiary, GrayText);
3397
+ font-family: inherit;
3398
+ font-size: 9px;
3399
+ text-overflow: ellipsis;
3400
+ white-space: nowrap;
3401
+ }
3402
+
3403
+ .devlead-board-workspace {
3404
+ display: block;
3405
+ margin: 1px 0 0;
3406
+ overflow: hidden;
3407
+ color: var(--dsw-alias-label-tertiary, GrayText);
3408
+ font-family: inherit;
3409
+ font-size: 10px;
3410
+ line-height: 15px;
3411
+ text-overflow: ellipsis;
3412
+ white-space: nowrap;
3413
+ }
3414
+
3415
+ .devlead-board-card-badges {
3416
+ flex-wrap: wrap;
3417
+ gap: 4px;
3418
+ min-width: 0;
3419
+ min-height: 28px;
3420
+ max-width: 100%;
3421
+ padding-top: 5px;
3422
+ }
3423
+
3424
+ .devlead-board-card-badges:empty {
3425
+ min-height: 0;
3426
+ padding-top: 0;
3427
+ }
3428
+
3429
+ .devlead-board-card-badges > span {
3430
+ font-size: 10px;
3431
+ }
3432
+
3433
+ .devlead-board-notes-chip {
3434
+ display: inline-flex;
3435
+ flex: 0 1 auto;
3436
+ align-items: center;
3437
+ gap: 4px;
3438
+ min-width: 0;
3439
+ max-width: 100%;
3440
+ min-height: 28px;
3441
+ margin: 0;
3442
+ padding: 2px 8px;
3443
+ overflow: hidden;
3444
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3445
+ border-radius: 999px;
3446
+ background: transparent;
3447
+ color: var(--dsw-alias-label-secondary, GrayText);
3448
+ cursor: pointer;
3449
+ font: inherit;
3450
+ font-size: 10px;
3451
+ }
3452
+
3453
+ .devlead-board-notes-chip > svg,
3454
+ .devlead-board-notes-chip > strong {
3455
+ flex: none;
3456
+ }
3457
+
3458
+ .devlead-board-notes-chip > strong {
3459
+ font-variant-numeric: tabular-nums;
3460
+ }
3461
+
3462
+ .devlead-board-notes-chip > .devlead-board-notes-chip-label {
3463
+ flex: none;
3464
+ color: var(--dsw-alias-label-primary, CanvasText);
3465
+ font-weight: 600;
3466
+ }
3467
+
3468
+ .devlead-board-notes-chip > span {
3469
+ min-width: 0;
3470
+ overflow: hidden;
3471
+ text-overflow: ellipsis;
3472
+ white-space: nowrap;
3473
+ }
3474
+
3475
+ .devlead-board-field {
3476
+ min-width: 0;
3477
+ margin-top: 7px;
3478
+ }
3479
+
3480
+ .devlead-board-field[data-empty="true"] {
3481
+ visibility: hidden;
3482
+ }
781
3483
 
782
- // packages/client-ui/src/client/styles.ts
783
- var STYLE_ATTRIBUTE = "data-plugin-css";
784
- var STYLE_KEY = "devlead";
785
- var styles = `
786
- /* Composer-tool row control: the users glyph plus a visible DevLead label. It
787
- keeps the 28px control height of the toolbar and sizes horizontally from its
788
- content, rather than occupying a fixed square glyph seat. The transparent
789
- 1px border is part of the base box (with 1px less padding), so enabling the
790
- accent border changes colour only, never the control's size or the toolbar
791
- layout. */
792
- .devlead-toggle {
793
- flex: none;
794
- width: auto;
795
- height: 28px;
796
- padding: 0 9px;
797
- border: 1px solid transparent;
798
- border-radius: 999px;
3484
+ .devlead-board-field p {
3485
+ display: -webkit-box;
3486
+ min-width: 0;
3487
+ min-height: 19px;
3488
+ margin: 0;
3489
+ overflow: hidden;
3490
+ overflow-wrap: anywhere;
3491
+ white-space: pre-wrap;
3492
+ -webkit-box-orient: vertical;
3493
+ -webkit-line-clamp: 2;
3494
+ }
3495
+
3496
+ .devlead-board-field-focus {
3497
+ margin-top: 8px;
3498
+ }
3499
+
3500
+ .devlead-board-field-focus p {
3501
+ min-height: 20px;
3502
+ color: var(--dsw-alias-label-primary, CanvasText);
3503
+ font-size: 14px;
3504
+ font-weight: 600;
3505
+ line-height: 20px;
3506
+ -webkit-line-clamp: 3;
3507
+ }
3508
+
3509
+ .devlead-board-field-next {
3510
+ display: flex;
3511
+ align-items: flex-start;
799
3512
  gap: 6px;
800
3513
  color: var(--dsw-alias-label-secondary, GrayText);
801
3514
  }
802
3515
 
803
- .devlead-toggle-label {
3516
+ .devlead-board-field-arrow {
804
3517
  flex: none;
805
- font-weight: 500;
806
- white-space: nowrap;
3518
+ color: var(--dsw-alias-state-business-primary, #4176e6);
3519
+ font-size: 14px;
3520
+ line-height: 19px;
807
3521
  }
808
3522
 
809
- @media (hover: hover) {
810
- .devlead-toggle:hover:not(:disabled):not([data-devlead-failed="true"]) {
811
- color: var(--dsw-alias-label-primary, CanvasText);
812
- }
3523
+ .devlead-board-field-next p {
3524
+ flex: 1 1 auto;
813
3525
  }
814
3526
 
815
- /* While the mode is on the same button stays in place and reads at full label
816
- color, with the business accent as a real border plus a very light halo.
817
- The halo is a box-shadow so it cannot add layout width; the border was
818
- already reserved (transparent) in the base rule. The failed rule below has
819
- the same specificity and wins the colour, so an error never leaves a blue
820
- accent behind. */
821
- .devlead-toggle[data-devlead-enabled="true"] {
822
- color: var(--dsw-alias-label-primary, CanvasText);
823
- border-color: var(--dsw-alias-state-business-primary, #4176e6);
824
- box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
3527
+ .devlead-board-field-goal {
3528
+ margin-top: 5px;
3529
+ padding-left: 12px;
3530
+ border-left: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3531
+ color: var(--dsw-alias-label-tertiary, GrayText);
3532
+ font-size: 12px;
825
3533
  }
826
3534
 
827
- .devlead-toggle[data-devlead-failed="true"] {
828
- color: var(--dsw-alias-label-error, #c0392b);
829
- border-color: var(--dsw-alias-label-error, #c0392b);
830
- box-shadow: none;
3535
+ .devlead-board-blockers-slot {
3536
+ min-width: 0;
831
3537
  }
832
3538
 
833
- /* The shell marks an active toolbar control with a subtle fill; the mode is a
834
- pressed toggle, not only a colour change, so mirror that affordance. */
835
- .devlead-toggle[aria-pressed="true"] {
3539
+ .devlead-board-blockers {
3540
+ margin-top: 8px;
3541
+ padding: 7px 8px;
3542
+ overflow: hidden;
3543
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 42%, transparent);
3544
+ border-radius: var(--dsw-radius-md, 8px);
3545
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 8%, transparent);
3546
+ color: var(--dsw-alias-state-warn-primary, #a15c00);
3547
+ }
3548
+
3549
+ .devlead-board-blockers h6 {
3550
+ display: flex;
3551
+ align-items: center;
3552
+ gap: 5px;
3553
+ font-size: 11px;
3554
+ }
3555
+
3556
+ .devlead-board-blockers ul,
3557
+ .devlead-board-tasks ul {
3558
+ min-width: 0;
3559
+ margin: 5px 0 0;
3560
+ padding: 0;
3561
+ list-style: none;
3562
+ }
3563
+
3564
+ .devlead-board-blockers li + li {
3565
+ margin-top: 6px;
3566
+ padding-top: 6px;
3567
+ border-top: 1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 24%, transparent);
3568
+ }
3569
+
3570
+ .devlead-board-blockers li > span:first-child {
3571
+ display: -webkit-box;
3572
+ overflow: hidden;
3573
+ overflow-wrap: anywhere;
3574
+ white-space: pre-wrap;
3575
+ -webkit-box-orient: vertical;
3576
+ -webkit-line-clamp: 3;
3577
+ }
3578
+
3579
+ .devlead-board-blocker-since {
3580
+ display: block;
3581
+ margin-top: 1px;
3582
+ color: var(--dsw-alias-label-secondary, GrayText);
3583
+ font-size: 10px;
3584
+ }
3585
+
3586
+ .devlead-board-progress {
3587
+ margin-top: 8px;
3588
+ }
3589
+
3590
+ .devlead-board-progress-heading {
3591
+ justify-content: flex-end;
3592
+ height: 13px;
3593
+ color: var(--dsw-alias-label-secondary, GrayText);
3594
+ font-size: 10px;
3595
+ line-height: 13px;
3596
+ }
3597
+
3598
+ .devlead-board-progress-heading > strong {
3599
+ font-variant-numeric: tabular-nums;
3600
+ font-weight: 600;
3601
+ }
3602
+
3603
+ .devlead-board-progress progress {
3604
+ display: block;
3605
+ width: 100%;
3606
+ height: 2px;
3607
+ overflow: hidden;
3608
+ appearance: none;
3609
+ border: 0;
3610
+ border-radius: 999px;
836
3611
  background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
3612
+ color: var(--dsw-alias-state-business-primary, #4176e6);
837
3613
  }
838
3614
 
839
- /* On a narrow viewport the visible label and the stale-watch warning would
840
- squeeze the composer toolbar and the status notice. The toggle keeps its
841
- accessible name and icon; the bar keeps the watched/running counts. */
842
- @media (max-width: 480px) {
843
- .devlead-toggle {
844
- padding: 0 7px;
845
- gap: 0;
846
- }
3615
+ .devlead-board-progress progress::-webkit-progress-bar {
3616
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
3617
+ }
847
3618
 
848
- .devlead-toggle-label,
849
- .devlead-label,
850
- .devlead-missing {
851
- display: none;
852
- }
3619
+ .devlead-board-progress progress::-webkit-progress-value {
3620
+ background: var(--dsw-alias-state-business-primary, #4176e6);
3621
+ }
853
3622
 
854
- .devlead-bar {
855
- gap: 6px;
856
- padding: 4px 10px;
857
- }
3623
+ .devlead-board-progress progress::-moz-progress-bar {
3624
+ background: var(--dsw-alias-state-business-primary, #4176e6);
3625
+ }
858
3626
 
859
- .devlead-meta {
860
- gap: 6px;
861
- }
3627
+ .devlead-board-card[data-status="blocked"] .devlead-board-progress progress::-webkit-progress-value,
3628
+ .devlead-board-card[data-status="blocked"] .devlead-board-progress progress::-moz-progress-bar {
3629
+ background: var(--dsw-alias-state-warn-primary, #a15c00);
862
3630
  }
863
3631
 
864
- .devlead-dock {
865
- box-sizing: border-box;
866
- width: calc(
867
- 100% -
868
- var(--dsh-composer-side-clearance, 16px) -
869
- var(--dsh-composer-side-clearance, 16px) -
870
- var(--dsh-composer-dock-inset, 8px) -
871
- var(--dsh-composer-dock-inset, 8px) -
872
- var(--dsh-composer-dock-inset, 8px) -
873
- var(--dsh-composer-dock-inset, 8px)
874
- );
875
- max-width: calc(var(--dsh-composer-card-max-width, 952px) - 4 * var(--dsh-composer-dock-inset, 8px));
876
- margin: 0 auto;
3632
+ .devlead-board-tasks {
3633
+ min-width: 0;
3634
+ margin-top: 6px;
3635
+ border-top: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
877
3636
  }
878
3637
 
879
- /* Menu-surface card: the composer context-stack geometry and elevation triple
880
- (stroke + soft light) rather than an extra CSS border, which would double the
881
- hairline and add layout width; the blur needs the surface on a background
882
- layer, so it is painted by the pseudo-element behind the content. */
883
- .devlead-bar {
884
- position: relative;
885
- isolation: isolate;
886
- box-sizing: border-box;
3638
+ .devlead-board summary {
3639
+ min-width: 0;
3640
+ max-width: 100%;
3641
+ color: var(--dsw-alias-label-secondary, GrayText);
3642
+ cursor: pointer;
3643
+ font-weight: 500;
3644
+ list-style: none;
3645
+ }
3646
+
3647
+ .devlead-board summary::-webkit-details-marker {
3648
+ display: none;
3649
+ }
3650
+
3651
+ .devlead-board summary::after {
3652
+ flex: none;
3653
+ margin-left: auto;
3654
+ color: var(--dsw-alias-label-tertiary, GrayText);
3655
+ content: '\u203A';
3656
+ font-size: 16px;
3657
+ font-weight: 400;
3658
+ transform: rotate(0deg);
3659
+ transition: transform 120ms ease;
3660
+ }
3661
+
3662
+ .devlead-board details[open] > summary::after {
3663
+ transform: rotate(90deg);
3664
+ }
3665
+
3666
+ .devlead-board-tasks > summary {
887
3667
  display: flex;
888
3668
  align-items: center;
889
- gap: 8px;
890
- width: 100%;
3669
+ gap: 6px;
3670
+ padding: 6px 1px 0;
3671
+ overflow: hidden;
3672
+ font-size: 11px;
3673
+ }
3674
+
3675
+ .devlead-board-tasks > summary strong {
3676
+ margin-left: auto;
3677
+ font-size: 10px;
3678
+ font-variant-numeric: tabular-nums;
3679
+ }
3680
+
3681
+ .devlead-board-tasks > summary::after {
3682
+ margin-left: 1px;
3683
+ }
3684
+
3685
+ .devlead-board-tasks li {
3686
+ min-width: 0;
3687
+ padding: 6px 0;
3688
+ border-top: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3689
+ }
3690
+
3691
+ .devlead-board-task-heading {
3692
+ align-items: flex-start;
3693
+ gap: 7px;
3694
+ }
3695
+
3696
+ .devlead-board-task-title {
3697
+ display: -webkit-box;
3698
+ flex: 1 1 auto;
891
3699
  min-width: 0;
892
- min-height: 34px;
893
- margin: 0 auto;
894
- padding: 4px 12px;
895
3700
  overflow: hidden;
896
- border: 0;
897
- --dsw-elevation-stroke-color: var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
898
- border-radius: var(--dsw-radius-lg, 12px);
899
- box-shadow: var(--dsw-elevation-panel, 0 1px 2px rgba(0, 0, 0, 0.08));
3701
+ overflow-wrap: anywhere;
3702
+ white-space: pre-wrap;
3703
+ -webkit-box-orient: vertical;
3704
+ -webkit-line-clamp: 2;
3705
+ }
3706
+
3707
+ /* The native task disclosure is also the keyboard-accessible full-content
3708
+ view: opening it removes every informational clamp, not only the task list's
3709
+ visibility. Hover titles remain a shortcut, never the only complete copy. */
3710
+ .devlead-board-card:has(.devlead-board-tasks[open]) .devlead-board-field p,
3711
+ .devlead-board-card:has(.devlead-board-tasks[open]) .devlead-board-blockers li > span:first-child,
3712
+ .devlead-board-card:has(.devlead-board-tasks[open]) .devlead-board-task-title {
3713
+ display: block;
3714
+ overflow: visible;
3715
+ -webkit-line-clamp: unset;
3716
+ }
3717
+
3718
+ .devlead-board-task-meta {
3719
+ flex-wrap: wrap;
3720
+ gap: 3px 7px;
3721
+ margin-top: 2px;
3722
+ color: var(--dsw-alias-label-tertiary, GrayText);
3723
+ font-size: 10px;
3724
+ }
3725
+
3726
+ .devlead-board-task-meta code {
3727
+ overflow: hidden;
3728
+ font-family: inherit;
3729
+ text-overflow: ellipsis;
3730
+ white-space: nowrap;
3731
+ }
3732
+
3733
+ .devlead-board-card-footer {
3734
+ display: flex;
3735
+ align-items: center;
3736
+ justify-content: flex-end;
3737
+ gap: 3px;
3738
+ margin-top: auto;
3739
+ padding-top: 5px;
3740
+ color: var(--dsw-alias-label-tertiary, GrayText);
3741
+ font-size: 10px;
3742
+ line-height: 14px;
3743
+ }
3744
+
3745
+ .devlead-board-muted {
3746
+ color: var(--dsw-alias-label-tertiary, GrayText);
3747
+ }
3748
+
3749
+ .devlead-board-secondary {
3750
+ min-width: 0;
3751
+ max-width: 100%;
3752
+ margin-top: 9px;
3753
+ overflow: hidden;
3754
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3755
+ border-radius: var(--dsw-radius-md, 8px);
3756
+ background: color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 2%, transparent);
3757
+ }
3758
+
3759
+ .devlead-board-secondary > summary {
3760
+ display: flex;
3761
+ align-items: center;
3762
+ gap: 7px;
3763
+ min-height: 36px;
3764
+ padding: 7px 9px;
3765
+ overflow: hidden;
3766
+ }
3767
+
3768
+ .devlead-board-secondary > summary > h4 {
3769
+ display: flex;
3770
+ flex: 1 1 auto;
3771
+ align-items: center;
3772
+ justify-content: space-between;
3773
+ gap: 7px;
3774
+ overflow: hidden;
3775
+ font-size: 11px;
3776
+ }
3777
+
3778
+ .devlead-board-secondary > summary > h4 > span:first-child,
3779
+ .devlead-board-unlisted > summary > span:first-child {
3780
+ min-width: 0;
3781
+ overflow: hidden;
3782
+ text-overflow: ellipsis;
3783
+ white-space: nowrap;
3784
+ }
3785
+
3786
+ .devlead-board-secondary[open] > summary {
3787
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3788
+ }
3789
+
3790
+ .devlead-board-secondary > .devlead-board-cards {
3791
+ padding: 8px;
3792
+ }
3793
+
3794
+ .devlead-board-unlisted-body {
3795
+ padding: 8px 9px;
3796
+ color: var(--dsw-alias-label-secondary, GrayText);
3797
+ font-size: 12px;
3798
+ }
3799
+
3800
+ .devlead-board-unlisted-list {
3801
+ margin: 0;
3802
+ padding: 0;
3803
+ list-style: none;
3804
+ }
3805
+
3806
+ .devlead-board-unlisted-list li {
3807
+ padding: 7px 0;
3808
+ overflow: hidden;
3809
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3810
+ }
3811
+
3812
+ .devlead-board-unlisted-list li:last-child {
3813
+ border-bottom: 0;
3814
+ }
3815
+
3816
+ .devlead-board-unlisted-list strong,
3817
+ .devlead-board-unlisted-list code,
3818
+ .devlead-board-unlisted-list span {
3819
+ display: block;
3820
+ overflow: hidden;
3821
+ text-overflow: ellipsis;
3822
+ white-space: nowrap;
3823
+ }
3824
+
3825
+ .devlead-board-unlisted-list strong {
900
3826
  color: var(--dsw-alias-label-primary, CanvasText);
901
- font-size: 13px;
902
- line-height: 20px;
3827
+ }
3828
+
3829
+ .devlead-board-unlisted-list code {
3830
+ margin-top: 2px;
3831
+ color: var(--dsw-alias-label-tertiary, GrayText);
903
3832
  font-family: inherit;
3833
+ font-size: 11px;
904
3834
  }
905
3835
 
906
- .devlead-bar::before {
907
- position: absolute;
908
- z-index: -1;
909
- inset: 0;
910
- border-radius: inherit;
911
- background: var(--dsw-specific-menu, Canvas);
912
- backdrop-filter: var(--dsw-menu-backdrop-filter, none);
913
- content: '';
914
- pointer-events: none;
3836
+ /* Immersive notes: two reading lanes on wide panes, stacked on narrow panes. */
3837
+ .devlead-board-content:has(.devlead-notes-reader) {
3838
+ padding: 0;
3839
+ overflow: hidden;
915
3840
  }
916
3841
 
917
- .devlead-glyph {
918
- display: inline-flex;
3842
+ .devlead-notes-reader {
3843
+ display: flex;
3844
+ min-width: 0;
3845
+ min-height: 0;
3846
+ height: 100%;
3847
+ flex-direction: column;
3848
+ }
3849
+
3850
+ .devlead-notes-reader-header {
3851
+ display: flex;
919
3852
  flex: none;
920
3853
  align-items: center;
921
- color: var(--dsw-alias-label-tertiary, GrayText);
3854
+ gap: 8px;
3855
+ min-width: 0;
3856
+ padding: 9px 11px;
3857
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
922
3858
  }
923
3859
 
924
- .devlead-label {
925
- flex: none;
926
- font-weight: 500;
927
- color: var(--dsw-alias-label-primary, CanvasText);
928
- white-space: nowrap;
3860
+ .devlead-notes-reader-header > div {
3861
+ min-width: 0;
929
3862
  }
930
3863
 
931
- .devlead-meta {
932
- display: inline-flex;
933
- flex: none;
934
- align-items: center;
935
- gap: 10px;
936
- color: var(--dsw-alias-label-secondary, GrayText);
937
- font-variant-numeric: tabular-nums;
3864
+ .devlead-notes-reader-header h3 {
3865
+ margin: 0;
3866
+ overflow: hidden;
3867
+ font-size: 14px;
3868
+ line-height: 20px;
3869
+ text-overflow: ellipsis;
938
3870
  white-space: nowrap;
939
3871
  }
940
3872
 
941
- .devlead-watched {
942
- flex: none;
3873
+ .devlead-notes-reader-header span {
3874
+ color: var(--dsw-alias-label-tertiary, GrayText);
3875
+ font-size: 10px;
943
3876
  }
944
3877
 
945
- .devlead-running {
946
- display: inline-flex;
947
- align-items: center;
948
- gap: 5px;
3878
+ .devlead-notes-reader > .devlead-notes-state {
3879
+ flex: 1 1 auto;
3880
+ margin: 10px;
949
3881
  }
950
3882
 
951
- .devlead-dot {
952
- flex: none;
953
- width: 6px;
954
- height: 6px;
955
- border-radius: 999px;
956
- background: var(--dsw-alias-label-tertiary, GrayText);
3883
+ .devlead-notes-reader-body {
3884
+ display: grid;
3885
+ flex: 1 1 auto;
3886
+ grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
3887
+ min-width: 0;
3888
+ min-height: 0;
957
3889
  }
958
3890
 
959
- .devlead-dot[data-active="true"] {
960
- background: var(--dsw-alias-state-success-primary, #2e7d32);
3891
+ .devlead-notes-list {
3892
+ min-width: 0;
3893
+ min-height: 0;
3894
+ overflow-x: hidden;
3895
+ overflow-y: auto;
3896
+ border-right: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
3897
+ background: color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 2%, transparent);
961
3898
  }
962
3899
 
963
- .devlead-missing {
964
- color: var(--dsw-alias-label-secondary, GrayText);
3900
+ .devlead-notes-list ul {
3901
+ margin: 0;
3902
+ padding: 6px;
3903
+ list-style: none;
965
3904
  }
966
3905
 
967
- /* One stable live region wrapping the hint or the latest-notification chip so
968
- assistive technology announces a new notification as a content change of an
969
- existing region, not as a freshly inserted one. */
970
- .devlead-notice {
971
- display: inline-flex;
972
- flex: 1 1 auto;
973
- align-items: center;
3906
+ .devlead-notes-list button {
3907
+ display: flex;
3908
+ width: 100%;
974
3909
  min-width: 0;
975
- overflow: hidden;
976
- white-space: nowrap;
3910
+ margin: 0;
3911
+ padding: 7px 8px;
3912
+ border: 0;
3913
+ border-radius: var(--dsw-radius-md, 8px);
3914
+ background: transparent;
3915
+ color: var(--dsw-alias-label-secondary, GrayText);
3916
+ cursor: pointer;
3917
+ font: inherit;
3918
+ text-align: left;
3919
+ flex-direction: column;
977
3920
  }
978
3921
 
979
- .devlead-hint {
980
- flex: 1 1 auto;
981
- min-width: 0;
3922
+ .devlead-notes-list button[aria-current="page"] {
3923
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
3924
+ color: var(--dsw-alias-label-primary, CanvasText);
3925
+ }
3926
+
3927
+ .devlead-notes-list strong,
3928
+ .devlead-notes-list button > span {
3929
+ max-width: 100%;
982
3930
  overflow: hidden;
983
- color: var(--dsw-alias-label-tertiary, GrayText);
984
- font-size: 12px;
985
3931
  text-overflow: ellipsis;
3932
+ }
3933
+
3934
+ .devlead-notes-list strong {
3935
+ color: var(--dsw-alias-label-primary, CanvasText);
3936
+ font-size: 12px;
986
3937
  white-space: nowrap;
987
3938
  }
988
3939
 
989
- .devlead-notification {
990
- display: inline-flex;
991
- flex: 1 1 auto;
992
- align-items: center;
993
- gap: 6px;
3940
+ .devlead-notes-list button > span {
3941
+ display: -webkit-box;
3942
+ margin-top: 2px;
3943
+ overflow-wrap: anywhere;
3944
+ font-size: 11px;
3945
+ -webkit-box-orient: vertical;
3946
+ -webkit-line-clamp: 2;
3947
+ }
3948
+
3949
+ .devlead-notes-list time {
3950
+ margin-top: 3px;
3951
+ color: var(--dsw-alias-label-tertiary, GrayText);
3952
+ font-size: 10px;
3953
+ }
3954
+
3955
+ .devlead-note-document {
994
3956
  min-width: 0;
995
- overflow: hidden;
996
- color: var(--dsw-alias-label-secondary, GrayText);
997
- white-space: nowrap;
3957
+ min-height: 0;
3958
+ padding: 16px clamp(14px, 4vw, 34px) 30px;
3959
+ overflow-x: hidden;
3960
+ overflow-y: auto;
3961
+ overscroll-behavior: contain;
998
3962
  }
999
3963
 
1000
- .devlead-notification-dot {
1001
- flex: none;
1002
- width: 6px;
1003
- height: 6px;
1004
- border-radius: 999px;
1005
- background: var(--dsw-alias-label-tertiary, GrayText);
3964
+ .devlead-note-document > header {
3965
+ margin-bottom: 16px;
3966
+ padding-bottom: 11px;
3967
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
1006
3968
  }
1007
3969
 
1008
- .devlead-notification-dot[data-transition="completed"] {
1009
- background: var(--dsw-alias-state-success-primary, #2e7d32);
3970
+ .devlead-note-document > header h4 {
3971
+ margin: 0;
3972
+ overflow-wrap: anywhere;
3973
+ font-size: 20px;
3974
+ line-height: 28px;
3975
+ letter-spacing: -0.02em;
1010
3976
  }
1011
3977
 
1012
- .devlead-notification-dot[data-transition="error"] {
1013
- background: var(--dsw-alias-state-error-primary, #c0392b);
3978
+ .devlead-note-document > header p {
3979
+ margin: 5px 0;
3980
+ color: var(--dsw-alias-label-secondary, GrayText);
3981
+ overflow-wrap: anywhere;
1014
3982
  }
1015
3983
 
1016
- .devlead-notification-dot[data-transition="blocked"],
1017
- .devlead-notification-dot[data-transition="max-tokens"] {
1018
- background: var(--dsw-alias-state-warn-primary, #a15c00);
3984
+ .devlead-note-document > header time {
3985
+ color: var(--dsw-alias-label-tertiary, GrayText);
3986
+ font-size: 11px;
1019
3987
  }
1020
3988
 
1021
- /* Report dots follow the delivery lane: the action-required kinds (blocked/
1022
- decision/question) share the warning ink \u2014 a blocked report is a scheduling
1023
- fact, not a Host failure, so it must not wear the error red. Background
1024
- kinds (progress/fyi) keep the default tertiary dot: a non-urgent update
1025
- reads quieter than a settled outcome. */
1026
- .devlead-notification-dot[data-report-kind="blocked"],
1027
- .devlead-notification-dot[data-report-kind="decision"],
1028
- .devlead-notification-dot[data-report-kind="question"] {
1029
- background: var(--dsw-alias-state-warn-primary, #a15c00);
3989
+ .devlead-markdown {
3990
+ max-width: 76ch;
3991
+ color: var(--dsw-alias-label-primary, CanvasText);
3992
+ font-size: 13px;
3993
+ line-height: 1.7;
3994
+ overflow-wrap: anywhere;
1030
3995
  }
1031
3996
 
1032
- /* Action-required chips wear the warning ink on the kind label so the strip
1033
- reads "the lead must act" at a glance; colour only, never layout. */
1034
- .devlead-notification[data-lane="action-required"] .devlead-notification-label {
1035
- color: var(--dsw-alias-state-warn-primary, #a15c00);
3997
+ .devlead-markdown h1,
3998
+ .devlead-markdown h2,
3999
+ .devlead-markdown h3,
4000
+ .devlead-markdown h4,
4001
+ .devlead-markdown h5,
4002
+ .devlead-markdown h6 {
4003
+ margin: 1.35em 0 0.5em;
4004
+ line-height: 1.3;
4005
+ letter-spacing: -0.012em;
1036
4006
  }
1037
4007
 
1038
- /* Background chips are non-urgent: one uniform opacity step weakens the whole
1039
- chip (dot, who, label, detail) without touching any box, mirroring the
1040
- watched-row mark's quieter-ink idiom. */
1041
- .devlead-notification[data-lane="background"] {
1042
- opacity: 0.72;
4008
+ .devlead-markdown h1 { font-size: 1.55em; }
4009
+ .devlead-markdown h2 { font-size: 1.35em; }
4010
+ .devlead-markdown h3 { font-size: 1.18em; }
4011
+ .devlead-markdown h4,
4012
+ .devlead-markdown h5,
4013
+ .devlead-markdown h6 { font-size: 1em; }
4014
+
4015
+ .devlead-markdown p {
4016
+ margin: 0.7em 0;
4017
+ white-space: pre-wrap;
1043
4018
  }
1044
4019
 
1045
- .devlead-notification-who {
1046
- flex: 0 1 auto;
1047
- min-width: 0;
1048
- overflow: hidden;
1049
- color: var(--dsw-alias-label-primary-dimmed, rgba(127, 127, 127, 0.9));
1050
- text-overflow: ellipsis;
4020
+ .devlead-markdown ul,
4021
+ .devlead-markdown ol {
4022
+ margin: 0.65em 0;
4023
+ padding-left: 1.6em;
1051
4024
  }
1052
4025
 
1053
- .devlead-notification-turn,
1054
- .devlead-notification-label {
1055
- flex: none;
4026
+ .devlead-markdown li + li {
4027
+ margin-top: 0.25em;
1056
4028
  }
1057
4029
 
1058
- /* Fold-derived question/answer lifecycle suffix ("answered \xB7 presented"):
1059
- compact neutral copy \u2014 the kind dot and label carry the urgency, the suffix
1060
- only states the lifecycle fact. */
1061
- .devlead-notification-status {
1062
- flex: none;
4030
+ .devlead-markdown blockquote {
4031
+ margin: 0.8em 0;
4032
+ padding: 2px 0 2px 12px;
4033
+ border-left: 2px solid var(--dsw-alias-state-business-primary, #4176e6);
1063
4034
  color: var(--dsw-alias-label-secondary, GrayText);
1064
4035
  }
1065
4036
 
1066
- /* A suppressed turn-end wake keeps its transition row; only this marker is
1067
- weakened. Tertiary ink at the detail size reads as an annotation, and the
1068
- marker's title carries the localized explanation of which merge rule hit. */
1069
- .devlead-notification-wake {
1070
- flex: none;
1071
- color: var(--dsw-alias-label-tertiary, GrayText);
1072
- font-size: 12px;
4037
+ .devlead-markdown code {
4038
+ padding: 0.1em 0.35em;
4039
+ border-radius: var(--dsw-radius-sm, 4px);
4040
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
4041
+ font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
4042
+ font-size: 0.9em;
1073
4043
  }
1074
4044
 
1075
- /* A turn failure excerpt keeps the error ink; a report's summary/message
1076
- detail is neutral copy \u2014 the kind dot and localized label carry the
1077
- semantics, so progress/fyi/question text must not read as a failure. */
1078
- .devlead-notification-error,
1079
- .devlead-notification-detail {
1080
- flex: 0 1 auto;
1081
- min-width: 0;
1082
- overflow: hidden;
1083
- font-size: 12px;
1084
- text-overflow: ellipsis;
4045
+ .devlead-markdown pre {
4046
+ max-width: 100%;
4047
+ margin: 0.8em 0;
4048
+ padding: 11px 12px;
4049
+ overflow-x: auto;
4050
+ border: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
4051
+ border-radius: var(--dsw-radius-md, 8px);
4052
+ background: color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 4%, transparent);
1085
4053
  }
1086
4054
 
1087
- .devlead-notification-error {
1088
- color: var(--dsw-alias-label-error, #c0392b);
4055
+ .devlead-markdown pre code {
4056
+ padding: 0;
4057
+ background: transparent;
4058
+ white-space: pre;
4059
+ overflow-wrap: normal;
1089
4060
  }
1090
4061
 
1091
- .devlead-notification-detail {
1092
- color: var(--dsw-alias-label-secondary, GrayText);
4062
+ .devlead-markdown a {
4063
+ color: var(--dsw-alias-state-business-primary, #4176e6);
4064
+ text-decoration: underline;
4065
+ text-underline-offset: 2px;
1093
4066
  }
1094
4067
 
1095
- /* Visually hidden but announced: the compact toolbar surface has no inline
1096
- error seat, so its failure text is mirrored into a live region through this
1097
- class (the shipped visually-hidden idiom used by the chat surfaces). */
1098
- .devlead-sr-only {
1099
- position: absolute;
1100
- width: 1px;
1101
- height: 1px;
1102
- overflow: hidden;
1103
- clip: rect(0 0 0 0);
1104
- white-space: nowrap;
4068
+ .devlead-board button:focus-visible,
4069
+ .devlead-board summary:focus-visible,
4070
+ .devlead-board a:focus-visible {
4071
+ outline: 2px solid var(--dsw-alias-state-business-primary, #4176e6);
4072
+ outline-offset: 2px;
1105
4073
  }
1106
4074
 
1107
- /* Sidebar Session-row mark: a non-interactive glyph after the row's time
1108
- label. The seat is inline inside the row's 20px line box, so the icon can
1109
- never change the row height or the title's ellipsis width. */
1110
- .devlead-row-mark {
1111
- display: inline-flex;
1112
- flex: none;
1113
- align-items: center;
1114
- color: var(--dsw-alias-label-secondary, GrayText);
4075
+ .devlead-board-card:focus-within {
4076
+ box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
1115
4077
  }
1116
4078
 
1117
- /* The active lead row gets the same business accent as the toolbar toggle,
1118
- painted as an overlay ring so the 32px row box, padding, and title lane never
1119
- move. Do not color or resize the shell row's border: it has a 3px transparent
1120
- border-inline (paint inset) but no top/bottom border, and an inset box-shadow
1121
- is clipped to the padding box, so either would look thicker/deeper on the
1122
- left/right than on top/bottom. The ::after overlay is positioned against the
1123
- row's border box (negative inline offsets cancel the transparent paint inset)
1124
- and draws one 1px border plus a light outer halo on all four sides at the
1125
- row's own radius. The row owns a stable data-row-key; :has scopes the
1126
- decoration to exactly the active row. The status hook stays mounted while the
1127
- shell hides the resting seat on hover, so the overlay survives hover/focus. */
1128
- [data-row-key^="session:"]:has([data-devlead-active-mark="true"]) {
1129
- position: relative;
4079
+ .devlead-board-card:focus-visible,
4080
+ .devlead-board-priority:focus-visible {
4081
+ outline: 2px solid var(--dsw-alias-state-business-primary, #4176e6);
4082
+ outline-offset: 2px;
1130
4083
  }
1131
4084
 
1132
- [data-row-key^="session:"]:has([data-devlead-active-mark="true"])::after {
1133
- content: '';
1134
- position: absolute;
1135
- inset: 0 calc(-1 * var(--dsh-sidebar-paint-inset, 3px));
1136
- border: 1px solid var(--dsw-alias-state-business-primary, #4176e6);
1137
- border-radius: inherit;
1138
- box-shadow: 0 0 0 2px var(--dsw-alias-state-business-tertiary, rgba(65, 118, 230, 0.12));
1139
- pointer-events: none;
4085
+ /* Chromium shares each of the ten card-section tracks across one visual row.
4086
+ The flex column above remains the equal-height/footer fallback elsewhere. */
4087
+ @supports (grid-template-rows: subgrid) {
4088
+ .devlead-board-cards {
4089
+ grid-auto-rows: auto;
4090
+ }
4091
+
4092
+ .devlead-board-card {
4093
+ display: grid;
4094
+ grid-row: span 10;
4095
+ grid-template-rows: subgrid;
4096
+ row-gap: 0;
4097
+ height: auto;
4098
+ }
1140
4099
  }
1141
4100
 
1142
- /* A watched row uses a quieter shield than the active lead's mark: secondary
1143
- ink at reduced opacity stays legible in both palettes without competing with
1144
- the active ring. */
1145
- .devlead-row-mark-watched {
1146
- color: var(--dsw-alias-label-secondary, GrayText);
1147
- opacity: 0.62;
4101
+ @media (hover: hover) {
4102
+ .devlead-board-refresh:hover:not(:disabled),
4103
+ .devlead-notes-back:hover:not(:disabled),
4104
+ .devlead-board-notes-chip:hover:not(:disabled),
4105
+ .devlead-notes-list button:hover {
4106
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
4107
+ color: var(--dsw-alias-label-primary, CanvasText);
4108
+ }
4109
+
4110
+ .devlead-board-card:hover {
4111
+ box-shadow: 0 1px 3px color-mix(in srgb, var(--dsw-alias-label-primary, CanvasText) 10%, transparent);
4112
+ }
4113
+
4114
+ .devlead-board-card[data-status="blocked"]:hover {
4115
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--dsw-alias-state-warn-primary, #a15c00) 16%, transparent);
4116
+ }
4117
+
4118
+ .devlead-board summary:hover {
4119
+ color: var(--dsw-alias-label-primary, CanvasText);
4120
+ }
1148
4121
  }
1149
4122
 
1150
- /* Hover-card line explaining the mark; mirrors the shell's hover status rows
1151
- (12px text on a 20px line) so the card keeps one rhythm. */
1152
- .devlead-row-hover-active-dot {
1153
- display: inline-block;
1154
- flex: none;
1155
- box-sizing: border-box;
1156
- width: 8px;
1157
- height: 8px;
1158
- border: 1px solid var(--dsw-alias-state-business-primary, #4176e6);
1159
- border-radius: 999px;
4123
+ @container devlead-board (min-width: 620px) {
4124
+ .devlead-board-group > .devlead-board-cards {
4125
+ grid-template-columns: repeat(2, minmax(0, 1fr));
4126
+ }
1160
4127
  }
1161
4128
 
1162
- .devlead-row-hover {
1163
- display: flex;
1164
- align-items: center;
1165
- gap: 8px;
1166
- font-size: 12px;
1167
- line-height: 20px;
1168
- color: var(--dsw-alias-label-secondary, GrayText);
4129
+ @container devlead-board (min-width: 980px) {
4130
+ .devlead-board-group > .devlead-board-cards {
4131
+ grid-template-columns: repeat(3, minmax(0, 1fr));
4132
+ }
1169
4133
  }
1170
4134
 
1171
- .devlead-row-hover-glyph {
1172
- display: inline-flex;
1173
- flex: none;
1174
- align-items: center;
4135
+ @container devlead-board (max-width: 560px) {
4136
+ .devlead-notes-reader-body {
4137
+ grid-template-columns: minmax(0, 1fr);
4138
+ grid-template-rows: minmax(0, auto) minmax(0, 1fr);
4139
+ }
4140
+
4141
+ .devlead-notes-list {
4142
+ max-height: 172px;
4143
+ border-right: 0;
4144
+ border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, 0.24));
4145
+ }
4146
+
4147
+ .devlead-notes-list ul {
4148
+ display: grid;
4149
+ grid-template-columns: repeat(2, minmax(0, 1fr));
4150
+ gap: 3px;
4151
+ }
4152
+ }
4153
+
4154
+ @container devlead-board (max-width: 340px) {
4155
+ .devlead-board-header {
4156
+ padding-inline: 8px;
4157
+ }
4158
+
4159
+ .devlead-board-content {
4160
+ padding: 7px;
4161
+ }
4162
+
4163
+ .devlead-board-content:has(.devlead-notes-reader) {
4164
+ padding: 0;
4165
+ }
4166
+
4167
+ .devlead-board-kpis > div {
4168
+ padding-inline: 5px;
4169
+ }
4170
+
4171
+ .devlead-notes-list ul {
4172
+ grid-template-columns: minmax(0, 1fr);
4173
+ }
4174
+ }
4175
+
4176
+ @media (max-width: 480px) {
4177
+ .devlead-note-document {
4178
+ padding: 13px 12px 24px;
4179
+ }
4180
+ }
4181
+
4182
+ @media (prefers-reduced-motion: reduce) {
4183
+ .devlead-board *,
4184
+ .devlead-board *::before,
4185
+ .devlead-board *::after {
4186
+ scroll-behavior: auto !important;
4187
+ transition: none !important;
4188
+ animation: none !important;
4189
+ }
1175
4190
  }
4191
+
1176
4192
  `;
1177
4193
  var STYLE_TAG_STATE = /* @__PURE__ */ Symbol.for("@yankeguo/dsh-client-ui-devlead.style-tag");
1178
4194
  function styleTagState() {
@@ -1216,7 +4232,17 @@ window.__ModuleLoader__.load({
1216
4232
 
1217
4233
  // packages/client-ui/src/client/index.tsx
1218
4234
  var NS = "devlead";
1219
- var inject = ["slots", "sessions", "remote", "remote.commands", "locale"];
4235
+ var inject = [
4236
+ "slots",
4237
+ "sessions",
4238
+ "remote",
4239
+ "remote.commands",
4240
+ "remote.workspaceFiles",
4241
+ "locale",
4242
+ "sidebarRight",
4243
+ "sidebarRightTabs",
4244
+ "workspaces"
4245
+ ];
1220
4246
  function apply(ctx) {
1221
4247
  ctx.effect(() => ctx.locale.register(NS, { zh, en }), "devlead: dictionaries");
1222
4248
  ctx.effect(() => ensureStyleTag(), "devlead: styles");
@@ -1249,12 +4275,125 @@ window.__ModuleLoader__.load({
1249
4275
  order: 20,
1250
4276
  locale: NS
1251
4277
  }, DevLeadSessionMark));
4278
+ ctx.slots.inject("sidebar.session.row.leading", () => ctx.slots.register({
4279
+ name: "sidebar.session.row.leading",
4280
+ id: "devlead-accessible",
4281
+ order: 20,
4282
+ locale: NS
4283
+ }, DevLeadSessionAccessibleMark));
1252
4284
  ctx.slots.inject("sidebar.session.row.hover", () => ctx.slots.register({
1253
4285
  name: "sidebar.session.row.hover",
1254
4286
  id: "devlead",
1255
4287
  order: 20,
1256
4288
  locale: NS
1257
4289
  }, DevLeadSessionHoverMark));
4290
+ const sessions = ctx.sessions;
4291
+ let boardSurfaceDisposers = [];
4292
+ const boardEligible = (sessionId) => resolveDevLeadBoardSessionConfig(
4293
+ sessionId,
4294
+ sessions.list.getSnapshot().byId[sessionId],
4295
+ currentDevLeadBoardConfig()
4296
+ ) !== void 0;
4297
+ const closeBoardTabs = () => {
4298
+ const onScreen = ctx.sidebarRight.mounted.getSnapshot();
4299
+ if (onScreen === void 0) return;
4300
+ for (const tab of ctx.sidebarRight.openTabs.getSnapshot()) {
4301
+ if (tab.sessionId !== onScreen || tab.kind !== DEVLEAD_BOARD_TAB_KIND) continue;
4302
+ try {
4303
+ ctx.sidebarRight.close(tab.tabId);
4304
+ } catch {
4305
+ }
4306
+ }
4307
+ };
4308
+ const disposeBoardSurfaces = () => {
4309
+ const disposers = boardSurfaceDisposers;
4310
+ if (disposers.length === 0) return;
4311
+ boardSurfaceDisposers = [];
4312
+ for (const dispose of [...disposers].reverse()) {
4313
+ try {
4314
+ dispose();
4315
+ } catch {
4316
+ }
4317
+ }
4318
+ closeBoardTabs();
4319
+ };
4320
+ const ensureBoardSurfaces = (sessionId) => {
4321
+ if (sessionId === void 0) return false;
4322
+ if (boardSurfaceDisposers.length > 0) return true;
4323
+ if (!boardEligible(sessionId)) return false;
4324
+ const t = ctx.locale.bind(NS);
4325
+ const disposers = [];
4326
+ try {
4327
+ disposers.push(ctx.sidebarRightTabs.register({
4328
+ id: DEVLEAD_BOARD_TAB_ID,
4329
+ kind: DEVLEAD_BOARD_TAB_KIND,
4330
+ title: () => t("board.title"),
4331
+ guide: [{
4332
+ id: "open",
4333
+ order: 30,
4334
+ title: () => t("board.title"),
4335
+ description: () => t("board.guide"),
4336
+ icon: import_dsh_client_ui_primitives7.IconGaugeOutlineRegular
4337
+ }]
4338
+ }));
4339
+ disposers.push(ctx.slots.inject("sidebar.right.pane.tab", () => ctx.slots.register({
4340
+ name: "sidebar.right.pane.tab",
4341
+ key: DEVLEAD_BOARD_TAB_ID,
4342
+ locale: NS,
4343
+ // The body resolves its own path from the tab Session's summary plus
4344
+ // the Host global, so the injected face keeps only the shared Remote.
4345
+ inject: () => ({ files: ctx.remote.workspaceFiles })
4346
+ }, DevLeadBoardPanel)));
4347
+ disposers.push(ctx.slots.inject("sidebar.right.pane.tab.title", () => ctx.slots.register({
4348
+ name: "sidebar.right.pane.tab.title",
4349
+ key: DEVLEAD_BOARD_TAB_ID,
4350
+ locale: NS
4351
+ }, DevLeadBoardTitle)));
4352
+ } catch {
4353
+ for (const dispose of disposers.reverse()) {
4354
+ try {
4355
+ dispose();
4356
+ } catch {
4357
+ }
4358
+ }
4359
+ return false;
4360
+ }
4361
+ boardSurfaceDisposers = disposers;
4362
+ return true;
4363
+ };
4364
+ ctx.slots.inject("conversation.session.header.utilities", () => ctx.slots.register({
4365
+ name: "conversation.session.header.utilities",
4366
+ id: "devlead-board",
4367
+ // Next to the shipped Schedule entry (-5), left of the overflow menu.
4368
+ order: -4,
4369
+ locale: NS,
4370
+ inject: (sessionId) => ({
4371
+ onOpen: () => {
4372
+ if (!ensureBoardSurfaces(sessionId)) return;
4373
+ ctx.sidebarRight.openTab(DEVLEAD_BOARD_TAB_KIND);
4374
+ }
4375
+ })
4376
+ }, DevLeadBoardButton));
4377
+ ctx.effect(() => {
4378
+ const sync = () => {
4379
+ const onScreen = ctx.sidebarRight.mounted.getSnapshot();
4380
+ if (onScreen !== void 0 && boardEligible(onScreen)) {
4381
+ ensureBoardSurfaces(onScreen);
4382
+ } else {
4383
+ disposeBoardSurfaces();
4384
+ closeBoardTabs();
4385
+ }
4386
+ };
4387
+ const offMounted = ctx.sidebarRight.mounted.subscribe(sync);
4388
+ const offSessions = sessions.list.subscribe(sync);
4389
+ sync();
4390
+ return () => {
4391
+ offMounted();
4392
+ offSessions();
4393
+ disposeBoardSurfaces();
4394
+ closeBoardTabs();
4395
+ };
4396
+ }, "devlead: board surfaces");
1258
4397
  }
1259
4398
 
1260
4399
  return module.exports;