@anuma/sdk 1.0.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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/expo/chunk-LJYAMK62.mjs +25 -0
- package/dist/expo/chunk-MJJIYFAX.mjs +25 -0
- package/dist/expo/chunk-PJCZO4BQ.mjs +25 -0
- package/dist/expo/clientConfig-2MI4KULF.mjs +10 -0
- package/dist/expo/clientConfig-QDAXFL3W.mjs +10 -0
- package/dist/expo/clientConfig-R4IOW7I2.mjs +10 -0
- package/dist/expo/index.cjs +7858 -0
- package/dist/expo/index.d.mts +2590 -0
- package/dist/expo/index.d.ts +2590 -0
- package/dist/expo/index.mjs +7770 -0
- package/dist/index.cjs +1200 -0
- package/dist/index.d.mts +2796 -0
- package/dist/index.d.ts +2796 -0
- package/dist/index.mjs +1138 -0
- package/dist/next/index.cjs +64 -0
- package/dist/next/index.d.mts +23 -0
- package/dist/next/index.d.ts +23 -0
- package/dist/next/index.mjs +39 -0
- package/dist/polyfills/index.cjs +61 -0
- package/dist/polyfills/index.d.mts +9 -0
- package/dist/polyfills/index.d.ts +9 -0
- package/dist/polyfills/index.mjs +34 -0
- package/dist/react/chunk-LJYAMK62.mjs +25 -0
- package/dist/react/chunk-MJJIYFAX.mjs +25 -0
- package/dist/react/chunk-PJCZO4BQ.mjs +25 -0
- package/dist/react/clientConfig-2MI4KULF.mjs +10 -0
- package/dist/react/clientConfig-QDAXFL3W.mjs +10 -0
- package/dist/react/clientConfig-R4IOW7I2.mjs +10 -0
- package/dist/react/index.cjs +15178 -0
- package/dist/react/index.d.mts +6014 -0
- package/dist/react/index.d.ts +6014 -0
- package/dist/react/index.mjs +14945 -0
- package/dist/tools/chunk-KDFGY4SK.mjs +13 -0
- package/dist/tools/clientConfig-RMDOT5YM.mjs +10 -0
- package/dist/tools/index.cjs +775 -0
- package/dist/tools/index.d.mts +121 -0
- package/dist/tools/index.d.ts +121 -0
- package/dist/tools/index.mjs +741 -0
- package/dist/vercel/index.cjs +86 -0
- package/dist/vercel/index.d.mts +149 -0
- package/dist/vercel/index.d.ts +149 -0
- package/dist/vercel/index.mjs +57 -0
- package/package.json +149 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar tool definition for the chat system.
|
|
3
|
+
* This tool allows the LLM to list events from the user's Google Calendar.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Tool configuration type that extends the SDK's tool type with executor support.
|
|
7
|
+
* The SDK runtime supports these properties even though the base types don't include them.
|
|
8
|
+
*
|
|
9
|
+
* Note: Client tools use "arguments" internally. The SDK converts this to "parameters"
|
|
10
|
+
* when sending to the API (see serverTools.ts mergeTools function).
|
|
11
|
+
*/
|
|
12
|
+
interface ToolConfig {
|
|
13
|
+
type: 'function';
|
|
14
|
+
function: {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
arguments: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
executor?: (args: Record<string, unknown>) => Promise<unknown> | unknown;
|
|
20
|
+
autoExecute?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface ListEventsArgs {
|
|
23
|
+
timeMin?: string;
|
|
24
|
+
timeMax?: string;
|
|
25
|
+
maxResults?: number;
|
|
26
|
+
}
|
|
27
|
+
interface CreateEventArgs {
|
|
28
|
+
summary: string;
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
location?: string;
|
|
33
|
+
attendees?: string[];
|
|
34
|
+
}
|
|
35
|
+
interface UpdateEventArgs {
|
|
36
|
+
eventId: string;
|
|
37
|
+
summary?: string;
|
|
38
|
+
start?: string;
|
|
39
|
+
end?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
location?: string;
|
|
42
|
+
attendees?: string[];
|
|
43
|
+
}
|
|
44
|
+
interface CalendarEvent {
|
|
45
|
+
id: string;
|
|
46
|
+
summary: string;
|
|
47
|
+
start: string;
|
|
48
|
+
end: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
location?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates the Google Calendar list events tool with access to the token getter.
|
|
54
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
55
|
+
*/
|
|
56
|
+
declare function createGoogleCalendarTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Creates the Google Calendar create event tool with access to the token getter.
|
|
59
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
60
|
+
*/
|
|
61
|
+
declare function createGoogleCalendarCreateEventTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Creates the Google Calendar update event tool with access to the token getter.
|
|
64
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
65
|
+
*/
|
|
66
|
+
declare function createGoogleCalendarUpdateEventTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
67
|
+
/**
|
|
68
|
+
* Creates all chat tools with the provided token context.
|
|
69
|
+
* This factory function allows tools to access authentication tokens via closures.
|
|
70
|
+
*/
|
|
71
|
+
declare function createChatTools(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig[];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Google Drive tool definition for the chat system.
|
|
75
|
+
* This tool allows the LLM to search files in the user's Google Drive.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
interface SearchFilesArgs {
|
|
79
|
+
query: string;
|
|
80
|
+
maxResults?: number;
|
|
81
|
+
mimeType?: string;
|
|
82
|
+
}
|
|
83
|
+
interface DriveFile {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
mimeType: string;
|
|
87
|
+
webViewLink?: string;
|
|
88
|
+
modifiedTime?: string;
|
|
89
|
+
size?: string;
|
|
90
|
+
owners?: {
|
|
91
|
+
displayName: string;
|
|
92
|
+
emailAddress: string;
|
|
93
|
+
}[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Creates the Google Drive search tool with access to the token getter.
|
|
97
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
98
|
+
*/
|
|
99
|
+
declare function createGoogleDriveSearchTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
100
|
+
interface ListRecentFilesArgs {
|
|
101
|
+
maxResults?: number;
|
|
102
|
+
mimeType?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Creates the Google Drive list recent files tool with access to the token getter.
|
|
106
|
+
*/
|
|
107
|
+
declare function createGoogleDriveListRecentTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
108
|
+
interface GetFileContentArgs {
|
|
109
|
+
fileId?: string;
|
|
110
|
+
fileName?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates the Google Drive get file content tool
|
|
114
|
+
*/
|
|
115
|
+
declare function createGoogleDriveGetContentTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
116
|
+
/**
|
|
117
|
+
* Creates all Google Drive tools with the provided token context.
|
|
118
|
+
*/
|
|
119
|
+
declare function createDriveTools(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig[];
|
|
120
|
+
|
|
121
|
+
export { type CalendarEvent, type CreateEventArgs, type DriveFile, type GetFileContentArgs, type ListEventsArgs, type ListRecentFilesArgs, type SearchFilesArgs, type ToolConfig, type UpdateEventArgs, createChatTools, createDriveTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar tool definition for the chat system.
|
|
3
|
+
* This tool allows the LLM to list events from the user's Google Calendar.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Tool configuration type that extends the SDK's tool type with executor support.
|
|
7
|
+
* The SDK runtime supports these properties even though the base types don't include them.
|
|
8
|
+
*
|
|
9
|
+
* Note: Client tools use "arguments" internally. The SDK converts this to "parameters"
|
|
10
|
+
* when sending to the API (see serverTools.ts mergeTools function).
|
|
11
|
+
*/
|
|
12
|
+
interface ToolConfig {
|
|
13
|
+
type: 'function';
|
|
14
|
+
function: {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
arguments: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
executor?: (args: Record<string, unknown>) => Promise<unknown> | unknown;
|
|
20
|
+
autoExecute?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface ListEventsArgs {
|
|
23
|
+
timeMin?: string;
|
|
24
|
+
timeMax?: string;
|
|
25
|
+
maxResults?: number;
|
|
26
|
+
}
|
|
27
|
+
interface CreateEventArgs {
|
|
28
|
+
summary: string;
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
location?: string;
|
|
33
|
+
attendees?: string[];
|
|
34
|
+
}
|
|
35
|
+
interface UpdateEventArgs {
|
|
36
|
+
eventId: string;
|
|
37
|
+
summary?: string;
|
|
38
|
+
start?: string;
|
|
39
|
+
end?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
location?: string;
|
|
42
|
+
attendees?: string[];
|
|
43
|
+
}
|
|
44
|
+
interface CalendarEvent {
|
|
45
|
+
id: string;
|
|
46
|
+
summary: string;
|
|
47
|
+
start: string;
|
|
48
|
+
end: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
location?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates the Google Calendar list events tool with access to the token getter.
|
|
54
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
55
|
+
*/
|
|
56
|
+
declare function createGoogleCalendarTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Creates the Google Calendar create event tool with access to the token getter.
|
|
59
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
60
|
+
*/
|
|
61
|
+
declare function createGoogleCalendarCreateEventTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Creates the Google Calendar update event tool with access to the token getter.
|
|
64
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
65
|
+
*/
|
|
66
|
+
declare function createGoogleCalendarUpdateEventTool(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig;
|
|
67
|
+
/**
|
|
68
|
+
* Creates all chat tools with the provided token context.
|
|
69
|
+
* This factory function allows tools to access authentication tokens via closures.
|
|
70
|
+
*/
|
|
71
|
+
declare function createChatTools(getAccessToken: () => string | null, requestCalendarAccess: () => Promise<string>): ToolConfig[];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Google Drive tool definition for the chat system.
|
|
75
|
+
* This tool allows the LLM to search files in the user's Google Drive.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
interface SearchFilesArgs {
|
|
79
|
+
query: string;
|
|
80
|
+
maxResults?: number;
|
|
81
|
+
mimeType?: string;
|
|
82
|
+
}
|
|
83
|
+
interface DriveFile {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
mimeType: string;
|
|
87
|
+
webViewLink?: string;
|
|
88
|
+
modifiedTime?: string;
|
|
89
|
+
size?: string;
|
|
90
|
+
owners?: {
|
|
91
|
+
displayName: string;
|
|
92
|
+
emailAddress: string;
|
|
93
|
+
}[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Creates the Google Drive search tool with access to the token getter.
|
|
97
|
+
* The token getter is captured in a closure so the executor can access it.
|
|
98
|
+
*/
|
|
99
|
+
declare function createGoogleDriveSearchTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
100
|
+
interface ListRecentFilesArgs {
|
|
101
|
+
maxResults?: number;
|
|
102
|
+
mimeType?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Creates the Google Drive list recent files tool with access to the token getter.
|
|
106
|
+
*/
|
|
107
|
+
declare function createGoogleDriveListRecentTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
108
|
+
interface GetFileContentArgs {
|
|
109
|
+
fileId?: string;
|
|
110
|
+
fileName?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates the Google Drive get file content tool
|
|
114
|
+
*/
|
|
115
|
+
declare function createGoogleDriveGetContentTool(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig;
|
|
116
|
+
/**
|
|
117
|
+
* Creates all Google Drive tools with the provided token context.
|
|
118
|
+
*/
|
|
119
|
+
declare function createDriveTools(getAccessToken: () => string | null, requestDriveAccess: () => Promise<string>): ToolConfig[];
|
|
120
|
+
|
|
121
|
+
export { type CalendarEvent, type CreateEventArgs, type DriveFile, type GetFileContentArgs, type ListEventsArgs, type ListRecentFilesArgs, type SearchFilesArgs, type ToolConfig, type UpdateEventArgs, createChatTools, createDriveTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool };
|