@spunto/design-system 0.65.0 → 0.66.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/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import type { DraftFile, TaskPendingAction } from "./types"
|
|
|
12
12
|
* Answering a task — the bottom of the cockpit's centre column.
|
|
13
13
|
*
|
|
14
14
|
* What it does is a **new turn, not an interruption**: the harness is resumed with what you wrote,
|
|
15
|
-
*
|
|
15
|
+
* in the same sandbox, on whatever the checkout holds, and its events continue the timeline above. Which is
|
|
16
16
|
* why it only appears while the task is in review — a session that is still talking has no open
|
|
17
17
|
* stdin to interrupt, and a box that pretended otherwise would be the worst kind of lie: one that
|
|
18
18
|
* looks like it worked.
|
|
@@ -250,7 +250,7 @@ export function TaskComposer({
|
|
|
250
250
|
? // Both paths are real and the composer cannot know which one it will take:
|
|
251
251
|
// the session is usually still listening, and is resumed if it has exited.
|
|
252
252
|
"Goes to the live session — or resumes it if it has exited."
|
|
253
|
-
: "Resumes the session with your message — same
|
|
253
|
+
: "Resumes the session with your message — same sandbox, same checkout.")}
|
|
254
254
|
</span>
|
|
255
255
|
{interactive && state === "running" && onInterrupt && (
|
|
256
256
|
<Button
|
|
@@ -317,8 +317,9 @@ export function bootSteps({
|
|
|
317
317
|
detail: setup ? phaseLabel(setup) : worker ? "waiting for the container's first report…" : undefined,
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
//
|
|
321
|
-
//
|
|
320
|
+
// Tasks from before RFC 0056 only: the platform created the task's branch in every repository
|
|
321
|
+
// before the session started — one recorded command per repo, which is where this reads from.
|
|
322
|
+
// A task since has no such command, and no Branch step: the agent branches, if it wants to.
|
|
322
323
|
const branchCommands = commands.filter((c) => (c.label ?? "").startsWith("Branch setup"))
|
|
323
324
|
const branchState: StepState =
|
|
324
325
|
branchCommands.length === 0
|
|
@@ -336,8 +337,9 @@ export function bootSteps({
|
|
|
336
337
|
commands: branchCommands.length > 0 ? branchCommands : undefined,
|
|
337
338
|
}
|
|
338
339
|
|
|
340
|
+
const legacyBranch = branchCommands.length > 0
|
|
339
341
|
const queued = task.state === "queued"
|
|
340
|
-
const ready = branchState === "done"
|
|
342
|
+
const ready = legacyBranch ? branchState === "done" : setupState === "done"
|
|
341
343
|
const session: TaskBootStep = {
|
|
342
344
|
key: "session",
|
|
343
345
|
label: "Agent session",
|
|
@@ -345,15 +347,17 @@ export function bootSteps({
|
|
|
345
347
|
detail: task.startedAt
|
|
346
348
|
? "started"
|
|
347
349
|
: queued
|
|
348
|
-
?
|
|
350
|
+
? legacyBranch
|
|
351
|
+
? "starts as soon as the branch is ready"
|
|
352
|
+
: "starts as soon as the machine is ready"
|
|
349
353
|
: "never started",
|
|
350
354
|
}
|
|
351
355
|
|
|
352
356
|
// A post-mortem drops the container and setup rows on purpose. Their only source is the
|
|
353
357
|
// machine's state *now* — and a task that is over no longer owns its machine, so those two rows
|
|
354
358
|
// would describe someone else's boot. What is left is recorded: which worker it got, whether
|
|
355
|
-
// its branch commands ran, whether a session ever started.
|
|
356
|
-
const rest = [branch, session]
|
|
359
|
+
// its branch commands ran (an old task), whether a session ever started.
|
|
360
|
+
const rest = legacyBranch ? [branch, session] : [session]
|
|
357
361
|
return queued ? [machine, container, setupStep, ...rest] : [machine, ...rest]
|
|
358
362
|
}
|
|
359
363
|
|
|
@@ -49,6 +49,11 @@ export interface NewTaskComposerProps {
|
|
|
49
49
|
/** Branches common to the project's repositories. Any name typed is accepted too. */
|
|
50
50
|
branches?: string[]
|
|
51
51
|
defaultBranch?: string | null
|
|
52
|
+
/**
|
|
53
|
+
* No Base branch chip: the starting point is decided elsewhere — a snapshot, which is cloned from
|
|
54
|
+
* nothing. The value typed so far is not sent either.
|
|
55
|
+
*/
|
|
56
|
+
hideBaseBranch?: boolean
|
|
52
57
|
modelGroups?: NewTaskModelGroup[]
|
|
53
58
|
/** The project's default model — what the chip says when nobody picked one. */
|
|
54
59
|
defaultModel?: string | null
|
|
@@ -226,6 +231,7 @@ export function NewTaskComposer({
|
|
|
226
231
|
onProjectChange,
|
|
227
232
|
branches = [],
|
|
228
233
|
defaultBranch = null,
|
|
234
|
+
hideBaseBranch = false,
|
|
229
235
|
modelGroups = [],
|
|
230
236
|
defaultModel = null,
|
|
231
237
|
fields = [],
|
|
@@ -281,7 +287,7 @@ export function NewTaskComposer({
|
|
|
281
287
|
onSubmit({
|
|
282
288
|
...(asksProject ? { projectId } : {}),
|
|
283
289
|
prompt: prompt.trim(),
|
|
284
|
-
...(baseBranch.trim() ? { baseBranch: baseBranch.trim() } : {}),
|
|
290
|
+
...(baseBranch.trim() && !hideBaseBranch ? { baseBranch: baseBranch.trim() } : {}),
|
|
285
291
|
...(model.trim() ? { model: model.trim() } : {}),
|
|
286
292
|
files: draft.files,
|
|
287
293
|
...(Object.keys(values).length > 0 ? { fields: values } : {}),
|
|
@@ -320,7 +326,7 @@ export function NewTaskComposer({
|
|
|
320
326
|
<p className="mt-3 text-base font-semibold">What should the agent do?</p>
|
|
321
327
|
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
|
|
322
328
|
{description ??
|
|
323
|
-
"It gets its own machine
|
|
329
|
+
"It gets its own machine. Its session streams right here as soon as it starts — answer it as it works."}
|
|
324
330
|
</p>
|
|
325
331
|
</div>
|
|
326
332
|
</div>
|
|
@@ -392,15 +398,17 @@ export function NewTaskComposer({
|
|
|
392
398
|
</span>
|
|
393
399
|
))}
|
|
394
400
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
{!hideBaseBranch && (
|
|
402
|
+
<FreeTextChip
|
|
403
|
+
label="Base branch"
|
|
404
|
+
icon={<GitBranchIcon />}
|
|
405
|
+
value={baseBranch}
|
|
406
|
+
onChange={setBaseBranch}
|
|
407
|
+
placeholder={defaultBranch ?? "default branch"}
|
|
408
|
+
groups={[{ id: "branches", items: branches.map((b) => ({ value: b })) }]}
|
|
409
|
+
searchPlaceholder="Start from…"
|
|
410
|
+
/>
|
|
411
|
+
)}
|
|
404
412
|
|
|
405
413
|
<FreeTextChip
|
|
406
414
|
label="Model"
|
|
@@ -261,7 +261,7 @@ export function TaskList<T extends TaskItem>({
|
|
|
261
261
|
<div>
|
|
262
262
|
<p className="text-sm font-medium">No tasks yet</p>
|
|
263
263
|
<p className="mt-0.5 text-xs text-muted-foreground">
|
|
264
|
-
Delegate a unit of work — it gets its own
|
|
264
|
+
Delegate a unit of work — it gets its own sandbox and agent session
|
|
265
265
|
</p>
|
|
266
266
|
</div>
|
|
267
267
|
{emptyAction}
|
|
@@ -92,19 +92,26 @@ describe("boot steps", () => {
|
|
|
92
92
|
|
|
93
93
|
it("is looking for a machine while queued without a worker", () => {
|
|
94
94
|
const steps = bootSteps({ task: task({ state: "queued" }), worker: null, commands: [] })
|
|
95
|
-
|
|
95
|
+
// RFC 0056: no Branch step — Spunto creates no branch, the agent does if it wants one.
|
|
96
|
+
expect(steps.map((s) => s.key)).toEqual(["machine", "container", "setup", "session"])
|
|
96
97
|
expect(steps[0].state).toBe("running")
|
|
97
98
|
})
|
|
98
99
|
|
|
100
|
+
it("starts the session step once the machine is set up, with nothing in between", () => {
|
|
101
|
+
const worker = { id: "w1", name: "sbx-1", state: "ready", dockerState: "running", createdAt: "2026-09-20T00:00:00Z" }
|
|
102
|
+
const steps = bootSteps({ task: task({ state: "queued", branch: null }), worker, commands: [] })
|
|
103
|
+
expect(steps.find((s) => s.key === "session")).toMatchObject({ state: "running", detail: "starts as soon as the machine is ready" })
|
|
104
|
+
})
|
|
105
|
+
|
|
99
106
|
it("says the machine was never allocated on a task that died before one", () => {
|
|
100
107
|
const steps = bootSteps({ task: task({ state: "failed" }), worker: null, commands: [] })
|
|
101
108
|
// A post-mortem drops the container/setup rows: the machine is no longer the task's.
|
|
102
|
-
expect(steps.map((s) => s.key)).toEqual(["machine", "
|
|
109
|
+
expect(steps.map((s) => s.key)).toEqual(["machine", "session"])
|
|
103
110
|
expect(steps[0].state).toBe("error")
|
|
104
|
-
expect(steps[
|
|
111
|
+
expect(steps[1].detail).toBe("never started")
|
|
105
112
|
})
|
|
106
113
|
|
|
107
|
-
it("starts the session step once the branch is ready
|
|
114
|
+
it("an older task, branched by the platform: starts the session step once the branch is ready", () => {
|
|
108
115
|
const worker = { id: "w1", name: "pool-1", state: "ready", dockerState: "running", createdAt: "2026-09-20T00:00:00Z" }
|
|
109
116
|
const steps = bootSteps({ task: task({ state: "queued" }), worker, commands: [branchSetup("succeeded")] })
|
|
110
117
|
expect(steps.find((s) => s.key === "machine")?.detail).toBe("recycled from the pool · pool-1")
|