@lota-sdk/ui 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lota-sdk/ui",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -25,8 +25,8 @@
25
25
  "registry": "https://registry.npmjs.org/"
26
26
  },
27
27
  "dependencies": {
28
- "@lota-sdk/shared": "0.1.15",
29
- "ai": "^6.0.134"
28
+ "@lota-sdk/shared": "0.1.16",
29
+ "ai": "^6.0.137"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@ai-sdk/react": "^3.0.118",
@@ -34,8 +34,8 @@
34
34
  "react": "^19.2.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@ai-sdk/react": "^3.0.136",
38
- "@tanstack/react-query": "^5.91.3",
37
+ "@ai-sdk/react": "^3.0.139",
38
+ "@tanstack/react-query": "^5.95.2",
39
39
  "@types/react": "^19.2.14",
40
40
  "react": "^19.2.4"
41
41
  }
@@ -63,7 +63,7 @@ export async function uploadComposerFiles(params: {
63
63
  throw new Error('Total attachment size exceeds allowed limit.')
64
64
  }
65
65
 
66
- return await Promise.all(
66
+ return Promise.all(
67
67
  uploads.map(async (file) => {
68
68
  const response = await params.uploadFile(file)
69
69
  return {
@@ -74,7 +74,7 @@ export function useSessionMessages<TMessage extends { id: string; metadata?: { c
74
74
  }
75
75
 
76
76
  const response = pageParam ? await fetchOlderPage(sessionId, pageParam) : await fetchLatestPage(sessionId)
77
- return await normalizePage({ response, validateMessages })
77
+ return normalizePage({ response, validateMessages })
78
78
  },
79
79
  getNextPageParam: (lastPage) => (lastPage.hasMore ? lastPage.prevCursor : undefined),
80
80
  initialPageParam: undefined as string | undefined,
@@ -83,6 +83,8 @@ export function useThreadChat<UI_MESSAGE extends UIMessage>({
83
83
  messages: initialMessages,
84
84
  messageMetadataSchema,
85
85
  dataPartSchemas,
86
+ // TODO: Replace with stable `throttle` once AI SDK promotes it from experimental.
87
+ // Tracked at: https://github.com/vercel/ai/issues — currently still `experimental_throttle` in @ai-sdk/react v3.x.
86
88
  experimental_throttle: experimentalThrottle,
87
89
  sendAutomaticallyWhen,
88
90
  onFinish: () => {
@@ -1,23 +1,7 @@
1
- import type { ExecutionPlanToolResultData, SerializablePlanNode } from '@lota-sdk/shared'
1
+ import type { SerializablePlanNode } from '@lota-sdk/shared'
2
+ import { getLatestExecutionPlanResult } from '@lota-sdk/shared'
2
3
 
3
- function isExecutionPlanResult(value: unknown): value is ExecutionPlanToolResultData {
4
- return value !== null && value !== undefined && typeof value === 'object' && 'hasPlan' in value
5
- }
6
-
7
- export function getLatestExecutionPlanResult(output: unknown): ExecutionPlanToolResultData | null {
8
- if (isExecutionPlanResult(output)) {
9
- return output
10
- }
11
-
12
- if (Array.isArray(output)) {
13
- for (let index = output.length - 1; index >= 0; index -= 1) {
14
- const candidate = getLatestExecutionPlanResult(output[index])
15
- if (candidate) return candidate
16
- }
17
- }
18
-
19
- return null
20
- }
4
+ export { getLatestExecutionPlanResult }
21
5
 
22
6
  export function getExecutionPlanActionLabel(action: string, isRunning: boolean): string {
23
7
  if (isRunning) return 'Updating execution run'