Skip to content

Add wassette inspect subcommand for debugging WebAssembly components#430

Merged
Mossaka merged 9 commits into
mainfrom
copilot/add-component2json-subcommand
Nov 1, 2025
Merged

Add wassette inspect subcommand for debugging WebAssembly components#430
Mossaka merged 9 commits into
mainfrom
copilot/add-component2json-subcommand

Conversation

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor
  • Explore repository structure and understand the codebase
  • Understand component2json binary functionality (inspects WASM components and displays JSON schemas)
  • Review existing CLI structure in src/main.rs and src/commands.rs
  • Add new wassette inspect subcommand to CLI
  • Implement the subcommand handler that calls component2json functionality
  • Add tests for the new subcommand
  • Build and test the changes
  • Update CHANGELOG.md
  • Remove standalone component2json binary (now integrated as subcommand)
  • Remove unused dependencies from component2json crate (anyhow, tokio)
Original prompt

There is a binary in component2json crate called 'component2json'. Can you add this as a subcommand to wassette for debugging purposes? It should not be called component2json though because the name is confusing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Added 'inspect' subcommand to wassette CLI that displays JSON schema for component inputs/outputs
- Implemented handler in src/main.rs that leverages component2json functionality
- Added component2json and wasmtime dependencies to main Cargo.toml
- Added comprehensive integration tests for the new inspect subcommand
- Updated CHANGELOG.md with the new feature
- All tests pass and code is formatted

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add subcommand for component2json in wassette Add wassette inspect subcommand for debugging WebAssembly components Oct 22, 2025
Copilot AI requested a review from Mossaka October 22, 2025 04:58
@Mossaka Mossaka marked this pull request as ready for review October 22, 2025 05:14
@Mossaka

Mossaka commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

@copilot can you delete the binary from component2json crate?

- Removed [[bin]] section from crates/component2json/Cargo.toml
- Deleted crates/component2json/cmd/ directory containing the standalone binary
- The functionality is now available via 'wassette inspect' subcommand
- All tests pass and the inspect command works correctly

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot can you delete the binary from component2json crate?

Done! Removed the standalone binary in commit 4d08188. The [[bin]] section has been removed from crates/component2json/Cargo.toml and the cmd/ directory has been deleted. The functionality is now exclusively available through wassette inspect.

@Mossaka

Mossaka commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

@copilot Please address this pipeline failure:

/home/runner/.cargo/bin/cargo machete
Analyzing dependencies of crates in this directory...
cargo-machete found the following unused dependencies in this directory:
component2json -- ./crates/component2json/Cargo.toml:
	anyhow
	tokio

If you believe cargo-machete has detected an unused dependency incorrectly,
you can add the dependency to the list of dependencies to ignore in the
`[package.metadata.cargo-machete]` section of the appropriate Cargo.toml.
For example:

[package.metadata.cargo-machete]
ignored = ["prost"]

You can also try running it with the `--with-metadata` flag for better accuracy,
though this may modify your Cargo.lock files.

Done!
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 1

- Removed `anyhow` dependency (only used by deleted binary)
- Removed `tokio` dependency (only used by deleted binary)
- Fixes cargo-machete pipeline check
- All tests pass and inspect command still works correctly

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Please address this pipeline failure:

Fixed in commit e251ca7. Removed anyhow and tokio dependencies from crates/component2json/Cargo.toml as they were only used by the deleted binary. The library now only depends on what it actually uses. Verified with cargo machete - no unused dependencies detected.

@Mossaka Mossaka merged commit 723a08d into main Nov 1, 2025
15 checks passed
@Mossaka Mossaka deleted the copilot/add-component2json-subcommand branch November 1, 2025 19:15
Mossaka pushed a commit to Mossaka/wassette that referenced this pull request Feb 2, 2026
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