@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host model catalog: the routes this deployment serves, the reasoning metadata
|
|
3
|
+
* their adapters expose, and the normalization the board reads them through.
|
|
4
|
+
*
|
|
5
|
+
* The board publishes the catalog (the settings card's model and level pickers
|
|
6
|
+
* read it) and resolves a card's pinned reasoning effort against it, so "this
|
|
7
|
+
* model declares that level" is answered from the host's own configuration
|
|
8
|
+
* instead of a guess. Framework-free (no cordis, no SDK imports) because both
|
|
9
|
+
* halves compile it.
|
|
10
|
+
*
|
|
11
|
+
* @module dsh-task-board/core/model-catalog
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** One resolved `provider/model` route. */
|
|
15
|
+
export interface ModelRoute {
|
|
16
|
+
provider: string
|
|
17
|
+
model: string
|
|
18
|
+
/** Reasoning level the route is configured or resolved at; absent means inherit. */
|
|
19
|
+
reasoningEffort?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** One reasoning-effort option an adapter exposes for an exact model route. */
|
|
23
|
+
export interface CatalogReasoningEffort {
|
|
24
|
+
id: string
|
|
25
|
+
name?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** One adapter-discovered model of the host catalog. */
|
|
29
|
+
export interface CatalogModel {
|
|
30
|
+
id: string
|
|
31
|
+
name?: string
|
|
32
|
+
reasoning?: { efforts: CatalogReasoningEffort[]; defaultEffort?: string }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** One provider route and its models. */
|
|
36
|
+
export interface CatalogGroup {
|
|
37
|
+
id: string
|
|
38
|
+
name?: string
|
|
39
|
+
models: CatalogModel[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The host model catalog the board resolves routes and reasoning levels against. */
|
|
43
|
+
export interface ModelCatalogView {
|
|
44
|
+
/** The route an unconfigured session starts at: the host's own configuration. */
|
|
45
|
+
default?: ModelRoute
|
|
46
|
+
groups: CatalogGroup[]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Split a qualified `provider/model` route; undefined when it is not one. */
|
|
50
|
+
export function parseModelRoute(qualified: string | undefined): { provider: string; model: string } | undefined {
|
|
51
|
+
const raw = qualified?.trim() ?? ''
|
|
52
|
+
if (raw === '') return undefined
|
|
53
|
+
const slash = raw.indexOf('/')
|
|
54
|
+
if (slash <= 0 || slash === raw.length - 1) return undefined
|
|
55
|
+
const provider = raw.slice(0, slash).trim()
|
|
56
|
+
const model = raw.slice(slash + 1).trim()
|
|
57
|
+
if (provider === '' || model === '') return undefined
|
|
58
|
+
return { provider, model: model }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Normalize the raw `session/modelCatalog` reply into the shape the board
|
|
63
|
+
* reads. Everything is optional in the wire value, so every level is checked:
|
|
64
|
+
* an unreadable catalog degrades to "unknown", never to a crash.
|
|
65
|
+
* @param value - the raw gateway reply.
|
|
66
|
+
* @returns the normalized catalog, or undefined when nothing usable arrived.
|
|
67
|
+
*/
|
|
68
|
+
export function normalizeCatalog(value: unknown): ModelCatalogView | undefined {
|
|
69
|
+
if (typeof value !== 'object' || value === null) return undefined
|
|
70
|
+
const row = value as Record<string, unknown>
|
|
71
|
+
let fallback: ModelRoute | undefined
|
|
72
|
+
const rawDefault = row.default
|
|
73
|
+
if (typeof rawDefault === 'object' && rawDefault !== null) {
|
|
74
|
+
const route = rawDefault as Record<string, unknown>
|
|
75
|
+
if (typeof route.provider === 'string' && route.provider !== '' && typeof route.model === 'string' && route.model !== '') {
|
|
76
|
+
fallback = {
|
|
77
|
+
provider: route.provider,
|
|
78
|
+
model: route.model,
|
|
79
|
+
...(typeof route.reasoningEffort === 'string' && route.reasoningEffort !== '' ? { reasoningEffort: route.reasoningEffort } : {}),
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const groups: CatalogGroup[] = []
|
|
84
|
+
for (const entry of Array.isArray(row.groups) ? row.groups : []) {
|
|
85
|
+
if (typeof entry !== 'object' || entry === null) continue
|
|
86
|
+
const group = entry as Record<string, unknown>
|
|
87
|
+
if (typeof group.id !== 'string' || group.id === '') continue
|
|
88
|
+
const models: CatalogModel[] = []
|
|
89
|
+
for (const item of Array.isArray(group.models) ? group.models : []) {
|
|
90
|
+
if (typeof item !== 'object' || item === null) continue
|
|
91
|
+
const model = item as Record<string, unknown>
|
|
92
|
+
if (typeof model.id !== 'string' || model.id === '') continue
|
|
93
|
+
const reasoning = typeof model.reasoning === 'object' && model.reasoning !== null
|
|
94
|
+
? model.reasoning as Record<string, unknown>
|
|
95
|
+
: undefined
|
|
96
|
+
const efforts: CatalogReasoningEffort[] = []
|
|
97
|
+
for (const effort of Array.isArray(reasoning?.efforts) ? reasoning.efforts as unknown[] : []) {
|
|
98
|
+
if (typeof effort !== 'object' || effort === null) continue
|
|
99
|
+
const option = effort as Record<string, unknown>
|
|
100
|
+
if (typeof option.id !== 'string' || option.id === '') continue
|
|
101
|
+
efforts.push({ id: option.id, ...(typeof option.name === 'string' ? { name: option.name } : {}) })
|
|
102
|
+
}
|
|
103
|
+
const defaultEffort = typeof reasoning?.defaultEffort === 'string' && reasoning.defaultEffort !== '' ? reasoning.defaultEffort : undefined
|
|
104
|
+
models.push({
|
|
105
|
+
id: model.id,
|
|
106
|
+
...(typeof model.name === 'string' ? { name: model.name } : {}),
|
|
107
|
+
...(reasoning === undefined ? {} : { reasoning: { efforts, ...(defaultEffort === undefined ? {} : { defaultEffort }) } }),
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
groups.push({ id: group.id, ...(typeof group.name === 'string' ? { name: group.name } : {}), models })
|
|
111
|
+
}
|
|
112
|
+
if (fallback === undefined && groups.length === 0) return undefined
|
|
113
|
+
return { ...(fallback === undefined ? {} : { default: fallback }), groups }
|
|
114
|
+
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* the only place that can complete the documented `provider/model` or model-id
|
|
16
16
|
* pin.
|
|
17
17
|
*/
|
|
18
|
-
import type { CatalogModel, ModelCatalogView } from './
|
|
18
|
+
import type { CatalogModel, ModelCatalogView } from './model-catalog.ts'
|
|
19
19
|
|
|
20
20
|
/** One execution route an effort resolves against: `provider/model`, or a bare model id. */
|
|
21
21
|
export interface ReasoningRoute {
|
package/src/core/store.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { sanitizeFreezeSnapshot } from './freeze-snapshot.ts'
|
|
|
18
18
|
import { sanitizeHandover } from './handover.ts'
|
|
19
19
|
import { normalizeTaskIntegrations } from './extension.ts'
|
|
20
20
|
import { normalizeAttachments } from './attachment.ts'
|
|
21
|
-
import { normalizeVerification } from './verification.ts'
|
|
22
21
|
|
|
23
22
|
/** Persistence seam for the task ledger. */
|
|
24
23
|
export interface TaskStore {
|
|
@@ -76,8 +75,6 @@ function isTaskRecordShape(value: unknown): value is Omit<TaskRecord, 'status'>
|
|
|
76
75
|
if (record.hidden !== undefined && typeof record.hidden !== 'boolean') return false
|
|
77
76
|
if (record.attachments !== undefined && !Array.isArray(record.attachments)) return false
|
|
78
77
|
if (record.reuseSession !== undefined && typeof record.reuseSession !== 'boolean') return false
|
|
79
|
-
if (record.goalRun !== undefined && typeof record.goalRun !== 'boolean') return false
|
|
80
|
-
if (record.skipVerification !== undefined && typeof record.skipVerification !== 'boolean') return false
|
|
81
78
|
if (!Array.isArray(record.executions)) return false
|
|
82
79
|
for (const execution of record.executions) {
|
|
83
80
|
if (typeof execution !== 'object' || execution === null) return false
|
|
@@ -95,13 +92,30 @@ function isTaskRecordShape(value: unknown): value is Omit<TaskRecord, 'status'>
|
|
|
95
92
|
// written before the field existed carries none, and a non-boolean value
|
|
96
93
|
// is dropped by the repair below rather than trusted as provenance.
|
|
97
94
|
if (entry.external !== undefined && typeof entry.external !== 'boolean') return false
|
|
98
|
-
// The acceptance block is repaired like every other optional field: an
|
|
99
|
-
// unusable one is dropped, which can only make the board MORE strict.
|
|
100
|
-
if (entry.verification !== undefined && normalizeVerification(entry.verification) === undefined) return false
|
|
101
95
|
}
|
|
102
96
|
return true
|
|
103
97
|
}
|
|
104
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Drop the fields of retired features from one loaded row.
|
|
101
|
+
*
|
|
102
|
+
* A ledger written by an older build may still carry them: `goalRun` and
|
|
103
|
+
* `skipVerification` on a card, and the acceptance block on an execution. They
|
|
104
|
+
* are removed field by field rather than rejected — an old row always loads,
|
|
105
|
+
* every other field is untouched, and the next commit persists the row without
|
|
106
|
+
* them, so a removed option never survives a load and no new value is ever
|
|
107
|
+
* written for it.
|
|
108
|
+
* @param value - the parsed row (a card or one execution record).
|
|
109
|
+
* @returns a copy without the retired fields.
|
|
110
|
+
*/
|
|
111
|
+
function withoutRetiredFields<T extends object>(value: T): T {
|
|
112
|
+
const kept = { ...value } as Record<string, unknown>
|
|
113
|
+
delete kept.goalRun
|
|
114
|
+
delete kept.skipVerification
|
|
115
|
+
delete kept.verification
|
|
116
|
+
return kept as T
|
|
117
|
+
}
|
|
118
|
+
|
|
105
119
|
/** A task record is structurally valid if it round-trips through the UI. */
|
|
106
120
|
export function isTaskRecord(value: unknown): value is TaskRecord {
|
|
107
121
|
return isTaskRecordShape(value) && isTaskStatus(value.status)
|
|
@@ -245,7 +259,7 @@ export function parseLedger(raw: string | null): TaskRecord[] {
|
|
|
245
259
|
}
|
|
246
260
|
// Always (re)assign the schedule: a repair that returns undefined must
|
|
247
261
|
// clear a malformed persisted rule rather than leave it in the row.
|
|
248
|
-
const task: TaskRecord = { ...row, status: normalizeStatus(row.status) }
|
|
262
|
+
const task: TaskRecord = withoutRetiredFields({ ...row, status: normalizeStatus(row.status) })
|
|
249
263
|
task.schedule = normalizeSchedule(row.schedule)
|
|
250
264
|
// The lineage link is repaired like every other optional field: a blank or
|
|
251
265
|
// non-string parent id clears the link instead of dropping the row. Whether
|
|
@@ -255,16 +269,13 @@ export function parseLedger(raw: string | null): TaskRecord[] {
|
|
|
255
269
|
// Cascade bookkeeping on execution records is repaired field by field too,
|
|
256
270
|
// so a hand-edited ledger degrades a run group instead of the whole task.
|
|
257
271
|
task.executions = task.executions.map(execution => ({
|
|
258
|
-
...execution,
|
|
272
|
+
...withoutRetiredFields(execution),
|
|
259
273
|
runGroupId: normalizeTargetId(execution.runGroupId),
|
|
260
274
|
ownResult: isExecutionOutcome(execution.ownResult) ? execution.ownResult : undefined,
|
|
261
275
|
ownError: typeof execution.ownError === 'string' ? execution.ownError : undefined,
|
|
262
276
|
// A summary a reader does not recognize (an older document has none) is
|
|
263
277
|
// simply absent; a malformed one is dropped without costing the run.
|
|
264
278
|
summary: normalizeExecutionSummary(execution.summary),
|
|
265
|
-
// A malformed acceptance block is dropped rather than dropping the
|
|
266
|
-
// execution record: the board then treats that run as unverified.
|
|
267
|
-
verification: normalizeVerification(execution.verification),
|
|
268
279
|
// A malformed rework block is dropped on the same terms: the run itself
|
|
269
280
|
// is what the history is for, and only its instructions are unrecoverable.
|
|
270
281
|
rework: normalizeExecutionRework(execution.rework),
|
|
@@ -282,12 +293,6 @@ export function parseLedger(raw: string | null): TaskRecord[] {
|
|
|
282
293
|
task.archivedAt = typeof row.archivedAt === 'number' && Number.isFinite(row.archivedAt) ? row.archivedAt : undefined
|
|
283
294
|
task.permission = isTaskPermission(row.permission) ? row.permission as TaskPermission : undefined
|
|
284
295
|
task.reuseSession = row.reuseSession === true ? true : undefined
|
|
285
|
-
// The goal opt-in is stored only when it is ON: absent means the default
|
|
286
|
-
// (one plain turn per run), so a hand-edited false normalizes back to it.
|
|
287
|
-
task.goalRun = row.goalRun === true ? true : undefined
|
|
288
|
-
// The acceptance opt-out is stored only when it is ON: absent inherits the
|
|
289
|
-
// board-wide switch, so a hand-edited false normalizes back to inherit.
|
|
290
|
-
task.skipVerification = row.skipVerification === true ? true : undefined
|
|
291
296
|
task.freeze = normalizeFreeze(row.freeze)
|
|
292
297
|
task.handover = normalizeHandover(row.handover)
|
|
293
298
|
// Tags are repaired field by field like the schedule: a malformed entry is
|
package/src/core/tasks.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* unit-testable in isolation.
|
|
6
6
|
*/
|
|
7
7
|
import type { FreezeSnapshot } from './freeze-snapshot.ts'
|
|
8
|
-
import type { ExecutionVerification } from './verification.ts'
|
|
9
8
|
import type { TaskHandover, TaskHandoverInput } from './handover.ts'
|
|
10
9
|
import { normalizeTaskIntegrations, type TaskBoardExtensionPayload } from './extension.ts'
|
|
11
10
|
import { normalizeAttachments, type TaskAttachment } from './attachment.ts'
|
|
@@ -134,14 +133,6 @@ export interface ExecutionRecord {
|
|
|
134
133
|
* informational, and every field above is what the board decides with.
|
|
135
134
|
*/
|
|
136
135
|
summary?: ExecutionSummary
|
|
137
|
-
/**
|
|
138
|
-
* Goal acceptance state of this execution (task-board goal verification).
|
|
139
|
-
* Fixed when the execution starts and never rewritten from later settings:
|
|
140
|
-
* the contract is frozen here, the attempts accrue here, and the settlement
|
|
141
|
-
* rule reads the pass record here. Absent on an execution that started
|
|
142
|
-
* before the feature existed, which keeps it on the historical verdict.
|
|
143
|
-
*/
|
|
144
|
-
verification?: ExecutionVerification
|
|
145
136
|
}
|
|
146
137
|
|
|
147
138
|
/**
|
|
@@ -493,32 +484,6 @@ export interface TaskRecord {
|
|
|
493
484
|
* run group it opened before this behavior changed.
|
|
494
485
|
*/
|
|
495
486
|
teamRun?: boolean
|
|
496
|
-
/**
|
|
497
|
-
* Start every execution of this task with dsh's built-in `/goal` command,
|
|
498
|
-
* armed with the composed execution prompt as its objective. The session then
|
|
499
|
-
* keeps working automatic continuation rounds until the agent marks the goal
|
|
500
|
-
* complete, and this board settles the execution on the goal's own end
|
|
501
|
-
* instead of at the first turn end. Absent means OFF — the option is
|
|
502
|
-
* unchecked by default, so only an explicit `true` joins the goal run and
|
|
503
|
-
* every card that never touched it (including every card written before the
|
|
504
|
-
* field existed) runs one plain turn. A session whose `/goal` command is
|
|
505
|
-
* refused still runs the prompt.
|
|
506
|
-
*/
|
|
507
|
-
goalRun?: boolean
|
|
508
|
-
/**
|
|
509
|
-
* Run this task's goal executions WITHOUT the board's acceptance gate.
|
|
510
|
-
*
|
|
511
|
-
* Absent means INHERIT: the execution's applicability is decided by the
|
|
512
|
-
* board-wide `goalVerification` switch frozen at start, exactly as a card
|
|
513
|
-
* that never touched this option behaves. Only an explicit `true` opts the
|
|
514
|
-
* card out, and the execution records `applicability: 'disabled'` so the
|
|
515
|
-
* report says plainly that nothing certified this run.
|
|
516
|
-
*
|
|
517
|
-
* The opt-out is per execution, not per run: flipping it never rewrites the
|
|
518
|
-
* verdict rule of an execution already open, and a rerun or a scheduled
|
|
519
|
-
* occurrence reads the card's current value when it freezes its contract.
|
|
520
|
-
*/
|
|
521
|
-
skipVerification?: boolean
|
|
522
487
|
/**
|
|
523
488
|
* Frozen context snapshot for a continuation card; absent on plain tasks.
|
|
524
489
|
* Sanitized before it enters the ledger (redaction, slash-command taint,
|
|
@@ -625,16 +590,6 @@ export interface NewTaskInput {
|
|
|
625
590
|
applyCardDefaults?: boolean
|
|
626
591
|
/** Reuse the previous execution's session for later runs (issue #1419). */
|
|
627
592
|
reuseSession?: boolean
|
|
628
|
-
/**
|
|
629
|
-
* Start the execution with dsh's built-in `/goal`. Absent means the default
|
|
630
|
-
* (one plain turn); only an explicit true joins the goal run.
|
|
631
|
-
*/
|
|
632
|
-
goalRun?: boolean
|
|
633
|
-
/**
|
|
634
|
-
* Run this task's goal executions without the acceptance gate; absent
|
|
635
|
-
* inherits the board-wide `goalVerification` switch.
|
|
636
|
-
*/
|
|
637
|
-
skipVerification?: boolean
|
|
638
593
|
/**
|
|
639
594
|
* Optional scheduling rule requested at creation time (the new-task
|
|
640
595
|
* dialog): an enable flag, the kind of plan (a recurring 5-field cron
|
|
@@ -794,14 +749,6 @@ export function createTask(input: NewTaskInput, now: number, id: string): TaskRe
|
|
|
794
749
|
model: normalizeTargetId(input.model),
|
|
795
750
|
reasoningEffort: normalizeTargetId(input.reasoningEffort),
|
|
796
751
|
reuseSession: input.reuseSession === true ? true : undefined,
|
|
797
|
-
// Default OFF: only an explicit true is stored, so a card that never
|
|
798
|
-
// touched the option (and every card written before the field existed)
|
|
799
|
-
// keeps running one plain turn.
|
|
800
|
-
goalRun: input.goalRun === true ? true : undefined,
|
|
801
|
-
// Default OFF: only an explicit true is stored, so a card that never
|
|
802
|
-
// touched the option inherits the board-wide acceptance switch exactly as
|
|
803
|
-
// every card written before the field existed does.
|
|
804
|
-
skipVerification: input.skipVerification === true ? true : undefined,
|
|
805
752
|
...(input.freeze === undefined ? {} : { freeze: freezeOf(input.freeze, now) }),
|
|
806
753
|
...(input.handover === undefined ? {} : { handover: { ...input.handover, bundledAt: now } }),
|
|
807
754
|
...(tags === undefined ? {} : { tags }),
|
|
@@ -17,7 +17,7 @@ import type { TaskHandoverInput } from '../handover.ts'
|
|
|
17
17
|
* Editable fields on a task (the update patch surface). `freeze` replaces the
|
|
18
18
|
* continuation-card snapshot (restamping frozenAt); an explicit null clears it.
|
|
19
19
|
*/
|
|
20
|
-
export type TaskUpdatePatch = Partial<Pick<TaskRecord, 'title' | 'description' | 'prompt' | 'workspaceId' | 'mode' | 'permission' | 'model' | 'reasoningEffort' | 'reuseSession'
|
|
20
|
+
export type TaskUpdatePatch = Partial<Pick<TaskRecord, 'title' | 'description' | 'prompt' | 'workspaceId' | 'mode' | 'permission' | 'model' | 'reasoningEffort' | 'reuseSession'>> & {
|
|
21
21
|
freeze?: FreezeSnapshot & { redacted?: boolean } | null
|
|
22
22
|
/** Replaces the handover bundle (restamping bundledAt); an explicit null clears it. */
|
|
23
23
|
handover?: TaskHandoverInput | null
|
|
@@ -134,13 +134,6 @@ export function applyUpdateTask(
|
|
|
134
134
|
// Session reuse is a boolean opt-in; false (or an explicit null from a
|
|
135
135
|
// caller that needs to clear it) returns the task to one session per run.
|
|
136
136
|
if ('reuseSession' in patch) next.reuseSession = patch.reuseSession === true ? true : undefined
|
|
137
|
-
// The /goal opt-in is default-OFF: true joins the goal run, while false
|
|
138
|
-
// (or an explicit null) returns the card to the default and stores nothing.
|
|
139
|
-
if ('goalRun' in patch) next.goalRun = patch.goalRun === true ? true : undefined
|
|
140
|
-
// The acceptance opt-out is the mirror image: default OFF, so only true
|
|
141
|
-
// pins a card out of the gate; false (or an explicit null) returns it to
|
|
142
|
-
// inheriting the board-wide switch and stores nothing.
|
|
143
|
-
if ('skipVerification' in patch) next.skipVerification = patch.skipVerification === true ? true : undefined
|
|
144
137
|
if (workspaceId !== undefined || 'workspaceId' in patch) next.workspaceId = workspaceId
|
|
145
138
|
if (mode !== undefined || 'mode' in patch) next.mode = mode
|
|
146
139
|
if (permission !== undefined || 'permission' in patch) next.permission = permission
|
package/src/host/agent-tools.ts
CHANGED
|
@@ -172,10 +172,6 @@ function taskSummary(
|
|
|
172
172
|
...(task.reasoningEffort === undefined ? {} : { reasoningEffort: task.reasoningEffort }),
|
|
173
173
|
...(task.reuseSession === true ? { reuseSession: true } : {}),
|
|
174
174
|
...(task.teamRun === true ? { teamRun: true } : {}),
|
|
175
|
-
// Default-OFF opt-in: only a card that asked for the goal run reports it.
|
|
176
|
-
...(task.goalRun === true ? { goalRun: true } : {}),
|
|
177
|
-
// Default-OFF opt-out: the deviation is what a reader must be told.
|
|
178
|
-
...(task.skipVerification === true ? { skipVerification: true } : {}),
|
|
179
175
|
...(task.schedule === undefined ? {} : { schedule: scheduleView(task.schedule) }),
|
|
180
176
|
...(task.freeze === undefined ? {} : { continuationCard: true }),
|
|
181
177
|
...(task.permissionConfirmedAt === undefined ? {} : { permissionConfirmedAt: task.permissionConfirmedAt }),
|
|
@@ -362,7 +358,6 @@ function buildManageTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
362
358
|
'A manual move writes the card column only and never fabricates an execution record, so the card reports a declaration rather than evidence of a run: done/failed declare work finished (or failed) outside a Host-run execution — human work, an external system, a decision made elsewhere — and running says the work is under way without a tracked session. Use task_board_run when the work should actually run in a session here.',
|
|
363
359
|
'record-external-outcome is the record-backed version of move-done and move-failed: use it when YOU, or another agent outside this Host, actually finished or failed the card with your own model, so the terminal column and the run history both derive from one execution record. It takes result (succeeded or failed) and initiatedBy (who completed it, for example your own agent name) plus an optional summary, and it is refused while the card still has an open execution: the Host stays the only authority over a run it is executing. It cannot record running or cancelled — those remain Host-only. A parent card that dispatched its subtasks uses it once, at the end, to backfill every subtask card with the conclusion it reached; the Host records an inherited verdict on a subtask the parent never wrote back, so the write-back is what keeps each subtask conclusion its own.',
|
|
364
360
|
'settle force-closes the open execution of a card the board can no longer observe (a stuck running card) and records it cancelled with the caller as the reason, so the card returns to the todo column and can be run again.',
|
|
365
|
-
'reset-verification clears the acceptance anomalies (timeouts, authentication failures, an unresolvable judge route, or an attempt the time budget ended) recorded on a card open execution, so the next update_goal(action: complete) runs a fresh acceptance. It is refused unless that execution really carries such anomalies, it never clears a quality verdict, and a spent anomaly budget otherwise HOLDS the card open instead of failing it: tell the user the acceptance environment is unusable and that this action is how they clear it once they have fixed it.',
|
|
366
361
|
'archive takes the whole subtask tree off the board and is refused while any member has an unsettled execution; restore brings the task, its ancestors and its subtree back; delete removes one card and is refused while it still has subtasks (detach or delete them first) or while it runs.',
|
|
367
362
|
'It cannot confirm a permission binding: the confirmation gate is a human act performed in the board UI.',
|
|
368
363
|
].join(' '),
|
|
@@ -371,7 +366,7 @@ function buildManageTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
371
366
|
action: {
|
|
372
367
|
type: 'string',
|
|
373
368
|
required: true,
|
|
374
|
-
enum: ['move-todo', 'move-backlog', 'move-running', 'move-done', 'move-failed', 'archive', 'restore', 'delete', 'settle', '
|
|
369
|
+
enum: ['move-todo', 'move-backlog', 'move-running', 'move-done', 'move-failed', 'archive', 'restore', 'delete', 'settle', 'record-external-outcome'],
|
|
375
370
|
description: 'The lifecycle operation to perform.',
|
|
376
371
|
},
|
|
377
372
|
// Only record-external-outcome reads these two; every other action
|
|
@@ -432,7 +427,6 @@ function buildManageTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
432
427
|
'move-failed': { kind: 'move', taskId: args.taskId, status: 'failed' },
|
|
433
428
|
archive: { kind: 'archive', taskId: args.taskId },
|
|
434
429
|
settle: { kind: 'settle', taskId: args.taskId },
|
|
435
|
-
'reset-verification': { kind: 'reset-verification', taskId: args.taskId },
|
|
436
430
|
restore: { kind: 'restore', taskId: args.taskId },
|
|
437
431
|
delete: { kind: 'delete', taskId: args.taskId },
|
|
438
432
|
}
|
|
@@ -605,8 +599,6 @@ function buildCreateTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
605
599
|
model: { type: 'string', description: 'Pinned model as provider/model (or a model id); omit to adopt the board new-card default, and the host default when none is configured.' },
|
|
606
600
|
reasoningEffort: { type: 'string', description: 'Reasoning effort id for that model (an adapter-owned level such as "high"); omit to adopt the board new-card default for that model, and the model own default when none applies. Only an effort the target model declares is sent; an empty string clears it back to the default.' },
|
|
607
601
|
reuseSession: { type: 'boolean', description: 'Continue later runs in the previous execution session instead of a fresh conversation.' },
|
|
608
|
-
goalRun: { type: 'boolean', description: 'Start each run with dsh built-in /goal so the session keeps working continuation rounds until the goal completes. Off by default: omit (or pass false) for a single plain turn, and pass true to opt this card in. It only takes effect while the deployment global native /goal switch is on.' },
|
|
609
|
-
skipVerification: { type: 'boolean', description: 'Run this task without the board acceptance gate: update_goal may mark the goal complete without a passing acceptance, and the execution record is marked skipped. Default false (omit to inherit the board-wide acceptance switch). Only affects executions started afterwards.' },
|
|
610
602
|
tags: {
|
|
611
603
|
type: 'array',
|
|
612
604
|
description: 'Labels: the name renders as a badge and drives the board filter; promptPrefix is injected ahead of the execution prompt on every run.',
|
|
@@ -656,8 +648,6 @@ function buildCreateTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
656
648
|
// targets the caller omitted are filled.
|
|
657
649
|
applyCardDefaults: true,
|
|
658
650
|
...(args.reuseSession === true ? { reuseSession: true } : {}),
|
|
659
|
-
...(args.goalRun === true ? { goalRun: true } : {}),
|
|
660
|
-
...(args.skipVerification === true ? { skipVerification: true } : {}),
|
|
661
651
|
...(tags.length === 0 ? {} : { tags }),
|
|
662
652
|
...(args.schedule === undefined ? {} : {
|
|
663
653
|
schedule: {
|
|
@@ -715,8 +705,6 @@ function buildUpdateTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
715
705
|
model: { type: 'string', description: 'New pinned model; an empty string clears it.' },
|
|
716
706
|
reasoningEffort: { type: 'string', description: 'New reasoning effort id for the pinned model; an empty string clears it back to the model own default. Only an effort the target model declares is sent at run time.' },
|
|
717
707
|
reuseSession: { type: 'boolean', description: 'Continue later runs in the previous execution session.' },
|
|
718
|
-
goalRun: { type: 'boolean', description: 'Whether each run starts with dsh built-in /goal (default false, one plain turn). Pass true to opt this card in, or false to return it to the default.' },
|
|
719
|
-
skipVerification: { type: 'boolean', description: 'Whether this task runs without the board acceptance gate (default false, inherit the board-wide switch). Pass true to opt out; pass false to opt back in. Only affects executions started afterwards.' },
|
|
720
708
|
tags: {
|
|
721
709
|
type: 'array',
|
|
722
710
|
description: 'Replacement label set; an empty array clears all labels.',
|
|
@@ -748,8 +736,6 @@ function buildUpdateTool(host: TaskBoardToolHost): ToolDefinition {
|
|
|
748
736
|
patch.permission = args.permission === '' ? undefined : args.permission
|
|
749
737
|
}
|
|
750
738
|
if (has(args, 'reuseSession')) patch.reuseSession = args.reuseSession === true
|
|
751
|
-
if (has(args, 'goalRun')) patch.goalRun = args.goalRun === true ? true : false
|
|
752
|
-
if (has(args, 'skipVerification')) patch.skipVerification = args.skipVerification === true ? true : false
|
|
753
739
|
if (has(args, 'tags')) {
|
|
754
740
|
const tags = args.tags ?? []
|
|
755
741
|
patch.tags = tags.length === 0
|
|
@@ -143,7 +143,7 @@ function mergePayload(
|
|
|
143
143
|
current: TaskBoardExtensionPayload | undefined,
|
|
144
144
|
patch: TaskBoardExtensionPayload,
|
|
145
145
|
): TaskBoardExtensionPayload {
|
|
146
|
-
const next: TaskBoardExtensionPayload = { ...
|
|
146
|
+
const next: TaskBoardExtensionPayload = { ...current }
|
|
147
147
|
for (const [key, value] of Object.entries(patch)) {
|
|
148
148
|
if (value === undefined) delete next[key]
|
|
149
149
|
else next[key] = value
|
|
@@ -624,7 +624,7 @@ export class TaskBoardExtensionRegistry {
|
|
|
624
624
|
this.ledger.saveTaskRecord({
|
|
625
625
|
...task,
|
|
626
626
|
updatedAt: this.now(),
|
|
627
|
-
integrations: { ...
|
|
627
|
+
integrations: { ...task.integrations, [id]: next },
|
|
628
628
|
})
|
|
629
629
|
}
|
|
630
630
|
|
package/src/host/llm-dispatch.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One-shot model dispatch for the board's Host half.
|
|
3
3
|
*
|
|
4
|
-
* The board makes
|
|
5
|
-
* (`
|
|
6
|
-
* (`host-ai.ts`). Both call the official `llm` service, and both must call it
|
|
4
|
+
* The board makes one one-shot model call: the "parse pasted text" action
|
|
5
|
+
* (`host-ai.ts`). It calls the official `llm` service, and it must call it
|
|
7
6
|
* the way the official agent loop does.
|
|
8
7
|
*
|
|
9
8
|
* The runtime exposes two entry points with the same name shape. The public
|
|
@@ -20,9 +19,9 @@
|
|
|
20
19
|
* so the guard's `for await (const chunk of next())` raised
|
|
21
20
|
* `TypeError: next(...) is not a function or its return value is not async
|
|
22
21
|
* iterable`. The agent loop was unaffected because it already dispatches
|
|
23
|
-
* through `prepareCall(...).stream(...)`; the board's
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* through `prepareCall(...).stream(...)`; the board's one-shot call was not,
|
|
23
|
+
* and the parse action failed with that TypeError until it dispatched the same
|
|
24
|
+
* way.
|
|
26
25
|
*
|
|
27
26
|
* Dispatching through the prepared call fixes that at the owner: the board no
|
|
28
27
|
* longer depends on a mutable instance property that a plugin may legitimately
|
|
@@ -38,10 +37,9 @@ export type OneShotRequest = Pick<GenerateOptions, 'messages' | 'signal'> & Pick
|
|
|
38
37
|
/**
|
|
39
38
|
* The call config as this board's own domain types carry it.
|
|
40
39
|
*
|
|
41
|
-
* `
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* assertion.
|
|
40
|
+
* The parse route's `reasoningEffort` and the catalog's effort ids are plain
|
|
41
|
+
* strings, while the SDK brands them nominally; the single crossing is branded
|
|
42
|
+
* here so no caller repeats the assertion.
|
|
45
43
|
*/
|
|
46
44
|
export interface OneShotCallConfig {
|
|
47
45
|
provider: string
|
package/src/host-ledger.ts
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
cascadeTargets,
|
|
15
15
|
combineCascadeOutcome,
|
|
16
16
|
hasOutstandingDescendants,
|
|
17
|
-
isOutstanding,
|
|
18
17
|
normalizeSubtaskDepth,
|
|
19
18
|
openGroupExecution,
|
|
20
19
|
outstandingDescendants as lineageOutstandingDescendants,
|
|
@@ -31,7 +30,6 @@ import { applySetParent } from './core/use-cases/task-parent.ts'
|
|
|
31
30
|
import { applyDeleteTag, applyRenameTag } from './core/use-cases/task-tag.ts'
|
|
32
31
|
import { applyUpdateTask, canEditTaskContent, hasContentPatch } from './core/use-cases/task-update.ts'
|
|
33
32
|
import { TASK_BOARD_MIGRATABLE_SCHEMA_VERSIONS, TASK_BOARD_SCHEMA_VERSION, TASK_BOARD_ZONE_STAMP_SCHEMA_VERSION, type TaskBoardAction, type TaskBoardSchedulerSnapshot } from './protocol.ts'
|
|
34
|
-
import { withoutAcceptanceAnomalies, type ExecutionVerification } from './core/verification.ts'
|
|
35
33
|
import { DEFAULT_SESSION_PERMISSION, requiresPermissionConfirmation, type TaskPermission } from './core/handover.ts'
|
|
36
34
|
|
|
37
35
|
interface PersistedScheduler extends TaskBoardSchedulerSnapshot {
|
|
@@ -382,17 +380,7 @@ function mergeTask(a: TaskRecord, b: TaskRecord): TaskRecord {
|
|
|
382
380
|
const previous = byId.get(entry.id)
|
|
383
381
|
byId.set(entry.id, previous === undefined ? entry : betterExecution(previous, entry))
|
|
384
382
|
}
|
|
385
|
-
|
|
386
|
-
// browser half that also wrote this execution carries no attempts, and taking
|
|
387
|
-
// its copy would erase the Host's verdict. The copy with the most recorded
|
|
388
|
-
// attempts wins, and one execution's verdict is never copied onto another.
|
|
389
|
-
const executions = [...byId.values()].sort((x, y) => x.startedAt - y.startedAt).map(entry => {
|
|
390
|
-
if (entry.verification !== undefined) return entry
|
|
391
|
-
const richer = [...a.executions, ...b.executions]
|
|
392
|
-
.filter(other => other.id === entry.id && other.verification !== undefined)
|
|
393
|
-
.sort((x, y) => (y.verification?.attempts.length ?? 0) - (x.verification?.attempts.length ?? 0))[0]
|
|
394
|
-
return richer?.verification === undefined ? entry : { ...entry, verification: richer.verification }
|
|
395
|
-
})
|
|
383
|
+
const executions = [...byId.values()].sort((x, y) => x.startedAt - y.startedAt)
|
|
396
384
|
return { ...newer, executions: retainRecentExecutions(executions) }
|
|
397
385
|
}
|
|
398
386
|
|
|
@@ -1227,32 +1215,6 @@ export class HostTaskLedger {
|
|
|
1227
1215
|
this.finalizeReadyRuns(false)
|
|
1228
1216
|
break
|
|
1229
1217
|
}
|
|
1230
|
-
case 'reset-verification': {
|
|
1231
|
-
// The explicit user reset of the acceptance anomaly counter (issue
|
|
1232
|
-
// #1828). It clears the attempts the ENVIRONMENT produced — timeouts,
|
|
1233
|
-
// authentication failures, unresolvable routes, and attempts the time
|
|
1234
|
-
// budget ended — and nothing else: a quality verdict is the board's own
|
|
1235
|
-
// judgement of the work and survives every reset. Only the open
|
|
1236
|
-
// execution is addressable, because the reset exists to unblock a
|
|
1237
|
-
// completion claim on a run that is still going.
|
|
1238
|
-
const task = this.document.tasks.find(item => item.id === action.taskId)
|
|
1239
|
-
if (task === undefined) throw new Error('task not found')
|
|
1240
|
-
if (task.archivedAt !== undefined) throw new Error('archived task is read-only')
|
|
1241
|
-
const execution = [...task.executions].reverse().find(entry => entry.endedAt === undefined)
|
|
1242
|
-
if (execution === undefined) throw new Error('task has no open execution')
|
|
1243
|
-
const verification = execution.verification
|
|
1244
|
-
if (verification === undefined || verification.applicability !== 'enforced') {
|
|
1245
|
-
throw new Error('this execution is not gated by task acceptance')
|
|
1246
|
-
}
|
|
1247
|
-
const cleared = withoutAcceptanceAnomalies(verification)
|
|
1248
|
-
if (cleared === undefined) throw new Error('this execution has no acceptance anomaly to reset')
|
|
1249
|
-
this.document.tasks = this.document.tasks.map(item => item.id !== action.taskId ? item : {
|
|
1250
|
-
...item,
|
|
1251
|
-
updatedAt: now,
|
|
1252
|
-
executions: item.executions.map(entry => entry.id === execution.id ? { ...entry, verification: cleared } : entry),
|
|
1253
|
-
})
|
|
1254
|
-
break
|
|
1255
|
-
}
|
|
1256
1218
|
case 'restore': {
|
|
1257
1219
|
if (this.subtreeHasOpenExecution(action.taskId)) throw new Error('running task cannot be restored')
|
|
1258
1220
|
const result = applyRestoreTask(this.document.tasks, action.taskId, now, this.maxSubtaskDepth)
|
|
@@ -1668,54 +1630,6 @@ export class HostTaskLedger {
|
|
|
1668
1630
|
return this.normalizeDocument({ ...parsed, tasks: rows as TaskRecord[] })
|
|
1669
1631
|
}
|
|
1670
1632
|
|
|
1671
|
-
/**
|
|
1672
|
-
* Find the still-open execution that ran in one session, with its task.
|
|
1673
|
-
*
|
|
1674
|
-
* The completion gate keys on the session id its tool call arrives from: the
|
|
1675
|
-
* execution record is the only object binding a session to a card, and an
|
|
1676
|
-
* already-settled execution is deliberately not returned (a session the board
|
|
1677
|
-
* no longer owns must not be gated).
|
|
1678
|
-
* @param sessionId - the DSH session the tool call runs in.
|
|
1679
|
-
* @returns the open execution and its task, or undefined.
|
|
1680
|
-
*/
|
|
1681
|
-
findOpenExecutionBySession(sessionId: string): { task: TaskRecord; execution: ExecutionRecord } | undefined {
|
|
1682
|
-
if (sessionId === '') return undefined
|
|
1683
|
-
for (const task of this.document.tasks) {
|
|
1684
|
-
for (const execution of task.executions) {
|
|
1685
|
-
if (execution.endedAt !== undefined) continue
|
|
1686
|
-
if (execution.sessionId === sessionId) return { task, execution }
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
return undefined
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
/**
|
|
1693
|
-
* Replace one execution's acceptance block (creating it when absent).
|
|
1694
|
-
*
|
|
1695
|
-
* A no-op when the serialized value is unchanged, so a coarse caller that
|
|
1696
|
-
* re-writes the same state never bumps the ledger revision. A settled
|
|
1697
|
-
* execution keeps its record: the report of a finished cycle must survive,
|
|
1698
|
-
* and only the board's own settlement moves the card.
|
|
1699
|
-
* @param taskId - the task owning the execution.
|
|
1700
|
-
* @param executionId - the execution to update.
|
|
1701
|
-
* @param verification - the new block.
|
|
1702
|
-
* @returns true when the ledger changed.
|
|
1703
|
-
*/
|
|
1704
|
-
setVerification(taskId: string, executionId: string, verification: ExecutionVerification): boolean {
|
|
1705
|
-
const now = this.now()
|
|
1706
|
-
const task = this.document.tasks.find(item => item.id === taskId)
|
|
1707
|
-
const execution = task?.executions.find(entry => entry.id === executionId)
|
|
1708
|
-
if (task === undefined || execution === undefined) return false
|
|
1709
|
-
if (JSON.stringify(execution.verification ?? null) === JSON.stringify(verification)) return false
|
|
1710
|
-
this.document.tasks = this.document.tasks.map(item => item.id !== taskId ? item : {
|
|
1711
|
-
...item,
|
|
1712
|
-
updatedAt: now,
|
|
1713
|
-
executions: item.executions.map(entry => entry.id === executionId ? { ...entry, verification } : entry),
|
|
1714
|
-
})
|
|
1715
|
-
this.commit()
|
|
1716
|
-
return true
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
1633
|
private load(dir: string): LedgerDocument {
|
|
1720
1634
|
const existed = existsSync(this.file)
|
|
1721
1635
|
// schemaVersion stays unknown-typed here: on-disk documents may be v2 or
|
|
@@ -1733,7 +1647,7 @@ export class HostTaskLedger {
|
|
|
1733
1647
|
} catch (error) {
|
|
1734
1648
|
// Migration failure is explicit: the original file stays in place
|
|
1735
1649
|
// for manual recovery and the ledger refuses to start (fail closed).
|
|
1736
|
-
throw new Error(`ledger v${String(parsed.schemaVersion)} to v${TASK_BOARD_SCHEMA_VERSION} migration failed; original file kept at ${this.file}: ${error instanceof Error ? error.message : String(error)}
|
|
1650
|
+
throw new Error(`ledger v${String(parsed.schemaVersion)} to v${TASK_BOARD_SCHEMA_VERSION} migration failed; original file kept at ${this.file}: ${error instanceof Error ? error.message : String(error)}`, { cause: error })
|
|
1737
1651
|
}
|
|
1738
1652
|
}
|
|
1739
1653
|
try {
|
|
@@ -1944,7 +1858,7 @@ export class HostTaskLedger {
|
|
|
1944
1858
|
const hint = confirmedOwner
|
|
1945
1859
|
? ''
|
|
1946
1860
|
: `; if this PID was reused after a crash and no other DSH host is running, remove ${this.lockFile} manually and retry`
|
|
1947
|
-
throw new Error(`task-board ledger is already owned by process ${pid}${hint}
|
|
1861
|
+
throw new Error(`task-board ledger is already owned by process ${pid}${hint}`, { cause: error })
|
|
1948
1862
|
}
|
|
1949
1863
|
}
|
|
1950
1864
|
try { unlinkSync(this.lockFile) } catch (unlinkError) {
|
package/src/host-routes.ts
CHANGED
|
@@ -428,14 +428,14 @@ export function makeTaskBoardRoutes(
|
|
|
428
428
|
}
|
|
429
429
|
},
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const modelCatalog: WebRoute = {
|
|
432
432
|
kind: 'exact',
|
|
433
|
-
path: `${TASK_BOARD_API_PREFIX}/
|
|
433
|
+
path: `${TASK_BOARD_API_PREFIX}/model-catalog`,
|
|
434
434
|
handler: async (req, res): Promise<void> => {
|
|
435
435
|
if (req.method !== 'GET') return writeJson(res, 405, { ok: false, error: 'method-not-allowed' }, { 'cache-control': 'no-store' })
|
|
436
436
|
if (!guard(req, res)) return
|
|
437
437
|
try {
|
|
438
|
-
writeJson(res, 200, await service.
|
|
438
|
+
writeJson(res, 200, await service.modelCatalogOptions(), { 'cache-control': 'no-store' })
|
|
439
439
|
} catch (error) {
|
|
440
440
|
writeJson(res, 500, { ok: false, error: error instanceof Error ? error.message : String(error) }, { 'cache-control': 'no-store' })
|
|
441
441
|
}
|
|
@@ -520,5 +520,5 @@ export function makeTaskBoardRoutes(
|
|
|
520
520
|
}
|
|
521
521
|
},
|
|
522
522
|
}
|
|
523
|
-
return [state, action, events, parse,
|
|
523
|
+
return [state, action, events, parse, modelCatalog, attachmentUpload, attachmentImage]
|
|
524
524
|
}
|