lemma-sdk 0.2.2 → 0.2.4
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 +29 -0
- package/dist/auth.d.ts +50 -1
- package/dist/auth.js +219 -3
- package/dist/browser/lemma-client.js +254 -51
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.js +3 -3
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -2
- package/dist/namespaces/agents.d.ts +5 -5
- package/dist/namespaces/assistants.d.ts +36 -41
- package/dist/namespaces/assistants.js +18 -24
- package/dist/namespaces/datastores.d.ts +6 -6
- package/dist/namespaces/desks.d.ts +6 -6
- package/dist/namespaces/files.d.ts +7 -7
- package/dist/namespaces/functions.d.ts +8 -8
- package/dist/namespaces/icons.d.ts +1 -1
- package/dist/namespaces/integrations.d.ts +13 -13
- package/dist/namespaces/organizations.d.ts +8 -8
- package/dist/namespaces/pod-members.d.ts +3 -3
- package/dist/namespaces/pod-surfaces.d.ts +1 -1
- package/dist/namespaces/pods.d.ts +4 -4
- package/dist/namespaces/records.d.ts +7 -7
- package/dist/namespaces/resources.d.ts +9 -5
- package/dist/namespaces/resources.js +3 -2
- package/dist/namespaces/tables.d.ts +7 -7
- package/dist/namespaces/tasks.d.ts +14 -13
- package/dist/namespaces/tasks.js +6 -18
- package/dist/namespaces/users.d.ts +3 -3
- package/dist/namespaces/workflows.d.ts +10 -10
- package/dist/react/useAuth.d.ts +6 -2
- package/dist/react/useAuth.js +1 -1
- package/dist/types.d.ts +8 -9
- package/dist/types.js +5 -1
- package/package.json +1 -1
package/dist/namespaces/tasks.js
CHANGED
|
@@ -8,25 +8,15 @@ export class TasksNamespace {
|
|
|
8
8
|
list(options = {}) {
|
|
9
9
|
return this.http.request("GET", `/pods/${this.podId()}/tasks`, {
|
|
10
10
|
params: {
|
|
11
|
-
agent_name: options.
|
|
12
|
-
agent_id: options.agentId,
|
|
11
|
+
agent_name: options.agent_name,
|
|
13
12
|
limit: options.limit ?? 100,
|
|
14
|
-
page_token: options.
|
|
15
|
-
cursor: options.cursor,
|
|
13
|
+
page_token: options.page_token,
|
|
16
14
|
},
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
create(
|
|
20
|
-
if (!options.agentId && !options.agentName) {
|
|
21
|
-
throw new Error("Either agentId or agentName is required.");
|
|
22
|
-
}
|
|
17
|
+
create(payload) {
|
|
23
18
|
return this.http.request("POST", `/pods/${this.podId()}/tasks`, {
|
|
24
|
-
body:
|
|
25
|
-
agent_id: options.agentId,
|
|
26
|
-
agent_name: options.agentName ?? options.agentId,
|
|
27
|
-
input_data: options.input,
|
|
28
|
-
runtime_account_ids: options.runtimeAccountIds,
|
|
29
|
-
},
|
|
19
|
+
body: payload,
|
|
30
20
|
});
|
|
31
21
|
}
|
|
32
22
|
get(taskId) {
|
|
@@ -47,12 +37,10 @@ export class TasksNamespace {
|
|
|
47
37
|
list: (taskId, options = {}) => this.http.request("GET", `/pods/${this.podId()}/tasks/${taskId}/messages`, {
|
|
48
38
|
params: {
|
|
49
39
|
limit: options.limit ?? 100,
|
|
50
|
-
page_token: options.
|
|
51
|
-
cursor: options.cursor,
|
|
40
|
+
page_token: options.page_token,
|
|
52
41
|
},
|
|
53
42
|
}),
|
|
54
|
-
add: (taskId,
|
|
55
|
-
const payload = { content };
|
|
43
|
+
add: (taskId, payload) => {
|
|
56
44
|
return this.http.request("POST", `/pods/${this.podId()}/tasks/${taskId}/messages`, {
|
|
57
45
|
body: payload,
|
|
58
46
|
});
|
|
@@ -3,7 +3,7 @@ import type { UserProfileRequest } from "../openapi_client/models/UserProfileReq
|
|
|
3
3
|
export declare class UsersNamespace {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: GeneratedClientAdapter);
|
|
6
|
-
current(): Promise<import("../
|
|
7
|
-
getProfile(): Promise<import("../
|
|
8
|
-
upsertProfile(payload: UserProfileRequest): Promise<import("../
|
|
6
|
+
current(): Promise<import("../types.js").UserResponse>;
|
|
7
|
+
getProfile(): Promise<import("../types.js").UserResponse>;
|
|
8
|
+
upsertProfile(payload: UserProfileRequest): Promise<import("../types.js").UserResponse>;
|
|
9
9
|
}
|
|
@@ -13,28 +13,28 @@ export declare class WorkflowsNamespace {
|
|
|
13
13
|
list(options?: {
|
|
14
14
|
limit?: number;
|
|
15
15
|
pageToken?: string;
|
|
16
|
-
}): Promise<import("../
|
|
17
|
-
create(payload: WorkflowCreateRequest): Promise<import("../
|
|
18
|
-
get(workflowName: string): Promise<import("../
|
|
19
|
-
update(workflowName: string, payload: WorkflowUpdateRequest): Promise<import("../
|
|
16
|
+
}): Promise<import("../types.js").WorkflowListResponse>;
|
|
17
|
+
create(payload: WorkflowCreateRequest): Promise<import("../types.js").FlowEntity>;
|
|
18
|
+
get(workflowName: string): Promise<import("../types.js").FlowEntity>;
|
|
19
|
+
update(workflowName: string, payload: WorkflowUpdateRequest): Promise<import("../types.js").FlowEntity>;
|
|
20
20
|
delete(workflowName: string): Promise<void>;
|
|
21
21
|
visualize(workflowName: string): Promise<string>;
|
|
22
22
|
readonly graph: {
|
|
23
|
-
update: (workflowName: string, graph: WorkflowGraphUpdateRequest) => Promise<import("../
|
|
23
|
+
update: (workflowName: string, graph: WorkflowGraphUpdateRequest) => Promise<import("../types.js").FlowEntity>;
|
|
24
24
|
};
|
|
25
25
|
readonly installs: {
|
|
26
|
-
create: (workflowName: string, payload?: WorkflowInstallRequest) => Promise<import("../
|
|
26
|
+
create: (workflowName: string, payload?: WorkflowInstallRequest) => Promise<import("../types.js").FlowInstallEntity>;
|
|
27
27
|
delete: (workflowName: string, installId: string) => Promise<void>;
|
|
28
28
|
};
|
|
29
29
|
private postRunAction;
|
|
30
30
|
readonly runs: {
|
|
31
|
-
start: (workflowName: string, inputs?: WorkflowRunInputs) => Promise<import("../
|
|
31
|
+
start: (workflowName: string, inputs?: WorkflowRunInputs) => Promise<import("../types.js").FlowRunEntity>;
|
|
32
32
|
list: (workflowName: string, options?: {
|
|
33
33
|
limit?: number;
|
|
34
34
|
pageToken?: string;
|
|
35
|
-
}) => Promise<import("../
|
|
36
|
-
get: (runId: string, podId?: string) => Promise<import("../
|
|
37
|
-
resume: (runId: string, inputs?: WorkflowRunInputs, podId?: string) => Promise<import("../
|
|
35
|
+
}) => Promise<import("../types.js").WorkflowRunListResponse>;
|
|
36
|
+
get: (runId: string, podId?: string) => Promise<import("../types.js").FlowRunEntity>;
|
|
37
|
+
resume: (runId: string, inputs?: WorkflowRunInputs, podId?: string) => Promise<import("../types.js").FlowRunEntity>;
|
|
38
38
|
visualize: (runId: string, podId?: string) => Promise<string>;
|
|
39
39
|
cancel: (runId: string, podId?: string) => Promise<Record<string, unknown>>;
|
|
40
40
|
retry: (runId: string, podId?: string) => Promise<Record<string, unknown>>;
|
package/dist/react/useAuth.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { AuthState } from "../auth.js";
|
|
2
|
+
import type { AuthState, BuildAuthUrlOptions } from "../auth.js";
|
|
3
|
+
type RedirectToAuthOptions = Omit<BuildAuthUrlOptions, "redirectUri"> & {
|
|
4
|
+
redirectUri?: string;
|
|
5
|
+
};
|
|
3
6
|
export interface UseAuthResult {
|
|
4
7
|
status: AuthState["status"];
|
|
5
8
|
user: AuthState["user"];
|
|
6
9
|
isLoading: boolean;
|
|
7
10
|
isAuthenticated: boolean;
|
|
8
|
-
redirectToAuth: () => void;
|
|
11
|
+
redirectToAuth: (options?: RedirectToAuthOptions) => void;
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
14
|
* React hook for subscribing to Lemma auth state.
|
|
@@ -14,3 +17,4 @@ export interface UseAuthResult {
|
|
|
14
17
|
* const { isAuthenticated, isLoading, redirectToAuth } = useAuth(client);
|
|
15
18
|
*/
|
|
16
19
|
export declare function useAuth(client: LemmaClient): UseAuthResult;
|
|
20
|
+
export {};
|
package/dist/react/useAuth.js
CHANGED
|
@@ -24,6 +24,6 @@ export function useAuth(client) {
|
|
|
24
24
|
user: state.user,
|
|
25
25
|
isLoading: state.status === "loading",
|
|
26
26
|
isAuthenticated: state.status === "authenticated",
|
|
27
|
-
redirectToAuth: () => client.auth.redirectToAuth(),
|
|
27
|
+
redirectToAuth: (options) => client.auth.redirectToAuth(options),
|
|
28
28
|
};
|
|
29
29
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RecordFilter as GeneratedRecordFilter } from "./openapi_client/models/RecordFilter.js";
|
|
2
2
|
import type { RecordSort as GeneratedRecordSort } from "./openapi_client/models/RecordSort.js";
|
|
3
|
-
import type { AgentResponse, AssistantResponse, AvailableModels, ConversationMessageResponse, ConversationResponse, CreateAgentRequest, CreateAssistantRequest, IconUploadResponse, OrganizationInvitationResponse, OrganizationMemberResponse, OrganizationResponse, PodConfigResponse, PodMemberResponse, PodResponse, TaskMessageResponse, TaskResponse, UpdateAgentRequest, UpdateAssistantRequest, UserResponse } from "./openapi_client/index.js";
|
|
3
|
+
import type { AgentResponse, AssistantResponse, AvailableModels, ConversationMessageResponse, ConversationResponse, CreateAgentRequest, CreateAssistantRequest, CreateTaskRequest, IconUploadResponse, OrganizationInvitationResponse, OrganizationMemberResponse, OrganizationResponse, PodConfigResponse, PodMemberResponse, PodResponse, TaskMessageResponse, TaskResponse, UpdateAgentRequest, UpdateAssistantRequest, UserResponse } from "./openapi_client/index.js";
|
|
4
4
|
/** Public ergonomic types. */
|
|
5
5
|
export interface PageResult<T> {
|
|
6
6
|
items: T[];
|
|
@@ -23,14 +23,8 @@ export interface RunFunctionOptions {
|
|
|
23
23
|
/** Input payload for the function */
|
|
24
24
|
input?: Record<string, unknown>;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
agentId?: string;
|
|
29
|
-
/** Backward-compatible alias supported by older APIs */
|
|
30
|
-
agentName?: string;
|
|
31
|
-
input?: Record<string, unknown>;
|
|
32
|
-
runtimeAccountIds?: string[];
|
|
33
|
-
}
|
|
26
|
+
/** Alias kept for backward compatibility; shape follows generated OpenAPI schema exactly. */
|
|
27
|
+
export type CreateTaskOptions = CreateTaskRequest;
|
|
34
28
|
export interface WorkflowRunInputs {
|
|
35
29
|
[key: string]: unknown;
|
|
36
30
|
}
|
|
@@ -63,3 +57,8 @@ export interface CursorPage<T> {
|
|
|
63
57
|
limit: number;
|
|
64
58
|
next_page_token?: string | null;
|
|
65
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Re-export generated OpenAPI models/enums/services from the same module so this
|
|
62
|
+
* file remains the single public type surface for the SDK.
|
|
63
|
+
*/
|
|
64
|
+
export * from "./openapi_client/index.js";
|
package/dist/types.js
CHANGED