@fish-under-sea/dsh-client-ui-task-board-fish 0.0.0-stage → 0.5.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/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +202 -2
- package/README.zh.md +203 -0
- package/cordis.patch.yml +12 -0
- package/icon.svg +3 -0
- package/lib/client.js +12941 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +10471 -0
- package/lib/types/client/PluginSettingsCard.d.ts +144 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +92 -0
- package/lib/types/client/apply-guard.d.ts +25 -0
- package/lib/types/client/board/ClampedMarkdown.d.ts +3 -0
- package/lib/types/client/board/ConfirmDialog.d.ts +15 -0
- package/lib/types/client/board/EditTaskModal.d.ts +17 -0
- package/lib/types/client/board/LinkSubtaskModal.d.ts +14 -0
- package/lib/types/client/board/NewTaskModal.d.ts +26 -0
- package/lib/types/client/board/TagManagerModal.d.ts +26 -0
- package/lib/types/client/board/TaskBoard.d.ts +26 -0
- package/lib/types/client/board/TaskCard.d.ts +36 -0
- package/lib/types/client/board/TaskDetail.d.ts +9 -0
- package/lib/types/client/board/TaskForm.d.ts +72 -0
- package/lib/types/client/board/VerificationReport.d.ts +23 -0
- package/lib/types/client/board/card-view.d.ts +113 -0
- package/lib/types/client/board/icons.d.ts +32 -0
- package/lib/types/client/board/overlay.d.ts +69 -0
- package/lib/types/client/board/parse-model-pref.d.ts +4 -0
- package/lib/types/client/board/preset-label.d.ts +22 -0
- package/lib/types/client/board/status-key.d.ts +19 -0
- package/lib/types/client/board/task-markdown.d.ts +19 -0
- package/lib/types/client/host-api.d.ts +63 -0
- package/lib/types/client/index.d.ts +128 -0
- package/lib/types/client/locales.d.ts +443 -0
- package/lib/types/client/main-session.d.ts +32 -0
- package/lib/types/client/native-panel.d.ts +48 -0
- package/lib/types/client/plugin-card-seat.d.ts +108 -0
- package/lib/types/client/schedule-presets.d.ts +10 -0
- package/lib/types/client/schedule-zone.d.ts +97 -0
- package/lib/types/client/seats.d.ts +18 -0
- package/lib/types/client/service.d.ts +32 -0
- package/lib/types/client/settings-entry-form.d.ts +49 -0
- package/lib/types/client/settings-form.d.ts +213 -0
- package/lib/types/core/controller.d.ts +373 -0
- package/lib/types/core/degraded-reason.d.ts +46 -0
- package/lib/types/core/extension.d.ts +283 -0
- package/lib/types/core/freeze-snapshot.d.ts +71 -0
- package/lib/types/core/handover.d.ts +70 -0
- package/lib/types/core/issue-form.d.ts +16 -0
- package/lib/types/core/package-name.d.ts +9 -0
- package/lib/types/core/poll-cadence.d.ts +31 -0
- package/lib/types/core/schedule.d.ts +124 -0
- package/lib/types/core/session-reuse.d.ts +24 -0
- package/lib/types/core/store.d.ts +64 -0
- package/lib/types/core/subtask.d.ts +141 -0
- package/lib/types/core/tasks.d.ts +601 -0
- package/lib/types/core/use-cases/task-archive.d.ts +20 -0
- package/lib/types/core/use-cases/task-create.d.ts +27 -0
- package/lib/types/core/use-cases/task-delete.d.ts +27 -0
- package/lib/types/core/use-cases/task-parent.d.ts +21 -0
- package/lib/types/core/use-cases/task-schedule.d.ts +96 -0
- package/lib/types/core/use-cases/task-tag.d.ts +48 -0
- package/lib/types/core/use-cases/task-update.d.ts +56 -0
- package/lib/types/core/verification-budget.d.ts +52 -0
- package/lib/types/core/verification.d.ts +753 -0
- package/lib/types/core/workspace-target.d.ts +41 -0
- package/lib/types/dsh-home.d.ts +16 -0
- package/lib/types/host/agent-tools.d.ts +27 -0
- package/lib/types/host/extension-registry.d.ts +111 -0
- package/lib/types/host/llm-dispatch.d.ts +63 -0
- package/lib/types/host/verification-gate.d.ts +95 -0
- package/lib/types/host/verification-runner.d.ts +139 -0
- package/lib/types/host/workspace-evidence.d.ts +53 -0
- package/lib/types/host-ai.d.ts +51 -0
- package/lib/types/host-ledger.d.ts +385 -0
- package/lib/types/host-routes.d.ts +36 -0
- package/lib/types/host-runner.d.ts +252 -0
- package/lib/types/host-service.d.ts +379 -0
- package/lib/types/http.d.ts +59 -0
- package/lib/types/index.d.ts +322 -0
- package/lib/types/loopback.d.ts +24 -0
- package/lib/types/mount-once.d.ts +55 -0
- package/lib/types/power-inhibitor.d.ts +73 -0
- package/lib/types/protocol.d.ts +212 -0
- package/lib/types/tool-surface.d.ts +71 -0
- package/package.json +107 -4
- package/src/client/PluginSettingsCard.tsx +564 -0
- package/src/client/TaskBoardSettingsCard.tsx +539 -0
- package/src/client/apply-guard.ts +35 -0
- package/src/client/board/ClampedMarkdown.tsx +69 -0
- package/src/client/board/ConfirmDialog.tsx +44 -0
- package/src/client/board/EditTaskModal.tsx +110 -0
- package/src/client/board/LinkSubtaskModal.tsx +97 -0
- package/src/client/board/NewTaskModal.tsx +718 -0
- package/src/client/board/TagManagerModal.tsx +235 -0
- package/src/client/board/TaskBoard.tsx +558 -0
- package/src/client/board/TaskCard.tsx +315 -0
- package/src/client/board/TaskDetail.tsx +985 -0
- package/src/client/board/TaskForm.tsx +264 -0
- package/src/client/board/VerificationReport.tsx +322 -0
- package/src/client/board/card-view.ts +220 -0
- package/src/client/board/icons.tsx +89 -0
- package/src/client/board/overlay.tsx +189 -0
- package/src/client/board/parse-model-pref.ts +35 -0
- package/src/client/board/preset-label.ts +44 -0
- package/src/client/board/status-key.ts +41 -0
- package/src/client/board/task-markdown.module.css +137 -0
- package/src/client/board/task-markdown.tsx +106 -0
- package/src/client/board-settings.module.css +66 -0
- package/src/client/board.module.css +1837 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/host-api.ts +336 -0
- package/src/client/index.ts +501 -0
- package/src/client/locales.ts +905 -0
- package/src/client/main-session.ts +43 -0
- package/src/client/native-panel.tsx +140 -0
- package/src/client/plugin-card-seat.ts +199 -0
- package/src/client/schedule-presets.ts +13 -0
- package/src/client/schedule-zone.ts +233 -0
- package/src/client/seats.tsx +58 -0
- package/src/client/service.ts +94 -0
- package/src/client/settings-card.module.css +444 -0
- package/src/client/settings-entry-form.ts +142 -0
- package/src/client/settings-form.ts +468 -0
- package/src/core/controller.ts +871 -0
- package/src/core/degraded-reason.ts +81 -0
- package/src/core/extension.ts +376 -0
- package/src/core/freeze-snapshot.ts +213 -0
- package/src/core/handover.ts +132 -0
- package/src/core/issue-form.ts +19 -0
- package/src/core/package-name.ts +9 -0
- package/src/core/poll-cadence.ts +41 -0
- package/src/core/schedule.ts +363 -0
- package/src/core/session-reuse.ts +40 -0
- package/src/core/store.ts +371 -0
- package/src/core/subtask.ts +341 -0
- package/src/core/tasks.ts +843 -0
- package/src/core/use-cases/task-archive.ts +91 -0
- package/src/core/use-cases/task-create.ts +110 -0
- package/src/core/use-cases/task-delete.ts +43 -0
- package/src/core/use-cases/task-parent.ts +65 -0
- package/src/core/use-cases/task-schedule.ts +251 -0
- package/src/core/use-cases/task-tag.ts +110 -0
- package/src/core/use-cases/task-update.ts +126 -0
- package/src/core/verification-budget.ts +115 -0
- package/src/core/verification.ts +1594 -0
- package/src/core/workspace-target.ts +59 -0
- package/src/dsh-home.ts +42 -0
- package/src/host/agent-tools.ts +762 -0
- package/src/host/extension-registry.ts +509 -0
- package/src/host/llm-dispatch.ts +87 -0
- package/src/host/verification-gate.ts +487 -0
- package/src/host/verification-runner.ts +702 -0
- package/src/host/workspace-evidence.ts +176 -0
- package/src/host-ai.ts +158 -0
- package/src/host-ledger.ts +1826 -0
- package/src/host-routes.ts +306 -0
- package/src/host-runner.ts +755 -0
- package/src/host-service.ts +1112 -0
- package/src/http.ts +127 -0
- package/src/index.ts +722 -0
- package/src/loopback.ts +63 -0
- package/src/mount-once.ts +142 -0
- package/src/power-inhibitor.ts +321 -0
- package/src/protocol.ts +591 -0
- package/src/tool-surface.ts +95 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update-task use case: apply an editable-field patch (title/description/
|
|
3
|
+
* prompt plus the execution targets workspaceId/mode/permission) with a
|
|
4
|
+
* fresh updatedAt. Pure ledger transition (no persistence or notify — the
|
|
5
|
+
* controller orchestrates those).
|
|
6
|
+
*
|
|
7
|
+
* An explicit `undefined` in the patch clears the field (the task falls
|
|
8
|
+
* back to the runtime default); an unknown permission string is ignored so
|
|
9
|
+
* stale UI can never persist a value the execution service rejects.
|
|
10
|
+
*/
|
|
11
|
+
import { freezeOf, isTaskPermission, normalizeTags, normalizeTargetId, type TaskRecord, type TaskPermission, type TaskTag } from '../tasks.ts'
|
|
12
|
+
import type { FreezeSnapshot } from '../freeze-snapshot.ts'
|
|
13
|
+
import type { TaskHandoverInput } from '../handover.ts'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Editable fields on a task (the update patch surface). `freeze` replaces the
|
|
17
|
+
* continuation-card snapshot (restamping frozenAt); an explicit null clears it.
|
|
18
|
+
*/
|
|
19
|
+
export type TaskUpdatePatch = Partial<Pick<TaskRecord, 'title' | 'description' | 'prompt' | 'workspaceId' | 'mode' | 'permission' | 'model' | 'reuseSession' | 'teamRun' | 'goalRun' | 'skipVerification'>> & {
|
|
20
|
+
freeze?: FreezeSnapshot & { redacted?: boolean } | null
|
|
21
|
+
/** Replaces the handover bundle (restamping bundledAt); an explicit null clears it. */
|
|
22
|
+
handover?: TaskHandoverInput | null
|
|
23
|
+
/**
|
|
24
|
+
* Replaces the task's labels (issue #1521). Unlike the content fields, tags
|
|
25
|
+
* stay editable after the first run: they classify the task and shape the
|
|
26
|
+
* NEXT execution prompt, they are not the record of what already ran. An
|
|
27
|
+
* explicit null (or a list that normalizes to nothing) clears them.
|
|
28
|
+
*/
|
|
29
|
+
tags?: TaskTag[] | null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The fields that edit the task's content (what the user reads and what the
|
|
33
|
+
* next execution sends). Unlike the execution targets they stay editable only
|
|
34
|
+
* while the task has never started executing — after the first run the
|
|
35
|
+
* recorded prompt is the record of what actually ran, so it becomes read-only.
|
|
36
|
+
*/
|
|
37
|
+
export const TASK_CONTENT_FIELDS = ['title', 'description', 'prompt'] as const
|
|
38
|
+
|
|
39
|
+
/** Whether an update patch touches any task-content field. */
|
|
40
|
+
export function hasContentPatch(patch: TaskUpdatePatch): boolean {
|
|
41
|
+
return (TASK_CONTENT_FIELDS as readonly string[]).some(field => field in patch)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Whether a task's content may still be edited: the task must be on-board
|
|
46
|
+
* (not archived) and must never have started executing. Fail-closed: a task
|
|
47
|
+
* with any execution record — running, settled, or cancelled before launch —
|
|
48
|
+
* keeps its content fixed. The run, not the column, is the trigger: a card
|
|
49
|
+
* parked in 'running' by hand has nothing recorded yet and stays editable.
|
|
50
|
+
*/
|
|
51
|
+
export function canEditTaskContent(task: TaskRecord): boolean {
|
|
52
|
+
return task.archivedAt === undefined && task.executions.length === 0
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Keep an unknown permission string from entering the ledger. */
|
|
56
|
+
function normalizePermission(
|
|
57
|
+
current: TaskPermission | undefined,
|
|
58
|
+
value: TaskPermission | undefined,
|
|
59
|
+
): TaskPermission | undefined {
|
|
60
|
+
if (value === undefined) return undefined
|
|
61
|
+
return isTaskPermission(value) ? value : current
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Apply an update across the ledger. Tasks that do not match the id are left
|
|
66
|
+
* untouched; the matched task receives the patch plus a fresh updatedAt.
|
|
67
|
+
* @param tasks - current ledger.
|
|
68
|
+
* @param id - the task to update.
|
|
69
|
+
* @param patch - editable-field changes.
|
|
70
|
+
* @param now - clock instant (ms epoch).
|
|
71
|
+
*/
|
|
72
|
+
export function applyUpdateTask(
|
|
73
|
+
tasks: readonly TaskRecord[],
|
|
74
|
+
id: string,
|
|
75
|
+
patch: TaskUpdatePatch,
|
|
76
|
+
now: number,
|
|
77
|
+
): readonly TaskRecord[] {
|
|
78
|
+
return tasks.map(task => {
|
|
79
|
+
if (task.id !== id) return task
|
|
80
|
+
const { freeze: freezePatch, handover: handoverPatch, tags: tagsPatch, ...rest } = patch
|
|
81
|
+
const workspaceId = 'workspaceId' in patch ? normalizeTargetId(patch.workspaceId) : undefined
|
|
82
|
+
const mode = 'mode' in patch ? normalizeTargetId(patch.mode) : undefined
|
|
83
|
+
const permission = 'permission' in patch ? normalizePermission(task.permission, patch.permission) : undefined
|
|
84
|
+
const model = 'model' in patch ? normalizeTargetId(patch.model) : undefined
|
|
85
|
+
const next: TaskRecord = { ...task, ...rest, updatedAt: now }
|
|
86
|
+
// Content fields normalize like creation does (trimmed); an explicit
|
|
87
|
+
// undefined keeps the current value — content cannot be cleared.
|
|
88
|
+
for (const field of TASK_CONTENT_FIELDS) {
|
|
89
|
+
if (!(field in patch)) continue
|
|
90
|
+
const value = patch[field]
|
|
91
|
+
next[field] = value === undefined ? task[field] : value.trim()
|
|
92
|
+
}
|
|
93
|
+
// null (or a vanished key value) clears the snapshot; a present object
|
|
94
|
+
// replaces it with a fresh frozenAt stamp.
|
|
95
|
+
next.freeze = freezePatch == null ? undefined : freezeOf(freezePatch, now)
|
|
96
|
+
// Handover follows the same null-clears convention, restamping bundledAt.
|
|
97
|
+
next.handover = handoverPatch == null ? undefined : { ...handoverPatch, bundledAt: now }
|
|
98
|
+
// Tags use the same convention: a present array replaces the set (after
|
|
99
|
+
// repair), an explicit null or a fully-invalid list clears it.
|
|
100
|
+
if ('tags' in patch) next.tags = tagsPatch == null ? undefined : normalizeTags(tagsPatch)
|
|
101
|
+
// The permission confirmation binds the exact permission value: a change
|
|
102
|
+
// of the pinned permission or of the handover bundle re-arms the gate
|
|
103
|
+
// (blocking confirm-then-swap escalation). handover was destructured out
|
|
104
|
+
// of rest above, so the stamp survives only when explicitly kept.
|
|
105
|
+
if (('permission' in patch && patch.permission !== undefined && patch.permission !== task.permission) || 'handover' in patch) {
|
|
106
|
+
next.permissionConfirmedAt = undefined
|
|
107
|
+
}
|
|
108
|
+
// Session reuse is a boolean opt-in; false (or an explicit null from a
|
|
109
|
+
// caller that needs to clear it) returns the task to one session per run.
|
|
110
|
+
if ('reuseSession' in patch) next.reuseSession = patch.reuseSession === true ? true : undefined
|
|
111
|
+
// Team execution is a boolean opt-in with the same clear-by-false rule.
|
|
112
|
+
if ('teamRun' in patch) next.teamRun = patch.teamRun === true ? true : undefined
|
|
113
|
+
// The /goal opt-in is default-OFF: true joins the goal run, while false
|
|
114
|
+
// (or an explicit null) returns the card to the default and stores nothing.
|
|
115
|
+
if ('goalRun' in patch) next.goalRun = patch.goalRun === true ? true : undefined
|
|
116
|
+
// The acceptance opt-out is the mirror image: default OFF, so only true
|
|
117
|
+
// pins a card out of the gate; false (or an explicit null) returns it to
|
|
118
|
+
// inheriting the board-wide switch and stores nothing.
|
|
119
|
+
if ('skipVerification' in patch) next.skipVerification = patch.skipVerification === true ? true : undefined
|
|
120
|
+
if (workspaceId !== undefined || 'workspaceId' in patch) next.workspaceId = workspaceId
|
|
121
|
+
if (mode !== undefined || 'mode' in patch) next.mode = mode
|
|
122
|
+
if (permission !== undefined || 'permission' in patch) next.permission = permission
|
|
123
|
+
if (model !== undefined || 'model' in patch) next.model = model
|
|
124
|
+
return next
|
|
125
|
+
})
|
|
126
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal acceptance time budgets: the one place the judge's per-call ceiling and
|
|
3
|
+
* the acceptance's total ceiling live.
|
|
4
|
+
*
|
|
5
|
+
* Both are user settings (seconds), so the bounds and the seconds to
|
|
6
|
+
* milliseconds conversion live here rather than in either half: the Host
|
|
7
|
+
* clamps a hand-edited profile value to the same range the schema declares, and
|
|
8
|
+
* the gate reads the effective values live, so raising a ceiling takes effect
|
|
9
|
+
* without a reload.
|
|
10
|
+
*
|
|
11
|
+
* The two numbers are one budget, not two independent knobs: one acceptance is
|
|
12
|
+
* {@link ACCEPTANCE_JUDGE_CALLS} serial judge calls (three criteria times two
|
|
13
|
+
* rounds), so a total budget that cannot fit the calls can only end the
|
|
14
|
+
* acceptance early. {@link DEFAULT_VERIFICATION_BUDGET_SECONDS} is therefore
|
|
15
|
+
* derived from the per-call default times the call count plus two retries.
|
|
16
|
+
*
|
|
17
|
+
* @module dsh-task-board/core/verification-budget
|
|
18
|
+
*/
|
|
19
|
+
import { CODING_CRITERIA, VERIFICATION_ROUNDS } from './verification.ts'
|
|
20
|
+
|
|
21
|
+
/** Judge calls one acceptance issues: every criterion, every round. */
|
|
22
|
+
export const ACCEPTANCE_JUDGE_CALLS: number = CODING_CRITERIA.length * VERIFICATION_ROUNDS
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Per-judge-call ceiling used when the row names none: two and a half minutes
|
|
26
|
+
* for a reasoning model reading an 80,000 character trace with a 16,384 token
|
|
27
|
+
* output cap. The former 120s constant was tight enough that a slow but healthy
|
|
28
|
+
* route produced a wall of per-call timeouts, and every one of them was charged
|
|
29
|
+
* as an acceptance anomaly against a budget that then failed the card.
|
|
30
|
+
*/
|
|
31
|
+
export const DEFAULT_VERIFICATION_CALL_TIMEOUT_SECONDS = 150
|
|
32
|
+
|
|
33
|
+
/** Shortest accepted per-call ceiling: below this no useful judge answers. */
|
|
34
|
+
export const VERIFICATION_CALL_TIMEOUT_MIN_SECONDS = 30
|
|
35
|
+
|
|
36
|
+
/** Longest accepted per-call ceiling, ten minutes. */
|
|
37
|
+
export const VERIFICATION_CALL_TIMEOUT_MAX_SECONDS = 600
|
|
38
|
+
|
|
39
|
+
/** Headroom the default total budget leaves beyond the mandatory calls. */
|
|
40
|
+
const DEFAULT_BUDGET_EXTRA_CALLS = 2
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Total ceiling of one acceptance attempt, covering evidence rendering and
|
|
44
|
+
* every judge call including retries. Derived from the per-call default rather
|
|
45
|
+
* than pinned, because a total budget smaller than
|
|
46
|
+
* {@link ACCEPTANCE_JUDGE_CALLS} times the per-call ceiling guarantees that no
|
|
47
|
+
* acceptance can ever finish.
|
|
48
|
+
*/
|
|
49
|
+
export const DEFAULT_VERIFICATION_BUDGET_SECONDS: number =
|
|
50
|
+
DEFAULT_VERIFICATION_CALL_TIMEOUT_SECONDS * (ACCEPTANCE_JUDGE_CALLS + DEFAULT_BUDGET_EXTRA_CALLS)
|
|
51
|
+
|
|
52
|
+
/** Shortest accepted total budget: long enough for at least one judge call. */
|
|
53
|
+
export const VERIFICATION_BUDGET_MIN_SECONDS = 120
|
|
54
|
+
|
|
55
|
+
/** Longest accepted total budget, thirty minutes. */
|
|
56
|
+
export const VERIFICATION_BUDGET_MAX_SECONDS = 1800
|
|
57
|
+
|
|
58
|
+
/** The default total budget in milliseconds, the face the abort timer takes. */
|
|
59
|
+
export const DEFAULT_VERIFICATION_BUDGET_MS = DEFAULT_VERIFICATION_BUDGET_SECONDS * 1_000
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Clamp a configured ceiling into the supported range. A value the schema
|
|
63
|
+
* would refuse (non-finite, below the floor, above the ceiling) still leaves
|
|
64
|
+
* the board judging: an out-of-range setting never disables acceptance.
|
|
65
|
+
* @param value - configured seconds, or undefined for the default.
|
|
66
|
+
* @param fallback - the default to use when nothing usable was configured.
|
|
67
|
+
* @param min - shortest accepted value.
|
|
68
|
+
* @param max - longest accepted value.
|
|
69
|
+
* @returns the effective value in seconds.
|
|
70
|
+
*/
|
|
71
|
+
function clampSeconds(value: number | undefined, fallback: number, min: number, max: number): number {
|
|
72
|
+
if (value === undefined || !Number.isFinite(value)) return fallback
|
|
73
|
+
return Math.min(Math.max(Math.trunc(value), min), max)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The effective per-judge-call ceiling.
|
|
78
|
+
* @param seconds - configured seconds, or undefined for the default.
|
|
79
|
+
* @returns the effective ceiling in seconds.
|
|
80
|
+
*/
|
|
81
|
+
export function normalizeVerificationCallTimeoutSeconds(seconds: number | undefined): number {
|
|
82
|
+
return clampSeconds(
|
|
83
|
+
seconds,
|
|
84
|
+
DEFAULT_VERIFICATION_CALL_TIMEOUT_SECONDS,
|
|
85
|
+
VERIFICATION_CALL_TIMEOUT_MIN_SECONDS,
|
|
86
|
+
VERIFICATION_CALL_TIMEOUT_MAX_SECONDS,
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The effective per-judge-call ceiling the timer face takes.
|
|
92
|
+
* @param seconds - configured seconds, or undefined for the default.
|
|
93
|
+
* @returns the effective ceiling in milliseconds.
|
|
94
|
+
*/
|
|
95
|
+
export function verificationCallTimeoutMs(seconds: number | undefined): number {
|
|
96
|
+
return normalizeVerificationCallTimeoutSeconds(seconds) * 1_000
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The effective total budget of one acceptance attempt.
|
|
101
|
+
* @param seconds - configured seconds, or undefined for the default.
|
|
102
|
+
* @returns the effective budget in seconds.
|
|
103
|
+
*/
|
|
104
|
+
export function normalizeVerificationBudgetSeconds(seconds: number | undefined): number {
|
|
105
|
+
return clampSeconds(seconds, DEFAULT_VERIFICATION_BUDGET_SECONDS, VERIFICATION_BUDGET_MIN_SECONDS, VERIFICATION_BUDGET_MAX_SECONDS)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The effective total budget the abort face takes.
|
|
110
|
+
* @param seconds - configured seconds, or undefined for the default.
|
|
111
|
+
* @returns the effective budget in milliseconds.
|
|
112
|
+
*/
|
|
113
|
+
export function verificationBudgetMs(seconds: number | undefined): number {
|
|
114
|
+
return normalizeVerificationBudgetSeconds(seconds) * 1_000
|
|
115
|
+
}
|