add design style

This commit is contained in:
yumoqing 2026-05-04 10:09:44 +08:00
parent 09fff13dd9
commit eb28ba57b9
8 changed files with 177 additions and 64 deletions

View File

@ -1 +0,0 @@
# harnessed_reasoning module

View File

@ -1,19 +1,52 @@
#!/bin/bash #!/bin/bash
# harnessed_reasoning build script # harnessed_reasoning build script
# Follows module-development-spec: processes models/, json/, and wwwroot/
set -e set -e
echo "Building harnessed_reasoning module..." MODULE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODULE_NAME="harnessed_reasoning"
# Get the main application wwwroot directory echo "Building ${MODULE_NAME} module..."
MAIN_WWWROOT="/path/to/main/wwwroot"
# Create symbolic links for wwwroot files # Step 1: Generate DDL from model JSON files
for file in wwwroot/*; do if [ -d "$MODULE_DIR/models" ] && ls "$MODULE_DIR/models"/*.json 1>/dev/null 2>&1; then
echo "Generating DDL from model definitions..."
cd "$MODULE_DIR/models"
if command -v json2ddl &>/dev/null; then
json2ddl mysql . > mysql.ddl.sql
echo "Generated mysql.ddl.sql from models/"
else
echo "Warning: json2ddl not found, skipping DDL generation"
fi
cd "$MODULE_DIR"
fi
# Step 2: Generate CRUD UI from JSON definitions
if [ -d "$MODULE_DIR/json" ] && ls "$MODULE_DIR/json"/*.json 1>/dev/null 2>&1; then
echo "Generating CRUD UI files from JSON definitions..."
cd "$MODULE_DIR/json"
if command -v xls2ui &>/dev/null; then
for f in *.json; do
xls2ui -m ../models -o ../wwwroot "${MODULE_NAME}" "$f" 2>/dev/null || true
done
echo "Generated CRUD UI files in wwwroot/"
else
echo "Warning: xls2ui not found, skipping UI generation"
fi
cd "$MODULE_DIR"
fi
# Step 3: Link wwwroot files to main application wwwroot
MAIN_WWWROOT="$MODULE_DIR/../wwwroot"
mkdir -p "$MAIN_WWWROOT"
for file in "$MODULE_DIR"/wwwroot/*; do
if [ -f "$file" ]; then if [ -f "$file" ]; then
filename=$(basename "$file") filename=$(basename "$file")
ln -sf "$file" "$MAIN_WWWROOT/harnessed_reasoning_$filename" ln -sf "$file" "$MAIN_WWWROOT/${MODULE_NAME}_${filename}"
echo "Linked $filename to main wwwroot"
fi fi
done done
echo "harnessed_reasoning module build completed!" echo "${MODULE_NAME} module build completed successfully!"

View File

@ -1,14 +0,0 @@
from ahserver.serverenv import ServerEnv
from .core import (
hermes_reason_and_execute,
hermes_get_reasoning_session,
hermes_list_reasoning_sessions,
hermes_get_reasoning_config
)
def load_harnessed_reasoning():
env = ServerEnv()
env.hermes_reason_and_execute = hermes_reason_and_execute
env.hermes_get_reasoning_session = hermes_get_reasoning_session
env.hermes_list_reasoning_sessions = hermes_list_reasoning_sessions
env.hermes_get_reasoning_config = hermes_get_reasoning_config

View File

@ -1,4 +1,33 @@
{ {
"harnessed_reasoning_sessions": [], "harnessed_reasoning_sessions": [],
"harnessed_reasoning_config": [] "harnessed_reasoning_config": [
{
"id": "default_config_user_1",
"user_id": "user_1",
"max_reasoning_steps": 10,
"max_tool_calls_per_step": 5,
"enable_cross_session_search": "1",
"enable_skill_auto_loading": "1",
"safety_mode": "strict",
"max_context_tokens": 4000,
"enable_error_recovery": "1",
"max_recovery_attempts": 3,
"created_at": "2026-04-20 10:45:00",
"updated_at": "2026-04-20 10:45:00"
},
{
"id": "default_config_user_2",
"user_id": "user_2",
"max_reasoning_steps": 10,
"max_tool_calls_per_step": 5,
"enable_cross_session_search": "1",
"enable_skill_auto_loading": "1",
"safety_mode": "moderate",
"max_context_tokens": 4000,
"enable_error_recovery": "1",
"max_recovery_attempts": 3,
"created_at": "2026-04-20 10:45:00",
"updated_at": "2026-04-20 10:45:00"
}
]
} }

View File

@ -5,7 +5,39 @@
"params": { "params": {
"logined_userid": "user_id", "logined_userid": "user_id",
"confidential_fields": [], "confidential_fields": [],
"browserfields": {}, "browserfields": {
"alters": {
"enable_cross_session_search": {
"uitype": "code",
"data": [
{"value": "1", "text": "Enabled"},
{"value": "0", "text": "Disabled"}
]
},
"enable_skill_auto_loading": {
"uitype": "code",
"data": [
{"value": "1", "text": "Enabled"},
{"value": "0", "text": "Disabled"}
]
},
"enable_error_recovery": {
"uitype": "code",
"data": [
{"value": "1", "text": "Enabled"},
{"value": "0", "text": "Disabled"}
]
},
"safety_mode": {
"uitype": "code",
"data": [
{"value": "strict", "text": "Strict"},
{"value": "moderate", "text": "Moderate"},
{"value": "lenient", "text": "Lenient"}
]
}
}
},
"editexclouded": ["id", "user_id", "created_at"] "editexclouded": ["id", "user_id", "created_at"]
} }
} }

View File

@ -7,6 +7,7 @@
"logined_userid": "user_id", "logined_userid": "user_id",
"confidential_fields": [], "confidential_fields": [],
"browserfields": { "browserfields": {
"exclouded": ["id", "user_id", "created_at", "updated_at"],
"alters": { "alters": {
"status": { "status": {
"uitype": "code", "uitype": "code",

View File

@ -1,30 +1,26 @@
[build-system] [build-system]
requires = ["setuptools>=45", "wheel"] requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project] [project]
name = "harnessed_reasoning" name = "harnessed-reasoning"
version = "1.0.0" version = "1.0.0"
description = "Hermes Reasoning Module - Production-ready reasoning engine with full context awareness" description = "Hermes Reasoning Engine module - advanced reasoning with context awareness, safety checks, and error recovery"
authors = [{name = "Hermes AI Team"}] requires-python = ">=3.10"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = [ dependencies = [
"ahserver>=1.0.0", "ahserver",
"appPublic>=1.0.0", "sqlor",
"sqlor-database-module>=1.0.0", "apppublic",
"harnessed_agent>=1.0.0" "appbase",
"rbac",
"harnessed-agent",
]
[project.optional-dependencies]
dev = [
"pytest",
"pytest-asyncio",
] ]
[tool.setuptools.packages.find] [tool.setuptools.packages.find]
where = ["."]
include = ["harnessed_reasoning*"] include = ["harnessed_reasoning*"]

View File

@ -1,21 +1,58 @@
{ {
"widgettype": "tabs", "widgettype": "VBox",
"options": { "options": {
"tabs": [ "width": "100%",
"height": "100%",
"css": ""
},
"subwidgets": [
{ {
"title": "Reasoning Sessions", "widgettype": "Toolbar",
"url": "{{entire_url(harnessed_reasoning_sessions_crud)}}" "options": {
"css": "ios-navbar",
"items": [
{
"widgettype": "Label",
"text": "Reasoning Engine",
"options": {
"css": "ios-navbar-title"
}
}, },
{ {
"title": "Session Details", "widgettype": "Label",
"url": "{{entire_url(harnessed_reasoning_session_detail)}}" "text": "Manage sessions and system configuration",
}, "options": {
{ "css": "ios-navbar-subtitle"
"title": "Configuration", }
"url": "{{entire_url(harnessed_reasoning_config_view)}}"
} }
] ]
}
}, },
"subwidgets": [], {
"binds": [] "widgettype": "Tab",
"options": {
"tabs": [
{"title": "Sessions", "icon": "history"},
{"title": "Configuration", "icon": "settings"}
],
"css": "ios-tabbar"
},
"subwidgets": [
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url(harnessed_reasoning_sessions_crud)}}",
"css": "ios-card"
}
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url(harnessed_reasoning_config_view)}}",
"css": "ios-card"
}
}
]
}
]
} }