mattermost-mobile/app/constants
Nick Misasi 9e0735c00d
Add two-phase tool call approval for agents in channels (#9506)
* Add two-phase tool call approval for agents in channels

Implements the mobile counterpart to the webapp's multiplayer tool calling
feature. When a bot is @mentioned in a channel, tool call arguments and
results are redacted from other members. Only the invoker can approve/reject
tool execution (Phase 1) and decide whether to share results with the
channel (Phase 2).

See mattermost/mattermost-plugin-agents#491 for the server/webapp changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add tests for channel tool calling utilities and remote actions

Tests for isToolCallRedacted, isPendingToolResult, getToolApprovalStage,
mergeToolCalls utility functions and fetchToolCallPrivate,
fetchToolResultPrivate, submitToolResult remote actions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add e2e tests and testIDs for agent tool calls in channels

Adds detox e2e tests covering tool call card rendering, approval buttons,
result approval phase, and multi-tool-call scenarios. Adds testID props
to ToolApprovalSet and ToolCard components to support the e2e tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address PR review feedback for two-phase tool call approval

- Fix mergeToolCalls to preserve public-only tools instead of dropping them
- Fix stale closure race in handleToolDecision with functional setState
- Add forceLogoutIfNecessary to tool_private and tool_result remote actions
- Show snackbar on submit failure using existing error types
- Reset isDM in catch block to prevent stale state
- Sync animation shared values when isCollapsed changes externally
- Clear private data on streaming-to-persisted transition
- Wrap action buttons with usePreventDoubleTap
- Use toolCalls reference instead of toolCalls.length in effect dependency
- Fix grammar in warning callout ("its" -> "their")
- Change fontWeight from number to string per RN conventions

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address PR review feedback: withObservables HOC, memoization, typography

- Refactor AgentPost to use withObservables HOC for channel observation
  instead of useEffect+subscribe, providing isDM as a prop
- Memoize undecidedCount in ToolApprovalSet and move before early return
- Replace manual font styles with typography() utility in ToolCard

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 11:20:25 -05:00
..
about_links.ts Barebones code for v2 2020-11-17 14:20:58 -03:00
action_type.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
apps.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
autocomplete.test.ts [MM-49540] Message Priority Phase 3 (#7142) 2023-04-27 11:22:03 +00:00
autocomplete.ts Fix cannot search user when pressing space (#7486) 2023-08-09 11:38:06 +02:00
calls.ts Remove long deprecated Calls code (#8747) 2025-05-15 18:20:45 +02:00
categories.ts Refactor categories list (#9270) 2025-12-23 07:29:06 +02:00
channel.ts MM 45015 - auto follow threads (#7463) 2023-11-14 10:00:19 +01:00
config.ts [Gekidou MM-41093] CRT - WS Events, Actions, Queries, Thread Follow, Post Query (#6075) 2022-04-04 19:55:13 +05:30
custom_status.ts Remove tand prevent double tap (#9078) 2025-08-25 12:03:01 +02:00
database.ts Burn On Read Posts (#9307) 2025-12-11 09:42:16 +05:30
datetime.ts Gekidou CRT - Global threads screen (#6140) 2022-04-28 09:01:36 -04:00
deep_linking.ts Easy Login (#9261) 2025-11-20 12:38:06 +01:00
device.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
draft.ts Standardize tabs across different components (#8691) 2025-05-28 16:23:37 +02:00
emoji.ts Improve emoji picker performance introducing flashList (#8650) 2025-03-11 22:09:46 +08:00
events.ts feat: support fillewillbedownloaded and sendtoastmessage pluginapi (#9416) 2026-02-16 17:10:25 +01:00
files.ts Ability to show quick action and add files to edit post (#8926) 2025-06-25 16:04:08 +05:30
gallery.ts [MM-67056] Show actions on image gallery for android (#9386) 2026-01-12 14:52:41 +01:00
general.ts Add model mocks to TestHelper (#8715) 2025-03-28 09:40:08 +01:00
image.ts fix: fixed image overflow in message attachments (#8361) 2024-12-06 08:27:42 +02:00
index.ts [MM-60405] Crossteam search (#8411) 2025-02-05 13:46:38 -07:00
integrations.ts Add AppsForm and Interactive Dialogs (#6142) 2022-04-28 18:26:21 +02:00
launch.ts Add DeepLink support (#6869) 2022-12-16 18:57:15 +02:00
license.ts Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
list.ts [Gekidou] Sidebar Categories FlatList Optimisations (#6031) 2022-03-08 18:16:58 -03:00
members.ts [Gekidou - MM-47653] Implement Manage Members Screen (#6771) 2023-02-03 10:42:12 +02:00
navigation.ts Refactor NavigationStore (#6842) 2022-12-07 16:44:21 +02:00
network.ts show alert when server SSL is invalid or untrusted (#7533) 2023-09-07 06:23:34 -03:00
notification_level.ts Add GM as DM feature support (#7515) 2023-09-26 18:35:40 +02:00
permissions.ts [MM-67253] Add support for DMs and GMs for autotranslations (#9505) 2026-02-16 16:32:02 +01:00
post.ts Burn On Read Posts (#9307) 2025-12-11 09:42:16 +05:30
post_draft.ts Extra keyboard (#8348) 2024-11-29 11:58:13 +08:00
preferences.ts MM-37809 Update Default Themes (#7907) 2024-04-24 06:54:09 +08:00
profile.ts MM-40364 [Gekidou] - Image Picker for Edit Profile (#5901) 2022-01-28 16:06:50 +04:00
push_notification.ts Fix MM 56723 (#7883) 2024-04-24 17:12:56 +02:00
push_proxy.ts [Gekidou] [MM-41837] Add verification for push proxy and related interface (#6192) 2022-05-09 11:41:16 +02:00
reaction_picker.ts BottomSheet migration to react-native-bottom-sheet (#6907) 2023-01-05 09:51:51 +02:00
screens.ts feat: AI rewrite (#9280) 2026-02-16 16:48:57 +01:00
server_errors.ts Displayed channel related error with name field 2023-11-16 17:06:39 +05:30
snack_bar.ts Add two-phase tool call approval for agents in channels (#9506) 2026-02-19 11:20:25 -05:00
sso.ts Update the value for login type (#9329) 2025-12-12 16:26:22 +01:00
supported_server.ts Update supported ESR version (#9205) 2025-11-17 08:15:50 +02:00
team.ts [MM-60405] Crossteam search (#8411) 2025-02-05 13:46:38 -07:00
tooltip.ts Fix scheduled messages tooltip entering an infinite resize loop (#8877) 2025-05-23 13:05:31 +02:00
tutorial.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
versions.ts copy channel purpose text implemented (#7586) 2023-10-09 18:36:56 +02:00
view.ts Reduce channel banner height to 26px (#9520) 2026-02-18 13:43:01 -05:00
websocket.ts Add two-phase tool call approval for agents in channels (#9506) 2026-02-19 11:20:25 -05:00