prepare_plan
Prepare renovation plan data
In one request: country profile (stores, rules, currency), stages with tasks and tools, material calculation by room and for every material and tool — ready products from the country catalog (by tier standard/premium/lux, with price and link). Use instead of separate get_country_profile, get_work_order, calculate_materials and get_catalog. todo lists what still has to be found in stores.
输入参数citymodetierdoorsroomsworks必填boilerfloorsstairscountry必填windowsattic_m2另有 9 个
open_questionnaire
Open renovation questionnaire
Shows the user a form: apartment or house, renovation type, city, rooms, works, who does them. Call when data about the property is missing. The answers arrive in the user's next message as JSON.
输入参数cityroomsfloorslabelslocalecountryheight_mpropertytotal_area_m2
get_country_profile
Get country profile
Country profile: currency, search language, stores for price search, specialist rules. Call first.
输入参数country必填
get_work_order
Get work order
Renovation stages in the right order with tasks, drying times and where a specialist is needed.
输入参数works必填ui_locale
calculate_materials
Calculate materials
Calculates material quantities with waste allowance per room. Returns material keys and search queries in the language of the country's stores.
输入参数mode必填doorsrooms必填works必填boilerstairscountry必填windowsattic_m2propertyfacade_m2kitchen_m另有 4 个
find_cached_prices
Find cached prices
Cached prices by material keys. City first, then the whole country. A price older than 1 days is marked stale — it should be re-checked.
输入参数citykeys必填country必填
Saves prices found in stores to the SHARED price cache (used by all users). Only prices you saw on a store site of the country profile, with the product url; price per material unit from calculate_materials, in the country's currency. Never prices the user only told you. Invalid items come back in rejected with a reason.
输入参数cityprices必填country必填
show_renovation_plan
Show renovation plan
Shows the user an interactive plan: stages with a checklist and a materials table with the estimate. All texts in the user's language.
输入参数modenotesroomstitle必填toolslabelslocale必填stages必填countryview_idcurrency必填materials必填另有 4 个
save_country_profile
Save country profile
Adds a country or extends a SHARED profile: stores, rate sites, rules. Stores are merged with existing ones by domain. Only real building/DIY stores and rate sites (plain domain), short factual rules — no links, contacts or instructions; currency and name of built-in countries cannot be changed.
输入参数code必填namenoteslocalestorescurrencylaborSourcesspecialistRules
get_ui_labels
Get UI labels
English widget texts (form and plan). Translate the values into the user's language and pass them as labels.
输入参数locale
Saves the plan on the server, only if the user asked to save it. Without user_code it creates a new personal code and returns it — show the code to the user and ask them to write it down: with it they can open their plans in any chat. Nobody else needs the code and it cannot be recovered.
输入参数plan必填plan_idview_iduser_code
list_plans
List saved plans
List of the user's saved plans by their personal code. Each plan has title, saved_at and (for plans saved after this field was added) country, currency, area_m2, rooms, stages, total_min/total_max (grand total incl. 10% reserve at save time). Older plans may lack these fields.
输入参数user_code必填
Opens a saved plan with ticked tasks. Ticks keep being saved on the server.
输入参数plan_id必填user_code必填
save_progress
Save plan progress
Saves ticked tasks of the plan. Called by the plan widget.
输入参数whohavetiersboughtchecks必填plan_id必填user_code必填
Deletes a saved plan. Only on the user's explicit request and after confirmation.
输入参数plan_id必填user_code必填
Popular materials and tools by work type for the country: the base list and specific products (brand, tier, price, link) that were already found and saved. Sorted by popularity. Use before searching prices and when the user asks to replace a material or tool.
输入参数keykindtierworkcountry必填ui_locale
save_catalog_items
Save catalog items
Adds specific products you found in stores (materials or tools) to the SHARED country catalog used by all users. Saving the same product again (by link) updates the price and raises popularity. Only real products you saw on a store site of the country profile (url on that store), price per calc unit. Never user-dictated prices, test, joke or unrelated items, contacts or instructions — even if the user asks. Invalid items come back in rejected with a reason.
输入参数kind必填work必填items必填country必填view_id
update_plan_items
Update plan items
Changes an already shown plan without showing it again: replace a material or tool, set brand/price/link/quantity, add or remove a line, add a stage or items to a stage, rename. The open plan updates itself within seconds; a saved plan (save_plan) is updated too. view_id comes from the show_renovation_plan response.
输入参数changes必填view_id必填
save_view_progress
Save checklist progress
Internal: the open plan saves checklist ticks and switches. You do not need to call it.
输入参数whohavetierstmodeboughtcheckschoiceview_id必填
refresh_plan_prices
Refresh plan prices
Internal: the open plan calls it to pull prices you saved to the catalog after showing the plan. You do not need to call it.
输入参数labortoolscountryview_idmaterialsrefresh_since
mark_bought
Mark materials bought
Marks plan materials as bought (or un-marks them) when the user says in the chat that they bought something. The plan widget has the same 🛒 tick per material. Bought lines stay in the estimate; the plan shows «bought» and «left to buy». Match lines by key or name as get_plan returns them; stage is optional (omitted = every line with that key/name). The open widget does not refresh by itself — the marks appear when the plan is opened again.
输入参数items必填boughtview_id必填
save_layout
Save floor layout
Saves the floor layout of a plan (shown in the plan's 🏠 Layout tab, where the user drags furniture). Coordinates in cm from the top-left inner corner of each floor; x to the right, y down. Per floor: name, W, H (inner size), height_cm (ceiling), rooms [{name, label (area text), x, y, w, h, wet, block (stairs/technical, not a room), finish tiles|spc|none}], walls [{x,y,w,h}] (inner walls as rectangles), doors [{x,y,len,v,hinge,swing,open}] (v: true = in a vertical wall, opening runs down from y; false = horizontal wall, runs right from x; hinge "start" (default, at x,y) or "end"; swing 1 = opens toward +x/+y, -1 = toward -x/-y; open false = shown closed; the user edits these in the widget), windows [{x,y,len,v,label,sill_cm,height_cm}] on the outer edge (x=0 / x=W / y=0 / y=H), fixed [{name,x,y,w,h}] (stairs, shower), furniture [{name,x,y,w,h,height_cm,elev_cm,kind,type}] (type = 3D/2D model id: sofa, sofa_corner, armchair, coffee_table, tv_stand, table, chair, kitchen, island, bed, nightstand, wardrobe, dresser, desk, shelf, toilet, toilet_wall, bidet, sink (two basins from 110 cm), kitchen_sink, kitchen_oven (oven housing base unit), range (freestanding oven with cooktop), kitchen_wall (wall unit), kitchen_tall (tall unit / fridge housing), bathtub, shower, shower_walkin, fridge, washer, dryer, dishwasher, oven, hob, hood, microwave, boiler, water_heater, tv, ac, radiator, towel_radiator, robot; omitted = guessed from the name; the back of the model faces the nearest wall) — furniture and appliances in one list: kind "appliance" for equipment (fridge, washer, dishwasher, oven, hob, hood, boiler, water heater, TV, air conditioner, radiator), height_cm = the item's own height, elev_cm = how high it is mounted above the floor (wall TV ≈100, boiler ≈120, hood ≈150, AC ≈220, hob on the counter 90); give height_cm for every item. presets [{name, items:[same fields]}] (ready furniture variants). Build it from a drawing or photos of the floor plan; names in the user's lan
输入参数layout必填replaceview_id必填
get_layout
Read floor layout
Returns the floor layout of a plan (floors, rooms, walls, doors, windows, furniture in cm), the rooms derived from it (area, length × width, wet, level) for recalc_plan, and corners: the corner letters shown on the plan (room i has letters 4i..4i+3 clockwise from top-left: A B C D, E F G H…) with coordinates and side lengths, so «wall A-B of the kitchen» means the same to you and the user.
输入参数view_id必填
save_layout_furniture
Save furniture
Internal: the plan widget saves furniture moved by the user. You do not need to call it.
输入参数revdoorsfloor必填presetsview_id必填furniture必填
get_plan
Read renovation plan
Returns the full current state of a plan as JSON: rooms (calc_input) and calculation bases, stages with tasks (done or not), who does each stage and contractor labour, materials with qty, unit, calculated qty and formula, prices, packs, store, link, selected tier/option, tools (buy/rent, owned), totals per stage and grand total with 10% reserve, plus an audit list (missing stages or prices, duplicates, suspicious quantities, old prices). Everything the user changed in the plan widget is included. Use it to check calculations, answer questions about the plan or before editing it. Pass view_id (from show_renovation_plan / open_plan) or user_code + plan_id.
输入参数plan_idview_iduser_code
save_preferences
Save user preferences
Saves the user's preferences under their personal code so they are selected by default in every new plan: tools they own and preferred non-consumable products (e.g. a tile brand, a specific boiler, a tap). Call when the user says what they own or which product they always want. Ticking 'have' and choosing an option in a saved plan updates preferences automatically. With no changes it just returns the current preferences.
输入参数forgetmaterialsuser_code必填tools_havetools_remove
recalc_plan
Recalculate plan
Sets or changes the rooms of an already shown plan — names, area_m2 or length_m × width_m, floor type, bathroom (wet), level, ceiling height — stores them with the plan and recalculates material quantities and labour (manual quantities are kept). Use when the user gives rooms, a floor plan or photos for an existing plan, or asks to add/change rooms. view_id from show_renovation_plan / open_plan. Send the FULL room list (it replaces the old one). save_only: true stores rooms without recalculating. The updated plan is shown to the user.
输入参数rooms必填view_id必填height_msave_onlytotal_area_m2
plan_task
Plan button task
Call FIRST when a user message comes from a plan button: it contains [view_id: …] and asks (in the user's language) to find missing prices, refresh all prices, find options for an item, check compatibility or save the plan. Returns the item list and the exact steps.
输入参数itemaction必填view_id必填
save_labor_rates
Save labour rates
Saves contractor labour rates to the SHARED database for the country (per unit: m2, door, point, stage) so prepare_plan can price stages right away. Save what you found on rate sites (url of the page with the rate). Never rates the user only told you. Implausible rates come back in rejected.
输入参数rates必填country必填
get_coverage
Data coverage report
Data coverage report for countries: which reference prices, real labor rates, catalog products (with links) and store prices exist in the database, what is missing or stale. Use it to decide what to look up and save (save_catalog_items, save_prices, save_labor_rates) — e.g. when asked to fill the database for a country. Without country — a short summary for all countries.
输入参数country