Function: collectArtifactCompatibleIds()
ts
function collectArtifactCompatibleIds(
ctx: {
turnRetrievables: Iterable<{
content: unknown;
id: string;
inline: boolean;
}>;
turnToolCalls: Iterable<{
fromArtifactTool?: boolean;
id: string;
results: unknown;
}>;
},
requires: SpooledArtifactConstructor,
): string[];Defined in: src/lib/classes/spooled_artifact.ts:79
Collect artifact IDs from the current turn's tool calls and retrievables that are instances of a specific artifact class.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | { turnRetrievables: Iterable<{ content: unknown; id: string; inline: boolean; }>; turnToolCalls: Iterable<{ fromArtifactTool?: boolean; id: string; results: unknown; }>; } | The dispatch context containing tool calls and retrievables. |
ctx.turnRetrievables | Iterable<{ content: unknown; id: string; inline: boolean; }> | - |
ctx.turnToolCalls | Iterable<{ fromArtifactTool?: boolean; id: string; results: unknown; }> | - |
requires | SpooledArtifactConstructor | The artifact class constructor to filter by. |
Returns
string[]
An array of unique artifact IDs matching the specified class, with collision detection.
Throws
@nhtio/adk!E_ARTIFACT_ID_COLLISION when the same ID appears in both tool calls and retrievables.