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.
@@ -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
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  /** The package version (must equal package.json "version"). */
9
- export const PLUGIN_VERSION = '0.2.1'
9
+ export const PLUGIN_VERSION = '0.3.3'