Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 23, 2025

SmartHopper 1.1.0-alpha: Smarter GhJSON & knowledge tools

This alpha release focuses on a modern GhJSON/property system and powerful knowledge tools for McNeel forum and web—plus foundational scripting improvements that prepare SmartHopper for richer script workflows in future releases.

🌐 Knowledge tools for McNeel forum, web & Rhino files

  • McNeel forum AI tools:
    • mcneel_forum_search with configurable result limits and raw JSON post payloads.
    • mcneel_forum_post_get (renamed from web_rhino_forum_read_post) to fetch full posts by ID.
    • mcneel_forum_post/topic_summarize to generate AI‑powered summaries of forum threads.
  • web_generic_page_read now returns clean, context‑aware text for:
    • Wikipedia/Wikimedia, Discourse forums, GitHub/GitLab file URLs, and Stack Exchange questions via official APIs.

📦 Modern GhJSON & Property Management V2

  • New PropertyManagerV2 architecture with:
    • Clear separation of filtering, extraction, and application.
    • PropertyFilter, PropertyHandlers, PropertyFilterConfig, SerializationContext, and ComponentCategory for precise, scenario‑aware property control.
  • GhJSON optimization:
    • Groups only include members that are part of the current selection.
    • Runtime‑only properties (VolatileData, IsValid, ReferenceID, IsGeometryLoaded, etc.) are removed to keep JSON compact.
    • Fixed contradictory whitelist/omit rules and simplified ComponentProperty (removed Type and HumanReadable).
  • Enhanced GhJSON schema:
    • Rich parameter metadata: parameterName, dataMapping, simplify, reverse, invert, unitize, expression, variableName, isPrincipal, locked.
    • Unified value property for component state across sliders, panels, scribbles, scripts, and value lists.
    • Extended component schema with Id, Params, InputSettings, OutputSettings, and ComponentState.
    • Removed redundant/implicit fields (expressionContent, access, description, optional, type/object metadata).
    • BREAKING: The enhanced schema is now the default for all gh_get and gh_put operations, with legacy Pivot preserved for positioning compatibility.

🧠 Preparing advanced scripting workflows

  • Lays the groundwork for future scripting-focused releases with robust VB Script and script component handling:
    • Full 3‑section VB Script serialization/deserialization (imports, script, additional) with a dedicated VBScriptCode model and vbCode support in ComponentState.
    • GhJSON now extracts and restores VB Script code via ScriptSource properties (UsingCode, ScriptCode, AdditionalCode) using reflection.
  • Script components implement IGH_VariableParameterComponent for reliable dynamic parameter creation/removal:
    • Parameter settings applied via CreateParameter/DestroyParameter and VariableParameterMaintenance() with names, optional flags, and modifiers.
  • All script parameter and code operations are wrapped in RhinoApp.InvokeOnUiThread() to keep the Rhino/Grasshopper UI responsive and stable.
  • New unified script_generator AI tool replaces legacy script_new and script_edit, creating or editing script components from natural language and optional component GUIDs—forming the base for richer scripting assistants in upcoming versions.

🧪 Reliability, workflows & test coverage

  • Utility helpers for centralized Grasshopper/Rhino operations:
    • GHConnectionUtils, GHGenerateUtils, RhinoFileUtils, RhinoGeometryUtils.
  • SelectingComponentBase now persists selected objects across file save/load, including restored selection counts and graceful handling of missing objects.
  • New SmartHopper.Core.Grasshopper.Tests project:
    • 40+ AIResponseParserTests covering complex parsing and edge cases.
    • 30+ PropertyManagerTests validating type conversion and persistent data behavior.
  • Hotfix workflow system:
    • Automated hotfix branch creation, version bumping, conflict‑safe milestone updates, and fully documented hotfix pipelines.
    • Extended CI validations and test workflows for hotfix/** and release/** branches.

🛠️ Technical Requirements

  • Rhino 8.24 or above is required
  • Windows 10/11 (macOS has not been tested)
  • Valid API keys for at least one supported AI provider (MistralAI, OpenAI, DeepSeek, Anthropic, OpenRouter)

⚠️ Important Notes

  • This is an alpha release with some features still unstable or subject to change.
  • API keys are required, and usage costs apply based on your provider and model choices.
  • Documentation is actively evolving to cover the new GhJSON schema, scripting tools, and knowledge workflows.

🤝 We Value Your Feedback!

Help shape SmartHopper’s future by:

  • Sharing your experiences with the new GhJSON, scripting, and knowledge tools
  • Suggesting improvements via our discussions
  • Telling us what AI capabilities or workflows would help your Grasshopper/Rhino practice most

We hope you enjoy these new features and improvements!

Happy designing! 🎨

marc-romu and others added 30 commits October 13, 2025 08:24
## Description

This PR introduces a robust hotfix workflow system for handling
emergency production fixes, along with comprehensive documentation. The
changes include:

### Added
- **Hotfix Workflow System**:
- `hotfix-0-new-branch.yml`: Creates `hotfix/X.X.X-description` branch
from main with automatic patch version increment
- `hotfix-1-release-hotfix.yml`: Prepares
`release/X.X.X-hotfix-description` branch with version updates,
changelog, and PR to main
  - Automatic version conflict resolution for dependent milestones
- Hotfix PRs trigger all existing validations (version check, code
style, tests)
- Integration with existing release workflows for GitHub Release
creation and Yak upload

- **Documentation**:
  - `HOTFIX_WORKFLOW.md`: Complete guide for emergency hotfix releases
- `RELEASE_WORKFLOW.md`: Updated guide for regular milestone-based
releases

### Changed
- Extended PR validation and CI test workflows to run on `hotfix/**` and
`release/**` branches

### Removed
- Obsolete `user-security-patch.yml` workflow

## Breaking Changes

None.

## Testing Done

None.

## Checklist

- [x] This PR is focused on a single feature or bug fix
- [x] Version in Solution.props was updated, if necessary, and follows
semantic versioning
- [x] CHANGELOG.md has been updated
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
- [x] PR description follows [Pull Request Description
Template](#pull-request-description-template)
This PR updates the version badge in the README.md to match the current
version in Solution.props.

This is an automated PR created by the Update Version Badge workflow.
…fying components value into componentState.value
marc-romu and others added 26 commits November 22, 2025 23:36
…cons

- Added new `mcneel_forum_topic_related` AI tool and `McNeelForumTopicRelatedComponent` to retrieve suggested related topics for a forum topic
- Added component icons for McNeel forum components (search, post get/open/deconstruct/summarize, topic related/summarize)
- Added component icons for web summarize and script generate/review components
- Renamed `metrics.png` to `metricsdeconstruct.png` for consistency
…ly summaries

- Removed metadata outputs (Post Id, Author, Date, Title, Url, Post Count) from post and topic summarization components
- Updated components to use DataTreeProcessor.GetProcessingPathMetrics for consistent data count calculation
- Added component icons for McNeel forum post and topic summarization
- Changed component exposure from secondary to primary
- Refactored mcneel_forum_post tool to use FetchFilteredPostAsync helper
…score

- Renamed gh_connect.cs to _gh_connect.cs
- Renamed gh_generate.cs to _gh_generate.cs
- Renamed gh_parameter_modifier.cs to _gh_parameter_modifier.cs
- Renamed rhino_get_geometry.cs to _rhino_get_geometry.cs
- Renamed rhino_read_3dm.cs to _rhino_read_3dm.cs
- Renamed script_parameter_modifier.cs to _script_parameter_modifier.cs
…cessingUnitMode

- Added ProcessingUnitMode enum (Items/Branches) to StatefulAsyncComponentBase to define processing granularity
- Replaced RunDataTreeFunctionAsync with new RunProcessingAsync method that uses centralized ProcessingPlan-based metrics
- Updated all AI components to use RunProcessingAsync and set UnitMode to Items where appropriate
- Centralized data count calculation in RunProcessingAsync
…ocessingMetrics and fix BranchFlatten/GetBranchFromTree bugs

- Updated all DataTreeProcessor test components to call CalculateProcessingMetrics before RunAsync for consistency
- Fixed GetBranchFromTree incorrectly returning branches from different paths when tree had single path (flat tree fallback bug)
- Fixed BranchFlatten topology creating one processing unit per path instead of flattening all branches together
- Added DataTreeProcessingSchema.md documenting centralized data-tree mechanics in DataTreeProcessor
- Added FlatTreeBroadcasting.md documenting flat tree broadcasting rules and edge cases
- Documented unified ProcessingTopology enum (ItemToItem/ItemGraft/BranchFlatten/BranchToBranch) replacing legacy branch/item modes
…gy analysis

- Updated ShouldBroadcastFlatTree to accept otherTreePaths (excluding the flat tree itself) instead of allTreePaths
- Fixed scalar {0} broadcasting rules: now correctly handles Rule 4 (direct {0} match prevents broadcasting to deeper {0;...})
- Fixed GetBranchFromTree to exclude self-tree when building topology context for broadcast decisions
- Refactored GetProcessingPathMetrics to remove broadcast-only paths from processing
…y fields in AI tools

- Extracted system prompts to readonly fields in img_generate, mcneel_forum_post, mcneel_forum_topic, script_generator, script_review, text_evaluate, and text_generate
- Extracted user prompt templates to readonly fields in script_generator, script_review, and text_generate
- Added toolName and toolCapabilityRequirements readonly fields to img_generate for consistency
- Added debug logging to text_evaluate tool
…dia, Discourse, GitHub/GitLab, and Stack Exchange

- Added TryFetchWikimediaPlainTextAsync to retrieve clean plain text from Wikipedia/Wikimedia articles via their API
- Added TryFetchDiscourseRawContentAsync to fetch raw markdown from Discourse forums using /posts/{id}.json endpoint
- Added TryFetchGitHostContentAsync to retrieve raw file content from GitHub/GitLab URLs
- Added TryFetchStackExchangeContentAsync to fetch question
…346)

# feat(core): add AI knowledge tools and GhJSON/property management v2

## Description

- **New knowledge tools and components**
- Added McNeel forum AI tools: `mcneel_forum_search`,
`mcneel_forum_post_get`, `mcneel_forum_post_summarize`.
- Introduced new Grasshopper knowledge components for McNeel forum and
generic web sources, enabling search, retrieval, and summarization
workflows.
- Enhanced `web_generic_page_read` to return clean text/markdown for
Wikipedia/Wikimedia, Discourse forums, GitHub/GitLab file URLs, and
Stack Exchange questions via their APIs.

- **Script and parameter tooling**
- Implemented VB Script 3‑section serialization/deserialization with
dedicated `VBScriptCode` model and `ComponentState.vbCode` support.
- Added AI tools for parameter and script modification
(flatten/graft/reset mapping/reverse/simplify, bulk input/output tools,
script parameter add/remove/set type/access/optional, script principal
input, standard output toggle).
- Consolidated script editing/creation into a unified `script_generator`
tool and corresponding components; removed legacy `script_new` /
`script_edit` components and tools.
- Fixed multiple issues in script component
serialization/deserialization and GUID handling.

- **Property Management System V2 and GhJSON schema**
- Replaced the legacy `PropertyManager` with `PropertyManagerV2`,
`PropertyFilter`, and specialized property handlers, with clear
serialization contexts (AIOptimized/Standard, etc.).
- Optimized GhJSON output by removing runtime-only and redundant
properties and tightening the whitelist/omit logic.
  - Implemented the enhanced GhJSON schema:
- Parameter properties: `parameterName`, `dataMapping`, `simplify`,
`reverse`, `invert`, `unitize`, `expression`, `variableName`,
`isPrincipal`, `locked`.
- Component properties: consolidated universal `value`, plus
`locked`/`hidden` and type‑specific mappings (slider, panel, scribble,
script, value list).
- Extended `ComponentProperties` with `Id`, `Params`, `InputSettings`,
`OutputSettings`, `ComponentState`.
- Added full data type serialization system (colors, geometry,
intervals, numbers, text, etc.) with a registry and explicit format
prefixes, ensuring accurate round-tripping.

- **GhJSON document and placement improvements**
- Improved document metadata serialization: schema version,
Rhino/Grasshopper version, parameter counts, dependencies, and more.
- Implemented robust group and stand‑alone parameter serialization,
including connection handling and new `paramIndex`‑based wiring.
- Improved `gh_put` placement logic with smart pivot handling, automatic
grid layout when pivots are missing, and better overlap avoidance.

- **AI infrastructure and providers**
- Refactored AICall core to use `AIRequest`/`AIRequestCall`/`AIReturn`
with policy‑driven validation and diagnostics.
- Introduced `ConversationSession` for multi‑turn conversations,
tooling, and streaming orchestration, with an always‑on
`PolicyPipeline`.
- Centralized model management and selection via `ModelManager` and
provider‑scoped model capability descriptors.
- Enhanced streaming adapters and reasoning support for OpenAI,
MistralAI, DeepSeek; added Anthropic and OpenRouter providers and
updated provider icons.
- Improved API key handling with stronger encryption and centralized
authentication logic.

- **Components, UI, and tests**
- Added persistence to `SelectingComponentBase` (selected objects
restored by GUID).
- Standardized stateful components’ data-tree processing via
`RunProcessingAsync` and `ProcessingUnitMode`, with better metrics and
progress reporting.
- Introduced `SmartHopper.Core.Grasshopper.Tests` and other tests for AI
response parsing, property management, context/model managers, and
GhJSON.
- Updated README/docs (including GhJSON docs and AI tools docs) and
badges to match the new capabilities.

## Breaking Changes

- **GhJSON schema changes**
- New enhanced GhJSON schema is now the **default** for `gh_get` and
`gh_put`.
- Some properties were removed or renamed (e.g., `Properties` bag
replaced by structured
`Params`/`InputSettings`/`OutputSettings`/`ComponentState`, consolidated
`value` field).
- Clients consuming previous GhJSON formats may need to be updated to
the new schema.

- **Legacy tools and components**
- Removed legacy script tools `script_new` and `script_edit` and their
corresponding components in favor of the unified `script_generator`.
- Removed the legacy `PropertyManager` and related APIs in favor of
`PropertyManagerV2`.

- **Internal refactors**
- Reorganized `SmartHopper.Core.Grasshopper.Utils` into dedicated
sub‑namespaces/folders and renamed several utility classes.
- AICall and provider infrastructure have been refactored; any code
depending on internal types or behavior may require adjustments.

## Testing Done

- [x] Build SmartHopper solution in Debug and Release on Windows with
Rhino 8 / Grasshopper 1.
- [x] Run all unit tests, including new
`SmartHopper.Core.Grasshopper.Tests` and infrastructure tests.
- [ ] Manually validate:
- [x] `mcneel_forum_search`, `mcneel_forum_post_get`, and
`mcneel_forum_post_summarize` tools and corresponding components.
- [x] `web_generic_page_read` behavior on Wikipedia, Discourse,
GitHub/GitLab file URLs, and Stack Exchange questions.
- [ ] Script/parameter AI tools (`script_generator`, parameter
mapping/modifier tools) including VB Script 3‑section round‑trips.
- [x] GhJSON round‑trip (`gh_get` → edit → `gh_put`) for documents with
components, stand‑alone parameters, groups, and connections.
- [x] ConversationSession‑based chat flows (with and without tools)
across main providers.

## Checklist

- [x] This PR is focused on a single feature or bug fix
- [x] Version in Solution.props was updated, if necessary, and follows
semantic versioning
- [x] CHANGELOG.md has been updated
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/en/v1.1.0/) format
- [x] PR description follows [Pull Request Description
Template](https://github.com/architects-toolkit/SmartHopper/blob/main/CONTRIBUTING.md#pull-request-description-template)
… fixes (#347)

This PR prepares the release for version 1.1.0-alpha with version update
and code style fixes:

- Updated version in Solution.props
- Updated changelog with closed-solved issues
- Updated README badges
@github-actions github-actions bot requested a review from marc-romu as a code owner November 23, 2025 23:09
@marc-romu marc-romu added this to the 1.1.0-alpha milestone Nov 23, 2025
@marc-romu marc-romu merged commit aefd485 into main Nov 23, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants