lemma-sdk 0.2.23 → 0.2.25
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/README.md +156 -511
- package/dist/auth.js +0 -1
- package/dist/browser/lemma-client.js +196 -112
- package/dist/namespaces/assistants.d.ts +21 -3
- package/dist/namespaces/assistants.js +13 -7
- package/dist/namespaces/files.d.ts +9 -4
- package/dist/namespaces/files.js +52 -14
- package/dist/namespaces/records.d.ts +10 -2
- package/dist/namespaces/records.js +15 -9
- package/dist/openapi_client/index.d.ts +7 -7
- package/dist/openapi_client/index.js +2 -4
- package/dist/openapi_client/models/ColumnSchema.d.ts +4 -0
- package/dist/openapi_client/models/CreateConversationRequest.d.ts +1 -1
- package/dist/openapi_client/models/CreateFolderRequest.d.ts +1 -2
- package/dist/openapi_client/models/CreateTableRequest.d.ts +1 -1
- package/dist/openapi_client/models/CreateTriggerRequest.d.ts +0 -1
- package/dist/openapi_client/models/DatastoreFileUploadRequest.d.ts +1 -1
- package/dist/openapi_client/models/DatastoreQueryRequest.d.ts +9 -0
- package/dist/openapi_client/models/DatastoreQueryResponse.d.ts +7 -0
- package/dist/openapi_client/models/DirectoryTreeNode.d.ts +7 -0
- package/dist/openapi_client/models/DirectoryTreeResponse.d.ts +6 -0
- package/dist/openapi_client/models/DirectoryTreeResponse.js +1 -0
- package/dist/openapi_client/models/FileResponse.d.ts +4 -6
- package/dist/openapi_client/models/FileSearchRequest.d.ts +5 -3
- package/dist/openapi_client/models/FileSearchResultSchema.d.ts +1 -0
- package/dist/openapi_client/models/FileSearchScopeMode.d.ts +4 -0
- package/dist/openapi_client/models/FileSearchScopeMode.js +9 -0
- package/dist/openapi_client/models/PodCreateRequest.d.ts +0 -4
- package/dist/openapi_client/models/PodMemberDetailResponse.d.ts +14 -0
- package/dist/openapi_client/models/PodMemberDetailResponse.js +1 -0
- package/dist/openapi_client/models/PodMemberResponse.d.ts +3 -3
- package/dist/openapi_client/models/PodResponse.d.ts +0 -5
- package/dist/openapi_client/models/PodUpdateRequest.d.ts +0 -4
- package/dist/openapi_client/models/TableResponse.d.ts +1 -1
- package/dist/openapi_client/models/TriggerResponse.d.ts +0 -1
- package/dist/openapi_client/models/update.d.ts +2 -2
- package/dist/openapi_client/services/ConversationsService.d.ts +3 -2
- package/dist/openapi_client/services/ConversationsService.js +5 -3
- package/dist/openapi_client/services/FilesService.d.ts +34 -25
- package/dist/openapi_client/services/FilesService.js +75 -47
- package/dist/openapi_client/services/PodMembersService.d.ts +14 -4
- package/dist/openapi_client/services/PodMembersService.js +29 -8
- package/dist/openapi_client/services/QueryService.d.ts +14 -0
- package/dist/openapi_client/services/QueryService.js +26 -0
- package/dist/openapi_client/services/RecordsService.d.ts +7 -13
- package/dist/openapi_client/services/RecordsService.js +12 -26
- package/dist/react/components/AssistantEmbedded.d.ts +1 -1
- package/dist/react/components/AssistantEmbedded.js +2 -1
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.js +0 -1
- package/dist/react/useAssistantController.d.ts +5 -1
- package/dist/react/useAssistantController.js +7 -3
- package/dist/react/useAssistantSession.d.ts +12 -0
- package/dist/react/useAssistantSession.js +24 -5
- package/dist/react/useTaskSession.js +145 -73
- package/dist/task-events.d.ts +2 -1
- package/dist/task-events.js +38 -1
- package/dist/types.d.ts +10 -4
- package/package.json +1 -1
- package/dist/openapi_client/models/PodStatus.d.ts +0 -4
- package/dist/openapi_client/models/PodStatus.js +0 -9
- package/dist/openapi_client/models/PodType.d.ts +0 -6
- package/dist/openapi_client/models/PodType.js +0 -11
- package/dist/openapi_client/models/RecordFilter.d.ts +0 -15
- package/dist/openapi_client/models/RecordFilterOperator.d.ts +0 -10
- package/dist/openapi_client/models/RecordFilterOperator.js +0 -15
- package/dist/openapi_client/models/RecordQueryRequest.d.ts +0 -20
- package/dist/openapi_client/models/RecordSort.d.ts +0 -11
- package/dist/openapi_client/models/RecordSortDirection.d.ts +0 -4
- package/dist/openapi_client/models/RecordSortDirection.js +0 -9
- package/dist/react/useAgentRun.d.ts +0 -17
- package/dist/react/useAgentRun.js +0 -66
- /package/dist/openapi_client/models/{RecordFilter.js → DatastoreQueryRequest.js} +0 -0
- /package/dist/openapi_client/models/{RecordQueryRequest.js → DatastoreQueryResponse.js} +0 -0
- /package/dist/openapi_client/models/{RecordSort.js → DirectoryTreeNode.js} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RecordFilter } from './RecordFilter.js';
|
|
2
|
-
import type { RecordSort } from './RecordSort.js';
|
|
3
|
-
/**
|
|
4
|
-
* Structured query contract for listing table records.
|
|
5
|
-
*/
|
|
6
|
-
export type RecordQueryRequest = {
|
|
7
|
-
/**
|
|
8
|
-
* Structured filter conditions combined with AND semantics. Example: `[{"field": "status", "op": "eq", "value": "OPEN"}]`.
|
|
9
|
-
*/
|
|
10
|
-
filters?: Array<RecordFilter>;
|
|
11
|
-
limit?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Opaque token from a previous response page.
|
|
14
|
-
*/
|
|
15
|
-
page_token?: (string | null);
|
|
16
|
-
/**
|
|
17
|
-
* Ordered sort clauses. Example: `[{"field": "created_at", "direction": "desc"}]`.
|
|
18
|
-
*/
|
|
19
|
-
sort?: Array<RecordSort>;
|
|
20
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
-
/* istanbul ignore file */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
export var RecordSortDirection;
|
|
6
|
-
(function (RecordSortDirection) {
|
|
7
|
-
RecordSortDirection["ASC"] = "asc";
|
|
8
|
-
RecordSortDirection["DESC"] = "desc";
|
|
9
|
-
})(RecordSortDirection || (RecordSortDirection = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import { type SseRawEvent } from "../streams.js";
|
|
3
|
-
export interface UseAgentRunStreamOptions {
|
|
4
|
-
client: LemmaClient;
|
|
5
|
-
podId?: string;
|
|
6
|
-
taskId?: string | null;
|
|
7
|
-
autoConnect?: boolean;
|
|
8
|
-
onEvent?: (event: SseRawEvent, payload: unknown | null) => void;
|
|
9
|
-
onError?: (error: unknown) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface UseAgentRunStreamResult {
|
|
12
|
-
isStreaming: boolean;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
connect: () => Promise<void>;
|
|
15
|
-
disconnect: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare function useAgentRunStream({ client, podId, taskId, autoConnect, onEvent, onError, }: UseAgentRunStreamOptions): UseAgentRunStreamResult;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { parseSSEJson, readSSE } from "../streams.js";
|
|
3
|
-
function resolvePodId(client, podId) {
|
|
4
|
-
const resolved = podId ?? client.podId;
|
|
5
|
-
if (!resolved) {
|
|
6
|
-
throw new Error("podId is required. Pass podId or set it on LemmaClient.");
|
|
7
|
-
}
|
|
8
|
-
return resolved;
|
|
9
|
-
}
|
|
10
|
-
export function useAgentRunStream({ client, podId, taskId, autoConnect = true, onEvent, onError, }) {
|
|
11
|
-
const [isStreaming, setIsStreaming] = useState(false);
|
|
12
|
-
const [error, setError] = useState(null);
|
|
13
|
-
const abortRef = useRef(null);
|
|
14
|
-
const disconnect = useCallback(() => {
|
|
15
|
-
abortRef.current?.abort();
|
|
16
|
-
abortRef.current = null;
|
|
17
|
-
}, []);
|
|
18
|
-
const connect = useCallback(async () => {
|
|
19
|
-
if (!taskId) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
disconnect();
|
|
23
|
-
const controller = new AbortController();
|
|
24
|
-
abortRef.current = controller;
|
|
25
|
-
setError(null);
|
|
26
|
-
setIsStreaming(true);
|
|
27
|
-
try {
|
|
28
|
-
client.setPodId(resolvePodId(client, podId));
|
|
29
|
-
const stream = await client.tasks.stream(taskId, { signal: controller.signal });
|
|
30
|
-
for await (const event of readSSE(stream)) {
|
|
31
|
-
if (controller.signal.aborted) {
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
onEvent?.(event, parseSSEJson(event));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch (streamError) {
|
|
38
|
-
if (!(streamError instanceof Error && streamError.name === "AbortError")) {
|
|
39
|
-
const normalized = streamError instanceof Error
|
|
40
|
-
? streamError
|
|
41
|
-
: new Error("Failed to stream agent run.");
|
|
42
|
-
setError(normalized);
|
|
43
|
-
onError?.(streamError);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
if (abortRef.current === controller) {
|
|
48
|
-
abortRef.current = null;
|
|
49
|
-
}
|
|
50
|
-
setIsStreaming(false);
|
|
51
|
-
}
|
|
52
|
-
}, [client, disconnect, onError, onEvent, podId, taskId]);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (!autoConnect || !taskId) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
void connect();
|
|
58
|
-
return () => disconnect();
|
|
59
|
-
}, [autoConnect, connect, disconnect, taskId]);
|
|
60
|
-
return {
|
|
61
|
-
isStreaming,
|
|
62
|
-
error,
|
|
63
|
-
connect,
|
|
64
|
-
disconnect,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|