@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.en.md +6 -4
- package/README.md +6 -4
- package/README.zh.md +6 -4
- package/icon.png +0 -0
- package/lib/client.js +4428 -1508
- package/lib/client.js.map +1 -1
- package/lib/index.js +2670 -496
- package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
- package/lib/types/client/PluginSettingsCard.d.ts +130 -19
- package/lib/types/client/RangeBubble.d.ts +46 -0
- package/lib/types/client/SegmentGroup.d.ts +28 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
- package/lib/types/client/board/AttachmentField.d.ts +70 -0
- package/lib/types/client/board/ExecutionLog.d.ts +24 -0
- package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
- package/lib/types/client/board/TaskForm.d.ts +4 -0
- package/lib/types/client/board/VerificationReport.d.ts +2 -15
- package/lib/types/client/board/model-options.d.ts +87 -0
- package/lib/types/client/board/preset-label.d.ts +21 -0
- package/lib/types/client/board/preset-roster.d.ts +45 -0
- package/lib/types/client/board/source-group.d.ts +27 -0
- package/lib/types/client/body-mutations.d.ts +45 -0
- package/lib/types/client/host-api.d.ts +25 -0
- package/lib/types/client/locales.d.ts +87 -9
- package/lib/types/client/pending-verify.d.ts +47 -0
- package/lib/types/client/plugin-card-seat.d.ts +3 -1
- package/lib/types/client/service.d.ts +4 -1
- package/lib/types/client/settings-form.d.ts +73 -51
- package/lib/types/core/attachment.d.ts +132 -0
- package/lib/types/core/card-defaults.d.ts +78 -0
- package/lib/types/core/controller.d.ts +57 -8
- package/lib/types/core/execution-summary.d.ts +52 -0
- package/lib/types/core/extension.d.ts +116 -0
- package/lib/types/core/launch-width.d.ts +31 -0
- package/lib/types/core/reasoning-effort.d.ts +57 -0
- package/lib/types/core/session-reuse.d.ts +7 -1
- package/lib/types/core/spend-budget.d.ts +28 -0
- package/lib/types/core/subtask.d.ts +100 -37
- package/lib/types/core/tasks.d.ts +94 -10
- package/lib/types/core/use-cases/task-create.d.ts +10 -5
- package/lib/types/core/use-cases/task-tag.d.ts +36 -0
- package/lib/types/core/use-cases/task-update.d.ts +22 -1
- package/lib/types/core/wire-projection.d.ts +35 -0
- package/lib/types/core/workspace-target.d.ts +23 -3
- package/lib/types/host/attachments.d.ts +250 -0
- package/lib/types/host/extension-registry.d.ts +40 -0
- package/lib/types/host/launch-admission.d.ts +71 -0
- package/lib/types/host-ledger.d.ts +114 -47
- package/lib/types/host-routes.d.ts +63 -0
- package/lib/types/host-runner.d.ts +164 -18
- package/lib/types/host-service.d.ts +182 -46
- package/lib/types/host-spend.d.ts +52 -0
- package/lib/types/index.d.ts +173 -54
- package/lib/types/loopback.d.ts +41 -1
- package/lib/types/protocol.d.ts +52 -11
- package/lib/types/tool-surface.d.ts +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +36 -29
- package/src/client/CardDefaultPresetField.tsx +101 -0
- package/src/client/PluginSettingsCard.tsx +385 -111
- package/src/client/RangeBubble.tsx +164 -0
- package/src/client/SegmentGroup.tsx +93 -0
- package/src/client/TaskBoardSettingsCard.tsx +332 -37
- package/src/client/board/AttachmentField.tsx +383 -0
- package/src/client/board/EditTaskModal.tsx +63 -0
- package/src/client/board/ExecutionLog.tsx +154 -0
- package/src/client/board/LinkSubtaskModal.tsx +1 -1
- package/src/client/board/NewTaskModal.tsx +154 -45
- package/src/client/board/ReasoningEffortField.tsx +50 -0
- package/src/client/board/TagManagerModal.tsx +151 -2
- package/src/client/board/TaskBoard.tsx +47 -10
- package/src/client/board/TaskCard.tsx +45 -23
- package/src/client/board/TaskDetail.tsx +468 -258
- package/src/client/board/TaskForm.tsx +19 -4
- package/src/client/board/VerificationReport.tsx +143 -104
- package/src/client/board/model-options.ts +208 -0
- package/src/client/board/preset-label.ts +32 -0
- package/src/client/board/preset-roster.ts +58 -0
- package/src/client/board/source-group.ts +94 -0
- package/src/client/board/task-markdown.module.css +11 -8
- package/src/client/board-settings.module.css +35 -7
- package/src/client/board.module.css +1044 -105
- package/src/client/body-mutations.ts +133 -0
- package/src/client/host-api.ts +70 -0
- package/src/client/index.ts +109 -95
- package/src/client/locales.ts +205 -48
- package/src/client/pending-verify.ts +90 -0
- package/src/client/plugin-card-seat.ts +8 -2
- package/src/client/service.ts +24 -0
- package/src/client/settings-card.module.css +466 -89
- package/src/client/settings-entry-form.ts +0 -1
- package/src/client/settings-form.ts +102 -60
- package/src/core/attachment.ts +287 -0
- package/src/core/card-defaults.ts +132 -0
- package/src/core/controller.ts +90 -11
- package/src/core/execution-summary.ts +96 -0
- package/src/core/extension.ts +120 -0
- package/src/core/launch-width.ts +38 -0
- package/src/core/reasoning-effort.ts +92 -0
- package/src/core/session-reuse.ts +7 -1
- package/src/core/spend-budget.ts +35 -0
- package/src/core/store.ts +19 -1
- package/src/core/subtask.ts +144 -68
- package/src/core/tasks.ts +117 -10
- package/src/core/use-cases/task-create.ts +27 -16
- package/src/core/use-cases/task-tag.ts +56 -0
- package/src/core/use-cases/task-update.ts +33 -5
- package/src/core/wire-projection.ts +81 -0
- package/src/core/workspace-target.ts +27 -3
- package/src/host/agent-tools.ts +33 -21
- package/src/host/attachments.ts +650 -0
- package/src/host/extension-registry.ts +150 -5
- package/src/host/launch-admission.ts +139 -0
- package/src/host-ledger.ts +248 -117
- package/src/host-routes.ts +233 -15
- package/src/host-runner.ts +395 -61
- package/src/host-service.ts +512 -139
- package/src/host-spend.ts +105 -0
- package/src/index.ts +312 -92
- package/src/loopback.ts +57 -1
- package/src/protocol.ts +83 -18
- package/src/tool-surface.ts +1 -0
- package/icon.svg +0 -3
|
@@ -10,12 +10,35 @@ import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client'
|
|
|
10
10
|
import { useEffect, useState } from 'react'
|
|
11
11
|
import type { TaskBoardPowerSnapshot, TaskBoardVerificationOptions } from '../protocol.ts'
|
|
12
12
|
import type { TaskBoardExtensionDispatch } from '../core/extension.ts'
|
|
13
|
+
import type { ExecutionPresetOption } from '../core/controller.ts'
|
|
14
|
+
import { TASK_PERMISSIONS } from '../core/tasks.ts'
|
|
13
15
|
import { resolveContract, type ModelCatalogView, type VerificationSettings } from '../core/verification.ts'
|
|
14
16
|
import { parseModelRoute } from '../core/verification.ts'
|
|
17
|
+
import { CardDefaultPresetField } from './CardDefaultPresetField.tsx'
|
|
15
18
|
import { PluginSettingsCard, BooleanField, ChoiceField, ValueField } from './PluginSettingsCard.tsx'
|
|
19
|
+
import {
|
|
20
|
+
modelChoiceRows,
|
|
21
|
+
modelDisplayLabel,
|
|
22
|
+
modelOptionsFromCatalog,
|
|
23
|
+
reasoningEffortsFor,
|
|
24
|
+
reasoningHintKey,
|
|
25
|
+
reasoningPickerEnabled,
|
|
26
|
+
reconcileReasoningEffort,
|
|
27
|
+
} from './board/model-options.ts'
|
|
16
28
|
import { SUBTASK_DEPTH_MAX, SUBTASK_DEPTH_MIN } from '../core/subtask.ts'
|
|
17
29
|
import { SESSION_POLL_MAX_SECONDS, SESSION_POLL_MIN_SECONDS } from '../core/poll-cadence.ts'
|
|
18
|
-
import {
|
|
30
|
+
import { RUN_LAUNCH_WIDTH_MAX, RUN_LAUNCH_WIDTH_MIN } from '../core/launch-width.ts'
|
|
31
|
+
import {
|
|
32
|
+
CardForm,
|
|
33
|
+
booleanField,
|
|
34
|
+
choiceField,
|
|
35
|
+
textField,
|
|
36
|
+
type CardActions,
|
|
37
|
+
type CardShell,
|
|
38
|
+
type FieldSpec,
|
|
39
|
+
type FieldState as CardFieldState,
|
|
40
|
+
} from './settings-form.ts'
|
|
41
|
+
import type { TaskBoardKey } from './locales.ts'
|
|
19
42
|
import settingsCss from './board-settings.module.css'
|
|
20
43
|
|
|
21
44
|
/** The depth choices the card offers, derived from the supported range. */
|
|
@@ -33,6 +56,7 @@ const SUBTASK_DEPTH_CHOICES: readonly string[] = Array.from(
|
|
|
33
56
|
function sessionPollField(): FieldSpec {
|
|
34
57
|
return {
|
|
35
58
|
field: 'sessionPollSeconds',
|
|
59
|
+
entry: 'type',
|
|
36
60
|
format: value => typeof value === 'number' && Number.isInteger(value) ? String(value) : '',
|
|
37
61
|
parse: (text) => {
|
|
38
62
|
const trimmed = text.trim()
|
|
@@ -55,6 +79,7 @@ function sessionPollField(): FieldSpec {
|
|
|
55
79
|
function subtaskDepthField(): FieldSpec {
|
|
56
80
|
return {
|
|
57
81
|
field: 'maxSubtaskDepth',
|
|
82
|
+
entry: 'pick',
|
|
58
83
|
format: value => typeof value === 'number' && Number.isInteger(value) ? String(value) : '',
|
|
59
84
|
parse: (text) => {
|
|
60
85
|
const trimmed = text.trim()
|
|
@@ -65,34 +90,63 @@ function subtaskDepthField(): FieldSpec {
|
|
|
65
90
|
}
|
|
66
91
|
|
|
67
92
|
/**
|
|
68
|
-
* The
|
|
69
|
-
*
|
|
70
|
-
* draft blocks the save instead of
|
|
93
|
+
* The run-launch width field: a whole number of concurrent launches inside the
|
|
94
|
+
* supported range, because the Host schema (`runLaunchWidth`) is numeric. A
|
|
95
|
+
* draft outside the range blocks the save instead of staging a value the Host
|
|
96
|
+
* would clamp behind the user's back.
|
|
71
97
|
*/
|
|
72
|
-
function
|
|
98
|
+
function runLaunchWidthField(): FieldSpec {
|
|
73
99
|
return {
|
|
74
|
-
field: '
|
|
75
|
-
|
|
100
|
+
field: 'runLaunchWidth',
|
|
101
|
+
entry: 'type',
|
|
102
|
+
format: value => typeof value === 'number' && Number.isInteger(value) ? String(value) : '',
|
|
76
103
|
parse: (text) => {
|
|
77
104
|
const trimmed = text.trim()
|
|
78
105
|
if (trimmed === '') return { kind: 'clear' }
|
|
79
|
-
|
|
106
|
+
if (!/^\d+$/.test(trimmed)) return undefined
|
|
107
|
+
const width = Number(trimmed)
|
|
108
|
+
return width >= RUN_LAUNCH_WIDTH_MIN && width <= RUN_LAUNCH_WIDTH_MAX
|
|
109
|
+
? { kind: 'set', value: width }
|
|
110
|
+
: undefined
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The daily token cap field: whole tokens, 0 for "no gate". Every non-negative
|
|
117
|
+
* whole number is a legal cap, so the draft only has to be one; a blank draft
|
|
118
|
+
* clears the entry back to the schema default (0).
|
|
119
|
+
*/
|
|
120
|
+
function spendBudgetField(): FieldSpec {
|
|
121
|
+
return {
|
|
122
|
+
field: 'spendBudgetTokens',
|
|
123
|
+
entry: 'type',
|
|
124
|
+
format: value => typeof value === 'number' && Number.isInteger(value) ? String(value) : '',
|
|
125
|
+
parse: (text) => {
|
|
126
|
+
const trimmed = text.trim()
|
|
127
|
+
if (trimmed === '') return { kind: 'clear' }
|
|
128
|
+
if (!/^\d+$/.test(trimmed)) return undefined
|
|
129
|
+
return { kind: 'set', value: Number(trimmed) }
|
|
80
130
|
},
|
|
81
131
|
}
|
|
82
132
|
}
|
|
83
133
|
|
|
84
134
|
/**
|
|
85
|
-
* The
|
|
86
|
-
*
|
|
87
|
-
*
|
|
135
|
+
* The judge-model field: blank inherits the host model catalog default, and a
|
|
136
|
+
* non-blank draft must be a qualified provider/model route. An unparseable
|
|
137
|
+
* draft blocks the save instead of storing a route nothing can resolve.
|
|
138
|
+
* The new-card default model uses the same gate, so both fields accept exactly
|
|
139
|
+
* the routes an execution can pin.
|
|
88
140
|
*/
|
|
89
|
-
function
|
|
141
|
+
function modelRouteField(field: string): FieldSpec {
|
|
90
142
|
return {
|
|
91
|
-
field
|
|
143
|
+
field,
|
|
144
|
+
entry: 'pick',
|
|
92
145
|
format: value => typeof value === 'string' ? value : '',
|
|
93
146
|
parse: (text) => {
|
|
94
147
|
const trimmed = text.trim()
|
|
95
|
-
|
|
148
|
+
if (trimmed === '') return { kind: 'clear' }
|
|
149
|
+
return parseModelRoute(trimmed) === undefined ? undefined : { kind: 'set', value: trimmed }
|
|
96
150
|
},
|
|
97
151
|
}
|
|
98
152
|
}
|
|
@@ -105,10 +159,26 @@ export interface TaskBoardSettings {
|
|
|
105
159
|
announceToAgent?: boolean
|
|
106
160
|
/** Prevent host idle sleep while sessions run or schedules are armed. */
|
|
107
161
|
preventIdleSleep?: boolean
|
|
162
|
+
/**
|
|
163
|
+
* Whether the operator's own reverse proxy or tunnel may speak for the
|
|
164
|
+
* browser (default off). Volatile, so the board's fence reads it per request.
|
|
165
|
+
*/
|
|
166
|
+
trustForwardedProxy?: boolean
|
|
108
167
|
/** Subtask depth limit (1..3); 1 means a single level of subtasks. */
|
|
109
168
|
maxSubtaskDepth?: number
|
|
110
169
|
/** Roster-poll cadence in seconds while the board has work to reconcile. */
|
|
111
170
|
sessionPollSeconds?: number
|
|
171
|
+
/**
|
|
172
|
+
* How many run launches may be in flight at once (1..16, default 3). One run
|
|
173
|
+
* opens its whole subtree, so this bounds the burst of sessions a single run
|
|
174
|
+
* action creates; members enter the running column in batches, none is dropped.
|
|
175
|
+
*/
|
|
176
|
+
runLaunchWidth?: number
|
|
177
|
+
/**
|
|
178
|
+
* Daily token ceiling for the work this board dispatches; 0 means no gate.
|
|
179
|
+
* Tokens, not money: only DeepSeek's own routes are priced.
|
|
180
|
+
*/
|
|
181
|
+
spendBudgetTokens?: number
|
|
112
182
|
/**
|
|
113
183
|
* GLOBAL native /goal switch (default off): the master control over whether
|
|
114
184
|
* this board starts a run with dsh's built-in /goal at all. Frozen per
|
|
@@ -121,6 +191,20 @@ export interface TaskBoardSettings {
|
|
|
121
191
|
goalVerificationModel?: string
|
|
122
192
|
/** Judge reasoning effort; blank inherits the host default level. */
|
|
123
193
|
goalVerificationReasoningEffort?: string
|
|
194
|
+
/**
|
|
195
|
+
* Agent preset the create dialog of this board opens with. Blank pins
|
|
196
|
+
* nothing, so a new card follows the deployment default as before.
|
|
197
|
+
*/
|
|
198
|
+
cardDefaultMode?: string
|
|
199
|
+
/** Permission the create dialog opens with; blank applies no default. */
|
|
200
|
+
cardDefaultPermission?: string
|
|
201
|
+
/** Execution model route the create dialog opens with; blank applies none. */
|
|
202
|
+
cardDefaultModel?: string
|
|
203
|
+
/**
|
|
204
|
+
* Reasoning level bound to `cardDefaultModel`; it applies only while a
|
|
205
|
+
* card's final model IS that configured route, and is inert without one.
|
|
206
|
+
*/
|
|
207
|
+
cardDefaultReasoningEffort?: string
|
|
124
208
|
}
|
|
125
209
|
|
|
126
210
|
/** What the task-board card renders. */
|
|
@@ -131,10 +215,16 @@ export interface TaskBoardSettingsCardState extends CardShell {
|
|
|
131
215
|
announceToAgent: CardFieldState
|
|
132
216
|
/** Idle-system-sleep protection flag. */
|
|
133
217
|
preventIdleSleep: CardFieldState
|
|
218
|
+
/** Forwarded-request trust flag. */
|
|
219
|
+
trustForwardedProxy: CardFieldState
|
|
134
220
|
/** Subtask depth limit field. */
|
|
135
221
|
maxSubtaskDepth: CardFieldState
|
|
136
222
|
/** Roster-poll cadence field. */
|
|
137
223
|
sessionPollSeconds: CardFieldState
|
|
224
|
+
/** Run-launch admission width field. */
|
|
225
|
+
runLaunchWidth: CardFieldState
|
|
226
|
+
/** Daily token cap field. */
|
|
227
|
+
spendBudgetTokens: CardFieldState
|
|
138
228
|
/** GLOBAL native /goal switch. */
|
|
139
229
|
goalRunEnabled: CardFieldState
|
|
140
230
|
/** Goal-acceptance switch. */
|
|
@@ -143,6 +233,20 @@ export interface TaskBoardSettingsCardState extends CardShell {
|
|
|
143
233
|
goalVerificationModel: CardFieldState
|
|
144
234
|
/** Judge reasoning-effort field. */
|
|
145
235
|
goalVerificationReasoningEffort: CardFieldState
|
|
236
|
+
/** New-card default agent preset. */
|
|
237
|
+
cardDefaultMode: CardFieldState
|
|
238
|
+
/** New-card default permission. */
|
|
239
|
+
cardDefaultPermission: CardFieldState
|
|
240
|
+
/** New-card default model route. */
|
|
241
|
+
cardDefaultModel: CardFieldState
|
|
242
|
+
/** New-card default reasoning level. */
|
|
243
|
+
cardDefaultReasoningEffort: CardFieldState
|
|
244
|
+
/**
|
|
245
|
+
* The deployment's agent-preset roster, published by the runtime read the
|
|
246
|
+
* plugin wires; undefined until it answers, which leaves the default-preset
|
|
247
|
+
* field offering the inherit choice alone.
|
|
248
|
+
*/
|
|
249
|
+
presets?: readonly ExecutionPresetOption[]
|
|
146
250
|
}
|
|
147
251
|
|
|
148
252
|
/** The registration-side face the card's slot entry injects. */
|
|
@@ -159,6 +263,8 @@ export interface TaskBoardSettingsCardFace extends CardActions {
|
|
|
159
263
|
export class TaskBoardSettingsCardController {
|
|
160
264
|
private readonly form: CardForm<TaskBoardSettings>
|
|
161
265
|
private readonly store: SnapshotStore<TaskBoardSettingsCardState>
|
|
266
|
+
/** The deployment's agent-preset roster, once its runtime read has answered. */
|
|
267
|
+
private presets: readonly ExecutionPresetOption[] | undefined
|
|
162
268
|
|
|
163
269
|
/** @param scope - the bound configuration form for the `task-board` namespace. */
|
|
164
270
|
constructor(scope: ConfigForm<TaskBoardSettings>, private readonly dispatch: TaskBoardExtensionDispatch) {
|
|
@@ -166,12 +272,22 @@ export class TaskBoardSettingsCardController {
|
|
|
166
272
|
booleanField('enabled'),
|
|
167
273
|
booleanField('announceToAgent'),
|
|
168
274
|
booleanField('preventIdleSleep'),
|
|
275
|
+
booleanField('trustForwardedProxy'),
|
|
169
276
|
subtaskDepthField(),
|
|
170
277
|
sessionPollField(),
|
|
278
|
+
runLaunchWidthField(),
|
|
279
|
+
spendBudgetField(),
|
|
171
280
|
booleanField('goalRunEnabled'),
|
|
172
281
|
booleanField('goalVerification'),
|
|
173
|
-
|
|
174
|
-
|
|
282
|
+
modelRouteField('goalVerificationModel'),
|
|
283
|
+
textField('goalVerificationReasoningEffort', 'pick'),
|
|
284
|
+
// The new-card defaults: blank is a real value every one of them keeps
|
|
285
|
+
// ("apply no default"), which is why they are applied like any other field
|
|
286
|
+
// and only their parse rules differ.
|
|
287
|
+
textField('cardDefaultMode', 'pick'),
|
|
288
|
+
choiceField('cardDefaultPermission', TASK_PERMISSIONS),
|
|
289
|
+
modelRouteField('cardDefaultModel'),
|
|
290
|
+
textField('cardDefaultReasoningEffort', 'pick'),
|
|
175
291
|
])
|
|
176
292
|
this.store = this.form.bind(() => this.projection())
|
|
177
293
|
}
|
|
@@ -182,15 +298,37 @@ export class TaskBoardSettingsCardController {
|
|
|
182
298
|
enabled: this.form.field('enabled'),
|
|
183
299
|
announceToAgent: this.form.field('announceToAgent'),
|
|
184
300
|
preventIdleSleep: this.form.field('preventIdleSleep'),
|
|
301
|
+
trustForwardedProxy: this.form.field('trustForwardedProxy'),
|
|
185
302
|
maxSubtaskDepth: this.form.field('maxSubtaskDepth'),
|
|
186
303
|
sessionPollSeconds: this.form.field('sessionPollSeconds'),
|
|
304
|
+
runLaunchWidth: this.form.field('runLaunchWidth'),
|
|
305
|
+
spendBudgetTokens: this.form.field('spendBudgetTokens'),
|
|
187
306
|
goalRunEnabled: this.form.field('goalRunEnabled'),
|
|
188
307
|
goalVerification: this.form.field('goalVerification'),
|
|
189
308
|
goalVerificationModel: this.form.field('goalVerificationModel'),
|
|
190
309
|
goalVerificationReasoningEffort: this.form.field('goalVerificationReasoningEffort'),
|
|
310
|
+
cardDefaultMode: this.form.field('cardDefaultMode'),
|
|
311
|
+
cardDefaultPermission: this.form.field('cardDefaultPermission'),
|
|
312
|
+
cardDefaultModel: this.form.field('cardDefaultModel'),
|
|
313
|
+
cardDefaultReasoningEffort: this.form.field('cardDefaultReasoningEffort'),
|
|
314
|
+
...(this.presets === undefined ? {} : { presets: this.presets }),
|
|
191
315
|
}
|
|
192
316
|
}
|
|
193
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Publish the deployment's agent-preset roster to the default-preset field.
|
|
320
|
+
* The roster is a runtime fact read outside this card (src/client/index.ts
|
|
321
|
+
* wires it once for both the board's pickers and this topic); it can arrive
|
|
322
|
+
* late or not at all, and until it does the field lists the inherit choice
|
|
323
|
+
* alone. This never blocks a save: a deployment that serves no roster still
|
|
324
|
+
* has a writable settings document.
|
|
325
|
+
* @param presets - the roster rows.
|
|
326
|
+
*/
|
|
327
|
+
setPresetRoster(presets: readonly ExecutionPresetOption[]): void {
|
|
328
|
+
this.presets = presets
|
|
329
|
+
this.store.set(this.projection())
|
|
330
|
+
}
|
|
331
|
+
|
|
194
332
|
/**
|
|
195
333
|
* Build the face the card's slot registration injects.
|
|
196
334
|
* @returns the card's snapshot and its form actions.
|
|
@@ -279,7 +417,16 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
279
417
|
},
|
|
280
418
|
...catalog.groups.flatMap(group => group.models.map(model => ({
|
|
281
419
|
value: group.id + '/' + model.id,
|
|
282
|
-
|
|
420
|
+
// The shared display form: the model name first, then the provider
|
|
421
|
+
// that publishes it, so two providers offering one model name stay
|
|
422
|
+
// tellable apart.
|
|
423
|
+
label: modelDisplayLabel({
|
|
424
|
+
id: group.id + '/' + model.id,
|
|
425
|
+
name: model.name ?? model.id,
|
|
426
|
+
// The provider is the group id — the same token the route pins,
|
|
427
|
+
// and the one every other model picker names.
|
|
428
|
+
provider: group.id,
|
|
429
|
+
}),
|
|
283
430
|
}))),
|
|
284
431
|
]
|
|
285
432
|
const stagedRoute = parseModelRoute(stagedSettings.model) ?? (inheritRoute === undefined ? undefined : { provider: inheritRoute.provider, model: inheritRoute.model })
|
|
@@ -304,6 +451,25 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
304
451
|
invalidLabel: t('settings.invalidNumber'),
|
|
305
452
|
disabled,
|
|
306
453
|
}
|
|
454
|
+
// The new-card-defaults topic reads the SAME catalog the acceptance fields
|
|
455
|
+
// and the create dialog read (session/modelCatalog, served here through the
|
|
456
|
+
// verification payload), normalized once into the roster the reasoning
|
|
457
|
+
// helpers below consume, so the default level can only offer levels the
|
|
458
|
+
// chosen default model really declares.
|
|
459
|
+
const defaultModels = modelOptionsFromCatalog(catalog)
|
|
460
|
+
const defaultModel = state.cardDefaultModel.text
|
|
461
|
+
const defaultEffortChoices = reasoningEffortsFor(defaultModels, defaultModel)
|
|
462
|
+
.map(effort => ({ value: effort, label: effort }))
|
|
463
|
+
/**
|
|
464
|
+
* Drop a staged default level the newly picked default model cannot honour,
|
|
465
|
+
* exactly as the create dialog's own model picker does (one shared rule):
|
|
466
|
+
* the level belongs to the route it was chosen for.
|
|
467
|
+
*/
|
|
468
|
+
const dropUnhonouredEffort = (nextModel: string): void => {
|
|
469
|
+
const current = state.cardDefaultReasoningEffort.text
|
|
470
|
+
const kept = reconcileReasoningEffort(defaultModels, nextModel, current)
|
|
471
|
+
if (kept !== current) props.edit('cardDefaultReasoningEffort', kept)
|
|
472
|
+
}
|
|
307
473
|
// Chrome state of the nested disclosure cards below: they stage into this
|
|
308
474
|
// card's form and are written by its one save, so they carry no footer and no
|
|
309
475
|
// unsaved pill of their own (the outer header owns the pill).
|
|
@@ -337,7 +503,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
337
503
|
<ul className={settingsCss.nestedCards}>
|
|
338
504
|
<PluginSettingsCard
|
|
339
505
|
t={t}
|
|
340
|
-
|
|
506
|
+
density="nested"
|
|
507
|
+
titleKey="settings.enabledTopic"
|
|
341
508
|
descriptionKey="settings.enabledCardHint"
|
|
342
509
|
defaultOpen={false}
|
|
343
510
|
hideFooter
|
|
@@ -348,7 +515,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
348
515
|
<BooleanField
|
|
349
516
|
id="settings-task-board-enabled"
|
|
350
517
|
label={t('settings.enabled')}
|
|
351
|
-
hint={t('settings.
|
|
518
|
+
hint={t('settings.enabledHintBrief')}
|
|
519
|
+
hintTitle={t('settings.enabledHint')}
|
|
352
520
|
inheritLabel={t('settings.inherit')}
|
|
353
521
|
onLabel={t('settings.on')}
|
|
354
522
|
offLabel={t('settings.off')}
|
|
@@ -360,7 +528,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
360
528
|
<BooleanField
|
|
361
529
|
id="settings-task-board-announce"
|
|
362
530
|
label={t('settings.announceToAgent')}
|
|
363
|
-
hint={t('settings.
|
|
531
|
+
hint={t('settings.announceToAgentHintBrief')}
|
|
532
|
+
hintTitle={t('settings.announceToAgentHint')}
|
|
364
533
|
inheritLabel={t('settings.inherit')}
|
|
365
534
|
onLabel={t('settings.on')}
|
|
366
535
|
offLabel={t('settings.off')}
|
|
@@ -372,7 +541,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
372
541
|
<BooleanField
|
|
373
542
|
id="settings-task-board-prevent-idle-sleep"
|
|
374
543
|
label={t('settings.preventIdleSleep')}
|
|
375
|
-
hint={t('settings.
|
|
544
|
+
hint={t('settings.preventIdleSleepHintBrief')}
|
|
545
|
+
hintTitle={t('settings.preventIdleSleepHint')}
|
|
376
546
|
inheritLabel={t('settings.inherit')}
|
|
377
547
|
onLabel={t('settings.on')}
|
|
378
548
|
offLabel={t('settings.off')}
|
|
@@ -381,11 +551,26 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
381
551
|
onEdit={(text) => { props.edit('preventIdleSleep', text) }}
|
|
382
552
|
onReset={() => { props.resetField('preventIdleSleep') }}
|
|
383
553
|
/>
|
|
554
|
+
<BooleanField
|
|
555
|
+
id="settings-task-board-trust-forwarded-proxy"
|
|
556
|
+
label={t('settings.trustForwardedProxy')}
|
|
557
|
+
hint={t('settings.trustForwardedProxyHintBrief')}
|
|
558
|
+
hintTitle={t('settings.trustForwardedProxyHint')}
|
|
559
|
+
inheritLabel={t('settings.inherit')}
|
|
560
|
+
onLabel={t('settings.on')}
|
|
561
|
+
offLabel={t('settings.off')}
|
|
562
|
+
{...fieldProps}
|
|
563
|
+
{...state.trustForwardedProxy}
|
|
564
|
+
onEdit={(text) => { props.edit('trustForwardedProxy', text) }}
|
|
565
|
+
onReset={() => { props.resetField('trustForwardedProxy') }}
|
|
566
|
+
/>
|
|
384
567
|
<ValueField
|
|
385
568
|
id="settings-task-board-session-poll"
|
|
386
569
|
label={t('settings.sessionPollSeconds')}
|
|
387
|
-
hint={t('settings.
|
|
570
|
+
hint={t('settings.sessionPollSecondsHintBrief')}
|
|
571
|
+
hintTitle={t('settings.sessionPollSecondsHint')}
|
|
388
572
|
numeric
|
|
573
|
+
range={{ min: SESSION_POLL_MIN_SECONDS, max: SESSION_POLL_MAX_SECONDS, step: 1 }}
|
|
389
574
|
{...fieldProps}
|
|
390
575
|
{...state.sessionPollSeconds}
|
|
391
576
|
onEdit={(text) => { props.edit('sessionPollSeconds', text) }}
|
|
@@ -394,7 +579,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
394
579
|
<ChoiceField
|
|
395
580
|
id="settings-task-board-subtask-depth"
|
|
396
581
|
label={t('settings.maxSubtaskDepth')}
|
|
397
|
-
hint={t('settings.
|
|
582
|
+
hint={t('settings.maxSubtaskDepthHintBrief')}
|
|
583
|
+
hintTitle={t('settings.maxSubtaskDepthHint')}
|
|
398
584
|
inheritLabel={t('settings.inherit')}
|
|
399
585
|
choices={SUBTASK_DEPTH_CHOICES.map(value => ({
|
|
400
586
|
value,
|
|
@@ -405,10 +591,34 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
405
591
|
onEdit={(text) => { props.edit('maxSubtaskDepth', text) }}
|
|
406
592
|
onReset={() => { props.resetField('maxSubtaskDepth') }}
|
|
407
593
|
/>
|
|
594
|
+
<ValueField
|
|
595
|
+
id="settings-task-board-run-launch-width"
|
|
596
|
+
label={t('settings.runLaunchWidth')}
|
|
597
|
+
hint={t('settings.runLaunchWidthHintBrief')}
|
|
598
|
+
hintTitle={t('settings.runLaunchWidthHint')}
|
|
599
|
+
numeric
|
|
600
|
+
range={{ min: RUN_LAUNCH_WIDTH_MIN, max: RUN_LAUNCH_WIDTH_MAX, step: 1 }}
|
|
601
|
+
{...fieldProps}
|
|
602
|
+
{...state.runLaunchWidth}
|
|
603
|
+
onEdit={(text) => { props.edit('runLaunchWidth', text) }}
|
|
604
|
+
onReset={() => { props.resetField('runLaunchWidth') }}
|
|
605
|
+
/>
|
|
606
|
+
<ValueField
|
|
607
|
+
id="settings-task-board-spend-budget"
|
|
608
|
+
label={t('settings.spendBudgetTokens')}
|
|
609
|
+
hint={t('settings.spendBudgetTokensHintBrief')}
|
|
610
|
+
hintTitle={t('settings.spendBudgetTokensHint')}
|
|
611
|
+
numeric
|
|
612
|
+
{...fieldProps}
|
|
613
|
+
{...state.spendBudgetTokens}
|
|
614
|
+
onEdit={(text) => { props.edit('spendBudgetTokens', text) }}
|
|
615
|
+
onReset={() => { props.resetField('spendBudgetTokens') }}
|
|
616
|
+
/>
|
|
408
617
|
</PluginSettingsCard>
|
|
409
618
|
|
|
410
619
|
<PluginSettingsCard
|
|
411
620
|
t={t}
|
|
621
|
+
density="nested"
|
|
412
622
|
titleKey="settings.runBehaviorTitle"
|
|
413
623
|
descriptionKey="settings.runBehaviorCardHint"
|
|
414
624
|
defaultOpen={false}
|
|
@@ -420,7 +630,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
420
630
|
<BooleanField
|
|
421
631
|
id="settings-task-board-goal-run"
|
|
422
632
|
label={t('settings.goalRunGlobal')}
|
|
423
|
-
hint={t('settings.
|
|
633
|
+
hint={t('settings.goalRunGlobalHintBrief')}
|
|
634
|
+
hintTitle={t('settings.goalRunGlobalHint')}
|
|
424
635
|
inheritLabel={t('settings.inherit')}
|
|
425
636
|
onLabel={t('settings.on')}
|
|
426
637
|
offLabel={t('settings.off')}
|
|
@@ -433,6 +644,7 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
433
644
|
|
|
434
645
|
<PluginSettingsCard
|
|
435
646
|
t={t}
|
|
647
|
+
density="nested"
|
|
436
648
|
titleKey="settings.goalVerificationTitle"
|
|
437
649
|
descriptionKey="settings.goalVerificationCardHint"
|
|
438
650
|
defaultOpen={false}
|
|
@@ -444,7 +656,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
444
656
|
<BooleanField
|
|
445
657
|
id="settings-task-board-goal-verification"
|
|
446
658
|
label={t('settings.goalVerification')}
|
|
447
|
-
hint={t('settings.
|
|
659
|
+
hint={t('settings.goalVerificationHintBrief')}
|
|
660
|
+
hintTitle={t('settings.goalVerificationHint')}
|
|
448
661
|
inheritLabel={t('settings.inherit')}
|
|
449
662
|
onLabel={t('settings.on')}
|
|
450
663
|
offLabel={t('settings.off')}
|
|
@@ -456,7 +669,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
456
669
|
<ChoiceField
|
|
457
670
|
id="settings-task-board-goal-verification-model"
|
|
458
671
|
label={t('settings.goalVerificationModel')}
|
|
459
|
-
hint={t('settings.
|
|
672
|
+
hint={t('settings.goalVerificationModelHintBrief')}
|
|
673
|
+
hintTitle={t('settings.goalVerificationModelHint')}
|
|
460
674
|
inheritLabel={t('settings.inherit')}
|
|
461
675
|
choices={modelChoices}
|
|
462
676
|
{...fieldProps}
|
|
@@ -467,7 +681,8 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
467
681
|
<ChoiceField
|
|
468
682
|
id="settings-task-board-goal-verification-effort"
|
|
469
683
|
label={t('settings.goalVerificationEffort')}
|
|
470
|
-
hint={t('settings.
|
|
684
|
+
hint={t('settings.goalVerificationEffortHintBrief')}
|
|
685
|
+
hintTitle={t('settings.goalVerificationEffortHint')}
|
|
471
686
|
inheritLabel={t('settings.inherit')}
|
|
472
687
|
choices={effortChoices}
|
|
473
688
|
{...fieldProps}
|
|
@@ -511,6 +726,84 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
511
726
|
)}
|
|
512
727
|
</PluginSettingsCard>
|
|
513
728
|
|
|
729
|
+
{/* New-card defaults: what the create dialog opens with, and what the
|
|
730
|
+
Host create path fills an omitted target from when the caller opts
|
|
731
|
+
in. Every field's blank choice is a real value — "apply no default"
|
|
732
|
+
— so a deployment that configures none of them creates cards
|
|
733
|
+
exactly as it did before this topic existed. */}
|
|
734
|
+
<PluginSettingsCard
|
|
735
|
+
t={t}
|
|
736
|
+
density="nested"
|
|
737
|
+
titleKey="settings.cardDefaultsTitle"
|
|
738
|
+
descriptionKey="settings.cardDefaultsCardBrief"
|
|
739
|
+
descriptionTitleKey="settings.cardDefaultsCardHint"
|
|
740
|
+
defaultOpen={false}
|
|
741
|
+
hideFooter
|
|
742
|
+
state={nestedShell}
|
|
743
|
+
onSave={props.save}
|
|
744
|
+
onDiscard={props.discard}
|
|
745
|
+
>
|
|
746
|
+
<CardDefaultPresetField
|
|
747
|
+
id="settings-task-board-card-default-mode"
|
|
748
|
+
label={t('new.agentPreset')}
|
|
749
|
+
hint={t('settings.cardDefaultModeHintBrief')}
|
|
750
|
+
hintTitle={t('settings.cardDefaultModeHint')}
|
|
751
|
+
presets={state.presets}
|
|
752
|
+
{...fieldProps}
|
|
753
|
+
{...state.cardDefaultMode}
|
|
754
|
+
onEdit={(text) => { props.edit('cardDefaultMode', text) }}
|
|
755
|
+
onReset={() => { props.resetField('cardDefaultMode') }}
|
|
756
|
+
/>
|
|
757
|
+
<ChoiceField
|
|
758
|
+
id="settings-task-board-card-default-permission"
|
|
759
|
+
label={t('new.permission')}
|
|
760
|
+
hint={t('settings.cardDefaultPermissionHintBrief')}
|
|
761
|
+
hintTitle={t('settings.cardDefaultPermissionHint')}
|
|
762
|
+
inheritLabel={t('exec.permission.default')}
|
|
763
|
+
choices={TASK_PERMISSIONS.map(id => ({ value: id, label: t(`exec.permission.${id}` as TaskBoardKey) }))}
|
|
764
|
+
{...fieldProps}
|
|
765
|
+
{...state.cardDefaultPermission}
|
|
766
|
+
onEdit={(text) => { props.edit('cardDefaultPermission', text) }}
|
|
767
|
+
onReset={() => { props.resetField('cardDefaultPermission') }}
|
|
768
|
+
/>
|
|
769
|
+
<ChoiceField
|
|
770
|
+
id="settings-task-board-card-default-model"
|
|
771
|
+
label={t('new.model')}
|
|
772
|
+
hint={t('settings.cardDefaultModelHintBrief')}
|
|
773
|
+
hintTitle={t('settings.cardDefaultModelHint')}
|
|
774
|
+
inheritLabel={t('exec.model.default')}
|
|
775
|
+
choices={modelChoiceRows(defaultModels)}
|
|
776
|
+
{...fieldProps}
|
|
777
|
+
{...state.cardDefaultModel}
|
|
778
|
+
onEdit={(text) => {
|
|
779
|
+
props.edit('cardDefaultModel', text)
|
|
780
|
+
dropUnhonouredEffort(text)
|
|
781
|
+
}}
|
|
782
|
+
onReset={() => {
|
|
783
|
+
props.resetField('cardDefaultModel')
|
|
784
|
+
// A blank default model carries no route for a level to bind to,
|
|
785
|
+
// so the staged default level goes with it.
|
|
786
|
+
dropUnhonouredEffort('')
|
|
787
|
+
}}
|
|
788
|
+
/>
|
|
789
|
+
<ChoiceField
|
|
790
|
+
id="settings-task-board-card-default-effort"
|
|
791
|
+
label={t('exec.reasoning')}
|
|
792
|
+
hint={t(reasoningHintKey(defaultModels, defaultModel))}
|
|
793
|
+
inheritLabel={t('exec.reasoning.inherit')}
|
|
794
|
+
choices={defaultEffortChoices}
|
|
795
|
+
{...fieldProps}
|
|
796
|
+
{...state.cardDefaultReasoningEffort}
|
|
797
|
+
// The levels on offer are the declared ones of the picked default
|
|
798
|
+
// model, so without a model that declares any there is nothing to
|
|
799
|
+
// choose: the selector locks instead of offering a level no model
|
|
800
|
+
// would accept.
|
|
801
|
+
disabled={disabled || !reasoningPickerEnabled(defaultModels, defaultModel)}
|
|
802
|
+
onEdit={(text) => { props.edit('cardDefaultReasoningEffort', text) }}
|
|
803
|
+
onReset={() => { props.resetField('cardDefaultReasoningEffort') }}
|
|
804
|
+
/>
|
|
805
|
+
</PluginSettingsCard>
|
|
806
|
+
|
|
514
807
|
{/* Provider sections: a family extension contributes its own nested
|
|
515
808
|
settings card into this list through the seat this card declares —
|
|
516
809
|
the family provider extension is the one that does. Each
|
|
@@ -518,17 +811,19 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
518
811
|
seat draws nothing. */}
|
|
519
812
|
{renderSlot('task-board.settings.section', { dispatch })}
|
|
520
813
|
</ul>
|
|
521
|
-
{/* Live power facts
|
|
522
|
-
|
|
814
|
+
{/* Live power facts as label/value rows, then the battery caveat: quiet
|
|
815
|
+
small print that closes the card instead of a run-on sentence. */}
|
|
523
816
|
<div className={settingsCss.power}>
|
|
524
|
-
<
|
|
525
|
-
{t('settings.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
})}
|
|
531
|
-
|
|
817
|
+
<dl className={settingsCss.powerFacts}>
|
|
818
|
+
<dt className={settingsCss.powerTerm}>{t('settings.powerPlatform')}</dt>
|
|
819
|
+
<dd className={settingsCss.powerValue}>{power?.platform ?? t('settings.powerUnknown')}</dd>
|
|
820
|
+
<dt className={settingsCss.powerTerm}>{t('settings.powerPhase')}</dt>
|
|
821
|
+
<dd className={settingsCss.powerValue}>{power?.phase ?? t('settings.powerUnknown')}</dd>
|
|
822
|
+
<dt className={settingsCss.powerTerm}>{t('settings.powerRunning')}</dt>
|
|
823
|
+
<dd className={settingsCss.powerValue}>{String(power?.runningSessions ?? 0)}</dd>
|
|
824
|
+
<dt className={settingsCss.powerTerm}>{t('settings.powerSchedules')}</dt>
|
|
825
|
+
<dd className={settingsCss.powerValue}>{String(power?.armedSchedules ?? 0)}</dd>
|
|
826
|
+
</dl>
|
|
532
827
|
<p className={settingsCss.powerLine}>{t('settings.powerBoundary')}</p>
|
|
533
828
|
{power?.lastError !== undefined && (
|
|
534
829
|
<p className={settingsCss.powerError}>{t('settings.powerError', { error: power.lastError })}</p>
|