-
Notifications
You must be signed in to change notification settings - Fork 0
release/1.2.1-alpha #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
release/1.2.1-alpha #361
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…on workflow - Updated version in Solution.props and README badges to 1.2.1-dev.251207 - Added `script_generate_and_place_on_canvas` wrapper tool that combines `script_generate` and `gh_put` in a single call to reduce token consumption - Added `script_edit_and_replace_on_canvas` wrapper tool documentation in DEV.md - Moved `script_generate` and `script_edit` tools to Hidden category (only wrapper tools visible to chat agents)
…indow - Override OnShown to center dialog on the screen containing the owner window or Rhino main window - Use Screen.FromRectangle to detect the target screen from reference window bounds - Fall back to PrimaryScreen if no reference window is available - Calculate center position based on screen's WorkingArea to respect taskbar and system UI
…pt_generate_and_place_on_canvas instanceGuid - Added `gh_get_selected_with_data`, `gh_get_by_guid_with_data`, and `gh_get_errors_with_data` tools that return components with their runtime/volatile data (actual values flowing through outputs) - Added `includeRuntimeData` parameter to base `gh_get` tool for optional runtime data extraction - Runtime data includes total item count, branch structure, and sample values for each parameter
…ds from ToolCalls to ToolResults - Fixed critical bug where identical user messages were collapsed in UI by assigning unique TurnId via `InteractionUtility.GenerateTurnId()` to each user message - Fixed TurnId inconsistency by unconditionally inheriting TurnId from ToolCall to ToolResult instead of conditional check that was never true due to `AIBodyBuilder.EnsureTurnId()` pre-assignment - Updated CHANGELOG.md
…ppers (#359) ## Description - **Script tools** - Added `script_generate_and_place_on_canvas` wrapper tool that calls `script_generate` and `gh_put` in a single operation to generate a script component and place it on the canvas, reducing token usage and tool orchestration complexity. - Hid `script_generate` and `script_edit` from chat (kept available via `AIScriptGenerator` component) and added explicit `script_edit_and_replace_on_canvas` wrapper for GUID-based edit-and-replace flows. - Updated script generation flow so `script_generate` no longer exposes a pre-placement `instanceGuid`; real instance GUIDs now come from `script_generate_and_place_on_canvas` / `script_edit_and_replace_on_canvas` via `gh_put`. - Fixed `script_generate_and_place_on_canvas` to return the **actual** Grasshopper `instanceGuid` assigned on placement instead of the in-memory GUID from `script_generate`. - Improved error handling and partial-success reporting when script generation succeeds but `gh_put` fails. - **GhJSON / `gh_get` tools and runtime data** - Extended `gh_get` to support optional **runtime/volatile data** extraction via a new `includeRuntimeData` parameter. - Implemented `GhJsonSerializer.ExtractRuntimeData` and `ExtractParameterVolatileData`: - Captures counts and path structure for inputs/outputs. - Adds per-branch summaries with sample values (limited to a few items) and `hasMore` markers. - Organizes data by component/parameter `InstanceGuid` for downstream analysis. - Added new wrapper tools around `gh_get`: - `gh_get_selected_with_data`, `gh_get_by_guid_with_data`, `gh_get_errors_with_data` for targeted snapshots that include runtime data. - `gh_get_selected`, `gh_get_by_guid`, `gh_get_errors`, `gh_get_locked`, `gh_get_hidden`, `gh_get_visible` for more focused structural queries. - Updated tool schemas in `gh_get.cs` (filters, connection depth, `includeRuntimeData`, `guidFilter`) and wired them through `GhGetToolAsync`, including a `forceIncludeRuntimeData` flag for the `*_with_data` wrappers. - Relaxed GhJSON validation in `GHJsonAnalyzer` so missing `connections` is treated as an empty array (no connections) while still erroring when `connections` exists but is not an array. - **`gh_put` tool** - Enhanced `gh_put` result to include an `instanceGuids` array containing the actual `InstanceGuid`s of all placed components. - Updated script wrapper tools to use these real instance GUIDs instead of any pre-computed IDs. - **Chat UI and conversation session** - Fixed a critical WebChat UI bug where two identical user messages were collapsed into one: - `WebChatDialog` now assigns a unique `TurnId` to every outgoing user interaction via `InteractionUtility.GenerateTurnId()`, ensuring dedup keys remain distinct even for identical content. - Fixed `ConversationSession` TurnId consistency: - Tool result interactions now always inherit the `TurnId` from their originating tool calls (no conditional assignment), ensuring correct per-turn metrics aggregation. - Error tool results produced via helpers also preserve the original tool call `TurnId`. - **Dialogs and UX** - Improved `StyledMessageDialog` positioning by centering dialogs on the active Rhino/Eto window’s working area on `OnShown`, for more predictable and user-friendly placement. - **Docs and versioning** - Bumped solution version to `1.2.1-dev.251207` in `Solution.props` and updated README badges to reflect the new dev version and unstable development status. - Documented new and updated tools in `DEV.md` (script wrappers and `gh_get*` variants, including `*_with_data` tools). - Updated [CHANGELOG.md](cci:7://file:///c:/Users/Marc%20Roca/source/repos/architects-toolkit/SmartHopper/CHANGELOG.md:0:0-0:0) under `[Unreleased]` to record: - Newly added script and GhJSON tools and runtime datasets. - Script placement bug fix and GhJSON validation improvement. - Chat UI / conversation session TurnId fixes. - Clarification that `script_generate` no longer exposes a pre-placement `instanceGuid`. ## Breaking Changes - **None expected for typical workflows.** - `script_generate` no longer returns a pre-placement `instanceGuid`; instance GUIDs should be obtained via `script_generate_and_place_on_canvas` / `script_edit_and_replace_on_canvas` (or directly from `gh_put`), which aligns with the intended usage pattern. - GhJSON validation now treats missing `connections` as valid (empty) instead of an error, which is a relaxation rather than a breaking change. ## Testing Done - `script_generate_and_place_on_canvas`: - Generate a new script component and confirm it is placed once on the canvas. - Verify the returned `instanceGuid` matches the component actually placed in Grasshopper. - `script_edit_and_replace_on_canvas`: - Edit an existing script component by GUID and confirm it is replaced in place, with wiring preserved and a correct `instanceGuid`. - `gh_get*` tools: - Run `gh_get_selected_with_data` / `gh_get_by_guid_with_data` / `gh_get_errors_with_data` on small and moderate definitions and verify: - `runtimeData` includes correct total counts, branch structure, and sample values. - No excessive payloads are generated for large trees (samples limited as expected). - Dialog UX: - Open `StyledMessageDialog` and confirm dialogs are centered on the active Rhino window. - Automated tests: - [x] Run full .NET test suite / CI on the branch. - [x] Verify no regressions in existing GhJSON tests (serialization, deserialization, validation). ## 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](cci:7://file:///c:/Users/Marc%20Roca/source/repos/architects-toolkit/SmartHopper/CHANGELOG.md:0:0-0:0) 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 (#360) # SmartHopper 1.2.1-alpha: Runtime data snapshots & script canvas wrappers [Patch] This patch release focuses on richer inspection of Grasshopper definitions (including runtime data snapshots), smoother script component workflows, and small but important chat and UI fixes. ## Detailed list of changes - Added new script wrapper tool `script_generate_and_place_on_canvas` that generates a Grasshopper script component and places it on the canvas in a single call, simplifying chat workflows and reducing token usage. - Updated script tools so the low-level `script_generate` / `script_edit` tools are hidden from chat (still available via AIScript components) while wrapper tools handle full generate-and-place / edit-and-replace flows. - Changed script generation behavior so `script_generate` no longer returns a pre-placement `instanceGuid`; instead, wrapper tools now report the real `instanceGuid` assigned by Grasshopper after placement. - Enhanced `gh_get` to optionally include snapshots of runtime/volatile data (branch counts, item counts, and sample values) for inputs and outputs, enabling richer debugging and inspection. - Added specialized `gh_get` variants such as `gh_get_selected_with_data`, `gh_get_by_guid_with_data`, and `gh_get_errors_with_data` to retrieve focused subsets of the document together with their runtime data. - Improved `gh_put` tool results by returning an `instanceGuids` array with the actual GUIDs of components placed on the canvas, making follow-up queries and wiring much easier. - Relaxed GhJSON validation so documents without any connections are treated as valid (missing `connections` is now considered an empty list instead of an error). - Fixed a chat UI bug where sending the same user message twice could cause one message to be collapsed; each user message now gets a unique turn ID and shows correctly in the conversation. - Improved conversation session turn handling so tool results inherit the correct turn ID from their tool calls, leading to accurate per-turn metrics aggregation in the UI. - Refined dialog positioning so `StyledMessageDialog` windows open centered on the Rhino/Eto main window for a more predictable and polished user experience.
marc-romu
approved these changes
Dec 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR prepares the release for version 1.2.1-alpha with version update and code style fixes: