@iblai/mcp 1.3.3 → 1.4.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/dist/resources/packages-playwright.d.ts.map +1 -1
- package/dist/resources/packages-playwright.js +47 -0
- package/dist/resources/packages-playwright.js.map +1 -1
- package/dist/resources/web-containers.d.ts.map +1 -1
- package/dist/resources/web-containers.js +30 -0
- package/dist/resources/web-containers.js.map +1 -1
- package/dist/resources/web-utils.d.ts.map +1 -1
- package/dist/resources/web-utils.js +36 -0
- package/dist/resources/web-utils.js.map +1 -1
- package/dist/tools/component-info.d.ts.map +1 -1
- package/dist/tools/component-info.js +804 -0
- package/dist/tools/component-info.js.map +1 -1
- package/dist/tools/hook-info.d.ts.map +1 -1
- package/dist/tools/hook-info.js +163 -0
- package/dist/tools/hook-info.js.map +1 -1
- package/dist/tools/playwright-helper-info.d.ts.map +1 -1
- package/dist/tools/playwright-helper-info.js +395 -0
- package/dist/tools/playwright-helper-info.js.map +1 -1
- package/package.json +1 -1
|
@@ -1391,6 +1391,88 @@ interface PaywallModalProps {
|
|
|
1391
1391
|
Wires \`useCreateCheckoutMutation\` from \`@iblai/data-layer\` to redirect to Stripe Checkout. The grid auto-sizes for 1, 2, 3, or 4+ prices.
|
|
1392
1392
|
|
|
1393
1393
|
**File Location**: \`packages/web-containers/src/components/modals/paywall-modal.tsx\``,
|
|
1394
|
+
UpgradePackageModal: `# UpgradePackageModal Component
|
|
1395
|
+
|
|
1396
|
+
Centered upgrade dialog presenting a "free upgrade" CTA — typically used to nudge users on the Free plan into the premium tier with no credit-card friction. Wires the \`useStripeUpgrade\` hook (from \`@iblai/iblai-js/web-utils\`) to fetch a Stripe Pricing Page session and redirect to the resolved \`free\` checkout link.
|
|
1397
|
+
|
|
1398
|
+
\`\`\`typescript
|
|
1399
|
+
import { UpgradePackageModal } from '@iblai/iblai-js/web-containers';
|
|
1400
|
+
|
|
1401
|
+
interface UpgradePackageModalProps {
|
|
1402
|
+
open: boolean;
|
|
1403
|
+
onClose: () => void;
|
|
1404
|
+
redirectUrl: string; // success_url passed to Stripe
|
|
1405
|
+
sourcePlatformKey: string; // current tenant key
|
|
1406
|
+
mainPlatformKey: string; // main IBL platform key
|
|
1407
|
+
currentUserEmail: string; // prefills locked_prefilled_email
|
|
1408
|
+
title?: string; // default: "Subscribe to unlock full features"
|
|
1409
|
+
description?: string;
|
|
1410
|
+
ctaLabel?: string; // default: "Upgrade for free"
|
|
1411
|
+
features?: string[]; // bulleted feature list inside the dialog
|
|
1412
|
+
footerNote?: string; // default: "No credit card required. Cancel anytime."
|
|
1413
|
+
className?: string;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
<UpgradePackageModal
|
|
1417
|
+
open={isUpgradeOpen}
|
|
1418
|
+
onClose={() => setIsUpgradeOpen(false)}
|
|
1419
|
+
redirectUrl={\`\${window.location.origin}/billing/success\`}
|
|
1420
|
+
sourcePlatformKey={tenantKey}
|
|
1421
|
+
mainPlatformKey={mainPlatformKey}
|
|
1422
|
+
currentUserEmail={user.email}
|
|
1423
|
+
/>
|
|
1424
|
+
\`\`\`
|
|
1425
|
+
|
|
1426
|
+
The CTA calls \`handleUpgrade('free')\` from \`useStripeUpgrade\` — it resolves the Stripe pricing-page session, picks the \`free\` payment link, appends \`locked_prefilled_email\` and \`client_reference_id\`, and redirects via \`window.location.href\`. Use \`UpgradePackageModal\` for the "free upgrade" path, and \`PaywallModal\` for explicit paid-tier checkout flows.
|
|
1427
|
+
|
|
1428
|
+
**File Location**: \`packages/web-containers/src/components/modals/upgrade-package-modal.tsx\``,
|
|
1429
|
+
CreditBalance: `# CreditBalance Component
|
|
1430
|
+
|
|
1431
|
+
Plan-aware credit balance dropdown that lives in the navbar. Surfaces remaining/consumed credits, reset date, the current plan badge (Free / Trial / Premium), and the auto-recharge configuration; the action button at the bottom adapts to the user's plan and payment-method state.
|
|
1432
|
+
|
|
1433
|
+
\`\`\`typescript
|
|
1434
|
+
import { CreditBalance } from '@iblai/iblai-js/web-containers';
|
|
1435
|
+
|
|
1436
|
+
interface CreditBalanceProps {
|
|
1437
|
+
tenant: string; // tenant/platform key
|
|
1438
|
+
username: string;
|
|
1439
|
+
mainPlatformKey: string; // main IBL platform key (for upgrade flow)
|
|
1440
|
+
currentUserEmail: string;
|
|
1441
|
+
redirectUrl: string; // success_url for Stripe upgrade
|
|
1442
|
+
className?: string;
|
|
1443
|
+
enabled?: boolean; // default: true — gate via tenant.show_paywall
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
// Typically gated on the current tenant's \`show_paywall\` flag
|
|
1447
|
+
<CreditBalance
|
|
1448
|
+
tenant={currentTenant.key}
|
|
1449
|
+
username={username}
|
|
1450
|
+
mainPlatformKey={mainPlatformKey}
|
|
1451
|
+
currentUserEmail={user.email}
|
|
1452
|
+
redirectUrl={window.location.href}
|
|
1453
|
+
enabled={Boolean(currentTenant.show_paywall)}
|
|
1454
|
+
/>
|
|
1455
|
+
\`\`\`
|
|
1456
|
+
|
|
1457
|
+
**Behavior:**
|
|
1458
|
+
- Renders nothing when \`enabled\` is false or \`tenant\` is empty.
|
|
1459
|
+
- Trigger button has \`data-testid="credit-balance-trigger"\` (icon-only). Status dot turns amber at \`balance ≤ 10\` ("low") and red at \`balance ≤ 1\` ("critical"); hidden when "healthy".
|
|
1460
|
+
- Dropdown panel has \`data-testid="credit-balance-panel"\` and contains a plan badge with \`data-testid="credit-balance-plan-badge"\`.
|
|
1461
|
+
- Action button rules:
|
|
1462
|
+
- **Free** (or \`free_trial\`): single "Upgrade Plan" button (gradient + \`Sparkles\` icon) — calls \`useStripeUpgrade.handleUpgrade('premium')\`.
|
|
1463
|
+
- **Premium with payment method**: pair of "Manage Usage" and "Add Credits" buttons (open \`AutoRechargeModal\` and \`AddCreditsModal\` respectively).
|
|
1464
|
+
- **Premium without payment method**: single "Manage Billing" button — opens the Stripe customer portal in \`payment_method_update\` flow via \`useCreateStripeCustomerPortalMutation\`.
|
|
1465
|
+
- Auto Recharge section only renders when there is a payment method on file AND plan is not Free.
|
|
1466
|
+
- Re-fetches billing info on every dropdown open via \`refetch()\` from \`useGetAccountBillingInfoQuery\`.
|
|
1467
|
+
|
|
1468
|
+
**Data dependencies:**
|
|
1469
|
+
- \`useGetAccountBillingInfoQuery({ platform_key })\` — credits, plan, payment method, auto-recharge settings, \`free_trial\` flag.
|
|
1470
|
+
- \`useCreateStripeCustomerPortalMutation\` — for the "Manage Billing" path.
|
|
1471
|
+
- \`useStripeUpgrade\` (web-utils) — for the "Upgrade Plan" path.
|
|
1472
|
+
|
|
1473
|
+
**Related:** \`UpgradePackageModal\`, \`AutoRechargeModal\`, \`AddCreditsModal\`, \`useStripeUpgrade\`, \`useGetAccountBillingInfoQuery\`.
|
|
1474
|
+
|
|
1475
|
+
**File Location**: \`packages/web-containers/src/components/credit-balance.tsx\``,
|
|
1394
1476
|
AnalyticsMonetizationStats: `# AnalyticsMonetizationStats Component
|
|
1395
1477
|
|
|
1396
1478
|
Analytics dashboard tab showing monetization KPIs (revenue, sales count, active paywalls, subscriber count), distribution charts, and paginated subscriber/paywall tables.
|
|
@@ -2561,6 +2643,721 @@ import Link from 'next/link';
|
|
|
2561
2643
|
\`\`\`
|
|
2562
2644
|
|
|
2563
2645
|
**File Location**: \`packages/web-containers/src/components/course-content/footer.tsx\``,
|
|
2646
|
+
// ============================================================================
|
|
2647
|
+
// EDIT MENTOR MODAL — Extracted Tabs
|
|
2648
|
+
// ============================================================================
|
|
2649
|
+
AgentSettingsProvider: `# AgentSettingsProvider
|
|
2650
|
+
|
|
2651
|
+
React context provider that supplies shared identity and config to all agent settings tabs. Wrap tab content with this provider so each tab reads tenantKey, mentorId, username, enableRBAC, and executeGatedAction from context instead of props.
|
|
2652
|
+
|
|
2653
|
+
\`\`\`typescript
|
|
2654
|
+
import { AgentSettingsProvider } from '@iblai/iblai-js/web-containers/next';
|
|
2655
|
+
import type { AgentSettingsContextValue } from '@iblai/iblai-js/web-containers/next';
|
|
2656
|
+
|
|
2657
|
+
interface AgentSettingsContextValue {
|
|
2658
|
+
tenantKey: string;
|
|
2659
|
+
mentorId: string;
|
|
2660
|
+
username: string;
|
|
2661
|
+
enableRBAC: boolean;
|
|
2662
|
+
executeGatedAction?: (fn: () => unknown) => unknown;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
<AgentSettingsProvider
|
|
2666
|
+
tenantKey={tenantKey}
|
|
2667
|
+
mentorId={activeMentorId}
|
|
2668
|
+
username={username}
|
|
2669
|
+
enableRBAC={config.enableRBAC()}
|
|
2670
|
+
executeGatedAction={(fn) => executeWithTrialCheck(fn)}
|
|
2671
|
+
>
|
|
2672
|
+
<SettingsTab ... />
|
|
2673
|
+
<LLMTab ... />
|
|
2674
|
+
</AgentSettingsProvider>
|
|
2675
|
+
\`\`\`
|
|
2676
|
+
|
|
2677
|
+
The \`useAgentSettings()\` hook is also exported for building custom tabs that read from this context.
|
|
2678
|
+
|
|
2679
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
2680
|
+
|
|
2681
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/agent-settings-context.tsx\``,
|
|
2682
|
+
SettingsTab: `# SettingsTab Component
|
|
2683
|
+
|
|
2684
|
+
Agent/mentor settings form with name, description, category, visibility, toggles, image upload, and copy/delete sub-modals. Reads identity from AgentSettingsProvider context — must be wrapped by it.
|
|
2685
|
+
|
|
2686
|
+
\`\`\`typescript
|
|
2687
|
+
import { SettingsTab } from '@iblai/iblai-js/web-containers/next';
|
|
2688
|
+
import type { SettingsTabProps, DeepPartial, SettingsTabLabels } from '@iblai/iblai-js/web-containers/next';
|
|
2689
|
+
|
|
2690
|
+
interface SettingsTabProps {
|
|
2691
|
+
onSettingsSaved?: (mentor: unknown) => void;
|
|
2692
|
+
onMentorDeleted?: (deletedMentorId: string) => void;
|
|
2693
|
+
tenants: CopyMentorTenant[];
|
|
2694
|
+
isLoadingTenants?: boolean;
|
|
2695
|
+
onMentorCopied?: (params: {
|
|
2696
|
+
forkedMentorId: string;
|
|
2697
|
+
destinationTenantKey: string;
|
|
2698
|
+
isCrossTenantCopy: boolean;
|
|
2699
|
+
}) => void;
|
|
2700
|
+
labels?: DeepPartial<SettingsTabLabels>;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
// With the default "agent" labels:
|
|
2704
|
+
<SettingsTab
|
|
2705
|
+
tenants={tenants}
|
|
2706
|
+
onMentorDeleted={handleDelete}
|
|
2707
|
+
onMentorCopied={handleCopy}
|
|
2708
|
+
/>
|
|
2709
|
+
|
|
2710
|
+
// With custom "mentor" labels:
|
|
2711
|
+
import { MENTOR_SETTINGS_TAB_LABELS } from './mentor-labels';
|
|
2712
|
+
|
|
2713
|
+
<SettingsTab
|
|
2714
|
+
tenants={tenants}
|
|
2715
|
+
onMentorDeleted={handleDelete}
|
|
2716
|
+
onMentorCopied={handleCopy}
|
|
2717
|
+
labels={MENTOR_SETTINGS_TAB_LABELS}
|
|
2718
|
+
/>
|
|
2719
|
+
\`\`\`
|
|
2720
|
+
|
|
2721
|
+
The label system uses typed nested-object overrides. The package ships \`AGENT_SETTINGS_TAB_LABELS\` as the default; consumer apps pass their own vocabulary via the \`labels\` prop. Use \`resolveSettingsTabLabels(override)\` for deep-merging partial overrides.
|
|
2722
|
+
|
|
2723
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
2724
|
+
|
|
2725
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/settings-tab.tsx\``,
|
|
2726
|
+
LLMTab: `# LLMTab Component
|
|
2727
|
+
|
|
2728
|
+
LLM provider selection grid with search, provider cards, and a modal for choosing specific models. Reads identity from AgentSettingsProvider context — must be wrapped by it.
|
|
2729
|
+
|
|
2730
|
+
\`\`\`typescript
|
|
2731
|
+
import { LLMTab } from '@iblai/iblai-js/web-containers/next';
|
|
2732
|
+
import type { LLMTabProps, LLMProviderDetails, DeepPartial, LLMTabLabels } from '@iblai/iblai-js/web-containers/next';
|
|
2733
|
+
|
|
2734
|
+
interface LLMTabProps {
|
|
2735
|
+
showConfigurationHeader?: boolean;
|
|
2736
|
+
getLLMProviderDetails: (providerName: string, llmName?: string) => LLMProviderDetails;
|
|
2737
|
+
labels?: DeepPartial<LLMTabLabels>;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
interface LLMProviderDetails {
|
|
2741
|
+
logo: string;
|
|
2742
|
+
name: string;
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
<LLMTab
|
|
2746
|
+
getLLMProviderDetails={(name) => ({
|
|
2747
|
+
name: name.charAt(0).toUpperCase() + name.slice(1),
|
|
2748
|
+
logo: \`/llm-\${name}-provider.png\`,
|
|
2749
|
+
})}
|
|
2750
|
+
labels={MENTOR_LLM_TAB_LABELS}
|
|
2751
|
+
/>
|
|
2752
|
+
\`\`\`
|
|
2753
|
+
|
|
2754
|
+
\`getLLMProviderDetails\` is host-provided because provider logos live in the consuming app's \`/public\` dir.
|
|
2755
|
+
|
|
2756
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
2757
|
+
|
|
2758
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/llm-tab.tsx\``,
|
|
2759
|
+
ToolsTab: `# ToolsTab Component
|
|
2760
|
+
|
|
2761
|
+
Tool toggle grid for enabling/disabling tools and integrations on an agent. Reads identity from AgentSettingsProvider context — must be wrapped by it.
|
|
2762
|
+
|
|
2763
|
+
\`\`\`typescript
|
|
2764
|
+
import { ToolsTab } from '@iblai/iblai-js/web-containers/next';
|
|
2765
|
+
import type { ToolsTabProps, ToolsTabLabels, DeepPartial } from '@iblai/iblai-js/web-containers/next';
|
|
2766
|
+
|
|
2767
|
+
interface ToolsTabProps {
|
|
2768
|
+
labels?: DeepPartial<ToolsTabLabels>;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
// With the default "agent" labels:
|
|
2772
|
+
<ToolsTab />
|
|
2773
|
+
|
|
2774
|
+
// With custom "mentor" labels:
|
|
2775
|
+
import { MENTOR_TOOLS_TAB_LABELS } from './mentor-tools-labels';
|
|
2776
|
+
|
|
2777
|
+
<ToolsTab labels={MENTOR_TOOLS_TAB_LABELS} />
|
|
2778
|
+
\`\`\`
|
|
2779
|
+
|
|
2780
|
+
Each tool row has a Switch that toggles the tool slug on the mentor via \`useEditMentorMutation\`. Permissions are gated through \`WithFormPermissions\` using the \`enableRBAC\` flag from context.
|
|
2781
|
+
|
|
2782
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
2783
|
+
|
|
2784
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/tools-tab.tsx\``,
|
|
2785
|
+
MemoryTab: `# MemoryTab Component
|
|
2786
|
+
|
|
2787
|
+
Memory settings tab with an enable toggle and a ManageMemories CRUD subsection (filter by user/date range, add/edit/delete memories, bulk delete). Reads identity from AgentSettingsProvider context — must be wrapped by it.
|
|
2788
|
+
|
|
2789
|
+
\`\`\`typescript
|
|
2790
|
+
import { MemoryTab } from '@iblai/iblai-js/web-containers/next';
|
|
2791
|
+
import type { MemoryTabProps, MemoryTabLabels, DeepPartial } from '@iblai/iblai-js/web-containers/next';
|
|
2792
|
+
|
|
2793
|
+
interface MemoryTabProps {
|
|
2794
|
+
labels?: DeepPartial<MemoryTabLabels>;
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
// With the default "agent" labels:
|
|
2798
|
+
<MemoryTab />
|
|
2799
|
+
|
|
2800
|
+
// With custom "mentor" labels:
|
|
2801
|
+
import { MENTOR_MEMORY_TAB_LABELS } from './mentor-memory-labels';
|
|
2802
|
+
|
|
2803
|
+
<MemoryTab labels={MENTOR_MEMORY_TAB_LABELS} />
|
|
2804
|
+
\`\`\`
|
|
2805
|
+
|
|
2806
|
+
The enable toggle mutates \`enable_memory_component\` on mentor settings. The ManageMemories subsection uses \`useGetMentorMemoriesQuery\`, \`useCreateMentorMemoryMutation\`, \`useUpdateMentorMemoryMutation\`, \`useDeleteMentorMemoryMutation\`, and \`useGetMemoryCategoriesAdminQuery\` to manage memories by category.
|
|
2807
|
+
|
|
2808
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
2809
|
+
|
|
2810
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/memory-tab.tsx\``,
|
|
2811
|
+
SafetyTab: `# SafetyTab Component
|
|
2812
|
+
|
|
2813
|
+
Safety and moderation settings with four prompt cards (Moderation Prompt, Safety Prompt, Moderation Response, Safety Response) and optional Flagged Prompts viewer. Reads identity from AgentSettingsProvider context — must be wrapped by it.
|
|
2814
|
+
|
|
2815
|
+
\`\`\`typescript
|
|
2816
|
+
import { SafetyTab } from '@iblai/iblai-js/web-containers/next';
|
|
2817
|
+
import type {
|
|
2818
|
+
SafetyTabProps,
|
|
2819
|
+
SafetyTabLabels,
|
|
2820
|
+
SafetySelectedPrompt,
|
|
2821
|
+
SafetyEditFormValues,
|
|
2822
|
+
DeepPartial,
|
|
2823
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
2824
|
+
|
|
2825
|
+
interface SafetyTabProps {
|
|
2826
|
+
/** Render a prompt string as rich content (e.g. Markdown). Defaults to plain text. */
|
|
2827
|
+
renderPromptContent?: (content: string) => React.ReactNode;
|
|
2828
|
+
/** Modal for editing a prompt. Host-provided. */
|
|
2829
|
+
EditPromptModal?: React.ComponentType<{
|
|
2830
|
+
isOpen: boolean;
|
|
2831
|
+
onClose: () => void;
|
|
2832
|
+
handleSave: (p: SafetySelectedPrompt, v: SafetyEditFormValues) => void;
|
|
2833
|
+
selectedPrompt: SafetySelectedPrompt;
|
|
2834
|
+
isEditing: boolean;
|
|
2835
|
+
}>;
|
|
2836
|
+
/** Modal showing flagged/moderated prompts. Host-provided. */
|
|
2837
|
+
FlaggedPromptsModal?: React.ComponentType<{
|
|
2838
|
+
isOpen: boolean;
|
|
2839
|
+
onClose: () => void;
|
|
2840
|
+
mentorId: string;
|
|
2841
|
+
tenantKey: string;
|
|
2842
|
+
username: string;
|
|
2843
|
+
}>;
|
|
2844
|
+
/** Whether to show the View Flagged Prompts button. Defaults to true. */
|
|
2845
|
+
showFlaggedPrompts?: boolean;
|
|
2846
|
+
labels?: DeepPartial<SafetyTabLabels>;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
<SafetyTab
|
|
2850
|
+
labels={MENTOR_SAFETY_TAB_LABELS}
|
|
2851
|
+
renderPromptContent={(content) => (
|
|
2852
|
+
<Markdown className="text-sm text-gray-700">
|
|
2853
|
+
{parsePrompt(content)}
|
|
2854
|
+
</Markdown>
|
|
2855
|
+
)}
|
|
2856
|
+
EditPromptModal={EditPromptModal}
|
|
2857
|
+
FlaggedPromptsModal={FlaggedPromptsModal}
|
|
2858
|
+
/>
|
|
2859
|
+
\`\`\`
|
|
2860
|
+
|
|
2861
|
+
\`EditPromptModal\`, \`FlaggedPromptsModal\`, and \`renderPromptContent\` are host-provided because they have standalone-specific dependencies (rich-text editing, pagination, notification dialogs) that don't belong in the shared package. The default \`renderPromptContent\` renders plain text.
|
|
2862
|
+
|
|
2863
|
+
The moderation/safety toggle switches use \`executeGatedAction\` from context when provided (e.g., for paywall gating on free-trial users).
|
|
2864
|
+
|
|
2865
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
2866
|
+
|
|
2867
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/safety-tab.tsx\``,
|
|
2868
|
+
CopyButton: `# CopyButton Component
|
|
2869
|
+
|
|
2870
|
+
Small button that copies text to the clipboard and shows "Copied" feedback for a short duration. Used by prompt cards in SafetyTab, PromptsTab, and DisclaimersTab.
|
|
2871
|
+
|
|
2872
|
+
\`\`\`typescript
|
|
2873
|
+
import { CopyButton } from '@iblai/iblai-js/web-containers/next';
|
|
2874
|
+
|
|
2875
|
+
interface CopyButtonProps {
|
|
2876
|
+
text: string;
|
|
2877
|
+
disabled?: boolean;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
<CopyButton text={mentor?.system_prompt ?? ''} />
|
|
2881
|
+
<CopyButton text="Copy me" disabled={isLoading} />
|
|
2882
|
+
\`\`\`
|
|
2883
|
+
|
|
2884
|
+
Internally uses \`useCopyToClipboard\` with a 1000ms reset timeout. The aria-label switches between "Copy text to clipboard" and "Text copied to clipboard" based on status.
|
|
2885
|
+
|
|
2886
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
2887
|
+
|
|
2888
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/copy-button.tsx\``,
|
|
2889
|
+
// ============================================================================
|
|
2890
|
+
// AGENT SEARCH — explore, pick and star AI mentors / agents
|
|
2891
|
+
// ============================================================================
|
|
2892
|
+
AgentSearch: `# AgentSearch Component
|
|
2893
|
+
|
|
2894
|
+
Full explore-page drop-in that combines search input, filter row, and the four sections (Starred, Featured, Custom, Default). Reads tenant metadata internally, debounces the search input, and wires star mutations via \`useAgentStar\`.
|
|
2895
|
+
|
|
2896
|
+
\`\`\`typescript
|
|
2897
|
+
import { AgentSearch } from '@iblai/iblai-js/web-containers/next';
|
|
2898
|
+
import type {
|
|
2899
|
+
AgentSearchProps,
|
|
2900
|
+
AgentSearchSection,
|
|
2901
|
+
AgentSearchLabels,
|
|
2902
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
2903
|
+
|
|
2904
|
+
<AgentSearch
|
|
2905
|
+
tenantKey={tenantKey}
|
|
2906
|
+
username={username}
|
|
2907
|
+
enableRBAC={enableRBAC}
|
|
2908
|
+
rbacPermissions={rbacPermissions}
|
|
2909
|
+
executeGatedAction={executeWithTrialCheck}
|
|
2910
|
+
mainTenantKey="main"
|
|
2911
|
+
onAgentClick={(agent) => router.push(\`/\${agent.slug}\`)}
|
|
2912
|
+
onCreateAgent={() => setCreateOpen(true)}
|
|
2913
|
+
onUnauthenticatedAction={() => redirectToAuthSpa()}
|
|
2914
|
+
createAgentRbacResource="/mentors/#create"
|
|
2915
|
+
labels={MENTOR_SEARCH_LABELS}
|
|
2916
|
+
include={['starred', 'featured', 'custom', 'default', 'filters']}
|
|
2917
|
+
getLLMProviderName={(key) => providerMap[key] ?? key}
|
|
2918
|
+
/>
|
|
2919
|
+
\`\`\`
|
|
2920
|
+
|
|
2921
|
+
\`include\` defaults to all sections. Terminology defaults to "agent"; host apps override via \`labels\` (either a full bundle or a \`DeepPartial\`).
|
|
2922
|
+
|
|
2923
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
2924
|
+
|
|
2925
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/agent-search.tsx\``,
|
|
2926
|
+
AgentCard: `# AgentCard Component
|
|
2927
|
+
|
|
2928
|
+
Clickable card for a single agent search result. Renders avatar, name, description, "Updated on …" timestamp, and optionally a \`StarButton\` when \`variant="with-star"\`.
|
|
2929
|
+
|
|
2930
|
+
\`\`\`typescript
|
|
2931
|
+
import { AgentCard } from '@iblai/iblai-js/web-containers/next';
|
|
2932
|
+
import type { AgentCardProps } from '@iblai/iblai-js/web-containers/next';
|
|
2933
|
+
|
|
2934
|
+
interface AgentCardProps {
|
|
2935
|
+
agent: AgentSearchResult;
|
|
2936
|
+
onClick: (agent: AgentSearchResult) => void;
|
|
2937
|
+
variant?: 'default' | 'with-star'; // default: 'default'
|
|
2938
|
+
isStarred?: boolean;
|
|
2939
|
+
isTogglingStar?: boolean;
|
|
2940
|
+
onToggleStar?: (agent: AgentSearchResult, e: React.MouseEvent) => void;
|
|
2941
|
+
disableStar?: boolean;
|
|
2942
|
+
updatedOnLabel?: string; // default: 'Updated on'
|
|
2943
|
+
exploreAriaPrefix?: string; // default: 'Explore agent:'
|
|
2944
|
+
formatDate?: (dateString: string) => string;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
<AgentCard
|
|
2948
|
+
agent={agent}
|
|
2949
|
+
variant="with-star"
|
|
2950
|
+
isStarred={agent.starred}
|
|
2951
|
+
isTogglingStar={togglingAgentId === String(agent.id)}
|
|
2952
|
+
onToggleStar={toggleFavorite}
|
|
2953
|
+
onClick={handleAgentClick}
|
|
2954
|
+
/>
|
|
2955
|
+
\`\`\`
|
|
2956
|
+
|
|
2957
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
2958
|
+
|
|
2959
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/agent-card.tsx\``,
|
|
2960
|
+
AgentSearchInput: `# AgentSearchInput Component
|
|
2961
|
+
|
|
2962
|
+
Debounce-friendly search input with a magnifier icon that swaps to a spinner while \`isLoading\` is true. Visually labelled for screen readers.
|
|
2963
|
+
|
|
2964
|
+
\`\`\`typescript
|
|
2965
|
+
import { AgentSearchInput } from '@iblai/iblai-js/web-containers/next';
|
|
2966
|
+
import type { AgentSearchInputProps } from '@iblai/iblai-js/web-containers/next';
|
|
2967
|
+
|
|
2968
|
+
interface AgentSearchInputProps {
|
|
2969
|
+
value: string;
|
|
2970
|
+
onChange: (value: string) => void;
|
|
2971
|
+
isLoading?: boolean;
|
|
2972
|
+
placeholder?: string; // default: 'Search'
|
|
2973
|
+
ariaLabel?: string; // default: 'Search agents'
|
|
2974
|
+
className?: string;
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
<AgentSearchInput
|
|
2978
|
+
value={searchQuery}
|
|
2979
|
+
onChange={setSearchQuery}
|
|
2980
|
+
isLoading={isFetching}
|
|
2981
|
+
placeholder={labels.searchPlaceholder}
|
|
2982
|
+
ariaLabel={labels.searchAriaLabel}
|
|
2983
|
+
/>
|
|
2984
|
+
\`\`\`
|
|
2985
|
+
|
|
2986
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
2987
|
+
|
|
2988
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/agent-search-input.tsx\``,
|
|
2989
|
+
AgentSearchFilters: `# AgentSearchFilters Component
|
|
2990
|
+
|
|
2991
|
+
Horizontal row of dropdown filters driven by the facets returned by \`useAgentSearch\` (Category, Subject, LLM Provider, Type, Featured / Promotion) plus an optional "Created By" (Me / My Organization / Community) filter and a "Clear All" button.
|
|
2992
|
+
|
|
2993
|
+
\`\`\`typescript
|
|
2994
|
+
import { AgentSearchFilters } from '@iblai/iblai-js/web-containers/next';
|
|
2995
|
+
import type {
|
|
2996
|
+
AgentSearchFiltersProps,
|
|
2997
|
+
AgentSearchFiltersState,
|
|
2998
|
+
AgentSearchFiltersLabels,
|
|
2999
|
+
CreatedByFilter,
|
|
3000
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3001
|
+
|
|
3002
|
+
<AgentSearchFilters
|
|
3003
|
+
facets={facets}
|
|
3004
|
+
showCreatedByFilter={communityEnabled}
|
|
3005
|
+
includeMeToCreatedByFilter={hasCustomAgents}
|
|
3006
|
+
onFiltersChange={setFilters}
|
|
3007
|
+
onCreatedByChange={setCreatedBy}
|
|
3008
|
+
labels={labels.filters}
|
|
3009
|
+
getLLMProviderName={(key) => providerMap[key] ?? key}
|
|
3010
|
+
/>
|
|
3011
|
+
\`\`\`
|
|
3012
|
+
|
|
3013
|
+
\`CreatedByFilter\` = \`'me' | 'my-organization' | 'community' | null\`.
|
|
3014
|
+
|
|
3015
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
3016
|
+
|
|
3017
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/agent-search-filters.tsx\``,
|
|
3018
|
+
AgentEmptyState: `# AgentEmptyState Component
|
|
3019
|
+
|
|
3020
|
+
Simple "no results" card used inside agent-search sections.
|
|
3021
|
+
|
|
3022
|
+
\`\`\`typescript
|
|
3023
|
+
import { AgentEmptyState } from '@iblai/iblai-js/web-containers/next';
|
|
3024
|
+
import type { AgentEmptyStateProps } from '@iblai/iblai-js/web-containers/next';
|
|
3025
|
+
|
|
3026
|
+
interface AgentEmptyStateProps {
|
|
3027
|
+
message?: string; // default: 'Sorry, no agents found!'
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
<AgentEmptyState message={labels.noResults} />
|
|
3031
|
+
\`\`\`
|
|
3032
|
+
|
|
3033
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
3034
|
+
|
|
3035
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/agent-empty-state.tsx\``,
|
|
3036
|
+
StarButton: `# StarButton Component
|
|
3037
|
+
|
|
3038
|
+
Small icon-only button used inside \`AgentCard\` (and anywhere else an agent favorite toggle is rendered). Renders a \`Star\` icon when idle and a \`Loader2\` spinner while \`isToggling\`. Wraps a Radix \`Tooltip\` and swaps aria labels + tooltip copy based on state.
|
|
3039
|
+
|
|
3040
|
+
\`\`\`typescript
|
|
3041
|
+
import { StarButton } from '@iblai/iblai-js/web-containers/next';
|
|
3042
|
+
import type { StarButtonProps } from '@iblai/iblai-js/web-containers/next';
|
|
3043
|
+
|
|
3044
|
+
interface StarButtonProps {
|
|
3045
|
+
isStarred?: boolean;
|
|
3046
|
+
isToggling?: boolean;
|
|
3047
|
+
disabled?: boolean;
|
|
3048
|
+
onClick: (e: React.MouseEvent) => void;
|
|
3049
|
+
tooltipStarred?: string; // default: 'Unset as favorite'
|
|
3050
|
+
tooltipUnstarred?: string; // default: 'Set as favorite'
|
|
3051
|
+
ariaLabelStarred?: string; // default: 'Remove from favorites'
|
|
3052
|
+
ariaLabelUnstarred?: string; // default: 'Add to favorites'
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
<StarButton
|
|
3056
|
+
isStarred={agent.starred}
|
|
3057
|
+
isToggling={togglingAgentId === String(agent.id)}
|
|
3058
|
+
onClick={(e) => toggleFavorite(agent, e)}
|
|
3059
|
+
/>
|
|
3060
|
+
\`\`\`
|
|
3061
|
+
|
|
3062
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
3063
|
+
|
|
3064
|
+
**File Location**: \`packages/web-containers/src/components/agent-search/star-button.tsx\``,
|
|
3065
|
+
// ============================================================================
|
|
3066
|
+
// EDIT MENTOR MODAL — tab components
|
|
3067
|
+
// Each tab reads identity (tenantKey / mentorId / username / enableRBAC /
|
|
3068
|
+
// executeGatedAction) from <AgentSettingsProvider> via useAgentSettings().
|
|
3069
|
+
// ============================================================================
|
|
3070
|
+
AccessTab: `# AccessTab Component
|
|
3071
|
+
|
|
3072
|
+
RBAC access / role management tab for the Edit Mentor Modal. Lists existing access policies, supports adding users or groups, and editing/removing their roles. Reads identity from \`AgentSettingsProvider\`.
|
|
3073
|
+
|
|
3074
|
+
\`\`\`typescript
|
|
3075
|
+
import { AccessTab } from '@iblai/iblai-js/web-containers/next';
|
|
3076
|
+
import type {
|
|
3077
|
+
AccessTabProps,
|
|
3078
|
+
AccessTabLabels,
|
|
3079
|
+
DeepPartial,
|
|
3080
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3081
|
+
|
|
3082
|
+
interface AccessTabProps {
|
|
3083
|
+
labels?: DeepPartial<AccessTabLabels>;
|
|
3084
|
+
/** Called when the tab fetches RBAC permissions for /users/ and /groups/. */
|
|
3085
|
+
onPermissionsLoaded?: (permissions: object) => void;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
<AccessTab
|
|
3089
|
+
labels={MENTOR_ACCESS_TAB_LABELS}
|
|
3090
|
+
onPermissionsLoaded={(perms) => dispatch(rbac.merge(perms))}
|
|
3091
|
+
/>
|
|
3092
|
+
\`\`\`
|
|
3093
|
+
|
|
3094
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3095
|
+
|
|
3096
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/access-tab.tsx\``,
|
|
3097
|
+
ApiTab: `# ApiTab Component
|
|
3098
|
+
|
|
3099
|
+
API-key management tab: lists existing keys with their creation date and lets the admin create or revoke them. Reads identity from \`AgentSettingsProvider\` and uses \`useGetApiKeysQuery\` / \`WithPermissions\`. Gated via \`executeGatedAction\` when provided.
|
|
3100
|
+
|
|
3101
|
+
\`\`\`typescript
|
|
3102
|
+
import { ApiTab } from '@iblai/iblai-js/web-containers/next';
|
|
3103
|
+
import type {
|
|
3104
|
+
ApiTabProps,
|
|
3105
|
+
ApiTabLabels,
|
|
3106
|
+
ApiKey,
|
|
3107
|
+
DeepPartial,
|
|
3108
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3109
|
+
|
|
3110
|
+
interface ApiTabProps {
|
|
3111
|
+
labels?: DeepPartial<ApiTabLabels>;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3114
|
+
<ApiTab labels={MENTOR_API_TAB_LABELS} />
|
|
3115
|
+
\`\`\`
|
|
3116
|
+
|
|
3117
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3118
|
+
|
|
3119
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/api-tab.tsx\``,
|
|
3120
|
+
DatasetsTab: `# DatasetsTab Component
|
|
3121
|
+
|
|
3122
|
+
Knowledge / training dataset management tab. Shows a searchable paginated table of datasets with train / delete / retrain actions. Because the standalone "Add Resource" modal (Dropbox / Drive / OneDrive pickers) and the standalone pagination component have deep app-specific dependencies, both are injected as props.
|
|
3123
|
+
|
|
3124
|
+
\`\`\`typescript
|
|
3125
|
+
import { DatasetsTab } from '@iblai/iblai-js/web-containers/next';
|
|
3126
|
+
import type {
|
|
3127
|
+
DatasetsTabProps,
|
|
3128
|
+
DatasetsTabLabels,
|
|
3129
|
+
Dataset,
|
|
3130
|
+
DeepPartial,
|
|
3131
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3132
|
+
|
|
3133
|
+
interface DatasetsTabProps {
|
|
3134
|
+
labels?: DeepPartial<DatasetsTabLabels>;
|
|
3135
|
+
onSelect?: (dataset: Dataset) => void;
|
|
3136
|
+
selectedDatasetId?: string;
|
|
3137
|
+
AddResourceModal?: React.ComponentType<{
|
|
3138
|
+
isOpen: boolean;
|
|
3139
|
+
onClose: () => void;
|
|
3140
|
+
keepParentOpen?: boolean;
|
|
3141
|
+
}>;
|
|
3142
|
+
PaginationComponent?: React.ComponentType<{
|
|
3143
|
+
currentPage: number;
|
|
3144
|
+
totalPages: number;
|
|
3145
|
+
onPageChange: (page: number) => void;
|
|
3146
|
+
disabled: boolean;
|
|
3147
|
+
}>;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
<DatasetsTab
|
|
3151
|
+
labels={MENTOR_DATASETS_TAB_LABELS}
|
|
3152
|
+
AddResourceModal={AddResourceModal}
|
|
3153
|
+
PaginationComponent={IblPagination}
|
|
3154
|
+
/>
|
|
3155
|
+
\`\`\`
|
|
3156
|
+
|
|
3157
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3158
|
+
|
|
3159
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/datasets-tab.tsx\``,
|
|
3160
|
+
DisclaimersTab: `# DisclaimersTab Component
|
|
3161
|
+
|
|
3162
|
+
User Agreement + Advisory disclaimer management tab. Renders the current disclaimer content with an Edit action, a separate user-agreement card, and supports plain or Markdown rendering via \`renderContent\`.
|
|
3163
|
+
|
|
3164
|
+
\`\`\`typescript
|
|
3165
|
+
import { DisclaimersTab } from '@iblai/iblai-js/web-containers/next';
|
|
3166
|
+
import type {
|
|
3167
|
+
DisclaimersTabProps,
|
|
3168
|
+
DisclaimersTabLabels,
|
|
3169
|
+
DeepPartial,
|
|
3170
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3171
|
+
|
|
3172
|
+
interface DisclaimersTabProps {
|
|
3173
|
+
labels?: DeepPartial<DisclaimersTabLabels>;
|
|
3174
|
+
defaultDisclaimerContent?: string;
|
|
3175
|
+
renderContent?: (content: string) => React.ReactNode;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
<DisclaimersTab
|
|
3179
|
+
labels={MENTOR_DISCLAIMERS_TAB_LABELS}
|
|
3180
|
+
defaultDisclaimerContent={DEFAULT_DISCLAIMER}
|
|
3181
|
+
renderContent={(content) => <Markdown>{content}</Markdown>}
|
|
3182
|
+
/>
|
|
3183
|
+
\`\`\`
|
|
3184
|
+
|
|
3185
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3186
|
+
|
|
3187
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/disclaimers-tab.tsx\``,
|
|
3188
|
+
EmbedTab: `# EmbedTab Component
|
|
3189
|
+
|
|
3190
|
+
Embed / share configuration tab. Handles visibility, SSO provider selection, custom floating bubble config, CSS/JS overrides, and generates copy-paste embed snippets via a host-provided \`CopyCodeBlock\` component. URL building and the copyable code renderer are injected because they depend on standalone-specific libs.
|
|
3191
|
+
|
|
3192
|
+
\`\`\`typescript
|
|
3193
|
+
import { EmbedTab } from '@iblai/iblai-js/web-containers/next';
|
|
3194
|
+
import type {
|
|
3195
|
+
EmbedTabProps,
|
|
3196
|
+
EmbedTabLabels,
|
|
3197
|
+
EmbedUrlConfig,
|
|
3198
|
+
VisibilityOption,
|
|
3199
|
+
SsoProvider,
|
|
3200
|
+
DeepPartial,
|
|
3201
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3202
|
+
|
|
3203
|
+
interface EmbedTabProps {
|
|
3204
|
+
labels?: DeepPartial<EmbedTabLabels>;
|
|
3205
|
+
urls: EmbedUrlConfig;
|
|
3206
|
+
CopyCodeBlock: React.ComponentType<{ code: string }>;
|
|
3207
|
+
visibilityOptions: VisibilityOption[];
|
|
3208
|
+
ssoProviders?: SsoProvider[];
|
|
3209
|
+
isSsoProvidersError?: boolean;
|
|
3210
|
+
supportEmail?: string;
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3213
|
+
<EmbedTab
|
|
3214
|
+
labels={MENTOR_EMBED_TAB_LABELS}
|
|
3215
|
+
urls={embedUrls}
|
|
3216
|
+
CopyCodeBlock={CopyCodeBlock}
|
|
3217
|
+
visibilityOptions={visibilityOptions}
|
|
3218
|
+
ssoProviders={ssoProviders}
|
|
3219
|
+
/>
|
|
3220
|
+
\`\`\`
|
|
3221
|
+
|
|
3222
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3223
|
+
|
|
3224
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/embed-tab.tsx\``,
|
|
3225
|
+
HistoryTab: `# HistoryTab Component
|
|
3226
|
+
|
|
3227
|
+
Chat-history browser for a mentor. Supports date-range / user / session filtering, pagination, optional export, and custom rendering of AI message content (e.g. Markdown). The pagination UI is host-provided.
|
|
3228
|
+
|
|
3229
|
+
\`\`\`typescript
|
|
3230
|
+
import { HistoryTab } from '@iblai/iblai-js/web-containers/next';
|
|
3231
|
+
import type {
|
|
3232
|
+
HistoryTabProps,
|
|
3233
|
+
HistoryTabLabels,
|
|
3234
|
+
DeepPartial,
|
|
3235
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3236
|
+
|
|
3237
|
+
interface HistoryTabProps {
|
|
3238
|
+
renderMessageContent?: (content: string) => React.ReactNode;
|
|
3239
|
+
PaginationComponent?: React.ComponentType<{
|
|
3240
|
+
currentPage: number;
|
|
3241
|
+
totalPages: number;
|
|
3242
|
+
onPageChange: (page: number) => void;
|
|
3243
|
+
disabled: boolean;
|
|
3244
|
+
disableNumberedButtons?: boolean;
|
|
3245
|
+
}>;
|
|
3246
|
+
onExport?: (filters: ChatHistoryFilter) => void;
|
|
3247
|
+
isExporting?: boolean;
|
|
3248
|
+
labels?: DeepPartial<HistoryTabLabels>;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
<HistoryTab
|
|
3252
|
+
labels={MENTOR_HISTORY_TAB_LABELS}
|
|
3253
|
+
renderMessageContent={(c) => <Markdown>{c}</Markdown>}
|
|
3254
|
+
PaginationComponent={IblPagination}
|
|
3255
|
+
onExport={handleExport}
|
|
3256
|
+
isExporting={isExporting}
|
|
3257
|
+
/>
|
|
3258
|
+
\`\`\`
|
|
3259
|
+
|
|
3260
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3261
|
+
|
|
3262
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/history-tab.tsx\``,
|
|
3263
|
+
PromptsTab: `# PromptsTab Component
|
|
3264
|
+
|
|
3265
|
+
Suggested / guided prompts management tab. Supports toggling greeting method (proactive response vs. proactive prompt), adding / editing individual prompts, and rendering prompt bodies as plain text or Markdown via \`renderPromptContent\`.
|
|
3266
|
+
|
|
3267
|
+
\`\`\`typescript
|
|
3268
|
+
import {
|
|
3269
|
+
PromptsTab,
|
|
3270
|
+
GreetingMethod,
|
|
3271
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3272
|
+
import type {
|
|
3273
|
+
PromptsTabProps,
|
|
3274
|
+
PromptsTabLabels,
|
|
3275
|
+
PromptsSelectedPrompt,
|
|
3276
|
+
PromptsEditFormValues,
|
|
3277
|
+
DeepPartial,
|
|
3278
|
+
} from '@iblai/iblai-js/web-containers/next';
|
|
3279
|
+
|
|
3280
|
+
interface PromptsTabProps {
|
|
3281
|
+
renderPromptContent?: (content: string) => React.ReactNode;
|
|
3282
|
+
labels?: DeepPartial<PromptsTabLabels>;
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
<PromptsTab
|
|
3286
|
+
labels={MENTOR_PROMPTS_TAB_LABELS}
|
|
3287
|
+
renderPromptContent={(c) => <Markdown>{parsePrompt(c)}</Markdown>}
|
|
3288
|
+
/>
|
|
3289
|
+
\`\`\`
|
|
3290
|
+
|
|
3291
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js and AgentSettingsProvider wrapper
|
|
3292
|
+
|
|
3293
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/prompts-tab.tsx\``,
|
|
3294
|
+
CopyMentorModal: `# CopyMentorModal Component
|
|
3295
|
+
|
|
3296
|
+
Forks a mentor into another tenant. Renders a Dialog with name / visibility / target-tenant inputs, drives \`useForkMentorMutation\` + \`useEditMentorMutation\`, and surfaces toast feedback. Typically launched from \`SettingsTab\`.
|
|
3297
|
+
|
|
3298
|
+
\`\`\`typescript
|
|
3299
|
+
import { CopyMentorModal } from '@iblai/iblai-js/web-containers/next';
|
|
3300
|
+
import type { CopyMentorTenant } from '@iblai/iblai-js/web-containers/next';
|
|
3301
|
+
|
|
3302
|
+
interface CopyMentorModalProps {
|
|
3303
|
+
open: boolean;
|
|
3304
|
+
onClose: () => void;
|
|
3305
|
+
tenantKey: string;
|
|
3306
|
+
mentorId: string;
|
|
3307
|
+
username: string;
|
|
3308
|
+
tenants: CopyMentorTenant[]; // { key, name?, is_admin }[]
|
|
3309
|
+
isLoadingTenants?: boolean;
|
|
3310
|
+
onSuccessfulCopy?: (copiedMentorId: string) => void;
|
|
3311
|
+
labels?: CopyMentorModalLabels;
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
<CopyMentorModal
|
|
3315
|
+
open={isCopyOpen}
|
|
3316
|
+
onClose={() => setCopyOpen(false)}
|
|
3317
|
+
tenantKey={tenantKey}
|
|
3318
|
+
mentorId={mentorId}
|
|
3319
|
+
username={username}
|
|
3320
|
+
tenants={tenants}
|
|
3321
|
+
isLoadingTenants={isLoadingTenants}
|
|
3322
|
+
/>
|
|
3323
|
+
\`\`\`
|
|
3324
|
+
|
|
3325
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
3326
|
+
|
|
3327
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/settings-tab/copy-mentor-modal.tsx\``,
|
|
3328
|
+
DeleteMentorModal: `# DeleteMentorModal Component
|
|
3329
|
+
|
|
3330
|
+
AlertDialog confirmation for destroying a mentor. Drives \`useDeleteMentorMutation\` and calls back \`onSuccessfulDelete\` after the dialog closes so the host can handle parent-modal close and navigation.
|
|
3331
|
+
|
|
3332
|
+
\`\`\`typescript
|
|
3333
|
+
import { DeleteMentorModal } from '@iblai/iblai-js/web-containers/next';
|
|
3334
|
+
|
|
3335
|
+
interface DeleteMentorModalProps {
|
|
3336
|
+
isOpen: boolean;
|
|
3337
|
+
onClose: () => void;
|
|
3338
|
+
tenantKey: string;
|
|
3339
|
+
mentorId: string;
|
|
3340
|
+
username: string;
|
|
3341
|
+
onSuccessfulDelete?: (deletedMentorId: string) => void;
|
|
3342
|
+
labels?: DeleteMentorModalLabels; // SettingsTabLabels['deleteModal']
|
|
3343
|
+
}
|
|
3344
|
+
|
|
3345
|
+
<DeleteMentorModal
|
|
3346
|
+
isOpen={isDeleteOpen}
|
|
3347
|
+
onClose={() => setDeleteOpen(false)}
|
|
3348
|
+
tenantKey={tenantKey}
|
|
3349
|
+
mentorId={mentorId}
|
|
3350
|
+
username={username}
|
|
3351
|
+
onSuccessfulDelete={(id) => {
|
|
3352
|
+
setDeleteOpen(false);
|
|
3353
|
+
router.push('/mentors');
|
|
3354
|
+
}}
|
|
3355
|
+
/>
|
|
3356
|
+
\`\`\`
|
|
3357
|
+
|
|
3358
|
+
> **Import from \`@iblai/iblai-js/web-containers/next\`** — requires Next.js
|
|
3359
|
+
|
|
3360
|
+
**File Location**: \`packages/web-containers/src/components/modals/edit-mentor-modal/tabs/settings-tab/delete-mentor-modal.tsx\``,
|
|
2564
3361
|
};
|
|
2565
3362
|
const UI_PRIMITIVES = [
|
|
2566
3363
|
'Button',
|
|
@@ -2621,6 +3418,13 @@ export function getComponentInfo(componentName) {
|
|
|
2621
3418
|
'EdxIframe',
|
|
2622
3419
|
'CourseContentTabPage',
|
|
2623
3420
|
'CourseContentLayout',
|
|
3421
|
+
'AgentSettingsProvider',
|
|
3422
|
+
'SettingsTab',
|
|
3423
|
+
'LLMTab',
|
|
3424
|
+
'ToolsTab',
|
|
3425
|
+
'MemoryTab',
|
|
3426
|
+
'SafetyTab',
|
|
3427
|
+
'CopyButton',
|
|
2624
3428
|
];
|
|
2625
3429
|
return `Component "${componentName}" not found.
|
|
2626
3430
|
|