@spunto/design-system 0.63.0 → 0.64.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spunto/design-system",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "description": "Spunto's shared design system — green tokens (conservatory + sprout), color constants, and UI primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,14 +42,15 @@ import type { DraftFile, TaskPendingAction } from "./types"
42
42
  * stream, and every agent app's runner (RFC 0048) — mirrors `isInteractive` of
43
43
  * `@spunto/build/agent-stream`, which this package does not depend on.
44
44
  */
45
- export const INTERACTIVE_PROTOCOLS: ReadonlySet<string> = new Set(["claude-stream", "claude-runner", "codex-runner"])
45
+ export const INTERACTIVE_PROTOCOLS: ReadonlySet<string> = new Set(["agent-v1", "claude-stream", "claude-runner", "codex-runner"])
46
46
 
47
47
  export interface TaskComposerProps {
48
48
  state: string
49
49
  /** Did the stream give us a session id to resume? Without one there is nothing to continue. */
50
50
  canResume?: boolean
51
51
  /**
52
- * How the session is read (`claude-stream`, or an agent app's `claude-runner` / `codex-runner`…).
52
+ * How the session is read (`agent-v1`, the Spunto agent contract every agent app's runner speaks;
53
+ * `claude-stream` or an app's older `claude-runner` / `codex-runner` for a session begun on them).
53
54
  * An interactive one is answered while it works, and stopped (`INTERACTIVE_PROTOCOLS`).
54
55
  */
55
56
  protocol: string
@@ -14,7 +14,7 @@
14
14
  // machine), then how it was set up.
15
15
 
16
16
  import { createContext, useContext, useState, type ReactNode } from "react"
17
- import { CheckIcon, ChevronRightIcon, CopyIcon, ExternalLinkIcon, GitBranchIcon, Loader2Icon, XCircleIcon } from "lucide-react"
17
+ import { CheckIcon, ChevronRightIcon, CopyIcon, ExternalLinkIcon, GitBranchIcon, Loader2Icon, SlidersHorizontalIcon, XCircleIcon } from "lucide-react"
18
18
 
19
19
  import { cn, formatRelativeTime } from "../../utils"
20
20
  import { TaskCommandLog } from "./command-log"
@@ -46,6 +46,11 @@ export interface TaskDetailsProps {
46
46
  * the pull requests, and where each stands. One block per app, absent when it has nothing.
47
47
  */
48
48
  appTiles?: TaskAppTile[] | null
49
+ /**
50
+ * Where a reader changes what a `customizable` block shows — the app's card in the org's
51
+ * integrations. Absent (or null for a tile) = no link.
52
+ */
53
+ appTileSettingsHref?: (tile: TaskAppTile) => string | null
49
54
  attachmentUrl?: AttachmentUrl
50
55
  /** The Machine block's content — typically a `TaskMachine`. */
51
56
  machine?: ReactNode
@@ -131,6 +136,21 @@ function Block({
131
136
  )
132
137
  }
133
138
 
139
+ /** « Customize » under a block whose app lets each reader choose what it shows (RFC 0053 § 6). */
140
+ function CustomizeLink({ tile, href }: { tile: TaskAppTile; href?: (tile: TaskAppTile) => string | null }) {
141
+ const to = tile.customizable && href ? href(tile) : null
142
+ if (!to) return null
143
+ return (
144
+ <a
145
+ href={to}
146
+ className="mt-3 inline-flex items-center gap-1 text-[10px] text-muted-foreground transition-colors hover:text-foreground"
147
+ >
148
+ <SlidersHorizontalIcon className="h-3 w-3" />
149
+ Customize
150
+ </a>
151
+ )
152
+ }
153
+
134
154
  export function TaskDetails({
135
155
  task,
136
156
  variant = "sidebar",
@@ -138,6 +158,7 @@ export function TaskDetails({
138
158
  pullRequests,
139
159
  shared,
140
160
  appTiles,
161
+ appTileSettingsHref,
141
162
  attachmentUrl,
142
163
  machine,
143
164
  commands = [],
@@ -232,6 +253,7 @@ export function TaskDetails({
232
253
  {appTiles?.filter((tile) => tile.session).map((tile) => (
233
254
  <Block key={tile.appId} variant={variant} title={tile.title} hint={tile.appName === tile.title ? undefined : tile.appName}>
234
255
  <TaskAppTileContent tile={tile} />
256
+ <CustomizeLink tile={tile} href={appTileSettingsHref} />
235
257
  </Block>
236
258
  ))}
237
259
 
@@ -246,6 +268,7 @@ export function TaskDetails({
246
268
  {appTiles?.filter((tile) => !tile.session).map((tile) => (
247
269
  <Block key={tile.appId} variant={variant} title={tile.title} hint={tile.appName === tile.title ? undefined : tile.appName}>
248
270
  <TaskAppTileContent tile={tile} />
271
+ <CustomizeLink tile={tile} href={appTileSettingsHref} />
249
272
  </Block>
250
273
  ))}
251
274
 
@@ -356,7 +356,7 @@ describe("TaskComposer", () => {
356
356
  })
357
357
 
358
358
  it("lets an agent app's session be answered while it works — every runner is interactive", () => {
359
- for (const protocol of ["claude-runner", "codex-runner"]) {
359
+ for (const protocol of ["agent-v1", "claude-runner", "codex-runner"]) {
360
360
  const onSubmit = vi.fn()
361
361
  const { unmount } = render(<TaskComposer state="running" canResume protocol={protocol} onSubmit={onSubmit} />)
362
362
  const box = screen.getByRole("textbox") as HTMLTextAreaElement
@@ -313,6 +313,8 @@ export interface TaskAppTile {
313
313
  title: string
314
314
  /** From the app running the task's session: drawn right under Session rather than with the others. */
315
315
  session?: boolean
316
+ /** The app lets each reader choose what this block shows (RFC 0053 § 6): `TaskDetails` links to where. */
317
+ customizable?: boolean
316
318
  meters?: TaskAppTileMeter[]
317
319
  facts?: TaskAppTileFact[]
318
320
  items?: TaskAppTileItem[]