@fish-under-sea/dsh-client-ui-task-board-fish 2.2.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.en.md +4 -4
  2. package/package.json +1 -1
  3. package/README.i18n.yaml +0 -6
  4. package/README.md +0 -31
  5. package/README.zh.md +0 -31
  6. package/lib/client.js +0 -15861
  7. package/lib/client.js.map +0 -1
  8. package/lib/index.js +0 -12653
  9. package/lib/types/client/CardDefaultPresetField.d.ts +0 -35
  10. package/lib/types/client/PluginSettingsCard.d.ts +0 -255
  11. package/lib/types/client/RangeBubble.d.ts +0 -46
  12. package/lib/types/client/SegmentGroup.d.ts +0 -28
  13. package/lib/types/client/TaskBoardSettingsCard.d.ts +0 -155
  14. package/lib/types/client/apply-guard.d.ts +0 -25
  15. package/lib/types/client/board/AttachmentField.d.ts +0 -70
  16. package/lib/types/client/board/ClampedMarkdown.d.ts +0 -3
  17. package/lib/types/client/board/ConfirmDialog.d.ts +0 -15
  18. package/lib/types/client/board/EditTaskModal.d.ts +0 -17
  19. package/lib/types/client/board/ExecutionLog.d.ts +0 -24
  20. package/lib/types/client/board/LinkSubtaskModal.d.ts +0 -14
  21. package/lib/types/client/board/NewTaskModal.d.ts +0 -26
  22. package/lib/types/client/board/ReasoningEffortField.d.ts +0 -25
  23. package/lib/types/client/board/TagManagerModal.d.ts +0 -26
  24. package/lib/types/client/board/TaskBoard.d.ts +0 -26
  25. package/lib/types/client/board/TaskCard.d.ts +0 -36
  26. package/lib/types/client/board/TaskDetail.d.ts +0 -9
  27. package/lib/types/client/board/TaskForm.d.ts +0 -76
  28. package/lib/types/client/board/VerificationReport.d.ts +0 -10
  29. package/lib/types/client/board/card-view.d.ts +0 -113
  30. package/lib/types/client/board/icons.d.ts +0 -32
  31. package/lib/types/client/board/model-options.d.ts +0 -87
  32. package/lib/types/client/board/overlay.d.ts +0 -69
  33. package/lib/types/client/board/parse-model-pref.d.ts +0 -4
  34. package/lib/types/client/board/preset-label.d.ts +0 -43
  35. package/lib/types/client/board/preset-roster.d.ts +0 -45
  36. package/lib/types/client/board/source-group.d.ts +0 -27
  37. package/lib/types/client/board/status-key.d.ts +0 -19
  38. package/lib/types/client/board/task-markdown.d.ts +0 -19
  39. package/lib/types/client/body-mutations.d.ts +0 -45
  40. package/lib/types/client/host-api.d.ts +0 -88
  41. package/lib/types/client/index.d.ts +0 -128
  42. package/lib/types/client/locales.d.ts +0 -521
  43. package/lib/types/client/main-session.d.ts +0 -32
  44. package/lib/types/client/native-panel.d.ts +0 -48
  45. package/lib/types/client/pending-verify.d.ts +0 -47
  46. package/lib/types/client/plugin-card-seat.d.ts +0 -110
  47. package/lib/types/client/schedule-presets.d.ts +0 -10
  48. package/lib/types/client/schedule-zone.d.ts +0 -97
  49. package/lib/types/client/seats.d.ts +0 -18
  50. package/lib/types/client/service.d.ts +0 -35
  51. package/lib/types/client/settings-entry-form.d.ts +0 -49
  52. package/lib/types/client/settings-form.d.ts +0 -235
  53. package/lib/types/core/attachment.d.ts +0 -132
  54. package/lib/types/core/card-defaults.d.ts +0 -78
  55. package/lib/types/core/controller.d.ts +0 -422
  56. package/lib/types/core/degraded-reason.d.ts +0 -46
  57. package/lib/types/core/execution-summary.d.ts +0 -52
  58. package/lib/types/core/extension.d.ts +0 -399
  59. package/lib/types/core/freeze-snapshot.d.ts +0 -71
  60. package/lib/types/core/handover.d.ts +0 -70
  61. package/lib/types/core/issue-form.d.ts +0 -16
  62. package/lib/types/core/launch-width.d.ts +0 -31
  63. package/lib/types/core/package-name.d.ts +0 -9
  64. package/lib/types/core/poll-cadence.d.ts +0 -31
  65. package/lib/types/core/reasoning-effort.d.ts +0 -57
  66. package/lib/types/core/schedule.d.ts +0 -124
  67. package/lib/types/core/session-reuse.d.ts +0 -30
  68. package/lib/types/core/spend-budget.d.ts +0 -28
  69. package/lib/types/core/store.d.ts +0 -64
  70. package/lib/types/core/subtask.d.ts +0 -204
  71. package/lib/types/core/tasks.d.ts +0 -685
  72. package/lib/types/core/use-cases/task-archive.d.ts +0 -20
  73. package/lib/types/core/use-cases/task-create.d.ts +0 -32
  74. package/lib/types/core/use-cases/task-delete.d.ts +0 -27
  75. package/lib/types/core/use-cases/task-parent.d.ts +0 -21
  76. package/lib/types/core/use-cases/task-schedule.d.ts +0 -96
  77. package/lib/types/core/use-cases/task-tag.d.ts +0 -84
  78. package/lib/types/core/use-cases/task-update.d.ts +0 -77
  79. package/lib/types/core/verification-budget.d.ts +0 -52
  80. package/lib/types/core/verification.d.ts +0 -753
  81. package/lib/types/core/wire-projection.d.ts +0 -35
  82. package/lib/types/core/workspace-target.d.ts +0 -61
  83. package/lib/types/dsh-home.d.ts +0 -16
  84. package/lib/types/host/agent-tools.d.ts +0 -27
  85. package/lib/types/host/attachments.d.ts +0 -250
  86. package/lib/types/host/extension-registry.d.ts +0 -151
  87. package/lib/types/host/launch-admission.d.ts +0 -71
  88. package/lib/types/host/llm-dispatch.d.ts +0 -63
  89. package/lib/types/host/verification-gate.d.ts +0 -95
  90. package/lib/types/host/verification-runner.d.ts +0 -139
  91. package/lib/types/host/workspace-evidence.d.ts +0 -53
  92. package/lib/types/host-ai.d.ts +0 -51
  93. package/lib/types/host-ledger.d.ts +0 -452
  94. package/lib/types/host-routes.d.ts +0 -99
  95. package/lib/types/host-runner.d.ts +0 -401
  96. package/lib/types/host-service.d.ts +0 -517
  97. package/lib/types/host-spend.d.ts +0 -52
  98. package/lib/types/http.d.ts +0 -59
  99. package/lib/types/index.d.ts +0 -441
  100. package/lib/types/loopback.d.ts +0 -64
  101. package/lib/types/mount-once.d.ts +0 -55
  102. package/lib/types/power-inhibitor.d.ts +0 -73
  103. package/lib/types/protocol.d.ts +0 -253
  104. package/lib/types/tool-surface.d.ts +0 -72
@@ -1,24 +0,0 @@
1
- import type { ExecutionRecord } from '../../core/tasks.ts';
2
- import { type TaskBoardKey } from '../locales.ts';
3
- /** Rows shown before the history asks to be expanded. */
4
- export declare const VISIBLE_EXECUTIONS = 5;
5
- /** Execution outcome → locale key, shared with the history's folded summary. */
6
- /**
7
- * A recorded failure text in the reader's own language, for the refusals the
8
- * board itself produces and can therefore translate. Any other text is the
9
- * Host's own sentence and is printed verbatim.
10
- * @param error - the execution's recorded failure text.
11
- * @returns the localized refusal, or the original text.
12
- */
13
- export declare function failureText(error: string): string;
14
- export declare const EXECUTION_RESULT_KEY: Record<NonNullable<ExecutionRecord['result']>, TaskBoardKey>;
15
- /**
16
- * Render one card's execution history.
17
- * @param props - the card's executions, its time zone and the session jump.
18
- * @returns the newest rows, the disclosure for the rest, and nothing else.
19
- */
20
- export declare function ExecutionLog({ executions, timeZone, onOpenSession }: {
21
- executions: readonly ExecutionRecord[];
22
- timeZone?: string;
23
- onOpenSession: (sessionId: string) => void;
24
- }): import("react").JSX.Element;
@@ -1,14 +0,0 @@
1
- import type { BoardController } from '../../core/controller.ts';
2
- import { type TaskRecord } from '../../core/tasks.ts';
3
- import { type OverlayPhase } from './overlay.tsx';
4
- /** Link-subtask overlay props. */
5
- export interface LinkSubtaskModalProps {
6
- controller: BoardController;
7
- /** The task the picked card becomes a subtask of. */
8
- parent: TaskRecord;
9
- onClose: () => void;
10
- /** Which leg of the enter/exit motion pair the surface is on. */
11
- phase?: OverlayPhase;
12
- }
13
- /** Link-subtask overlay. */
14
- export declare function LinkSubtaskModal({ controller, parent, onClose, phase }: LinkSubtaskModalProps): import("react").JSX.Element;
@@ -1,26 +0,0 @@
1
- import type { BoardController } from '../../core/controller.ts';
2
- import { type TaskRecord } from '../../core/tasks.ts';
3
- import type { OverlayPhase } from './overlay.tsx';
4
- export interface NewTaskModalProps {
5
- controller: BoardController;
6
- onClose: () => void;
7
- /** Optional task template to clone/duplicate from. */
8
- initialTask?: TaskRecord;
9
- /**
10
- * Workspace the board's project filter has selected (#1536): a task created
11
- * while a project is open belongs to that project unless the user changes it.
12
- */
13
- defaultWorkspaceId?: string;
14
- /** Optional callback after successful duplication (e.g. to archive source). */
15
- onDuplicateSuccess?: (sourceTaskId: string) => Promise<void>;
16
- /**
17
- * Task the new card becomes a subtask of ("add subtask" from its detail
18
- * view). The execution targets start from the parent's and the create action
19
- * carries the parent link; unset targets inherit again at run time.
20
- */
21
- parentTask?: TaskRecord;
22
- /** Which leg of the enter/exit motion pair the surface is on. */
23
- phase?: OverlayPhase;
24
- }
25
- /** New-task form overlay. */
26
- export declare function NewTaskModal({ controller, onClose, initialTask, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps): import("react").JSX.Element;
@@ -1,25 +0,0 @@
1
- /**
2
- * Reasoning-effort field: one picker shared by both execution-target editors
3
- * (the create dialog and the detail page), so the two never describe the same
4
- * capability differently. The levels are the ones the picked model's catalog
5
- * entry declares; an empty value is a real choice — "follow the model or Host
6
- * default" — and is the default state.
7
- *
8
- * A stored level the roster no longer lists (the model left the roster, or its
9
- * adapter changed) stays shown and labelled, but is not offered again, so the
10
- * field never silently shows a different value than the one the card will ask
11
- * for while the choosable set stays exactly the levels the model declares.
12
- */
13
- import type { ExecutionModelOption } from '../../core/controller.ts';
14
- /** The controlled reasoning-effort picker. */
15
- export declare function ReasoningEffortField({ models, modelId, value, pending, onChange }: {
16
- /** The roster the picked model is looked up in. */
17
- models: readonly ExecutionModelOption[];
18
- /** The model this card pins; '' means "no pin". */
19
- modelId: string;
20
- /** The selected effort; '' means "follow the model or Host default". */
21
- value: string;
22
- /** Whether a mutation is in flight (the field locks with the rest of the form). */
23
- pending: boolean;
24
- onChange: (next: string) => void;
25
- }): import("react").JSX.Element;
@@ -1,26 +0,0 @@
1
- import type { BoardController } from '../../core/controller.ts';
2
- import { type TaskRecord } from '../../core/tasks.ts';
3
- import { type OverlayPhase } from './overlay.tsx';
4
- /** One label as the manager lists it: its definition plus how many tasks carry it. */
5
- export interface TagUsage {
6
- name: string;
7
- promptPrefix?: string;
8
- /** Tasks carrying the label right now. */
9
- count: number;
10
- }
11
- /**
12
- * Labels in use, in board order (first occurrence wins, exactly like the
13
- * filter row), each with its usage count.
14
- * @param tasks - the whole ledger (board and archive).
15
- * @returns one row per label.
16
- */
17
- export declare function tagUsage(tasks: readonly TaskRecord[]): TagUsage[];
18
- /** Label-manager overlay props. */
19
- export interface TagManagerModalProps {
20
- controller: BoardController;
21
- onClose: () => void;
22
- /** Which leg of the enter/exit motion pair the surface is on. */
23
- phase?: OverlayPhase;
24
- }
25
- /** Label-manager overlay. */
26
- export declare function TagManagerModal({ controller, onClose, phase }: TagManagerModalProps): import("react").JSX.Element;
@@ -1,26 +0,0 @@
1
- import { type BoardController } from '../../core/controller.ts';
2
- import { type TaskRecord } from '../../core/tasks.ts';
3
- /** Sentinel option value of the project row's "register a new project" entry. */
4
- export declare const NEW_PROJECT_VALUE = "__dsh_new_project__";
5
- /**
6
- * Case-insensitive title/description/tag/freeze-snapshot/provider-payload match.
7
- *
8
- * A leading `#` is dropped from the needle. Providers render their own
9
- * identifiers with that prefix (`#1758`) and the board attaches no meaning to
10
- * it: stripping it keeps the identifier searchable exactly as it is written on
11
- * screen, without the board learning any provider's vocabulary.
12
- */
13
- export declare function matchesFilter(task: TaskRecord, filter: string): boolean;
14
- /**
15
- * Whether a task carries every selected label (issue #1521). Multi-select is
16
- * conjunctive: adding a label narrows the board instead of widening it, which
17
- * is the only reading that keeps "工作" selected from dragging unrelated cards
18
- * back in when a second label is added.
19
- */
20
- export declare function matchesTagFilter(task: TaskRecord, selected: readonly string[]): boolean;
21
- /** Cards a grouped column renders before the oldest group folds. */
22
- export declare const COLUMN_FOLD_THRESHOLD = 30;
23
- /** Board component; subscribes to the controller snapshot. */
24
- export declare function TaskBoard({ controller }: {
25
- controller: BoardController;
26
- }): import("react").JSX.Element;
@@ -1,36 +0,0 @@
1
- import type { TaskRecord } from '../../core/tasks.ts';
2
- /** Compact relative/absolute time label. */
3
- export declare function formatHostTimestamp(ms: number, timeZone?: string): string;
4
- export declare function formatTime(ms: number, timeZone?: string): string;
5
- /**
6
- * Card time label: relative within a day, otherwise the calendar date read in
7
- * the Host time zone (the same zone the tooltip and the detail view use), so a
8
- * card never shows a browser-local date beside a Host-zone tooltip.
9
- * @param ms - the instant.
10
- * @param timeZone - Host IANA zone; absent uses the browser zone.
11
- * @param now - the current instant.
12
- */
13
- export declare function formatCardTime(ms: number, timeZone?: string, now?: number): string;
14
- declare function TaskCardInner({ task, pending, timeZone, onClick, onOpenSession, compact, subtaskCount, isSubtask, subtasksDone, subtasksRunning, subtasksFailed, }: {
15
- task: TaskRecord;
16
- pending: boolean;
17
- timeZone?: string;
18
- onClick: () => void;
19
- /** Open an execution session; absent renders the session mark inert. */
20
- onOpenSession?: (sessionId: string) => void;
21
- /** Single-line density used by long settled columns. */
22
- compact?: boolean;
23
- /** Direct subtasks of this card, shown as a badge (0 hides it). */
24
- subtaskCount?: number;
25
- /** Whether this card is itself a subtask. */
26
- isSubtask?: boolean;
27
- /** Direct subtasks already settled as done, for the roll-up badge. */
28
- subtasksDone?: number;
29
- /** Direct subtasks currently running, for the roll-up badge. */
30
- subtasksRunning?: number;
31
- /** Direct subtasks that failed, for the roll-up badge. */
32
- subtasksFailed?: number;
33
- }): import("react").JSX.Element;
34
- /** Memoized card: re-renders only when the card's own task record changes. */
35
- export declare const TaskCard: import("react").MemoExoticComponent<typeof TaskCardInner>;
36
- export {};
@@ -1,9 +0,0 @@
1
- import type { BoardController } from '../../core/controller.ts';
2
- import { type TaskRecord } from '../../core/tasks.ts';
3
- import { type OverlayPhase } from './overlay.tsx';
4
- /** Task detail overlay. */
5
- export declare function TaskDetail({ controller, task, phase }: {
6
- controller: BoardController;
7
- task: TaskRecord;
8
- phase?: OverlayPhase;
9
- }): import("react").JSX.Element;
@@ -1,76 +0,0 @@
1
- /**
2
- * Shared task-modal pieces: the overlay shell (backdrop, form, title, error,
3
- * footer) and the title/description/prompt field trio used by both the
4
- * NewTaskModal and the EditTaskModal. State stays in the owning modal; these
5
- * are controlled components.
6
- */
7
- import { type ReactNode } from 'react';
8
- import { type TaskTag } from '../../core/tasks.ts';
9
- import { type OverlayPhase } from './overlay.tsx';
10
- /** Modal overlay: closes on backdrop press, submits through the form. */
11
- export declare function ModalShell({ ariaLabel, title, error, pending, submitLabel, onSubmit, onClose, secondaryAction, phase, children, }: {
12
- ariaLabel: string;
13
- title: string;
14
- error: string | undefined;
15
- pending: boolean;
16
- submitLabel: string;
17
- onSubmit: () => void;
18
- onClose: () => void;
19
- /** Optional second action beside the primary submit (e.g. create and run). */
20
- secondaryAction?: {
21
- label: string;
22
- onSubmit: () => void;
23
- };
24
- /** Which leg of the enter/exit motion pair the surface is on. */
25
- phase?: OverlayPhase;
26
- children: ReactNode;
27
- }): import("react").JSX.Element;
28
- /**
29
- * One collapsible region of a task form (create/edit dialog UX): the form
30
- * groups its configuration into a few regions instead of stacking every field
31
- * in one long column, so a normal-sized dialog needs no scrollbar. A collapsed
32
- * region keeps a one-line summary of the values it holds, so nothing is hidden
33
- * without a trace; a region holding a blocking error is forced open by its
34
- * owner (forceOpen) rather than reporting the error out of sight.
35
- *
36
- * The body is the panel fold's body under another name: it enters and leaves on
37
- * the same animation pair, and `usePresence` keeps it mounted through the exit
38
- * leg so collapsing never snaps.
39
- */
40
- export declare function CollapsibleSection({ title, summary, defaultOpen, forceOpen, children, }: {
41
- title: string;
42
- /** One-line value preview rendered only while the region is collapsed. */
43
- summary?: string | undefined;
44
- /** Whether the region starts expanded (the owner's default layout). */
45
- defaultOpen?: boolean;
46
- /** Open regardless of the stored state: an error inside must stay visible. */
47
- forceOpen?: boolean;
48
- children: ReactNode;
49
- }): import("react").JSX.Element;
50
- /** Title + description + prompt fields shared by the new and edit task forms. */
51
- export declare function TaskContentFields({ title, description, prompt, onTitleChange, onDescriptionChange, onPromptChange, }: {
52
- title: string;
53
- description: string;
54
- prompt: string;
55
- /** Receives the new title; the owner also clears its error state. */
56
- onTitleChange: (value: string) => void;
57
- onDescriptionChange: (value: string) => void;
58
- onPromptChange: (value: string) => void;
59
- }): import("react").JSX.Element;
60
- /**
61
- * Task labels (issue #1521): one row per label holding the badge name and an
62
- * optional execution hint. The name inputs offer the labels already used on the
63
- * board through a datalist, and picking one adopts its hint when the row has
64
- * none — so a business line is defined once and reused by every later task.
65
- */
66
- export declare function TaskTagFields({ tags, knownTags, onChange, }: {
67
- tags: TaskTag[];
68
- /** Labels already carried elsewhere on the board. */
69
- knownTags: TaskTag[];
70
- onChange: (tags: TaskTag[]) => void;
71
- }): import("react").JSX.Element;
72
- /**
73
- * Clean a tag list via normalizeTags: trim, drop blanks and duplicates, cap
74
- * lengths and count, so the wire always carries a valid tag list.
75
- */
76
- export declare function cleanTags(tags: readonly TaskTag[]): TaskTag[];
@@ -1,10 +0,0 @@
1
- import { type ExecutionVerification } from '../../core/verification.ts';
2
- /**
3
- * Render one execution's acceptance report.
4
- * @param props - the execution's persisted acceptance block.
5
- * @returns the verdict badge with its fold-out detail, or nothing when
6
- * acceptance never applied.
7
- */
8
- export declare function VerificationReport({ verification }: {
9
- verification: ExecutionVerification;
10
- }): import("react").JSX.Element | null;
@@ -1,113 +0,0 @@
1
- /**
2
- * Card view model: the pure derivations a task card renders from its record.
3
- *
4
- * Everything here is a function of the task record (plus the clock and the
5
- * Host time zone for the recency groups), so the card stays a thin renderer and
6
- * every rule is unit-testable without mounting React. Nothing here writes the
7
- * record: the type prefix, the tone and the time label are presentation only.
8
- *
9
- * @module @fish-under-sea/dsh-client-ui-task-board-fish/client/board/card-view
10
- */
11
- import { type ExecutionOutcome, type ExecutionRecord, type TaskRecord, type TaskStatus } from '../../core/tasks.ts';
12
- import type { TaskBoardKey } from '../locales.ts';
13
- /** A title split into its bracketed type prefix and the remaining text. */
14
- export interface TitleParts {
15
- /** Bracketed type prefix such as `Bug` from `[Bug]: ...`; absent when none. */
16
- kind?: string;
17
- /** Title text without the prefix (the whole title when there is no prefix). */
18
- text: string;
19
- }
20
- /**
21
- * Split an issue-form style type prefix off a title. The prefix becomes a
22
- * badge, so the clamped title lines carry the text the reader scans for. A
23
- * title that is only a prefix keeps its full text.
24
- * @param summary - the plain-text title.
25
- * @returns the prefix (when present) and the remaining title text.
26
- */
27
- export declare function splitTitleKind(summary: string): TitleParts;
28
- /** Stripe tone of a card: the state of its latest execution. */
29
- export type CardTone = 'running' | ExecutionOutcome;
30
- /** What the card reports about its latest execution. */
31
- export interface CardOutcome {
32
- /** Stripe tone; absent on an archived card or a card that never ran. */
33
- tone?: CardTone;
34
- /** The latest execution record, when the card ran at least once. */
35
- latest?: ExecutionRecord;
36
- /**
37
- * The column disagrees with the latest settled run: a card in Done whose last
38
- * run did not succeed, or a card in Failed whose last run succeeded. The
39
- * column was then set by hand or by a provider (a closed issue), and the
40
- * card says so instead of letting a red run count read as a contradiction.
41
- */
42
- declared: boolean;
43
- }
44
- /**
45
- * Derive the card's execution outcome.
46
- * @param task - the task record.
47
- * @param archived - whether the card renders in the archive view.
48
- */
49
- export declare function cardOutcome(task: TaskRecord, archived: boolean): CardOutcome;
50
- /** Locale key of the latest settled result shown before the run count. */
51
- export declare const RESULT_KEY: Record<ExecutionOutcome, TaskBoardKey>;
52
- /** The one time a card shows, and what that time means. */
53
- export interface CardTimeline {
54
- /** Locale key with a `{time}` placeholder. */
55
- key: TaskBoardKey;
56
- /** The instant (ms epoch). */
57
- at: number;
58
- }
59
- /**
60
- * Pick the time that tells cards in the same column apart. `updatedAt` moves
61
- * on every provider sync, so a column of synced cards would all read
62
- * "updated 4m"; each column instead shows the instant its cards differ by:
63
- * planning columns the creation time, an executing card its start, settled
64
- * columns the latest run's settlement, the archive the archive time.
65
- * @param task - the task record.
66
- * @param archived - whether the card renders in the archive view.
67
- */
68
- export declare function cardTimeline(task: TaskRecord, archived: boolean): CardTimeline;
69
- /** Recency bucket of a settled card. */
70
- export type RecencyGroup = 'today' | 'week' | 'earlier';
71
- /** Group order, newest first. */
72
- export declare const RECENCY_GROUPS: readonly RecencyGroup[];
73
- /** Locale key of each recency group header. */
74
- export declare const RECENCY_KEY: Record<RecencyGroup, TaskBoardKey>;
75
- /**
76
- * Bucket an instant: the same Host calendar day as now, the last seven days, or
77
- * earlier.
78
- * @param at - the instant to bucket.
79
- * @param now - the current instant.
80
- * @param timeZone - Host IANA zone the calendar day is read in.
81
- */
82
- export declare function recencyGroup(at: number, now: number, timeZone?: string): RecencyGroup;
83
- /** One recency group and its items, newest first. */
84
- export interface RecencyBucket<T> {
85
- group: RecencyGroup;
86
- items: T[];
87
- }
88
- /**
89
- * Sort items newest first and split them into recency groups; empty groups are
90
- * omitted.
91
- * @param items - the items to group.
92
- * @param at - the instant each item is ordered and bucketed by.
93
- * @param now - the current instant.
94
- * @param timeZone - Host IANA zone.
95
- */
96
- export declare function groupByRecency<T>(items: readonly T[], at: (item: T) => number, now: number, timeZone?: string): RecencyBucket<T>[];
97
- /** Columns that render compact by default: the long settled column. */
98
- export declare const DEFAULT_COMPACT_COLUMNS: readonly TaskStatus[];
99
- /** Browser storage key of the per-column density choice. */
100
- export declare const COMPACT_COLUMNS_KEY = "dsh.taskBoard.compactColumns.v1";
101
- /**
102
- * Read the columns the user set to compact. A missing, unreadable or malformed
103
- * value falls back to the default rather than failing the board.
104
- * @param storage - browser storage (absent outside a browser).
105
- */
106
- export declare function readCompactColumns(storage: Pick<Storage, 'getItem'> | undefined): TaskStatus[];
107
- /**
108
- * Persist the compact columns; a storage failure (quota, privacy mode) only
109
- * loses the preference.
110
- * @param storage - browser storage (absent outside a browser).
111
- * @param columns - the compact columns.
112
- */
113
- export declare function writeCompactColumns(storage: Pick<Storage, 'setItem'> | undefined, columns: readonly TaskStatus[]): void;
@@ -1,32 +0,0 @@
1
- /**
2
- * The board's own vector glyphs.
3
- *
4
- * Every control glyph the board draws comes from here, so one action always
5
- * has one metaphor and one stroke recipe: a 16-unit viewBox, `currentColor`,
6
- * 1.3 stroke, round caps and joins — the same recipe the sidebar panel glyph
7
- * (`native-panel.tsx`) uses, which is why the board's chrome and its sidebar
8
- * row read as one product. Icon-only controls pass a localized `title` and an
9
- * accessible name at the call site; the glyph itself is always decorative.
10
- *
11
- * @module @fish-under-sea/dsh-client-ui-task-board-fish/client/board/icons
12
- */
13
- import type { ReactElement } from 'react';
14
- /** Props of one board glyph: the shared recipe plus an explicit pixel size. */
15
- export interface BoardIconProps {
16
- /** Rendered square edge in CSS pixels. */
17
- size?: number;
18
- }
19
- /** Leave the board: the back-to-chat chevron. */
20
- export declare function IconChevronLeft(props: BoardIconProps): ReactElement;
21
- /** Dismiss a transient surface. */
22
- export declare function IconClose(props: BoardIconProps): ReactElement;
23
- /** Add: create a task, a label row, or a subtask. */
24
- export declare function IconPlus(props: BoardIconProps): ReactElement;
25
- /** Open the execution's session transcript. */
26
- export declare function IconSession(props: BoardIconProps): ReactElement;
27
- /** Switch a column to single-line cards. */
28
- export declare function IconCompactRows(props: BoardIconProps): ReactElement;
29
- /** Switch a column back to full cards. */
30
- export declare function IconExpandRows(props: BoardIconProps): ReactElement;
31
- /** A scheduled run: the recurrence mark on a card. */
32
- export declare function IconClock(props: BoardIconProps): ReactElement;
@@ -1,87 +0,0 @@
1
- /**
2
- * Execution model options: the picker rows built from the official
3
- * `session/modelCatalog` reply, and the reasoning-effort derivation both
4
- * execution-target editors read off them (the create dialog and the detail
5
- * page share one contract here, so they cannot promise different levels).
6
- *
7
- * The pickers must offer each model's real reasoning levels, which only the
8
- * catalog declares — so the reply is normalized once, here, instead of every
9
- * picker re-reading the wire shape. The fallback discovery path carries no
10
- * capability metadata at all; its rows stay silent about reasoning rather than
11
- * claiming a model supports none.
12
- *
13
- * This module also owns the one display form a model row is shown in: the
14
- * model name, then the provider that publishes it. Two providers may publish
15
- * one model name, and they are two different routes, so a picker that shows
16
- * only the name offers two identical rows. Every picker and every collapsed
17
- * summary reads the label from here, so they cannot drift apart.
18
- */
19
- import type { ExecutionModelOption } from '../../core/controller.ts';
20
- import type { TaskBoardKey } from '../locales.ts';
21
- /**
22
- * Normalize a `session/modelCatalog` reply into picker rows: one row per model
23
- * of every provider group, keyed by the qualified route an execution pins.
24
- * @param value - the raw catalog reply.
25
- * @returns the rows, empty when the reply is unreadable.
26
- */
27
- export declare function modelOptionsFromCatalog(value: unknown): ExecutionModelOption[];
28
- /**
29
- * Normalize the flat `llm/discoverModels` list into picker rows. That reply
30
- * names models only, so every row leaves the reasoning capability unknown.
31
- * @param value - the raw discovery list.
32
- * @returns the rows, empty when the list is unreadable.
33
- */
34
- export declare function modelOptionsFromDiscoveredModels(value: unknown): ExecutionModelOption[];
35
- /**
36
- * The display form of one model row: the model name first, then the provider
37
- * that publishes it, joined by " · ".
38
- *
39
- * Two providers publishing one model name are two different routes, so the
40
- * provider belongs in the label — otherwise the picker offers two identical
41
- * rows and the operator cannot tell which route a card would pin. A row
42
- * without a provider (the flat discovery fallback names models only) keeps
43
- * its bare name, and a row that carries no name of its own shows the model
44
- * part of its own qualified route, so the provider is never printed twice.
45
- * @param model - the roster row.
46
- * @returns the label every model picker row and every collapsed summary shows.
47
- */
48
- export declare function modelDisplayLabel(model: ExecutionModelOption): string;
49
- /**
50
- * The picker rows of a model roster: the qualified `provider/model` route as
51
- * the value a pin stores, and the shared display form as the label, so two
52
- * providers offering one model name stay distinguishable.
53
- * @param models - the roster rows.
54
- * @returns the choice rows, in roster order.
55
- */
56
- export declare function modelChoiceRows(models: readonly ExecutionModelOption[]): Array<{
57
- value: string;
58
- label: string;
59
- }>;
60
- /**
61
- * The capability row the roster publishes for one model route.
62
- * @returns undefined when no model is pinned, or the roster does not describe
63
- * the pinned one — an unknown model is not the same as a model without
64
- * reasoning.
65
- */
66
- export declare function reasoningOfModel(models: readonly ExecutionModelOption[], modelId: string): ExecutionModelOption['reasoning'] | undefined;
67
- /**
68
- * The effort ids the picker offers for a model, in catalog order.
69
- * @returns an empty list when the model is unpinned, unknown, declares no
70
- * reasoning, or publishes no selectable level.
71
- */
72
- export declare function reasoningEffortsFor(models: readonly ExecutionModelOption[], modelId: string): string[];
73
- /** Whether the effort picker may be operated: a pinned model with declared, selectable levels. */
74
- export declare function reasoningPickerEnabled(models: readonly ExecutionModelOption[], modelId: string): boolean;
75
- /**
76
- * The effort to keep when the picked model changes. Only a model that declares
77
- * its levels can invalidate one: a model the roster cannot describe keeps the
78
- * stored value, because the roster has no grounds to call it invalid.
79
- * @param effort - the effort currently stored/selected ('' = follow the default).
80
- * @returns the effort to keep.
81
- */
82
- export declare function reconcileReasoningEffort(models: readonly ExecutionModelOption[], modelId: string, effort: string): string;
83
- /**
84
- * The copy explaining why the picker is in its current state. One lookup for
85
- * both editors, so the create dialog and the detail page never drift apart.
86
- */
87
- export declare function reasoningHintKey(models: readonly ExecutionModelOption[], modelId: string): TaskBoardKey;
@@ -1,69 +0,0 @@
1
- /**
2
- * Shared behavior of the board's transient surfaces (the task detail overlay
3
- * and every modal that opens above it).
4
- *
5
- * Two concerns live here because they are one contract:
6
- *
7
- * - `usePresence` keeps a surface mounted through its exit leg. The board's
8
- * overlays are mounted by a boolean at the call site; the moment that
9
- * boolean flips the node would vanish, so the enter animation had no
10
- * reverse. Presence turns the boolean into `open` -> `closing` -> gone and
11
- * paints the phase on the surface, which is what the CSS transition pair
12
- * reads. Dimensions never change across the pair, so nothing around the
13
- * overlay reflows.
14
- * - `useDialog` owns the keyboard and focus contract of a modal surface:
15
- * focus moves into the dialog when it opens and returns to the control that
16
- * opened it when it closes, Tab cycles inside it, and Escape asks the owner
17
- * to close.
18
- *
19
- * @module @fish-under-sea/dsh-client-ui-task-board-fish/client/board/overlay
20
- */
21
- import { type MouseEvent } from 'react';
22
- /**
23
- * Exit duration in milliseconds. It matches `--dsh-tb-motion-close` in
24
- * `board.module.css`; under `prefers-reduced-motion` the stylesheet keeps the
25
- * same duration and drops only the spatial travel, so the unmount delay stays
26
- * valid for both motion settings.
27
- */
28
- export declare const OVERLAY_EXIT_MS = 140;
29
- /** Lifecycle phase of one transient surface. */
30
- export type OverlayPhase = 'open' | 'closing';
31
- /** Presence of one transient surface. */
32
- export interface OverlayPresence {
33
- /** Whether the surface should render at all (true through the exit leg). */
34
- mounted: boolean;
35
- /** Which leg of the motion pair the surface is on. */
36
- phase: OverlayPhase;
37
- }
38
- /**
39
- * Keep a surface mounted until its exit transition has run.
40
- *
41
- * `open=false` starts the exit leg immediately (the surface paints
42
- * `data-state="closing"`) and unmounts it one exit duration later. Re-opening
43
- * during the exit leg cancels the unmount, so a fast toggle never leaves a
44
- * half-faded surface behind.
45
- * @param open - the owner's mount request.
46
- * @param exitMs - exit duration; defaults to {@link OVERLAY_EXIT_MS}.
47
- * @returns the mount decision and the phase to paint.
48
- */
49
- export declare function usePresence(open: boolean, exitMs?: number): OverlayPresence;
50
- /** The dialog's keyboard/focus handle. */
51
- export interface DialogHandle<T extends HTMLElement> {
52
- /** Callback ref for the dialog element itself (it must accept focus). */
53
- attach: (node: T | null) => void;
54
- /** Backdrop press handler: closes only on a press of the backdrop itself. */
55
- onMouseDown: (event: MouseEvent<HTMLElement>) => void;
56
- }
57
- /**
58
- * Bind a modal surface's keyboard and focus contract.
59
- *
60
- * Focus enters the dialog on mount (its first focusable control, or the dialog
61
- * itself) and returns to the control that opened it on unmount. Tab wraps
62
- * inside the dialog, and Escape asks the owner to close — but only while the
63
- * surface is on its enter leg, so a repeat press during the exit cannot queue
64
- * a second close.
65
- * @param onClose - the owner's close request.
66
- * @param phase - the surface's current motion phase.
67
- * @returns the ref to attach and the backdrop press handler.
68
- */
69
- export declare function useDialog<T extends HTMLElement>(onClose: () => void, phase: OverlayPhase): DialogHandle<T>;
@@ -1,4 +0,0 @@
1
- /** The remembered parse model; '' means the Host default (or no preference). */
2
- export declare function readParseModelPreference(storage?: Pick<Storage, 'getItem'> | undefined): string;
3
- /** Remember the picked parse model; '' records the Host-default choice. */
4
- export declare function writeParseModelPreference(model: string, storage?: Pick<Storage, 'setItem'> | undefined): void;
@@ -1,43 +0,0 @@
1
- /**
2
- * Display-only labels for the agent-preset roster, shared by the task form and
3
- * the detail view.
4
- *
5
- * The deployment's four built-in presets (the `standard` / `ptc` / `minimal` /
6
- * `cordis` rows the shipped web-app bundle declares) carry no display name in
7
- * the registry roster, so a picker would list bare ids beside the user presets.
8
- * The map below only supplies names for those four; any other id — a renamed
9
- * built-in, a community preset, a user preset — falls back to the roster name
10
- * and then to the id, so this table can never hide or mislabel a preset.
11
- */
12
- import type { ExecutionPresetOption } from '../../core/controller.ts';
13
- /** Whether one roster row is a shipped built-in preset. */
14
- export declare function isBuiltinPreset(id: string): boolean;
15
- /** Display label of one preset row: built-in label, roster name, or raw id. */
16
- export declare function presetLabel(preset: Pick<ExecutionPresetOption, 'id' | 'name'>): string;
17
- /**
18
- * Label of the empty ("inherit") choice: names the preset a run actually lands
19
- * on when the card pins nothing, which is the deployment default the roster
20
- * marks with `isDefault`.
21
- */
22
- export declare function inheritPresetLabel(presets: readonly ExecutionPresetOption[]): string;
23
- /** One preset row a picker renders: the stored id, its label, and whether it may be picked. */
24
- export interface PresetChoiceRow {
25
- /** The value a pin stores. */
26
- id: string;
27
- /** Display label, already carrying the default and unavailable suffixes. */
28
- label: string;
29
- /** True when the preset cannot compose a session: the row is shown but not selectable. */
30
- disabled: boolean;
31
- }
32
- /**
33
- * The picker rows of one roster, split into the built-in and the user presets.
34
- * Both pickers render these rows — the create dialog's mode select and the
35
- * settings card's default-preset field — so their wording and their
36
- * unavailable rows cannot drift apart.
37
- * @param presets - the roster options.
38
- * @returns one row list per group, in roster order.
39
- */
40
- export declare function presetChoiceRows(presets: readonly ExecutionPresetOption[]): {
41
- builtin: PresetChoiceRow[];
42
- custom: PresetChoiceRow[];
43
- };