@iblai/mcp 1.0.0
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/README.md +199 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/data-layer.d.ts +8 -0
- package/dist/resources/data-layer.d.ts.map +1 -0
- package/dist/resources/data-layer.js +181 -0
- package/dist/resources/data-layer.js.map +1 -0
- package/dist/resources/guides-layout.d.ts +8 -0
- package/dist/resources/guides-layout.d.ts.map +1 -0
- package/dist/resources/guides-layout.js +235 -0
- package/dist/resources/guides-layout.js.map +1 -0
- package/dist/resources/guides-rbac.d.ts +8 -0
- package/dist/resources/guides-rbac.d.ts.map +1 -0
- package/dist/resources/guides-rbac.js +231 -0
- package/dist/resources/guides-rbac.js.map +1 -0
- package/dist/resources/guides-theme.d.ts +8 -0
- package/dist/resources/guides-theme.d.ts.map +1 -0
- package/dist/resources/guides-theme.js +183 -0
- package/dist/resources/guides-theme.js.map +1 -0
- package/dist/resources/index.d.ts +17 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +18 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/packages-overview.d.ts +8 -0
- package/dist/resources/packages-overview.d.ts.map +1 -0
- package/dist/resources/packages-overview.js +53 -0
- package/dist/resources/packages-overview.js.map +1 -0
- package/dist/resources/web-containers.d.ts +8 -0
- package/dist/resources/web-containers.d.ts.map +1 -0
- package/dist/resources/web-containers.js +122 -0
- package/dist/resources/web-containers.js.map +1 -0
- package/dist/resources/web-utils.d.ts +8 -0
- package/dist/resources/web-utils.d.ts.map +1 -0
- package/dist/resources/web-utils.js +210 -0
- package/dist/resources/web-utils.js.map +1 -0
- package/dist/tools/api-query-info.d.ts +16 -0
- package/dist/tools/api-query-info.d.ts.map +1 -0
- package/dist/tools/api-query-info.js +2398 -0
- package/dist/tools/api-query-info.js.map +1 -0
- package/dist/tools/component-info.d.ts +16 -0
- package/dist/tools/component-info.d.ts.map +1 -0
- package/dist/tools/component-info.js +1323 -0
- package/dist/tools/component-info.js.map +1 -0
- package/dist/tools/hook-info.d.ts +16 -0
- package/dist/tools/hook-info.d.ts.map +1 -0
- package/dist/tools/hook-info.js +1988 -0
- package/dist/tools/hook-info.js.map +1 -0
- package/dist/tools/index.d.ts +68 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +14 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/page-template.d.ts +28 -0
- package/dist/tools/page-template.d.ts.map +1 -0
- package/dist/tools/page-template.js +198 -0
- package/dist/tools/page-template.js.map +1 -0
- package/dist/tools/provider-setup.d.ts +24 -0
- package/dist/tools/provider-setup.d.ts.map +1 -0
- package/dist/tools/provider-setup.js +213 -0
- package/dist/tools/provider-setup.js.map +1 -0
- package/package.json +28 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { packagesOverview } from './packages-overview.js';
|
|
2
|
+
import { webContainers } from './web-containers.js';
|
|
3
|
+
import { webUtils } from './web-utils.js';
|
|
4
|
+
import { dataLayer } from './data-layer.js';
|
|
5
|
+
import { guidesLayout } from './guides-layout.js';
|
|
6
|
+
import { guidesRbac } from './guides-rbac.js';
|
|
7
|
+
import { guidesTheme } from './guides-theme.js';
|
|
8
|
+
export const RESOURCES = {
|
|
9
|
+
[packagesOverview.uri]: packagesOverview,
|
|
10
|
+
[webContainers.uri]: webContainers,
|
|
11
|
+
[webUtils.uri]: webUtils,
|
|
12
|
+
[dataLayer.uri]: dataLayer,
|
|
13
|
+
[guidesLayout.uri]: guidesLayout,
|
|
14
|
+
[guidesRbac.uri]: guidesRbac,
|
|
15
|
+
[guidesTheme.uri]: guidesTheme,
|
|
16
|
+
};
|
|
17
|
+
export { packagesOverview, webContainers, webUtils, dataLayer, guidesLayout, guidesRbac, guidesTheme, };
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,gBAAgB;IACxC,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa;IAClC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ;IACxB,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS;IAC1B,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,YAAY;IAChC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,UAAU;IAC5B,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,WAAW;CAC/B,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages-overview.d.ts","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;CAmD5B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const packagesOverview = {
|
|
2
|
+
uri: 'ibl://packages/overview',
|
|
3
|
+
name: 'IBL Frontend Packages Overview',
|
|
4
|
+
description: 'Overview of all shared packages in the IBL frontend monorepo',
|
|
5
|
+
mimeType: 'text/markdown',
|
|
6
|
+
content: `# IBL Frontend Packages Overview
|
|
7
|
+
|
|
8
|
+
## Monorepo Structure
|
|
9
|
+
|
|
10
|
+
The IBL frontend is a PNPM workspace monorepo with the following structure:
|
|
11
|
+
|
|
12
|
+
\`\`\`
|
|
13
|
+
ibl-frontend/
|
|
14
|
+
├── apps/ # Next.js SPAs
|
|
15
|
+
│ ├── auth/ # Authentication SPA
|
|
16
|
+
│ ├── mentor/ # AI Mentor SPA (with chat functionality)
|
|
17
|
+
│ └── skills/ # Skills/Learning SPA
|
|
18
|
+
├── packages/ # Shared libraries
|
|
19
|
+
│ ├── data-layer/ # Redux store, RTK Query APIs
|
|
20
|
+
│ ├── web-containers/ # Shared React components (Radix UI)
|
|
21
|
+
│ ├── web-utils/ # Authentication, providers, hooks
|
|
22
|
+
│ ├── api-ai/ # Generated AI API client
|
|
23
|
+
│ ├── api-core/ # Generated Core API client
|
|
24
|
+
│ └── api-ai-plus/ # Generated AI Plus API client
|
|
25
|
+
└── playwright/ # E2E test suite
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
## Package Import Patterns
|
|
29
|
+
|
|
30
|
+
\`\`\`typescript
|
|
31
|
+
// Data Layer - Redux and RTK Query
|
|
32
|
+
import { useGetMentorSettingsQuery, mentorReducer } from '@iblai/data-layer';
|
|
33
|
+
|
|
34
|
+
// Web Containers - UI Components
|
|
35
|
+
import { Button, Card, Dialog } from '@iblai/web-containers';
|
|
36
|
+
import { Profile, NotificationDropdown } from '@iblai/web-containers';
|
|
37
|
+
|
|
38
|
+
// Web Utils - Providers and Hooks
|
|
39
|
+
import { AuthProvider, TenantProvider, MentorProvider } from '@iblai/web-utils';
|
|
40
|
+
import { useAdvancedChat, useMentorSettings } from '@iblai/web-utils';
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
## Key Technologies
|
|
44
|
+
|
|
45
|
+
- **Framework**: Next.js 15.3.6 with App Router
|
|
46
|
+
- **React**: React 19.1.0
|
|
47
|
+
- **State Management**: Redux Toolkit + RTK Query
|
|
48
|
+
- **UI Components**: Radix UI primitives + Tailwind CSS
|
|
49
|
+
- **Forms**: React Hook Form + TanStack Form
|
|
50
|
+
- **Build**: Turborepo + Rollup (packages)
|
|
51
|
+
`,
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=packages-overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages-overview.js","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,yBAAyB;IAC9B,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CV;CACA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-containers.d.ts","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAwHzB,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const webContainers = {
|
|
2
|
+
uri: 'ibl://packages/web-containers',
|
|
3
|
+
name: 'Web Containers Package',
|
|
4
|
+
description: 'Shared React components built on Radix UI',
|
|
5
|
+
mimeType: 'text/markdown',
|
|
6
|
+
content: `# @iblai/web-containers
|
|
7
|
+
|
|
8
|
+
Shared React component library built on Radix UI primitives with Tailwind CSS styling.
|
|
9
|
+
|
|
10
|
+
## UI Primitives (Radix UI-based)
|
|
11
|
+
|
|
12
|
+
Located in \`@iblai/web-containers/components/ui/\`:
|
|
13
|
+
|
|
14
|
+
| Component | Import | Description |
|
|
15
|
+
|-----------|--------|-------------|
|
|
16
|
+
| Button | \`import { Button } from '@iblai/web-containers'\` | Variants: default, destructive, outline, secondary, ghost, link |
|
|
17
|
+
| Card | \`import { Card, CardHeader, CardContent, CardFooter } from '@iblai/web-containers'\` | Container for content grouping |
|
|
18
|
+
| Dialog | \`import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@iblai/web-containers'\` | Modal dialog |
|
|
19
|
+
| Input | \`import { Input } from '@iblai/web-containers'\` | Text input field |
|
|
20
|
+
| Select | \`import { Select, SelectTrigger, SelectContent, SelectItem } from '@iblai/web-containers'\` | Dropdown select |
|
|
21
|
+
| Tabs | \`import { Tabs, TabsList, TabsTrigger, TabsContent } from '@iblai/web-containers'\` | Tabbed interface |
|
|
22
|
+
| Switch | \`import { Switch } from '@iblai/web-containers'\` | Toggle switch |
|
|
23
|
+
| Checkbox | \`import { Checkbox } from '@iblai/web-containers'\` | Checkbox input |
|
|
24
|
+
| Tooltip | \`import { Tooltip, TooltipTrigger, TooltipContent } from '@iblai/web-containers'\` | Hover tooltip |
|
|
25
|
+
| Avatar | \`import { Avatar, AvatarImage, AvatarFallback } from '@iblai/web-containers'\` | User avatar |
|
|
26
|
+
| Badge | \`import { Badge } from '@iblai/web-containers'\` | Inline label |
|
|
27
|
+
| Skeleton | \`import { Skeleton } from '@iblai/web-containers'\` | Loading placeholder |
|
|
28
|
+
| Toast/Toaster | \`import { Toaster, toast } from '@iblai/web-containers'\` | Notifications (Sonner) |
|
|
29
|
+
|
|
30
|
+
## Feature Components
|
|
31
|
+
|
|
32
|
+
### Profile Management
|
|
33
|
+
\`\`\`typescript
|
|
34
|
+
import { Profile, Account, Security, Organization } from '@iblai/web-containers';
|
|
35
|
+
|
|
36
|
+
// Full profile with tabs
|
|
37
|
+
<Profile
|
|
38
|
+
username={username}
|
|
39
|
+
tenantKey={tenantKey}
|
|
40
|
+
tabs={['basic', 'social', 'education', 'experience', 'security']}
|
|
41
|
+
/>
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
### Notifications
|
|
45
|
+
\`\`\`typescript
|
|
46
|
+
import { NotificationDropdown, SendNotificationDialog } from '@iblai/web-containers';
|
|
47
|
+
|
|
48
|
+
<NotificationDropdown
|
|
49
|
+
org={tenantKey}
|
|
50
|
+
userId={username}
|
|
51
|
+
isAdmin={isAdmin}
|
|
52
|
+
onViewNotifications={handleView}
|
|
53
|
+
/>
|
|
54
|
+
\`\`\`
|
|
55
|
+
|
|
56
|
+
### Analytics Dashboard
|
|
57
|
+
\`\`\`typescript
|
|
58
|
+
import {
|
|
59
|
+
AnalyticsLayout,
|
|
60
|
+
AnalyticsOverview,
|
|
61
|
+
ChartFiltersProvider,
|
|
62
|
+
useChartFilters,
|
|
63
|
+
} from '@iblai/web-containers';
|
|
64
|
+
|
|
65
|
+
<ChartFiltersProvider>
|
|
66
|
+
<AnalyticsLayout>
|
|
67
|
+
<AnalyticsOverview />
|
|
68
|
+
</AnalyticsLayout>
|
|
69
|
+
</ChartFiltersProvider>
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
### Authentication Buttons
|
|
73
|
+
\`\`\`typescript
|
|
74
|
+
import { LoginButton, SignupButton } from '@iblai/web-containers';
|
|
75
|
+
|
|
76
|
+
<LoginButton
|
|
77
|
+
authUrl="https://auth.example.com"
|
|
78
|
+
appName="mentor"
|
|
79
|
+
platformKey={tenantKey}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<SignupButton
|
|
83
|
+
authUrl="https://auth.example.com"
|
|
84
|
+
tenantKey={tenantKey}
|
|
85
|
+
/>
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
## Utility Functions
|
|
89
|
+
|
|
90
|
+
\`\`\`typescript
|
|
91
|
+
import { cn, htmlToMarkdown, sanitizeHtml } from '@iblai/web-containers';
|
|
92
|
+
|
|
93
|
+
// Merge Tailwind classes with conflict resolution
|
|
94
|
+
const className = cn('base-class', condition && 'conditional-class');
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
## Next.js Specific Exports
|
|
98
|
+
|
|
99
|
+
\`\`\`typescript
|
|
100
|
+
import { SsoLogin, ErrorPage, UserProfileDropdown } from '@iblai/web-containers/next';
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
## Styling / Theme
|
|
104
|
+
|
|
105
|
+
The package uses CSS custom properties for theming:
|
|
106
|
+
|
|
107
|
+
\`\`\`css
|
|
108
|
+
:root {
|
|
109
|
+
--primary: #0058cc;
|
|
110
|
+
--primary-light: #00b0ef;
|
|
111
|
+
--primary-dark: #004499;
|
|
112
|
+
/* ... more variables */
|
|
113
|
+
}
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
Import base styles in your app:
|
|
117
|
+
\`\`\`typescript
|
|
118
|
+
import '@iblai/web-containers/styles/base.css';
|
|
119
|
+
\`\`\`
|
|
120
|
+
`,
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=web-containers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-containers.js","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHV;CACA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-utils.d.ts","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;CAgNpB,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
export const webUtils = {
|
|
2
|
+
uri: 'ibl://packages/web-utils',
|
|
3
|
+
name: 'Web Utils Package',
|
|
4
|
+
description: 'Authentication, providers, and utility hooks',
|
|
5
|
+
mimeType: 'text/markdown',
|
|
6
|
+
content: `# @iblai/web-utils
|
|
7
|
+
|
|
8
|
+
Authentication utilities, context providers, and React hooks for the IBL platform.
|
|
9
|
+
|
|
10
|
+
## Providers
|
|
11
|
+
|
|
12
|
+
### AuthProvider
|
|
13
|
+
Handles authentication middleware, token validation, and cross-SPA synchronization.
|
|
14
|
+
|
|
15
|
+
\`\`\`typescript
|
|
16
|
+
import { AuthProvider } from '@iblai/web-utils';
|
|
17
|
+
|
|
18
|
+
<AuthProvider
|
|
19
|
+
skip={pathname === '/sso-login' || pathname === '/version'}
|
|
20
|
+
middleware={{
|
|
21
|
+
'/public': false, // No auth required
|
|
22
|
+
'/admin/*': 'admin', // Admin only
|
|
23
|
+
'/*': true, // Auth required
|
|
24
|
+
}}
|
|
25
|
+
username={username}
|
|
26
|
+
token={token}
|
|
27
|
+
redirectToAuthSpa={redirectToAuthSpa}
|
|
28
|
+
hasNonExpiredAuthToken={hasNonExpiredAuthToken}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</AuthProvider>
|
|
32
|
+
\`\`\`
|
|
33
|
+
|
|
34
|
+
### TenantProvider
|
|
35
|
+
Manages multi-tenant context, tenant switching, and tenant metadata.
|
|
36
|
+
|
|
37
|
+
\`\`\`typescript
|
|
38
|
+
import { TenantProvider } from '@iblai/web-utils';
|
|
39
|
+
|
|
40
|
+
<TenantProvider
|
|
41
|
+
currentTenant={currentTenant}
|
|
42
|
+
requestedTenant={requestedTenant}
|
|
43
|
+
saveCurrentTenant={saveTenant}
|
|
44
|
+
handleTenantSwitch={handleSwitch}
|
|
45
|
+
onLoadPlatformPermissions={(permissions) => dispatch(updateRbac(permissions))}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</TenantProvider>
|
|
49
|
+
\`\`\`
|
|
50
|
+
|
|
51
|
+
### MentorProvider (for Mentor App only)
|
|
52
|
+
Manages AI mentor selection, authorization, and navigation.
|
|
53
|
+
|
|
54
|
+
\`\`\`typescript
|
|
55
|
+
import { MentorProvider } from '@iblai/web-utils';
|
|
56
|
+
|
|
57
|
+
<MentorProvider
|
|
58
|
+
username={username}
|
|
59
|
+
isAdmin={isAdmin}
|
|
60
|
+
mainTenantKey={mainTenant}
|
|
61
|
+
redirectToNoMentorsPage={() => router.push('/no-mentors')}
|
|
62
|
+
redirectToCreateMentor={() => router.push('/create')}
|
|
63
|
+
onLoadMentorsPermissions={(permissions) => dispatch(updateRbac(permissions))}
|
|
64
|
+
requestedMentorId={mentorId}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</MentorProvider>
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
## Provider Hierarchy
|
|
71
|
+
|
|
72
|
+
**CRITICAL: Providers must be nested in this exact order:**
|
|
73
|
+
|
|
74
|
+
### For Skills App:
|
|
75
|
+
\`\`\`typescript
|
|
76
|
+
<StoreProvider>
|
|
77
|
+
<AuthProvider>
|
|
78
|
+
<TenantProvider>
|
|
79
|
+
<ClientLayout>
|
|
80
|
+
{children}
|
|
81
|
+
</ClientLayout>
|
|
82
|
+
</TenantProvider>
|
|
83
|
+
</AuthProvider>
|
|
84
|
+
</StoreProvider>
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
### For Mentor App:
|
|
88
|
+
\`\`\`typescript
|
|
89
|
+
<StoreProvider>
|
|
90
|
+
<AuthProvider>
|
|
91
|
+
<TenantProvider>
|
|
92
|
+
<MentorProvider>
|
|
93
|
+
<AppProvider>
|
|
94
|
+
{children}
|
|
95
|
+
</AppProvider>
|
|
96
|
+
</MentorProvider>
|
|
97
|
+
</TenantProvider>
|
|
98
|
+
</AuthProvider>
|
|
99
|
+
</StoreProvider>
|
|
100
|
+
\`\`\`
|
|
101
|
+
|
|
102
|
+
## Chat Hooks
|
|
103
|
+
|
|
104
|
+
### useAdvancedChat
|
|
105
|
+
Main hook for AI mentor chat with WebSocket streaming.
|
|
106
|
+
|
|
107
|
+
\`\`\`typescript
|
|
108
|
+
import { useAdvancedChat } from '@iblai/web-utils';
|
|
109
|
+
|
|
110
|
+
const {
|
|
111
|
+
messages,
|
|
112
|
+
isStreaming,
|
|
113
|
+
sendMessage,
|
|
114
|
+
stopGenerating,
|
|
115
|
+
startNewChat,
|
|
116
|
+
sessionId,
|
|
117
|
+
mentorName,
|
|
118
|
+
profileImage,
|
|
119
|
+
activeTab,
|
|
120
|
+
changeTab,
|
|
121
|
+
} = useAdvancedChat({
|
|
122
|
+
mentorId,
|
|
123
|
+
tenantKey,
|
|
124
|
+
username,
|
|
125
|
+
token: axdToken,
|
|
126
|
+
wsUrl: \`\${config.baseWsUrl()}/ws/langflow/\`,
|
|
127
|
+
mode: 'advanced', // or 'default'
|
|
128
|
+
errorHandler: (error) => toast.error(error.message),
|
|
129
|
+
on402Error: () => showSubscriptionModal(),
|
|
130
|
+
});
|
|
131
|
+
\`\`\`
|
|
132
|
+
|
|
133
|
+
### useMentorSettings
|
|
134
|
+
Fetches mentor configuration.
|
|
135
|
+
|
|
136
|
+
\`\`\`typescript
|
|
137
|
+
import { useMentorSettings } from '@iblai/web-utils';
|
|
138
|
+
|
|
139
|
+
const {
|
|
140
|
+
profileImage,
|
|
141
|
+
mentorName,
|
|
142
|
+
llmProvider,
|
|
143
|
+
mentorTools,
|
|
144
|
+
enableGuidedPrompts,
|
|
145
|
+
} = useMentorSettings({ mentorId, tenantKey, username });
|
|
146
|
+
\`\`\`
|
|
147
|
+
|
|
148
|
+
## Authentication Utilities
|
|
149
|
+
|
|
150
|
+
\`\`\`typescript
|
|
151
|
+
import {
|
|
152
|
+
isLoggedIn,
|
|
153
|
+
redirectToAuthSpa,
|
|
154
|
+
handleLogout,
|
|
155
|
+
syncAuthToCookies,
|
|
156
|
+
clearAuthCookies,
|
|
157
|
+
} from '@iblai/web-utils';
|
|
158
|
+
|
|
159
|
+
// Check if user is logged in
|
|
160
|
+
if (!isLoggedIn('axd_token')) {
|
|
161
|
+
redirectToAuthSpa({
|
|
162
|
+
authUrl: 'https://auth.example.com',
|
|
163
|
+
appName: 'mentor',
|
|
164
|
+
logout: false,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Complete logout
|
|
169
|
+
handleLogout({
|
|
170
|
+
authUrl: 'https://auth.example.com',
|
|
171
|
+
redirectUrl: '/login',
|
|
172
|
+
});
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
## File Upload Service
|
|
176
|
+
|
|
177
|
+
\`\`\`typescript
|
|
178
|
+
import { createFileReference, createMultipleFileReferences } from '@iblai/web-utils';
|
|
179
|
+
|
|
180
|
+
// Single file upload
|
|
181
|
+
const fileRef = await createFileReference({
|
|
182
|
+
file,
|
|
183
|
+
org: tenantKey,
|
|
184
|
+
username,
|
|
185
|
+
mentorId,
|
|
186
|
+
onProgress: (percent) => setProgress(percent),
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// Multiple files
|
|
190
|
+
const fileRefs = await createMultipleFileReferences({
|
|
191
|
+
files,
|
|
192
|
+
org: tenantKey,
|
|
193
|
+
username,
|
|
194
|
+
mentorId,
|
|
195
|
+
onFileProgress: (index, percent) => updateProgress(index, percent),
|
|
196
|
+
});
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
## Constants
|
|
200
|
+
|
|
201
|
+
\`\`\`typescript
|
|
202
|
+
import {
|
|
203
|
+
LOCAL_STORAGE_KEYS,
|
|
204
|
+
ANONYMOUS_USERNAME,
|
|
205
|
+
TOOLS, // Web search, code interpreter, etc.
|
|
206
|
+
} from '@iblai/web-utils';
|
|
207
|
+
\`\`\`
|
|
208
|
+
`,
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=web-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-utils.js","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0MV;CACA,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const apiQueryInfoTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
queryName: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
required: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function getApiQueryInfo(queryName: string): string;
|
|
16
|
+
//# sourceMappingURL=api-query-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-query-info.d.ts","sourceRoot":"","sources":["../../src/tools/api-query-info.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAa5B,CAAC;AAyzEF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAgKzD"}
|