Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 7, 2025

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

  • Updated version in Solution.props
  • Updated changelog with closed-solved issues
  • Updated README badges

marc-romu and others added 7 commits December 7, 2025 08:38
…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.
@github-actions github-actions bot requested a review from marc-romu as a code owner December 7, 2025 09:08
@marc-romu marc-romu added this to the 1.2.1-alpha milestone Dec 7, 2025
@marc-romu marc-romu enabled auto-merge December 7, 2025 09:09
@marc-romu marc-romu merged commit 4650419 into main Dec 7, 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