/** * Reading a field out of JSON that has not finished arriving. * * A model writes a file in one tool call, and that call's arguments stream in over several seconds. * Reporting only the completed call meant the panel showed a file *after* it was written — the work * was over by the time there was anything to look at, which is the opposite of watching it happen. * * `JSON.parse` cannot help with a fragment: `{"path":"a.ts","content":"line one\\nline t` is not * JSON and never will be until the rest turns up. So this walks the one value it was asked for and * decodes exactly as much as has arrived, which is enough to paint. * * Done here rather than in the browser for two reasons. It is testable — the client is a template * string and cannot be imported by a test — and it means the event carries the fields themselves * rather than a JSON fragment for the page to pick apart, which is both smaller and one less place * for a half-escaped sequence to end up in the DOM. */ /** * As much of a string field as has arrived, or null when the field has not started. * * Null and empty string are different answers: null means "this field is not here yet", and empty * means "it is here and so far it is empty". A caller waiting for content to paint needs to tell * those apart, or it paints an empty panel the moment the key appears. */ export declare function partialString(json: string, field: string): string | null; /** The first of several field names that has started arriving. */ export declare function partialAny(json: string, fields: readonly string[]): string | null; /** The path and content of a write, as far as either has arrived. */ export interface PartialWrite { path: string | null; content: string | null; } /** * What a streaming write is about. * * The field names are the ones the file tools actually use — a model may be talking to `write_file` * or an edit tool, and the value to show is whichever of them is present. */ export declare function partialWrite(json: string): PartialWrite; //# sourceMappingURL=partial-json.d.ts.map