@greatapps/greatagents-ui 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +204 -1
- package/dist/index.js +1797 -125
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +14 -0
- package/src/components/agents/agent-edit-form.tsx +4 -1
- package/src/components/agents/agent-form-dialog.tsx +5 -1
- package/src/components/agents/agent-objectives-list.tsx +15 -6
- package/src/components/agents/agent-prompt-editor.tsx +9 -5
- package/src/components/agents/agent-tabs.tsx +4 -4
- package/src/components/agents/agent-tools-list.tsx +12 -5
- package/src/components/agents/agents-table.tsx +7 -2
- package/src/components/capabilities/advanced-tab.tsx +82 -0
- package/src/components/capabilities/capabilities-tab.tsx +475 -0
- package/src/components/capabilities/integration-card.tsx +162 -0
- package/src/components/capabilities/integration-wizard.tsx +537 -0
- package/src/components/capabilities/integrations-tab.tsx +61 -0
- package/src/components/capabilities/types.ts +48 -0
- package/src/components/capabilities/wizard-steps/config-step.tsx +117 -0
- package/src/components/capabilities/wizard-steps/confirm-step.tsx +123 -0
- package/src/components/capabilities/wizard-steps/credentials-step.tsx +205 -0
- package/src/components/capabilities/wizard-steps/info-step.tsx +78 -0
- package/src/components/conversations/agent-conversations-table.tsx +13 -2
- package/src/components/conversations/conversation-view.tsx +2 -2
- package/src/components/tools/tool-credentials-form.tsx +34 -14
- package/src/components/tools/tool-form-dialog.tsx +9 -5
- package/src/components/tools/tools-table.tsx +8 -3
- package/src/data/integrations-registry.ts +23 -0
- package/src/hooks/index.ts +10 -0
- package/src/hooks/use-capabilities.ts +50 -0
- package/src/hooks/use-integrations.ts +114 -0
- package/src/index.ts +34 -0
- package/src/pages/agent-capabilities-page.tsx +159 -0
- package/src/pages/agent-detail-page.tsx +1 -0
- package/src/pages/index.ts +2 -0
- package/src/pages/integrations-management-page.tsx +166 -0
- package/src/types/capabilities.ts +32 -0
- package/src/types/index.ts +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,34 @@ import { DndContextProps, UniqueIdentifier, DragEndEvent, DragOverlay } from '@d
|
|
|
5
5
|
import { SortableContextProps } from '@dnd-kit/sortable';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
|
|
8
|
+
interface CapabilityOperation {
|
|
9
|
+
slug: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
interface CapabilityModule {
|
|
14
|
+
slug: string;
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
operations: string[];
|
|
18
|
+
}
|
|
19
|
+
interface CapabilityCategory {
|
|
20
|
+
slug: string;
|
|
21
|
+
label: string;
|
|
22
|
+
modules: CapabilityModule[];
|
|
23
|
+
}
|
|
24
|
+
interface CapabilitiesResponse {
|
|
25
|
+
product: string | null;
|
|
26
|
+
categories: CapabilityCategory[];
|
|
27
|
+
}
|
|
28
|
+
interface AgentCapability {
|
|
29
|
+
module: string;
|
|
30
|
+
operations: string[];
|
|
31
|
+
}
|
|
32
|
+
interface AgentCapabilitiesPayload {
|
|
33
|
+
capabilities: AgentCapability[];
|
|
34
|
+
}
|
|
35
|
+
|
|
8
36
|
interface ApiResponse<T = unknown> {
|
|
9
37
|
status: 0 | 1;
|
|
10
38
|
message?: string;
|
|
@@ -206,6 +234,9 @@ declare function createGagentsClient(config: GagentsClientConfig): {
|
|
|
206
234
|
end_time: string;
|
|
207
235
|
}) => Promise<ApiResponse<AvailabilityResult>>;
|
|
208
236
|
disconnectCalendar: (idAccount: number, externalReference: string, provider?: string) => Promise<ApiResponse<void>>;
|
|
237
|
+
getCapabilities: (idAccount: number) => Promise<ApiResponse<CapabilitiesResponse>>;
|
|
238
|
+
getAgentCapabilities: (idAccount: number, idAgent: number) => Promise<ApiResponse<AgentCapability[]>>;
|
|
239
|
+
updateAgentCapabilities: (idAccount: number, idAgent: number, body: AgentCapabilitiesPayload) => Promise<ApiResponse<AgentCapability[]>>;
|
|
209
240
|
};
|
|
210
241
|
type GagentsClient = ReturnType<typeof createGagentsClient>;
|
|
211
242
|
|
|
@@ -265,6 +296,9 @@ declare function useGagentsClient(config: GagentsHookConfig): {
|
|
|
265
296
|
end_time: string;
|
|
266
297
|
}) => Promise<ApiResponse<AvailabilityResult>>;
|
|
267
298
|
disconnectCalendar: (idAccount: number, externalReference: string, provider?: string) => Promise<ApiResponse<void>>;
|
|
299
|
+
getCapabilities: (idAccount: number) => Promise<ApiResponse<CapabilitiesResponse>>;
|
|
300
|
+
getAgentCapabilities: (idAccount: number, idAgent: number) => Promise<ApiResponse<AgentCapability[]>>;
|
|
301
|
+
updateAgentCapabilities: (idAccount: number, idAgent: number, body: AgentCapabilitiesPayload) => Promise<ApiResponse<AgentCapability[]>>;
|
|
268
302
|
};
|
|
269
303
|
|
|
270
304
|
declare function useAgents(config: GagentsHookConfig, params?: Record<string, string>): _tanstack_react_query.UseQueryResult<{
|
|
@@ -405,6 +439,50 @@ declare function useGagentsContacts(config: GagentsHookConfig, params?: Record<s
|
|
|
405
439
|
total: number;
|
|
406
440
|
}, Error>;
|
|
407
441
|
|
|
442
|
+
declare function useCapabilities(config: GagentsHookConfig): _tanstack_react_query.UseQueryResult<CapabilitiesResponse, Error>;
|
|
443
|
+
declare function useAgentCapabilities(config: GagentsHookConfig, agentId: number | null): _tanstack_react_query.UseQueryResult<AgentCapability[], Error>;
|
|
444
|
+
declare function useUpdateAgentCapabilities(config: GagentsHookConfig): _tanstack_react_query.UseMutationResult<ApiResponse<AgentCapability[]>, Error, {
|
|
445
|
+
agentId: number;
|
|
446
|
+
payload: AgentCapabilitiesPayload;
|
|
447
|
+
}, unknown>;
|
|
448
|
+
|
|
449
|
+
type IntegrationAuthType = "oauth2" | "api_key" | "none";
|
|
450
|
+
type IntegrationStatus = "available" | "coming_soon";
|
|
451
|
+
interface IntegrationDefinition {
|
|
452
|
+
slug: string;
|
|
453
|
+
name: string;
|
|
454
|
+
description: string;
|
|
455
|
+
icon: string;
|
|
456
|
+
authType: IntegrationAuthType;
|
|
457
|
+
status: IntegrationStatus;
|
|
458
|
+
}
|
|
459
|
+
declare const INTEGRATIONS_REGISTRY: IntegrationDefinition[];
|
|
460
|
+
|
|
461
|
+
type IntegrationCardState = "available" | "connected" | "expired" | "coming_soon";
|
|
462
|
+
interface IntegrationCardData {
|
|
463
|
+
/** Static definition from registry */
|
|
464
|
+
definition: IntegrationDefinition;
|
|
465
|
+
/** Resolved visual state */
|
|
466
|
+
state: IntegrationCardState;
|
|
467
|
+
/** Matching credential if one exists */
|
|
468
|
+
credential: ToolCredential | null;
|
|
469
|
+
/** Matching tool record if one exists */
|
|
470
|
+
tool: Tool | null;
|
|
471
|
+
/** How many agents share this credential */
|
|
472
|
+
sharedByAgentsCount: number;
|
|
473
|
+
/** Whether this agent has a linked agent_tool for this integration */
|
|
474
|
+
linkedToAgent: boolean;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Cross-references the static integrations registry with live data
|
|
478
|
+
* (tools, tool_credentials, agent_tools) to produce card state for each
|
|
479
|
+
* integration entry.
|
|
480
|
+
*/
|
|
481
|
+
declare function useIntegrationState(config: GagentsHookConfig, agentId: number | null): {
|
|
482
|
+
cards: IntegrationCardData[];
|
|
483
|
+
isLoading: boolean;
|
|
484
|
+
};
|
|
485
|
+
|
|
408
486
|
declare function AgentsTable({ config, onNavigateToAgent }: {
|
|
409
487
|
config: GagentsHookConfig;
|
|
410
488
|
onNavigateToAgent?: (agentId: number) => void;
|
|
@@ -547,6 +625,101 @@ interface ConversationViewProps {
|
|
|
547
625
|
}
|
|
548
626
|
declare function ConversationView({ conversationId, onClose, contactsMap, config, renderChatLink, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
549
627
|
|
|
628
|
+
interface IntegrationCardProps {
|
|
629
|
+
card: IntegrationCardData;
|
|
630
|
+
onConnect: (card: IntegrationCardData) => void;
|
|
631
|
+
}
|
|
632
|
+
declare function IntegrationCard({ card, onConnect }: IntegrationCardProps): react_jsx_runtime.JSX.Element;
|
|
633
|
+
|
|
634
|
+
interface IntegrationsTabProps {
|
|
635
|
+
config: GagentsHookConfig;
|
|
636
|
+
agentId: number | null;
|
|
637
|
+
/** Called when user clicks a card action (connect / configure / reconnect).
|
|
638
|
+
* The consuming app wires this to the wizard (Story 18.9). */
|
|
639
|
+
onConnect: (card: IntegrationCardData) => void;
|
|
640
|
+
}
|
|
641
|
+
declare function IntegrationsTab({ config, agentId, onConnect, }: IntegrationsTabProps): react_jsx_runtime.JSX.Element;
|
|
642
|
+
|
|
643
|
+
interface CapabilitiesTabProps {
|
|
644
|
+
config: GagentsHookConfig;
|
|
645
|
+
agentId: number;
|
|
646
|
+
}
|
|
647
|
+
declare function CapabilitiesTab({ config, agentId }: CapabilitiesTabProps): react_jsx_runtime.JSX.Element;
|
|
648
|
+
|
|
649
|
+
interface AdvancedTabProps {
|
|
650
|
+
config: GagentsHookConfig;
|
|
651
|
+
agentId: number;
|
|
652
|
+
gagentsApiUrl: string;
|
|
653
|
+
}
|
|
654
|
+
declare function AdvancedTab({ config, agentId, gagentsApiUrl }: AdvancedTabProps): react_jsx_runtime.JSX.Element;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Types for the Integration Wizard flow.
|
|
658
|
+
*
|
|
659
|
+
* The wizard uses the base IntegrationDefinition from the integrations registry
|
|
660
|
+
* and extends it with wizard-specific metadata via WizardIntegrationMeta.
|
|
661
|
+
*/
|
|
662
|
+
|
|
663
|
+
interface IntegrationCapability {
|
|
664
|
+
label: string;
|
|
665
|
+
description?: string;
|
|
666
|
+
}
|
|
667
|
+
interface WizardIntegrationMeta {
|
|
668
|
+
/** Icon as React node for the wizard header */
|
|
669
|
+
icon?: React.ReactNode;
|
|
670
|
+
/** Provider label for OAuth button (e.g. "Google") */
|
|
671
|
+
providerLabel?: string;
|
|
672
|
+
/** What this integration can do */
|
|
673
|
+
capabilities: IntegrationCapability[];
|
|
674
|
+
/** Required permissions / prerequisites */
|
|
675
|
+
requirements: string[];
|
|
676
|
+
/** Whether this integration has a config step */
|
|
677
|
+
hasConfigStep: boolean;
|
|
678
|
+
}
|
|
679
|
+
type WizardStep = "info" | "credentials" | "config" | "confirm";
|
|
680
|
+
type OAuthStatus = "idle" | "waiting" | "success" | "error";
|
|
681
|
+
interface OAuthResult {
|
|
682
|
+
success: boolean;
|
|
683
|
+
email?: string;
|
|
684
|
+
error?: string;
|
|
685
|
+
credentialId?: number;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
interface ConfigOption {
|
|
689
|
+
id: string;
|
|
690
|
+
label: string;
|
|
691
|
+
description?: string;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
interface IntegrationWizardProps {
|
|
695
|
+
open: boolean;
|
|
696
|
+
onOpenChange: (open: boolean) => void;
|
|
697
|
+
/** Base integration definition from registry */
|
|
698
|
+
integration: IntegrationDefinition;
|
|
699
|
+
/** Wizard-specific metadata (capabilities, requirements, etc.) */
|
|
700
|
+
meta: WizardIntegrationMeta;
|
|
701
|
+
agentId: string | number;
|
|
702
|
+
config: GagentsHookConfig;
|
|
703
|
+
onComplete: () => void;
|
|
704
|
+
/** gagents-r3-api base URL (used to build OAuth URLs) */
|
|
705
|
+
gagentsApiUrl: string;
|
|
706
|
+
/**
|
|
707
|
+
* Existing credential ID -- when set, the wizard opens in edit mode
|
|
708
|
+
* (step 2 shows "Reconectar" and step 3 is pre-filled).
|
|
709
|
+
*/
|
|
710
|
+
existingCredentialId?: number;
|
|
711
|
+
/**
|
|
712
|
+
* Callback to load config options after OAuth completes.
|
|
713
|
+
* e.g. load Google Calendar list. Returns ConfigOption[].
|
|
714
|
+
*/
|
|
715
|
+
loadConfigOptions?: (credentialId: number) => Promise<ConfigOption[]>;
|
|
716
|
+
/**
|
|
717
|
+
* Existing config value to pre-fill the config step in edit/reconnect mode.
|
|
718
|
+
*/
|
|
719
|
+
existingConfigValue?: string;
|
|
720
|
+
}
|
|
721
|
+
declare function IntegrationWizard({ open, onOpenChange, integration, meta, agentId: _agentId, config, onComplete, gagentsApiUrl, existingCredentialId, loadConfigOptions, existingConfigValue, }: IntegrationWizardProps): react_jsx_runtime.JSX.Element;
|
|
722
|
+
|
|
550
723
|
interface AgentsPageProps {
|
|
551
724
|
config: GagentsHookConfig;
|
|
552
725
|
onNavigateToAgent?: (agentId: number) => void;
|
|
@@ -563,6 +736,26 @@ interface AgentDetailPageProps {
|
|
|
563
736
|
}
|
|
564
737
|
declare function AgentDetailPage({ config, agentId, onBack, renderChatLink, }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
|
|
565
738
|
|
|
739
|
+
interface AgentCapabilitiesPageProps {
|
|
740
|
+
config: GagentsHookConfig;
|
|
741
|
+
agentId: number;
|
|
742
|
+
gagentsApiUrl: string;
|
|
743
|
+
/**
|
|
744
|
+
* Resolve wizard metadata for a given integration card.
|
|
745
|
+
* The consuming app provides this so the wizard gets correct
|
|
746
|
+
* capabilities, requirements, and config step flag.
|
|
747
|
+
*/
|
|
748
|
+
resolveWizardMeta?: (card: IntegrationCardData) => WizardIntegrationMeta;
|
|
749
|
+
/**
|
|
750
|
+
* Callback to load config options after OAuth completes
|
|
751
|
+
* (e.g. load Google Calendar list). Forwarded to IntegrationWizard.
|
|
752
|
+
*/
|
|
753
|
+
loadConfigOptions?: (credentialId: number) => Promise<ConfigOption[]>;
|
|
754
|
+
/** Called after wizard completes successfully. */
|
|
755
|
+
onWizardComplete?: () => void;
|
|
756
|
+
}
|
|
757
|
+
declare function AgentCapabilitiesPage({ config, agentId, gagentsApiUrl, resolveWizardMeta, loadConfigOptions, onWizardComplete, }: AgentCapabilitiesPageProps): react_jsx_runtime.JSX.Element;
|
|
758
|
+
|
|
566
759
|
interface ToolsPageProps {
|
|
567
760
|
config: GagentsHookConfig;
|
|
568
761
|
title?: string;
|
|
@@ -578,4 +771,14 @@ interface CredentialsPageProps {
|
|
|
578
771
|
}
|
|
579
772
|
declare function CredentialsPage({ config, gagentsApiUrl, title, subtitle, }: CredentialsPageProps): react_jsx_runtime.JSX.Element;
|
|
580
773
|
|
|
581
|
-
|
|
774
|
+
interface IntegrationsManagementPageProps {
|
|
775
|
+
config: GagentsHookConfig;
|
|
776
|
+
gagentsApiUrl: string;
|
|
777
|
+
/** Called when user clicks connect/reconnect on an integration card. */
|
|
778
|
+
onConnect?: (card: IntegrationCardData) => void;
|
|
779
|
+
title?: string;
|
|
780
|
+
subtitle?: string;
|
|
781
|
+
}
|
|
782
|
+
declare function IntegrationsManagementPage({ config, gagentsApiUrl, onConnect, title, subtitle, }: IntegrationsManagementPageProps): react_jsx_runtime.JSX.Element;
|
|
783
|
+
|
|
784
|
+
export { AdvancedTab, type AdvancedTabProps, type Agent, AgentCapabilitiesPage, type AgentCapabilitiesPageProps, type AgentCapabilitiesPayload, type AgentCapability, AgentConversationsPanel, AgentConversationsTable, AgentDetailPage, type AgentDetailPageProps, AgentEditForm, AgentFormDialog, AgentObjectivesList, AgentPromptEditor, AgentTabs, type AgentTool, AgentToolsList, AgentsPage, type AgentsPageProps, AgentsTable, type ApiResponse, type AvailabilityConflict, type AvailabilityResult, type CalendarStatus, type CapabilitiesResponse, CapabilitiesTab, type CapabilitiesTabProps, type CapabilityCategory, type CapabilityModule, type CapabilityOperation, type ConfigOption, type ContactUser, type Conversation, ConversationView, CredentialsPage, type CredentialsPageProps, type GagentsClient, type GagentsClientConfig, type GagentsContact, type GagentsHookConfig, INTEGRATIONS_REGISTRY, type IntegrationAuthType, type IntegrationCapability, IntegrationCard, type IntegrationCardData, type IntegrationCardProps, type IntegrationCardState, type IntegrationDefinition, type IntegrationStatus, IntegrationWizard, type IntegrationWizardProps, IntegrationsManagementPage, type IntegrationsManagementPageProps, IntegrationsTab, type IntegrationsTabProps, type OAuthResult, type OAuthStatus, type Objective, type PromptVersion, Sortable, SortableContent, SortableItem, SortableItemHandle, SortableOverlay, type Tool, type ToolCredential, ToolCredentialsForm, ToolFormDialog, ToolsPage, type ToolsPageProps, ToolsTable, type WizardIntegrationMeta, type WizardStep, cn, createGagentsClient, useAddAgentTool, useAgent, useAgentCapabilities, useAgentConversations, useAgentTools, useAgents, useCapabilities, useContactUsers, useConversation, useConversations, useCreateAgent, useCreateObjective, useCreateTool, useCreateToolCredential, useDeleteAgent, useDeleteObjective, useDeleteTool, useDeleteToolCredential, useGagentsClient, useGagentsContacts, useIntegrationState, useObjectives, usePromptVersions, useRemoveAgentTool, useTool, useToolCredentials, useTools, useUpdateAgent, useUpdateAgentCapabilities, useUpdateAgentTool, useUpdateObjective, useUpdateTool, useUpdateToolCredential };
|