@scenemesh/entity-engine-aimodule 1.0.0 → 1.0.2
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/components/ChatDialog/ChatDialog.d.ts +17 -0
- package/dist/components/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/components/ChatDialog/ChatDialog.js +346 -0
- package/dist/components/ChatDialog/ChatDialog.js.map +1 -0
- package/dist/components/DynamicUI/DynamicToolRenderer.d.ts +9 -0
- package/dist/components/DynamicUI/DynamicToolRenderer.d.ts.map +1 -0
- package/dist/components/DynamicUI/DynamicToolRenderer.js +114 -0
- package/dist/components/DynamicUI/DynamicToolRenderer.js.map +1 -0
- package/dist/components/DynamicUI/EntityEngineDynamicComponents.d.ts +75 -0
- package/dist/components/DynamicUI/EntityEngineDynamicComponents.d.ts.map +1 -0
- package/dist/components/DynamicUI/EntityEngineDynamicComponents.js +123 -0
- package/dist/components/DynamicUI/EntityEngineDynamicComponents.js.map +1 -0
- package/dist/components/DynamicUI/index.d.ts +12 -0
- package/dist/components/DynamicUI/index.d.ts.map +1 -0
- package/dist/components/DynamicUI/index.js +13 -0
- package/dist/components/DynamicUI/index.js.map +1 -0
- package/dist/components/FileViewer/FileViewer.d.ts +16 -0
- package/dist/components/FileViewer/FileViewer.d.ts.map +1 -0
- package/dist/components/FileViewer/FileViewer.js +158 -0
- package/dist/components/FileViewer/FileViewer.js.map +1 -0
- package/dist/components/GenerativeUI/PrebuiltComponents.d.ts +44 -0
- package/dist/components/GenerativeUI/PrebuiltComponents.d.ts.map +1 -0
- package/dist/components/GenerativeUI/PrebuiltComponents.js +65 -0
- package/dist/components/GenerativeUI/PrebuiltComponents.js.map +1 -0
- package/dist/components/MessageBubble/MessageBubble.d.ts +29 -0
- package/dist/components/MessageBubble/MessageBubble.d.ts.map +1 -0
- package/dist/components/MessageBubble/MessageBubble.js +222 -0
- package/dist/components/MessageBubble/MessageBubble.js.map +1 -0
- package/dist/components/ReasoningComponents/ReasoningDisplay.d.ts +26 -0
- package/dist/components/ReasoningComponents/ReasoningDisplay.d.ts.map +1 -0
- package/dist/components/ReasoningComponents/ReasoningDisplay.js +44 -0
- package/dist/components/ReasoningComponents/ReasoningDisplay.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/core/ai-core-manager.d.ts +221 -0
- package/dist/core/ai-core-manager.d.ts.map +1 -0
- package/dist/core/ai-core-manager.js +536 -0
- package/dist/core/ai-core-manager.js.map +1 -0
- package/dist/core/ai-core.d.ts +380 -0
- package/dist/core/ai-core.d.ts.map +1 -0
- package/dist/core/ai-core.js +297 -0
- package/dist/core/ai-core.js.map +1 -0
- package/dist/core/ai-embeddings.d.ts +204 -0
- package/dist/core/ai-embeddings.d.ts.map +1 -0
- package/dist/core/ai-embeddings.js +380 -0
- package/dist/core/ai-embeddings.js.map +1 -0
- package/dist/core/ai-provider.d.ts +265 -0
- package/dist/core/ai-provider.d.ts.map +1 -0
- package/dist/core/ai-provider.js +717 -0
- package/dist/core/ai-provider.js.map +1 -0
- package/dist/core/ai-settings.d.ts +289 -0
- package/dist/core/ai-settings.d.ts.map +1 -0
- package/dist/core/ai-settings.js +585 -0
- package/dist/core/ai-settings.js.map +1 -0
- package/dist/core/ai-structured.d.ts +198 -0
- package/dist/core/ai-structured.d.ts.map +1 -0
- package/dist/core/ai-structured.js +460 -0
- package/dist/core/ai-structured.js.map +1 -0
- package/dist/core/ai-tools.d.ts +378 -0
- package/dist/core/ai-tools.d.ts.map +1 -0
- package/dist/core/ai-tools.js +637 -0
- package/dist/core/ai-tools.js.map +1 -0
- package/dist/core/index.d.ts +47 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +75 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/system-prompt.d.ts +6 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +273 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core-index.d.ts +29 -1648
- package/dist/core-index.d.ts.map +1 -0
- package/dist/core-index.js +63 -99
- package/dist/core-index.js.map +1 -1
- package/dist/entity-module/ai.module.d.ts +48 -0
- package/dist/entity-module/ai.module.d.ts.map +1 -0
- package/dist/entity-module/ai.module.js +126 -0
- package/dist/entity-module/ai.module.js.map +1 -0
- package/dist/entity-module/index.d.ts +9 -0
- package/dist/entity-module/index.d.ts.map +1 -0
- package/dist/entity-module/index.js +9 -0
- package/dist/entity-module/index.js.map +1 -0
- package/dist/entity-module/models/ai-model.d.ts +3 -0
- package/dist/entity-module/models/ai-model.d.ts.map +1 -0
- package/dist/entity-module/models/ai-model.js +44 -0
- package/dist/entity-module/models/ai-model.js.map +1 -0
- package/dist/entity-module/models/index.d.ts +3 -0
- package/dist/entity-module/models/index.d.ts.map +1 -0
- package/dist/entity-module/models/index.js +6 -0
- package/dist/entity-module/models/index.js.map +1 -0
- package/dist/entity-module/module.json +8 -0
- package/dist/entity-module/renderers/ai-form-renderer.d.ts +3 -0
- package/dist/entity-module/renderers/ai-form-renderer.d.ts.map +1 -0
- package/dist/entity-module/renderers/ai-form-renderer.js +201 -0
- package/dist/entity-module/renderers/ai-form-renderer.js.map +1 -0
- package/dist/entity-module/renderers/ai-renderer.d.ts +3 -0
- package/dist/entity-module/renderers/ai-renderer.d.ts.map +1 -0
- package/dist/entity-module/renderers/ai-renderer.js +99 -0
- package/dist/entity-module/renderers/ai-renderer.js.map +1 -0
- package/dist/entity-module/renderers/index.d.ts +3 -0
- package/dist/entity-module/renderers/index.d.ts.map +1 -0
- package/dist/entity-module/renderers/index.js +3 -0
- package/dist/entity-module/renderers/index.js.map +1 -0
- package/dist/entity-module/servlets/ai-servlet.d.ts +15 -0
- package/dist/entity-module/servlets/ai-servlet.d.ts.map +1 -0
- package/dist/entity-module/servlets/ai-servlet.js +377 -0
- package/dist/entity-module/servlets/ai-servlet.js.map +1 -0
- package/dist/entity-module/servlets/index.d.ts +3 -0
- package/dist/entity-module/servlets/index.d.ts.map +1 -0
- package/dist/entity-module/servlets/index.js +6 -0
- package/dist/entity-module/servlets/index.js.map +1 -0
- package/dist/entity-module/views/ai-view.d.ts +3 -0
- package/dist/entity-module/views/ai-view.d.ts.map +1 -0
- package/dist/entity-module/views/ai-view.js +33 -0
- package/dist/entity-module/views/ai-view.js.map +1 -0
- package/dist/entity-module/views/index.d.ts +3 -0
- package/dist/entity-module/views/index.d.ts.map +1 -0
- package/dist/entity-module/views/index.js +6 -0
- package/dist/entity-module/views/index.js.map +1 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useChat.d.ts +13 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useChat.js +13 -0
- package/dist/hooks/useChat.js.map +1 -0
- package/dist/hooks/useCompletion.d.ts +17 -0
- package/dist/hooks/useCompletion.d.ts.map +1 -0
- package/dist/hooks/useCompletion.js +17 -0
- package/dist/hooks/useCompletion.js.map +1 -0
- package/dist/hooks/useObject.d.ts +16 -0
- package/dist/hooks/useObject.d.ts.map +1 -0
- package/dist/hooks/useObject.js +17 -0
- package/dist/hooks/useObject.js.map +1 -0
- package/dist/index.d.ts +42 -2876
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -1168
- package/dist/index.js.map +1 -1
- package/dist/tools/dynamic-tools/entity-query-tool.d.ts +15 -0
- package/dist/tools/dynamic-tools/entity-query-tool.d.ts.map +1 -0
- package/dist/tools/dynamic-tools/entity-query-tool.js +178 -0
- package/dist/tools/dynamic-tools/entity-query-tool.js.map +1 -0
- package/dist/tools/dynamic-tools/index.d.ts +8 -0
- package/dist/tools/dynamic-tools/index.d.ts.map +1 -0
- package/dist/tools/dynamic-tools/index.js +8 -0
- package/dist/tools/dynamic-tools/index.js.map +1 -0
- package/dist/tools/frontend-tools/index.d.ts +7 -0
- package/dist/tools/frontend-tools/index.d.ts.map +1 -0
- package/dist/tools/frontend-tools/index.js +7 -0
- package/dist/tools/frontend-tools/index.js.map +1 -0
- package/dist/tools/frontend-tools/record-tools.d.ts +48 -0
- package/dist/tools/frontend-tools/record-tools.d.ts.map +1 -0
- package/dist/tools/frontend-tools/record-tools.js +97 -0
- package/dist/tools/frontend-tools/record-tools.js.map +1 -0
- package/dist/tools/index.d.ts +217 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +52 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/static-tools/index.d.ts +9 -0
- package/dist/tools/static-tools/index.d.ts.map +1 -0
- package/dist/tools/static-tools/index.js +9 -0
- package/dist/tools/static-tools/index.js.map +1 -0
- package/dist/tools/static-tools/location-tool.d.ts +38 -0
- package/dist/tools/static-tools/location-tool.d.ts.map +1 -0
- package/dist/tools/static-tools/location-tool.js +97 -0
- package/dist/tools/static-tools/location-tool.js.map +1 -0
- package/dist/tools/static-tools/weather-tool.d.ts +19 -0
- package/dist/tools/static-tools/weather-tool.d.ts.map +1 -0
- package/dist/tools/static-tools/weather-tool.js +27 -0
- package/dist/tools/static-tools/weather-tool.js.map +1 -0
- package/dist/types/core-types.d.ts +183 -0
- package/dist/types/core-types.d.ts.map +1 -0
- package/dist/types/core-types.js +7 -0
- package/dist/types/core-types.js.map +1 -0
- package/dist/types/index.d.ts +50 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +31 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/ui-types.d.ts +434 -0
- package/dist/types/ui-types.d.ts.map +1 -0
- package/dist/types/ui-types.js +8 -0
- package/dist/types/ui-types.js.map +1 -0
- package/dist/ui/index.d.ts +30 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +67 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui-index.d.ts +12 -607
- package/dist/ui-index.d.ts.map +1 -0
- package/dist/ui-index.js +106 -2350
- package/dist/ui-index.js.map +1 -1
- package/dist/utils/index.d.ts +122 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +336 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/persistence.d.ts +99 -0
- package/dist/utils/persistence.d.ts.map +1 -0
- package/dist/utils/persistence.js +286 -0
- package/dist/utils/persistence.js.map +1 -0
- package/dist/utils/streaming.d.ts +144 -0
- package/dist/utils/streaming.d.ts.map +1 -0
- package/dist/utils/streaming.js +359 -0
- package/dist/utils/streaming.js.map +1 -0
- package/dist/utils/theme.d.ts +162 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +211 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/utils/warnings.d.ts +77 -0
- package/dist/utils/warnings.d.ts.map +1 -0
- package/dist/utils/warnings.js +228 -0
- package/dist/utils/warnings.js.map +1 -0
- package/package.json +3 -3
- package/dist/ai-core-LBGYFGOK.mjs +0 -17
- package/dist/ai-core-LBGYFGOK.mjs.map +0 -1
- package/dist/ai-core-UGJWSCQN.js +0 -17
- package/dist/ai-core-UGJWSCQN.js.map +0 -1
- package/dist/ai-core-manager-B3Z34RHA.mjs +0 -9
- package/dist/ai-core-manager-B3Z34RHA.mjs.map +0 -1
- package/dist/ai-core-manager-W7SSDCG5.js +0 -9
- package/dist/ai-core-manager-W7SSDCG5.js.map +0 -1
- package/dist/ai-embeddings-5ED5LDXX.mjs +0 -17
- package/dist/ai-embeddings-5ED5LDXX.mjs.map +0 -1
- package/dist/ai-embeddings-WCXZMMTZ.js +0 -17
- package/dist/ai-embeddings-WCXZMMTZ.js.map +0 -1
- package/dist/ai-form-renderer-24IWNMX5.js +0 -233
- package/dist/ai-form-renderer-24IWNMX5.js.map +0 -1
- package/dist/ai-form-renderer-BORQABF2.mjs +0 -233
- package/dist/ai-form-renderer-BORQABF2.mjs.map +0 -1
- package/dist/ai-provider-3PSCVEEN.mjs +0 -17
- package/dist/ai-provider-3PSCVEEN.mjs.map +0 -1
- package/dist/ai-provider-WMPMVZFL.js +0 -17
- package/dist/ai-provider-WMPMVZFL.js.map +0 -1
- package/dist/ai-renderer-7WGGWH5D.mjs +0 -134
- package/dist/ai-renderer-7WGGWH5D.mjs.map +0 -1
- package/dist/ai-renderer-OILYWAJV.js +0 -134
- package/dist/ai-renderer-OILYWAJV.js.map +0 -1
- package/dist/ai-settings-DGCFPK3U.js +0 -15
- package/dist/ai-settings-DGCFPK3U.js.map +0 -1
- package/dist/ai-settings-DTXEAB64.mjs +0 -15
- package/dist/ai-settings-DTXEAB64.mjs.map +0 -1
- package/dist/ai-structured-EGZ26ZS4.mjs +0 -13
- package/dist/ai-structured-EGZ26ZS4.mjs.map +0 -1
- package/dist/ai-structured-N2FZLO4A.js +0 -13
- package/dist/ai-structured-N2FZLO4A.js.map +0 -1
- package/dist/ai-tools-B3R77HZ3.js +0 -19
- package/dist/ai-tools-B3R77HZ3.js.map +0 -1
- package/dist/ai-tools-JAPVYQGE.mjs +0 -19
- package/dist/ai-tools-JAPVYQGE.mjs.map +0 -1
- package/dist/ai.module-GAHVCBTP.js +0 -7
- package/dist/ai.module-GAHVCBTP.js.map +0 -1
- package/dist/ai.module-TTPMTPB3.mjs +0 -7
- package/dist/ai.module-TTPMTPB3.mjs.map +0 -1
- package/dist/chunk-25C2NRSD.mjs +0 -611
- package/dist/chunk-25C2NRSD.mjs.map +0 -1
- package/dist/chunk-4JQ7UOXH.js +0 -427
- package/dist/chunk-4JQ7UOXH.js.map +0 -1
- package/dist/chunk-6IUKES2L.js +0 -290
- package/dist/chunk-6IUKES2L.js.map +0 -1
- package/dist/chunk-COWPK7XN.mjs +0 -834
- package/dist/chunk-COWPK7XN.mjs.map +0 -1
- package/dist/chunk-CTEXPMVZ.js +0 -512
- package/dist/chunk-CTEXPMVZ.js.map +0 -1
- package/dist/chunk-DXQTHA75.js +0 -573
- package/dist/chunk-DXQTHA75.js.map +0 -1
- package/dist/chunk-DZFQ6I23.js +0 -72
- package/dist/chunk-DZFQ6I23.js.map +0 -1
- package/dist/chunk-J323UTPE.mjs +0 -650
- package/dist/chunk-J323UTPE.mjs.map +0 -1
- package/dist/chunk-LHNNALVF.js +0 -834
- package/dist/chunk-LHNNALVF.js.map +0 -1
- package/dist/chunk-O7SZSMXV.js +0 -1621
- package/dist/chunk-O7SZSMXV.js.map +0 -1
- package/dist/chunk-OTNOFOVW.js +0 -650
- package/dist/chunk-OTNOFOVW.js.map +0 -1
- package/dist/chunk-PRIGZEI4.mjs +0 -72
- package/dist/chunk-PRIGZEI4.mjs.map +0 -1
- package/dist/chunk-SBSZ3IPB.mjs +0 -573
- package/dist/chunk-SBSZ3IPB.mjs.map +0 -1
- package/dist/chunk-SXPA6SSD.mjs +0 -1621
- package/dist/chunk-SXPA6SSD.mjs.map +0 -1
- package/dist/chunk-T5A4KAVS.mjs +0 -512
- package/dist/chunk-T5A4KAVS.mjs.map +0 -1
- package/dist/chunk-TDRKKUNT.mjs +0 -357
- package/dist/chunk-TDRKKUNT.mjs.map +0 -1
- package/dist/chunk-TJFNODPE.js +0 -357
- package/dist/chunk-TJFNODPE.js.map +0 -1
- package/dist/chunk-V2SSI3SL.mjs +0 -427
- package/dist/chunk-V2SSI3SL.mjs.map +0 -1
- package/dist/chunk-X42L6MTY.mjs +0 -290
- package/dist/chunk-X42L6MTY.mjs.map +0 -1
- package/dist/chunk-YSVMY77H.js +0 -611
- package/dist/chunk-YSVMY77H.js.map +0 -1
- package/dist/core-ANYRS6EF.mjs +0 -73
- package/dist/core-ANYRS6EF.mjs.map +0 -1
- package/dist/core-K5K34DCS.js +0 -73
- package/dist/core-K5K34DCS.js.map +0 -1
- package/dist/core-index.d.mts +0 -1668
- package/dist/core-index.mjs +0 -101
- package/dist/core-index.mjs.map +0 -1
- package/dist/index.d.mts +0 -2911
- package/dist/index.mjs +0 -1177
- package/dist/index.mjs.map +0 -1
- package/dist/tools-352X7A6X.mjs +0 -366
- package/dist/tools-352X7A6X.mjs.map +0 -1
- package/dist/tools-YLEX6GNO.js +0 -366
- package/dist/tools-YLEX6GNO.js.map +0 -1
- package/dist/ui-index.d.mts +0 -627
- package/dist/ui-index.mjs +0 -2353
- package/dist/ui-index.mjs.map +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Collection - Unified export for all available tools
|
|
3
|
+
*
|
|
4
|
+
* Optimized file structure:
|
|
5
|
+
* - static-tools/: Static tools (predefined types)
|
|
6
|
+
* - dynamic-tools/: Dynamic tools (runtime types)
|
|
7
|
+
* - frontend-tools/: Frontend proxy tools
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Default tools collection - Static, dynamic and frontend proxy tools
|
|
11
|
+
*
|
|
12
|
+
* Design features:
|
|
13
|
+
* - Static tools: getWeather, getLocation (basic functionality)
|
|
14
|
+
* - Dynamic tools: entityQuery (data retrieval focused)
|
|
15
|
+
* - Frontend proxy tools: record* operations
|
|
16
|
+
*/
|
|
17
|
+
export declare const defaultTools: {
|
|
18
|
+
readonly getWeather: import("ai").Tool<{
|
|
19
|
+
location: string;
|
|
20
|
+
unit: "celsius" | "fahrenheit";
|
|
21
|
+
}, {
|
|
22
|
+
location: string;
|
|
23
|
+
temperature: number;
|
|
24
|
+
weather: string;
|
|
25
|
+
humidity: number;
|
|
26
|
+
windSpeed: number;
|
|
27
|
+
unit: "celsius" | "fahrenheit";
|
|
28
|
+
lastUpdated: string;
|
|
29
|
+
}>;
|
|
30
|
+
readonly getLocation: import("ai").Tool<{
|
|
31
|
+
city: string;
|
|
32
|
+
includeWeather: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
city: string;
|
|
35
|
+
country: string;
|
|
36
|
+
province: string;
|
|
37
|
+
coordinates: {
|
|
38
|
+
lat: number;
|
|
39
|
+
lng: number;
|
|
40
|
+
};
|
|
41
|
+
timezone: string;
|
|
42
|
+
population: number;
|
|
43
|
+
area: number;
|
|
44
|
+
} | {
|
|
45
|
+
weather: {
|
|
46
|
+
temperature: number;
|
|
47
|
+
condition: string;
|
|
48
|
+
humidity: number;
|
|
49
|
+
};
|
|
50
|
+
city: string;
|
|
51
|
+
country: string;
|
|
52
|
+
province: string;
|
|
53
|
+
coordinates: {
|
|
54
|
+
lat: number;
|
|
55
|
+
lng: number;
|
|
56
|
+
};
|
|
57
|
+
timezone: string;
|
|
58
|
+
population: number;
|
|
59
|
+
area: number;
|
|
60
|
+
}>;
|
|
61
|
+
readonly entityQuery: ({
|
|
62
|
+
description?: string;
|
|
63
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
64
|
+
inputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
65
|
+
onInputStart?: (options: import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
66
|
+
onInputDelta?: (options: {
|
|
67
|
+
inputTextDelta: string;
|
|
68
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
69
|
+
onInputAvailable?: ((options: {
|
|
70
|
+
input: unknown;
|
|
71
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>) | undefined;
|
|
72
|
+
} & {
|
|
73
|
+
execute: import("ai").ToolExecuteFunction<unknown, unknown>;
|
|
74
|
+
outputSchema?: import("@ai-sdk/provider-utils").FlexibleSchema<unknown> | undefined;
|
|
75
|
+
} & {
|
|
76
|
+
toModelOutput?: ((output: unknown) => import("@ai-sdk/provider").LanguageModelV2ToolResultPart["output"]) | undefined;
|
|
77
|
+
} & {
|
|
78
|
+
type: "dynamic";
|
|
79
|
+
} & {
|
|
80
|
+
type: "dynamic";
|
|
81
|
+
}) | ({
|
|
82
|
+
description?: string;
|
|
83
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
84
|
+
inputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
85
|
+
onInputStart?: (options: import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
86
|
+
onInputDelta?: (options: {
|
|
87
|
+
inputTextDelta: string;
|
|
88
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
89
|
+
onInputAvailable?: ((options: {
|
|
90
|
+
input: unknown;
|
|
91
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>) | undefined;
|
|
92
|
+
} & {
|
|
93
|
+
outputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
94
|
+
execute?: never;
|
|
95
|
+
} & {
|
|
96
|
+
toModelOutput?: ((output: unknown) => import("@ai-sdk/provider").LanguageModelV2ToolResultPart["output"]) | undefined;
|
|
97
|
+
} & {
|
|
98
|
+
type: "dynamic";
|
|
99
|
+
} & {
|
|
100
|
+
type: "dynamic";
|
|
101
|
+
});
|
|
102
|
+
readonly recordGetValues: import("ai").Tool<{}, string>;
|
|
103
|
+
readonly recordSetValues: import("ai").Tool<{
|
|
104
|
+
values: Record<string, any>;
|
|
105
|
+
}, string>;
|
|
106
|
+
readonly recordResetForm: import("ai").Tool<{}, string>;
|
|
107
|
+
readonly recordValidateForm: import("ai").Tool<{}, string>;
|
|
108
|
+
readonly recordGetFieldInfo: import("ai").Tool<{
|
|
109
|
+
fieldName?: string | undefined;
|
|
110
|
+
}, string>;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Get all available tools
|
|
114
|
+
*/
|
|
115
|
+
export declare function getAllTools(): {
|
|
116
|
+
readonly getWeather: import("ai").Tool<{
|
|
117
|
+
location: string;
|
|
118
|
+
unit: "celsius" | "fahrenheit";
|
|
119
|
+
}, {
|
|
120
|
+
location: string;
|
|
121
|
+
temperature: number;
|
|
122
|
+
weather: string;
|
|
123
|
+
humidity: number;
|
|
124
|
+
windSpeed: number;
|
|
125
|
+
unit: "celsius" | "fahrenheit";
|
|
126
|
+
lastUpdated: string;
|
|
127
|
+
}>;
|
|
128
|
+
readonly getLocation: import("ai").Tool<{
|
|
129
|
+
city: string;
|
|
130
|
+
includeWeather: boolean;
|
|
131
|
+
}, {
|
|
132
|
+
city: string;
|
|
133
|
+
country: string;
|
|
134
|
+
province: string;
|
|
135
|
+
coordinates: {
|
|
136
|
+
lat: number;
|
|
137
|
+
lng: number;
|
|
138
|
+
};
|
|
139
|
+
timezone: string;
|
|
140
|
+
population: number;
|
|
141
|
+
area: number;
|
|
142
|
+
} | {
|
|
143
|
+
weather: {
|
|
144
|
+
temperature: number;
|
|
145
|
+
condition: string;
|
|
146
|
+
humidity: number;
|
|
147
|
+
};
|
|
148
|
+
city: string;
|
|
149
|
+
country: string;
|
|
150
|
+
province: string;
|
|
151
|
+
coordinates: {
|
|
152
|
+
lat: number;
|
|
153
|
+
lng: number;
|
|
154
|
+
};
|
|
155
|
+
timezone: string;
|
|
156
|
+
population: number;
|
|
157
|
+
area: number;
|
|
158
|
+
}>;
|
|
159
|
+
readonly entityQuery: ({
|
|
160
|
+
description?: string;
|
|
161
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
162
|
+
inputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
163
|
+
onInputStart?: (options: import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
164
|
+
onInputDelta?: (options: {
|
|
165
|
+
inputTextDelta: string;
|
|
166
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
167
|
+
onInputAvailable?: ((options: {
|
|
168
|
+
input: unknown;
|
|
169
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>) | undefined;
|
|
170
|
+
} & {
|
|
171
|
+
execute: import("ai").ToolExecuteFunction<unknown, unknown>;
|
|
172
|
+
outputSchema?: import("@ai-sdk/provider-utils").FlexibleSchema<unknown> | undefined;
|
|
173
|
+
} & {
|
|
174
|
+
toModelOutput?: ((output: unknown) => import("@ai-sdk/provider").LanguageModelV2ToolResultPart["output"]) | undefined;
|
|
175
|
+
} & {
|
|
176
|
+
type: "dynamic";
|
|
177
|
+
} & {
|
|
178
|
+
type: "dynamic";
|
|
179
|
+
}) | ({
|
|
180
|
+
description?: string;
|
|
181
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
182
|
+
inputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
183
|
+
onInputStart?: (options: import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
184
|
+
onInputDelta?: (options: {
|
|
185
|
+
inputTextDelta: string;
|
|
186
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>;
|
|
187
|
+
onInputAvailable?: ((options: {
|
|
188
|
+
input: unknown;
|
|
189
|
+
} & import("ai").ToolCallOptions) => void | PromiseLike<void>) | undefined;
|
|
190
|
+
} & {
|
|
191
|
+
outputSchema: import("@ai-sdk/provider-utils").FlexibleSchema<unknown>;
|
|
192
|
+
execute?: never;
|
|
193
|
+
} & {
|
|
194
|
+
toModelOutput?: ((output: unknown) => import("@ai-sdk/provider").LanguageModelV2ToolResultPart["output"]) | undefined;
|
|
195
|
+
} & {
|
|
196
|
+
type: "dynamic";
|
|
197
|
+
} & {
|
|
198
|
+
type: "dynamic";
|
|
199
|
+
});
|
|
200
|
+
readonly recordGetValues: import("ai").Tool<{}, string>;
|
|
201
|
+
readonly recordSetValues: import("ai").Tool<{
|
|
202
|
+
values: Record<string, any>;
|
|
203
|
+
}, string>;
|
|
204
|
+
readonly recordResetForm: import("ai").Tool<{}, string>;
|
|
205
|
+
readonly recordValidateForm: import("ai").Tool<{}, string>;
|
|
206
|
+
readonly recordGetFieldInfo: import("ai").Tool<{
|
|
207
|
+
fieldName?: string | undefined;
|
|
208
|
+
}, string>;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Get tools list (for API documentation or debugging)
|
|
212
|
+
*/
|
|
213
|
+
export declare function getToolsList(): string[];
|
|
214
|
+
export { weatherTool, locationTool } from './static-tools';
|
|
215
|
+
export { entityQueryTool, toolsIntegration } from './dynamic-tools';
|
|
216
|
+
export { recordGetValuesTool, recordSetValuesTool, recordResetFormTool, recordValidateFormTool, recordGetFieldInfoTool } from './frontend-tools';
|
|
217
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcf,CAAC;AAEX;;GAEG;AACH,wBAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1B;AAED;;GAEG;AACH,wBAAgB,YAAY,aAE3B;AAGD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Collection - Unified export for all available tools
|
|
3
|
+
*
|
|
4
|
+
* Optimized file structure:
|
|
5
|
+
* - static-tools/: Static tools (predefined types)
|
|
6
|
+
* - dynamic-tools/: Dynamic tools (runtime types)
|
|
7
|
+
* - frontend-tools/: Frontend proxy tools
|
|
8
|
+
*/
|
|
9
|
+
// Dynamic tools import
|
|
10
|
+
import { entityQueryTool } from './dynamic-tools';
|
|
11
|
+
// Static tools import
|
|
12
|
+
import { weatherTool, locationTool } from './static-tools';
|
|
13
|
+
// Frontend proxy tools import
|
|
14
|
+
import { recordGetValuesTool, recordSetValuesTool, recordResetFormTool, recordValidateFormTool, recordGetFieldInfoTool } from './frontend-tools';
|
|
15
|
+
/**
|
|
16
|
+
* Default tools collection - Static, dynamic and frontend proxy tools
|
|
17
|
+
*
|
|
18
|
+
* Design features:
|
|
19
|
+
* - Static tools: getWeather, getLocation (basic functionality)
|
|
20
|
+
* - Dynamic tools: entityQuery (data retrieval focused)
|
|
21
|
+
* - Frontend proxy tools: record* operations
|
|
22
|
+
*/
|
|
23
|
+
export const defaultTools = {
|
|
24
|
+
// Static tools
|
|
25
|
+
getWeather: weatherTool,
|
|
26
|
+
getLocation: locationTool,
|
|
27
|
+
// Dynamic tools
|
|
28
|
+
entityQuery: entityQueryTool,
|
|
29
|
+
// Frontend proxy tools - standardized view controller operations
|
|
30
|
+
recordGetValues: recordGetValuesTool,
|
|
31
|
+
recordSetValues: recordSetValuesTool,
|
|
32
|
+
recordResetForm: recordResetFormTool,
|
|
33
|
+
recordValidateForm: recordValidateFormTool,
|
|
34
|
+
recordGetFieldInfo: recordGetFieldInfoTool,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get all available tools
|
|
38
|
+
*/
|
|
39
|
+
export function getAllTools() {
|
|
40
|
+
return defaultTools;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get tools list (for API documentation or debugging)
|
|
44
|
+
*/
|
|
45
|
+
export function getToolsList() {
|
|
46
|
+
return Object.keys(defaultTools);
|
|
47
|
+
}
|
|
48
|
+
// Re-export specific tools (backward compatibility)
|
|
49
|
+
export { weatherTool, locationTool } from './static-tools';
|
|
50
|
+
export { entityQueryTool, toolsIntegration } from './dynamic-tools';
|
|
51
|
+
export { recordGetValuesTool, recordSetValuesTool, recordResetFormTool, recordValidateFormTool, recordGetFieldInfoTool } from './frontend-tools';
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,8BAA8B;AAC9B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe;IACf,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,YAAY;IAEzB,gBAAgB;IAChB,WAAW,EAAE,eAAe;IAE5B,iEAAiE;IACjE,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,kBAAkB,EAAE,sBAAsB;IAC1C,kBAAkB,EAAE,sBAAsB;CAClC,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC;AAED,oDAAoD;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/static-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/static-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Tool - Get city geographic information
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Location tool - get geographic location information for cities
|
|
6
|
+
*/
|
|
7
|
+
export declare const locationTool: import("ai").Tool<{
|
|
8
|
+
city: string;
|
|
9
|
+
includeWeather: boolean;
|
|
10
|
+
}, {
|
|
11
|
+
city: string;
|
|
12
|
+
country: string;
|
|
13
|
+
province: string;
|
|
14
|
+
coordinates: {
|
|
15
|
+
lat: number;
|
|
16
|
+
lng: number;
|
|
17
|
+
};
|
|
18
|
+
timezone: string;
|
|
19
|
+
population: number;
|
|
20
|
+
area: number;
|
|
21
|
+
} | {
|
|
22
|
+
weather: {
|
|
23
|
+
temperature: number;
|
|
24
|
+
condition: string;
|
|
25
|
+
humidity: number;
|
|
26
|
+
};
|
|
27
|
+
city: string;
|
|
28
|
+
country: string;
|
|
29
|
+
province: string;
|
|
30
|
+
coordinates: {
|
|
31
|
+
lat: number;
|
|
32
|
+
lng: number;
|
|
33
|
+
};
|
|
34
|
+
timezone: string;
|
|
35
|
+
population: number;
|
|
36
|
+
area: number;
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=location-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/static-tools/location-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;aAmDyB,MAAM;aAAO,MAAM;;;;;;;;;;;;;;;aAAnB,MAAM;aAAO,MAAM;;;;;EAlBnE,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Tool - Get city geographic information
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { tool } from 'ai';
|
|
6
|
+
/**
|
|
7
|
+
* Location tool - get geographic location information for cities
|
|
8
|
+
*/
|
|
9
|
+
export const locationTool = tool({
|
|
10
|
+
description: 'Display geographic information for a city including coordinates, timezone, and population',
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
city: z.string().describe('城市名称,如:北京、上海、广州'),
|
|
13
|
+
includeWeather: z.boolean().default(false).describe('是否同时包含天气信息')
|
|
14
|
+
}),
|
|
15
|
+
execute: async ({ city, includeWeather }) => {
|
|
16
|
+
// Simulate location API call - return component data directly
|
|
17
|
+
const locationData = {
|
|
18
|
+
city,
|
|
19
|
+
country: '中国',
|
|
20
|
+
province: getProvinceByCity(city),
|
|
21
|
+
coordinates: getCityCoordinates(city),
|
|
22
|
+
timezone: 'Asia/Shanghai',
|
|
23
|
+
population: getCityPopulation(city),
|
|
24
|
+
area: getCityArea(city)
|
|
25
|
+
};
|
|
26
|
+
// 如果需要天气信息,直接扩展数据结构
|
|
27
|
+
if (includeWeather) {
|
|
28
|
+
return {
|
|
29
|
+
...locationData,
|
|
30
|
+
weather: {
|
|
31
|
+
temperature: 22,
|
|
32
|
+
condition: '晴天',
|
|
33
|
+
humidity: 65
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// 直接返回位置数据,不包装在success/data/message中
|
|
38
|
+
return locationData;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// 辅助函数 - 获取城市省份
|
|
42
|
+
function getProvinceByCity(city) {
|
|
43
|
+
const cityProvinceMap = {
|
|
44
|
+
'北京': '北京市',
|
|
45
|
+
'上海': '上海市',
|
|
46
|
+
'深圳': '广东省',
|
|
47
|
+
'广州': '广东省',
|
|
48
|
+
'杭州': '浙江省',
|
|
49
|
+
'成都': '四川省',
|
|
50
|
+
'西安': '陕西省',
|
|
51
|
+
'南京': '江苏省'
|
|
52
|
+
};
|
|
53
|
+
return cityProvinceMap[city] || '未知省份';
|
|
54
|
+
}
|
|
55
|
+
// 辅助函数 - 获取城市坐标
|
|
56
|
+
function getCityCoordinates(city) {
|
|
57
|
+
const coordinatesMap = {
|
|
58
|
+
'北京': { lat: 39.9042, lng: 116.4074 },
|
|
59
|
+
'上海': { lat: 31.2304, lng: 121.4737 },
|
|
60
|
+
'深圳': { lat: 22.3193, lng: 114.1694 },
|
|
61
|
+
'广州': { lat: 23.1291, lng: 113.2644 },
|
|
62
|
+
'杭州': { lat: 30.2741, lng: 120.1551 },
|
|
63
|
+
'成都': { lat: 30.5728, lng: 104.0668 },
|
|
64
|
+
'西安': { lat: 34.3416, lng: 108.9398 },
|
|
65
|
+
'南京': { lat: 32.0603, lng: 118.7969 }
|
|
66
|
+
};
|
|
67
|
+
return coordinatesMap[city] || { lat: 39.9042, lng: 116.4074 };
|
|
68
|
+
}
|
|
69
|
+
// 辅助函数 - 获取城市人口
|
|
70
|
+
function getCityPopulation(city) {
|
|
71
|
+
const populationMap = {
|
|
72
|
+
'北京': 2154,
|
|
73
|
+
'上海': 2424,
|
|
74
|
+
'深圳': 1756,
|
|
75
|
+
'广州': 1868,
|
|
76
|
+
'杭州': 1220,
|
|
77
|
+
'成都': 2094,
|
|
78
|
+
'西安': 1295,
|
|
79
|
+
'南京': 931
|
|
80
|
+
};
|
|
81
|
+
return populationMap[city] || 1000;
|
|
82
|
+
}
|
|
83
|
+
// 辅助函数 - 获取城市面积
|
|
84
|
+
function getCityArea(city) {
|
|
85
|
+
const areaMap = {
|
|
86
|
+
'北京': 16410,
|
|
87
|
+
'上海': 6340,
|
|
88
|
+
'深圳': 1997,
|
|
89
|
+
'广州': 7434,
|
|
90
|
+
'杭州': 16853,
|
|
91
|
+
'成都': 14335,
|
|
92
|
+
'西安': 10108,
|
|
93
|
+
'南京': 6587
|
|
94
|
+
};
|
|
95
|
+
return areaMap[city] || 5000;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=location-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-tool.js","sourceRoot":"","sources":["../../../src/tools/static-tools/location-tool.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weather Tool - Get city weather information
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Weather tool - get weather information for specified city
|
|
6
|
+
*/
|
|
7
|
+
export declare const weatherTool: import("ai").Tool<{
|
|
8
|
+
location: string;
|
|
9
|
+
unit: "celsius" | "fahrenheit";
|
|
10
|
+
}, {
|
|
11
|
+
location: string;
|
|
12
|
+
temperature: number;
|
|
13
|
+
weather: string;
|
|
14
|
+
humidity: number;
|
|
15
|
+
windSpeed: number;
|
|
16
|
+
unit: "celsius" | "fahrenheit";
|
|
17
|
+
lastUpdated: string;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=weather-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/static-tools/weather-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;EAkBtB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weather Tool - Get city weather information
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { tool } from 'ai';
|
|
6
|
+
/**
|
|
7
|
+
* Weather tool - get weather information for specified city
|
|
8
|
+
*/
|
|
9
|
+
export const weatherTool = tool({
|
|
10
|
+
description: 'Display weather information for a city including temperature, conditions, and humidity',
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
location: z.string().describe('城市名称,如:北京、上海、深圳'),
|
|
13
|
+
unit: z.enum(['celsius', 'fahrenheit']).default('celsius').describe('温度单位:摄氏度或华氏度')
|
|
14
|
+
}),
|
|
15
|
+
execute: async ({ location, unit }) =>
|
|
16
|
+
// Simulate weather API call - return component data directly
|
|
17
|
+
({
|
|
18
|
+
location,
|
|
19
|
+
temperature: unit === 'celsius' ? 22 : 72,
|
|
20
|
+
weather: '晴天',
|
|
21
|
+
humidity: 65,
|
|
22
|
+
windSpeed: 12,
|
|
23
|
+
unit,
|
|
24
|
+
lastUpdated: new Date().toISOString()
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=weather-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-tool.js","sourceRoot":"","sources":["../../../src/tools/static-tools/weather-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,wFAAwF;IACrG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAChD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;KACpF,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;IACpC,6DAA6D;IAC5D,CAAC;QACA,QAAQ;QACR,WAAW,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,IAAI;QACJ,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACtC,CAAC;CAEL,CAAC,CAAC"}
|