@alia.onl/sdk 4.0.1 → 4.1.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/CHANGELOG.md +48 -0
- package/package.json +5 -4
- package/src/components/AliaChatContent.tsx +1 -1
- package/src/components/AliaChatMessageList.tsx +7 -9
- package/src/components/PlanPreviewCard.tsx +3 -1
- package/src/components/ResearchProgressCard.tsx +9 -11
- package/src/components/ThinkingIndicator.tsx +2 -2
- package/src/components/ui/dropdown-menu.web.tsx +36 -9
- package/src/components/ui/prompt-input/add-menu.tsx +1 -1
- package/src/components/ui/prompt-input/attachments.tsx +8 -10
- package/src/components/ui/prompt-input/mic-button.tsx +2 -1
- package/src/components/ui/prompt-input/prompt-input.tsx +2 -1
- package/src/components/ui/prompt-input/submit-button.tsx +2 -1
- package/src/components/voice/VoiceControls.tsx +4 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @alia.onl/sdk
|
|
2
|
+
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Every `lucide-react-native` import is now a per-icon subpath
|
|
8
|
+
(`lucide-react-native/icons/<name>`) instead of the package barrel, and the
|
|
9
|
+
dependency moved from `^0.562.0` to `^1.24.0` (the first line that exposes
|
|
10
|
+
`./icons/*` in its `exports` map, with per-icon type declarations).
|
|
11
|
+
|
|
12
|
+
The barrel statically re-exports ~1750 icon modules and Metro does not
|
|
13
|
+
tree-shake, so a single named import pulled roughly 1.2 MB of unused icon
|
|
14
|
+
source into every consumer bundle. Measured with a real Metro build of the
|
|
15
|
+
same eight icons: 1755 modules / 1 656 869 bytes via the barrel versus
|
|
16
|
+
16 modules / 18 312 bytes via subpaths.
|
|
17
|
+
|
|
18
|
+
- **Consumers must enable Metro's package-exports resolution.** Set
|
|
19
|
+
`resolver.unstable_enablePackageExports = true` in `metro.config.js`. It is
|
|
20
|
+
the default in Expo SDK 53+ and Metro 0.82+, so most projects already have
|
|
21
|
+
it. Without it the bundle fails at build time with
|
|
22
|
+
`Unable to resolve module lucide-react-native/icons/…` — a loud failure, not
|
|
23
|
+
a silent runtime one.
|
|
24
|
+
|
|
25
|
+
The public API is unchanged: no icon is re-exported from `.` or `./voice`, and
|
|
26
|
+
no exported component, hook, or type was added, removed, or renamed.
|
|
27
|
+
|
|
28
|
+
## 4.0.1
|
|
29
|
+
|
|
30
|
+
- Expose `./package.json` in the `exports` map.
|
|
31
|
+
|
|
32
|
+
## 4.0.0
|
|
33
|
+
|
|
34
|
+
### Breaking
|
|
35
|
+
|
|
36
|
+
- The voice surface moved from the root entry to `@alia.onl/sdk/voice` so
|
|
37
|
+
text-chat consumers no longer pull `livekit-client` through the export
|
|
38
|
+
barrel. Update imports of `AudioWaveVisualizer`, `VoiceOverlay`,
|
|
39
|
+
`VoiceControls`, `useVoiceRoom`, `useAudioLevelMonitor`, `useAudioLevels`,
|
|
40
|
+
`useAmbientWave`, `useSoundEffects`, `useVoiceSoundEffects`, and the
|
|
41
|
+
`RoomState` / `AgentState` / `VoiceMessage` / `VoiceToolInvocation` types.
|
|
42
|
+
|
|
43
|
+
Note that rendering `AliaChatScreen` or `AliaChatSheet` still reaches
|
|
44
|
+
`livekit-client`: `AliaChatContent` imports `useVoiceRoom` and
|
|
45
|
+
`useAudioLevelMonitor` directly. Only consumers composing the leaf
|
|
46
|
+
primitives themselves avoid it.
|
|
47
|
+
- An `exports` map was introduced, so deep imports into package internals no
|
|
48
|
+
longer resolve. Only `.`, `./voice`, and `./package.json` are public.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alia.onl/sdk",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Alia AI chat SDK — reusable chat UI, voice, and streaming components for Oxy apps",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"src",
|
|
16
|
-
"tsconfig.json"
|
|
16
|
+
"tsconfig.json",
|
|
17
|
+
"CHANGELOG.md"
|
|
17
18
|
],
|
|
18
19
|
"private": false,
|
|
19
20
|
"publishConfig": {
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"@tanstack/react-query-persist-client": "^5.101.2",
|
|
28
29
|
"class-variance-authority": "^0.7.1",
|
|
29
30
|
"clsx": "^2.1.1",
|
|
30
|
-
"lucide-react-native": "^
|
|
31
|
+
"lucide-react-native": "^1.24.0",
|
|
31
32
|
"react-native-markdown-display": "^7.0.2",
|
|
32
33
|
"tailwind-merge": "^3.6.0",
|
|
33
34
|
"zeego": "^3.0.6",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"react": "^19.2.3",
|
|
38
39
|
"react-native": "^0.86.0",
|
|
39
|
-
"@oxyhq/services": "^
|
|
40
|
+
"@oxyhq/services": "^22.12.3",
|
|
40
41
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
41
42
|
"socket.io-client": "^4.8.3",
|
|
42
43
|
"expo-font": "^57.0.0",
|
|
@@ -16,7 +16,7 @@ import React, {
|
|
|
16
16
|
import { View, StyleSheet } from 'react-native';
|
|
17
17
|
import { useSharedValue } from 'react-native-reanimated';
|
|
18
18
|
import type { SharedValue } from 'react-native-reanimated';
|
|
19
|
-
import
|
|
19
|
+
import Volume2 from 'lucide-react-native/icons/volume-2';
|
|
20
20
|
import { useAliaChat, type UseAliaChatOptions } from '../hooks/useAliaChat';
|
|
21
21
|
import { useVoiceRoom } from '../hooks/useVoiceRoom';
|
|
22
22
|
import { useAudioLevelMonitor } from '../hooks/useAudioLevelMonitor';
|
|
@@ -11,15 +11,13 @@ import Animated, {
|
|
|
11
11
|
cancelAnimation,
|
|
12
12
|
type SharedValue,
|
|
13
13
|
} from 'react-native-reanimated';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Pencil,
|
|
22
|
-
} from 'lucide-react-native';
|
|
14
|
+
import Copy from 'lucide-react-native/icons/copy';
|
|
15
|
+
import Check from 'lucide-react-native/icons/check';
|
|
16
|
+
import Volume2 from 'lucide-react-native/icons/volume-2';
|
|
17
|
+
import Square from 'lucide-react-native/icons/square';
|
|
18
|
+
import ThumbsUp from 'lucide-react-native/icons/thumbs-up';
|
|
19
|
+
import ThumbsDown from 'lucide-react-native/icons/thumbs-down';
|
|
20
|
+
import Pencil from 'lucide-react-native/icons/pencil';
|
|
23
21
|
import { Text } from './ui/text';
|
|
24
22
|
import { AliaMarkdown } from './Markdown';
|
|
25
23
|
import { ThinkingIndicator } from './ThinkingIndicator';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { View, Pressable } from 'react-native';
|
|
2
2
|
import { Text } from './ui/text';
|
|
3
3
|
import { Button } from './ui/button';
|
|
4
|
-
import
|
|
4
|
+
import Check from 'lucide-react-native/icons/check';
|
|
5
|
+
import X from 'lucide-react-native/icons/x';
|
|
6
|
+
import ListChecks from 'lucide-react-native/icons/list-checks';
|
|
5
7
|
import Animated from 'react-native-reanimated';
|
|
6
8
|
import { planPreviewEnter } from '../animations';
|
|
7
9
|
import type { PlanStep } from '../types';
|
|
@@ -2,15 +2,13 @@ import { useState } from 'react';
|
|
|
2
2
|
import { View, Pressable } from 'react-native';
|
|
3
3
|
import { Text } from './ui/text';
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Loader2,
|
|
13
|
-
} from 'lucide-react-native';
|
|
5
|
+
import Search from 'lucide-react-native/icons/search';
|
|
6
|
+
import BookOpen from 'lucide-react-native/icons/book-open';
|
|
7
|
+
import CircleCheckBig from 'lucide-react-native/icons/circle-check-big';
|
|
8
|
+
import ChevronDown from 'lucide-react-native/icons/chevron-down';
|
|
9
|
+
import ChevronUp from 'lucide-react-native/icons/chevron-up';
|
|
10
|
+
import ExternalLink from 'lucide-react-native/icons/external-link';
|
|
11
|
+
import LoaderCircle from 'lucide-react-native/icons/loader-circle';
|
|
14
12
|
import type { ResearchProgress } from '../types';
|
|
15
13
|
|
|
16
14
|
interface ResearchProgressCardProps {
|
|
@@ -42,7 +40,7 @@ export function ResearchProgressCard({ progress }: ResearchProgressCardProps) {
|
|
|
42
40
|
<View className="flex-row items-center gap-2">
|
|
43
41
|
<View className="w-8 h-8 rounded-full bg-primary/10 items-center justify-center">
|
|
44
42
|
{isComplete ? (
|
|
45
|
-
<
|
|
43
|
+
<CircleCheckBig size={16} className="text-green-500" />
|
|
46
44
|
) : (
|
|
47
45
|
<Search size={16} className="text-primary" />
|
|
48
46
|
)}
|
|
@@ -111,7 +109,7 @@ export function ResearchProgressCard({ progress }: ResearchProgressCardProps) {
|
|
|
111
109
|
{/* Current search query indicator */}
|
|
112
110
|
{progress.currentQuery && !isComplete && (
|
|
113
111
|
<View className="flex-row items-center gap-2 bg-muted/50 rounded-lg px-3 py-1.5">
|
|
114
|
-
<
|
|
112
|
+
<LoaderCircle size={12} className="text-muted-foreground" />
|
|
115
113
|
<Text className="text-xs text-muted-foreground flex-1" numberOfLines={1}>
|
|
116
114
|
{progress.currentQuery}
|
|
117
115
|
</Text>
|
|
@@ -30,7 +30,7 @@ const workingPhrases = [
|
|
|
30
30
|
"Doing the thing...",
|
|
31
31
|
];
|
|
32
32
|
|
|
33
|
-
export function ThinkingIndicator({ isWorking = false, statusText }: { isWorking?: boolean; statusText?: string }) {
|
|
33
|
+
export function ThinkingIndicator({ isWorking = false, statusText, color }: { isWorking?: boolean; statusText?: string; color?: string }) {
|
|
34
34
|
const phrases = isWorking ? workingPhrases : thinkingPhrases;
|
|
35
35
|
const [phraseIndex, setPhraseIndex] = useState(() =>
|
|
36
36
|
Math.floor(Math.random() * phrases.length)
|
|
@@ -84,7 +84,7 @@ export function ThinkingIndicator({ isWorking = false, statusText }: { isWorking
|
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<View className="flex-row items-center gap-2 py-2">
|
|
87
|
-
<AliaMark size={16} state={isWorking ? 'working' : 'thinking'}
|
|
87
|
+
<AliaMark size={16} state={isWorking ? 'working' : 'thinking'} color={color} />
|
|
88
88
|
<View className="flex-row items-center">
|
|
89
89
|
<Text className="text-base text-muted-foreground">{shownText}</Text>
|
|
90
90
|
{(statusText || isTyping) && (
|
|
@@ -5,27 +5,54 @@ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
|
5
5
|
import { CheckIcon, ChevronRightIcon } from "@radix-ui/react-icons";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import type { LucideIcon } from "lucide-react-native";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
// Per-icon subpaths, never the `lucide-react-native` barrel: the barrel
|
|
9
|
+
// statically re-exports all ~1500 icons, and Metro has no tree shaking, so a
|
|
10
|
+
// single named import pulls ~1.3 MB of unused icon modules into every consumer
|
|
11
|
+
// bundle.
|
|
12
|
+
import Star from "lucide-react-native/icons/star";
|
|
13
|
+
import Pencil from "lucide-react-native/icons/pencil";
|
|
14
|
+
import Trash2 from "lucide-react-native/icons/trash-2";
|
|
15
|
+
import Share2 from "lucide-react-native/icons/share-2";
|
|
16
|
+
import Download from "lucide-react-native/icons/download";
|
|
17
|
+
import Settings from "lucide-react-native/icons/settings";
|
|
18
|
+
import CircleQuestionMark from "lucide-react-native/icons/circle-question-mark";
|
|
19
|
+
import Image from "lucide-react-native/icons/image";
|
|
20
|
+
import FileText from "lucide-react-native/icons/file-text";
|
|
21
|
+
import Search from "lucide-react-native/icons/search";
|
|
22
|
+
import ShoppingBag from "lucide-react-native/icons/shopping-bag";
|
|
23
|
+
import Ellipsis from "lucide-react-native/icons/ellipsis";
|
|
24
|
+
import ExternalLink from "lucide-react-native/icons/external-link";
|
|
25
|
+
import BookOpen from "lucide-react-native/icons/book-open";
|
|
26
|
+
import Globe from "lucide-react-native/icons/globe";
|
|
27
|
+
import PenTool from "lucide-react-native/icons/pen-tool";
|
|
28
|
+
import Sparkles from "lucide-react-native/icons/sparkles";
|
|
29
|
+
import User from "lucide-react-native/icons/user";
|
|
30
|
+
import CreditCard from "lucide-react-native/icons/credit-card";
|
|
31
|
+
import Bell from "lucide-react-native/icons/bell";
|
|
32
|
+
import LogOut from "lucide-react-native/icons/log-out";
|
|
33
|
+
import Folder from "lucide-react-native/icons/folder";
|
|
34
|
+
import Check from "lucide-react-native/icons/check";
|
|
35
|
+
import Brain from "lucide-react-native/icons/brain";
|
|
36
|
+
import Ghost from "lucide-react-native/icons/ghost";
|
|
37
|
+
import Bot from "lucide-react-native/icons/bot";
|
|
38
|
+
import Bookmark from "lucide-react-native/icons/bookmark";
|
|
39
|
+
import TriangleAlert from "lucide-react-native/icons/triangle-alert";
|
|
40
|
+
import Pin from "lucide-react-native/icons/pin";
|
|
14
41
|
|
|
15
42
|
// Map iOS SF Symbol names to Lucide icons for web rendering
|
|
16
43
|
const SF_SYMBOL_MAP: Record<string, LucideIcon> = {
|
|
17
44
|
"star": Star, "star.fill": Star, "pencil": Pencil, "trash": Trash2,
|
|
18
45
|
"square.and.arrow.up": Share2, "arrow.down.doc": Download,
|
|
19
|
-
"gearshape": Settings, "questionmark.circle":
|
|
46
|
+
"gearshape": Settings, "questionmark.circle": CircleQuestionMark,
|
|
20
47
|
"photo": Image, "doc": FileText, "magnifyingglass": Search,
|
|
21
|
-
"bag": ShoppingBag, "ellipsis":
|
|
48
|
+
"bag": ShoppingBag, "ellipsis": Ellipsis, "link": ExternalLink,
|
|
22
49
|
"book": BookOpen, "globe": Globe, "pencil.tip": PenTool,
|
|
23
50
|
"sparkle": Sparkles, "person.circle": User, "creditcard": CreditCard,
|
|
24
51
|
"bell": Bell, "rectangle.portrait.and.arrow.right": LogOut,
|
|
25
52
|
"folder": Folder, "checkmark": Check, "brain": Brain,
|
|
26
53
|
"eye.slash": Ghost, "cpu": Bot,
|
|
27
54
|
"bookmark": Bookmark, "bookmark.fill": Bookmark,
|
|
28
|
-
"exclamationmark.triangle":
|
|
55
|
+
"exclamationmark.triangle": TriangleAlert,
|
|
29
56
|
"pin": Pin, "pin.fill": Pin,
|
|
30
57
|
};
|
|
31
58
|
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, Pressable, ScrollView, ActivityIndicator } from "react-native";
|
|
3
3
|
import { Image } from "expo-image";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
X,
|
|
12
|
-
} from "lucide-react-native";
|
|
4
|
+
import FileText from "lucide-react-native/icons/file-text";
|
|
5
|
+
import FileSpreadsheet from "lucide-react-native/icons/file-spreadsheet";
|
|
6
|
+
import FileCode from "lucide-react-native/icons/file-code";
|
|
7
|
+
import FileArchive from "lucide-react-native/icons/file-archive";
|
|
8
|
+
import FileHeadphone from "lucide-react-native/icons/file-headphone";
|
|
9
|
+
import File from "lucide-react-native/icons/file";
|
|
10
|
+
import X from "lucide-react-native/icons/x";
|
|
13
11
|
import { Text } from "../text";
|
|
14
12
|
import { formatFileSize } from "../../../lib/utils";
|
|
15
13
|
import { usePromptInput, type Attachment } from "./context";
|
|
@@ -48,7 +46,7 @@ function getDocumentIcon(mimeType: string, name: string) {
|
|
|
48
46
|
mimeType.startsWith("audio/") ||
|
|
49
47
|
["mp3", "wav", "ogg", "flac", "aac"].includes(ext)
|
|
50
48
|
)
|
|
51
|
-
return { Icon:
|
|
49
|
+
return { Icon: FileHeadphone, color: "#EC4899", bgColor: "#EC489918" };
|
|
52
50
|
if (
|
|
53
51
|
mimeType === "text/plain" ||
|
|
54
52
|
["txt", "md", "rtf"].includes(ext)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { Pressable, ActivityIndicator } from "react-native";
|
|
3
|
-
import
|
|
3
|
+
import Mic from "lucide-react-native/icons/mic";
|
|
4
|
+
import MicOff from "lucide-react-native/icons/mic-off";
|
|
4
5
|
import { cn } from "../../../lib/utils";
|
|
5
6
|
import { useSpeechToText } from "../../../hooks/useSpeechToText";
|
|
6
7
|
import { usePromptInput } from "./context";
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
type ViewStyle,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
import { KeyboardAvoidingView } from "../../../lib/keyboard";
|
|
9
|
-
import
|
|
9
|
+
import Maximize2 from "lucide-react-native/icons/maximize-2";
|
|
10
|
+
import Minimize2 from "lucide-react-native/icons/minimize-2";
|
|
10
11
|
import { cn } from "../../../lib/utils";
|
|
11
12
|
import { PromptInputContext, type Attachment, type Completion } from "./context";
|
|
12
13
|
import { PromptInputTextarea } from "./textarea";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import ArrowUp from "lucide-react-native/icons/arrow-up";
|
|
3
|
+
import Square from "lucide-react-native/icons/square";
|
|
3
4
|
import { cn } from "../../../lib/utils";
|
|
4
5
|
import { Button } from "../button";
|
|
5
6
|
import { usePromptInput } from "./context";
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { View, Text, Pressable, ActivityIndicator, StyleSheet } from 'react-native';
|
|
7
|
-
import
|
|
7
|
+
import Mic from 'lucide-react-native/icons/mic';
|
|
8
|
+
import MicOff from 'lucide-react-native/icons/mic-off';
|
|
9
|
+
import PhoneOff from 'lucide-react-native/icons/phone-off';
|
|
10
|
+
import Users from 'lucide-react-native/icons/users';
|
|
8
11
|
import type { RoomState, AgentState } from '../../types';
|
|
9
12
|
|
|
10
13
|
interface VoiceControlsProps {
|