Streaming and activity
A node's live event stream and the activity feed built on top of it.
Exports of @north-light/crouter-sdk, read from the TypeScript compiler at build time. Types re-exported from @north-light/crouter-api are documented with that package.
ActivityStep
interface declared in resources/activity.ts
One tool call rendered as an activity step.
Prop
Type
DescribeTool
type declared in resources/activity.ts
Turn a streamed tool call into a label, or return null to omit it.
(tool: string, summary: string) => string | nulldescribeToolDefault
variable declared in resources/activity.ts
Plain labels for the tools every node can use.
(tool: string, summary: string) => string | nullfollowActivity
function declared in resources/activity.ts
Yield an immutable activity snapshot after every streamed tool-call change.
(stream: AsyncIterable<NodeStreamEvent>, options?: { describe?: DescribeTool; }) => AsyncGenerator<ActivityStep[]>NodeEventsOptions
interface declared in types.ts
Options for an existing node's event stream. Streams have no wall-clock timeout.
Prop
Type
NodeStream
class declared in resources/node-stream.ts
A parsed node event stream. Aborting it disconnects this observer, not the node.
Prop
Type
NodeStreamEvent
type declared in resources/node-stream.ts
One event from a node's stream.
import("@north-light/crouter-api").NodeEventErrorDTO | import("@north-light/crouter-api").NodeOutputTextDeltaDTO | import("@north-light/crouter-api").NodeOutputTextDoneDTO | import("@north-light/crouter-api").NodeReportPushedDTO | import("@north-light/crouter-api").NodeSettledDTO | import("@north-light/crouter-api").NodeStatusChangedDTO | import("@north-light/crouter-api").NodeToolCallCompletedDTO | import("@north-light/crouter-api").NodeToolCallStartedDTO | import("@north-light/crouter-api").NodeTurnCompletedDTO | import("@north-light/crouter-api").NodeTurnStartedDTONodeStreamEventListener
type declared in resources/node-stream.ts
A listener for one event type, receiving only that type's event.
(event: Extract<NodeStreamEvent, { type: T; }>) => voidNodeStreamEventType
type declared in resources/node-stream.ts
The type discriminant of a stream event, and the name on and off take.
"error" | "node.output_text.delta" | "node.output_text.done" | "node.report.pushed" | "node.settled" | "node.status.changed" | "node.tool_call.completed" | "node.tool_call.started" | "node.turn.completed" | "node.turn.started"