dsh-taskboard 0.2.1 → 0.3.3
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.md +50 -4
- package/lib/client.js +818 -77
- package/lib/host/execution.js +194 -54
- package/lib/host/execution.js.map +1 -1
- package/lib/host/git.js +234 -0
- package/lib/host/git.js.map +1 -0
- package/lib/host/routes.js +282 -5
- package/lib/host/routes.js.map +1 -1
- package/lib/host/tools.js +16 -2
- package/lib/host/tools.js.map +1 -1
- package/lib/index.js +17 -2
- package/lib/index.js.map +1 -1
- package/lib/shared/api.js.map +1 -1
- package/lib/shared/protocol.js +10 -1
- package/lib/shared/protocol.js.map +1 -1
- package/package.json +74 -74
- package/src/client/api.ts +23 -3
- package/src/client/board/TaskBoard.tsx +73 -0
- package/src/client/board/TaskCard.tsx +73 -5
- package/src/client/board/TaskDetail.tsx +173 -1
- package/src/client/board/TaskFormModal.tsx +100 -1
- package/src/client/controller.ts +108 -6
- package/src/client/index.ts +18 -1
- package/src/client/styles.ts +60 -0
- package/src/host/execution.ts +291 -65
- package/src/host/git.ts +293 -0
- package/src/host/routes.ts +294 -6
- package/src/host/tools.ts +17 -0
- package/src/index.ts +24 -1
- package/src/shared/api.ts +42 -3
- package/src/shared/protocol.ts +64 -0
- package/src/shared/version.ts +1 -1
package/src/shared/protocol.ts
CHANGED
|
@@ -102,6 +102,29 @@ export const URGENCY_COLOR: Readonly<Record<Urgency, string>> = {
|
|
|
102
102
|
// Execution
|
|
103
103
|
// ---------------------------------------------------------------------------
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Per-task code isolation mode (0.3.0).
|
|
107
|
+
* - `worktree`: each execution runs in a fresh `git worktree` on a dedicated
|
|
108
|
+
* task branch (`task/<标题>+<taskId>`) under `<workspace>/.dsh-worktrees/`.
|
|
109
|
+
* - `none`: run in the workspace directory as before, zero git interaction.
|
|
110
|
+
* Omitted = the default `worktree`; non-git projects auto-degrade at run
|
|
111
|
+
* time (the execution record carries an `isolationNote` explaining why).
|
|
112
|
+
*/
|
|
113
|
+
export type IsolationMode = 'worktree' | 'none'
|
|
114
|
+
|
|
115
|
+
/** Validate an isolation value. */
|
|
116
|
+
export function asIsolation(raw: string): IsolationMode {
|
|
117
|
+
if (raw !== 'worktree' && raw !== 'none') {
|
|
118
|
+
throw new Error("isolation must be 'worktree' or 'none'")
|
|
119
|
+
}
|
|
120
|
+
return raw
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Resolve a task's effective isolation (omitted → the worktree default). */
|
|
124
|
+
export function effectiveIsolation(task: Pick<TaskRecord, 'isolation'>): IsolationMode {
|
|
125
|
+
return task.isolation === undefined ? 'worktree' : task.isolation
|
|
126
|
+
}
|
|
127
|
+
|
|
105
128
|
/** How a task may run. */
|
|
106
129
|
export type ExecutionMode = 'claim' | 'scheduled'
|
|
107
130
|
|
|
@@ -237,6 +260,9 @@ export type CommentRecord = {
|
|
|
237
260
|
threadId?: string
|
|
238
261
|
}
|
|
239
262
|
|
|
263
|
+
/** One commit produced by an isolated execution (hash + subject). */
|
|
264
|
+
export type CommitInfo = { hash: string; subject: string }
|
|
265
|
+
|
|
240
266
|
/** One execution attempt of a task. */
|
|
241
267
|
export type ExecutionRecord = {
|
|
242
268
|
id: string
|
|
@@ -248,6 +274,30 @@ export type ExecutionRecord = {
|
|
|
248
274
|
endedAt?: number
|
|
249
275
|
outcome: 'running' | 'succeeded' | 'failed' | 'cancelled'
|
|
250
276
|
error?: string
|
|
277
|
+
/** Code isolation actually used (`none` also covers degraded worktree runs). */
|
|
278
|
+
isolation?: IsolationMode
|
|
279
|
+
/** Why worktree isolation degraded to running in the original directory. */
|
|
280
|
+
isolationNote?: string
|
|
281
|
+
/** The task branch this execution worked on (worktree runs only). */
|
|
282
|
+
branch?: string
|
|
283
|
+
/** Absolute path of the dedicated worktree (worktree runs only). */
|
|
284
|
+
worktreePath?: string
|
|
285
|
+
/** HEAD of the task branch before the execution started. */
|
|
286
|
+
baseCommit?: string
|
|
287
|
+
/** HEAD at settlement. */
|
|
288
|
+
headCommit?: string
|
|
289
|
+
/** Commits between baseCommit and headCommit (hash + subject; capped at 50, newest first). */
|
|
290
|
+
commits?: CommitInfo[]
|
|
291
|
+
/** Total commits before the evidence cap (equals commits.length when under it). */
|
|
292
|
+
commitsTotal?: number
|
|
293
|
+
/** Uncommitted changes present at settlement (`git status --porcelain` lines; capped at 100). */
|
|
294
|
+
dirtyFiles?: string[]
|
|
295
|
+
/** Total uncommitted lines before the evidence cap. */
|
|
296
|
+
dirtyFilesTotal?: number
|
|
297
|
+
/** Aggregate diff stat between baseCommit and headCommit. */
|
|
298
|
+
diffStat?: string
|
|
299
|
+
/** How many files differ between baseCommit and headCommit. */
|
|
300
|
+
changedFiles?: number
|
|
251
301
|
}
|
|
252
302
|
|
|
253
303
|
/** The per-model override a task may carry; absent = session default model. */
|
|
@@ -271,6 +321,20 @@ export type TaskRecord = {
|
|
|
271
321
|
blocked: boolean
|
|
272
322
|
execution: ExecutionConfig
|
|
273
323
|
model?: TaskModel
|
|
324
|
+
/** Code isolation for executions (omitted = the worktree default; see {@link IsolationMode}). */
|
|
325
|
+
isolation?: IsolationMode
|
|
326
|
+
/**
|
|
327
|
+
* The agent preset execution sessions are composed from (omitted = the
|
|
328
|
+
* deployment default preset). Recorded on the session header and mounted
|
|
329
|
+
* via the presets service at creation — this is what hands the session its
|
|
330
|
+
* tool set. Editable any time (each run composes fresh).
|
|
331
|
+
*/
|
|
332
|
+
presetId?: string
|
|
333
|
+
/**
|
|
334
|
+
* The task branch fixed at the FIRST worktree creation (`task/<标题>+<taskId>`).
|
|
335
|
+
* Renaming the task afterwards never changes it (history preservation).
|
|
336
|
+
*/
|
|
337
|
+
branch?: string
|
|
274
338
|
/**
|
|
275
339
|
* The session currently holding the in-progress claim (explicit claim or a
|
|
276
340
|
* live execution). Present only while `status === 'in_progress'`: any move
|
package/src/shared/version.ts
CHANGED