-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.ts
More file actions
122 lines (112 loc) · 3.14 KB
/
Copy pathmod.ts
File metadata and controls
122 lines (112 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Copyright 2024 the Beyond Better authors. All rights reserved. MIT license.
/**
* BB Tools Framework
*
* A comprehensive framework for building AI assistant tools. Provides base classes,
* interfaces, and utilities for creating tools that can interact with projects,
* manage conversations, and format output for both browser and console environments.
*
* ```ts
* import LLMTool from "@beyondbetter/tools";
* import type {
* IProjectEditor,
* IConversationInteraction,
* LLMToolRunResult
* } from "@beyondbetter/tools";
*
* class MyTool extends LLMTool {
* get inputSchema() {
* return {
* type: "object",
* properties: {
* param: { type: "string" }
* }
* };
* }
*
* async runTool(
* interaction: IConversationInteraction,
* toolUse: LLMAnswerToolUse,
* projectEditor: IProjectEditor
* ): Promise<LLMToolRunResult> {
* // Tool implementation
* }
* }
* ```
*
* ## Core Components
*
* - {@link LLMTool} - Base class for all tools
* - {@link IProjectEditor} - Project management interface
* - {@link IConversationInteraction} - Conversation management interface
*
* ## Types and Interfaces
*
* - Message Types: {@link LLMMessageContentPart}, {@link LLMMessageContentParts}
* - Tool Types: {@link LLMToolRunResult}, {@link LLMToolFeatures}
* - Utility Types: {@link TokenUsage}, {@link FileMetadata}
*
* ## Formatting
*
* - Browser: {@link TOOL_STYLES_BROWSER}, {@link TOOL_TAGS_BROWSER}
* - Console: {@link TOOL_STYLES_CONSOLE}
*
* @module
*/
export { default } from './llm_tool.ts';
// Core interfaces
export type { IProjectEditor } from './project_editor.ts';
export type { IConversationInteraction } from './interaction.ts';
// Legacy export for backward compatibility
export type { IConversationInteraction as IConversation } from './interaction.ts';
// Data source types
export type {
DataSourceAccessMethod,
DataSourceCapability,
DataSourceConfig,
DataSourceConnection,
DataSourceProviderType,
} from './data_source.ts';
// Message types
export type {
LLMAnswerToolUse,
LLMMessageContentPart,
LLMMessageContentPartAudioBlock,
LLMMessageContentPartBase,
LLMMessageContentPartImageBlock,
LLMMessageContentPartImageBlockSourceMediaType,
LLMMessageContentPartRedactedThinkingBlock,
LLMMessageContentParts,
LLMMessageContentPartTextBlock,
LLMMessageContentPartThinkingBlock,
LLMMessageContentPartToolResultBlock,
LLMMessageContentPartToolUseBlock,
} from './message.ts';
// Shared types
export type {
ConversationStats,
FileMetadata,
TokenUsage,
ToolStats,
ToolUsageStats,
} from './types.ts';
// Tool types
export type {
LLMToolConfig,
LLMToolFeatures,
LLMToolFormatterDestination,
LLMToolInputSchema,
LLMToolLogEntryFormattedResult,
LLMToolMetadata,
LLMToolRunBbResponse,
LLMToolRunBbResponseData,
LLMToolRunResult,
LLMToolRunResultContent,
LLMToolRunResultFormatter,
LLMToolRunToolResponse,
LLMToolUseInputFormatter,
} from './llm_tool.ts';
// Formatting utilities
export { TOOL_STYLES_BROWSER, TOOL_STYLES_CONSOLE, TOOL_TAGS_BROWSER } from './llm_tool_tags.tsx';
// Example tools
export * from './examples/mod.ts';