@linxin666/dsh-client-ui-task-board 0.4.16 → 0.4.18
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/README.i18n.yaml +2 -2
- package/README.md +16 -36
- package/README.zh.md +16 -36
- package/lib/client.js +107 -1354
- package/lib/client.js.map +1 -1
- package/lib/index.js +138 -2537
- package/lib/types/client/TaskBoardSettingsCard.d.ts +0 -20
- package/lib/types/client/board/status-key.d.ts +0 -15
- package/lib/types/client/locales.d.ts +1 -110
- package/lib/types/client/settings-entry-form.d.ts +1 -1
- package/lib/types/core/controller.d.ts +1 -1
- package/lib/types/core/extension.d.ts +4 -5
- package/lib/types/core/model-catalog.d.ts +58 -0
- package/lib/types/core/reasoning-effort.d.ts +1 -1
- package/lib/types/core/tasks.d.ts +0 -45
- package/lib/types/core/use-cases/task-update.d.ts +1 -1
- package/lib/types/host/llm-dispatch.d.ts +8 -10
- package/lib/types/host-ledger.d.ts +0 -28
- package/lib/types/host-runner.d.ts +6 -71
- package/lib/types/host-service.d.ts +17 -89
- package/lib/types/index.d.ts +0 -78
- package/lib/types/protocol.d.ts +6 -23
- package/package.json +26 -26
- package/src/client/TaskBoardSettingsCard.tsx +13 -201
- package/src/client/board/ExecutionLog.tsx +2 -5
- package/src/client/board/NewTaskModal.tsx +1 -42
- package/src/client/board/TaskBoard.tsx +2 -2
- package/src/client/board/TaskCard.tsx +2 -7
- package/src/client/board/TaskDetail.tsx +2 -37
- package/src/client/board/status-key.ts +0 -30
- package/src/client/board-settings.module.css +3 -22
- package/src/client/board.module.css +1 -104
- package/src/client/index.ts +2 -2
- package/src/client/locales.ts +6 -224
- package/src/client/settings-entry-form.ts +1 -1
- package/src/core/attachment.ts +1 -0
- package/src/core/controller.ts +1 -3
- package/src/core/extension.ts +4 -5
- package/src/core/freeze-snapshot.ts +3 -3
- package/src/core/model-catalog.ts +114 -0
- package/src/core/reasoning-effort.ts +1 -1
- package/src/core/store.ts +22 -17
- package/src/core/tasks.ts +0 -53
- package/src/core/use-cases/task-update.ts +1 -8
- package/src/host/agent-tools.ts +1 -15
- package/src/host/extension-registry.ts +2 -2
- package/src/host/llm-dispatch.ts +8 -10
- package/src/host-ledger.ts +3 -89
- package/src/host-routes.ts +4 -4
- package/src/host-runner.ts +13 -139
- package/src/host-service.ts +51 -266
- package/src/index.ts +9 -163
- package/src/protocol.ts +9 -44
- package/lib/types/client/board/VerificationReport.d.ts +0 -10
- package/lib/types/core/verification-budget.d.ts +0 -52
- package/lib/types/core/verification.d.ts +0 -753
- package/lib/types/host/verification-gate.d.ts +0 -95
- package/lib/types/host/verification-runner.d.ts +0 -139
- package/lib/types/host/workspace-evidence.d.ts +0 -53
- package/src/client/board/VerificationReport.tsx +0 -361
- package/src/core/verification-budget.ts +0 -115
- package/src/core/verification.ts +0 -1594
- package/src/host/verification-gate.ts +0 -487
- package/src/host/verification-runner.ts +0 -702
- package/src/host/workspace-evidence.ts +0 -176
|
@@ -8,17 +8,15 @@ import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@d
|
|
|
8
8
|
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store'
|
|
9
9
|
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client'
|
|
10
10
|
import { useEffect, useState } from 'react'
|
|
11
|
-
import type {
|
|
11
|
+
import type { TaskBoardModelCatalog, TaskBoardPowerSnapshot } from '../protocol.ts'
|
|
12
12
|
import type { TaskBoardExtensionDispatch } from '../core/extension.ts'
|
|
13
13
|
import type { ExecutionPresetOption } from '../core/controller.ts'
|
|
14
14
|
import { TASK_PERMISSIONS } from '../core/tasks.ts'
|
|
15
|
-
import {
|
|
16
|
-
import { parseModelRoute } from '../core/verification.ts'
|
|
15
|
+
import { parseModelRoute, type ModelCatalogView } from '../core/model-catalog.ts'
|
|
17
16
|
import { CardDefaultPresetField } from './CardDefaultPresetField.tsx'
|
|
18
17
|
import { PluginSettingsCard, BooleanField, ChoiceField, ValueField } from './PluginSettingsCard.tsx'
|
|
19
18
|
import {
|
|
20
19
|
modelChoiceRows,
|
|
21
|
-
modelDisplayLabel,
|
|
22
20
|
modelOptionsFromCatalog,
|
|
23
21
|
reasoningEffortsFor,
|
|
24
22
|
reasoningHintKey,
|
|
@@ -132,11 +130,11 @@ function spendBudgetField(): FieldSpec {
|
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
/**
|
|
135
|
-
* The
|
|
133
|
+
* The model-route field: blank inherits the host model catalog default, and a
|
|
136
134
|
* non-blank draft must be a qualified provider/model route. An unparseable
|
|
137
135
|
* draft blocks the save instead of storing a route nothing can resolve.
|
|
138
|
-
* The new-card default model uses
|
|
139
|
-
*
|
|
136
|
+
* The new-card default model uses this gate so it accepts exactly the routes
|
|
137
|
+
* an execution can pin.
|
|
140
138
|
*/
|
|
141
139
|
function modelRouteField(field: string): FieldSpec {
|
|
142
140
|
return {
|
|
@@ -179,18 +177,6 @@ export interface TaskBoardSettings {
|
|
|
179
177
|
* Tokens, not money: only DeepSeek's own routes are priced.
|
|
180
178
|
*/
|
|
181
179
|
spendBudgetTokens?: number
|
|
182
|
-
/**
|
|
183
|
-
* GLOBAL native /goal switch (default off): the master control over whether
|
|
184
|
-
* this board starts a run with dsh's built-in /goal at all. Frozen per
|
|
185
|
-
* execution.
|
|
186
|
-
*/
|
|
187
|
-
goalRunEnabled?: boolean
|
|
188
|
-
/** Goal acceptance for this board's executions (default on). */
|
|
189
|
-
goalVerification?: boolean
|
|
190
|
-
/** Judge model route for goal acceptance; blank inherits the host default. */
|
|
191
|
-
goalVerificationModel?: string
|
|
192
|
-
/** Judge reasoning effort; blank inherits the host default level. */
|
|
193
|
-
goalVerificationReasoningEffort?: string
|
|
194
180
|
/**
|
|
195
181
|
* Agent preset the create dialog of this board opens with. Blank pins
|
|
196
182
|
* nothing, so a new card follows the deployment default as before.
|
|
@@ -225,14 +211,6 @@ export interface TaskBoardSettingsCardState extends CardShell {
|
|
|
225
211
|
runLaunchWidth: CardFieldState
|
|
226
212
|
/** Daily token cap field. */
|
|
227
213
|
spendBudgetTokens: CardFieldState
|
|
228
|
-
/** GLOBAL native /goal switch. */
|
|
229
|
-
goalRunEnabled: CardFieldState
|
|
230
|
-
/** Goal-acceptance switch. */
|
|
231
|
-
goalVerification: CardFieldState
|
|
232
|
-
/** Judge model route field. */
|
|
233
|
-
goalVerificationModel: CardFieldState
|
|
234
|
-
/** Judge reasoning-effort field. */
|
|
235
|
-
goalVerificationReasoningEffort: CardFieldState
|
|
236
214
|
/** New-card default agent preset. */
|
|
237
215
|
cardDefaultMode: CardFieldState
|
|
238
216
|
/** New-card default permission. */
|
|
@@ -277,10 +255,6 @@ export class TaskBoardSettingsCardController {
|
|
|
277
255
|
sessionPollField(),
|
|
278
256
|
runLaunchWidthField(),
|
|
279
257
|
spendBudgetField(),
|
|
280
|
-
booleanField('goalRunEnabled'),
|
|
281
|
-
booleanField('goalVerification'),
|
|
282
|
-
modelRouteField('goalVerificationModel'),
|
|
283
|
-
textField('goalVerificationReasoningEffort', 'pick'),
|
|
284
258
|
// The new-card defaults: blank is a real value every one of them keeps
|
|
285
259
|
// ("apply no default"), which is why they are applied like any other field
|
|
286
260
|
// and only their parse rules differ.
|
|
@@ -303,10 +277,6 @@ export class TaskBoardSettingsCardController {
|
|
|
303
277
|
sessionPollSeconds: this.form.field('sessionPollSeconds'),
|
|
304
278
|
runLaunchWidth: this.form.field('runLaunchWidth'),
|
|
305
279
|
spendBudgetTokens: this.form.field('spendBudgetTokens'),
|
|
306
|
-
goalRunEnabled: this.form.field('goalRunEnabled'),
|
|
307
|
-
goalVerification: this.form.field('goalVerification'),
|
|
308
|
-
goalVerificationModel: this.form.field('goalVerificationModel'),
|
|
309
|
-
goalVerificationReasoningEffort: this.form.field('goalVerificationReasoningEffort'),
|
|
310
280
|
cardDefaultMode: this.form.field('cardDefaultMode'),
|
|
311
281
|
cardDefaultPermission: this.form.field('cardDefaultPermission'),
|
|
312
282
|
cardDefaultModel: this.form.field('cardDefaultModel'),
|
|
@@ -374,16 +344,16 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
374
344
|
const state = props.useTaskBoardSettingsCard(snapshot => snapshot)
|
|
375
345
|
const disabled = !state.writable
|
|
376
346
|
const [power, setPower] = useState<TaskBoardPowerSnapshot | undefined>()
|
|
377
|
-
const [
|
|
347
|
+
const [modelCatalog, setModelCatalog] = useState<TaskBoardModelCatalog | undefined>()
|
|
378
348
|
useEffect(() => {
|
|
379
349
|
// The SSE channel already carries power on every real change and pushes
|
|
380
350
|
// one frame on subscribe; polling the full /state snapshot every 5 s
|
|
381
351
|
// re-cloned and re-serialized the whole ledger server-side for one field.
|
|
382
352
|
let live = true
|
|
383
|
-
void fetch('api/task-board/
|
|
353
|
+
void fetch('api/task-board/model-catalog')
|
|
384
354
|
.then(r => r.ok ? r.json() : undefined)
|
|
385
|
-
.then((data:
|
|
386
|
-
if (data?.catalog && live)
|
|
355
|
+
.then((data: TaskBoardModelCatalog | undefined) => {
|
|
356
|
+
if (data?.catalog && live) setModelCatalog(data)
|
|
387
357
|
})
|
|
388
358
|
.catch(() => {})
|
|
389
359
|
const events = new EventSource('api/task-board/events')
|
|
@@ -397,63 +367,15 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
397
367
|
}
|
|
398
368
|
return () => { live = false; events.close() }
|
|
399
369
|
}, [])
|
|
400
|
-
|
|
401
|
-
// change already shows what the next execution would freeze (including a
|
|
402
|
-
// reasoning-level fallback the target model forces).
|
|
403
|
-
const catalog: ModelCatalogView = verification?.catalog ?? { groups: [] }
|
|
404
|
-
const stagedSettings: VerificationSettings = {
|
|
405
|
-
enabled: state.goalVerification.text !== 'false',
|
|
406
|
-
model: state.goalVerificationModel.text,
|
|
407
|
-
reasoningEffort: state.goalVerificationReasoningEffort.text,
|
|
408
|
-
}
|
|
409
|
-
const preview = resolveContract(stagedSettings, catalog)
|
|
410
|
-
const inheritRoute = catalog.default
|
|
411
|
-
const modelChoices = [
|
|
412
|
-
{
|
|
413
|
-
value: '',
|
|
414
|
-
label: inheritRoute === undefined
|
|
415
|
-
? t('settings.goalVerificationModelInheritUnknown')
|
|
416
|
-
: t('settings.goalVerificationModelInherit', { model: inheritRoute.provider + '/' + inheritRoute.model }),
|
|
417
|
-
},
|
|
418
|
-
...catalog.groups.flatMap(group => group.models.map(model => ({
|
|
419
|
-
value: group.id + '/' + model.id,
|
|
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
|
-
}),
|
|
430
|
-
}))),
|
|
431
|
-
]
|
|
432
|
-
const stagedRoute = parseModelRoute(stagedSettings.model) ?? (inheritRoute === undefined ? undefined : { provider: inheritRoute.provider, model: inheritRoute.model })
|
|
433
|
-
const stagedEfforts = stagedRoute === undefined
|
|
434
|
-
? []
|
|
435
|
-
: catalog.groups.find(group => group.id === stagedRoute.provider)?.models.find(model => model.id === stagedRoute.model)?.reasoning?.efforts ?? []
|
|
436
|
-
const effortChoices = [
|
|
437
|
-
{
|
|
438
|
-
value: '',
|
|
439
|
-
label: stagedRoute === undefined || stagedEfforts.length === 0
|
|
440
|
-
? t('settings.goalVerificationEffortInheritUnknown')
|
|
441
|
-
: t('settings.goalVerificationEffortInherit', {
|
|
442
|
-
effort: catalog.groups.find(group => group.id === stagedRoute.provider)?.models
|
|
443
|
-
.find(model => model.id === stagedRoute.model)?.reasoning?.defaultEffort ?? t('settings.goalVerificationEffortInheritUnknown'),
|
|
444
|
-
}),
|
|
445
|
-
},
|
|
446
|
-
...stagedEfforts.map(effort => ({ value: effort.id, label: effort.name ?? effort.id })),
|
|
447
|
-
]
|
|
370
|
+
const catalog: ModelCatalogView = modelCatalog?.catalog ?? { groups: [] }
|
|
448
371
|
const fieldProps = {
|
|
449
372
|
overriddenLabel: t('settings.overridden'),
|
|
450
373
|
resetLabel: t('settings.reset'),
|
|
451
374
|
invalidLabel: t('settings.invalidNumber'),
|
|
452
375
|
disabled,
|
|
453
376
|
}
|
|
454
|
-
// The new-card-defaults topic reads the SAME catalog the
|
|
455
|
-
//
|
|
456
|
-
// verification payload), normalized once into the roster the reasoning
|
|
377
|
+
// The new-card-defaults topic reads the SAME catalog the create dialog reads (session/modelCatalog, served here through the
|
|
378
|
+
// model-catalog payload), normalized once into the roster the reasoning
|
|
457
379
|
// helpers below consume, so the default level can only offer levels the
|
|
458
380
|
// chosen default model really declares.
|
|
459
381
|
const defaultModels = modelOptionsFromCatalog(catalog)
|
|
@@ -497,7 +419,7 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
497
419
|
>
|
|
498
420
|
{/* The board's own settings are nested disclosure cards, so an expanded
|
|
499
421
|
card reads as a short topic list: the board and its runtime behavior,
|
|
500
|
-
|
|
422
|
+
and whatever a provider contributes (a provider
|
|
501
423
|
extension registers into the seat rendered last). Every one
|
|
502
424
|
of them starts collapsed and shares this card's single save. */}
|
|
503
425
|
<ul className={settingsCss.nestedCards}>
|
|
@@ -616,116 +538,6 @@ export function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps) {
|
|
|
616
538
|
/>
|
|
617
539
|
</PluginSettingsCard>
|
|
618
540
|
|
|
619
|
-
<PluginSettingsCard
|
|
620
|
-
t={t}
|
|
621
|
-
density="nested"
|
|
622
|
-
titleKey="settings.runBehaviorTitle"
|
|
623
|
-
descriptionKey="settings.runBehaviorCardHint"
|
|
624
|
-
defaultOpen={false}
|
|
625
|
-
hideFooter
|
|
626
|
-
state={nestedShell}
|
|
627
|
-
onSave={props.save}
|
|
628
|
-
onDiscard={props.discard}
|
|
629
|
-
>
|
|
630
|
-
<BooleanField
|
|
631
|
-
id="settings-task-board-goal-run"
|
|
632
|
-
label={t('settings.goalRunGlobal')}
|
|
633
|
-
hint={t('settings.goalRunGlobalHintBrief')}
|
|
634
|
-
hintTitle={t('settings.goalRunGlobalHint')}
|
|
635
|
-
inheritLabel={t('settings.inherit')}
|
|
636
|
-
onLabel={t('settings.on')}
|
|
637
|
-
offLabel={t('settings.off')}
|
|
638
|
-
{...fieldProps}
|
|
639
|
-
{...state.goalRunEnabled}
|
|
640
|
-
onEdit={(text) => { props.edit('goalRunEnabled', text) }}
|
|
641
|
-
onReset={() => { props.resetField('goalRunEnabled') }}
|
|
642
|
-
/>
|
|
643
|
-
</PluginSettingsCard>
|
|
644
|
-
|
|
645
|
-
<PluginSettingsCard
|
|
646
|
-
t={t}
|
|
647
|
-
density="nested"
|
|
648
|
-
titleKey="settings.goalVerificationTitle"
|
|
649
|
-
descriptionKey="settings.goalVerificationCardHint"
|
|
650
|
-
defaultOpen={false}
|
|
651
|
-
hideFooter
|
|
652
|
-
state={nestedShell}
|
|
653
|
-
onSave={props.save}
|
|
654
|
-
onDiscard={props.discard}
|
|
655
|
-
>
|
|
656
|
-
<BooleanField
|
|
657
|
-
id="settings-task-board-goal-verification"
|
|
658
|
-
label={t('settings.goalVerification')}
|
|
659
|
-
hint={t('settings.goalVerificationHintBrief')}
|
|
660
|
-
hintTitle={t('settings.goalVerificationHint')}
|
|
661
|
-
inheritLabel={t('settings.inherit')}
|
|
662
|
-
onLabel={t('settings.on')}
|
|
663
|
-
offLabel={t('settings.off')}
|
|
664
|
-
{...fieldProps}
|
|
665
|
-
{...state.goalVerification}
|
|
666
|
-
onEdit={(text) => { props.edit('goalVerification', text) }}
|
|
667
|
-
onReset={() => { props.resetField('goalVerification') }}
|
|
668
|
-
/>
|
|
669
|
-
<ChoiceField
|
|
670
|
-
id="settings-task-board-goal-verification-model"
|
|
671
|
-
label={t('settings.goalVerificationModel')}
|
|
672
|
-
hint={t('settings.goalVerificationModelHintBrief')}
|
|
673
|
-
hintTitle={t('settings.goalVerificationModelHint')}
|
|
674
|
-
inheritLabel={t('settings.inherit')}
|
|
675
|
-
choices={modelChoices}
|
|
676
|
-
{...fieldProps}
|
|
677
|
-
{...state.goalVerificationModel}
|
|
678
|
-
onEdit={(text) => { props.edit('goalVerificationModel', text) }}
|
|
679
|
-
onReset={() => { props.resetField('goalVerificationModel') }}
|
|
680
|
-
/>
|
|
681
|
-
<ChoiceField
|
|
682
|
-
id="settings-task-board-goal-verification-effort"
|
|
683
|
-
label={t('settings.goalVerificationEffort')}
|
|
684
|
-
hint={t('settings.goalVerificationEffortHintBrief')}
|
|
685
|
-
hintTitle={t('settings.goalVerificationEffortHint')}
|
|
686
|
-
inheritLabel={t('settings.inherit')}
|
|
687
|
-
choices={effortChoices}
|
|
688
|
-
{...fieldProps}
|
|
689
|
-
{...state.goalVerificationReasoningEffort}
|
|
690
|
-
onEdit={(text) => { props.edit('goalVerificationReasoningEffort', text) }}
|
|
691
|
-
onReset={() => { props.resetField('goalVerificationReasoningEffort') }}
|
|
692
|
-
/>
|
|
693
|
-
<p className={settingsCss.note}>{t('settings.goalVerificationResolved')}</p>
|
|
694
|
-
{preview.route === undefined
|
|
695
|
-
? <p className={settingsCss.error}>{t('settings.goalVerificationRouteMissing')}</p>
|
|
696
|
-
: (
|
|
697
|
-
<ul className={settingsCss.resolvedList}>
|
|
698
|
-
<li>{t('settings.goalVerificationResolvedModel', { model: preview.route.provider + '/' + preview.route.model })}</li>
|
|
699
|
-
<li>
|
|
700
|
-
{preview.route.reasoningEffort === undefined
|
|
701
|
-
? t('settings.goalVerificationResolvedNoEffort')
|
|
702
|
-
: t('settings.goalVerificationResolvedEffort', { effort: preview.route.reasoningEffort })}
|
|
703
|
-
</li>
|
|
704
|
-
<li>
|
|
705
|
-
{t('settings.goalVerificationResolvedSource', {
|
|
706
|
-
source: preview.modelSource === 'inherit'
|
|
707
|
-
? t('settings.goalVerificationSourceInherit')
|
|
708
|
-
: t('settings.goalVerificationSourceExplicit'),
|
|
709
|
-
})}
|
|
710
|
-
</li>
|
|
711
|
-
<li>{t('settings.goalVerificationResolvedPreset', { threshold: String(preview.threshold) })}</li>
|
|
712
|
-
</ul>
|
|
713
|
-
)}
|
|
714
|
-
{preview.effortFallback !== undefined && (
|
|
715
|
-
<p className={settingsCss.note}>
|
|
716
|
-
{preview.effortFallback.resolved === undefined
|
|
717
|
-
? t('settings.goalVerificationEffortFallbackNone', { requested: preview.effortFallback.requested })
|
|
718
|
-
: t('settings.goalVerificationEffortFallback', {
|
|
719
|
-
requested: preview.effortFallback.requested,
|
|
720
|
-
resolved: preview.effortFallback.resolved,
|
|
721
|
-
})}
|
|
722
|
-
</p>
|
|
723
|
-
)}
|
|
724
|
-
{stagedSettings.model.trim() !== '' && parseModelRoute(stagedSettings.model) === undefined && (
|
|
725
|
-
<p className={settingsCss.note}>{t('settings.goalVerificationModelInvalid')}</p>
|
|
726
|
-
)}
|
|
727
|
-
</PluginSettingsCard>
|
|
728
|
-
|
|
729
541
|
{/* New-card defaults: what the create dialog opens with, and what the
|
|
730
542
|
Host create path fills an omitted target from when the caller opts
|
|
731
543
|
in. Every field's blank choice is a real value — "apply no default"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The execution history of one card.
|
|
3
3
|
*
|
|
4
|
-
* A card accumulates dozens of runs, and
|
|
5
|
-
*
|
|
6
|
-
* one row a reader needed. The history therefore renders newest first, keeps
|
|
4
|
+
* A card accumulates dozens of runs, and a long list buries the one row a
|
|
5
|
+
* reader needs. The history therefore renders newest first, keeps
|
|
7
6
|
* the five latest rows visible and puts the rest behind one disclosure that
|
|
8
7
|
* opens and closes as one motion pair (the presence hook keeps the extra rows
|
|
9
8
|
* mounted through the exit leg instead of pulling them out on the click's
|
|
@@ -22,7 +21,6 @@ import css from '../board.module.css'
|
|
|
22
21
|
import { IconSession } from './icons.tsx'
|
|
23
22
|
import { usePresence } from './overlay.tsx'
|
|
24
23
|
import { formatTime } from './TaskCard.tsx'
|
|
25
|
-
import { VerificationReport } from './VerificationReport.tsx'
|
|
26
24
|
|
|
27
25
|
/** Rows shown before the history asks to be expanded. */
|
|
28
26
|
export const VISIBLE_EXECUTIONS = 5
|
|
@@ -96,7 +94,6 @@ function ExecutionRow({ execution, timeZone, onOpen }: {
|
|
|
96
94
|
{t('detail.execution.initiator', { session: execution.initiatedBy })}
|
|
97
95
|
</span>
|
|
98
96
|
)}
|
|
99
|
-
{execution.verification !== undefined && <VerificationReport verification={execution.verification} />}
|
|
100
97
|
{execution.error !== undefined && execution.error !== '' && (
|
|
101
98
|
<span className={css.executionError}>
|
|
102
99
|
{failureText(execution.error)}
|
|
@@ -93,10 +93,6 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
93
93
|
const [reasoningEffort, setReasoningEffort] = useState(seed.reasoningEffort)
|
|
94
94
|
const inheritedPermission = parentTask === undefined ? undefined : effectiveTaskPermission(parentTask)
|
|
95
95
|
const [reuseSession, setReuseSession] = useState(initialTask?.reuseSession ?? false)
|
|
96
|
-
// Unchecked by default: a new task runs one plain turn unless the user opts
|
|
97
|
-
// into dsh's built-in /goal here. A duplicate keeps the original card's choice.
|
|
98
|
-
const [goalRun, setGoalRun] = useState(initialTask?.goalRun ?? false)
|
|
99
|
-
const [skipVerification, setSkipVerification] = useState(initialTask?.skipVerification ?? false)
|
|
100
96
|
const [scheduleEnabled, setScheduleEnabled] = useState(initialTask?.schedule?.enabled ?? false)
|
|
101
97
|
const [scheduleMode, setScheduleMode] = useState<ScheduleMode>(initialTask?.schedule?.mode ?? 'cron')
|
|
102
98
|
const [scheduleCron, setScheduleCron] = useState(initialTask?.schedule?.cron ?? '')
|
|
@@ -129,11 +125,6 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
129
125
|
const [error, setError] = useState<string | undefined>(undefined)
|
|
130
126
|
const [pending, setPending] = useState(false)
|
|
131
127
|
const [options, setOptions] = useState(controller.getSnapshot().executionOptions)
|
|
132
|
-
// Live GLOBAL native-/goal switch. The new-task form never rewrites a stored
|
|
133
|
-
// preference from it: the checkbox stays operable and is explained while the
|
|
134
|
-
// master switch is off, and the user's own choice is what a later re-enable
|
|
135
|
-
// restores.
|
|
136
|
-
const [goalRunEnabled, setGoalRunEnabled] = useState(controller.getSnapshot().host?.goalRunEnabled === true)
|
|
137
128
|
// "Parse pasted text" (issue #1540) exists only when the deployment carries a
|
|
138
129
|
// parse face; the section stays hidden otherwise.
|
|
139
130
|
const [canParse] = useState(controller.getSnapshot().canParseTask === true)
|
|
@@ -159,7 +150,6 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
159
150
|
() => controller.subscribe(() => {
|
|
160
151
|
const snapshot = controller.getSnapshot()
|
|
161
152
|
setOptions(snapshot.executionOptions)
|
|
162
|
-
setGoalRunEnabled(snapshot.host?.goalRunEnabled === true)
|
|
163
153
|
}),
|
|
164
154
|
[controller],
|
|
165
155
|
)
|
|
@@ -287,8 +277,6 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
287
277
|
...(model === '' ? {} : { model }),
|
|
288
278
|
...(reasoningEffort === '' ? {} : { reasoningEffort }),
|
|
289
279
|
...(reuseSession ? { reuseSession: true } : {}),
|
|
290
|
-
...(goalRun ? { goalRun: true } : {}),
|
|
291
|
-
...(skipVerification ? { skipVerification: true } : {}),
|
|
292
280
|
...(tagList.length > 0 ? { tags: tagList } : {}),
|
|
293
281
|
...(attachments.persisted.length + uploaded.length > 0
|
|
294
282
|
// The storage is content-addressed: the same content uploaded twice
|
|
@@ -399,12 +387,7 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
399
387
|
: t('new.summary.attachmentCount', { count: String(attachmentCount) })
|
|
400
388
|
const tagCount = cleanTags(tags).length
|
|
401
389
|
const labelsSummary = tagCount === 0 ? t('new.summary.none') : t('new.summary.labelCount', { count: String(tagCount) })
|
|
402
|
-
const runSummary =
|
|
403
|
-
// A card whose goal option is on but whose master switch is off will run one
|
|
404
|
-
// plain turn: the collapsed line says the truth rather than the stored value.
|
|
405
|
-
goalRun && goalRunEnabled ? t('new.summary.multiRound') : t('new.summary.singleRound'),
|
|
406
|
-
...(reuseSession ? [t('exec.reuseSession')] : []),
|
|
407
|
-
].join(' · ')
|
|
390
|
+
const runSummary = reuseSession ? t('exec.reuseSession') : t('new.summary.none')
|
|
408
391
|
const handoverSummary = freezeText.trim() !== '' || handoverText.trim() !== ''
|
|
409
392
|
? t('new.summary.filled')
|
|
410
393
|
: t('new.summary.none')
|
|
@@ -636,30 +619,6 @@ export function NewTaskModal({ controller, onClose, initialTask, defaultWorkspac
|
|
|
636
619
|
<span>{t('exec.reuseSession')}</span>
|
|
637
620
|
</label>
|
|
638
621
|
<p className={css.detailText}>{t('exec.reuseSessionHint')}</p>
|
|
639
|
-
|
|
640
|
-
<label className={css.scheduleToggle}>
|
|
641
|
-
<input
|
|
642
|
-
type="checkbox"
|
|
643
|
-
checked={goalRun}
|
|
644
|
-
// Always operable: the global switch decides whether the choice
|
|
645
|
-
// takes effect, never whether it may be stated, and the state (and a
|
|
646
|
-
// duplicate's template) is never rewritten by it.
|
|
647
|
-
onChange={event => { setGoalRun(event.target.checked) }}
|
|
648
|
-
/>
|
|
649
|
-
<span>{t('exec.goalRun')}</span>
|
|
650
|
-
</label>
|
|
651
|
-
<p className={css.detailText}>{t('exec.goalRunHint')}</p>
|
|
652
|
-
{!goalRunEnabled && <p className={css.detailText}>{t('settings.goalRunGlobalDisabledTaskOption')}</p>}
|
|
653
|
-
|
|
654
|
-
<label className={css.scheduleToggle}>
|
|
655
|
-
<input
|
|
656
|
-
type="checkbox"
|
|
657
|
-
checked={skipVerification}
|
|
658
|
-
onChange={event => { setSkipVerification(event.target.checked) }}
|
|
659
|
-
/>
|
|
660
|
-
<span>{t('exec.skipVerification')}</span>
|
|
661
|
-
</label>
|
|
662
|
-
<p className={css.detailText}>{t('exec.skipVerificationHint')}</p>
|
|
663
622
|
</CollapsibleSection>
|
|
664
623
|
|
|
665
624
|
<CollapsibleSection
|
|
@@ -116,7 +116,7 @@ const MemoTaskCard = memo(function MemoTaskCard({ task, pending, timeZone, onOpe
|
|
|
116
116
|
})
|
|
117
117
|
|
|
118
118
|
/** Settled columns whose cards group by recency and fold the oldest group. */
|
|
119
|
-
const GROUPED_COLUMNS:
|
|
119
|
+
const GROUPED_COLUMNS: ReadonlySet<TaskStatus> = new Set(['done', 'failed'])
|
|
120
120
|
|
|
121
121
|
/** Cards a grouped column renders before the oldest group folds. */
|
|
122
122
|
export const COLUMN_FOLD_THRESHOLD = 30
|
|
@@ -289,7 +289,7 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
289
289
|
|
|
290
290
|
/** Every column and the archive first split by provider-owned source. */
|
|
291
291
|
const renderSourceGroups = (view: SourceGroupView, tasks: TaskRecord[], compact: boolean, archived: boolean) => {
|
|
292
|
-
const recency = archived || GROUPED_COLUMNS.
|
|
292
|
+
const recency = archived || GROUPED_COLUMNS.has(view as TaskStatus)
|
|
293
293
|
return groupTasksBySource(tasks, snapshot.grouping ?? []).map(bucket => {
|
|
294
294
|
const foldKey = sourceGroupFoldKey(view, bucket.id)
|
|
295
295
|
const folded = isSourceGroupFolded(sourceFolds, view, bucket.id, searchActive)
|
|
@@ -23,7 +23,6 @@ import { t } from '../locales.ts'
|
|
|
23
23
|
import { useTaskBoardSeats } from '../seats.tsx'
|
|
24
24
|
import { cardOutcome, cardTimeline, RESULT_KEY, splitTitleKind } from './card-view.ts'
|
|
25
25
|
import { IconClock, IconSession } from './icons.tsx'
|
|
26
|
-
import { verificationRunningKey } from './status-key.ts'
|
|
27
26
|
import css from '../board.module.css'
|
|
28
27
|
import { markdownExcerpt, markdownToPlainText } from './task-markdown.tsx'
|
|
29
28
|
|
|
@@ -144,8 +143,6 @@ function TaskCardInner({
|
|
|
144
143
|
const isDraggable = !archived && !busy && !pending
|
|
145
144
|
const outcome = cardOutcome(task, archived)
|
|
146
145
|
const latest = outcome.latest
|
|
147
|
-
// Forced acceptance owns the running label.
|
|
148
|
-
const runningKey = verificationRunningKey(latest?.verification)
|
|
149
146
|
const timeline = cardTimeline(task, archived)
|
|
150
147
|
const resultText = latest?.result !== undefined ? t(RESULT_KEY[latest.result]) : ''
|
|
151
148
|
const sessionId = latest?.sessionId
|
|
@@ -154,7 +151,7 @@ function TaskCardInner({
|
|
|
154
151
|
const ariaLabel = [
|
|
155
152
|
title.kind === undefined ? summary : `${title.kind}: ${title.text}`,
|
|
156
153
|
!archived && pending ? t('board.pending') : '',
|
|
157
|
-
!archived && busy ? t(
|
|
154
|
+
!archived && busy ? t('detail.result.running') : '',
|
|
158
155
|
!archived && !busy && resultText !== '' ? resultText : '',
|
|
159
156
|
outcome.declared ? t('card.declared') : '',
|
|
160
157
|
subtasksFailed > 0 ? t('card.subtasksFailed', { count: String(subtasksFailed) }) : '',
|
|
@@ -173,9 +170,7 @@ function TaskCardInner({
|
|
|
173
170
|
// box that is the same size whether or not it holds a spinner. Nothing here
|
|
174
171
|
// can add or remove a row, so a state change cannot resize the card.
|
|
175
172
|
const runningLabel = !archived && latest !== undefined && executionLabel(latest) === 'running'
|
|
176
|
-
? (
|
|
177
|
-
? t(runningKey)
|
|
178
|
-
: latest.ownResult === undefined ? t('detail.result.running') : t('detail.subtasks.waiting'))
|
|
173
|
+
? (latest.ownResult === undefined ? t('detail.result.running') : t('detail.subtasks.waiting'))
|
|
179
174
|
: ''
|
|
180
175
|
// Archived cards settle outside the board's judgement, so they keep the plain
|
|
181
176
|
// text result instead of a badge that would paint a tone they do not own.
|
|
@@ -194,18 +194,12 @@ function FoldSection({ title, summary, hint, children }: {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/** The execution-target editor: workspace / mode / permission pickers. */
|
|
197
|
-
function ExecutionSettingsSection({ controller, task, pending, executionOptions
|
|
197
|
+
function ExecutionSettingsSection({ controller, task, pending, executionOptions }: {
|
|
198
198
|
controller: BoardController
|
|
199
199
|
task: TaskRecord
|
|
200
200
|
pending: boolean
|
|
201
201
|
/** Picker option sets, owned by the detail overlay's snapshot. */
|
|
202
202
|
executionOptions: ControllerSnapshot['executionOptions']
|
|
203
|
-
/**
|
|
204
|
-
* Live GLOBAL native-/goal switch. It only decides whether the card's own
|
|
205
|
-
* preference takes effect: the option stays operable while it is off, the
|
|
206
|
-
* stored value is never rewritten by it, and the explanation below says so.
|
|
207
|
-
*/
|
|
208
|
-
goalRunEnabled: boolean
|
|
209
203
|
}) {
|
|
210
204
|
const options = executionOptions
|
|
211
205
|
const models = options.models ?? []
|
|
@@ -223,8 +217,6 @@ function ExecutionSettingsSection({ controller, task, pending, executionOptions,
|
|
|
223
217
|
// One line for the closed fold: which switches are on.
|
|
224
218
|
const advancedOn: string[] = []
|
|
225
219
|
if (task.reuseSession === true) advancedOn.push(t('detail.settings.summary.reuseSession'))
|
|
226
|
-
if (task.goalRun === true) advancedOn.push(t('detail.settings.summary.goal'))
|
|
227
|
-
if (task.skipVerification === true) advancedOn.push(t('detail.settings.summary.skipVerification'))
|
|
228
220
|
const advancedSummary = advancedOn.length === 0 ? t('detail.settings.summary.none') : advancedOn.join(' · ')
|
|
229
221
|
return (
|
|
230
222
|
<section className={css.detailSection}>
|
|
@@ -313,7 +305,7 @@ function ExecutionSettingsSection({ controller, task, pending, executionOptions,
|
|
|
313
305
|
pending={pending}
|
|
314
306
|
onChange={effort => { controller.updateTask(task.id, { reasoningEffort: effort }) }}
|
|
315
307
|
/>
|
|
316
|
-
<FoldSection title={t('detail.settings.
|
|
308
|
+
<FoldSection title={t('detail.settings.run')} summary={advancedSummary}>
|
|
317
309
|
<label className={css.scheduleToggle} title={t('exec.reuseSessionHint')}>
|
|
318
310
|
<input
|
|
319
311
|
type="checkbox"
|
|
@@ -324,32 +316,6 @@ function ExecutionSettingsSection({ controller, task, pending, executionOptions,
|
|
|
324
316
|
<span>{t('exec.reuseSession')}</span>
|
|
325
317
|
</label>
|
|
326
318
|
<p className={css.detailMeta}>{t('exec.reuseSessionHint.short')}</p>
|
|
327
|
-
<label className={css.scheduleToggle} title={t('exec.goalRunHint')}>
|
|
328
|
-
<input
|
|
329
|
-
type="checkbox"
|
|
330
|
-
checked={task.goalRun === true}
|
|
331
|
-
// Always operable (only a pending execution locks it): the global
|
|
332
|
-
// switch decides whether the preference takes effect, never whether
|
|
333
|
-
// the user may state it, and it never rewrites what is stored here.
|
|
334
|
-
disabled={pending}
|
|
335
|
-
onChange={event => { controller.updateTask(task.id, { goalRun: event.target.checked }) }}
|
|
336
|
-
/>
|
|
337
|
-
<span>{t('exec.goalRun')}</span>
|
|
338
|
-
</label>
|
|
339
|
-
<p className={css.detailMeta}>{t('exec.goalRunHint.short')}</p>
|
|
340
|
-
{!goalRunEnabled && (
|
|
341
|
-
<p className={css.detailMeta} title={t('settings.goalRunGlobalDisabledTaskOption')}>{t('exec.goalRunGlobalOff')}</p>
|
|
342
|
-
)}
|
|
343
|
-
<label className={css.scheduleToggle} title={t('exec.skipVerificationHint')}>
|
|
344
|
-
<input
|
|
345
|
-
type="checkbox"
|
|
346
|
-
checked={task.skipVerification === true}
|
|
347
|
-
disabled={pending}
|
|
348
|
-
onChange={event => { controller.updateTask(task.id, { skipVerification: event.target.checked }) }}
|
|
349
|
-
/>
|
|
350
|
-
<span>{t('exec.skipVerification')}</span>
|
|
351
|
-
</label>
|
|
352
|
-
<p className={css.detailMeta}>{t('exec.skipVerificationHint.short')}</p>
|
|
353
319
|
</FoldSection>
|
|
354
320
|
</section>
|
|
355
321
|
)
|
|
@@ -1051,7 +1017,6 @@ export function TaskDetail({ controller, task, phase = 'open' }: { controller: B
|
|
|
1051
1017
|
task={current}
|
|
1052
1018
|
pending={pending}
|
|
1053
1019
|
executionOptions={snapshot.executionOptions}
|
|
1054
|
-
goalRunEnabled={snapshot.host?.goalRunEnabled === true}
|
|
1055
1020
|
/>
|
|
1056
1021
|
<ScheduleSection controller={controller} task={current} pending={pending} />
|
|
1057
1022
|
</>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { TaskStatus } from '../../core/tasks.ts'
|
|
2
|
-
import { verificationPhase, type ExecutionVerification, type VerificationPhase } from '../../core/verification.ts'
|
|
3
2
|
import type { TaskBoardKey } from '../locales.ts'
|
|
4
3
|
|
|
5
4
|
/** Task status → locale key (board column titles and the detail badge). */
|
|
@@ -10,32 +9,3 @@ export const STATUS_KEY: Record<TaskStatus, TaskBoardKey> = {
|
|
|
10
9
|
done: 'board.status.done',
|
|
11
10
|
failed: 'board.status.failed',
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Acceptance phase to the label the running column shows: executing,
|
|
16
|
-
* verifying, or fixing a failed acceptance. The card keeps one running label;
|
|
17
|
-
* this decides which one.
|
|
18
|
-
*/
|
|
19
|
-
export const VERIFICATION_PHASE_KEY: Record<VerificationPhase, TaskBoardKey> = {
|
|
20
|
-
off: 'running.executing',
|
|
21
|
-
executing: 'running.executing',
|
|
22
|
-
verifying: 'running.verifying',
|
|
23
|
-
repairing: 'running.repairing',
|
|
24
|
-
passed: 'running.verificationPassed',
|
|
25
|
-
failed: 'running.verificationFailed',
|
|
26
|
-
// Held for a human: the judge produced no usable veto, so this is NOT the
|
|
27
|
-
// quality-failure label.
|
|
28
|
-
invalid: 'running.verificationInvalid',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The acceptance label for one open execution, or undefined when acceptance
|
|
33
|
-
* does not govern it (the switch was off at start, the run never became a goal
|
|
34
|
-
* run, or a teammate is covered by its Lead).
|
|
35
|
-
* @param verification - the execution's acceptance state.
|
|
36
|
-
* @returns the locale key to render, or undefined for the historical label.
|
|
37
|
-
*/
|
|
38
|
-
export function verificationRunningKey(verification: ExecutionVerification | undefined): TaskBoardKey | undefined {
|
|
39
|
-
if (verification === undefined || verification.applicability !== 'enforced') return undefined
|
|
40
|
-
return VERIFICATION_PHASE_KEY[verificationPhase(verification)]
|
|
41
|
-
}
|
|
@@ -3,29 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The card's chrome belongs to the shared family slice
|
|
5
5
|
* (`settings-card.module.css`, generated); this file owns only the nested
|
|
6
|
-
* disclosure list and the
|
|
7
|
-
*
|
|
6
|
+
* disclosure list and the power facts, on theme tokens instead of inline
|
|
7
|
+
* literals.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
.note {
|
|
11
|
-
margin: 4px 0;
|
|
12
|
-
font-size: 12px;
|
|
13
|
-
color: var(--dsw-alias-label-secondary);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.error {
|
|
17
|
-
margin: 4px 0;
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
color: var(--dsw-alias-state-error-primary);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.resolvedList {
|
|
23
|
-
margin: 4px 0 8px;
|
|
24
|
-
padding-left: 16px;
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
color: var(--dsw-alias-label-secondary);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
10
|
/* One spacing step for this card's own blocks: the topic list and the power
|
|
30
11
|
facts under it read the same value instead of each hard-coding one. */
|
|
31
12
|
.nestedCards,
|
|
@@ -81,7 +62,7 @@
|
|
|
81
62
|
}
|
|
82
63
|
|
|
83
64
|
/* The nested disclosure cards of this card: the board and its runtime
|
|
84
|
-
behavior,
|
|
65
|
+
behavior, and the sections a provider extension
|
|
85
66
|
contributes. The gap keeps the stacked card
|
|
86
67
|
borders apart; an empty list draws nothing. */
|
|
87
68
|
.nestedCards {
|