diff --git a/refact-agent/gui/generated/documents.ts b/refact-agent/gui/generated/documents.ts index edca6a5a4..199a4c760 100644 --- a/refact-agent/gui/generated/documents.ts +++ b/refact-agent/gui/generated/documents.ts @@ -313,6 +313,7 @@ export type FMcpServerSubs = { export type FModelItem = { __typename?: 'FModelItem'; + provm_caps: Scalars['JSON']['output']; provm_name: Scalars['String']['output']; }; @@ -1489,7 +1490,7 @@ export type ModelsForExpertQueryVariables = Exact<{ }>; -export type ModelsForExpertQuery = { __typename?: 'Query', expert_choice_consequences: { __typename?: 'FExpertChoiceConsequences', models: Array<{ __typename?: 'FModelItem', provm_name: string }> } }; +export type ModelsForExpertQuery = { __typename?: 'Query', expert_choice_consequences: { __typename?: 'FExpertChoiceConsequences', models: Array<{ __typename?: 'FModelItem', provm_name: string, provm_caps: any }> } }; export type ToolsForGroupQueryVariables = Exact<{ located_fgroup_id: Scalars['String']['input']; @@ -1534,7 +1535,7 @@ export const MessagesSubscriptionDocument = {"kind":"Document","definitions":[{" export const MessageCreateMultipleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MessageCreateMultiple"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FThreadMultipleMessagesInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_messages_create_multiple"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode; export const ThreadPatchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ThreadPatch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"message"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_patch"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"patch"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"ft_error"},"value":{"kind":"Variable","name":{"kind":"Name","value":"message"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ft_id"}}]}}]}}]} as unknown as DocumentNode; export const ExpertsForGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExpertsForGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"experts_effective_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"located_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fexp_id"}},{"kind":"Field","name":{"kind":"Name","value":"fexp_name"}}]}}]}}]} as unknown as DocumentNode; -export const ModelsForExpertDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModelsForExpert"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"expert_choice_consequences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fexp_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"inside_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"provm_name"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ModelsForExpertDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModelsForExpert"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"expert_choice_consequences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fexp_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"inside_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"provm_name"}},{"kind":"Field","name":{"kind":"Name","value":"provm_caps"}}]}}]}}]}}]} as unknown as DocumentNode; export const ToolsForGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ToolsForGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cloud_tools_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"located_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"include_offline"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ctool_confirmed_exists_ts"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_description"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_id"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_name"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_parameters"}},{"kind":"Field","name":{"kind":"Name","value":"located_fgroup_id"}},{"kind":"Field","name":{"kind":"Name","value":"owner_fuser_id"}}]}}]}}]} as unknown as DocumentNode; export const ThreadConfirmationResponseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ThreadConfirmationResponse"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"confirmation_response"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ft_id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_set_confirmation_response"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ft_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ft_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"confirmation_response"},"value":{"kind":"Variable","name":{"kind":"Name","value":"confirmation_response"}}}]}]}}]} as unknown as DocumentNode; export const BasicStuffDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BasicStuff"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"query_basic_stuff"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fuser_id"}},{"kind":"Field","name":{"kind":"Name","value":"my_own_ws_id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ws_id"}},{"kind":"Field","name":{"kind":"Name","value":"ws_owner_fuser_id"}},{"kind":"Field","name":{"kind":"Name","value":"ws_root_group_id"}},{"kind":"Field","name":{"kind":"Name","value":"root_group_name"}},{"kind":"Field","name":{"kind":"Name","value":"have_coins_exactly"}},{"kind":"Field","name":{"kind":"Name","value":"have_coins_enough"}},{"kind":"Field","name":{"kind":"Name","value":"have_admin"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/refact-agent/gui/generated/graphql/gql.ts b/refact-agent/gui/generated/graphql/gql.ts index d3a1ac1d2..ba4653472 100644 --- a/refact-agent/gui/generated/graphql/gql.ts +++ b/refact-agent/gui/generated/graphql/gql.ts @@ -14,10 +14,10 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size */ type Documents = { - "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}": typeof types.ThreadsPageSubsDocument, + "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n provm_caps\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}": typeof types.ThreadsPageSubsDocument, }; const documents: Documents = { - "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}": types.ThreadsPageSubsDocument, + "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n provm_caps\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}": types.ThreadsPageSubsDocument, }; /** @@ -37,7 +37,7 @@ export function graphql(source: string): unknown; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}"): (typeof documents)["subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}"]; +export function graphql(source: "subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n provm_caps\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}"): (typeof documents)["subscription ThreadsPageSubs($located_fgroup_id: String!, $limit: Int!) {\n threads_in_group(located_fgroup_id: $located_fgroup_id, limit: $limit) {\n news_action\n news_payload_id\n news_payload {\n owner_fuser_id\n owner_shared\n ft_id\n ft_title\n ft_error\n ft_updated_ts\n ft_locked_by\n ft_need_assistant\n ft_need_tool_calls\n ft_archived_ts\n ft_created_ts\n }\n }\n}\n\nmutation DeleteThread($id: String!) {\n thread_delete(id: $id)\n}\n\nmutation CreateThread($input: FThreadInput!) {\n thread_create(input: $input) {\n ft_id\n }\n}\n\nsubscription MessagesSubscription($ft_id: String!, $want_deltas: Boolean!) {\n comprehensive_thread_subs(ft_id: $ft_id, want_deltas: $want_deltas) {\n news_action\n news_payload_id\n news_payload_thread_message {\n ft_app_specific\n ftm_belongs_to_ft_id\n ftm_alt\n ftm_num\n ftm_prev_alt\n ftm_role\n ftm_content\n ftm_tool_calls\n ftm_call_id\n ftm_usage\n ftm_created_ts\n ftm_user_preferences\n }\n stream_delta {\n ftm_role\n ftm_content\n }\n news_payload_thread {\n located_fgroup_id\n ft_id\n ft_need_user\n ft_need_assistant\n ft_fexp_id\n ft_confirmation_request\n ft_confirmation_response\n ft_title\n }\n }\n}\n\nmutation MessageCreateMultiple($input: FThreadMultipleMessagesInput!) {\n thread_messages_create_multiple(input: $input)\n}\n\nmutation ThreadPatch($id: String!, $message: String!) {\n thread_patch(id: $id, patch: {ft_error: $message}) {\n ft_id\n }\n}\n\nquery ExpertsForGroup($located_fgroup_id: String!) {\n experts_effective_list(located_fgroup_id: $located_fgroup_id) {\n fexp_id\n fexp_name\n }\n}\n\nquery ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) {\n expert_choice_consequences(\n fexp_id: $fexp_id\n inside_fgroup_id: $inside_fgroup_id\n ) {\n models {\n provm_name\n provm_caps\n }\n }\n}\n\nquery ToolsForGroup($located_fgroup_id: String!) {\n cloud_tools_list(located_fgroup_id: $located_fgroup_id, include_offline: false) {\n ctool_confirmed_exists_ts\n ctool_description\n ctool_id\n ctool_name\n ctool_parameters\n located_fgroup_id\n owner_fuser_id\n }\n}\n\nmutation ThreadConfirmationResponse($confirmation_response: String = \"\", $ft_id: String = \"\") {\n thread_set_confirmation_response(\n ft_id: $ft_id\n confirmation_response: $confirmation_response\n )\n}\n\nquery BasicStuff {\n query_basic_stuff {\n fuser_id\n my_own_ws_id\n workspaces {\n ws_id\n ws_owner_fuser_id\n ws_root_group_id\n root_group_name\n have_coins_exactly\n have_coins_enough\n have_admin\n }\n }\n}\n\nmutation CreateWorkSpaceGroup($fgroup_name: String!, $fgroup_parent_id: String!) {\n group_create(\n input: {fgroup_name: $fgroup_name, fgroup_parent_id: $fgroup_parent_id}\n ) {\n fgroup_id\n fgroup_name\n ws_id\n fgroup_parent_id\n fgroup_created_ts\n }\n}\n\nsubscription WorkspaceTree($ws_id: String!) {\n tree_subscription(ws_id: $ws_id) {\n treeupd_action\n treeupd_id\n treeupd_path\n treeupd_type\n treeupd_title\n }\n}"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/refact-agent/gui/generated/graphql/graphql.ts b/refact-agent/gui/generated/graphql/graphql.ts index 20a8ca809..5925720e3 100644 --- a/refact-agent/gui/generated/graphql/graphql.ts +++ b/refact-agent/gui/generated/graphql/graphql.ts @@ -315,6 +315,7 @@ export type FMcpServerSubs = { export type FModelItem = { __typename?: 'FModelItem'; + provm_caps: Scalars['JSON']['output']; provm_name: Scalars['String']['output']; }; @@ -1491,7 +1492,7 @@ export type ModelsForExpertQueryVariables = Exact<{ }>; -export type ModelsForExpertQuery = { __typename?: 'Query', expert_choice_consequences: { __typename?: 'FExpertChoiceConsequences', models: Array<{ __typename?: 'FModelItem', provm_name: string }> } }; +export type ModelsForExpertQuery = { __typename?: 'Query', expert_choice_consequences: { __typename?: 'FExpertChoiceConsequences', models: Array<{ __typename?: 'FModelItem', provm_name: string, provm_caps: any }> } }; export type ToolsForGroupQueryVariables = Exact<{ located_fgroup_id: Scalars['String']['input']; @@ -1536,7 +1537,7 @@ export const MessagesSubscriptionDocument = {"kind":"Document","definitions":[{" export const MessageCreateMultipleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MessageCreateMultiple"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FThreadMultipleMessagesInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_messages_create_multiple"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode; export const ThreadPatchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ThreadPatch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"message"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_patch"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"patch"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"ft_error"},"value":{"kind":"Variable","name":{"kind":"Name","value":"message"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ft_id"}}]}}]}}]} as unknown as DocumentNode; export const ExpertsForGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExpertsForGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"experts_effective_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"located_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fexp_id"}},{"kind":"Field","name":{"kind":"Name","value":"fexp_name"}}]}}]}}]} as unknown as DocumentNode; -export const ModelsForExpertDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModelsForExpert"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"expert_choice_consequences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fexp_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"inside_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"provm_name"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ModelsForExpertDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModelsForExpert"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"expert_choice_consequences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fexp_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fexp_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"inside_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inside_fgroup_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"provm_name"}},{"kind":"Field","name":{"kind":"Name","value":"provm_caps"}}]}}]}}]}}]} as unknown as DocumentNode; export const ToolsForGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ToolsForGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cloud_tools_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"located_fgroup_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"located_fgroup_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"include_offline"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ctool_confirmed_exists_ts"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_description"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_id"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_name"}},{"kind":"Field","name":{"kind":"Name","value":"ctool_parameters"}},{"kind":"Field","name":{"kind":"Name","value":"located_fgroup_id"}},{"kind":"Field","name":{"kind":"Name","value":"owner_fuser_id"}}]}}]}}]} as unknown as DocumentNode; export const ThreadConfirmationResponseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ThreadConfirmationResponse"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"confirmation_response"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ft_id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread_set_confirmation_response"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ft_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ft_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"confirmation_response"},"value":{"kind":"Variable","name":{"kind":"Name","value":"confirmation_response"}}}]}]}}]} as unknown as DocumentNode; export const BasicStuffDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BasicStuff"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"query_basic_stuff"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fuser_id"}},{"kind":"Field","name":{"kind":"Name","value":"my_own_ws_id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ws_id"}},{"kind":"Field","name":{"kind":"Name","value":"ws_owner_fuser_id"}},{"kind":"Field","name":{"kind":"Name","value":"ws_root_group_id"}},{"kind":"Field","name":{"kind":"Name","value":"root_group_name"}},{"kind":"Field","name":{"kind":"Name","value":"have_coins_exactly"}},{"kind":"Field","name":{"kind":"Name","value":"have_coins_enough"}},{"kind":"Field","name":{"kind":"Name","value":"have_admin"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/refact-agent/gui/generated/schema.graphql b/refact-agent/gui/generated/schema.graphql index 95ce5e3b4..caa7223bb 100644 --- a/refact-agent/gui/generated/schema.graphql +++ b/refact-agent/gui/generated/schema.graphql @@ -278,6 +278,7 @@ type FMcpServerSubs { } type FModelItem { + provm_caps: JSON! provm_name: String! } diff --git a/refact-agent/gui/src/__fixtures__/msw.ts b/refact-agent/gui/src/__fixtures__/msw.ts index 527109381..23e4e79fe 100644 --- a/refact-agent/gui/src/__fixtures__/msw.ts +++ b/refact-agent/gui/src/__fixtures__/msw.ts @@ -262,21 +262,42 @@ export const ModelsForExpert = graphql.query(ModelsForExpertDocument, () => { models: [ { provm_name: "claude-3-7-sonnet-20250219", + provm_caps: { + modelcap_input_images: true, + modelcap_reasoning_effort: true, + }, }, { provm_name: "claude-sonnet-4-20250514", + provm_caps: { + modelcap_input_images: true, + modelcap_reasoning_effort: true, + }, }, { provm_name: "gpt-4.1", + provm_caps: { + modelcap_input_images: true, + }, }, { provm_name: "gpt-4.1-mini", + provm_caps: { + modelcap_input_images: true, + }, }, { provm_name: "nebius/Qwen/Qwen3-235B-A22B", + provm_caps: { + modelcap_input_images: false, + }, }, { provm_name: "o4-mini", + provm_caps: { + modelcap_input_images: true, + modelcap_reasoning_effort: true, + }, }, ], }, diff --git a/refact-agent/gui/src/components/ChatForm/ChatForm.tsx b/refact-agent/gui/src/components/ChatForm/ChatForm.tsx index af61ef60c..902160292 100644 --- a/refact-agent/gui/src/components/ChatForm/ChatForm.tsx +++ b/refact-agent/gui/src/components/ChatForm/ChatForm.tsx @@ -38,7 +38,7 @@ import { InformationCallout, } from "../Callout/Callout"; import { ToolConfirmation } from "./ToolConfirmation"; -import { FileList } from "../Dropzone"; +import { AttachImagesButton, FileList } from "../Dropzone"; import { selectIsStreaming, selectIsWaiting, @@ -46,11 +46,13 @@ import { selectToolConfirmationRequests, } from "../../features/ThreadMessages"; import { AgentCapabilities } from "./AgentCapabilities/AgentCapabilities"; -import { TokensPreview } from "./TokensPreview"; +// import { TokensPreview } from "./TokensPreview"; import classNames from "classnames"; import { ExpertSelect } from "../../features/ExpertsAndModels/Experts"; import { ModelsForExpert } from "../../features/ExpertsAndModels"; +import { useCapabilitiesForModel } from "../../hooks"; +import { useAttachedImages } from "../../hooks/useAttachedImages"; export type ChatFormProps = { onSubmit: (str: string) => void; @@ -67,6 +69,8 @@ export const ChatForm: React.FC = ({ const isStreaming = useAppSelector(selectIsStreaming); const isWaiting = useAppSelector(selectIsWaiting); // const { isMultimodalitySupportedForCurrentModel } = useCapsForToolUse(); + const capabilities = useCapabilitiesForModel(); + const config = useConfig(); const globalError = useAppSelector(getErrorMessage); @@ -128,26 +132,26 @@ export const ChatForm: React.FC = ({ messagesAreEmpty, ]); - // const { processAndInsertImages } = useAttachedImages(); + const { processAndInsertImages } = useAttachedImages(); // TODO: disable pasting file - // const handlePastingFile = useCallback( - // (event: React.ClipboardEvent) => { - // if (!isMultimodalitySupportedForCurrentModel) return; - // const files: File[] = []; - // const items = event.clipboardData.items; - // for (const item of items) { - // if (item.kind === "file") { - // const file = item.getAsFile(); - // file && files.push(file); - // } - // } - // if (files.length > 0) { - // event.preventDefault(); - // processAndInsertImages(files); - // } - // }, - // [processAndInsertImages, isMultimodalitySupportedForCurrentModel], - // ); + const handlePastingFile = useCallback( + (event: React.ClipboardEvent) => { + if (!capabilities.multimodal) return; + const files: File[] = []; + const items = event.clipboardData.items; + for (const item of items) { + if (item.kind === "file") { + const file = item.getAsFile(); + file && files.push(file); + } + } + if (files.length > 0) { + event.preventDefault(); + processAndInsertImages(files); + } + }, + [capabilities.multimodal, processAndInsertImages], + ); const { checkboxes, @@ -356,7 +360,7 @@ export const ChatForm: React.FC = ({ {...props} autoFocus={autoFocus} style={{ boxShadow: "none", outline: "none" }} - // onPaste={handlePastingFile} + onPaste={handlePastingFile} /> )} /> @@ -370,9 +374,9 @@ export const ChatForm: React.FC = ({ {/* */} - + /> */} {/* = ({ onClick={onClose} /> )} - {/** TODO: multi modality */} - {/* {config.features?.images !== false && - isMultimodalitySupportedForCurrentModel && ( - - )} */} + + {capabilities.multimodal && } {/* TODO: Reserved space for microphone button coming later on */} { + return maybeAddImagesToContent(query); + }, [maybeAddImagesToContent, query]); const messagesToSend = formatMessagesForLsp(messages); const isWaiting = useAppSelector(selectIsWaiting); const isStreaming = useAppSelector(selectIsStreaming); // TODO: attach images const { data } = commandsApi.useGetCommandPreviewQuery( - { messages: [...messagesToSend, { role: "user", content: query }] }, + { + messages: [ + ...messagesToSend, + { role: "user", content: contentWithImages }, + ], + }, { skip: isWaiting || isStreaming, }, diff --git a/refact-agent/gui/src/components/Dropzone/Dropzone.tsx b/refact-agent/gui/src/components/Dropzone/Dropzone.tsx index 959cd37ad..fd63403f4 100644 --- a/refact-agent/gui/src/components/Dropzone/Dropzone.tsx +++ b/refact-agent/gui/src/components/Dropzone/Dropzone.tsx @@ -4,9 +4,8 @@ import { Cross1Icon, ImageIcon } from "@radix-ui/react-icons"; import { DropzoneInputProps, FileRejection, useDropzone } from "react-dropzone"; import { useAttachedImages } from "../../hooks/useAttachedImages"; import { TruncateLeft } from "../Text"; - -// import { useCapsForToolUse } from "../../hooks"; import { useAttachedFiles } from "../ChatForm/useCheckBoxes"; +import { useCapabilitiesForModel } from "../../hooks"; export const FileUploadContext = createContext<{ open: () => void; @@ -21,13 +20,11 @@ export const DropzoneProvider: React.FC< React.PropsWithChildren<{ asChild?: boolean }> > = ({ asChild, ...props }) => { const { setError, processAndInsertImages } = useAttachedImages(); - // const { isMultimodalitySupportedForCurrentModel } = useCapsForToolUse(); - const isMultimodalitySupportedForCurrentModel = false; + const capabilities = useCapabilitiesForModel(); const onDrop = useCallback( (acceptedFiles: File[], fileRejections: FileRejection[]): void => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isMultimodalitySupportedForCurrentModel) return; + if (!capabilities.multimodal) return; processAndInsertImages(acceptedFiles); if (fileRejections.length) { @@ -40,7 +37,7 @@ export const DropzoneProvider: React.FC< setError(rejectedFileMessage.join("\n")); } }, - [processAndInsertImages, setError, isMultimodalitySupportedForCurrentModel], + [capabilities.multimodal, processAndInsertImages, setError], ); // TODO: disable when chat is busy diff --git a/refact-agent/gui/src/hooks/index.ts b/refact-agent/gui/src/hooks/index.ts index 7015124cc..b0bd97669 100644 --- a/refact-agent/gui/src/hooks/index.ts +++ b/refact-agent/gui/src/hooks/index.ts @@ -32,3 +32,5 @@ export * from "./useBasicStuffQuery"; export * from "./useSendMessages"; export * from "./useIdForThread"; export * from "./useToolsForGroup"; +export * from "./useAttachImages"; +export * from "./useCapabilitiesForModel"; diff --git a/refact-agent/gui/src/hooks/useAttachImages.ts b/refact-agent/gui/src/hooks/useAttachImages.ts new file mode 100644 index 000000000..3b679e7ed --- /dev/null +++ b/refact-agent/gui/src/hooks/useAttachImages.ts @@ -0,0 +1,62 @@ +import { useCallback } from "react"; +import { + isUserMessage, + type UserMessage, + type UserMessageContentWithImage, +} from "../services/refact/types"; +import { useAppSelector } from "../hooks/useAppSelector"; +import { selectAllImages } from "../features/AttachedImages/imagesSlice"; +import { lastIndex } from "../utils/takeFromLast"; + +export function useAttachImages() { + const attachedImages = useAppSelector(selectAllImages); + const maybeAddImagesToContent = useCallback( + (question: string): UserMessage["ftm_content"] => { + if (attachedImages.length === 0) { + return question; + } + + const images = attachedImages.reduce( + (acc, image) => { + if (typeof image.content !== "string") return acc; + return [ + ...acc, + { + type: "image_url", + image_url: { url: image.content }, + }, + ]; + }, + [], + ); + + if (images.length === 0) { + return question; + } + + return [...images, { type: "text", text: question }]; + }, + [attachedImages], + ); + + const maybeAddImagesToMessages = useCallback( + (messages: { ftm_role: string; ftm_content: unknown }[]) => { + const lastUserMessageIndex = lastIndex(messages, isUserMessage); + if (lastUserMessageIndex === -1) return messages; + const messagesWithImages = messages.map((message, index) => { + if (index !== lastUserMessageIndex) return message; + if (!isUserMessage(message)) return message; + if (typeof message.ftm_content !== "string") return message; + const content = maybeAddImagesToContent(message.ftm_content); + return { + ...message, + ftm_content: content, + }; + }); + return messagesWithImages; + }, + [maybeAddImagesToContent], + ); + + return { maybeAddImagesToContent, maybeAddImagesToMessages }; +} diff --git a/refact-agent/gui/src/hooks/useAttachedImages.ts b/refact-agent/gui/src/hooks/useAttachedImages.ts index 6ec12d733..ba4f73be0 100644 --- a/refact-agent/gui/src/hooks/useAttachedImages.ts +++ b/refact-agent/gui/src/hooks/useAttachedImages.ts @@ -10,13 +10,13 @@ import { } from "../features/AttachedImages/imagesSlice"; import { setError } from "../features/Errors/errorsSlice"; import { setInformation } from "../features/Errors/informationSlice"; -// import { useCapsForToolUse } from "./useCapsForToolUse"; +import { useCapabilitiesForModel } from "./useCapabilitiesForModel"; // TODO: maybe remove export function useAttachedImages() { const images = useAppSelector(selectAllImages); // const { isMultimodalitySupportedForCurrentModel } = useCapsForToolUse(); - const isMultimodalitySupportedForCurrentModel = false; + const capabilities = useCapabilitiesForModel(); const dispatch = useAppDispatch(); const removeImage = useCallback( @@ -64,12 +64,11 @@ export function useAttachedImages() { ); useEffect(() => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isMultimodalitySupportedForCurrentModel) { + if (!capabilities.multimodal) { const action = resetAttachedImagesSlice(); dispatch(action); } - }, [isMultimodalitySupportedForCurrentModel, dispatch]); + }, [dispatch, capabilities.multimodal]); return { images, diff --git a/refact-agent/gui/src/hooks/useCapabilitiesForModel.ts b/refact-agent/gui/src/hooks/useCapabilitiesForModel.ts new file mode 100644 index 000000000..c40e99464 --- /dev/null +++ b/refact-agent/gui/src/hooks/useCapabilitiesForModel.ts @@ -0,0 +1,60 @@ +import { useMemo } from "react"; +import { + selectCurrentExpert, + selectCurrentModel, +} from "../features/ExpertsAndModels/expertsSlice"; +import { selectActiveGroup } from "../features/Teams/teamsSlice"; +import { graphqlQueriesAndMutations } from "../services/graphql/queriesAndMutationsApi"; +import { useAppSelector } from "./useAppSelector"; + +type ModelCapabilities = { + modelcaps_input_images?: boolean; + modelcaps_reasoning_effort?: boolean; +}; +function isModelCapabilities(obj: unknown): obj is ModelCapabilities { + if (!obj) return false; + if (typeof obj !== "object") return false; + if ( + "modelcaps_input_images" in obj && + typeof obj.modelcaps_input_images !== "boolean" + ) { + return false; + } + if ( + "modelcaps_reasoning_effort" in obj && + typeof obj.modelcaps_reasoning_effort !== "boolean" + ) { + return false; + } + return true; +} + +export function useCapabilitiesForModel() { + const selectedExpert = useAppSelector(selectCurrentExpert); + const selectedModel = useAppSelector(selectCurrentModel); + const workspace = useAppSelector(selectActiveGroup); + const expertsQuery = graphqlQueriesAndMutations.useModelsForExpertQuery( + { inside_fgroup_id: workspace?.id ?? "", fexp_id: selectedExpert ?? "" }, + { skip: !workspace?.id || !selectedExpert }, + ); + + const capsForModel = useMemo(() => { + const model = expertsQuery.data?.expert_choice_consequences.models.find( + (model) => model.provm_name === selectedModel, + ); + + if (isModelCapabilities(model?.provm_caps)) { + return model.provm_caps; + } + return { + modelcaps_input_images: false, + modelcaps_reasoning_effort: false, + }; + }, [expertsQuery.data?.expert_choice_consequences.models, selectedModel]); + + return { + multimodal: capsForModel.modelcaps_input_images ?? false, + thinking: capsForModel.modelcaps_reasoning_effort ?? false, + loading: expertsQuery.isFetching || expertsQuery.isFetching, + }; +} diff --git a/refact-agent/gui/src/hooks/useSendMessages.ts b/refact-agent/gui/src/hooks/useSendMessages.ts index e2f34772b..417f7b67e 100644 --- a/refact-agent/gui/src/hooks/useSendMessages.ts +++ b/refact-agent/gui/src/hooks/useSendMessages.ts @@ -11,13 +11,9 @@ import { selectCurrentModel, } from "../features/ExpertsAndModels/expertsSlice"; import { Tool } from "../services/refact/tools"; -// import { selectAllImages } from "../features/AttachedImages/imagesSlice"; -// import { -// UserMessage, -// UserMessageContentWithImage, -// } from "../services/refact/types"; import { useIdForThread } from "./useIdForThread"; import { graphqlQueriesAndMutations } from "../services/graphql/queriesAndMutationsApi"; +import { useAttachImages } from "./useAttachImages"; // TODO: since this is called twice it opens two sockets :/ move sendMessage and sendMultipleMessage to their own hooks @@ -44,38 +40,8 @@ export function useSendMessages() { const [getTools, _getToolsResult] = useGetToolsLazyQuery(); - // TODO: enable this - // const maybeAddImagesToQuestion = useCallback( - // (question: string): UserMessage => { - // if (attachedImages.length === 0) - // return { - // ftm_role: "user" as const, - // ftm_content: question, - // checkpoints: [], - // }; - - // const images = attachedImages.reduce( - // (acc, image) => { - // if (typeof image.content !== "string") return acc; - // return acc.concat({ - // type: "image_url", - // image_url: { url: image.content }, - // }); - // }, - // [], - // ); - - // if (images.length === 0) - // return { ftm_role: "user", ftm_content: question, checkpoints: [] }; - - // return { - // ftm_role: "user", - // ftm_content: [...images, { type: "text", text: question }], - // checkpoints: [], - // }; - // }, - // [attachedImages], - // ); + const { maybeAddImagesToMessages, maybeAddImagesToContent } = + useAttachImages(); const sendMultipleMessages = useCallback( async (messages: { ftm_role: string; ftm_content: unknown }[]) => { @@ -85,10 +51,11 @@ export function useSendMessages() { }, []); const enabledTools = allTools.filter((tool) => tool.enabled); const specs = enabledTools.map((tool) => tool.spec); + const maybeMessageWithImages = maybeAddImagesToMessages(messages); if (leafMessage.endAlt === 0 && leafMessage.endNumber === 0) { void createThreadWitMultipleMessages({ - messages, + messages: maybeMessageWithImages, expertId: selectedExpert ?? "", model: selectedModel ?? "", tools: specs, @@ -97,7 +64,7 @@ export function useSendMessages() { return; } - const inputMessages = messages.map((message, index) => { + const inputMessages = maybeMessageWithImages.map((message, index) => { return { ftm_alt: leafMessage.endAlt, ftm_app_specific: JSON.stringify(appSpecific), @@ -131,6 +98,7 @@ export function useSendMessages() { leafMessage.endAlt, leafMessage.endNumber, leafMessage.endPrevAlt, + maybeAddImagesToMessages, maybeFtId, selectedExpert, selectedModel, @@ -147,11 +115,11 @@ export function useSendMessages() { const enabledTools = allTools.filter((tool) => tool.enabled); const specs = enabledTools.map((tool) => tool.spec); - // TODO: add images + const contentWithImage = maybeAddImagesToContent(content); if (leafMessage.endAlt === 0 && leafMessage.endNumber === 0) { void createThreadWithMessage({ - content, + content: contentWithImage, expertId: selectedExpert ?? "", model: selectedModel ?? "", tools: specs, @@ -163,7 +131,7 @@ export function useSendMessages() { ftm_app_specific: JSON.stringify(appSpecific), ftm_belongs_to_ft_id: maybeFtId ?? "", // ftId.ft_id, ftm_call_id: "", - ftm_content: JSON.stringify(content), + ftm_content: JSON.stringify(contentWithImage), ftm_num: leafMessage.endNumber + 1, ftm_prev_alt: leafMessage.endPrevAlt, ftm_provenance: JSON.stringify(window.__REFACT_CHAT_VERSION__), // extra json data @@ -190,6 +158,7 @@ export function useSendMessages() { leafMessage.endAlt, leafMessage.endNumber, leafMessage.endPrevAlt, + maybeAddImagesToContent, maybeFtId, selectedExpert, selectedModel, diff --git a/refact-agent/gui/src/services/graphql/flexus.graphql b/refact-agent/gui/src/services/graphql/flexus.graphql index e29b3a9ac..7f30b81e9 100644 --- a/refact-agent/gui/src/services/graphql/flexus.graphql +++ b/refact-agent/gui/src/services/graphql/flexus.graphql @@ -93,6 +93,7 @@ query ModelsForExpert($fexp_id: String!, $inside_fgroup_id: String!) { ) { models { provm_name + provm_caps } } } diff --git a/refact-agent/gui/src/services/graphql/queriesAndMutationsApi.ts b/refact-agent/gui/src/services/graphql/queriesAndMutationsApi.ts index 01af928c6..4d10a5b50 100644 --- a/refact-agent/gui/src/services/graphql/queriesAndMutationsApi.ts +++ b/refact-agent/gui/src/services/graphql/queriesAndMutationsApi.ts @@ -41,6 +41,7 @@ import { type RootState } from "../../app/store"; import { setThreadFtId } from "../../features/ThreadMessages"; import { Tool } from "../refact/tools"; import type { IntegrationMeta } from "../../features/ThreadMessages"; +import { UserMessage } from "../refact/types"; async function fetchAppSearchableId(apiKey: string, port: number) { const appIdUrl = `http://127.0.0.1:${port}/v1/get-app-searchable-id`; @@ -291,7 +292,7 @@ export const graphqlQueriesAndMutations = createApi({ createThreadWithSingleMessage: builder.mutation< MessageCreateMultipleMutation & CreateThreadMutation, { - content: string; + content: UserMessage["ftm_content"]; expertId: string; model: string; tools: (Tool["spec"] | FCloudTool)[]; diff --git a/refact-agent/gui/src/utils/takeFromLast.ts b/refact-agent/gui/src/utils/takeFromLast.ts index 20ba649fc..96eb7379d 100644 --- a/refact-agent/gui/src/utils/takeFromLast.ts +++ b/refact-agent/gui/src/utils/takeFromLast.ts @@ -1,4 +1,4 @@ -function lastIndex(arr: A[], predicate: (a: A) => boolean): number { +export function lastIndex(arr: A[], predicate: (a: A) => boolean): number { return arr.reduce((acc, cur, index) => { if (predicate(cur)) return index; return acc;