{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://truleaf.org/fields/data-formats/1.0.0/kwau-conversations.schema.json","title":"Kwáu conversation line (kwau/conversations.ndjson)","description":"One NDJSON line per message of the workspace's threads: text is the answer's content object, citations are {kind, title, href}, user lines carry a per-bundle authorRef pseudonym (a recap, written by Kwáu, adds generated_by \"kwau\"), assistant lines carry generated_by \"kwau\" and model. Never a user id, name, payer, thinking, provider content, raw tool inputs or tool results.","type":"object","oneOf":[{"type":"object","additionalProperties":false,"required":["threadId","seq","createdAt","text","toolCalls","citations","role","authorRef"],"properties":{"threadId":{"type":"string","format":"uuid"},"seq":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"text":{"$ref":"#/$defs/ui_content"},"toolCalls":{"type":"array","items":{"$ref":"#/$defs/tool_call"},"maxItems":0},"citations":{"type":"array","items":{"$ref":"#/$defs/citation"}},"role":{"type":"string","const":"user"},"authorRef":{"type":"string","pattern":"^author-[0-9]{2,}$","description":"Pseudonymous author, numbered per export call."},"generated_by":{"type":"string","const":"kwau","description":"Present on a recap: Kwáu wrote this line at the start of a continued thread; the person did not type it."}}},{"type":"object","additionalProperties":false,"required":["threadId","seq","createdAt","text","toolCalls","citations","role","generated_by","model"],"properties":{"threadId":{"type":"string","format":"uuid"},"seq":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"text":{"$ref":"#/$defs/ui_content"},"toolCalls":{"type":"array","items":{"$ref":"#/$defs/tool_call"}},"citations":{"type":"array","items":{"$ref":"#/$defs/citation"}},"role":{"type":"string","const":"assistant"},"generated_by":{"type":"string","const":"kwau"},"model":{"type":["string","null"],"description":"Model that wrote the turn; null when unknown."}}}],"$defs":{"ui_content":{"type":"object","additionalProperties":false,"description":"Text blocks of all assistant rounds of the turn in order, tool calls, overlay previews and notices.","required":["blocks","tools","overlays","notices"],"properties":{"blocks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["text","citations"],"properties":{"text":{"type":"string"},"citations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","kind","title","citedText","href"],"properties":{"index":{"type":"integer","minimum":1},"kind":{"type":"string","description":"The kind of source cited.","enum":["parcel_index","overlay","weather","spray","sensor","alert","observation","crop","plant","guide","insight","agronomy","parcel"]},"title":{"type":"string"},"citedText":{"type":"string","maxLength":200},"href":{"type":"string","description":"Server-resolved link of a citation: an app route `{l}/fields/app/o/…` or a `https://truleaf.org{l}/(plants|guides|insights)/…` page, where `{l}` is empty for en-US and `/<locale>` otherwise. No other host or scheme is ever written.","pattern":"^(?:(?:/[a-z]{2}-[A-Z]{2})?/fields/app/o/|https://truleaf\\.org(?:/[a-z]{2}-[A-Z]{2})?/(?:plants|guides|insights)/)\\S*$"},"attribution":{"type":"array","description":"Data attribution keys, for instance copernicus_s2 or open_meteo.","items":{"type":"string"}}}}}}}},"tools":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["toolCallId","tool","status"],"properties":{"toolCallId":{"type":"string","format":"uuid"},"tool":{"type":"string","description":"The tool the assistant called.","enum":["get_fields","get_index_history","get_overlay","get_weather","get_spray_window","get_sensor_series","get_crop_profile","search_truleaf_knowledge","log_observation"]},"status":{"type":"string","description":"How the tool call finished.","enum":["ok","error","denied","pending_confirmation"]},"target":{"type":"string","minLength":1,"maxLength":80,"description":"Optional: the parcel name the call reads or the get_fields search phrase; never an id, model prose or another workspace's data."},"scope":{"type":"object","additionalProperties":false,"description":"Optional: the range a tool call covers.","properties":{"index":{"type":"string","enum":["ndvi","savi","msavi2","evi","ndre","cire","ndmi","gndvi","ndwi"]},"overlay":{"type":"string","enum":["index","true_color","zones"]},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"date":{"type":"string","format":"date"},"daysBack":{"type":"integer","minimum":0,"maximum":30},"daysAhead":{"type":"integer","minimum":0,"maximum":10},"hoursAhead":{"type":"integer","minimum":1,"maximum":72},"granularity":{"type":"string","enum":["hourly","daily"]},"attention":{"type":"boolean"},"compare":{"type":"string","enum":["prev_season","farm_median"]}}},"summary":{"type":"object","additionalProperties":false,"description":"Optional: counts and dates of what a successful call returned.","properties":{"count":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"date":{"type":"string","format":"date"}}},"latencyMs":{"type":"integer","minimum":0},"card":{"type":"object","additionalProperties":false,"description":"Optional: the structured data of a successful call that the answer shows as a card (an index trend chart, a spray-window strip). Built by the server from the tool's own JSON result for the thread's scope, never from model text; the model sees the same values. index_trend (get_index_history) carries index, the values or the no-values reason; spray_window (get_spray_window) carries the runs of equal verdict, issuedAt and the field's time zone. No card for other tools. Absent when the result has no usable shape.","required":["kind","orgId","parcelId"],"properties":{"kind":{"type":"string","enum":["index_trend","spray_window"]},"orgId":{"type":"string","format":"uuid"},"parcelId":{"type":"string","format":"uuid"},"index":{"type":"string","description":"The satellite index.","enum":["ndvi","savi","msavi2","evi","ndre","cire","ndmi","gndvi","ndwi"]},"reason":{"type":"string","enum":["too_small","covered","pending","backfilling"],"description":"Why index_trend has no values."},"trendOnly":{"type":"boolean","description":"index_trend of a trend-only field (whole-field values, no within-field detail)."},"points":{"type":"array","maxItems":90,"description":"index_trend usable observations, oldest first.","items":{"type":"object","additionalProperties":false,"required":["date","mean"],"properties":{"date":{"type":"string","format":"date"},"mean":{"type":"number"},"p10":{"type":["number","null"]},"p90":{"type":["number","null"]}}}},"weekly":{"type":"array","maxItems":60,"description":"index_trend weekly smoothed series, oldest first.","items":{"type":"object","additionalProperties":false,"required":["date","value"],"properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}}}},"compare":{"type":"object","additionalProperties":false,"required":["kind","points"],"properties":{"kind":{"type":"string","enum":["prev_season","farm_median"]},"points":{"type":"array","maxItems":120,"items":{"type":"object","additionalProperties":false,"required":["date","value"],"properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}}}}}},"changePct":{"type":"number","description":"index_trend latest observation against the median of the 14 days before it, in percent."},"truncated":{"type":"boolean"},"runs":{"type":"array","maxItems":72,"description":"spray_window runs of consecutive hours with an equal verdict, in time order.","items":{"type":"object","additionalProperties":false,"required":["from","to","verdict","reasons"],"properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"verdict":{"type":"string","description":"The spray verdict of this run.","enum":["good","marginal","bad","unknown"]},"reasons":{"type":"array","maxItems":13,"items":{"type":"string","description":"A reason for the verdict.","enum":["wind_low","wind_high","gust_high","gust_unknown","delta_t_low","delta_t_high","rain_expected","rain_recent","temp_high","warning_active","data_missing","inversion_risk","temp_low"]}}}}},"issuedAt":{"type":"string","format":"date-time","description":"spray_window forecast issue time."},"tz":{"type":"string","minLength":1,"maxLength":64,"description":"spray_window the field's IANA time zone, for local hours."}}}}}},"overlays":{"type":"array","items":{"type":"object","additionalProperties":false,"description":"event: overlay. A render key for the overlay preview (getParcelOverlay); never a signed link.","required":["toolCallId","parcelId","orgId","overlayRef","date","kind","index"],"properties":{"toolCallId":{"type":"string","format":"uuid"},"parcelId":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"overlayRef":{"type":"string","pattern":"^sat:","description":"sat:<parcelId>:<kind>:<index or none>:<date>"},"date":{"type":"string","format":"date"},"kind":{"type":"string","enum":["index","true_color","zones"]},"index":{"oneOf":[{"type":"string","description":"The satellite index.","enum":["ndvi","savi","msavi2","evi","ndre","cire","ndmi","gndvi","ndwi"]},{"type":"null"}]}}}},"notices":{"type":"array","items":{"type":"string","description":"The kind of notice shown with the answer.","enum":["dose_disclaimer","claim_disclaimer"]}}}},"tool_call":{"type":"object","additionalProperties":false,"required":["name","status"],"properties":{"name":{"type":"string","enum":["get_fields","get_index_history","get_overlay","get_weather","get_spray_window","get_sensor_series","get_crop_profile","search_truleaf_knowledge","log_observation"]},"status":{"type":"string","enum":["ok","error","denied","pending_confirmation"]}}},"citation":{"type":"object","additionalProperties":false,"required":["kind","title","href"],"properties":{"kind":{"type":"string"},"title":{"type":"string"},"href":{"type":"string","description":"Server-resolved link of a citation: an app route `{l}/fields/app/o/…` or a `https://truleaf.org{l}/(plants|guides|insights)/…` page, where `{l}` is empty for en-US and `/<locale>` otherwise. No other host or scheme is ever written.","pattern":"^(?:(?:/[a-z]{2}-[A-Z]{2})?/fields/app/o/|https://truleaf\\.org(?:/[a-z]{2}-[A-Z]{2})?/(?:plants|guides|insights)/)\\S*$"}}}}}