Skip to content

feat(truapi): expose current product context - #504

Open
pgherveou wants to merge 6 commits into
mainfrom
feat/product-context
Open

feat(truapi): expose current product context#504
pgherveou wants to merge 6 commits into
mainfrom
feat/product-context

Conversation

@pgherveou

@pgherveou pgherveou commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add system.getProductContext() so products can query the full canonical identifier already bound to the host runtime.

  • return { productId } before account pairing, without product-side network detection or normalization
  • add the concise RFC, generated protocol bindings, tests, and release metadata

Verification

Workspace build, strict clippy, all-target tests, WASM check, codegen goldens, and TypeScript package builds and tests pass.

Closes #503

Authored with assistance from Codex.

@pgherveou
pgherveou requested review from a team August 25, 2026 11:50
@pgherveou pgherveou added the rfc label Aug 25, 2026
@pgherveou pgherveou mentioned this pull request Aug 25, 2026
2 tasks
@pgherveou
pgherveou marked this pull request as draft August 25, 2026 11:58
Comment thread docs/rfcs/product-context.md Outdated
@pgherveou
pgherveou marked this pull request as ready for review August 25, 2026 12:19

@valentinfernandez1 valentinfernandez1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I cross validated with cli host and it works as expected. Just have one small nit

Great work 👍🏻

Comment thread rust/crates/truapi/src/v01/system.rs Outdated
@pgherveou

Copy link
Copy Markdown
Collaborator Author

@valentunn @johnthecat implemented the quick RFC from #503 can you add your +1 so we can merge this


/// Response containing the product context bound to the current host runtime.
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)]
pub struct GetProductContextResponse {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetProductContextResponse is the only payload type here without a domain prefix, the rest are Host* or Remote*, and the versioned enum wrapping this one is HostGetProductContextResponse. Rename to HostGetProductContextResponse for consistency?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah right, ideally we would just drop all these Host prefix, but maybe we can just keep it for now

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: Current product context

3 participants