Agents and scripts: Configure, Configuration Column, Row and Rule describe their exact parameters and reply (#11895) (#11896)

* claim: #11895

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Configuration table: input and output schemas for Configure, Configuration Column, Row and Rule (#11895)

describe_command now gives the exact parameters and reply of the four
commands that change a design's configuration table, and the warn and
strict parameter checks use them. The handlers read their parameters
from the raw JSON, so the new contracts in schema/config.rs read each
key as its handler does, with its message: lists of names as
params::string_list (whose json_brief and MAX_STRING_LIST become
pub(crate)), exactly one column target, faces picked or a face column's
key, a row's cells, and rules (whose schema describes them; the handler
keeps its own check). What only the design can answer stays the
handler's. All four reply with ConfigTableReply, as config.table does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
austin62jake
2026-11-04 18:19:35 +00:00
committed by GitHub
parent a3f293c987
commit 80889762ce
5 changed files with 652 additions and 17 deletions
+29 -5
View File
@@ -7,15 +7,27 @@ use solidcraft_doc::config::{Column, ConfigRow, MAX_COLUMNS, MAX_ROWS};
use super::CommandSpec;
use crate::params::{bad, bool_, str_, string_list};
use crate::schema::config::{ConfigActivation, ConfigRowParams, ConfigTable, ConfigTableParams, ConfigTableReply, ConfigTableRow, ConfigTarget};
use crate::schema::config::{
ConfigActivation, ConfigColumnParams, ConfigConfigureParams, ConfigRowEditParams, ConfigRowParams, ConfigRuleParams, ConfigTable,
ConfigTableParams, ConfigTableReply, ConfigTableRow, ConfigTarget,
};
use crate::schema::{TypedContract, output_schema_for};
use crate::{Result, Session};
const TABLE_CONTRACT: TypedContract<ConfigTableParams> = TypedContract::new();
const ROW_CONTRACT: TypedContract<ConfigRowParams> = TypedContract::new();
const CONFIGURE_CONTRACT: TypedContract<ConfigConfigureParams> = TypedContract::new();
const COLUMN_CONTRACT: TypedContract<ConfigColumnParams> = TypedContract::new();
const ROW_EDIT_CONTRACT: TypedContract<ConfigRowEditParams> = TypedContract::new();
const RULE_CONTRACT: TypedContract<ConfigRuleParams> = TypedContract::new();
pub static COMMANDS: &[CommandSpec] = &[
CommandSpec::new("config.configure", "Configure", configure).at("SOLID", "CONFIGURE").icon("params").params(
CommandSpec::new("config.configure", "Configure", crate::checked!("config.configure", configure))
.at("SOLID", "CONFIGURE")
.icon("params")
.contract(&CONFIGURE_CONTRACT)
.output(output_schema_for::<ConfigTableReply>)
.params(
"params?: [parameter names]; features?: [feature names]; materials?: [body names]; appearances?: [body names] (columns to add; with no rows yet, a \"Default\" row takes the current values)",
),
CommandSpec::new("config.table", "Display Configuration Table", crate::checked!("config.table", show))
@@ -25,8 +37,16 @@ pub static COMMANDS: &[CommandSpec] = &[
.contract(&TABLE_CONTRACT)
.output(output_schema_for::<ConfigTableReply>)
.params("→ columns (param:<name> or suppress:<feature>), rows, the active row and whether the design still matches it"),
CommandSpec::new("config.column", "Configuration Column", column).icon("configuration_table").params("param? | feature? | material? | appearance? (target name); delete?: bool"),
CommandSpec::new("config.row", "Configuration Row", row).icon("configuration_table").params(
CommandSpec::new("config.column", "Configuration Column", crate::checked!("config.column", column))
.icon("configuration_table")
.contract(&COLUMN_CONTRACT)
.output(output_schema_for::<ConfigTableReply>)
.params("param? | feature? | material? | appearance? (target name); delete?: bool"),
CommandSpec::new("config.row", "Configuration Row", crate::checked!("config.row", row))
.icon("configuration_table")
.contract(&ROW_EDIT_CONTRACT)
.output(output_schema_for::<ConfigTableReply>)
.params(
"name; from? (row to copy; default current values); values?: {column key: expression, suppression, material name, appearance name or Look object}; rename?; delete?: bool",
),
CommandSpec::new("config.activate", "Activate Configuration", crate::checked!("config.activate", activate))
@@ -40,7 +60,11 @@ pub static COMMANDS: &[CommandSpec] = &[
.contract(&ROW_CONTRACT)
.output(output_schema_for::<ConfigActivation>)
.params("row: name — validates a rebuild without changing the design or history"),
CommandSpec::new("config.rule", "Configuration Rule", rule).icon("configuration_table").params(
CommandSpec::new("config.rule", "Configuration Rule", crate::checked!("config.rule", rule))
.icon("configuration_table")
.contract(&RULE_CONTRACT)
.output(output_schema_for::<ConfigTableReply>)
.params(
"rule?: {id,name,enabled,condition,effect}; rules?: [rule…] (added or replaced together, then the rows checked once); id? + delete?; id? + index? (ordered move)",
),
CommandSpec::new("config.rules", "Configuration Rules", crate::checked!("config.rules", show))