@lssm/module.ai-chat 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
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/ai-chat.feature.js +93 -1
- package/dist/context/context-builder.js +147 -2
- package/dist/context/file-operations.js +174 -1
- package/dist/context/index.js +5 -1
- package/dist/context/workspace-context.js +123 -2
- package/dist/core/chat-service.js +211 -2
- package/dist/core/conversation-store.js +108 -1
- package/dist/core/index.js +4 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +22 -1
- package/dist/libs/ai-providers/dist/factory.js +225 -0
- package/dist/libs/ai-providers/dist/index.js +4 -0
- package/dist/libs/ai-providers/dist/legacy.js +2 -0
- package/dist/libs/ai-providers/dist/models.js +299 -0
- package/dist/libs/ai-providers/dist/validation.js +60 -0
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
- package/dist/libs/design-system/dist/components/atoms/Textarea.js +35 -0
- package/dist/libs/design-system/dist/lib/keyboard.js +193 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/textarea.js +16 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
- package/dist/libs/ui-kit-web/dist/ui/avatar.js +25 -0
- package/dist/libs/ui-kit-web/dist/ui/badge.js +26 -0
- package/dist/libs/ui-kit-web/dist/ui/scroll-area.js +39 -0
- package/dist/libs/ui-kit-web/dist/ui/select.js +79 -0
- package/dist/libs/ui-kit-web/dist/ui/skeleton.js +14 -0
- package/dist/libs/ui-kit-web/dist/ui/tooltip.js +39 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
- package/dist/presentation/components/ChatContainer.js +62 -1
- package/dist/presentation/components/ChatInput.js +149 -1
- package/dist/presentation/components/ChatMessage.js +135 -1
- package/dist/presentation/components/CodePreview.js +126 -2
- package/dist/presentation/components/ContextIndicator.js +96 -1
- package/dist/presentation/components/ModelPicker.d.ts +1 -1
- package/dist/presentation/components/ModelPicker.js +197 -1
- package/dist/presentation/components/index.js +8 -1
- package/dist/presentation/hooks/index.js +4 -1
- package/dist/presentation/hooks/useChat.js +171 -1
- package/dist/presentation/hooks/useProviders.js +42 -1
- package/dist/presentation/index.d.ts +0 -1
- package/dist/presentation/index.js +12 -1
- package/dist/providers/chat-utilities.js +16 -1
- package/dist/providers/index.js +7 -1
- package/package.json +10 -10
|
@@ -1 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { getModelsForProvider } from "../../libs/ai-providers/dist/models.js";
|
|
4
|
+
import { getAvailableProviders } from "../../libs/ai-providers/dist/factory.js";
|
|
5
|
+
import "../../libs/ai-providers/dist/index.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/presentation/hooks/useProviders.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Hook for managing AI provider information
|
|
11
|
+
*/
|
|
12
|
+
function useProviders() {
|
|
13
|
+
const [providers, setProviders] = React.useState([]);
|
|
14
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
15
|
+
const loadProviders = React.useCallback(async () => {
|
|
16
|
+
setIsLoading(true);
|
|
17
|
+
try {
|
|
18
|
+
setProviders(getAvailableProviders().map((p) => ({
|
|
19
|
+
...p,
|
|
20
|
+
models: getModelsForProvider(p.provider)
|
|
21
|
+
})));
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error("Failed to load providers:", error);
|
|
24
|
+
} finally {
|
|
25
|
+
setIsLoading(false);
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
loadProviders();
|
|
30
|
+
}, [loadProviders]);
|
|
31
|
+
return {
|
|
32
|
+
providers,
|
|
33
|
+
availableProviders: React.useMemo(() => providers.filter((p) => p.available), [providers]),
|
|
34
|
+
isAvailable: React.useCallback((provider) => providers.some((p) => p.provider === provider && p.available), [providers]),
|
|
35
|
+
getModels: React.useCallback((provider) => providers.find((p) => p.provider === provider)?.models ?? [], [providers]),
|
|
36
|
+
isLoading,
|
|
37
|
+
refresh: loadProviders
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { useProviders };
|
|
@@ -7,5 +7,4 @@ import { CodePreview } from "./components/CodePreview.js";
|
|
|
7
7
|
import "./components/index.js";
|
|
8
8
|
import { UseChatOptions, UseChatReturn, useChat } from "./hooks/useChat.js";
|
|
9
9
|
import { UseProvidersReturn, useProviders } from "./hooks/useProviders.js";
|
|
10
|
-
import "./hooks/index.js";
|
|
11
10
|
export { ChatContainer, ChatInput, ChatMessage, CodePreview, ContextIndicator, ModelPicker, UseChatOptions, UseChatReturn, UseProvidersReturn, useChat, useProviders };
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { ChatContainer } from "./components/ChatContainer.js";
|
|
2
|
+
import { CodePreview } from "./components/CodePreview.js";
|
|
3
|
+
import { ChatMessage } from "./components/ChatMessage.js";
|
|
4
|
+
import { ChatInput } from "./components/ChatInput.js";
|
|
5
|
+
import { ModelPicker } from "./components/ModelPicker.js";
|
|
6
|
+
import { ContextIndicator } from "./components/ContextIndicator.js";
|
|
7
|
+
import "./components/index.js";
|
|
8
|
+
import { useChat } from "./hooks/useChat.js";
|
|
9
|
+
import { useProviders } from "./hooks/useProviders.js";
|
|
10
|
+
import "./hooks/index.js";
|
|
11
|
+
|
|
12
|
+
export { ChatContainer, ChatInput, ChatMessage, CodePreview, ContextIndicator, ModelPicker, useChat, useProviders };
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/providers/chat-utilities.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if a provider supports local mode
|
|
4
|
+
*/
|
|
5
|
+
function supportsLocalMode(provider) {
|
|
6
|
+
return provider === "ollama";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check if a provider is available in Studio (cloud only)
|
|
10
|
+
*/
|
|
11
|
+
function isStudioAvailable(provider) {
|
|
12
|
+
return provider !== "ollama";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isStudioAvailable, supportsLocalMode };
|
package/dist/providers/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { DEFAULT_MODELS, MODELS, getDefaultModel, getModelInfo, getModelsForProvider, getRecommendedModels } from "../libs/ai-providers/dist/models.js";
|
|
2
|
+
import { createProvider, createProviderFromEnv, getAvailableProviders } from "../libs/ai-providers/dist/factory.js";
|
|
3
|
+
import { getEnvVarName, hasCredentials, isOllamaRunning, listOllamaModels, validateProvider } from "../libs/ai-providers/dist/validation.js";
|
|
4
|
+
import "../libs/ai-providers/dist/index.js";
|
|
5
|
+
import { isStudioAvailable, supportsLocalMode } from "./chat-utilities.js";
|
|
6
|
+
|
|
7
|
+
export { DEFAULT_MODELS, MODELS, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, isStudioAvailable, listOllamaModels, supportsLocalMode, validateProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/module.ai-chat",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217072406",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"test": "bun test"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@lssm/lib.ai-agent": "0.0.0-canary-
|
|
27
|
-
"@lssm/lib.ai-providers": "0.0.0-canary-
|
|
28
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
29
|
-
"@lssm/lib.metering": "0.0.0-canary-
|
|
30
|
-
"@lssm/lib.cost-tracking": "0.0.0-canary-
|
|
31
|
-
"@lssm/lib.design-system": "0.0.0-canary-
|
|
32
|
-
"@lssm/lib.ui-kit-web": "0.0.0-canary-
|
|
26
|
+
"@lssm/lib.ai-agent": "0.0.0-canary-20251217072406",
|
|
27
|
+
"@lssm/lib.ai-providers": "0.0.0-canary-20251217072406",
|
|
28
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217072406",
|
|
29
|
+
"@lssm/lib.metering": "0.0.0-canary-20251217072406",
|
|
30
|
+
"@lssm/lib.cost-tracking": "0.0.0-canary-20251217072406",
|
|
31
|
+
"@lssm/lib.design-system": "0.0.0-canary-20251217072406",
|
|
32
|
+
"@lssm/lib.ui-kit-web": "0.0.0-canary-20251217072406",
|
|
33
33
|
"@ai-sdk/react": "beta",
|
|
34
34
|
"ai": "beta",
|
|
35
35
|
"lucide-react": "^0.535.0",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"zod": "^4.1.13"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
41
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
40
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217072406",
|
|
41
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217072406",
|
|
42
42
|
"@types/react": "^19.0.14",
|
|
43
43
|
"tsdown": "^0.17.4",
|
|
44
44
|
"typescript": "^5.9.3"
|