@4djs/assistant 0.0.0 → 0.0.1
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/core/chat-activity.d.ts +19 -0
- package/dist/core/chat-activity.d.ts.map +1 -0
- package/dist/core/chat-commands.d.ts +33 -0
- package/dist/core/chat-commands.d.ts.map +1 -0
- package/dist/core/chat-history.d.ts +14 -0
- package/dist/core/chat-history.d.ts.map +1 -0
- package/dist/core/chat-reply-suggestions-parse.d.ts +20 -0
- package/dist/core/chat-reply-suggestions-parse.d.ts.map +1 -0
- package/dist/core/code-highlight.d.ts +3 -0
- package/dist/core/code-highlight.d.ts.map +1 -0
- package/dist/core/create-assistant-store.d.ts +33 -0
- package/dist/core/create-assistant-store.d.ts.map +1 -0
- package/dist/core/fetch-suggested-prompts.d.ts +11 -0
- package/dist/core/fetch-suggested-prompts.d.ts.map +1 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2876 -0
- package/dist/core/interactive-tools/choices.d.ts +22 -0
- package/dist/core/interactive-tools/choices.d.ts.map +1 -0
- package/dist/core/interactive-tools/confirmation.d.ts +15 -0
- package/dist/core/interactive-tools/confirmation.d.ts.map +1 -0
- package/dist/core/interactive-tools/constants.d.ts +6 -0
- package/dist/core/interactive-tools/constants.d.ts.map +1 -0
- package/dist/core/interactive-tools/execute.d.ts +11 -0
- package/dist/core/interactive-tools/execute.d.ts.map +1 -0
- package/dist/core/interactive-tools/index.d.ts +7 -0
- package/dist/core/interactive-tools/index.d.ts.map +1 -0
- package/dist/core/interactive-tools/suggestions.d.ts +13 -0
- package/dist/core/interactive-tools/suggestions.d.ts.map +1 -0
- package/dist/core/interactive-tools/waiters.d.ts +4 -0
- package/dist/core/interactive-tools/waiters.d.ts.map +1 -0
- package/dist/core/llm-chat.d.ts +96 -0
- package/dist/core/llm-chat.d.ts.map +1 -0
- package/dist/core/llm-config.d.ts +24 -0
- package/dist/core/llm-config.d.ts.map +1 -0
- package/dist/core/llm-models.d.ts +14 -0
- package/dist/core/llm-models.d.ts.map +1 -0
- package/dist/core/llm-provider.d.ts +13 -0
- package/dist/core/llm-provider.d.ts.map +1 -0
- package/dist/core/llm-settings-storage.d.ts +47 -0
- package/dist/core/llm-settings-storage.d.ts.map +1 -0
- package/dist/core/llm-sse.d.ts +13 -0
- package/dist/core/llm-sse.d.ts.map +1 -0
- package/dist/core/llm-types.d.ts +49 -0
- package/dist/core/llm-types.d.ts.map +1 -0
- package/dist/core/markdown-utils.d.ts +3 -0
- package/dist/core/markdown-utils.d.ts.map +1 -0
- package/dist/core/prepare-markdown.d.ts +7 -0
- package/dist/core/prepare-markdown.d.ts.map +1 -0
- package/dist/core/types.d.ts +74 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.css +1195 -0
- package/dist/index.js +184948 -0
- package/dist/react/Assistant.d.ts +10 -0
- package/dist/react/Assistant.d.ts.map +1 -0
- package/dist/react/components/HighlightedJsonCode.d.ts +6 -0
- package/dist/react/components/HighlightedJsonCode.d.ts.map +1 -0
- package/dist/react/components/MarkdownContent.d.ts +10 -0
- package/dist/react/components/MarkdownContent.d.ts.map +1 -0
- package/dist/react/components/MarkdownEditor.d.ts +11 -0
- package/dist/react/components/MarkdownEditor.d.ts.map +1 -0
- package/dist/react/components/MermaidDiagram.d.ts +8 -0
- package/dist/react/components/MermaidDiagram.d.ts.map +1 -0
- package/dist/react/components/ModelSelector.d.ts +8 -0
- package/dist/react/components/ModelSelector.d.ts.map +1 -0
- package/dist/react/components/chat/AssistantErrorCallout.d.ts +11 -0
- package/dist/react/components/chat/AssistantErrorCallout.d.ts.map +1 -0
- package/dist/react/components/chat/ChatActivity.d.ts +8 -0
- package/dist/react/components/chat/ChatActivity.d.ts.map +1 -0
- package/dist/react/components/chat/ChatComposer.d.ts +36 -0
- package/dist/react/components/chat/ChatComposer.d.ts.map +1 -0
- package/dist/react/components/chat/ChatEmptyState.d.ts +10 -0
- package/dist/react/components/chat/ChatEmptyState.d.ts.map +1 -0
- package/dist/react/components/chat/ChatInteractivePrompt/choices-prompt.d.ts +7 -0
- package/dist/react/components/chat/ChatInteractivePrompt/choices-prompt.d.ts.map +1 -0
- package/dist/react/components/chat/ChatInteractivePrompt/confirmation-prompt.d.ts +7 -0
- package/dist/react/components/chat/ChatInteractivePrompt/confirmation-prompt.d.ts.map +1 -0
- package/dist/react/components/chat/ChatInteractivePrompt/index.d.ts +7 -0
- package/dist/react/components/chat/ChatInteractivePrompt/index.d.ts.map +1 -0
- package/dist/react/components/chat/ChatInteractivePrompt/shell.d.ts +13 -0
- package/dist/react/components/chat/ChatInteractivePrompt/shell.d.ts.map +1 -0
- package/dist/react/components/chat/ChatInteractivePrompt/utils.d.ts +4 -0
- package/dist/react/components/chat/ChatInteractivePrompt/utils.d.ts.map +1 -0
- package/dist/react/components/chat/ChatMessage.d.ts +11 -0
- package/dist/react/components/chat/ChatMessage.d.ts.map +1 -0
- package/dist/react/components/chat/ChatMessageScroll.d.ts +8 -0
- package/dist/react/components/chat/ChatMessageScroll.d.ts.map +1 -0
- package/dist/react/components/chat/ChatReplySuggestions.d.ts +9 -0
- package/dist/react/components/chat/ChatReplySuggestions.d.ts.map +1 -0
- package/dist/react/components/chat/ComposerCommandMenu.d.ts +10 -0
- package/dist/react/components/chat/ComposerCommandMenu.d.ts.map +1 -0
- package/dist/react/components/chat/LlmSettingsStrip.d.ts +7 -0
- package/dist/react/components/chat/LlmSettingsStrip.d.ts.map +1 -0
- package/dist/react/components/chat/LlmSetupPrompt.d.ts +7 -0
- package/dist/react/components/chat/LlmSetupPrompt.d.ts.map +1 -0
- package/dist/react/components/chat/LlmUnavailableBanner.d.ts +6 -0
- package/dist/react/components/chat/LlmUnavailableBanner.d.ts.map +1 -0
- package/dist/react/components/chat/SuggestedPromptsList.d.ts +14 -0
- package/dist/react/components/chat/SuggestedPromptsList.d.ts.map +1 -0
- package/dist/react/components/chat/SuggestedPromptsStrip.d.ts +11 -0
- package/dist/react/components/chat/SuggestedPromptsStrip.d.ts.map +1 -0
- package/dist/react/components/chat/SystemPromptField.d.ts +10 -0
- package/dist/react/components/chat/SystemPromptField.d.ts.map +1 -0
- package/dist/react/components/highlighted-code.d.ts +8 -0
- package/dist/react/components/highlighted-code.d.ts.map +1 -0
- package/dist/react/context.d.ts +11 -0
- package/dist/react/context.d.ts.map +1 -0
- package/dist/react/hooks/use-composer-commands.d.ts +21 -0
- package/dist/react/hooks/use-composer-commands.d.ts.map +1 -0
- package/dist/react/hooks/use-suggested-prompts.d.ts +29 -0
- package/dist/react/hooks/use-suggested-prompts.d.ts.map +1 -0
- package/dist/react/index.d.ts +17 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/lib/parse-assistant-error.d.ts +9 -0
- package/dist/react/lib/parse-assistant-error.d.ts.map +1 -0
- package/dist/react/lib/prompt-icons.d.ts +5 -0
- package/dist/react/lib/prompt-icons.d.ts.map +1 -0
- package/dist/react/types.d.ts +69 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/utils/cn.d.ts +2 -0
- package/dist/react/utils/cn.d.ts.map +1 -0
- package/package.json +16 -5
- package/src/core/chat-activity.ts +0 -107
- package/src/core/chat-commands.ts +0 -173
- package/src/core/chat-history.ts +0 -113
- package/src/core/chat-reply-suggestions-parse.ts +0 -119
- package/src/core/code-highlight.ts +0 -20
- package/src/core/create-assistant-store.ts +0 -639
- package/src/core/fetch-suggested-prompts.ts +0 -53
- package/src/core/index.ts +0 -125
- package/src/core/interactive-tools/choices.ts +0 -155
- package/src/core/interactive-tools/confirmation.ts +0 -63
- package/src/core/interactive-tools/constants.ts +0 -22
- package/src/core/interactive-tools/execute.ts +0 -70
- package/src/core/interactive-tools/index.ts +0 -41
- package/src/core/interactive-tools/suggestions.ts +0 -87
- package/src/core/interactive-tools/waiters.ts +0 -55
- package/src/core/llm-chat.ts +0 -686
- package/src/core/llm-config.ts +0 -101
- package/src/core/llm-models.ts +0 -96
- package/src/core/llm-provider.ts +0 -99
- package/src/core/llm-settings-storage.ts +0 -331
- package/src/core/llm-sse.ts +0 -166
- package/src/core/llm-types.ts +0 -52
- package/src/core/markdown-utils.ts +0 -11
- package/src/core/prepare-markdown.ts +0 -38
- package/src/core/types.ts +0 -86
- package/src/css.d.ts +0 -1
- package/src/react/Assistant.tsx +0 -358
- package/src/react/components/HighlightedJsonCode.tsx +0 -24
- package/src/react/components/MarkdownContent.tsx +0 -98
- package/src/react/components/MarkdownEditor.tsx +0 -60
- package/src/react/components/MermaidDiagram.tsx +0 -139
- package/src/react/components/ModelSelector.tsx +0 -243
- package/src/react/components/chat/AssistantErrorCallout.tsx +0 -79
- package/src/react/components/chat/ChatActivity.tsx +0 -274
- package/src/react/components/chat/ChatComposer.tsx +0 -189
- package/src/react/components/chat/ChatEmptyState.tsx +0 -145
- package/src/react/components/chat/ChatInteractivePrompt/choices-prompt.tsx +0 -262
- package/src/react/components/chat/ChatInteractivePrompt/confirmation-prompt.tsx +0 -97
- package/src/react/components/chat/ChatInteractivePrompt/index.tsx +0 -60
- package/src/react/components/chat/ChatInteractivePrompt/shell.tsx +0 -60
- package/src/react/components/chat/ChatInteractivePrompt/utils.ts +0 -14
- package/src/react/components/chat/ChatMessage.tsx +0 -150
- package/src/react/components/chat/ChatMessageScroll.tsx +0 -116
- package/src/react/components/chat/ChatReplySuggestions.tsx +0 -231
- package/src/react/components/chat/ComposerCommandMenu.tsx +0 -69
- package/src/react/components/chat/LlmSettingsStrip.tsx +0 -348
- package/src/react/components/chat/LlmSetupPrompt.tsx +0 -58
- package/src/react/components/chat/LlmUnavailableBanner.tsx +0 -11
- package/src/react/components/chat/SuggestedPromptsList.tsx +0 -121
- package/src/react/components/chat/SuggestedPromptsStrip.tsx +0 -72
- package/src/react/components/chat/SystemPromptField.tsx +0 -107
- package/src/react/components/highlighted-code.tsx +0 -107
- package/src/react/context.tsx +0 -72
- package/src/react/hooks/use-composer-commands.ts +0 -129
- package/src/react/hooks/use-suggested-prompts.ts +0 -128
- package/src/react/index.ts +0 -39
- package/src/react/lib/parse-assistant-error.ts +0 -96
- package/src/react/lib/prompt-icons.ts +0 -40
- package/src/react/types.ts +0 -83
- package/src/react/utils/cn.ts +0 -5
- package/test/buildLlmHistory.test.ts +0 -95
- package/test/llm-config.test.ts +0 -72
- package/test/llmSettingsStorage.test.ts +0 -121
- package/test/parse-assistant-error.test.ts +0 -24
- package/tsconfig.json +0 -8
- /package/{src/styles/assistant.css → dist/styles.css} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ChatActivityStatus = "active" | "done" | "error";
|
|
2
|
+
export interface ChatActivityStep {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: "tool";
|
|
5
|
+
name: string;
|
|
6
|
+
args: Record<string, unknown>;
|
|
7
|
+
callId?: string;
|
|
8
|
+
status: ChatActivityStatus;
|
|
9
|
+
result?: unknown;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function summarizeActivityResult(result: unknown): unknown;
|
|
13
|
+
export declare function chatActivityStepLabel(step: ChatActivityStep): string;
|
|
14
|
+
export declare function formatJsonIfLarge(raw: string): string;
|
|
15
|
+
export declare function formatActivityJson(raw?: string): string | null;
|
|
16
|
+
export declare function formatActivityJsonValue(value: unknown): string | null;
|
|
17
|
+
export declare function isEmptyActivityJson(value: unknown): boolean;
|
|
18
|
+
export declare function stepHasDetails(step: ChatActivityStep): boolean;
|
|
19
|
+
//# sourceMappingURL=chat-activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-activity.d.ts","sourceRoot":"","sources":["../../src/core/chat-activity.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAYhE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAapE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAarD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ9D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuB3D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAI9D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type ChatCommandSurface = "assistant";
|
|
2
|
+
export type ChatCommandRunResult = {
|
|
3
|
+
handled: boolean;
|
|
4
|
+
clearInput?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
};
|
|
7
|
+
export type AssistantCommandDeps = {
|
|
8
|
+
clearMessages: () => void;
|
|
9
|
+
setError: (error: string | null) => void;
|
|
10
|
+
streaming: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type ChatCommandSuggestion = {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
usage: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function getChatCommandSuggestions(surface: ChatCommandSurface): ChatCommandSuggestion[];
|
|
18
|
+
export declare function isChatCommandInput(value: string): boolean;
|
|
19
|
+
export declare function filterChatCommands(value: string, surface: ChatCommandSurface): ChatCommandSuggestion[];
|
|
20
|
+
export declare function shouldShowChatCommandMenu(value: string, surface: ChatCommandSurface): boolean;
|
|
21
|
+
export declare function completionForChatCommand(command: ChatCommandSuggestion): string;
|
|
22
|
+
export declare function listChatCommands(surface?: ChatCommandSurface): Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function parseChatCommand(input: string): {
|
|
27
|
+
name: string;
|
|
28
|
+
args: string;
|
|
29
|
+
} | null;
|
|
30
|
+
export declare function runAssistantChatCommand(input: string, deps: AssistantCommandDeps): Promise<ChatCommandRunResult>;
|
|
31
|
+
/** @deprecated Use runAssistantChatCommand instead */
|
|
32
|
+
export declare function isClearCommand(text: string): boolean;
|
|
33
|
+
//# sourceMappingURL=chat-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-commands.d.ts","sourceRoot":"","sources":["../../src/core/chat-commands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C,MAAM,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAyBF,MAAM,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,kBAAkB,GACzB,qBAAqB,EAAE,CAQzB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,GACzB,qBAAqB,EAAE,CAiBzB;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAWT;AAED,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,qBAAqB,GAC5B,MAAM,CAER;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAC;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC,CAID;AAED,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgBvC;AA2BD,wBAAsB,uBAAuB,CAC5C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,oBAAoB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AssistantMessage, AssistantWelcomeContext } from "./types.js";
|
|
2
|
+
export interface ChatHistoryOptions {
|
|
3
|
+
storageKey?: string;
|
|
4
|
+
maxStored?: number;
|
|
5
|
+
welcomeMessage: (ctx: AssistantWelcomeContext) => AssistantMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function createChatHistoryHelpers(options: ChatHistoryOptions): {
|
|
8
|
+
getStored: () => AssistantMessage[] | null;
|
|
9
|
+
persist: (messages: AssistantMessage[]) => void;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
loadInitial: (ctx: AssistantWelcomeContext) => AssistantMessage[];
|
|
12
|
+
};
|
|
13
|
+
export type { AssistantMessage };
|
|
14
|
+
//# sourceMappingURL=chat-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-history.d.ts","sourceRoot":"","sources":["../../src/core/chat-history.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAK5E,MAAM,WAAW,kBAAkB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,CAAC,GAAG,EAAE,uBAAuB,KAAK,gBAAgB,CAAC;CACnE;AAyDD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB;qBAI7C,gBAAgB,EAAE,GAAG,IAAI;wBAapB,gBAAgB,EAAE;;uBAYnB,uBAAuB,KAAG,gBAAgB,EAAE;EAYtE;AAED,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type SuggestionField = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export type ParsedSuggestion = {
|
|
6
|
+
kind: "compact";
|
|
7
|
+
text: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "structured";
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
fields: SuggestionField[];
|
|
13
|
+
raw: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "custom";
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function parseSuggestionText(text: string): ParsedSuggestion;
|
|
19
|
+
export declare function splitToolValues(value: string): string[];
|
|
20
|
+
//# sourceMappingURL=chat-reply-suggestions-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-reply-suggestions-parse.d.ts","sourceRoot":"","sources":["../../src/core/chat-reply-suggestions-parse.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IACA,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACX,GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAcpC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAoClE;AA4CD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAUvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-highlight.d.ts","sourceRoot":"","sources":["../../src/core/code-highlight.ts"],"names":[],"mappings":"AAOA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAQ3E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type LlmSettingsFormState, type LlmSettingsFormValues } from "./llm-settings-storage.js";
|
|
2
|
+
import type { AssistantMessage, AssistantStoreDependencies } from "./types.js";
|
|
3
|
+
export interface AssistantState {
|
|
4
|
+
messages: AssistantMessage[];
|
|
5
|
+
chatLoading: boolean;
|
|
6
|
+
llmEnabled: boolean;
|
|
7
|
+
llmModel: string | null;
|
|
8
|
+
llmModels: string[];
|
|
9
|
+
llmModelsLoading: boolean;
|
|
10
|
+
selectedModel: string | null;
|
|
11
|
+
loadLlmStatus: () => Promise<void>;
|
|
12
|
+
getLlmSettingsForm: () => Promise<LlmSettingsFormState>;
|
|
13
|
+
saveLlmSettings: (values: LlmSettingsFormValues) => Promise<void>;
|
|
14
|
+
clearLlmSettings: () => Promise<void>;
|
|
15
|
+
testLlmSettings: (values: LlmSettingsFormValues) => Promise<{
|
|
16
|
+
ok: true;
|
|
17
|
+
model: string;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
error: string;
|
|
21
|
+
}>;
|
|
22
|
+
llmSettingsHasOverrides: () => Promise<boolean>;
|
|
23
|
+
setSelectedModel: (model: string) => void;
|
|
24
|
+
sendChat: (message: string) => Promise<void>;
|
|
25
|
+
retryLastChat: () => Promise<void>;
|
|
26
|
+
clearChatHistory: () => void;
|
|
27
|
+
stopChat: () => void;
|
|
28
|
+
submitInteractiveToolResult: (callId: string, result: unknown) => void;
|
|
29
|
+
cancelInteractiveToolResult: (callId: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function createAssistantStore(deps: AssistantStoreDependencies): import("zustand").UseBoundStore<import("zustand").StoreApi<AssistantState>>;
|
|
32
|
+
export type AssistantStore = ReturnType<typeof createAssistantStore>;
|
|
33
|
+
//# sourceMappingURL=create-assistant-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-assistant-store.d.ts","sourceRoot":"","sources":["../../src/core/create-assistant-store.ts"],"names":[],"mappings":"AAyBA,OAAO,EAMN,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAS1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAEX,gBAAgB,EAChB,0BAA0B,EAC1B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAA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
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
prompt: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseSuggestedPromptsResponse(data: unknown): SuggestedPromptsResponse["prompts"];
|
|
11
|
+
//# sourceMappingURL=fetch-suggested-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-suggested-prompts.d.ts","sourceRoot":"","sources":["../../src/core/fetch-suggested-prompts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACH;AAED,wBAAgB,6BAA6B,CAC5C,IAAI,EAAE,OAAO,GACX,wBAAwB,CAAC,SAAS,CAAC,CAwCrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type { ChatActivityStep } from "./chat-activity.js";
|
|
2
|
+
export { chatActivityStepLabel, formatJsonIfLarge, summarizeActivityResult, } from "./chat-activity.js";
|
|
3
|
+
export type { AssistantCommandDeps, ChatCommandRunResult, ChatCommandSuggestion, ChatCommandSurface, } from "./chat-commands.js";
|
|
4
|
+
export { filterChatCommands, getChatCommandSuggestions, isChatCommandInput, listChatCommands, parseChatCommand, runAssistantChatCommand, shouldShowChatCommandMenu, } from "./chat-commands.js";
|
|
5
|
+
export { createChatHistoryHelpers } from "./chat-history.js";
|
|
6
|
+
export { type AssistantState, createAssistantStore, } from "./create-assistant-store.js";
|
|
7
|
+
export { parseSuggestedPromptsResponse, type SuggestedPromptsResponse, } from "./fetch-suggested-prompts.js";
|
|
8
|
+
export { CHOICES_TOOL, type ChoiceOption, type ChoicesToolArgs, CONFIRMATION_TOOL, type ConfirmationToolArgs, type ReplySuggestions, rejectAllInteractiveToolWaiters, resolveInteractiveToolResult, SUGGEST_REPLIES_TOOL, } from "./interactive-tools/index.js";
|
|
9
|
+
export type { AgentStepResult, LlmChatStatus, StreamHandlers, ToolHandlers, } from "./llm-chat.js";
|
|
10
|
+
export { buildLlmHistory, ChatAbortedError, fetchLlmStatus, LlmNotConfiguredError, LlmUpstreamError, requestLlmCompletion, runLlmAgent, sanitizeLlmMessages, } from "./llm-chat.js";
|
|
11
|
+
export { buildCompletionsUrl, buildLlmRequestHeaders, buildModelsUrl, DEFAULT_LLM_BASE_URL, DEFAULT_LLM_MODEL, getFallbackModels, isLlmConfigured, isLlmUnavailableMessage, isLocalLlmBaseUrl, LLM_UNAVAILABLE_MESSAGE, } from "./llm-config.js";
|
|
12
|
+
export { clearProviderModelCache, fetchProviderModels, } from "./llm-models.js";
|
|
13
|
+
export { configureAssistantLlm, resetAssistantLlm, resolveAssistantLlmSettings, testLlmConnection, } from "./llm-provider.js";
|
|
14
|
+
export type { LlmSettingsFormState, LlmSettingsFormValues, StoredLlmUserSettings, } from "./llm-settings-storage.js";
|
|
15
|
+
export { assistantToStored, buildDefaultLlmSettings, createDefaultStoredSettings, createLlmSettingsFormState, createLlmSettingsFormStateFromStored, createLlmSettingsStorage, DEFAULT_LLM_SETTINGS_STORAGE_KEY, formatModelsText, isLlmSettingsFormDirty, mergeLlmSettings, migrateLegacyModelStorage, normalizeStoredSettings, normalizeStoredSystemPrompt, parseModelsText, peekStoredModel, persistStoredModelSelection, resolveSelectedModel, storedSettingsHaveOverrides, storedToAssistant, toStoredSettings, } from "./llm-settings-storage.js";
|
|
16
|
+
export type { ClientToolDefinition, LlmChatMessage, OpenAiToolCall, } from "./llm-types.js";
|
|
17
|
+
export { childrenToText } from "./markdown-utils.js";
|
|
18
|
+
export type { AssistantLlmConfig, AssistantLlmSettings, AssistantMessage, AssistantStorageKeys, AssistantStoreDependencies, AssistantSuggestedPrompt, AssistantToolContent, AssistantToolDefinition, AssistantToolResult, AssistantWelcomeContext, JsonSchema, } from "./types.js";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACN,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,6BAA6B,EAC7B,KAAK,wBAAwB,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,+BAA+B,EAC/B,4BAA4B,EAC5B,oBAAoB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,mBAAmB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,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