@linxin666/dsh-client-ui-task-board 0.4.17 → 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/lib/client.js +7 -7
- package/lib/client.js.map +1 -1
- package/lib/index.js +9 -9
- package/lib/types/client/settings-entry-form.d.ts +1 -1
- package/package.json +1 -1
- package/src/client/TaskBoardSettingsCard.tsx +0 -1
- package/src/client/board/TaskBoard.tsx +2 -2
- package/src/client/index.ts +1 -1
- package/src/client/settings-entry-form.ts +1 -1
- package/src/core/attachment.ts +1 -0
- package/src/core/freeze-snapshot.ts +3 -3
- package/src/host/extension-registry.ts +2 -2
- package/src/host-ledger.ts +2 -3
- package/src/host-runner.ts +1 -1
- package/src/protocol.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -1639,7 +1639,7 @@ const SECTION_NAMES = {
|
|
|
1639
1639
|
*/
|
|
1640
1640
|
const SENSITIVE_PATTERNS = [
|
|
1641
1641
|
/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
1642
|
-
/Bearer\s+[A-Za-z0-9._
|
|
1642
|
+
/Bearer\s+[A-Za-z0-9._~+/=:-]{8,}/gi,
|
|
1643
1643
|
/sk-[A-Za-z0-9_-]{8,}/g,
|
|
1644
1644
|
/ghp_[A-Za-z0-9]{20,}/g,
|
|
1645
1645
|
/glpat-[A-Za-z0-9_-]{15,}/g,
|
|
@@ -1693,13 +1693,13 @@ function sanitizeFreezeSnapshot(value, extraKeys = []) {
|
|
|
1693
1693
|
});
|
|
1694
1694
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return bad("invalid-freeze", "冻结快照必须是 goal/progress/next 字符串对象");
|
|
1695
1695
|
const record = value;
|
|
1696
|
-
const allowed = [
|
|
1696
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
1697
1697
|
"goal",
|
|
1698
1698
|
"progress",
|
|
1699
1699
|
"next",
|
|
1700
1700
|
...extraKeys
|
|
1701
|
-
];
|
|
1702
|
-
if (!Object.keys(record).every((key) => allowed.
|
|
1701
|
+
]);
|
|
1702
|
+
if (!Object.keys(record).every((key) => allowed.has(key))) return bad("invalid-freeze", "冻结快照包含未知字段");
|
|
1703
1703
|
for (const key of SECTION_ORDER$1) if (typeof record[key] !== "string") return bad("invalid-freeze", "冻结快照字段 " + SECTION_NAMES[key] + " 必须是字符串");
|
|
1704
1704
|
for (const key of SECTION_ORDER$1) if (hasSlashCommandLines(record[key])) return bad("dsh-command-line", "冻结文本的" + SECTION_NAMES[key] + "包含以 / 开头的命令行,整体拒绝");
|
|
1705
1705
|
let redacted = false;
|
|
@@ -4670,7 +4670,7 @@ var HostTaskLedger = class {
|
|
|
4670
4670
|
if (typeof parsed.schemaVersion === "number" && TASK_BOARD_MIGRATABLE_SCHEMA_VERSIONS.includes(parsed.schemaVersion)) try {
|
|
4671
4671
|
return this.migrateLegacyDocument(parsed);
|
|
4672
4672
|
} catch (error) {
|
|
4673
|
-
throw new Error(`ledger v${String(parsed.schemaVersion)} to v7 migration failed; original file kept at ${this.file}: ${error instanceof Error ? error.message : String(error)}
|
|
4673
|
+
throw new Error(`ledger v${String(parsed.schemaVersion)} to v7 migration failed; original file kept at ${this.file}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
4674
4674
|
}
|
|
4675
4675
|
try {
|
|
4676
4676
|
if (parsed.schemaVersion !== 7 || !Array.isArray(parsed.tasks)) throw new Error("unsupported ledger schema");
|
|
@@ -4866,7 +4866,7 @@ var HostTaskLedger = class {
|
|
|
4866
4866
|
}
|
|
4867
4867
|
})()))) {
|
|
4868
4868
|
const hint = ownerStartedAt !== void 0 && actualStartedAt !== void 0 && !startTimeMismatch(ownerStartedAt, actualStartedAt, ownerExact) ? "" : `; if this PID was reused after a crash and no other DSH host is running, remove ${this.lockFile} manually and retry`;
|
|
4869
|
-
throw new Error(`task-board ledger is already owned by process ${pid}${hint}
|
|
4869
|
+
throw new Error(`task-board ledger is already owned by process ${pid}${hint}`, { cause: error });
|
|
4870
4870
|
}
|
|
4871
4871
|
}
|
|
4872
4872
|
try {
|
|
@@ -5864,7 +5864,7 @@ var HostExecutionRunner = class HostExecutionRunner {
|
|
|
5864
5864
|
...decision.effort === void 0 ? {} : { reasoningEffort: decision.effort }
|
|
5865
5865
|
});
|
|
5866
5866
|
} catch (modelError) {
|
|
5867
|
-
if (decision.effort !== void 0) throw new Error(`session ${sessionId} refused the model selection "${provider === void 0 ? modelId : provider + "/" + modelId}" with reasoning effort "${decision.effort}": ` + (modelError instanceof Error ? modelError.message : String(modelError)));
|
|
5867
|
+
if (decision.effort !== void 0) throw new Error(`session ${sessionId} refused the model selection "${provider === void 0 ? modelId : provider + "/" + modelId}" with reasoning effort "${decision.effort}": ` + (modelError instanceof Error ? modelError.message : String(modelError)), { cause: modelError });
|
|
5868
5868
|
console.warn(`[dsh-task-board] failed to select model "${provider === void 0 ? modelId : provider + "/" + modelId}" for session ${sessionId}, falling back to default:`, modelError);
|
|
5869
5869
|
}
|
|
5870
5870
|
}
|
|
@@ -6500,7 +6500,7 @@ function emptySubscriptions() {
|
|
|
6500
6500
|
* undefined so a provider can remove a field without replacing the entry.
|
|
6501
6501
|
*/
|
|
6502
6502
|
function mergePayload(current, patch) {
|
|
6503
|
-
const next = { ...current
|
|
6503
|
+
const next = { ...current };
|
|
6504
6504
|
for (const [key, value] of Object.entries(patch)) if (value === void 0) delete next[key];
|
|
6505
6505
|
else next[key] = value;
|
|
6506
6506
|
return next;
|
|
@@ -6926,7 +6926,7 @@ var TaskBoardExtensionRegistry = class {
|
|
|
6926
6926
|
...task,
|
|
6927
6927
|
updatedAt: this.now(),
|
|
6928
6928
|
integrations: {
|
|
6929
|
-
...task.integrations
|
|
6929
|
+
...task.integrations,
|
|
6930
6930
|
[id]: next
|
|
6931
6931
|
}
|
|
6932
6932
|
});
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { ConfigForm, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
30
30
|
/** Options of {@link createServedEntryForm}. */
|
|
31
|
-
export interface ServedEntryFormOptions<
|
|
31
|
+
export interface ServedEntryFormOptions<_T> {
|
|
32
32
|
/** The shared configuration forms service (`ctx.configForms`). */
|
|
33
33
|
forms: ConfigForms;
|
|
34
34
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-task-board",
|
|
3
3
|
"description": "Host-authoritative task board for the DSH Web GUI with real session execution, Host cron scheduling, and optional cross-platform idle-sleep protection; mounted without DSH source changes.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.18",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -17,7 +17,6 @@ import { CardDefaultPresetField } from './CardDefaultPresetField.tsx'
|
|
|
17
17
|
import { PluginSettingsCard, BooleanField, ChoiceField, ValueField } from './PluginSettingsCard.tsx'
|
|
18
18
|
import {
|
|
19
19
|
modelChoiceRows,
|
|
20
|
-
modelDisplayLabel,
|
|
21
20
|
modelOptionsFromCatalog,
|
|
22
21
|
reasoningEffortsFor,
|
|
23
22
|
reasoningHintKey,
|
|
@@ -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)
|
package/src/client/index.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* plugin must not take the GUI down.
|
|
10
10
|
*/
|
|
11
11
|
import type { Context as ClientContext } from '@deepseek-ai/cordis'
|
|
12
|
-
import type { ClientRemote
|
|
12
|
+
import type { ClientRemote } from '@deepseek-ai/dsh-api-remotes/client'
|
|
13
13
|
import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'
|
|
14
14
|
import type { IWorkspaces } from '@deepseek-ai/dsh-api-workspace-controller/client'
|
|
15
15
|
import type { ConfigForm, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client'
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import type { ConfigForm, ConfigFormSnapshot, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client'
|
|
32
32
|
|
|
33
33
|
/** Options of {@link createServedEntryForm}. */
|
|
34
|
-
export interface ServedEntryFormOptions<
|
|
34
|
+
export interface ServedEntryFormOptions<_T> {
|
|
35
35
|
/** The shared configuration forms service (`ctx.configForms`). */
|
|
36
36
|
forms: ConfigForms
|
|
37
37
|
/**
|
package/src/core/attachment.ts
CHANGED
|
@@ -97,6 +97,7 @@ export function canonicalAttachmentName(value: unknown): string {
|
|
|
97
97
|
const raw = typeof value === 'string' ? value : ''
|
|
98
98
|
const leaf = raw.split(/[\\/]/).pop() ?? ''
|
|
99
99
|
const cleaned = leaf
|
|
100
|
+
// oxlint-disable-next-line no-control-regex -- folding control characters into spaces IS the normalization.
|
|
100
101
|
.replace(/[\u0000-\u001f\u007f]/g, ' ')
|
|
101
102
|
.replace(/\s+/g, ' ')
|
|
102
103
|
.trim()
|
|
@@ -53,7 +53,7 @@ const SECTION_NAMES: Record<SectionKey, string> = {
|
|
|
53
53
|
*/
|
|
54
54
|
const SENSITIVE_PATTERNS: RegExp[] = [
|
|
55
55
|
/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
56
|
-
/Bearer\s+[A-Za-z0-9._
|
|
56
|
+
/Bearer\s+[A-Za-z0-9._~+/=:-]{8,}/gi,
|
|
57
57
|
/sk-[A-Za-z0-9_-]{8,}/g,
|
|
58
58
|
/ghp_[A-Za-z0-9]{20,}/g,
|
|
59
59
|
/glpat-[A-Za-z0-9_-]{15,}/g,
|
|
@@ -111,8 +111,8 @@ export function sanitizeFreezeSnapshot(
|
|
|
111
111
|
return bad('invalid-freeze', '冻结快照必须是 goal/progress/next 字符串对象')
|
|
112
112
|
}
|
|
113
113
|
const record = value as Record<string, unknown>
|
|
114
|
-
const allowed = ['goal', 'progress', 'next', ...extraKeys]
|
|
115
|
-
if (!Object.keys(record).every(key => allowed.
|
|
114
|
+
const allowed = new Set(['goal', 'progress', 'next', ...extraKeys])
|
|
115
|
+
if (!Object.keys(record).every(key => allowed.has(key))) {
|
|
116
116
|
return bad('invalid-freeze', '冻结快照包含未知字段')
|
|
117
117
|
}
|
|
118
118
|
for (const key of SECTION_ORDER) {
|
|
@@ -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-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,
|
|
@@ -1648,7 +1647,7 @@ export class HostTaskLedger {
|
|
|
1648
1647
|
} catch (error) {
|
|
1649
1648
|
// Migration failure is explicit: the original file stays in place
|
|
1650
1649
|
// for manual recovery and the ledger refuses to start (fail closed).
|
|
1651
|
-
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 })
|
|
1652
1651
|
}
|
|
1653
1652
|
}
|
|
1654
1653
|
try {
|
|
@@ -1859,7 +1858,7 @@ export class HostTaskLedger {
|
|
|
1859
1858
|
const hint = confirmedOwner
|
|
1860
1859
|
? ''
|
|
1861
1860
|
: `; if this PID was reused after a crash and no other DSH host is running, remove ${this.lockFile} manually and retry`
|
|
1862
|
-
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 })
|
|
1863
1862
|
}
|
|
1864
1863
|
}
|
|
1865
1864
|
try { unlinkSync(this.lockFile) } catch (unlinkError) {
|
package/src/host-runner.ts
CHANGED
|
@@ -753,7 +753,7 @@ export class HostExecutionRunner {
|
|
|
753
753
|
// keeps the best-effort behavior: the card was asked to run, and losing
|
|
754
754
|
// the work over a model switch this run never promised is worse.
|
|
755
755
|
if (decision.effort !== undefined) {
|
|
756
|
-
throw new Error(`session ${sessionId} refused the model selection "${provider === undefined ? modelId : provider + '/' + modelId}" with reasoning effort "${decision.effort}": ` + (modelError instanceof Error ? modelError.message : String(modelError)))
|
|
756
|
+
throw new Error(`session ${sessionId} refused the model selection "${provider === undefined ? modelId : provider + '/' + modelId}" with reasoning effort "${decision.effort}": ` + (modelError instanceof Error ? modelError.message : String(modelError)), { cause: modelError })
|
|
757
757
|
}
|
|
758
758
|
console.warn(`[dsh-task-board] failed to select model "${provider === undefined ? modelId : provider + '/' + modelId}" for session ${sessionId}, falling back to default:`, modelError)
|
|
759
759
|
}
|
package/src/protocol.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { sanitizeFreezeSnapshot, type FreezeSnapshot } from './core/freeze-snaps
|
|
|
7
7
|
import { sanitizeHandover, type TaskHandoverInput } from './core/handover.ts'
|
|
8
8
|
import { TASK_BOARD_MESSAGE_MAX_LENGTH, isTaskBoardExtensionPayload, normalizeTaskIntegrations, type TaskBoardExtensionPayload } from './core/extension.ts'
|
|
9
9
|
import type { ModelCatalogView } from './core/model-catalog.ts'
|
|
10
|
-
import { isTaskAttachmentList
|
|
10
|
+
import { isTaskAttachmentList } from './core/attachment.ts'
|
|
11
11
|
|
|
12
12
|
/** Freeze payload carried by create/update actions after the gate (redacted in place). */
|
|
13
13
|
type FreezePayload = FreezeSnapshot & { redacted?: boolean; frozenBy?: string }
|