@libxai/board 0.14.0 → 0.14.2
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.cjs +92 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -5
- package/dist/index.d.ts +111 -5
- package/dist/index.js +92 -47
- package/dist/index.js.map +1 -1
- package/dist/styles.css +15 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1528,7 +1528,7 @@ interface GanttScrollBehavior {
|
|
|
1528
1528
|
* AI Assistant configuration for natural language task editing
|
|
1529
1529
|
* @version 0.14.0
|
|
1530
1530
|
*/
|
|
1531
|
-
interface GanttAIAssistantConfig {
|
|
1531
|
+
interface GanttAIAssistantConfig$1 {
|
|
1532
1532
|
/** Enable AI assistant (default: false) */
|
|
1533
1533
|
enabled?: boolean;
|
|
1534
1534
|
/** Custom placeholder text */
|
|
@@ -1536,17 +1536,21 @@ interface GanttAIAssistantConfig {
|
|
|
1536
1536
|
/** Position of the chat button */
|
|
1537
1537
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
1538
1538
|
/** Handler for AI commands - should return task updates */
|
|
1539
|
-
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult>;
|
|
1539
|
+
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult$1>;
|
|
1540
1540
|
/** Custom suggestions for the command palette */
|
|
1541
1541
|
suggestions?: string[];
|
|
1542
1542
|
/** Maximum messages to keep in history */
|
|
1543
1543
|
maxHistory?: number;
|
|
1544
|
+
/** Show quick add task button (default: true) */
|
|
1545
|
+
showQuickAdd?: boolean;
|
|
1546
|
+
/** Callback when quick add button is clicked */
|
|
1547
|
+
onQuickAddClick?: () => void;
|
|
1544
1548
|
}
|
|
1545
1549
|
/**
|
|
1546
1550
|
* AI Command result interface
|
|
1547
1551
|
* @version 0.14.0
|
|
1548
1552
|
*/
|
|
1549
|
-
interface AICommandResult {
|
|
1553
|
+
interface AICommandResult$1 {
|
|
1550
1554
|
type: 'move_task' | 'resize_task' | 'rename_task' | 'delete_task' | 'create_task' | 'link_tasks' | 'unlink_tasks' | 'assign_task' | 'set_progress' | 'set_status' | 'split_task' | 'group_tasks' | 'unknown';
|
|
1551
1555
|
taskId?: string;
|
|
1552
1556
|
taskName?: string;
|
|
@@ -1570,7 +1574,7 @@ interface GanttConfig {
|
|
|
1570
1574
|
initials: string;
|
|
1571
1575
|
color: string;
|
|
1572
1576
|
}>;
|
|
1573
|
-
aiAssistant?: GanttAIAssistantConfig;
|
|
1577
|
+
aiAssistant?: GanttAIAssistantConfig$1;
|
|
1574
1578
|
templates?: GanttTemplates;
|
|
1575
1579
|
permissions?: GanttPermissions;
|
|
1576
1580
|
disableScrollSync?: boolean;
|
|
@@ -2006,6 +2010,108 @@ interface TaskFormModalProps {
|
|
|
2006
2010
|
}
|
|
2007
2011
|
declare function TaskFormModal({ isOpen, onClose, task, availableTasks, availableUsers, onSubmit, isLoading, mode, theme, }: TaskFormModalProps): react_jsx_runtime.JSX.Element;
|
|
2008
2012
|
|
|
2013
|
+
type AICommandType = 'move_task' | 'resize_task' | 'rename_task' | 'delete_task' | 'create_task' | 'link_tasks' | 'unlink_tasks' | 'assign_task' | 'set_progress' | 'set_status' | 'split_task' | 'group_tasks' | 'unknown';
|
|
2014
|
+
interface AICommandResult {
|
|
2015
|
+
type: AICommandType;
|
|
2016
|
+
taskId?: string;
|
|
2017
|
+
taskName?: string;
|
|
2018
|
+
updates?: Partial<Task>;
|
|
2019
|
+
newTask?: Task;
|
|
2020
|
+
dependencyFrom?: string;
|
|
2021
|
+
dependencyTo?: string;
|
|
2022
|
+
message: string;
|
|
2023
|
+
success: boolean;
|
|
2024
|
+
error?: string;
|
|
2025
|
+
}
|
|
2026
|
+
interface GanttAIAssistantConfig {
|
|
2027
|
+
/** Enable AI assistant */
|
|
2028
|
+
enabled?: boolean;
|
|
2029
|
+
/** Custom placeholder text */
|
|
2030
|
+
placeholder?: string;
|
|
2031
|
+
/** Position of the chat button */
|
|
2032
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
2033
|
+
/** Handler for AI commands - should return task updates */
|
|
2034
|
+
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult>;
|
|
2035
|
+
/** Custom suggestions for the command palette */
|
|
2036
|
+
suggestions?: string[];
|
|
2037
|
+
/** Maximum messages to keep in history */
|
|
2038
|
+
maxHistory?: number;
|
|
2039
|
+
/** Show quick add task button (default: true) */
|
|
2040
|
+
showQuickAdd?: boolean;
|
|
2041
|
+
/** Callback when quick add button is clicked */
|
|
2042
|
+
onQuickAddClick?: () => void;
|
|
2043
|
+
}
|
|
2044
|
+
interface GanttAIAssistantProps {
|
|
2045
|
+
/** All current tasks in the Gantt */
|
|
2046
|
+
tasks: Task[];
|
|
2047
|
+
/** Theme configuration */
|
|
2048
|
+
theme: GanttTheme;
|
|
2049
|
+
/** AI assistant configuration */
|
|
2050
|
+
config: GanttAIAssistantConfig;
|
|
2051
|
+
/** Callback when tasks should be updated */
|
|
2052
|
+
onTasksUpdate: (updatedTasks: Task[]) => void;
|
|
2053
|
+
/** Callback for single task update */
|
|
2054
|
+
onTaskUpdate?: (taskId: string, updates: Partial<Task>) => void;
|
|
2055
|
+
/** Callback for task creation */
|
|
2056
|
+
onTaskCreate?: (task: Task) => void;
|
|
2057
|
+
/** Callback for task deletion */
|
|
2058
|
+
onTaskDelete?: (taskId: string) => void;
|
|
2059
|
+
/** Callback for dependency creation */
|
|
2060
|
+
onDependencyCreate?: (fromTaskId: string, toTaskId: string) => void;
|
|
2061
|
+
/** Callback for dependency deletion */
|
|
2062
|
+
onDependencyDelete?: (taskId: string, dependencyId: string) => void;
|
|
2063
|
+
}
|
|
2064
|
+
declare function GanttAIAssistant({ tasks, theme, config, onTasksUpdate: _onTasksUpdate, // Reserved for batch updates
|
|
2065
|
+
onTaskUpdate, onTaskCreate, onTaskDelete, onDependencyCreate, onDependencyDelete, }: GanttAIAssistantProps): react_jsx_runtime.JSX.Element | null;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* AI Command Parser for Gantt Chart
|
|
2069
|
+
* Parses natural language commands and converts them to task operations
|
|
2070
|
+
*
|
|
2071
|
+
* This module provides utilities for parsing AI responses and generating
|
|
2072
|
+
* prompts for natural language task editing.
|
|
2073
|
+
*
|
|
2074
|
+
* @version 0.14.0
|
|
2075
|
+
*/
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* System prompt for the AI model to understand Gantt task commands
|
|
2079
|
+
*/
|
|
2080
|
+
declare const GANTT_AI_SYSTEM_PROMPT = "You are a Gantt chart AI assistant. You help users edit project tasks using natural language commands.\n\nAVAILABLE COMMANDS:\n1. move_task - Move a task to a different date\n2. resize_task - Change task duration (extend/shorten)\n3. rename_task - Rename a task\n4. delete_task - Delete a task\n5. create_task - Create a new task\n6. link_tasks - Create dependency between tasks\n7. unlink_tasks - Remove dependency\n8. assign_task - Assign users to task\n9. set_progress - Update task progress (0-100%)\n10. set_status - Change task status (todo, in-progress, completed)\n\nRESPONSE FORMAT (JSON):\n{\n \"type\": \"command_type\",\n \"taskId\": \"id of the task to modify (if found)\",\n \"taskName\": \"name of the task mentioned\",\n \"updates\": { /* partial task updates */ },\n \"newTask\": { /* for create_task only */ },\n \"dependencyFrom\": \"source task id (for link/unlink)\",\n \"dependencyTo\": \"target task id (for link/unlink)\",\n \"message\": \"Human-readable response explaining what was done\",\n \"success\": true/false,\n \"error\": \"error message if failed\"\n}\n\nEXAMPLES:\n- \"Move Design to next Monday\" -> move_task with startDate update\n- \"Extend Testing by 3 days\" -> resize_task with endDate update\n- \"Rename 'Old Task' to 'New Task'\" -> rename_task with name update\n- \"Set Development progress to 50%\" -> set_progress with progress: 50\n- \"Link Design to Development\" -> link_tasks\n- \"Create a new task called 'Review'\" -> create_task\n\nTASK DATA FORMAT:\nTasks have: id, name, startDate, endDate, progress, status, dependencies[], assignees[]\n\nAlways try to match task names case-insensitively and handle partial matches.\nIf you can't find a task by name, search through the provided task list.\nIf ambiguous, ask for clarification in the message field.";
|
|
2081
|
+
/**
|
|
2082
|
+
* Generate the user prompt with current tasks context
|
|
2083
|
+
*/
|
|
2084
|
+
declare function generateTasksContext(tasks: Task[]): string;
|
|
2085
|
+
/**
|
|
2086
|
+
* Find a task by name (case-insensitive, partial match)
|
|
2087
|
+
*/
|
|
2088
|
+
declare function findTaskByName(tasks: Task[], name: string): Task | undefined;
|
|
2089
|
+
/**
|
|
2090
|
+
* Parse date from natural language
|
|
2091
|
+
*/
|
|
2092
|
+
declare function parseNaturalDate(text: string, referenceDate?: Date): Date | null;
|
|
2093
|
+
/**
|
|
2094
|
+
* Parse duration from natural language
|
|
2095
|
+
*/
|
|
2096
|
+
declare function parseNaturalDuration(text: string): number | null;
|
|
2097
|
+
/**
|
|
2098
|
+
* Parse progress percentage from natural language
|
|
2099
|
+
*/
|
|
2100
|
+
declare function parseProgress(text: string): number | null;
|
|
2101
|
+
/**
|
|
2102
|
+
* Parse task status from natural language
|
|
2103
|
+
*/
|
|
2104
|
+
declare function parseStatus(text: string): 'todo' | 'in-progress' | 'completed' | null;
|
|
2105
|
+
/**
|
|
2106
|
+
* Local command parser (for offline/simple commands without AI)
|
|
2107
|
+
* This can handle basic commands without needing an AI API call
|
|
2108
|
+
*/
|
|
2109
|
+
declare function parseLocalCommand(command: string, tasks: Task[]): AICommandResult$1 | null;
|
|
2110
|
+
/**
|
|
2111
|
+
* Validate and sanitize AI response
|
|
2112
|
+
*/
|
|
2113
|
+
declare function validateAIResponse(response: unknown): AICommandResult$1;
|
|
2114
|
+
|
|
2009
2115
|
/**
|
|
2010
2116
|
* Public utility functions for Gantt operations
|
|
2011
2117
|
* Similar to DHTMLX gantt.* utility methods
|
|
@@ -4455,4 +4561,4 @@ declare const themes: Record<ThemeName, Theme>;
|
|
|
4455
4561
|
*/
|
|
4456
4562
|
declare const defaultTheme: ThemeName;
|
|
4457
4563
|
|
|
4458
|
-
export { type AICallbacks, type GanttTask as AIGanttTask, type AIModelKey, type AIOperation, AIUsageDashboard, type AIUsageDashboardProps, AI_FEATURES, AI_MODELS, type Activity, type ActivityType, type AssigneeSuggestion, type Attachment, AttachmentUploader, type AttachmentUploaderProps, type Board, type BoardCallbacks, type BoardConfig, BoardProvider, type BoardProviderProps, type BorderRadiusToken, BulkOperationsToolbar, type BulkOperationsToolbarProps, BurnDownChart, type BurnDownChartProps, type BurnDownDataPoint, Card, CardDetailModal, type CardDetailModalProps, CardDetailModalV2, type CardDetailModalV2Props, type CardFilter, type CardFilters, CardHistoryReplay, type CardHistoryReplayProps, CardHistoryTimeline, type CardHistoryTimelineProps, type CardProps, CardRelationshipsGraph, type CardRelationshipsGraphProps, type CardSort, type CardSortKey, CardStack, type CardStackProps, type CardStack$1 as CardStackType, type CardStatus, type CardTemplate, CardTemplateSelector, type CardTemplateSelectorProps, type Card$1 as CardType, CircuitBreaker, Column, ColumnManager, type ColumnProps, type Column$1 as ColumnType, CommandPalette, type CommandPaletteProps, type Comment, ConfigMenu, type ConfigMenuProps, ContextMenu, DEFAULT_SHORTCUTS, DEFAULT_TEMPLATES, type DateFilter, DateRangePicker, type DateRangePickerProps, DependenciesSelector, type DependenciesSelectorProps, DependencyLine, type DesignTokens, DistributionCharts, type DistributionChartsProps, type DistributionDataPoint, type DragData, type DropData, type DurationToken, type EasingToken, EditableColumnTitle, type EditableColumnTitleProps, ErrorBoundary, type ErrorBoundaryProps, type ExportFormat, ExportImportModal, type ExportImportModalProps, type ExportOptions, FilterBar, type FilterBarProps, type FilterState, type FontSizeToken, type FontWeightToken, type Assignee as GanttAssignee, GanttBoard, type GanttConfig as GanttBoardConfig, type GanttBoardRef, type GanttColumn, type ColumnType as GanttColumnType, Milestone as GanttMilestone, type GanttPermissions, type Task as GanttTask, type GanttTemplates, type Theme$1 as GanttTheme, type GanttTheme as GanttThemeConfig, GanttToolbar, GenerateGanttTasksDialog, type GenerateGanttTasksDialogProps, GeneratePlanModal, type GeneratePlanModalProps, type GeneratedPlan, type GeneratedTasksResponse, type GroupByOption, GroupBySelector, type GroupBySelectorProps, type IPluginManager, type ImportResult, type Insight, type InsightSeverity, type InsightType, KanbanBoard, type KanbanBoardProps, KanbanViewAdapter, type KanbanViewConfig, type KeyboardAction, type KeyboardShortcut, KeyboardShortcutsHelp, type KeyboardShortcutsHelpProps, type LineHeightToken, MenuIcons, type OpacityToken, type Plugin, type PluginContext, type PluginHooks, PluginManager, type Priority, PrioritySelector, type PrioritySelectorProps, RATE_LIMITS, type RenderProps, type RetryOptions, type RetryResult, type ShadowToken, type SortBy, type SortOrder, type SortState, type SpacingToken, type StackSuggestion, type StackingConfig, type StackingStrategy, type Swimlane, SwimlaneBoardView, type SwimlaneBoardViewProps, type SwimlaneConfig, TaskBar, type TaskFormData, TaskFormModal, type TaskFormModalProps, TaskGrid, type Theme, type ThemeColors, type ThemeContextValue, ThemeModal, type ThemeModalProps, type ThemeName, ThemeProvider, ThemeSwitcher, type TimeScale, Timeline, type ThemeColors$1 as TokenThemeColors, type TokenValue, type UsageStats, type UseAIOptions, type UseAIReturn, type UseBoardReturn as UseBoardCoreReturn, type UseBoardOptions, type UseBoardReturn$1 as UseBoardReturn, type UseCardStackingOptions, type UseCardStackingResult, type UseDragStateReturn, type UseFiltersOptions, type UseFiltersReturn, type UseKanbanStateOptions, type UseKanbanStateReturn, type UseKeyboardShortcutsOptions, type UseKeyboardShortcutsReturn, type UseMultiSelectReturn, type UseSelectionStateReturn, type User$1 as User, UserAssignmentSelector, type UserAssignmentSelectorProps, VelocityChart, type VelocityChartProps, type VelocityDataPoint, VirtualGrid, type VirtualGridProps, VirtualList, type VirtualListProps, type ZIndexToken, aiUsageTracker, borderRadius, calculatePosition, cardToGanttTask, cardsToGanttTasks, cn, createKanbanView, createRetryWrapper, darkTheme, darkTheme$1 as darkTokenTheme, defaultTheme, designTokens, duration, easing, exportTokensToCSS, fontSize, fontWeight, formatCost, ganttTaskToCardUpdate, themes$1 as ganttThemes, gantt as ganttTokens, ganttUtils, generateCSSVariables, generateCompleteCSS, generateInitialPositions, generateThemeVariables, getToken, kanban as kanbanTokens, lightTheme, lightTheme$1 as lightTokenTheme, lineHeight, neutralTheme, neutralTheme$1 as neutralTokenTheme, opacity, pluginManager, retrySyncOperation, retryWithBackoff, shadows, shouldVirtualizeGrid, spacing, themes, useAI, useBoard$1 as useBoard, useBoard as useBoardCore, useBoardStore, useCardStacking, useDragState, useFilteredCards, useFilters, useKanbanState, useKeyboardShortcuts, useMultiSelect, useSelectionState, useSortedCards, useTheme, useVirtualGrid, useVirtualList, withErrorBoundary, zIndex };
|
|
4564
|
+
export { type AICallbacks, type AICommandResult$1 as AICommandResult, type GanttTask as AIGanttTask, type AIModelKey, type AIOperation, AIUsageDashboard, type AIUsageDashboardProps, AI_FEATURES, AI_MODELS, type Activity, type ActivityType, type AssigneeSuggestion, type Attachment, AttachmentUploader, type AttachmentUploaderProps, type Board, type BoardCallbacks, type BoardConfig, BoardProvider, type BoardProviderProps, type BorderRadiusToken, BulkOperationsToolbar, type BulkOperationsToolbarProps, BurnDownChart, type BurnDownChartProps, type BurnDownDataPoint, Card, CardDetailModal, type CardDetailModalProps, CardDetailModalV2, type CardDetailModalV2Props, type CardFilter, type CardFilters, CardHistoryReplay, type CardHistoryReplayProps, CardHistoryTimeline, type CardHistoryTimelineProps, type CardProps, CardRelationshipsGraph, type CardRelationshipsGraphProps, type CardSort, type CardSortKey, CardStack, type CardStackProps, type CardStack$1 as CardStackType, type CardStatus, type CardTemplate, CardTemplateSelector, type CardTemplateSelectorProps, type Card$1 as CardType, CircuitBreaker, Column, ColumnManager, type ColumnProps, type Column$1 as ColumnType, CommandPalette, type CommandPaletteProps, type Comment, ConfigMenu, type ConfigMenuProps, ContextMenu, DEFAULT_SHORTCUTS, DEFAULT_TEMPLATES, type DateFilter, DateRangePicker, type DateRangePickerProps, DependenciesSelector, type DependenciesSelectorProps, DependencyLine, type DesignTokens, DistributionCharts, type DistributionChartsProps, type DistributionDataPoint, type DragData, type DropData, type DurationToken, type EasingToken, EditableColumnTitle, type EditableColumnTitleProps, ErrorBoundary, type ErrorBoundaryProps, type ExportFormat, ExportImportModal, type ExportImportModalProps, type ExportOptions, FilterBar, type FilterBarProps, type FilterState, type FontSizeToken, type FontWeightToken, GANTT_AI_SYSTEM_PROMPT, GanttAIAssistant, type GanttAIAssistantConfig$1 as GanttAIAssistantConfig, type Assignee as GanttAssignee, GanttBoard, type GanttConfig as GanttBoardConfig, type GanttBoardRef, type GanttColumn, type ColumnType as GanttColumnType, Milestone as GanttMilestone, type GanttPermissions, type Task as GanttTask, type GanttTemplates, type Theme$1 as GanttTheme, type GanttTheme as GanttThemeConfig, GanttToolbar, GenerateGanttTasksDialog, type GenerateGanttTasksDialogProps, GeneratePlanModal, type GeneratePlanModalProps, type GeneratedPlan, type GeneratedTasksResponse, type GroupByOption, GroupBySelector, type GroupBySelectorProps, type IPluginManager, type ImportResult, type Insight, type InsightSeverity, type InsightType, KanbanBoard, type KanbanBoardProps, KanbanViewAdapter, type KanbanViewConfig, type KeyboardAction, type KeyboardShortcut, KeyboardShortcutsHelp, type KeyboardShortcutsHelpProps, type LineHeightToken, MenuIcons, type OpacityToken, type Plugin, type PluginContext, type PluginHooks, PluginManager, type Priority, PrioritySelector, type PrioritySelectorProps, RATE_LIMITS, type RenderProps, type RetryOptions, type RetryResult, type ShadowToken, type SortBy, type SortOrder, type SortState, type SpacingToken, type StackSuggestion, type StackingConfig, type StackingStrategy, type Swimlane, SwimlaneBoardView, type SwimlaneBoardViewProps, type SwimlaneConfig, TaskBar, type TaskFormData, TaskFormModal, type TaskFormModalProps, TaskGrid, type Theme, type ThemeColors, type ThemeContextValue, ThemeModal, type ThemeModalProps, type ThemeName, ThemeProvider, ThemeSwitcher, type TimeScale, Timeline, type ThemeColors$1 as TokenThemeColors, type TokenValue, type UsageStats, type UseAIOptions, type UseAIReturn, type UseBoardReturn as UseBoardCoreReturn, type UseBoardOptions, type UseBoardReturn$1 as UseBoardReturn, type UseCardStackingOptions, type UseCardStackingResult, type UseDragStateReturn, type UseFiltersOptions, type UseFiltersReturn, type UseKanbanStateOptions, type UseKanbanStateReturn, type UseKeyboardShortcutsOptions, type UseKeyboardShortcutsReturn, type UseMultiSelectReturn, type UseSelectionStateReturn, type User$1 as User, UserAssignmentSelector, type UserAssignmentSelectorProps, VelocityChart, type VelocityChartProps, type VelocityDataPoint, VirtualGrid, type VirtualGridProps, VirtualList, type VirtualListProps, type ZIndexToken, aiUsageTracker, borderRadius, calculatePosition, cardToGanttTask, cardsToGanttTasks, cn, createKanbanView, createRetryWrapper, darkTheme, darkTheme$1 as darkTokenTheme, defaultTheme, designTokens, duration, easing, exportTokensToCSS, findTaskByName, fontSize, fontWeight, formatCost, ganttTaskToCardUpdate, themes$1 as ganttThemes, gantt as ganttTokens, ganttUtils, generateCSSVariables, generateCompleteCSS, generateInitialPositions, generateTasksContext, generateThemeVariables, getToken, kanban as kanbanTokens, lightTheme, lightTheme$1 as lightTokenTheme, lineHeight, neutralTheme, neutralTheme$1 as neutralTokenTheme, opacity, parseLocalCommand, parseNaturalDate, parseNaturalDuration, parseProgress, parseStatus, pluginManager, retrySyncOperation, retryWithBackoff, shadows, shouldVirtualizeGrid, spacing, themes, useAI, useBoard$1 as useBoard, useBoard as useBoardCore, useBoardStore, useCardStacking, useDragState, useFilteredCards, useFilters, useKanbanState, useKeyboardShortcuts, useMultiSelect, useSelectionState, useSortedCards, useTheme, useVirtualGrid, useVirtualList, validateAIResponse, withErrorBoundary, zIndex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1528,7 +1528,7 @@ interface GanttScrollBehavior {
|
|
|
1528
1528
|
* AI Assistant configuration for natural language task editing
|
|
1529
1529
|
* @version 0.14.0
|
|
1530
1530
|
*/
|
|
1531
|
-
interface GanttAIAssistantConfig {
|
|
1531
|
+
interface GanttAIAssistantConfig$1 {
|
|
1532
1532
|
/** Enable AI assistant (default: false) */
|
|
1533
1533
|
enabled?: boolean;
|
|
1534
1534
|
/** Custom placeholder text */
|
|
@@ -1536,17 +1536,21 @@ interface GanttAIAssistantConfig {
|
|
|
1536
1536
|
/** Position of the chat button */
|
|
1537
1537
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
1538
1538
|
/** Handler for AI commands - should return task updates */
|
|
1539
|
-
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult>;
|
|
1539
|
+
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult$1>;
|
|
1540
1540
|
/** Custom suggestions for the command palette */
|
|
1541
1541
|
suggestions?: string[];
|
|
1542
1542
|
/** Maximum messages to keep in history */
|
|
1543
1543
|
maxHistory?: number;
|
|
1544
|
+
/** Show quick add task button (default: true) */
|
|
1545
|
+
showQuickAdd?: boolean;
|
|
1546
|
+
/** Callback when quick add button is clicked */
|
|
1547
|
+
onQuickAddClick?: () => void;
|
|
1544
1548
|
}
|
|
1545
1549
|
/**
|
|
1546
1550
|
* AI Command result interface
|
|
1547
1551
|
* @version 0.14.0
|
|
1548
1552
|
*/
|
|
1549
|
-
interface AICommandResult {
|
|
1553
|
+
interface AICommandResult$1 {
|
|
1550
1554
|
type: 'move_task' | 'resize_task' | 'rename_task' | 'delete_task' | 'create_task' | 'link_tasks' | 'unlink_tasks' | 'assign_task' | 'set_progress' | 'set_status' | 'split_task' | 'group_tasks' | 'unknown';
|
|
1551
1555
|
taskId?: string;
|
|
1552
1556
|
taskName?: string;
|
|
@@ -1570,7 +1574,7 @@ interface GanttConfig {
|
|
|
1570
1574
|
initials: string;
|
|
1571
1575
|
color: string;
|
|
1572
1576
|
}>;
|
|
1573
|
-
aiAssistant?: GanttAIAssistantConfig;
|
|
1577
|
+
aiAssistant?: GanttAIAssistantConfig$1;
|
|
1574
1578
|
templates?: GanttTemplates;
|
|
1575
1579
|
permissions?: GanttPermissions;
|
|
1576
1580
|
disableScrollSync?: boolean;
|
|
@@ -2006,6 +2010,108 @@ interface TaskFormModalProps {
|
|
|
2006
2010
|
}
|
|
2007
2011
|
declare function TaskFormModal({ isOpen, onClose, task, availableTasks, availableUsers, onSubmit, isLoading, mode, theme, }: TaskFormModalProps): react_jsx_runtime.JSX.Element;
|
|
2008
2012
|
|
|
2013
|
+
type AICommandType = 'move_task' | 'resize_task' | 'rename_task' | 'delete_task' | 'create_task' | 'link_tasks' | 'unlink_tasks' | 'assign_task' | 'set_progress' | 'set_status' | 'split_task' | 'group_tasks' | 'unknown';
|
|
2014
|
+
interface AICommandResult {
|
|
2015
|
+
type: AICommandType;
|
|
2016
|
+
taskId?: string;
|
|
2017
|
+
taskName?: string;
|
|
2018
|
+
updates?: Partial<Task>;
|
|
2019
|
+
newTask?: Task;
|
|
2020
|
+
dependencyFrom?: string;
|
|
2021
|
+
dependencyTo?: string;
|
|
2022
|
+
message: string;
|
|
2023
|
+
success: boolean;
|
|
2024
|
+
error?: string;
|
|
2025
|
+
}
|
|
2026
|
+
interface GanttAIAssistantConfig {
|
|
2027
|
+
/** Enable AI assistant */
|
|
2028
|
+
enabled?: boolean;
|
|
2029
|
+
/** Custom placeholder text */
|
|
2030
|
+
placeholder?: string;
|
|
2031
|
+
/** Position of the chat button */
|
|
2032
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
2033
|
+
/** Handler for AI commands - should return task updates */
|
|
2034
|
+
onCommand?: (command: string, tasks: Task[]) => Promise<AICommandResult>;
|
|
2035
|
+
/** Custom suggestions for the command palette */
|
|
2036
|
+
suggestions?: string[];
|
|
2037
|
+
/** Maximum messages to keep in history */
|
|
2038
|
+
maxHistory?: number;
|
|
2039
|
+
/** Show quick add task button (default: true) */
|
|
2040
|
+
showQuickAdd?: boolean;
|
|
2041
|
+
/** Callback when quick add button is clicked */
|
|
2042
|
+
onQuickAddClick?: () => void;
|
|
2043
|
+
}
|
|
2044
|
+
interface GanttAIAssistantProps {
|
|
2045
|
+
/** All current tasks in the Gantt */
|
|
2046
|
+
tasks: Task[];
|
|
2047
|
+
/** Theme configuration */
|
|
2048
|
+
theme: GanttTheme;
|
|
2049
|
+
/** AI assistant configuration */
|
|
2050
|
+
config: GanttAIAssistantConfig;
|
|
2051
|
+
/** Callback when tasks should be updated */
|
|
2052
|
+
onTasksUpdate: (updatedTasks: Task[]) => void;
|
|
2053
|
+
/** Callback for single task update */
|
|
2054
|
+
onTaskUpdate?: (taskId: string, updates: Partial<Task>) => void;
|
|
2055
|
+
/** Callback for task creation */
|
|
2056
|
+
onTaskCreate?: (task: Task) => void;
|
|
2057
|
+
/** Callback for task deletion */
|
|
2058
|
+
onTaskDelete?: (taskId: string) => void;
|
|
2059
|
+
/** Callback for dependency creation */
|
|
2060
|
+
onDependencyCreate?: (fromTaskId: string, toTaskId: string) => void;
|
|
2061
|
+
/** Callback for dependency deletion */
|
|
2062
|
+
onDependencyDelete?: (taskId: string, dependencyId: string) => void;
|
|
2063
|
+
}
|
|
2064
|
+
declare function GanttAIAssistant({ tasks, theme, config, onTasksUpdate: _onTasksUpdate, // Reserved for batch updates
|
|
2065
|
+
onTaskUpdate, onTaskCreate, onTaskDelete, onDependencyCreate, onDependencyDelete, }: GanttAIAssistantProps): react_jsx_runtime.JSX.Element | null;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* AI Command Parser for Gantt Chart
|
|
2069
|
+
* Parses natural language commands and converts them to task operations
|
|
2070
|
+
*
|
|
2071
|
+
* This module provides utilities for parsing AI responses and generating
|
|
2072
|
+
* prompts for natural language task editing.
|
|
2073
|
+
*
|
|
2074
|
+
* @version 0.14.0
|
|
2075
|
+
*/
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* System prompt for the AI model to understand Gantt task commands
|
|
2079
|
+
*/
|
|
2080
|
+
declare const GANTT_AI_SYSTEM_PROMPT = "You are a Gantt chart AI assistant. You help users edit project tasks using natural language commands.\n\nAVAILABLE COMMANDS:\n1. move_task - Move a task to a different date\n2. resize_task - Change task duration (extend/shorten)\n3. rename_task - Rename a task\n4. delete_task - Delete a task\n5. create_task - Create a new task\n6. link_tasks - Create dependency between tasks\n7. unlink_tasks - Remove dependency\n8. assign_task - Assign users to task\n9. set_progress - Update task progress (0-100%)\n10. set_status - Change task status (todo, in-progress, completed)\n\nRESPONSE FORMAT (JSON):\n{\n \"type\": \"command_type\",\n \"taskId\": \"id of the task to modify (if found)\",\n \"taskName\": \"name of the task mentioned\",\n \"updates\": { /* partial task updates */ },\n \"newTask\": { /* for create_task only */ },\n \"dependencyFrom\": \"source task id (for link/unlink)\",\n \"dependencyTo\": \"target task id (for link/unlink)\",\n \"message\": \"Human-readable response explaining what was done\",\n \"success\": true/false,\n \"error\": \"error message if failed\"\n}\n\nEXAMPLES:\n- \"Move Design to next Monday\" -> move_task with startDate update\n- \"Extend Testing by 3 days\" -> resize_task with endDate update\n- \"Rename 'Old Task' to 'New Task'\" -> rename_task with name update\n- \"Set Development progress to 50%\" -> set_progress with progress: 50\n- \"Link Design to Development\" -> link_tasks\n- \"Create a new task called 'Review'\" -> create_task\n\nTASK DATA FORMAT:\nTasks have: id, name, startDate, endDate, progress, status, dependencies[], assignees[]\n\nAlways try to match task names case-insensitively and handle partial matches.\nIf you can't find a task by name, search through the provided task list.\nIf ambiguous, ask for clarification in the message field.";
|
|
2081
|
+
/**
|
|
2082
|
+
* Generate the user prompt with current tasks context
|
|
2083
|
+
*/
|
|
2084
|
+
declare function generateTasksContext(tasks: Task[]): string;
|
|
2085
|
+
/**
|
|
2086
|
+
* Find a task by name (case-insensitive, partial match)
|
|
2087
|
+
*/
|
|
2088
|
+
declare function findTaskByName(tasks: Task[], name: string): Task | undefined;
|
|
2089
|
+
/**
|
|
2090
|
+
* Parse date from natural language
|
|
2091
|
+
*/
|
|
2092
|
+
declare function parseNaturalDate(text: string, referenceDate?: Date): Date | null;
|
|
2093
|
+
/**
|
|
2094
|
+
* Parse duration from natural language
|
|
2095
|
+
*/
|
|
2096
|
+
declare function parseNaturalDuration(text: string): number | null;
|
|
2097
|
+
/**
|
|
2098
|
+
* Parse progress percentage from natural language
|
|
2099
|
+
*/
|
|
2100
|
+
declare function parseProgress(text: string): number | null;
|
|
2101
|
+
/**
|
|
2102
|
+
* Parse task status from natural language
|
|
2103
|
+
*/
|
|
2104
|
+
declare function parseStatus(text: string): 'todo' | 'in-progress' | 'completed' | null;
|
|
2105
|
+
/**
|
|
2106
|
+
* Local command parser (for offline/simple commands without AI)
|
|
2107
|
+
* This can handle basic commands without needing an AI API call
|
|
2108
|
+
*/
|
|
2109
|
+
declare function parseLocalCommand(command: string, tasks: Task[]): AICommandResult$1 | null;
|
|
2110
|
+
/**
|
|
2111
|
+
* Validate and sanitize AI response
|
|
2112
|
+
*/
|
|
2113
|
+
declare function validateAIResponse(response: unknown): AICommandResult$1;
|
|
2114
|
+
|
|
2009
2115
|
/**
|
|
2010
2116
|
* Public utility functions for Gantt operations
|
|
2011
2117
|
* Similar to DHTMLX gantt.* utility methods
|
|
@@ -4455,4 +4561,4 @@ declare const themes: Record<ThemeName, Theme>;
|
|
|
4455
4561
|
*/
|
|
4456
4562
|
declare const defaultTheme: ThemeName;
|
|
4457
4563
|
|
|
4458
|
-
export { type AICallbacks, type GanttTask as AIGanttTask, type AIModelKey, type AIOperation, AIUsageDashboard, type AIUsageDashboardProps, AI_FEATURES, AI_MODELS, type Activity, type ActivityType, type AssigneeSuggestion, type Attachment, AttachmentUploader, type AttachmentUploaderProps, type Board, type BoardCallbacks, type BoardConfig, BoardProvider, type BoardProviderProps, type BorderRadiusToken, BulkOperationsToolbar, type BulkOperationsToolbarProps, BurnDownChart, type BurnDownChartProps, type BurnDownDataPoint, Card, CardDetailModal, type CardDetailModalProps, CardDetailModalV2, type CardDetailModalV2Props, type CardFilter, type CardFilters, CardHistoryReplay, type CardHistoryReplayProps, CardHistoryTimeline, type CardHistoryTimelineProps, type CardProps, CardRelationshipsGraph, type CardRelationshipsGraphProps, type CardSort, type CardSortKey, CardStack, type CardStackProps, type CardStack$1 as CardStackType, type CardStatus, type CardTemplate, CardTemplateSelector, type CardTemplateSelectorProps, type Card$1 as CardType, CircuitBreaker, Column, ColumnManager, type ColumnProps, type Column$1 as ColumnType, CommandPalette, type CommandPaletteProps, type Comment, ConfigMenu, type ConfigMenuProps, ContextMenu, DEFAULT_SHORTCUTS, DEFAULT_TEMPLATES, type DateFilter, DateRangePicker, type DateRangePickerProps, DependenciesSelector, type DependenciesSelectorProps, DependencyLine, type DesignTokens, DistributionCharts, type DistributionChartsProps, type DistributionDataPoint, type DragData, type DropData, type DurationToken, type EasingToken, EditableColumnTitle, type EditableColumnTitleProps, ErrorBoundary, type ErrorBoundaryProps, type ExportFormat, ExportImportModal, type ExportImportModalProps, type ExportOptions, FilterBar, type FilterBarProps, type FilterState, type FontSizeToken, type FontWeightToken, type Assignee as GanttAssignee, GanttBoard, type GanttConfig as GanttBoardConfig, type GanttBoardRef, type GanttColumn, type ColumnType as GanttColumnType, Milestone as GanttMilestone, type GanttPermissions, type Task as GanttTask, type GanttTemplates, type Theme$1 as GanttTheme, type GanttTheme as GanttThemeConfig, GanttToolbar, GenerateGanttTasksDialog, type GenerateGanttTasksDialogProps, GeneratePlanModal, type GeneratePlanModalProps, type GeneratedPlan, type GeneratedTasksResponse, type GroupByOption, GroupBySelector, type GroupBySelectorProps, type IPluginManager, type ImportResult, type Insight, type InsightSeverity, type InsightType, KanbanBoard, type KanbanBoardProps, KanbanViewAdapter, type KanbanViewConfig, type KeyboardAction, type KeyboardShortcut, KeyboardShortcutsHelp, type KeyboardShortcutsHelpProps, type LineHeightToken, MenuIcons, type OpacityToken, type Plugin, type PluginContext, type PluginHooks, PluginManager, type Priority, PrioritySelector, type PrioritySelectorProps, RATE_LIMITS, type RenderProps, type RetryOptions, type RetryResult, type ShadowToken, type SortBy, type SortOrder, type SortState, type SpacingToken, type StackSuggestion, type StackingConfig, type StackingStrategy, type Swimlane, SwimlaneBoardView, type SwimlaneBoardViewProps, type SwimlaneConfig, TaskBar, type TaskFormData, TaskFormModal, type TaskFormModalProps, TaskGrid, type Theme, type ThemeColors, type ThemeContextValue, ThemeModal, type ThemeModalProps, type ThemeName, ThemeProvider, ThemeSwitcher, type TimeScale, Timeline, type ThemeColors$1 as TokenThemeColors, type TokenValue, type UsageStats, type UseAIOptions, type UseAIReturn, type UseBoardReturn as UseBoardCoreReturn, type UseBoardOptions, type UseBoardReturn$1 as UseBoardReturn, type UseCardStackingOptions, type UseCardStackingResult, type UseDragStateReturn, type UseFiltersOptions, type UseFiltersReturn, type UseKanbanStateOptions, type UseKanbanStateReturn, type UseKeyboardShortcutsOptions, type UseKeyboardShortcutsReturn, type UseMultiSelectReturn, type UseSelectionStateReturn, type User$1 as User, UserAssignmentSelector, type UserAssignmentSelectorProps, VelocityChart, type VelocityChartProps, type VelocityDataPoint, VirtualGrid, type VirtualGridProps, VirtualList, type VirtualListProps, type ZIndexToken, aiUsageTracker, borderRadius, calculatePosition, cardToGanttTask, cardsToGanttTasks, cn, createKanbanView, createRetryWrapper, darkTheme, darkTheme$1 as darkTokenTheme, defaultTheme, designTokens, duration, easing, exportTokensToCSS, fontSize, fontWeight, formatCost, ganttTaskToCardUpdate, themes$1 as ganttThemes, gantt as ganttTokens, ganttUtils, generateCSSVariables, generateCompleteCSS, generateInitialPositions, generateThemeVariables, getToken, kanban as kanbanTokens, lightTheme, lightTheme$1 as lightTokenTheme, lineHeight, neutralTheme, neutralTheme$1 as neutralTokenTheme, opacity, pluginManager, retrySyncOperation, retryWithBackoff, shadows, shouldVirtualizeGrid, spacing, themes, useAI, useBoard$1 as useBoard, useBoard as useBoardCore, useBoardStore, useCardStacking, useDragState, useFilteredCards, useFilters, useKanbanState, useKeyboardShortcuts, useMultiSelect, useSelectionState, useSortedCards, useTheme, useVirtualGrid, useVirtualList, withErrorBoundary, zIndex };
|
|
4564
|
+
export { type AICallbacks, type AICommandResult$1 as AICommandResult, type GanttTask as AIGanttTask, type AIModelKey, type AIOperation, AIUsageDashboard, type AIUsageDashboardProps, AI_FEATURES, AI_MODELS, type Activity, type ActivityType, type AssigneeSuggestion, type Attachment, AttachmentUploader, type AttachmentUploaderProps, type Board, type BoardCallbacks, type BoardConfig, BoardProvider, type BoardProviderProps, type BorderRadiusToken, BulkOperationsToolbar, type BulkOperationsToolbarProps, BurnDownChart, type BurnDownChartProps, type BurnDownDataPoint, Card, CardDetailModal, type CardDetailModalProps, CardDetailModalV2, type CardDetailModalV2Props, type CardFilter, type CardFilters, CardHistoryReplay, type CardHistoryReplayProps, CardHistoryTimeline, type CardHistoryTimelineProps, type CardProps, CardRelationshipsGraph, type CardRelationshipsGraphProps, type CardSort, type CardSortKey, CardStack, type CardStackProps, type CardStack$1 as CardStackType, type CardStatus, type CardTemplate, CardTemplateSelector, type CardTemplateSelectorProps, type Card$1 as CardType, CircuitBreaker, Column, ColumnManager, type ColumnProps, type Column$1 as ColumnType, CommandPalette, type CommandPaletteProps, type Comment, ConfigMenu, type ConfigMenuProps, ContextMenu, DEFAULT_SHORTCUTS, DEFAULT_TEMPLATES, type DateFilter, DateRangePicker, type DateRangePickerProps, DependenciesSelector, type DependenciesSelectorProps, DependencyLine, type DesignTokens, DistributionCharts, type DistributionChartsProps, type DistributionDataPoint, type DragData, type DropData, type DurationToken, type EasingToken, EditableColumnTitle, type EditableColumnTitleProps, ErrorBoundary, type ErrorBoundaryProps, type ExportFormat, ExportImportModal, type ExportImportModalProps, type ExportOptions, FilterBar, type FilterBarProps, type FilterState, type FontSizeToken, type FontWeightToken, GANTT_AI_SYSTEM_PROMPT, GanttAIAssistant, type GanttAIAssistantConfig$1 as GanttAIAssistantConfig, type Assignee as GanttAssignee, GanttBoard, type GanttConfig as GanttBoardConfig, type GanttBoardRef, type GanttColumn, type ColumnType as GanttColumnType, Milestone as GanttMilestone, type GanttPermissions, type Task as GanttTask, type GanttTemplates, type Theme$1 as GanttTheme, type GanttTheme as GanttThemeConfig, GanttToolbar, GenerateGanttTasksDialog, type GenerateGanttTasksDialogProps, GeneratePlanModal, type GeneratePlanModalProps, type GeneratedPlan, type GeneratedTasksResponse, type GroupByOption, GroupBySelector, type GroupBySelectorProps, type IPluginManager, type ImportResult, type Insight, type InsightSeverity, type InsightType, KanbanBoard, type KanbanBoardProps, KanbanViewAdapter, type KanbanViewConfig, type KeyboardAction, type KeyboardShortcut, KeyboardShortcutsHelp, type KeyboardShortcutsHelpProps, type LineHeightToken, MenuIcons, type OpacityToken, type Plugin, type PluginContext, type PluginHooks, PluginManager, type Priority, PrioritySelector, type PrioritySelectorProps, RATE_LIMITS, type RenderProps, type RetryOptions, type RetryResult, type ShadowToken, type SortBy, type SortOrder, type SortState, type SpacingToken, type StackSuggestion, type StackingConfig, type StackingStrategy, type Swimlane, SwimlaneBoardView, type SwimlaneBoardViewProps, type SwimlaneConfig, TaskBar, type TaskFormData, TaskFormModal, type TaskFormModalProps, TaskGrid, type Theme, type ThemeColors, type ThemeContextValue, ThemeModal, type ThemeModalProps, type ThemeName, ThemeProvider, ThemeSwitcher, type TimeScale, Timeline, type ThemeColors$1 as TokenThemeColors, type TokenValue, type UsageStats, type UseAIOptions, type UseAIReturn, type UseBoardReturn as UseBoardCoreReturn, type UseBoardOptions, type UseBoardReturn$1 as UseBoardReturn, type UseCardStackingOptions, type UseCardStackingResult, type UseDragStateReturn, type UseFiltersOptions, type UseFiltersReturn, type UseKanbanStateOptions, type UseKanbanStateReturn, type UseKeyboardShortcutsOptions, type UseKeyboardShortcutsReturn, type UseMultiSelectReturn, type UseSelectionStateReturn, type User$1 as User, UserAssignmentSelector, type UserAssignmentSelectorProps, VelocityChart, type VelocityChartProps, type VelocityDataPoint, VirtualGrid, type VirtualGridProps, VirtualList, type VirtualListProps, type ZIndexToken, aiUsageTracker, borderRadius, calculatePosition, cardToGanttTask, cardsToGanttTasks, cn, createKanbanView, createRetryWrapper, darkTheme, darkTheme$1 as darkTokenTheme, defaultTheme, designTokens, duration, easing, exportTokensToCSS, findTaskByName, fontSize, fontWeight, formatCost, ganttTaskToCardUpdate, themes$1 as ganttThemes, gantt as ganttTokens, ganttUtils, generateCSSVariables, generateCompleteCSS, generateInitialPositions, generateTasksContext, generateThemeVariables, getToken, kanban as kanbanTokens, lightTheme, lightTheme$1 as lightTokenTheme, lineHeight, neutralTheme, neutralTheme$1 as neutralTokenTheme, opacity, parseLocalCommand, parseNaturalDate, parseNaturalDuration, parseProgress, parseStatus, pluginManager, retrySyncOperation, retryWithBackoff, shadows, shouldVirtualizeGrid, spacing, themes, useAI, useBoard$1 as useBoard, useBoard as useBoardCore, useBoardStore, useCardStacking, useDragState, useFilteredCards, useFilters, useKanbanState, useKeyboardShortcuts, useMultiSelect, useSelectionState, useSortedCards, useTheme, useVirtualGrid, useVirtualList, validateAIResponse, withErrorBoundary, zIndex };
|