@sixb/app 0.1.14 → 0.1.15

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.
Files changed (70) hide show
  1. package/dist/{chunk-vtp6nk44.js → chunk-736c9akn.js} +1 -1
  2. package/dist/{chunk-1rhht9y0.js → chunk-n0cxwvej.js} +1 -1
  3. package/dist/{chunk-0yb22w6m.js → chunk-qh1panvd.js} +1 -1
  4. package/dist/{chunk-aes17xmx.js → chunk-twjs2sb9.js} +3928 -3717
  5. package/dist/{chunk-aes17xmx.js.map → chunk-twjs2sb9.js.map} +46 -42
  6. package/dist/index.js +15 -6
  7. package/dist/index.js.map +6 -6
  8. package/dist/pages.js +60 -44
  9. package/dist/pages.js.map +8 -8
  10. package/dist/server.js +12 -6
  11. package/dist/server.js.map +3 -3
  12. package/package.json +3 -3
  13. package/src/agent/agent-chat.tsx +4 -22
  14. package/src/agent/agent-panel.tsx +4 -0
  15. package/src/agent/agent-surface.tsx +4 -0
  16. package/src/agent/agent.css +33 -3
  17. package/src/agent/approvals.ts +4 -5
  18. package/src/agent/artifact-panel.tsx +113 -37
  19. package/src/agent/components/activity-status.tsx +1 -1
  20. package/src/agent/components/agent-threads.tsx +377 -0
  21. package/src/agent/components/approval-card.tsx +336 -327
  22. package/src/agent/components/approval-mode-chip.tsx +38 -145
  23. package/src/agent/components/auto-model-chip.tsx +103 -167
  24. package/src/agent/components/composer-menu.tsx +185 -0
  25. package/src/agent/components/composer.tsx +38 -43
  26. package/src/agent/components/context-chips.tsx +1 -1
  27. package/src/agent/components/conversation-panel.tsx +16 -36
  28. package/src/agent/components/file-attachment-card.tsx +5 -2
  29. package/src/agent/components/message-parts.tsx +27 -11
  30. package/src/agent/components/message-view.tsx +182 -68
  31. package/src/agent/components/model-controls.tsx +133 -125
  32. package/src/agent/components/model-picker-row.tsx +38 -17
  33. package/src/agent/components/participant-input.tsx +159 -31
  34. package/src/agent/components/reasoning-effort-slider.tsx +27 -27
  35. package/src/agent/components/shared-thread-notice.tsx +1 -1
  36. package/src/agent/components/thread-people.tsx +45 -15
  37. package/src/agent/components/threads-button.tsx +70 -0
  38. package/src/agent/components/transcript.tsx +30 -1
  39. package/src/agent/conversation.ts +25 -1
  40. package/src/agent/delegation/child-card.tsx +187 -247
  41. package/src/agent/delegation/child-cards.tsx +4 -7
  42. package/src/agent/delegation/child-group.tsx +179 -98
  43. package/src/agent/delegation/child-parts.tsx +71 -106
  44. package/src/agent/delegation/child-work.tsx +6 -52
  45. package/src/agent/delegation/interpret.ts +0 -28
  46. package/src/agent/delegation/model.ts +115 -39
  47. package/src/agent/hooks/use-agent-conversation.ts +7 -92
  48. package/src/agent/hooks/use-people-suggestions.ts +90 -0
  49. package/src/agent/hooks/use-thread-lists.ts +77 -0
  50. package/src/agent/i18n/en.ts +96 -83
  51. package/src/agent/i18n/fr.ts +105 -100
  52. package/src/agent/react-router.tsx +48 -5
  53. package/src/agent/run-presentation.ts +6 -2
  54. package/src/agent/thread-navigation.ts +16 -0
  55. package/src/agent/thread-pages.ts +24 -0
  56. package/src/artifacts/person-avatar.tsx +1 -1
  57. package/src/createCustomApp.ts +13 -6
  58. package/src/index.ts +7 -3
  59. package/src/pages/home.tsx +3 -1
  60. package/src/pages/observability/ai-usage/calls.tsx +2 -1
  61. package/src/pages/settings/memory-history.tsx +2 -1
  62. package/src/pages/settings/messages.ts +2 -3
  63. package/src/pages/values.tsx +23 -1
  64. package/src/pages.ts +5 -1
  65. package/src/shell/agent-dock.tsx +4 -2
  66. package/src/agent/agents-page.ts +0 -7
  67. package/src/agent/components/agent-thread-switcher.tsx +0 -519
  68. /package/dist/{chunk-vtp6nk44.js.map → chunk-736c9akn.js.map} +0 -0
  69. /package/dist/{chunk-1rhht9y0.js.map → chunk-n0cxwvej.js.map} +0 -0
  70. /package/dist/{chunk-0yb22w6m.js.map → chunk-qh1panvd.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/app",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Custom app toolkit for Sixb projects — route scanning, dev serving, and production builds",
5
5
  "keywords": [
6
6
  "sixb",
@@ -55,8 +55,8 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@sixb/client": "^0.1.22",
58
- "@sixb/core": "^0.1.22",
59
- "@sixb/ui": "^0.1.6",
58
+ "@sixb/core": "^0.1.23",
59
+ "@sixb/ui": "^0.1.7",
60
60
  "@tailwindcss/cli": "^4.2.2",
61
61
  "@xyflow/react": "^12.10.2",
62
62
  "lucide-react": "^0.562.0",
@@ -21,6 +21,8 @@ export interface AgentChatProps {
21
21
  readonly threadId?: string | null
22
22
  readonly onNavigateHome: () => void
23
23
  readonly onNavigateThread: (threadId: string) => void
24
+ /** Open the page of every conversation, from the header's button; without it, there is none. */
25
+ readonly onOpenThreads?: () => void
24
26
  readonly className?: string
25
27
  readonly ambientContext?: readonly AgentContextInput[]
26
28
  readonly compact?: boolean
@@ -42,6 +44,7 @@ export function AgentChat({
42
44
  threadId: threadIdInput = null,
43
45
  onNavigateHome,
44
46
  onNavigateThread,
47
+ onOpenThreads,
45
48
  className,
46
49
  ambientContext = [],
47
50
  compact = false,
@@ -142,29 +145,8 @@ export function AgentChat({
142
145
  currentThread={conversation.currentThread}
143
146
  runningThreadCount={conversation.runningThreadCount}
144
147
  waitingThreadIds={conversation.waitingThreadIds}
145
- threadsError={conversation.threadsError ? messages.chat.threadsLoadFailed : null}
146
- hasMoreThreads={conversation.threadsHasMore}
147
- loadingMoreThreads={conversation.threadsLoadingMore}
148
- loadMoreThreadsError={conversation.threadsLoadMoreError}
149
- onLoadMoreThreads={() => void conversation.loadMoreThreads()}
150
- agentThreads={conversation.agentThreads}
151
- sharedThreads={
152
- conversation.user
153
- ? {
154
- threads: conversation.sharedThreads,
155
- total: conversation.sharedThreadsTotal,
156
- error: conversation.sharedThreadsError
157
- ? messages.chat.sharedThreadsLoadFailed
158
- : null,
159
- hasMore: conversation.sharedThreadsHasMore,
160
- loadingMore: conversation.sharedThreadsLoadingMore,
161
- loadMoreError: conversation.sharedThreadsLoadMoreError,
162
- onLoadMore: () => void conversation.loadMoreSharedThreads(),
163
- }
164
- : undefined
165
- }
166
148
  onNewChat={onNavigateHome}
167
- onSelectThread={onNavigateThread}
149
+ onOpenThreads={onOpenThreads}
168
150
  sandboxRecovery={
169
151
  conversation.sandboxRecoveryProps ? (
170
152
  <SandboxRecovery {...conversation.sandboxRecoveryProps} />
@@ -12,6 +12,8 @@ export interface AgentPanelProps {
12
12
  readonly defaultThreadId?: string | null
13
13
  readonly onThreadChange?: (threadId: string | null) => void
14
14
  readonly onNewThread?: () => void
15
+ /** Open the page of every conversation, from the header's button. */
16
+ readonly onOpenThreads?: () => void
15
17
  /** Optional modeless artifact canvas owned by an enclosing application shell. */
16
18
  readonly artifactHost?: HTMLElement | null
17
19
  /** Keep artifacts beside the chat on desktop instead of opening a modal. */
@@ -31,6 +33,7 @@ export function AgentPanel({
31
33
  defaultThreadId = null,
32
34
  onThreadChange,
33
35
  onNewThread,
36
+ onOpenThreads,
34
37
  artifactHost,
35
38
  splitArtifacts,
36
39
  conversationHeaderActions,
@@ -68,6 +71,7 @@ export function AgentPanel({
68
71
  onNewThread?.()
69
72
  }}
70
73
  onNavigateThread={changeThread}
74
+ onOpenThreads={onOpenThreads}
71
75
  className={cn("min-h-0 overflow-hidden bg-background", className)}
72
76
  />
73
77
  )
@@ -51,6 +51,8 @@ export interface AgentSurfaceProps {
51
51
  readonly onThreadChange?: (threadId: string | null) => void
52
52
  /** Offer an explicit full-page view for the selected thread. */
53
53
  readonly onExpandThread?: (threadId: string) => void
54
+ /** Open the page of every conversation, from the header's button. */
55
+ readonly onOpenThreads?: () => void
54
56
  /** Controlled dock width. Numeric values are pixels. */
55
57
  readonly dockWidth?: CSSProperties["width"]
56
58
  readonly defaultDockWidth?: number
@@ -86,6 +88,7 @@ export function AgentSurface({
86
88
  defaultThreadId = null,
87
89
  onThreadChange,
88
90
  onExpandThread,
91
+ onOpenThreads,
89
92
  dockWidth,
90
93
  defaultDockWidth = DEFAULT_AGENT_SURFACE_WIDTH,
91
94
  onDockWidthChange,
@@ -317,6 +320,7 @@ export function AgentSurface({
317
320
  composerPlaceholder={composerPlaceholder}
318
321
  threadId={currentThreadId}
319
322
  onThreadChange={changeThread}
323
+ onOpenThreads={onOpenThreads}
320
324
  welcomeContent={welcomeContent}
321
325
  conversationHeaderActions={
322
326
  fullPage && onRequestDock ? (
@@ -96,7 +96,6 @@
96
96
  pointer-events: none;
97
97
  border-radius: 9999px;
98
98
  background: var(--muted);
99
- box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent);
100
99
  }
101
100
 
102
101
  .sixb-reasoning-fill {
@@ -118,10 +117,11 @@
118
117
  width: var(--sixb-reasoning-thumb-size);
119
118
  height: var(--sixb-reasoning-thumb-size);
120
119
  pointer-events: none;
121
- border: 1px solid rgb(0 0 0 / 0.1);
122
120
  border-radius: 9999px;
123
121
  background: white;
124
- box-shadow: var(--shadow-sm);
122
+ box-shadow:
123
+ 0 0 0 0.5px rgb(0 0 0 / 0.08),
124
+ 0 1px 3px rgb(0 0 0 / 0.16);
125
125
  transition: left var(--sixb-reasoning-motion);
126
126
  }
127
127
 
@@ -230,6 +230,36 @@
230
230
  }
231
231
  }
232
232
 
233
+ /* The composer's one surface: a hairline and a soft lift, no border. Focus darkens the hairline. */
234
+ .sixb-composer-surface {
235
+ box-shadow:
236
+ 0 0 0 1px rgb(0 0 0 / 0.06),
237
+ 0 1px 2px rgb(0 0 0 / 0.03),
238
+ 0 4px 16px rgb(0 0 0 / 0.035);
239
+ transition: box-shadow 200ms ease;
240
+ }
241
+
242
+ .sixb-composer-surface:focus-within {
243
+ box-shadow:
244
+ 0 0 0 1px rgb(0 0 0 / 0.1),
245
+ 0 1px 2px rgb(0 0 0 / 0.03),
246
+ 0 4px 16px rgb(0 0 0 / 0.045);
247
+ }
248
+
249
+ .sixb-composer-surface[data-dragging] {
250
+ box-shadow:
251
+ 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent),
252
+ 0 4px 16px rgb(0 0 0 / 0.045);
253
+ }
254
+
255
+ :is(.dark *).sixb-composer-surface {
256
+ box-shadow: 0 0 0 1px rgb(255 255 255 / 0.09);
257
+ }
258
+
259
+ :is(.dark *).sixb-composer-surface:focus-within {
260
+ box-shadow: 0 0 0 1px rgb(255 255 255 / 0.16);
261
+ }
262
+
233
263
  /* An image the agent is making: a soft glow drifting under a slow sheen, like a print developing. */
234
264
  @keyframes sixb-media-drift {
235
265
  from {
@@ -14,12 +14,11 @@ export const AGENT_APPROVAL_MODES = ["manual", "accept-edits", "auto"] as const
14
14
 
15
15
  export type AgentApprovalMode = (typeof AGENT_APPROVAL_MODES)[number]
16
16
 
17
- /**
18
- * The mode Shift+Tab switches to: between Manual and Accept edits only. Auto is chosen from the menu,
19
- * never reached by a key pressed in passing; from Auto, the key goes back to Manual.
20
- */
17
+ /** The mode Shift+Tab switches to: the next one, Manual to Accept edits to Auto and round again. */
21
18
  export function toggledApprovalMode(mode: AgentApprovalMode): AgentApprovalMode {
22
- return mode === "manual" ? "accept-edits" : "manual"
19
+ return AGENT_APPROVAL_MODES[
20
+ (AGENT_APPROVAL_MODES.indexOf(mode) + 1) % AGENT_APPROVAL_MODES.length
21
+ ]
23
22
  }
24
23
 
25
24
  /** From least to most allowed. */
@@ -9,6 +9,7 @@ import {
9
9
  } from "@sixb/ui/components"
10
10
  import { useIsMobile } from "@sixb/ui/hooks"
11
11
  import { cn } from "@sixb/ui/lib/utils"
12
+ import { ChevronLeft, X } from "lucide-react"
12
13
  import {
13
14
  createContext,
14
15
  memo,
@@ -40,15 +41,36 @@ import {
40
41
  } from "./artifact-panel-state"
41
42
  import { useAgentMessages } from "./i18n"
42
43
 
44
+ /**
45
+ * A place in the panel a part of the conversation fills itself, such as a sub-agent's thread: the
46
+ * panel draws its title and close, and the part renders into `slotHost` while it is the one open.
47
+ */
48
+ export interface SlotTarget {
49
+ readonly type: "slot"
50
+ readonly id: string
51
+ readonly title: string
52
+ /** A step back within the slot, such as from one sub-agent to all of them: an arrow before the title. */
53
+ readonly back?: { readonly label: string; readonly onBack: () => void }
54
+ }
55
+
56
+ export type PanelTarget = ViewerTarget | SlotTarget
57
+
58
+ /** Identity for "is this target the open one". */
59
+ export function panelTargetKey(target: PanelTarget): string {
60
+ return target.type === "slot" ? `slot:${target.id}` : viewerTargetKey(target)
61
+ }
62
+
43
63
  export interface ArtifactPanelValue {
44
64
  /** What is open, or null when nothing is. */
45
- readonly openTarget: ViewerTarget | null
65
+ readonly openTarget: PanelTarget | null
46
66
  /** The open target's identity, or null when nothing is open. */
47
67
  readonly openKey: string | null
48
- readonly open: (target: ViewerTarget) => void
68
+ readonly open: (target: PanelTarget) => void
49
69
  readonly close: () => void
50
70
  /** Where the panel opens: beside the conversation, over the app, or as a dialog. */
51
71
  readonly presentation: ArtifactPanelPresentation
72
+ /** The element an open slot renders into, once the panel has drawn it. */
73
+ readonly slotHost: HTMLElement | null
52
74
  }
53
75
 
54
76
  interface PanelHandle {
@@ -99,10 +121,11 @@ export function ArtifactPanelRoot({
99
121
  }: ArtifactPanelRootProps) {
100
122
  const messages = useAgentMessages().artifacts
101
123
  const idPrefix = useId()
102
- const [localTarget, setLocalTarget] = useState<ViewerTarget | null>(null)
103
- const target: ViewerTarget | null = routeTarget ?? localTarget
124
+ const [localTarget, setLocalTarget] = useState<PanelTarget | null>(null)
125
+ const target: PanelTarget | null = routeTarget ?? localTarget
104
126
  // What the reader followed a reference from, so the panel can take them back.
105
- const [trail, setTrail] = useState<readonly ViewerTarget[]>([])
127
+ const [trail, setTrail] = useState<readonly PanelTarget[]>([])
128
+ const [slotHost, setSlotHost] = useState<HTMLElement | null>(null)
106
129
  const presentation = artifactPanelPresentation({
107
130
  compact,
108
131
  isMobile: useIsMobile(),
@@ -122,7 +145,7 @@ export function ArtifactPanelRoot({
122
145
  }, [scopeKey])
123
146
 
124
147
  const show = useCallback(
125
- (next: ViewerTarget) => {
148
+ (next: PanelTarget) => {
126
149
  if (onRouteTargetChange && next.type === "artifact") {
127
150
  setLocalTarget(null)
128
151
  onRouteTargetChange(next)
@@ -134,9 +157,12 @@ export function ArtifactPanelRoot({
134
157
  [onRouteTargetChange, routeTarget]
135
158
  )
136
159
  const open = useCallback(
137
- (next: ViewerTarget) => {
160
+ (next: PanelTarget) => {
138
161
  const active = typeof document === "undefined" ? null : document.activeElement
139
- openerRef.current = active instanceof HTMLElement ? active : null
162
+ // A move within the open slot keeps where focus returns: what was clicked there goes next.
163
+ if (!(active instanceof HTMLElement && active.closest("[data-agent-slot-frame]"))) {
164
+ openerRef.current = active instanceof HTMLElement ? active : null
165
+ }
140
166
  setTrail([])
141
167
  show(next)
142
168
  reveal()
@@ -155,39 +181,43 @@ export function ArtifactPanelRoot({
155
181
  const value = useMemo<ArtifactPanelValue>(
156
182
  () => ({
157
183
  openTarget: target,
158
- openKey: target ? viewerTargetKey(target) : null,
184
+ openKey: target ? panelTargetKey(target) : null,
159
185
  open,
160
186
  close,
161
187
  presentation,
188
+ slotHost: target?.type === "slot" ? slotHost : null,
162
189
  }),
163
- [target, open, close, presentation]
190
+ [target, open, close, presentation, slotHost]
164
191
  )
165
- const viewer = target ? (
166
- <Viewer
167
- target={target}
168
- onTargetChange={show}
169
- onOpenReference={(next) => {
170
- setTrail((current) => [...current, target])
171
- show(next)
172
- }}
173
- chrome={{
174
- onClose: close,
175
- ...(trail.length > 0
176
- ? {
177
- onBack: () => {
178
- const previous = trail.at(-1)
179
- setTrail((current) => current.slice(0, -1))
180
- if (previous) show(previous)
181
- },
182
- }
183
- : {}),
184
- ...(target.type === "artifact" && pageLinks
185
- ? { fullPageHref: artifactTargetHref(target) }
186
- : {}),
187
- ...(pageLinks ? {} : { withoutPageLink: true }),
188
- }}
189
- />
190
- ) : null
192
+ const viewer =
193
+ target?.type === "slot" ? (
194
+ <SlotFrame title={target.title} back={target.back} onClose={close} hostRef={setSlotHost} />
195
+ ) : target ? (
196
+ <Viewer
197
+ target={target}
198
+ onTargetChange={show}
199
+ onOpenReference={(next) => {
200
+ setTrail((current) => [...current, target])
201
+ show(next)
202
+ }}
203
+ chrome={{
204
+ onClose: close,
205
+ ...(trail.length > 0
206
+ ? {
207
+ onBack: () => {
208
+ const previous = trail.at(-1)
209
+ setTrail((current) => current.slice(0, -1))
210
+ if (previous) show(previous)
211
+ },
212
+ }
213
+ : {}),
214
+ ...(target.type === "artifact" && pageLinks
215
+ ? { fullPageHref: artifactTargetHref(target) }
216
+ : {}),
217
+ ...(pageLinks ? {} : { withoutPageLink: true }),
218
+ }}
219
+ />
220
+ ) : null
191
221
 
192
222
  return (
193
223
  <ArtifactPanelContext.Provider value={value}>
@@ -195,7 +225,7 @@ export function ArtifactPanelRoot({
195
225
  <ArtifactWorkspace
196
226
  idPrefix={idPrefix}
197
227
  revealKey={
198
- presentation === "panel" && target ? `${viewerTargetKey(target)}:${revealCount}` : null
228
+ presentation === "panel" && target ? `${panelTargetKey(target)}:${revealCount}` : null
199
229
  }
200
230
  viewer={presentation === "panel" ? viewer : null}
201
231
  >
@@ -239,6 +269,52 @@ export function ArtifactPanelRoot({
239
269
  )
240
270
  }
241
271
 
272
+ /** The panel's frame for a slot: its title and close, and the element the slot renders into. */
273
+ function SlotFrame({
274
+ title,
275
+ back,
276
+ onClose,
277
+ hostRef,
278
+ }: {
279
+ readonly title: string
280
+ readonly back?: SlotTarget["back"]
281
+ readonly onClose: () => void
282
+ readonly hostRef: (element: HTMLElement | null) => void
283
+ }) {
284
+ const messages = useAgentMessages().artifacts
285
+ return (
286
+ <div data-agent-slot-frame="" className="flex h-full min-h-0 flex-col">
287
+ <div className={cn("flex h-12 shrink-0 items-center gap-1 pr-2", back ? "pl-2" : "pl-5")}>
288
+ {back ? (
289
+ <button
290
+ type="button"
291
+ onClick={back.onBack}
292
+ aria-label={back.label}
293
+ title={back.label}
294
+ className="flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40"
295
+ >
296
+ <ChevronLeft className="size-4" aria-hidden="true" />
297
+ </button>
298
+ ) : null}
299
+ <h2 className="min-w-0 flex-1 truncate text-sm font-semibold text-foreground">{title}</h2>
300
+ <button
301
+ type="button"
302
+ onClick={onClose}
303
+ aria-label={messages.close}
304
+ className="flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40"
305
+ >
306
+ <X className="size-4" aria-hidden="true" />
307
+ </button>
308
+ </div>
309
+ <div
310
+ ref={hostRef}
311
+ data-agent-slot=""
312
+ className="scrollbar-thin min-h-0 flex-1 overflow-y-auto px-5 pb-6"
313
+ />
314
+ </div>
315
+ )
316
+ }
317
+
242
318
  /**
243
319
  * Escape in a deck's overview or presentation takes the deck back to its slide; only then does it
244
320
  * close the dialog. The dialog hears Escape first, on the document, before the deck does.
@@ -4,7 +4,7 @@ import { useAgentMessages } from "../i18n"
4
4
  import { type AgentMessages, en } from "../i18n/en"
5
5
 
6
6
  export const ACTIVITY_STATUS_ROW_CLASS_NAME =
7
- "group flex w-fit max-w-full items-center gap-1.5 rounded-md px-1 py-0.5 text-[13px] leading-normal text-muted-foreground"
7
+ "group -ml-1 flex w-fit max-w-full items-center gap-1.5 rounded-md px-1 py-0.5 text-[13px] leading-normal text-muted-foreground"
8
8
 
9
9
  interface ActivityStatusStep {
10
10
  readonly afterMs: number