@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.en.md +6 -4
- package/README.md +6 -4
- package/README.zh.md +6 -4
- package/icon.png +0 -0
- package/lib/client.js +4428 -1508
- package/lib/client.js.map +1 -1
- package/lib/index.js +2670 -496
- package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
- package/lib/types/client/PluginSettingsCard.d.ts +130 -19
- package/lib/types/client/RangeBubble.d.ts +46 -0
- package/lib/types/client/SegmentGroup.d.ts +28 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
- package/lib/types/client/board/AttachmentField.d.ts +70 -0
- package/lib/types/client/board/ExecutionLog.d.ts +24 -0
- package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
- package/lib/types/client/board/TaskForm.d.ts +4 -0
- package/lib/types/client/board/VerificationReport.d.ts +2 -15
- package/lib/types/client/board/model-options.d.ts +87 -0
- package/lib/types/client/board/preset-label.d.ts +21 -0
- package/lib/types/client/board/preset-roster.d.ts +45 -0
- package/lib/types/client/board/source-group.d.ts +27 -0
- package/lib/types/client/body-mutations.d.ts +45 -0
- package/lib/types/client/host-api.d.ts +25 -0
- package/lib/types/client/locales.d.ts +87 -9
- package/lib/types/client/pending-verify.d.ts +47 -0
- package/lib/types/client/plugin-card-seat.d.ts +3 -1
- package/lib/types/client/service.d.ts +4 -1
- package/lib/types/client/settings-form.d.ts +73 -51
- package/lib/types/core/attachment.d.ts +132 -0
- package/lib/types/core/card-defaults.d.ts +78 -0
- package/lib/types/core/controller.d.ts +57 -8
- package/lib/types/core/execution-summary.d.ts +52 -0
- package/lib/types/core/extension.d.ts +116 -0
- package/lib/types/core/launch-width.d.ts +31 -0
- package/lib/types/core/reasoning-effort.d.ts +57 -0
- package/lib/types/core/session-reuse.d.ts +7 -1
- package/lib/types/core/spend-budget.d.ts +28 -0
- package/lib/types/core/subtask.d.ts +100 -37
- package/lib/types/core/tasks.d.ts +94 -10
- package/lib/types/core/use-cases/task-create.d.ts +10 -5
- package/lib/types/core/use-cases/task-tag.d.ts +36 -0
- package/lib/types/core/use-cases/task-update.d.ts +22 -1
- package/lib/types/core/wire-projection.d.ts +35 -0
- package/lib/types/core/workspace-target.d.ts +23 -3
- package/lib/types/host/attachments.d.ts +250 -0
- package/lib/types/host/extension-registry.d.ts +40 -0
- package/lib/types/host/launch-admission.d.ts +71 -0
- package/lib/types/host-ledger.d.ts +114 -47
- package/lib/types/host-routes.d.ts +63 -0
- package/lib/types/host-runner.d.ts +164 -18
- package/lib/types/host-service.d.ts +182 -46
- package/lib/types/host-spend.d.ts +52 -0
- package/lib/types/index.d.ts +173 -54
- package/lib/types/loopback.d.ts +41 -1
- package/lib/types/protocol.d.ts +52 -11
- package/lib/types/tool-surface.d.ts +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +36 -29
- package/src/client/CardDefaultPresetField.tsx +101 -0
- package/src/client/PluginSettingsCard.tsx +385 -111
- package/src/client/RangeBubble.tsx +164 -0
- package/src/client/SegmentGroup.tsx +93 -0
- package/src/client/TaskBoardSettingsCard.tsx +332 -37
- package/src/client/board/AttachmentField.tsx +383 -0
- package/src/client/board/EditTaskModal.tsx +63 -0
- package/src/client/board/ExecutionLog.tsx +154 -0
- package/src/client/board/LinkSubtaskModal.tsx +1 -1
- package/src/client/board/NewTaskModal.tsx +154 -45
- package/src/client/board/ReasoningEffortField.tsx +50 -0
- package/src/client/board/TagManagerModal.tsx +151 -2
- package/src/client/board/TaskBoard.tsx +47 -10
- package/src/client/board/TaskCard.tsx +45 -23
- package/src/client/board/TaskDetail.tsx +468 -258
- package/src/client/board/TaskForm.tsx +19 -4
- package/src/client/board/VerificationReport.tsx +143 -104
- package/src/client/board/model-options.ts +208 -0
- package/src/client/board/preset-label.ts +32 -0
- package/src/client/board/preset-roster.ts +58 -0
- package/src/client/board/source-group.ts +94 -0
- package/src/client/board/task-markdown.module.css +11 -8
- package/src/client/board-settings.module.css +35 -7
- package/src/client/board.module.css +1044 -105
- package/src/client/body-mutations.ts +133 -0
- package/src/client/host-api.ts +70 -0
- package/src/client/index.ts +109 -95
- package/src/client/locales.ts +205 -48
- package/src/client/pending-verify.ts +90 -0
- package/src/client/plugin-card-seat.ts +8 -2
- package/src/client/service.ts +24 -0
- package/src/client/settings-card.module.css +466 -89
- package/src/client/settings-entry-form.ts +0 -1
- package/src/client/settings-form.ts +102 -60
- package/src/core/attachment.ts +287 -0
- package/src/core/card-defaults.ts +132 -0
- package/src/core/controller.ts +90 -11
- package/src/core/execution-summary.ts +96 -0
- package/src/core/extension.ts +120 -0
- package/src/core/launch-width.ts +38 -0
- package/src/core/reasoning-effort.ts +92 -0
- package/src/core/session-reuse.ts +7 -1
- package/src/core/spend-budget.ts +35 -0
- package/src/core/store.ts +19 -1
- package/src/core/subtask.ts +144 -68
- package/src/core/tasks.ts +117 -10
- package/src/core/use-cases/task-create.ts +27 -16
- package/src/core/use-cases/task-tag.ts +56 -0
- package/src/core/use-cases/task-update.ts +33 -5
- package/src/core/wire-projection.ts +81 -0
- package/src/core/workspace-target.ts +27 -3
- package/src/host/agent-tools.ts +33 -21
- package/src/host/attachments.ts +650 -0
- package/src/host/extension-registry.ts +150 -5
- package/src/host/launch-admission.ts +139 -0
- package/src/host-ledger.ts +248 -117
- package/src/host-routes.ts +233 -15
- package/src/host-runner.ts +395 -61
- package/src/host-service.ts +512 -139
- package/src/host-spend.ts +105 -0
- package/src/index.ts +312 -92
- package/src/loopback.ts +57 -1
- package/src/protocol.ts +83 -18
- package/src/tool-surface.ts +1 -0
- package/icon.svg +0 -3
package/src/loopback.ts
CHANGED
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
* Semantics: RFC 5735 IPv4 127/8, ::1, IPv4-mapped ::ffff:127/8 (matching the
|
|
9
9
|
* remote-web-ui gate), localhost hostnames, plus the browser same-origin
|
|
10
10
|
* markers (sec-fetch-site and Origin) for the request-level fence.
|
|
11
|
+
*
|
|
12
|
+
* A reverse proxy in front of the host rewrites the Host header to its own
|
|
13
|
+
* upstream literal (a Cloudflare tunnel, frp and an nginx reverse proxy all
|
|
14
|
+
* dial 127.0.0.1:<port>), and the socket the origin sees is the proxy's, which
|
|
15
|
+
* is loopback by construction. Both halves of the fence then hold for a public
|
|
16
|
+
* request. Forwarding headers are the signal that a hop stands in between: a
|
|
17
|
+
* request that carries CF-Connecting-IP or X-Forwarded-For is answered through
|
|
18
|
+
* a proxy and is never treated as a local one (issue #1906).
|
|
19
|
+
*
|
|
20
|
+
* An operator who runs that proxy or tunnel themselves can opt into the
|
|
21
|
+
* narrower case: isForwardedLoopbackRequest describes a forwarded request that
|
|
22
|
+
* still landed on this machine's loopback upstream, and a route family admits
|
|
23
|
+
* it only behind its own default-off switch (issue #1918).
|
|
11
24
|
* @module dsh-web-shared/host/loopback
|
|
12
25
|
*/
|
|
13
26
|
|
|
@@ -36,13 +49,29 @@ export function isLoopbackHostname(hostname: string): boolean {
|
|
|
36
49
|
return isIPv4Loopback(hostname)
|
|
37
50
|
}
|
|
38
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Whether a reverse proxy stood between the client and this host: the request
|
|
54
|
+
* carries CF-Connecting-IP or X-Forwarded-For. Either header is stamped by a
|
|
55
|
+
* hop that forwards traffic, so the request did not originate on this machine.
|
|
56
|
+
* @param request - node HTTP request.
|
|
57
|
+
* @returns true when a forwarding header is present.
|
|
58
|
+
*/
|
|
59
|
+
export function isProxiedRequest(request: IncomingMessage): boolean {
|
|
60
|
+
return request.headers['cf-connecting-ip'] !== undefined
|
|
61
|
+
|| request.headers['x-forwarded-for'] !== undefined
|
|
62
|
+
}
|
|
63
|
+
|
|
39
64
|
/**
|
|
40
65
|
* Request-level trust fence: a loopback socket address AND a loopback Host
|
|
41
66
|
* header, plus browser same-origin markers. The socket address is
|
|
42
|
-
* authoritative;
|
|
67
|
+
* authoritative for a direct connection; a request that carries a forwarding
|
|
68
|
+
* header is refused outright, because a proxy in front of the host makes both
|
|
69
|
+
* the socket address and the Host header describe the proxy rather than the
|
|
70
|
+
* client. X-Forwarded-For is therefore never evidence *for* loopback.
|
|
43
71
|
*/
|
|
44
72
|
export function isLoopbackRequest(request: IncomingMessage): boolean {
|
|
45
73
|
if (!isLoopbackAddress(request.socket.remoteAddress)) return false
|
|
74
|
+
if (isProxiedRequest(request)) return false
|
|
46
75
|
const host = request.headers.host
|
|
47
76
|
if (typeof host !== 'string') return false
|
|
48
77
|
let hostUrl: URL
|
|
@@ -61,3 +90,30 @@ export function isLoopbackRequest(request: IncomingMessage): boolean {
|
|
|
61
90
|
return false
|
|
62
91
|
}
|
|
63
92
|
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Whether a forwarded request landed on this machine's loopback upstream: a
|
|
96
|
+
* forwarding header (the proxy's own stamp), a loopback socket address (the
|
|
97
|
+
* proxy dials 127.0.0.1:<port>), and a loopback Host header (the proxy rewrote
|
|
98
|
+
* the authority to its upstream literal).
|
|
99
|
+
*
|
|
100
|
+
* This is a fact about the route, not a trust decision. A public request to a
|
|
101
|
+
* tunnel satisfies all three by construction, because the proxy is the client
|
|
102
|
+
* of this process: only a caller that operates the proxy can decide it stands
|
|
103
|
+
* for the browser, which is why every consumer keeps this behind an explicit
|
|
104
|
+
* default-off switch and its own browser markers. isLoopbackRequest is
|
|
105
|
+
* unchanged and still refuses a forwarded request (issue #1906).
|
|
106
|
+
* @param request - node HTTP request.
|
|
107
|
+
* @returns true when a forwarding header, a loopback socket, and a loopback Host all hold.
|
|
108
|
+
*/
|
|
109
|
+
export function isForwardedLoopbackRequest(request: IncomingMessage): boolean {
|
|
110
|
+
if (!isProxiedRequest(request)) return false
|
|
111
|
+
if (!isLoopbackAddress(request.socket.remoteAddress)) return false
|
|
112
|
+
const host = request.headers.host
|
|
113
|
+
if (typeof host !== 'string') return false
|
|
114
|
+
try {
|
|
115
|
+
return isLoopbackHostname(new URL('http://' + host).hostname)
|
|
116
|
+
} catch {
|
|
117
|
+
return false
|
|
118
|
+
}
|
|
119
|
+
}
|
package/src/protocol.ts
CHANGED
|
@@ -5,15 +5,18 @@ import { parseLedger } from './core/store.ts'
|
|
|
5
5
|
import { isValidTimeZone } from './core/schedule.ts'
|
|
6
6
|
import { sanitizeFreezeSnapshot, type FreezeSnapshot } from './core/freeze-snapshot.ts'
|
|
7
7
|
import { sanitizeHandover, type TaskHandoverInput } from './core/handover.ts'
|
|
8
|
-
import { isTaskBoardExtensionPayload, normalizeTaskIntegrations, type TaskBoardExtensionPayload } from './core/extension.ts'
|
|
8
|
+
import { TASK_BOARD_MESSAGE_MAX_LENGTH, isTaskBoardExtensionPayload, normalizeTaskIntegrations, type TaskBoardExtensionPayload } from './core/extension.ts'
|
|
9
9
|
import { normalizeVerification, type ModelCatalogView, type VerificationContract, type VerificationSettings } from './core/verification.ts'
|
|
10
|
+
import { isTaskAttachmentList, TASK_ATTACHMENT_LIMIT, TASK_ATTACHMENT_MAX_BYTES, TASK_ATTACHMENT_TOTAL_MAX_BYTES } from './core/attachment.ts'
|
|
10
11
|
|
|
11
12
|
/** Freeze payload carried by create/update actions after the gate (redacted in place). */
|
|
12
13
|
type FreezePayload = FreezeSnapshot & { redacted?: boolean; frozenBy?: string }
|
|
13
14
|
|
|
14
|
-
export const TASK_BOARD_SCHEMA_VERSION =
|
|
15
|
-
/** Ledger documents written before
|
|
16
|
-
export const TASK_BOARD_LEGACY_SCHEMA_VERSION =
|
|
15
|
+
export const TASK_BOARD_SCHEMA_VERSION = 7 as const
|
|
16
|
+
/** Ledger documents written before v7; loaded once and migrated on startup. */
|
|
17
|
+
export const TASK_BOARD_LEGACY_SCHEMA_VERSION = 6 as const
|
|
18
|
+
/** Ledger documents written before v6 (the scheduling mode and run budget). */
|
|
19
|
+
export const TASK_BOARD_PRE_RUN_BUDGET_SCHEMA_VERSION = 5 as const
|
|
17
20
|
/** Ledger documents written before v5; migrated through the v5 normalization too. */
|
|
18
21
|
export const TASK_BOARD_PRE_ACCEPTANCE_SCHEMA_VERSION = 4 as const
|
|
19
22
|
/** Ledger documents written before v4; migrated through the v4 normalization too. */
|
|
@@ -29,12 +32,14 @@ export const TASK_BOARD_OLDEST_SCHEMA_VERSION = 2 as const
|
|
|
29
32
|
export const TASK_BOARD_ZONE_STAMP_SCHEMA_VERSION = 4 as const
|
|
30
33
|
/**
|
|
31
34
|
* Every older generation the loader migrates in place. v5 only added the
|
|
32
|
-
* per-execution acceptance block
|
|
33
|
-
* budget,
|
|
34
|
-
* row; a document from any
|
|
35
|
+
* per-execution acceptance block, v6 only added the scheduling mode and run
|
|
36
|
+
* budget, and v7 only added the card attachment metadata, so the migration is
|
|
37
|
+
* the normalization pass that re-validates each row; a document from any
|
|
38
|
+
* listed generation upgrades losslessly.
|
|
35
39
|
*/
|
|
36
40
|
export const TASK_BOARD_MIGRATABLE_SCHEMA_VERSIONS: readonly number[] = [
|
|
37
41
|
TASK_BOARD_LEGACY_SCHEMA_VERSION,
|
|
42
|
+
TASK_BOARD_PRE_RUN_BUDGET_SCHEMA_VERSION,
|
|
38
43
|
TASK_BOARD_PRE_ACCEPTANCE_SCHEMA_VERSION,
|
|
39
44
|
TASK_BOARD_OLDER_SCHEMA_VERSION,
|
|
40
45
|
TASK_BOARD_OLDEST_SCHEMA_VERSION,
|
|
@@ -80,11 +85,6 @@ export interface TaskBoardSnapshot {
|
|
|
80
85
|
* disable the subtask controls; the Host ledger is the authority.
|
|
81
86
|
*/
|
|
82
87
|
maxSubtaskDepth?: number
|
|
83
|
-
/**
|
|
84
|
-
* Whether this deployment serves the Agent Teams service, so a task may opt
|
|
85
|
-
* into team execution (Team Lead session plus one teammate per subtask).
|
|
86
|
-
*/
|
|
87
|
-
teamRunAvailable?: boolean
|
|
88
88
|
/**
|
|
89
89
|
* Live GLOBAL native-/goal switch. The browser uses it to disable the
|
|
90
90
|
* task-level option (and explain that the global switch must be turned on
|
|
@@ -93,11 +93,39 @@ export interface TaskBoardSnapshot {
|
|
|
93
93
|
* flight.
|
|
94
94
|
*/
|
|
95
95
|
goalRunEnabled?: boolean
|
|
96
|
+
/**
|
|
97
|
+
* New-card defaults this deployment configures: what the create dialog opens
|
|
98
|
+
* with, and what the create path fills an omitted target from when the caller
|
|
99
|
+
* opts in (`applyCardDefaults`). A target the board configures nothing for is
|
|
100
|
+
* omitted rather than published blank, so the browser can tell "no default
|
|
101
|
+
* model" from "a blank one".
|
|
102
|
+
*/
|
|
103
|
+
cardDefaults?: { mode?: string; permission?: TaskPermission; model?: string; reasoningEffort?: string }
|
|
96
104
|
/**
|
|
97
105
|
* Read-only summaries published by running extensions, keyed by extension id.
|
|
98
106
|
* The board forwards them verbatim; it never interprets their shape.
|
|
99
107
|
*/
|
|
100
108
|
extensions?: Record<string, unknown>
|
|
109
|
+
/**
|
|
110
|
+
* The attachment limits this deployment enforces, so the browser can refuse
|
|
111
|
+
* an oversized selection before it uploads anything. The board's own caps
|
|
112
|
+
* are the ceiling; a deployment whose attachment storage publishes stricter
|
|
113
|
+
* image limits lowers the bounds it publishes here.
|
|
114
|
+
*/
|
|
115
|
+
attachmentLimits?: {
|
|
116
|
+
/** Maximum number of attachments one card may carry. */
|
|
117
|
+
maxAttachments: number
|
|
118
|
+
/** Maximum byte length of one attachment. */
|
|
119
|
+
maxBytes: number
|
|
120
|
+
/** Maximum byte length of all attachments of one card together. */
|
|
121
|
+
maxTotalBytes: number
|
|
122
|
+
/** Maximum number of IMAGES one card may carry (the official per-message budget). */
|
|
123
|
+
maxImages: number
|
|
124
|
+
/** Maximum byte length of one image. */
|
|
125
|
+
maxImageBytes: number
|
|
126
|
+
/** Maximum byte length of all images of one card together (the official per-message budget). */
|
|
127
|
+
maxMessageImageBytes: number
|
|
128
|
+
}
|
|
101
129
|
}
|
|
102
130
|
|
|
103
131
|
/**
|
|
@@ -178,6 +206,12 @@ export type TaskBoardAction =
|
|
|
178
206
|
| { kind: 'set-schedule'; taskId: string; patch: SetSchedulePatch }
|
|
179
207
|
| { kind: 'run'; taskId: string }
|
|
180
208
|
| { kind: 'rerun'; taskId: string }
|
|
209
|
+
/**
|
|
210
|
+
* Re-run an executed card in its own session, carrying rework instructions as
|
|
211
|
+
* this run's additional input. Every run gate applies exactly as it does to
|
|
212
|
+
* `rerun`, and the card's frozen content is never rewritten.
|
|
213
|
+
*/
|
|
214
|
+
| { kind: 'rework'; taskId: string; instructions: string }
|
|
181
215
|
| { kind: 'confirm-permission'; taskId: string }
|
|
182
216
|
| { kind: 'set-parent'; taskId: string; parentId: string | null }
|
|
183
217
|
/** Ledger-wide label management; see core/use-cases/task-tag.ts. */
|
|
@@ -263,7 +297,13 @@ function validImportedKnownFields(value: Record<string, unknown>): boolean {
|
|
|
263
297
|
// must carry a well-formed list or none at all, so a hand-edited export
|
|
264
298
|
// cannot smuggle a malformed tag past the gate.
|
|
265
299
|
if (value.tags !== undefined && !isTaskTagList(value.tags)) return false
|
|
300
|
+
// The model pin is carried by the import (with the level bound to it), so a
|
|
301
|
+
// non-string value is refused here like the other carried known fields.
|
|
302
|
+
if (value.model !== undefined && typeof value.model !== 'string') return false
|
|
266
303
|
if (value.integrations !== undefined && normalizeTaskIntegrations(value.integrations) === undefined) return false
|
|
304
|
+
// 安全门(对抗场景 e):import 不接受附件——旧版浏览器导出从不携带附件,
|
|
305
|
+
// 一条声称携带附件的导入必须被拒绝,而不是让未经校验的引用进入账本。
|
|
306
|
+
if (value.attachments !== undefined) return false
|
|
267
307
|
if (value.schedule !== undefined && !validImportedSchedule(value.schedule)) return false
|
|
268
308
|
if (value.executions !== undefined) {
|
|
269
309
|
if (!Array.isArray(value.executions)) return false
|
|
@@ -326,7 +366,15 @@ function importedTask(value: unknown): TaskRecord | undefined {
|
|
|
326
366
|
...(task.parentId === undefined ? {} : { parentId: task.parentId }),
|
|
327
367
|
...(task.workspaceId === undefined ? {} : { workspaceId: task.workspaceId }),
|
|
328
368
|
...(task.mode === undefined ? {} : { mode: task.mode }),
|
|
369
|
+
// The model pin rides the import together with the level bound to it: the
|
|
370
|
+
// two are one pair, and an imported level without its model would run at
|
|
371
|
+
// whatever route the session happens to be on. Blank text means "no pin",
|
|
372
|
+
// like every other target, so it is not carried as a pin of its own.
|
|
373
|
+
...(typeof task.model !== 'string' || task.model.trim() === '' ? {} : { model: task.model }),
|
|
329
374
|
...(task.permission === undefined ? {} : { permission: task.permission }),
|
|
375
|
+
// The reasoning effort rides the import like the other execution targets: it
|
|
376
|
+
// is the user's own card preference, not a verdict.
|
|
377
|
+
...(task.reasoningEffort === undefined ? {} : { reasoningEffort: task.reasoningEffort }),
|
|
330
378
|
...(task.reuseSession === undefined ? {} : { reuseSession: task.reuseSession }),
|
|
331
379
|
...(task.goalRun === undefined ? {} : { goalRun: task.goalRun }),
|
|
332
380
|
// The per-card acceptance opt-out rides the import like the /goal opt-in:
|
|
@@ -372,17 +420,25 @@ function handoverPayload(value: unknown): TaskHandoverInput | undefined {
|
|
|
372
420
|
|
|
373
421
|
function createInput(value: unknown): value is NewTaskInput {
|
|
374
422
|
const input = record(value)
|
|
375
|
-
if (input === undefined || !exactKeys(input, ['title', 'description', 'prompt', 'parentId', 'workspaceId', 'mode', 'permission', 'schedule', 'freeze', 'handover', 'model', '
|
|
423
|
+
if (input === undefined || !exactKeys(input, ['title', 'description', 'prompt', 'parentId', 'workspaceId', 'mode', 'permission', 'schedule', 'freeze', 'handover', 'model', 'reasoningEffort', 'applyCardDefaults', 'reuseSession', 'goalRun', 'skipVerification', 'tags', 'integrations', 'attachments'])) return false
|
|
376
424
|
if (input.parentId !== undefined && (typeof input.parentId !== 'string' || input.parentId.trim() === '')) return false
|
|
377
425
|
if (typeof input.title !== 'string' || typeof input.description !== 'string' || typeof input.prompt !== 'string') return false
|
|
378
|
-
|
|
426
|
+
// The reasoning effort is an adapter-owned id the Host resolves against the
|
|
427
|
+
// live model catalog, so this gate only keeps a malformed value (a number, an
|
|
428
|
+
// object, null) off the ledger; blank text means "inherit" like every other
|
|
429
|
+
// pinned target.
|
|
430
|
+
if (!optionalString(input.workspaceId) || !optionalString(input.mode) || !optionalString(input.model) || !optionalString(input.reasoningEffort)) return false
|
|
431
|
+
if (input.applyCardDefaults !== undefined && typeof input.applyCardDefaults !== 'boolean') return false
|
|
379
432
|
if (input.reuseSession !== undefined && typeof input.reuseSession !== 'boolean') return false
|
|
380
|
-
if (input.teamRun !== undefined && typeof input.teamRun !== 'boolean') return false
|
|
381
433
|
if (input.goalRun !== undefined && typeof input.goalRun !== 'boolean') return false
|
|
382
434
|
if (input.skipVerification !== undefined && typeof input.skipVerification !== 'boolean') return false
|
|
383
435
|
if (input.permission !== undefined && !isTaskPermission(input.permission)) return false
|
|
384
436
|
if (input.tags !== undefined && !isTaskTagList(input.tags)) return false
|
|
385
437
|
if (input.integrations !== undefined && normalizeTaskIntegrations(input.integrations) === undefined) return false
|
|
438
|
+
// Attachments are host-verified against the official storage before the
|
|
439
|
+
// ledger sees them; the wire gate only keeps a malformed, duplicated or
|
|
440
|
+
// oversized list off the action.
|
|
441
|
+
if (input.attachments !== undefined && !isTaskAttachmentList(input.attachments)) return false
|
|
386
442
|
if (input.freeze !== undefined && freezePayload(input.freeze) === undefined) return false
|
|
387
443
|
if (input.handover !== undefined && handoverPayload(input.handover) === undefined) return false
|
|
388
444
|
if (input.schedule !== undefined) {
|
|
@@ -402,22 +458,24 @@ function createInput(value: unknown): value is NewTaskInput {
|
|
|
402
458
|
|
|
403
459
|
function updatePatch(value: unknown): boolean {
|
|
404
460
|
const patch = record(value)
|
|
405
|
-
if (patch === undefined || !exactKeys(patch, ['title', 'description', 'prompt', 'workspaceId', 'mode', 'permission', 'freeze', 'handover', 'model', '
|
|
461
|
+
if (patch === undefined || !exactKeys(patch, ['title', 'description', 'prompt', 'workspaceId', 'mode', 'permission', 'freeze', 'handover', 'model', 'reasoningEffort', 'reuseSession', 'goalRun', 'skipVerification', 'tags', 'attachments'])) return false
|
|
406
462
|
// null (or false) clears the reuse opt-in; only a real boolean is accepted.
|
|
407
463
|
if (patch.reuseSession !== undefined && patch.reuseSession !== null && typeof patch.reuseSession !== 'boolean') return false
|
|
408
|
-
if (patch.teamRun !== undefined && patch.teamRun !== null && typeof patch.teamRun !== 'boolean') return false
|
|
409
464
|
// The goal opt-in is tri-state: null/true return the card to its default
|
|
410
465
|
// (goal run), false pins a single plain turn.
|
|
411
466
|
if (patch.goalRun !== undefined && patch.goalRun !== null && typeof patch.goalRun !== 'boolean') return false
|
|
412
467
|
// The acceptance opt-out is the mirror tri-state: null/false return the card
|
|
413
468
|
// to inheriting the board-wide switch, true pins it out of the gate.
|
|
414
469
|
if (patch.skipVerification !== undefined && patch.skipVerification !== null && typeof patch.skipVerification !== 'boolean') return false
|
|
415
|
-
for (const key of ['title', 'description', 'prompt', 'workspaceId', 'mode', 'model'] as const) {
|
|
470
|
+
for (const key of ['title', 'description', 'prompt', 'workspaceId', 'mode', 'model', 'reasoningEffort'] as const) {
|
|
416
471
|
if (!optionalString(patch[key])) return false
|
|
417
472
|
}
|
|
418
473
|
if (patch.permission !== undefined && !isTaskPermission(patch.permission)) return false
|
|
419
474
|
// null clears the label set; a present array must be a well-formed list.
|
|
420
475
|
if (patch.tags !== undefined && patch.tags !== null && !isTaskTagList(patch.tags)) return false
|
|
476
|
+
// null clears the attachment set; a present array replaces it wholesale and
|
|
477
|
+
// must be a well-formed list within the card-wide limits.
|
|
478
|
+
if (patch.attachments !== undefined && patch.attachments !== null && !isTaskAttachmentList(patch.attachments)) return false
|
|
421
479
|
// null clears the snapshot; an object must pass the freeze gate.
|
|
422
480
|
if (patch.freeze !== undefined && patch.freeze !== null && freezePayload(patch.freeze) === undefined) return false
|
|
423
481
|
// Same convention for the handover bundle.
|
|
@@ -575,6 +633,13 @@ function parseEnvelopeAction(value: unknown): TaskBoardActionEnvelope | undefine
|
|
|
575
633
|
},
|
|
576
634
|
}
|
|
577
635
|
}
|
|
636
|
+
case 'rework': {
|
|
637
|
+
if (!exactKeys(action, ['kind', 'taskId', 'instructions'])) return undefined
|
|
638
|
+
if (taskId === undefined || typeof action.instructions !== 'string') return undefined
|
|
639
|
+
const instructions = action.instructions.trim()
|
|
640
|
+
if (instructions === '' || instructions.length > TASK_BOARD_MESSAGE_MAX_LENGTH) return undefined
|
|
641
|
+
return { requestId: envelope.requestId, action: { kind: 'rework', taskId, instructions } }
|
|
642
|
+
}
|
|
578
643
|
case 'confirm-permission':
|
|
579
644
|
case 'delete':
|
|
580
645
|
case 'archive':
|
package/src/tool-surface.ts
CHANGED
package/icon.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
-
<path fill="#4d6bfe" fill-rule="evenodd" d="M 67.5 120 L 70.5 120 L 72.5 121 L 80.5 129 L 81.5 129 L 84.5 132 L 85.5 132 L 90.5 136 L 93.5 137 L 95.5 139 L 101.5 142 L 103.5 142 L 106.5 144 L 111.5 145 L 112.5 146 L 115.5 146 L 119.5 148 Q 122.75 147.25 123.5 149 L 127.5 149 L 128.5 150 L 133.5 150 L 134.5 151 L 140.5 151 L 141.5 152 L 150.5 152 L 151.5 153 L 160.5 153 L 161.5 154 L 171.5 154 L 172.5 155 L 178.5 155 L 179.5 156 Q 183.5 155 184.5 157 L 189.5 157 Q 190.5 159 194.5 158 L 195.5 159 L 197.5 159 L 198.5 160 L 200.5 160 L 201.5 161 L 206.5 162 L 209.5 164 L 211.5 164 L 219.5 168 L 224.5 172 L 227.5 173 L 247 191.5 L 247 192.5 L 253 199.5 L 255.5 204 L 258 201.5 L 263 193.5 L 272.5 183 L 273.5 183 L 280.5 176 L 281.5 176 L 292.5 168 L 300.5 164 L 302.5 164 L 305.5 162 L 307.5 162 L 308.5 161 L 310.5 161 L 314.5 159 L 317.5 159 L 318.5 158 Q 321.75 158.75 322.5 157 L 326.5 157 L 327.5 156 L 331.5 156 L 332.5 155 L 337.5 155 L 338.5 154 L 348.5 154 L 349.5 153 L 358.5 153 L 359.5 152 L 368.5 152 L 369.5 151 L 376.5 151 L 377.5 150 L 383.5 150 L 384.5 149 L 388.5 149 L 389.5 148 L 392.5 148 L 393.5 147 L 396.5 147 L 397.5 146 L 399.5 146 L 400.5 145 L 405.5 144 L 423.5 135 L 426.5 132 L 431.5 129 L 439.5 121 L 441.5 120 L 444.5 120 L 448 123.5 L 448 140.5 L 447 141.5 L 447 149.5 L 446 150.5 L 446 154.5 L 445 155.5 Q 445.75 158.75 444 159.5 L 444 163.5 Q 442.25 164.25 443 167.5 L 440 173.5 L 439 178.5 L 435 185.5 L 435 187.5 L 432 193.5 L 430 195.5 L 429 198.5 L 427 200.5 L 425 204.5 L 419 211.5 L 419 212.5 L 402.5 229 L 401.5 229 L 394.5 235 L 393.5 235 L 388.5 239 L 385.5 240 L 383.5 242 L 371.5 248 L 369.5 248 L 364.5 251 L 362.5 251 L 361.5 252 L 359.5 252 L 358.5 253 L 356.5 253 L 355.5 254 L 353.5 254 L 349.5 256 L 342.5 257 L 338.5 259 L 335.5 259 L 334.5 260 L 327.5 261 L 326.5 262 L 324.5 262 L 323.5 263 L 321.5 263 L 320.5 264 L 318.5 264 L 317.5 265 L 312.5 266 L 309.5 268 L 307.5 268 L 295.5 275 L 288 282.5 Q 287.5 286 285 287.5 Q 285.5 290 284 290.5 L 284 293.5 L 283 294.5 L 283 311.5 L 284 312.5 L 284 318.5 L 285 319.5 L 285 323.5 L 286 324.5 L 286 328.5 Q 288 329.5 287 333.5 L 288 334.5 L 288 337.5 L 289 338.5 L 289 341.5 L 290 342.5 L 290 345.5 L 291 346.5 L 292 353.5 L 293 354.5 L 293 356.5 L 295 360.5 L 295 363.5 L 296 364.5 L 296 367.5 L 297 368.5 L 297 370.5 L 298 371.5 L 298 373.5 L 299 374.5 L 299 376.5 L 301 380.5 L 301 386.5 L 298.5 389 L 294.5 391 Q 292 390.5 291.5 392 L 286.5 392 L 285.5 393 L 272.5 393 L 271.5 394 L 240.5 394 L 239.5 393 L 227.5 393 L 226.5 392 L 221.5 392 Q 220.75 390.25 217.5 391 L 212 387.5 L 211 385.5 L 211 381.5 L 212 380.5 Q 211.5 378 213 377.5 L 213 374.5 L 214 373.5 L 214 371.5 L 216 367.5 L 216 364.5 L 217 363.5 L 217 361.5 L 219 357.5 L 219 354.5 L 221 350.5 L 221 347.5 L 222 346.5 L 222 343.5 L 223 342.5 L 223 339.5 L 224 338.5 L 224 335.5 L 225 334.5 Q 224.25 331.25 226 330.5 L 226 326.5 L 227 325.5 Q 226 321.5 228 320.5 L 228 315.5 L 229 314.5 L 229 292.5 L 228 291.5 L 227 286.5 L 225 284.5 L 223 280.5 L 219.5 277 L 218.5 277 L 212.5 272 L 202.5 267 L 200.5 267 L 197.5 265 L 194.5 265 L 193.5 264 L 191.5 264 L 190.5 263 L 188.5 263 L 184.5 261 L 181.5 261 L 180.5 260 L 173.5 259 L 172.5 258 L 170.5 258 L 166.5 256 L 159.5 255 L 158.5 254 L 156.5 254 L 155.5 253 L 150.5 252 L 147.5 250 L 145.5 250 L 142.5 248 L 140.5 248 L 128.5 242 L 123.5 238 L 120.5 237 L 109.5 228 L 108.5 228 L 95 214.5 L 95 213.5 L 87 204.5 L 84 198.5 L 82 196.5 L 80 191.5 L 77 187.5 L 77 185.5 L 72 175.5 L 72 173.5 L 71 172.5 L 71 170.5 L 69 166.5 L 69 163.5 L 68 162.5 Q 68.75 159.25 67 158.5 L 67 154.5 L 66 153.5 L 66 148.5 L 65 147.5 L 65 139.5 L 64 138.5 L 64 124.5 L 67.5 120 Z"/>
|
|
3
|
-
</svg>
|