返回 DeepSeek-Reasonix
composerInvocationIdentity.ts
根目录 / desktop / frontend / src / lib / composerInvocationIdentity.ts
1 import type { ComposerInvocation } from "./invocationDisplay";
2
3 let nextID = 1;
4 export function newComposerInvocationID(invocations: ComposerInvocation[]): string {
5 // Persisted inputs can contain IDs allocated by a previous renderer.
6 let id: string;
7 do { id = `invocation-${nextID++}`; }
8 while (invocations.some(item => item.id === id));
9 return id;
10 }
11
11 lines TYPESCRIPT