Protocol and contract quick reference for API integration, troubleshooting, and regression alignment.
- Endpoint:
POST /api/v1/agent/run - Current orchestration is capability-driven and runs through the LangGraph ReAct agent.
- Execution chain:
detect_structure_type -> extract_draft_params -> build_model -> validate_model -> run_analysis -> run_code_check -> generate_report
Current architecture notes:
- public product interaction uses the chat-first request shape
- skills and tools are optional capability layers
- see
docs/agent-architecture.mdfor the current LangGraph agent design
Key result observability fields:
traceIdstartedAtcompletedAtdurationMsmetricstoolCalls
Minimal request example:
{
"message": "Run static analysis and generate report",
"context": {
"modelFormat": "structuremodel-v1",
"model": {
"schema_version": "1.0.0",
"unit_system": "SI",
"nodes": [],
"elements": [],
"materials": [],
"sections": [],
"load_cases": [],
"load_combinations": []
}
}
}Endpoints:
POST /api/v1/chat/messagePOST /api/v1/chat/stream
Notes:
chat/messageandchat/streamno longer accept a publicmodefield.- chat requests are always single-entry; the backend decides whether the turn remains conversational or invokes tools.
Typical stream event sequence:
startinteraction_update(optional)resultdone
Failure path emits: error.
Main endpoints:
POST /validatePOST /convertPOST /analyzePOST /code-checkGET /schema/convertersGET /enginesGET /engines/:idPOST /engines/:id/check
Built-in engine ids:
| Engine id | Adapter | Notes |
|---|---|---|
builtin-opensees |
builtin-opensees |
OpenSeesPy-backed analysis skills |
builtin-pkpm |
builtin-pkpm |
Requires local PKPM/SATWE runtime and JWSCYCLE.exe |
builtin-yjk |
builtin-yjk |
Requires local YJK 8.0 runtime and valid authorization |
Required baseline shape:
{
"schema_version": "1.0.0",
"unit_system": "SI",
"nodes": [],
"elements": [],
"materials": [],
"sections": [],
"load_cases": [],
"load_combinations": []
}Practical rules:
- Keep strict field names.
- Keep element references aligned with node/material/section IDs.
- Prefer
validate_modelbeforerun_analysiswhen possible.
StructureClaw 1.0 uses runtime settings.json as the user-facing configuration file. Configuration resolution can be summarized as:
settings.json- Selected environment-variable fallbacks
- Built-in defaults
When the corresponding setting is absent, the backend reads PORT, FRONTEND_PORT, and NODE_ENV as fallbacks. SCLAW_DATA_DIR changes the runtime base directory used to locate settings.json and data files.
Admin settings endpoints:
GET /api/v1/admin/settingsPUT /api/v1/admin/settings
Settings sections:
serverllmdatabaselogginganalysisstoragecorsagentpkpmyjk
Each returned field includes a value and source label so the UI can explain whether the effective value came from runtime settings or defaults.
GET /api/v1/agent/skillhub/searchGET /api/v1/agent/skillhub/installedPOST /api/v1/agent/skillhub/installPOST /api/v1/agent/skillhub/enablePOST /api/v1/agent/skillhub/disablePOST /api/v1/agent/skillhub/uninstallGET /api/v1/admin/skillsPOST /api/v1/admin/skills/reloadGET /api/v1/admin/skills/:id
User extension directories under the runtime data directory:
skills/<name>/skill.yamlskills/<name>/intent.md,draft.md,analysis.md,design.mdas neededskills/<name>/handler.jsfor executable handlerstools/<name>/tool.yamltools/<name>/tool.js
Built-in skills take priority on id collisions. User tools are appended to the registered tool set at graph build time.
Priority rule:
- User manual toggles (skill/tool enable/disable) have the highest priority.
- Manual toggles override automatic activation, default sets, and policy suggestions.
- Any skill or tool manually disabled by the user must become immediately unavailable to the orchestrator.
Contract checks and grouped regressions run via node tests/runner.mjs ... (not sclaw). List validation names with node tests/runner.mjs validate --list.
Agent orchestration and protocol:
node tests/runner.mjs validate validate-agent-orchestrationnode tests/runner.mjs validate validate-agent-base-chat-fallbacknode tests/runner.mjs validate validate-agent-tools-contractnode tests/runner.mjs validate validate-agent-api-contractnode tests/runner.mjs validate validate-agent-capability-matrix
SkillHub:
node tests/runner.mjs validate validate-agent-skillhub-clinode tests/runner.mjs validate validate-agent-skillhub-contractnode tests/runner.mjs validate validate-agent-skillhub-repository-down
Chat and messaging:
node tests/runner.mjs validate validate-chat-stream-contractnode tests/runner.mjs validate validate-chat-message-routing
Analysis and runtime:
node tests/runner.mjs validate validate-analyze-contractnode tests/runner.mjs validate validate-opensees-runtime-and-routing
Converter:
node tests/runner.mjs validate validate-converter-api-contractnode tests/runner.mjs validate validate-convert-batchnode tests/runner.mjs validate validate-convert-passratenode tests/runner.mjs validate validate-convert-roundtripnode tests/runner.mjs validate validate-midas-text-converter
Code-check, report and schema:
node tests/runner.mjs validate validate-code-check-traceabilitynode tests/runner.mjs validate validate-report-narrative-contractnode tests/runner.mjs validate validate-schema-migration
Regression:
node tests/runner.mjs validate validate-static-regressionnode tests/runner.mjs validate validate-static-3d-regressionnode tests/runner.mjs validate validate-structure-examples
Dev startup:
node tests/runner.mjs validate validate-dev-startup-guards
Regression entrypoints:
node tests/runner.mjs backend-regressionnode tests/runner.mjs analysis-regression
- Operational guide:
docs/handbook.md - Agent architecture:
docs/agent-architecture.md - Chinese operational guide:
docs/handbook_CN.md - Chinese protocol reference:
docs/reference_CN.md - Skill loading mechanism:
docs/schema/skill-loading.md - Skill loading mechanism (Chinese):
docs/schema/skill-loading_CN.md - Utility tools specification:
docs/schema/utility-tools.md - Utility tools specification (Chinese):
docs/schema/utility-tools_CN.md - Chinese agent architecture:
docs/agent-architecture_CN.md