File tree Expand file tree Collapse file tree
packages/workflow-code/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,9 +156,15 @@ export interface MothershipStreamV1ToolResultPayload extends StreamToolReplay {
156156}
157157
158158/** A subagent lane opens (`data: {name}`) or closes (`data: {error}` when it failed). */
159+ /** A subagent lane's display title (on start) or failure (on end). */
160+ export interface MothershipStreamV1SubagentSpanData {
161+ name ?: string ;
162+ error ?: string ;
163+ }
164+
159165export interface MothershipStreamV1SubagentSpanPayload {
160166 agent ?: string ;
161- data ?: unknown ;
167+ data ?: MothershipStreamV1SubagentSpanData ;
162168 event : "start" | "end" ;
163169 kind : "subagent" ;
164170}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type {
44 MothershipStreamV1EventEnvelope ,
55 MothershipStreamV1StreamRef ,
66 MothershipStreamV1StreamScope ,
7+ MothershipStreamV1SubagentSpanData ,
78 MothershipStreamV1Trace ,
89} from '@/lib/mothership/generated/mothership-stream-v1'
910import {
@@ -438,7 +439,8 @@ export function isSubagentSpanStreamEvent(
438439}
439440
440441/** What a subagent span's `data` carries: the lane `name` on start, its `error` on a failed end. */
441- export function subagentSpanData ( data : unknown ) : { name ?: string ; error ?: string } {
442+ /** Reads a subagent span's untrusted `data`, keeping only non-empty string fields. */
443+ export function subagentSpanData ( data : unknown ) : MothershipStreamV1SubagentSpanData {
442444 if ( ! isRecordLike ( data ) ) return { }
443445 return {
444446 ...( typeof data . name === 'string' && data . name ? { name : data . name } : { } ) ,
Original file line number Diff line number Diff line change 33 */
44
55import { expectLinearGrowth } from '@sim/testing/helpers/scaling'
6- import { describe , expect , it } from 'vitest'
6+ import { describe , it } from 'vitest'
77import { TEST_CATALOG } from '../compile/catalog.test-helpers'
88import { buildFieldIndex } from './surface'
99import type { CatalogBlock , CatalogSubBlock } from './types'
Original file line number Diff line number Diff line change 33 */
44
55import { expectLinearGrowth } from '@sim/testing/helpers/scaling'
6- import { describe , expect , it } from 'vitest'
6+ import { describe , it } from 'vitest'
77import { stronglyConnected } from './edges'
88
99describe ( 'compile scaling' , ( ) => {
Original file line number Diff line number Diff line change 33 */
44
55import { expectLinearGrowth } from '@sim/testing/helpers/scaling'
6- import { describe , expect , it } from 'vitest'
6+ import { describe , it } from 'vitest'
77import { compareEdges } from '../canonicalize/edges'
88import { compileWorkflow } from '../compile'
99import { TEST_CATALOG } from '../compile/catalog.test-helpers'
You can’t perform that action at this time.
0 commit comments