Skip to content

ToolItems

type ToolItems = {
emit: (item) => void;
latest: (itemType, key?) =>
| {
data: unknown;
}
| undefined;
list?: () => EmittedItem[];
};

Defined in: shared/src/tool/tool.ts:30

Read/write access to the conversation’s items for the duration of a call. latest resolves the current version of an identity (itemType + key); emit appends a new version; list enumerates the current version of every item. list is what lets a transport (e.g. HTTP) forward the caller’s item state so latest resolves the same on the far side as it does in-process.

emit: (item) => void;

Defined in: shared/src/tool/tool.ts:32

Parameter Type
item EmittedItem

void


latest: (itemType, key?) =>
| {
data: unknown;
}
| undefined;

Defined in: shared/src/tool/tool.ts:31

Parameter Type
itemType string
key? string

| { data: unknown; } | undefined


optional list?: () => EmittedItem[];

Defined in: shared/src/tool/tool.ts:33

EmittedItem[]