@linxin666/dsh-client-ui-task-board-team 0.0.0-stage → 0.4.14
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/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +66 -2
- package/README.zh.md +67 -0
- package/cordis.patch.yml +14 -0
- package/icon.svg +3 -0
- package/lib/client.js +1490 -0
- package/lib/index.js +2968 -0
- package/lib/types/client/PluginSettingsCard.d.ts +255 -0
- package/lib/types/client/RangeBubble.d.ts +46 -0
- package/lib/types/client/SegmentGroup.d.ts +28 -0
- package/lib/types/client/index.d.ts +58 -0
- package/lib/types/client/locales.d.ts +90 -0
- package/lib/types/client/optional-service.d.ts +22 -0
- package/lib/types/client/settings-form.d.ts +235 -0
- package/lib/types/client/team/extension.d.ts +29 -0
- package/lib/types/client/team/sections.d.ts +38 -0
- package/lib/types/client/team/settings.d.ts +67 -0
- package/lib/types/client/team/summary.d.ts +34 -0
- package/lib/types/core/contract.d.ts +269 -0
- package/lib/types/core/hub-protocol.d.ts +175 -0
- package/lib/types/core/identity.d.ts +96 -0
- package/lib/types/core/mirror.d.ts +51 -0
- package/lib/types/core/question-report.d.ts +84 -0
- package/lib/types/core/settlement.d.ts +49 -0
- package/lib/types/core/task-record.d.ts +59 -0
- package/lib/types/core/timers.d.ts +20 -0
- package/lib/types/host/bindings.d.ts +92 -0
- package/lib/types/host/channel.d.ts +44 -0
- package/lib/types/host/credentials.d.ts +63 -0
- package/lib/types/host/extension.d.ts +57 -0
- package/lib/types/host/hub-client.d.ts +157 -0
- package/lib/types/host/questions.d.ts +105 -0
- package/lib/types/host/service.d.ts +209 -0
- package/lib/types/host/setup.d.ts +152 -0
- package/lib/types/host/tools.d.ts +19 -0
- package/lib/types/host/waterfall.d.ts +39 -0
- package/lib/types/index.d.ts +152 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +84 -3
- package/src/client/PluginSettingsCard.tsx +838 -0
- package/src/client/RangeBubble.tsx +164 -0
- package/src/client/SegmentGroup.tsx +93 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/index.ts +139 -0
- package/src/client/locales.ts +168 -0
- package/src/client/optional-service.ts +30 -0
- package/src/client/settings-card.module.css +821 -0
- package/src/client/settings-form.ts +510 -0
- package/src/client/team/extension.ts +185 -0
- package/src/client/team/sections.tsx +159 -0
- package/src/client/team/settings.tsx +348 -0
- package/src/client/team/summary.ts +156 -0
- package/src/client/team/team.module.css +193 -0
- package/src/core/contract.ts +326 -0
- package/src/core/hub-protocol.ts +217 -0
- package/src/core/identity.ts +193 -0
- package/src/core/mirror.ts +88 -0
- package/src/core/question-report.ts +144 -0
- package/src/core/settlement.ts +84 -0
- package/src/core/task-record.ts +65 -0
- package/src/core/timers.ts +34 -0
- package/src/host/bindings.ts +211 -0
- package/src/host/channel.ts +97 -0
- package/src/host/credentials.ts +147 -0
- package/src/host/extension.ts +197 -0
- package/src/host/hub-client.ts +287 -0
- package/src/host/questions.ts +275 -0
- package/src/host/service.ts +1421 -0
- package/src/host/setup.ts +259 -0
- package/src/host/tools.ts +70 -0
- package/src/host/waterfall.ts +51 -0
- package/src/index.ts +452 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Family-shared chrome for plugin settings cards: a disclosure header naming
|
|
3
|
+
* the plugin and what its settings govern, the controls inside, and the line
|
|
4
|
+
* that reports a refused write. A pick is written the moment it is made and a
|
|
5
|
+
* typed value after a pause, so the card has no save button and nothing waits
|
|
6
|
+
* on the reader. Renders nothing while the namespace is unavailable — a
|
|
7
|
+
* deployment that does not compose the owning plugin should show no trace of
|
|
8
|
+
* it. Inlined into each consumer's client bundle; mirrors the official
|
|
9
|
+
* ui-plugin-config PluginCard in a self-contained slice.
|
|
10
|
+
*
|
|
11
|
+
* Every field inside the body is one settings row: the label and its hint on
|
|
12
|
+
* the left, the control on the right, a hairline between two rows; a narrow
|
|
13
|
+
* card stacks the control under the text (settings-card.module.css).
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import type { CardShell } from './settings-form.ts';
|
|
17
|
+
/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */
|
|
18
|
+
export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.readOnly", "settings.saveFailed"];
|
|
19
|
+
/** Copy key the card chrome itself reads. */
|
|
20
|
+
export type CardCopyKey = (typeof CARD_COPY_KEYS)[number];
|
|
21
|
+
/** Key domain for the plugin's own copy (inferred per consumer). */
|
|
22
|
+
export type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey;
|
|
23
|
+
/** Card chrome shared by every plugin settings card. */
|
|
24
|
+
export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
25
|
+
/** Locale reader for this card's copy. */
|
|
26
|
+
t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string;
|
|
27
|
+
/** Locale key of the plugin's name. */
|
|
28
|
+
titleKey: TKey;
|
|
29
|
+
/** Locale key of the line describing what this plugin's settings govern. */
|
|
30
|
+
descriptionKey: TKey;
|
|
31
|
+
/** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
|
|
32
|
+
descriptionNode?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Locale key of the full sentence behind a shortened description: when
|
|
35
|
+
* present, the header's native `title` takes this text while the visible
|
|
36
|
+
* line keeps `descriptionKey`/`descriptionNode`, so a compact card can
|
|
37
|
+
* compress the sentence without keeping a second visible copy of it.
|
|
38
|
+
* Defaults to the description key.
|
|
39
|
+
*/
|
|
40
|
+
descriptionTitleKey?: TKey;
|
|
41
|
+
/**
|
|
42
|
+
* Optional leading mark identifying the plugin. A card without one keeps the
|
|
43
|
+
* plain official header shape, so the chrome stays a readable sibling of the
|
|
44
|
+
* built-in PluginCard wherever a family plugin lands in the official bundle
|
|
45
|
+
* seat.
|
|
46
|
+
*/
|
|
47
|
+
icon?: ReactNode;
|
|
48
|
+
/** The card's form state: availability, writability, and how the last write went. */
|
|
49
|
+
state: CardShell;
|
|
50
|
+
/** Write every pending draft now: a text field's Enter or blur. */
|
|
51
|
+
onSave: () => void;
|
|
52
|
+
/** Drop every pending draft: a text field's Escape. */
|
|
53
|
+
onDiscard: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Id applied to the card's title element, so a header control (an immediate
|
|
56
|
+
* toggle in `headerAction`) can name itself through `aria-labelledby`
|
|
57
|
+
* instead of repeating the title as a string.
|
|
58
|
+
*/
|
|
59
|
+
titleId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Render the header only, with no body region. A card whose whole setting is
|
|
62
|
+
* the header control (a switch whose explanation is the description) has no
|
|
63
|
+
* controls to lay out below it, and an empty body would draw a divider line
|
|
64
|
+
* with nothing under it.
|
|
65
|
+
*/
|
|
66
|
+
headerOnly?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Render the controls expanded on arrival (still collapsible). Defaults to
|
|
69
|
+
* true: promoted first-level sections show their settings immediately.
|
|
70
|
+
*/
|
|
71
|
+
defaultOpen?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Render without the collapse affordance: a static header and an always
|
|
74
|
+
* visible body. Used by first-level settings sections whose nav entry
|
|
75
|
+
* already provides the selection.
|
|
76
|
+
*/
|
|
77
|
+
alwaysOpen?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Hide the line under the body that reports a refused write: a card whose
|
|
80
|
+
* body applies its own changes (an embedded external settings section)
|
|
81
|
+
* reports its own failures.
|
|
82
|
+
*/
|
|
83
|
+
hideFooter?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Optional control rendered at the header's trailing edge, before the
|
|
86
|
+
* chevron. A card whose setting is one immediate flip (it
|
|
87
|
+
* applies outside the card's form) puts its ToggleSwitch here, so the control
|
|
88
|
+
* is reachable without opening the card and matches a plugin card's shape.
|
|
89
|
+
*/
|
|
90
|
+
headerAction?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Render children even when the settings namespace is not exposed by the
|
|
93
|
+
* host. The 'not exposed' notice still explains the card above them; a card
|
|
94
|
+
* that wants the rows alone hides it through `hideNotExposedNotice`.
|
|
95
|
+
*/
|
|
96
|
+
renderChildrenWhenNotExposed?: boolean;
|
|
97
|
+
/** Hide the 'not exposed' notice, whichever branch renders the card body. */
|
|
98
|
+
hideNotExposedNotice?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Compact chrome for a topic card rendered inside another card's body: a
|
|
101
|
+
* smaller title, a tighter header and body inset, and a one-line description
|
|
102
|
+
* whose full text stays on the header's own title. Defaults to the
|
|
103
|
+
* first-level chrome, which is unchanged.
|
|
104
|
+
*/
|
|
105
|
+
density?: 'nested';
|
|
106
|
+
/** The plugin's controls. */
|
|
107
|
+
children: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Render one plugin settings card.
|
|
111
|
+
* @param props - the plugin's copy keys, its form state, and its controls.
|
|
112
|
+
* @returns the card, or nothing while the namespace is still loading.
|
|
113
|
+
*/
|
|
114
|
+
export declare function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>): import("react").JSX.Element | null;
|
|
115
|
+
/** Props every field control needs regardless of its value type. */
|
|
116
|
+
export interface FieldProps {
|
|
117
|
+
/** Stable id associating the label with its control. */
|
|
118
|
+
id: string;
|
|
119
|
+
/** Visible label. */
|
|
120
|
+
label: string;
|
|
121
|
+
/** One-line explanation rendered under the control. */
|
|
122
|
+
hint: string;
|
|
123
|
+
/**
|
|
124
|
+
* Full sentence behind the visible hint, exposed as the paragraph's native
|
|
125
|
+
* `title` so a card can shorten the line without losing the text. Omitted:
|
|
126
|
+
* the paragraph carries no title attribute at all.
|
|
127
|
+
*/
|
|
128
|
+
hintTitle?: string;
|
|
129
|
+
/** Draft text this control renders. */
|
|
130
|
+
text: string;
|
|
131
|
+
/** True when the field holds a user-layer entry over the inherited value. */
|
|
132
|
+
overridden: boolean;
|
|
133
|
+
/** True when the draft is not a value this field accepts. */
|
|
134
|
+
invalid: boolean;
|
|
135
|
+
/** Copy for the overridden badge. */
|
|
136
|
+
overriddenLabel: string;
|
|
137
|
+
/** Copy for the reset control. */
|
|
138
|
+
resetLabel: string;
|
|
139
|
+
/** Copy shown in place of the hint while the draft is invalid. */
|
|
140
|
+
invalidLabel: string;
|
|
141
|
+
/** Disables every control (read-only document, or an unavailable namespace). */
|
|
142
|
+
disabled: boolean;
|
|
143
|
+
/** Take new draft text; the card writes it as the field's entry rule says. */
|
|
144
|
+
onEdit: (text: string) => void;
|
|
145
|
+
/** Clear the field at once so it re-inherits the composition layer. */
|
|
146
|
+
onReset: () => void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A typed value field. Its draft is written after a pause in typing, at once on
|
|
150
|
+
* Enter or when focus leaves, and Escape puts the stored value back. `numeric`
|
|
151
|
+
* only hints the keypad: which drafts a field accepts is decided by its spec.
|
|
152
|
+
* A field given a `range` also offers the coarse slider bubble: dragging fills
|
|
153
|
+
* the draft live and releasing writes it.
|
|
154
|
+
*/
|
|
155
|
+
export declare function ValueField(props: FieldProps & {
|
|
156
|
+
/** Hints a numeric keypad without narrowing what the control accepts. */
|
|
157
|
+
numeric?: boolean;
|
|
158
|
+
/** Placeholder shown while the draft is empty. */
|
|
159
|
+
placeholder?: string;
|
|
160
|
+
/** Bounds of a numeric field, for the coarse slider; the spec still judges every draft. */
|
|
161
|
+
range?: {
|
|
162
|
+
min: number;
|
|
163
|
+
max: number;
|
|
164
|
+
step: number;
|
|
165
|
+
};
|
|
166
|
+
}): import("react").JSX.Element;
|
|
167
|
+
interface SelectOption {
|
|
168
|
+
value: string;
|
|
169
|
+
label: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The shared dual-mode select control. While an appearance skin is active it
|
|
173
|
+
* renders the legacy native `<select>` untouched, so element-level skin
|
|
174
|
+
* selectors keep working; under the default appearance it renders a
|
|
175
|
+
* self-drawn `role="listbox"` popup whose open/close is transition-animated.
|
|
176
|
+
* Cards reach it through BooleanField/ChoiceField; editors outside a card
|
|
177
|
+
* (the side-card prefs) bind it directly through onEdit.
|
|
178
|
+
* 双模式下拉框:皮肤激活时用原生 select,默认外观用自绘动画弹层。
|
|
179
|
+
*/
|
|
180
|
+
export declare function SelectField(props: {
|
|
181
|
+
id: string;
|
|
182
|
+
options: ReadonlyArray<SelectOption>;
|
|
183
|
+
value: string;
|
|
184
|
+
disabled: boolean;
|
|
185
|
+
invalid: boolean;
|
|
186
|
+
onEdit: (text: string) => void;
|
|
187
|
+
}): import("react").JSX.Element;
|
|
188
|
+
/**
|
|
189
|
+
* A visible segmented group for a small set of mutually exclusive values.
|
|
190
|
+
* Every option stays on screen, so inherit/on/off and short enum fields take
|
|
191
|
+
* one click without opening a popup. The pressed option carries the group's
|
|
192
|
+
* sliding highlight and `aria-pressed`; the group takes the field label as its
|
|
193
|
+
* accessible name.
|
|
194
|
+
*/
|
|
195
|
+
export declare function SegmentField(props: {
|
|
196
|
+
id: string;
|
|
197
|
+
label: string;
|
|
198
|
+
options: ReadonlyArray<SelectOption>;
|
|
199
|
+
value: string;
|
|
200
|
+
disabled: boolean;
|
|
201
|
+
invalid: boolean;
|
|
202
|
+
onEdit: (text: string) => void;
|
|
203
|
+
}): import("react").JSX.Element;
|
|
204
|
+
/** How a small single-choice field presents its options. */
|
|
205
|
+
export type FieldPresentation = 'select' | 'segment';
|
|
206
|
+
/** A boolean field: 继承 / 开 / 关. */
|
|
207
|
+
export declare function BooleanField(props: FieldProps & {
|
|
208
|
+
/** Copy for the inherit option. */
|
|
209
|
+
inheritLabel: string;
|
|
210
|
+
/** Copy for the on option. */
|
|
211
|
+
onLabel: string;
|
|
212
|
+
/** Copy for the off option. */
|
|
213
|
+
offLabel: string;
|
|
214
|
+
/** Defaults to the visible segments: the three answers always fit on one row. */
|
|
215
|
+
presentation?: FieldPresentation;
|
|
216
|
+
}): import("react").JSX.Element;
|
|
217
|
+
/** An enumerated field, selecting or segmenting its small choice set. */
|
|
218
|
+
export declare function ChoiceField(props: FieldProps & {
|
|
219
|
+
/** Copy for the inherit option (draft text is the empty string). */
|
|
220
|
+
inheritLabel: string;
|
|
221
|
+
/** Choices rendered in order; `value` is the draft/stored text. */
|
|
222
|
+
choices: ReadonlyArray<{
|
|
223
|
+
value: string;
|
|
224
|
+
label: string;
|
|
225
|
+
}>;
|
|
226
|
+
/**
|
|
227
|
+
* Visible segmented options for a short fixed set; defaults to the compact
|
|
228
|
+
* select, which also suits a list whose length follows the deployment.
|
|
229
|
+
*/
|
|
230
|
+
presentation?: FieldPresentation;
|
|
231
|
+
}): import("react").JSX.Element;
|
|
232
|
+
/**
|
|
233
|
+
* A boolean toggle drawn as a switch track, for a setting that is only on or
|
|
234
|
+
* off and applies on flip. It is a real button with
|
|
235
|
+
* `role="switch"` and `aria-checked`, so keyboard and assistive activation
|
|
236
|
+
* arrive as a click and the state is announced instead of inferred from a
|
|
237
|
+
* checkbox tick.
|
|
238
|
+
*
|
|
239
|
+
* The thumb bounces across only once the reader has pressed this switch: the
|
|
240
|
+
* press writes the mark that arms the bounce, so a page opening, a TAB
|
|
241
|
+
* switching back or a value arriving from elsewhere draws every thumb at rest.
|
|
242
|
+
*/
|
|
243
|
+
export declare function ToggleSwitch(props: {
|
|
244
|
+
/** Id of the element naming the switch (the card's title). */
|
|
245
|
+
labelledBy?: string;
|
|
246
|
+
/** Accessible name when no element labels it. */
|
|
247
|
+
ariaLabel?: string;
|
|
248
|
+
/** Current state. */
|
|
249
|
+
checked: boolean;
|
|
250
|
+
/** Disables the switch while a write is in flight or the Host refuses writes. */
|
|
251
|
+
disabled?: boolean;
|
|
252
|
+
/** Called with the requested next state. */
|
|
253
|
+
onChange: (next: boolean) => void;
|
|
254
|
+
}): import("react").JSX.Element;
|
|
255
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coarse adjustment for a bounded number: resting the pointer on the control
|
|
3
|
+
* (or moving focus into it) raises a small bubble holding a slider across the
|
|
4
|
+
* field's whole range, so a large change is one drag instead of many presses
|
|
5
|
+
* or a retyped value. The control itself stays the precise entry.
|
|
6
|
+
*
|
|
7
|
+
* The bubble belongs to the anchor's subtree, so moving from the control onto
|
|
8
|
+
* the bubble never counts as leaving. It opens after a short rest and closes a
|
|
9
|
+
* moment after the pointer and focus have both gone, so crossing the control
|
|
10
|
+
* on the way elsewhere does not flash it. While a drag is in progress the
|
|
11
|
+
* bubble stays put even if the pointer strays off it.
|
|
12
|
+
*
|
|
13
|
+
* Dragging reports each value through `onInput`, so the field shows it live;
|
|
14
|
+
* releasing the thumb, or a key press on it, reports `onCommit` once. The
|
|
15
|
+
* bubble opens on the side of the control that has room inside the nearest
|
|
16
|
+
* scrolling ancestor, so a row near the top of a settings page does not hang
|
|
17
|
+
* its bubble under the page edge.
|
|
18
|
+
*/
|
|
19
|
+
import { type ReactNode } from 'react';
|
|
20
|
+
/** Props of {@link RangeBubble}. */
|
|
21
|
+
export interface RangeBubbleProps {
|
|
22
|
+
/** Lowest value the slider reaches. */
|
|
23
|
+
min: number;
|
|
24
|
+
/** Highest value the slider reaches. */
|
|
25
|
+
max: number;
|
|
26
|
+
/** Slider granularity. */
|
|
27
|
+
step: number;
|
|
28
|
+
/** Current value; a value outside the range parks the thumb at the nearer end. */
|
|
29
|
+
value: number;
|
|
30
|
+
/** Accessible name of the slider. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Disables the bubble along with the control. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Each value while the thumb moves. */
|
|
35
|
+
onInput: (value: number) => void;
|
|
36
|
+
/** The value the thumb was released on, once per drag or key press. */
|
|
37
|
+
onCommit: (value: number) => void;
|
|
38
|
+
/** The precise control the bubble hangs off. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Render the control with its coarse-adjustment bubble.
|
|
43
|
+
* @param props - the range, the value and the two report callbacks.
|
|
44
|
+
* @returns the anchor holding the control and the bubble.
|
|
45
|
+
*/
|
|
46
|
+
export declare function RangeBubble(props: RangeBubbleProps): ReactNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The family's segmented control: a quiet track whose options share one
|
|
3
|
+
* highlight that slides to the pressed option, instead of each option fading
|
|
4
|
+
* its own background out and the next one in. The settings fields' small
|
|
5
|
+
* choices and the Web Extensions TAB strip both render through it, so the two
|
|
6
|
+
* read as one control.
|
|
7
|
+
*
|
|
8
|
+
* The caller builds the option buttons and marks the pressed one with
|
|
9
|
+
* `data-active`; the group measures that button after every render and writes
|
|
10
|
+
* its box as four custom properties, and the stylesheet draws the highlight
|
|
11
|
+
* there (`.segmentGroup[data-pill]::before`). Attribute and first placement
|
|
12
|
+
* land in the same task, so the highlight appears in place and only later
|
|
13
|
+
* changes slide. A ResizeObserver re-measures when the group or an option
|
|
14
|
+
* changes size: a longer locale, a font arriving, a container growing, a
|
|
15
|
+
* strip wrapping onto a second line.
|
|
16
|
+
*/
|
|
17
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
18
|
+
/** Props of {@link SegmentGroup}: the track's own attributes and the option buttons. */
|
|
19
|
+
export interface SegmentGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
/** The option buttons; the pressed one carries `data-active`. */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Render a segmented track around the caller's option buttons.
|
|
25
|
+
* @param props - the track's attributes (role, accessible name, key handler) and its options.
|
|
26
|
+
* @returns the track.
|
|
27
|
+
*/
|
|
28
|
+
export declare function SegmentGroup(props: SegmentGroupProps): ReactNode;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser half of the task-board team provider extension.
|
|
3
|
+
*
|
|
4
|
+
* It registers this extension's copy, then contributes three seats: the card
|
|
5
|
+
* decoration and the task-detail section (both behind the extension's own
|
|
6
|
+
* switch, which is read from the settings form), and the configuration block
|
|
7
|
+
* inside the board's own settings card (behind the board service alone, because
|
|
8
|
+
* that block is where the switch and the Host Token live).
|
|
9
|
+
*
|
|
10
|
+
* Failure policy: a missing slot registry, locale service or board service is
|
|
11
|
+
* handled, never thrown — the web shell fails the whole boot when a plugin apply
|
|
12
|
+
* throws, and one external plugin must not take the GUI down.
|
|
13
|
+
*
|
|
14
|
+
* @module dsh-task-board-team/client
|
|
15
|
+
*/
|
|
16
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
17
|
+
import { type TeamKey } from './locales.ts';
|
|
18
|
+
/** Locale namespace this half owns. */
|
|
19
|
+
export declare const NS = "task-board-team";
|
|
20
|
+
/** Settings namespace the block edits. */
|
|
21
|
+
export declare const SETTINGS_NAMESPACE = "task-board-team";
|
|
22
|
+
/** Profile entry ids this package's patch rows carry, most specific first. */
|
|
23
|
+
export declare const ENTRY_IDS: readonly string[];
|
|
24
|
+
/** The settings value this extension's own form carries. */
|
|
25
|
+
export interface TeamSettingsValue {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
29
|
+
interface SlotMap {
|
|
30
|
+
/** Provider task-detail section; the board declares and renders it. */
|
|
31
|
+
'task-board.detail.section': {
|
|
32
|
+
kind: 'list';
|
|
33
|
+
scope: 'root';
|
|
34
|
+
owner: import('../core/contract.ts').TaskBoardDetailSectionProps;
|
|
35
|
+
};
|
|
36
|
+
/** Provider settings section; the board declares and renders it. */
|
|
37
|
+
'task-board.settings.section': {
|
|
38
|
+
kind: 'list';
|
|
39
|
+
scope: 'root';
|
|
40
|
+
owner: import('../core/contract.ts').TaskBoardSettingsSectionProps;
|
|
41
|
+
};
|
|
42
|
+
/** Provider card decoration; the board declares and renders it. */
|
|
43
|
+
'task-board.card.decoration': {
|
|
44
|
+
kind: 'list';
|
|
45
|
+
scope: 'root';
|
|
46
|
+
owner: import('../core/contract.ts').TaskBoardCardDecorationProps;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface LocaleNamespaceMap {
|
|
50
|
+
/** The team provider extension copy. */
|
|
51
|
+
'task-board-team': TeamKey;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Mount the extension's browser half.
|
|
56
|
+
* @param ctx - the browser plugin context.
|
|
57
|
+
*/
|
|
58
|
+
export declare function apply(ctx: ClientContext): void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy of the team provider's browser half.
|
|
3
|
+
*
|
|
4
|
+
* The Chinese dictionary is the key source: every other locale tracks exactly
|
|
5
|
+
* these keys (the repository gate enforces parity), and no user-facing string is
|
|
6
|
+
* written inline in a component. The third language is carried centrally by
|
|
7
|
+
* dsh-i18n, which is why this module ships zh and en only.
|
|
8
|
+
*
|
|
9
|
+
* @module dsh-task-board-team/client/locales
|
|
10
|
+
*/
|
|
11
|
+
export declare const zh: {
|
|
12
|
+
readonly 'section.title': "团队协作";
|
|
13
|
+
readonly 'section.description': "把云端 team-hub 指派给本机 dsh-agents 成员的 issue 领成看板镜像卡并在本机执行";
|
|
14
|
+
readonly 'section.hub': "Hub 地址";
|
|
15
|
+
readonly 'section.team': "团队 ID";
|
|
16
|
+
readonly 'section.token': "Host Token";
|
|
17
|
+
readonly 'section.token.configured': "已配置(保存在宿主侧,不回显)";
|
|
18
|
+
readonly 'section.token.missing': "未配置";
|
|
19
|
+
readonly 'section.token.placeholder': "粘贴 Host Token,保存后只在宿主侧使用";
|
|
20
|
+
readonly 'section.token.placeholderShort': "粘贴 Token";
|
|
21
|
+
readonly 'section.token.save': "保存 Token";
|
|
22
|
+
readonly 'section.token.clear': "清除 Token";
|
|
23
|
+
readonly 'section.agents': "团队 Agent 绑定";
|
|
24
|
+
readonly 'section.agents.empty': "尚未绑定任何 dsh-agents 成员,本机不会领取任何团队任务";
|
|
25
|
+
readonly 'section.agents.hint': "填写 dsh-agents 的成员 ID,用逗号分隔";
|
|
26
|
+
readonly 'section.questionWait': "本地兜底等待(分钟)";
|
|
27
|
+
readonly 'section.questionWait.hint': "0 = 不设本地上限,一直等到 hub 给出终态(回答、过期或撤回)";
|
|
28
|
+
readonly 'section.save': "保存设置";
|
|
29
|
+
readonly 'section.saved': "已保存";
|
|
30
|
+
readonly 'section.refresh': "立即领取";
|
|
31
|
+
readonly 'section.connection': "连接状态";
|
|
32
|
+
readonly 'section.connection.idle': "未启动";
|
|
33
|
+
readonly 'section.connection.connecting': "正在注册";
|
|
34
|
+
readonly 'section.connection.online': "在线";
|
|
35
|
+
readonly 'section.connection.reconnecting': "正在重连";
|
|
36
|
+
readonly 'section.connection.error': "连接失败";
|
|
37
|
+
readonly 'section.host': "主机";
|
|
38
|
+
readonly 'section.heartbeat': "最近心跳";
|
|
39
|
+
readonly 'section.reconnects': "重连次数";
|
|
40
|
+
readonly 'section.capabilities': "能力";
|
|
41
|
+
readonly 'section.capability.followUp': "后续消息投递";
|
|
42
|
+
readonly 'section.capability.rework': "同会话返工";
|
|
43
|
+
readonly 'section.capability.run': "自动开始执行";
|
|
44
|
+
readonly 'section.capability.available': "可用";
|
|
45
|
+
readonly 'section.capability.missing': "不可用";
|
|
46
|
+
readonly 'section.capability.followUpMissing': "当前看板版本不提供 followUp,评论里 @ 本机 Agent 时只能记在活动流里";
|
|
47
|
+
readonly 'section.capability.reworkMissing': "当前看板版本不提供 rework,收到返工请求时只记录,不会重跑";
|
|
48
|
+
readonly 'section.capability.runMissing': "当前看板版本不提供执行入口,领取到的卡片需要人工在看板上开始";
|
|
49
|
+
readonly 'section.capability.presetPin': "建卡时钉住预设与模型";
|
|
50
|
+
readonly 'section.capability.presetPinMissing': "当前看板版本无法在建卡时钉住 Agent 预设、模型与思考档位,因此领取到的镜像卡没有启动,需要人工处理";
|
|
51
|
+
readonly 'section.problems': "配置问题";
|
|
52
|
+
readonly 'settings.collapse': "收起设置";
|
|
53
|
+
readonly 'settings.expand': "展开设置";
|
|
54
|
+
readonly 'settings.notExposed': "当前版本未向设置页暴露本扩展的配置命名空间,配置表单不可用。";
|
|
55
|
+
readonly 'settings.readOnly': "当前部署的设置只读。";
|
|
56
|
+
readonly 'settings.saveFailed': "部署未接受这次改动。";
|
|
57
|
+
readonly 'detail.title': "团队协作";
|
|
58
|
+
readonly 'detail.issue': "团队 issue";
|
|
59
|
+
readonly 'detail.assignee': "负责人";
|
|
60
|
+
readonly 'detail.reviewer': "审阅人";
|
|
61
|
+
readonly 'detail.agent': "执行 Agent";
|
|
62
|
+
readonly 'detail.status': "Hub 状态";
|
|
63
|
+
readonly 'detail.comments': "评论";
|
|
64
|
+
readonly 'detail.activity': "活动";
|
|
65
|
+
readonly 'detail.pending': "待回答的问题";
|
|
66
|
+
readonly 'detail.empty': "暂无";
|
|
67
|
+
readonly 'detail.error': "最近错误";
|
|
68
|
+
readonly 'status.todo': "待办";
|
|
69
|
+
readonly 'status.assigned': "已分配";
|
|
70
|
+
readonly 'status.waiting_host': "等待执行节点";
|
|
71
|
+
readonly 'status.running': "执行中";
|
|
72
|
+
readonly 'status.in_review': "待审阅";
|
|
73
|
+
readonly 'status.done': "已完成";
|
|
74
|
+
readonly 'status.canceled': "已取消";
|
|
75
|
+
readonly 'status.failed': "失败";
|
|
76
|
+
readonly unavailable: "本扩展的团队配置尚不可用";
|
|
77
|
+
};
|
|
78
|
+
export type TeamKey = keyof typeof zh;
|
|
79
|
+
export declare const en: Record<TeamKey, string>;
|
|
80
|
+
/**
|
|
81
|
+
* Install the runtime translate seat.
|
|
82
|
+
* @param bound - the locale-bound lookup of this namespace.
|
|
83
|
+
*/
|
|
84
|
+
export declare function setRuntimeTranslate(bound: (key: TeamKey) => string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Translate one key of this namespace.
|
|
87
|
+
* @param key - dictionary key.
|
|
88
|
+
* @returns the localized string.
|
|
89
|
+
*/
|
|
90
|
+
export declare function t(key: TeamKey): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional service access for the browser half.
|
|
3
|
+
*
|
|
4
|
+
* The web shell's context throws when a plugin reads a service it did not
|
|
5
|
+
* declare in its inject contract — an entry that wants to tolerate a deployment
|
|
6
|
+
* without a settings surface or slot registry therefore cannot read those names
|
|
7
|
+
* as plain properties. `ctx.get` resolves the same service without the inject
|
|
8
|
+
* requirement, and answers undefined when nothing serves it.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-task-board-team/client/optional-service
|
|
11
|
+
*/
|
|
12
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
13
|
+
/**
|
|
14
|
+
* Read one optional service by name, outside the inject contract.
|
|
15
|
+
*
|
|
16
|
+
* One external plugin must never take the GUI down: an unsupported read is
|
|
17
|
+
* reported as "no such service" instead of reaching the shell's boot check.
|
|
18
|
+
* @param ctx - the browser plugin context.
|
|
19
|
+
* @param name - the service name to resolve.
|
|
20
|
+
* @returns the service, or undefined when this deployment serves none.
|
|
21
|
+
*/
|
|
22
|
+
export declare function optionalService(ctx: ClientContext, name: string): unknown;
|