Add documentation and cleanup for setAdditionalContext#40
Open
robertson-waweru wants to merge 5 commits intosalesforce:devfrom
Open
Add documentation and cleanup for setAdditionalContext#40robertson-waweru wants to merge 5 commits intosalesforce:devfrom
robertson-waweru wants to merge 5 commits intosalesforce:devfrom
Conversation
- Add CopilotContext.ts with CopilotContextVariable and CopilotAdditionalContext interfaces - Add CopilotContextVariableType enum with Android SDK type names (Text, Number, Boolean, etc.) - Export types from types/index.ts and src/index.ts - Add comprehensive JSDoc with examples and type mappings Establishes type contract for additional context feature.
- Add setAdditionalContext React method to AgentforceModule - Convert NSDictionary to AgentforceVariable array with JSEncodableValue enum - Handle value type conversion (string, number, boolean, array, object) - Validate conversation exists before applying context - Add method declaration to AgentforceModule.m iOS implementation of additional context support.
- Add setAdditionalContext React method to AgentforceModule.kt - Convert ReadableMap to CopilotAdditionalContext object - Import SDK classes: CopilotAdditionalContext, CopilotContextVariable - Handle multiple value types (String, Number, Boolean, Map, Array) - Validate conversation exists before applying context - Use coroutine scope for async context setting Android implementation of additional context support.
- Add setAdditionalContext method to AgentforceService - Import and re-export CopilotAdditionalContext types - Add validation for context structure and variables - Add comprehensive JSDoc documentation with examples - Handle errors gracefully with clear messages - Log context application for debugging Completes JS bridge integration for W-21447588 and W-21447589.
- Add succinct API documentation to root README (18 lines) - Add comprehensive documentation to bridge README with examples - Include supported type reference and platform notes - Remove unused CopilotAdditionalContext import from SettingsScreen - Document common use cases and error handling Completes W-21447588 and W-21447589 documentation. Developers can now integrate additional context in their apps.
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
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.
Part 5 of stacked PRs for additional context support (W-21447588, W-21447589).
Changes
Testing
Stack Context
Depends on: #36 (TypeScript types), #37 (iOS bridge), #38 (Android bridge), #39 (JS bridge) - merge in order
Final PR in stack
Completes W-21447588 and W-21447589 with full documentation.
Developers can now integrate additional context in their React Native apps.
70 lines added