Assistant house style: a drawing-convention text every AI assistant reads

QetSettings::houseStyle()/setHouseStyle() (assistant/house_style),
qet.houseStyle()/qet.setHouseStyle() in the script API, a house_style
field in qet-assistant.json, and qet_about in the qet MCP server
showing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-05 18:32:42 +13:00
parent a5cd68ced5
commit 44dfb9d8d5
7 changed files with 91 additions and 4 deletions
+8 -1
View File
@@ -111,7 +111,14 @@ void write()
{QStringLiteral("stored_scripts"), scripts},
{QStringLiteral("refused_scripts"), refused},
{QStringLiteral("recordings"), MacroRecorder::recordings()},
{QStringLiteral("live"), s_live.isEmpty() ? QJsonValue() : QJsonValue(s_live)}};
{QStringLiteral("live"), s_live.isEmpty() ? QJsonValue() : QJsonValue(s_live)},
// Free-text drawing conventions, set once by the user
// (QetSettings::setHouseStyle(), qet.setHouseStyle()) and read
// by any assistant that connects, live or headless, without it
// having to ask the user or guess. Null, not "", when unset --
// the two mean different things to a reader.
{QStringLiteral("house_style"), QetSettings::houseStyle().isEmpty()
? QJsonValue() : QJsonValue(QetSettings::houseStyle())}};
const QString file_path = path();
QDir().mkpath(QFileInfo(file_path).path());
+27
View File
@@ -44,6 +44,7 @@
#include "../conductorsegment.h"
#include "../conductorrouter.h"
#include "../qetgraphicsitem/diagramimageitem.h"
#include "../utils/qetsettings.h"
// See diagrameventaddpdf.h: a missing QtPdf module (or Qt < 6.4) is not
// fatal at build time, so addPdfPage() is always declared -- a script
@@ -4200,6 +4201,32 @@ QStringList QetScriptApi::folioPresets() const
return names;
}
/**
@brief QetScriptApi::houseStyle
This installation's drawing conventions (grid, flow direction, routing,
tagging, grouping, ...), as free text the user wrote once. Empty when
nobody has set any. Not project-scoped: the same text for every
project this QElectroTech opens, same as liveAssistantEnabled().
@return the text
*/
QString QetScriptApi::houseStyle() const
{
return QetSettings::houseStyle();
}
/**
@brief QetScriptApi::setHouseStyle
Write the installation's drawing conventions. Always succeeds (a plain
setting, not project data, so there is nothing here to refuse); @return
is for a consistent call shape with the rest of the API.
@param text
*/
bool QetScriptApi::setHouseStyle(const QString &text)
{
QetSettings::setHouseStyle(text);
return true;
}
/**
@brief QetScriptApi::setFolioBorder
Change one field of a folio's frame through ChangeBorderCommand, as the
+5
View File
@@ -567,6 +567,11 @@ class QetScriptApi : public QObject
Q_INVOKABLE bool setFolioBorder(int folioIndex, const QString &property, const QString &value);
Q_INVOKABLE QStringList folioPresets() const;
// -- this installation's drawing conventions (grid, flow, routing, tagging, --
// -- grouping, ...), free text, for every assistant that connects to read --
Q_INVOKABLE QString houseStyle() const;
Q_INVOKABLE bool setHouseStyle(const QString &text);
// -- the conductor defaults of a folio (Folio properties > Conductors),
// or with folioIndex -1, the project's defaults for new folios --
Q_INVOKABLE QString conductorDefault(int folioIndex, const QString &property) const;
+17
View File
@@ -173,6 +173,23 @@ namespace QetSettings
settings.setValue("scripting/live_assistant", enabled);
}
/**
* @brief houseStyle
* @return this installation's drawing conventions, in the user's own
* words -- empty when nobody has set any.
*/
QString houseStyle()
{
QSettings settings;
return settings.value("assistant/house_style", QString()).toString();
}
void setHouseStyle(const QString &text)
{
QSettings settings;
settings.setValue("assistant/house_style", text);
}
/**
* @brief setSheetBackground
* Store the sheet background last picked in the diagram editor, so the
+10
View File
@@ -41,6 +41,16 @@ namespace QetSettings
bool liveAssistantEnabled();
void setLiveAssistantEnabled(bool enabled);
/**
@brief Free-text drawing conventions for this installation (grid,
flow direction, routing, tagging, grouping, ...), written once by
the user and read by every AI assistant that connects -- live or
headless -- through qet-assistant.json and qet.houseStyle().
Empty when never set.
*/
QString houseStyle();
void setHouseStyle(const QString &text);
/**
@brief The sheet (folio) background the diagram editors draw.