lemma-sdk 0.2.45 → 0.3.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/README.md +16 -0
- package/dist/assistant-events.js +12 -2
- package/dist/browser/lemma-client.js +13683 -4460
- package/dist/browser.d.ts +14 -6
- package/dist/browser.js +35 -6
- package/dist/client.d.ts +4 -0
- package/dist/client.js +16 -4
- package/dist/config.d.ts +4 -0
- package/dist/config.js +7 -1
- package/dist/generated.d.ts +14 -1
- package/dist/generated.js +62 -11
- package/dist/http.d.ts +47 -1
- package/dist/http.js +145 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/namespaces/agents.d.ts +20 -1
- package/dist/namespaces/agents.js +29 -1
- package/dist/namespaces/conversations.d.ts +5 -2
- package/dist/namespaces/conversations.js +2 -0
- package/dist/namespaces/desks.d.ts +9 -0
- package/dist/namespaces/desks.js +6 -0
- package/dist/namespaces/files.d.ts +18 -0
- package/dist/namespaces/files.js +21 -0
- package/dist/namespaces/functions.d.ts +3 -0
- package/dist/namespaces/functions.js +5 -0
- package/dist/namespaces/integrations.d.ts +2 -4
- package/dist/namespaces/integrations.js +2 -2
- package/dist/namespaces/records.d.ts +3 -9
- package/dist/namespaces/records.js +4 -33
- package/dist/namespaces/widgets.d.ts +17 -0
- package/dist/namespaces/widgets.js +16 -0
- package/dist/openapi_client/core/OpenAPI.js +1 -1
- package/dist/openapi_client/index.d.ts +7 -5
- package/dist/openapi_client/index.js +3 -0
- package/dist/openapi_client/models/AgentRunStatus.d.ts +10 -0
- package/dist/openapi_client/models/AgentRunStatus.js +15 -0
- package/dist/openapi_client/models/AgentToolset.d.ts +3 -2
- package/dist/openapi_client/models/AgentToolset.js +2 -1
- package/dist/openapi_client/models/AppTriggerResponseSchema.d.ts +2 -0
- package/dist/openapi_client/models/ApprovalDecisionResponse.d.ts +6 -0
- package/dist/openapi_client/models/AuthProvider.d.ts +4 -0
- package/dist/openapi_client/models/AuthProvider.js +9 -0
- package/dist/openapi_client/models/ConversationResponse.d.ts +4 -0
- package/dist/openapi_client/models/ConversationType.d.ts +2 -1
- package/dist/openapi_client/models/ConversationType.js +1 -0
- package/dist/openapi_client/models/DatastoreQueryRequest.d.ts +1 -1
- package/dist/openapi_client/models/FileSearchResultSchema.d.ts +2 -0
- package/dist/openapi_client/models/FileSignedUrlRequest.d.ts +4 -0
- package/dist/openapi_client/models/FileSignedUrlResponse.d.ts +6 -0
- package/dist/openapi_client/models/FileUrlResponse.d.ts +6 -0
- package/dist/openapi_client/models/FlowRunStatus.d.ts +3 -2
- package/dist/openapi_client/models/FlowRunStatus.js +3 -2
- package/dist/openapi_client/models/MessageKind.d.ts +14 -0
- package/dist/openapi_client/models/MessageKind.js +19 -0
- package/dist/openapi_client/models/MessageResponse.d.ts +5 -6
- package/dist/openapi_client/models/WorkflowRunResponse.d.ts +2 -2
- package/dist/openapi_client/services/AgentConversationsService.d.ts +8 -7
- package/dist/openapi_client/services/AgentConversationsService.js +7 -5
- package/dist/openapi_client/services/ApplicationsService.d.ts +19 -19
- package/dist/openapi_client/services/ApplicationsService.js +48 -44
- package/dist/openapi_client/services/FilesService.d.ts +20 -0
- package/dist/openapi_client/services/FilesService.js +47 -0
- package/dist/openapi_client/services/QueryService.d.ts +1 -1
- package/dist/openapi_client/services/QueryService.js +1 -1
- package/dist/openapi_client/services/RecordsService.d.ts +1 -3
- package/dist/openapi_client/services/RecordsService.js +1 -5
- package/dist/react/assistant-output.d.ts +6 -0
- package/dist/react/assistant-output.js +16 -0
- package/dist/react/useAssistantController.d.ts +8 -1
- package/dist/react/useAssistantController.js +87 -250
- package/dist/react/useAssistantRuntime.js +6 -17
- package/dist/react/useAssistantSession.d.ts +4 -2
- package/dist/react/useAssistantSession.js +6 -7
- package/dist/react/useConversationMessages.d.ts +2 -2
- package/dist/react/useConversationMessages.js +3 -5
- package/dist/react/useRecords.d.ts +1 -1
- package/dist/react/useRecords.js +2 -13
- package/dist/react/useReferencingRecords.d.ts +4 -6
- package/dist/react/useReferencingRecords.js +5 -5
- package/dist/react/useReverseRelatedRecords.d.ts +3 -4
- package/dist/react/useReverseRelatedRecords.js +5 -5
- package/dist/run-utils.d.ts +24 -0
- package/dist/run-utils.js +54 -0
- package/dist/types.d.ts +12 -6
- package/dist/version.d.ts +5 -0
- package/dist/version.js +7 -0
- package/package.json +10 -5
- package/dist/hey_client/client/client.gen.d.ts +0 -2
- package/dist/hey_client/client/client.gen.js +0 -216
- package/dist/hey_client/client/index.d.ts +0 -10
- package/dist/hey_client/client/index.js +0 -6
- package/dist/hey_client/client/types.gen.d.ts +0 -120
- package/dist/hey_client/client/types.gen.js +0 -2
- package/dist/hey_client/client/utils.gen.d.ts +0 -37
- package/dist/hey_client/client/utils.gen.js +0 -228
- package/dist/hey_client/client.gen.d.ts +0 -12
- package/dist/hey_client/client.gen.js +0 -3
- package/dist/hey_client/core/auth.gen.d.ts +0 -25
- package/dist/hey_client/core/auth.gen.js +0 -14
- package/dist/hey_client/core/bodySerializer.gen.d.ts +0 -25
- package/dist/hey_client/core/bodySerializer.gen.js +0 -57
- package/dist/hey_client/core/params.gen.d.ts +0 -43
- package/dist/hey_client/core/params.gen.js +0 -100
- package/dist/hey_client/core/pathSerializer.gen.d.ts +0 -33
- package/dist/hey_client/core/pathSerializer.gen.js +0 -106
- package/dist/hey_client/core/queryKeySerializer.gen.d.ts +0 -18
- package/dist/hey_client/core/queryKeySerializer.gen.js +0 -92
- package/dist/hey_client/core/serverSentEvents.gen.d.ts +0 -71
- package/dist/hey_client/core/serverSentEvents.gen.js +0 -132
- package/dist/hey_client/core/types.gen.d.ts +0 -83
- package/dist/hey_client/core/types.gen.js +0 -2
- package/dist/hey_client/core/utils.gen.d.ts +0 -19
- package/dist/hey_client/core/utils.gen.js +0 -87
- package/dist/hey_client/index.d.ts +0 -2
- package/dist/hey_client/index.js +0 -2
- package/dist/hey_client/sdk.gen.d.ts +0 -1005
- package/dist/hey_client/sdk.gen.js +0 -1438
- package/dist/hey_client/types.gen.d.ts +0 -13004
- package/dist/hey_client/types.gen.js +0 -2
- package/dist/openapi_client/models/NotificationContent.d.ts +0 -4
- package/dist/openapi_client/models/TextContent.d.ts +0 -4
- package/dist/openapi_client/models/ThinkingContent.d.ts +0 -4
- package/dist/openapi_client/models/ToolCallContent.d.ts +0 -6
- package/dist/openapi_client/models/ToolReturnContent.d.ts +0 -6
- package/dist/openapi_client/models/ToolReturnContent.js +0 -1
- /package/dist/openapi_client/models/{NotificationContent.js → ApprovalDecisionResponse.js} +0 -0
- /package/dist/openapi_client/models/{TextContent.js → FileSignedUrlRequest.js} +0 -0
- /package/dist/openapi_client/models/{ThinkingContent.js → FileSignedUrlResponse.js} +0 -0
- /package/dist/openapi_client/models/{ToolCallContent.js → FileUrlResponse.js} +0 -0
|
@@ -2,13 +2,41 @@ import { AgentsService } from "../openapi_client/services/AgentsService.js";
|
|
|
2
2
|
export class AgentsNamespace {
|
|
3
3
|
client;
|
|
4
4
|
podId;
|
|
5
|
-
|
|
5
|
+
conversations;
|
|
6
|
+
constructor(client, podId,
|
|
7
|
+
// Lazy accessor — conversations is constructed alongside agents on the client.
|
|
8
|
+
conversations) {
|
|
6
9
|
this.client = client;
|
|
7
10
|
this.podId = podId;
|
|
11
|
+
this.conversations = conversations;
|
|
8
12
|
}
|
|
9
13
|
list(options = {}) {
|
|
10
14
|
return this.client.request(() => AgentsService.agentList(this.podId(), options.pageToken, options.limit ?? 100));
|
|
11
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Run an agent on a single message (the `.run` verb, alongside
|
|
18
|
+
* `functions.run` / `datastore.query`). Note the return contract differs:
|
|
19
|
+
* those return the result directly, whereas an agent reply is asynchronous —
|
|
20
|
+
* this opens a fresh conversation, sends `message`, and returns the created
|
|
21
|
+
* conversation (read the reply via `client.conversations.messages.list(conv.id)`).
|
|
22
|
+
* With `stream: true` it returns the SSE stream so you can consume tokens as
|
|
23
|
+
* they arrive.
|
|
24
|
+
*/
|
|
25
|
+
async run(agentName, message, options = {}) {
|
|
26
|
+
if (!this.conversations) {
|
|
27
|
+
throw new Error("agents.run requires the conversations namespace — call it via client.agents.run().");
|
|
28
|
+
}
|
|
29
|
+
const conversations = this.conversations();
|
|
30
|
+
const conversation = await conversations.createForAgent(agentName, {
|
|
31
|
+
title: options.title,
|
|
32
|
+
metadata: options.metadata,
|
|
33
|
+
});
|
|
34
|
+
if (options.stream) {
|
|
35
|
+
return conversations.sendMessageStream(conversation.id, { content: message }, { signal: options.signal });
|
|
36
|
+
}
|
|
37
|
+
await conversations.messages.send(conversation.id, { content: message });
|
|
38
|
+
return conversation;
|
|
39
|
+
}
|
|
12
40
|
create(payload) {
|
|
13
41
|
return this.client.request(() => AgentsService.agentCreate(this.podId(), payload));
|
|
14
42
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { ApprovalDecisionResponse } from "../openapi_client/models/ApprovalDecisionResponse.js";
|
|
2
3
|
import type { AgentRuntimeConfig } from "../openapi_client/models/AgentRuntimeConfig.js";
|
|
3
4
|
import type { ConversationListResponse } from "../openapi_client/models/ConversationListResponse.js";
|
|
5
|
+
import type { ConversationType } from "../openapi_client/models/ConversationType.js";
|
|
4
6
|
import type { CreateConversationRequest } from "../openapi_client/models/CreateConversationRequest.js";
|
|
5
7
|
import type { HarnessKind } from "../openapi_client/models/HarnessKind.js";
|
|
6
|
-
import type { MessageResponse } from "../openapi_client/models/MessageResponse.js";
|
|
7
8
|
import type { ResolveUserApprovalRequest } from "../openapi_client/models/ResolveUserApprovalRequest.js";
|
|
8
9
|
import type { SendMessageRequest } from "../openapi_client/models/SendMessageRequest.js";
|
|
9
10
|
import type { UpdateConversationRequest } from "../openapi_client/models/UpdateConversationRequest.js";
|
|
@@ -44,6 +45,8 @@ export declare class ConversationsNamespace {
|
|
|
44
45
|
list(options?: {
|
|
45
46
|
agent_name?: string | null;
|
|
46
47
|
pod_id?: string | null;
|
|
48
|
+
parent_id?: string | null;
|
|
49
|
+
type?: ConversationType | null;
|
|
47
50
|
limit?: number;
|
|
48
51
|
page_token?: string | null;
|
|
49
52
|
}): Promise<ConversationListResponse>;
|
|
@@ -96,7 +99,7 @@ export declare class ConversationsNamespace {
|
|
|
96
99
|
}) => Promise<UserApprovalListResponse>;
|
|
97
100
|
resolve: (conversationId: string, approvalId: string, payload: ResolveUserApprovalInput, options?: {
|
|
98
101
|
pod_id?: string | null;
|
|
99
|
-
}) => Promise<
|
|
102
|
+
}) => Promise<ApprovalDecisionResponse>;
|
|
100
103
|
};
|
|
101
104
|
}
|
|
102
105
|
export {};
|
|
@@ -107,6 +107,8 @@ export class ConversationsNamespace {
|
|
|
107
107
|
return this.http.request("GET", `/pods/${podId}/conversations`, {
|
|
108
108
|
params: {
|
|
109
109
|
agent_name: options.agent_name,
|
|
110
|
+
parent_id: options.parent_id,
|
|
111
|
+
type: options.type,
|
|
110
112
|
limit: options.limit ?? 20,
|
|
111
113
|
page_token: options.page_token,
|
|
112
114
|
},
|
|
@@ -16,6 +16,15 @@ export declare class DesksNamespace {
|
|
|
16
16
|
get(name: string): Promise<import("../types.js").DeskDetailResponse>;
|
|
17
17
|
update(name: string, payload: UpdateDeskRequest): Promise<import("../types.js").DeskDetailResponse>;
|
|
18
18
|
delete(name: string): Promise<import("../types.js").DeskMessageResponse>;
|
|
19
|
+
/** Promote a conversation widget into a persisted desk (save as desk). */
|
|
20
|
+
createFromWidget(payload: {
|
|
21
|
+
conversation_id: string;
|
|
22
|
+
tool_call_id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
public_slug?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
visibility?: string;
|
|
27
|
+
}): Promise<unknown>;
|
|
19
28
|
readonly assets: {
|
|
20
29
|
get: (name: string, path?: string) => Promise<string>;
|
|
21
30
|
};
|
package/dist/namespaces/desks.js
CHANGED
|
@@ -23,6 +23,12 @@ export class DesksNamespace {
|
|
|
23
23
|
delete(name) {
|
|
24
24
|
return this.client.request(() => DesksService.deskDelete(this.podId(), name));
|
|
25
25
|
}
|
|
26
|
+
/** Promote a conversation widget into a persisted desk (save as desk). */
|
|
27
|
+
createFromWidget(payload) {
|
|
28
|
+
return this.http.request("POST", `/pods/${this.podId()}/desks/from-widget`, {
|
|
29
|
+
body: payload,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
26
32
|
assets = {
|
|
27
33
|
get: (name, path) => this.http.request("GET", `/pods/${this.podId()}/desks/${name}/assets${path ? `/${path.replace(/^\/+/, "")}` : ""}`),
|
|
28
34
|
};
|
|
@@ -3,6 +3,8 @@ import type { HttpClient } from "../http.js";
|
|
|
3
3
|
import type { ConvertedFileResponse } from "../openapi_client/models/ConvertedFileResponse.js";
|
|
4
4
|
import type { DirectoryTreeResponse } from "../openapi_client/models/DirectoryTreeResponse.js";
|
|
5
5
|
import { FileSearchScopeMode } from "../openapi_client/models/FileSearchScopeMode.js";
|
|
6
|
+
import type { FileSignedUrlResponse } from "../openapi_client/models/FileSignedUrlResponse.js";
|
|
7
|
+
import type { FileUrlResponse } from "../openapi_client/models/FileUrlResponse.js";
|
|
6
8
|
import { SearchMethod } from "../openapi_client/models/SearchMethod.js";
|
|
7
9
|
type SearchMethodInput = SearchMethod | `${SearchMethod}`;
|
|
8
10
|
type FileSearchScopeModeInput = FileSearchScopeMode | `${FileSearchScopeMode}`;
|
|
@@ -18,6 +20,22 @@ export declare class FilesNamespace {
|
|
|
18
20
|
parentId?: string;
|
|
19
21
|
}): Promise<import("../types.js").FileListResponse>;
|
|
20
22
|
get(path: string): Promise<import("../types.js").FileDetailResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* URLs for a file: a short-lived download `url` plus a permanent
|
|
25
|
+
* authenticated `app_url` deep-link that opens the file in the Lemma
|
|
26
|
+
* frontend (the viewer must be a signed-in pod member).
|
|
27
|
+
*/
|
|
28
|
+
getUrl(path: string): Promise<FileUrlResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Mint a public, hit-capped short signed URL (no login needed to open).
|
|
31
|
+
* Expires after `expiresSeconds` (default 3h, max 24h) and serves the file
|
|
32
|
+
* at most `maxHits` times (default 50, max 100); both bounds are clamped
|
|
33
|
+
* server-side. Use it to share a file outside the pod without unbounded egress.
|
|
34
|
+
*/
|
|
35
|
+
createSignedUrl(path: string, options?: {
|
|
36
|
+
expiresSeconds?: number;
|
|
37
|
+
maxHits?: number;
|
|
38
|
+
}): Promise<FileSignedUrlResponse>;
|
|
21
39
|
delete(path: string): Promise<void>;
|
|
22
40
|
search(query: string, options?: {
|
|
23
41
|
limit?: number;
|
package/dist/namespaces/files.js
CHANGED
|
@@ -45,6 +45,27 @@ export class FilesNamespace {
|
|
|
45
45
|
get(path) {
|
|
46
46
|
return this.client.request(() => FilesService.fileGet(this.podId(), path));
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* URLs for a file: a short-lived download `url` plus a permanent
|
|
50
|
+
* authenticated `app_url` deep-link that opens the file in the Lemma
|
|
51
|
+
* frontend (the viewer must be a signed-in pod member).
|
|
52
|
+
*/
|
|
53
|
+
getUrl(path) {
|
|
54
|
+
return this.client.request(() => FilesService.fileUrl(this.podId(), path));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Mint a public, hit-capped short signed URL (no login needed to open).
|
|
58
|
+
* Expires after `expiresSeconds` (default 3h, max 24h) and serves the file
|
|
59
|
+
* at most `maxHits` times (default 50, max 100); both bounds are clamped
|
|
60
|
+
* server-side. Use it to share a file outside the pod without unbounded egress.
|
|
61
|
+
*/
|
|
62
|
+
createSignedUrl(path, options = {}) {
|
|
63
|
+
const body = {
|
|
64
|
+
expires_seconds: options.expiresSeconds,
|
|
65
|
+
max_hits: options.maxHits,
|
|
66
|
+
};
|
|
67
|
+
return this.client.request(() => FilesService.fileSignedUrl(this.podId(), path, body));
|
|
68
|
+
}
|
|
48
69
|
delete(path) {
|
|
49
70
|
return this.client.request(() => FilesService.fileDelete(this.podId(), path));
|
|
50
71
|
}
|
|
@@ -15,6 +15,9 @@ export declare class FunctionsNamespace {
|
|
|
15
15
|
get(name: string): Promise<import("../types.js").FunctionDetailResponse>;
|
|
16
16
|
update(name: string, payload: UpdateFunctionRequest): Promise<import("../types.js").FunctionActionResponse>;
|
|
17
17
|
delete(name: string): Promise<import("../types.js").FunctionMessageResponse>;
|
|
18
|
+
/** Run a function — convenience alias for `functions.runs.create`, matching the
|
|
19
|
+
* Python SDK's `functions.run(name, input)` and the unified `.run` verb. */
|
|
20
|
+
run(name: string, options?: RunFunctionOptions): Promise<import("../types.js").FunctionRunResponse>;
|
|
18
21
|
readonly permissions: {
|
|
19
22
|
get: (name: string) => Promise<import("../types.js").FunctionPermissionsResponse>;
|
|
20
23
|
replace: (name: string, payload: FunctionPermissionsReplaceRequest) => Promise<import("../types.js").FunctionPermissionsResponse>;
|
|
@@ -21,6 +21,11 @@ export class FunctionsNamespace {
|
|
|
21
21
|
delete(name) {
|
|
22
22
|
return this.client.request(() => FunctionsService.functionDelete(this.podId(), name));
|
|
23
23
|
}
|
|
24
|
+
/** Run a function — convenience alias for `functions.runs.create`, matching the
|
|
25
|
+
* Python SDK's `functions.run(name, input)` and the unified `.run` verb. */
|
|
26
|
+
run(name, options = {}) {
|
|
27
|
+
return this.runs.create(name, options);
|
|
28
|
+
}
|
|
24
29
|
permissions = {
|
|
25
30
|
get: (name) => this.client.request(() => FunctionsService.functionPermissionsGet(this.podId(), name)),
|
|
26
31
|
replace: (name, payload) => this.client.request(() => FunctionsService.functionPermissionsReplace(this.podId(), name, payload)),
|
|
@@ -44,13 +44,11 @@ export declare class IntegrationsNamespace {
|
|
|
44
44
|
};
|
|
45
45
|
helperAgent(goal: string, appNames: string[]): Promise<import("../types.js").IntegrationHelperAgentResponse>;
|
|
46
46
|
readonly triggers: {
|
|
47
|
-
list: (options?: {
|
|
48
|
-
applicationId?: string;
|
|
47
|
+
list: (scope: OperationScope, options?: {
|
|
49
48
|
search?: string;
|
|
50
49
|
limit?: number;
|
|
51
|
-
pageToken?: string;
|
|
52
50
|
}) => Promise<import("../types.js").AppTriggerListResponseSchema>;
|
|
53
|
-
get: (
|
|
51
|
+
get: (scope: OperationScope, triggerName: string) => Promise<import("../types.js").AppTriggerResponseSchema>;
|
|
54
52
|
};
|
|
55
53
|
readonly accounts: {
|
|
56
54
|
list: (organizationId: string, options?: {
|
|
@@ -41,8 +41,8 @@ export class IntegrationsNamespace {
|
|
|
41
41
|
return this.client.request(() => AgentToolsService.agentToolIntegrationHelperAgent(body));
|
|
42
42
|
}
|
|
43
43
|
triggers = {
|
|
44
|
-
list: (options = {}) => this.client.request(() => ApplicationsService.applicationTriggerList(
|
|
45
|
-
get: (
|
|
44
|
+
list: (scope, options = {}) => this.client.request(() => ApplicationsService.applicationTriggerList(scope.organizationId, scope.authConfigName, options.search, options.limit ?? 100)),
|
|
45
|
+
get: (scope, triggerName) => this.client.request(() => ApplicationsService.applicationTriggerGet(scope.organizationId, scope.authConfigName, triggerName)),
|
|
46
46
|
};
|
|
47
47
|
accounts = {
|
|
48
48
|
list: (organizationId, options = {}) => this.client.request(() => IntegrationsService.integrationAccountList(organizationId, options.applicationId, options.limit ?? 100, options.pageToken)),
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
-
import type { HttpClient } from "../http.js";
|
|
3
|
-
import type { RecordListResponse } from "../openapi_client/models/RecordListResponse.js";
|
|
4
2
|
import type { ListRecordsOptions, RecordFilter, RecordSort } from "../types.js";
|
|
5
3
|
export interface RecordQueryRequest {
|
|
6
4
|
filters?: RecordFilter[];
|
|
@@ -8,21 +6,17 @@ export interface RecordQueryRequest {
|
|
|
8
6
|
limit?: number;
|
|
9
7
|
page_token?: string;
|
|
10
8
|
offset?: number;
|
|
11
|
-
sort_by?: string;
|
|
12
|
-
order?: "asc" | "desc" | string;
|
|
13
9
|
}
|
|
14
10
|
export declare class RecordsNamespace {
|
|
15
11
|
private readonly client;
|
|
16
|
-
private readonly http;
|
|
17
12
|
private readonly podId;
|
|
18
|
-
constructor(client: GeneratedClientAdapter,
|
|
19
|
-
list(table: string, options?: ListRecordsOptions): Promise<RecordListResponse>;
|
|
20
|
-
listWithParams(table: string, params: Record<string, string | number | boolean | undefined | null>): Promise<RecordListResponse>;
|
|
13
|
+
constructor(client: GeneratedClientAdapter, podId: () => string);
|
|
14
|
+
list(table: string, options?: ListRecordsOptions): Promise<import("../types.js").RecordListResponse>;
|
|
21
15
|
create(table: string, data: Record<string, unknown>): Promise<Record<string, any>>;
|
|
22
16
|
get(table: string, recordId: string): Promise<Record<string, any>>;
|
|
23
17
|
update(table: string, recordId: string, data: Record<string, unknown>): Promise<Record<string, any>>;
|
|
24
18
|
delete(table: string, recordId: string): Promise<void>;
|
|
25
|
-
query(table: string, payload: RecordQueryRequest): Promise<RecordListResponse>;
|
|
19
|
+
query(table: string, payload: RecordQueryRequest): Promise<import("../types.js").RecordListResponse>;
|
|
26
20
|
readonly bulk: {
|
|
27
21
|
create: (table: string, records: Record<string, unknown>[]) => Promise<import("../types.js").DatastoreCountResponse>;
|
|
28
22
|
update: (table: string, records: Record<string, unknown>[]) => Promise<import("../types.js").DatastoreCountResponse>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { RecordsService } from "../openapi_client/services/RecordsService.js";
|
|
2
|
-
function getRecordsPath(podId, table) {
|
|
3
|
-
return `/pods/${encodeURIComponent(podId)}/datastore/tables/${encodeURIComponent(table)}/records`;
|
|
4
|
-
}
|
|
5
2
|
function serializeFilters(filters) {
|
|
6
3
|
if (!filters || filters.length === 0) {
|
|
7
4
|
return undefined;
|
|
@@ -16,40 +13,14 @@ function serializeSort(sort) {
|
|
|
16
13
|
}
|
|
17
14
|
export class RecordsNamespace {
|
|
18
15
|
client;
|
|
19
|
-
http;
|
|
20
16
|
podId;
|
|
21
|
-
constructor(client,
|
|
17
|
+
constructor(client, podId) {
|
|
22
18
|
this.client = client;
|
|
23
|
-
this.http = http;
|
|
24
19
|
this.podId = podId;
|
|
25
20
|
}
|
|
26
21
|
list(table, options = {}) {
|
|
27
|
-
const { filters, sort, limit, pageToken, offset
|
|
28
|
-
|
|
29
|
-
return this.client.request(() => RecordsService.recordList(this.podId(), table, limit ?? 20, offset, sortBy ?? undefined, order ?? "asc", serializeFilters(filters), serializeSort(sort), pageToken));
|
|
30
|
-
}
|
|
31
|
-
const hasCustomParams = typeof offset === "number" ||
|
|
32
|
-
typeof sortBy === "string" ||
|
|
33
|
-
typeof order === "string" ||
|
|
34
|
-
!!params;
|
|
35
|
-
if (hasCustomParams) {
|
|
36
|
-
return this.http.request("GET", getRecordsPath(this.podId(), table), {
|
|
37
|
-
params: {
|
|
38
|
-
limit: limit ?? 20,
|
|
39
|
-
page_token: pageToken,
|
|
40
|
-
offset,
|
|
41
|
-
sort_by: sortBy,
|
|
42
|
-
order,
|
|
43
|
-
...(params ?? {}),
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return this.client.request(() => RecordsService.recordList(this.podId(), table, limit ?? 20, offset, sortBy ?? undefined, order ?? "asc", undefined, undefined, pageToken));
|
|
48
|
-
}
|
|
49
|
-
listWithParams(table, params) {
|
|
50
|
-
return this.http.request("GET", getRecordsPath(this.podId(), table), {
|
|
51
|
-
params,
|
|
52
|
-
});
|
|
22
|
+
const { filters, sort, limit, pageToken, offset } = options;
|
|
23
|
+
return this.client.request(() => RecordsService.recordList(this.podId(), table, limit ?? 20, offset, serializeFilters(filters), serializeSort(sort), pageToken));
|
|
53
24
|
}
|
|
54
25
|
create(table, data) {
|
|
55
26
|
return this.client.request(() => RecordsService.recordCreate(this.podId(), table, { data }));
|
|
@@ -64,7 +35,7 @@ export class RecordsNamespace {
|
|
|
64
35
|
return this.client.request(() => RecordsService.recordDelete(this.podId(), table, recordId));
|
|
65
36
|
}
|
|
66
37
|
query(table, payload) {
|
|
67
|
-
return this.client.request(() => RecordsService.recordList(this.podId(), table, payload.limit ?? 20, payload.offset,
|
|
38
|
+
return this.client.request(() => RecordsService.recordList(this.podId(), table, payload.limit ?? 20, payload.offset, serializeFilters(payload.filters), serializeSort(payload.sort), payload.page_token));
|
|
68
39
|
}
|
|
69
40
|
bulk = {
|
|
70
41
|
create: (table, records) => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
export declare class WidgetsNamespace {
|
|
3
|
+
private readonly http;
|
|
4
|
+
private readonly podId;
|
|
5
|
+
constructor(http: HttpClient, podId: () => string);
|
|
6
|
+
/**
|
|
7
|
+
* Mint a short-lived, signed embed URL for a conversation widget. The widget
|
|
8
|
+
* serve route is authenticated; this returns a URL the iframe can load even
|
|
9
|
+
* when the session cookie is not sent in a cross-site/embedded context.
|
|
10
|
+
*/
|
|
11
|
+
embedUrl(payload: {
|
|
12
|
+
conversation_id: string;
|
|
13
|
+
tool_call_id: string;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
url: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class WidgetsNamespace {
|
|
2
|
+
http;
|
|
3
|
+
podId;
|
|
4
|
+
constructor(http, podId) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
this.podId = podId;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Mint a short-lived, signed embed URL for a conversation widget. The widget
|
|
10
|
+
* serve route is authenticated; this returns a URL the iframe can load even
|
|
11
|
+
* when the session cookie is not sent in a cross-site/embedded context.
|
|
12
|
+
*/
|
|
13
|
+
embedUrl(payload) {
|
|
14
|
+
return this.http.request("POST", `/pods/${this.podId()}/widgets/${payload.conversation_id}/${payload.tool_call_id}/embed-token`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -22,6 +22,7 @@ export type { AgentPermissionsResponse } from './models/AgentPermissionsResponse
|
|
|
22
22
|
export type { AgentResourcePermissionRequest } from './models/AgentResourcePermissionRequest.js';
|
|
23
23
|
export type { AgentResourcePermissionResponse } from './models/AgentResourcePermissionResponse.js';
|
|
24
24
|
export { AgentRunApprovalDecision } from './models/AgentRunApprovalDecision.js';
|
|
25
|
+
export { AgentRunStatus } from './models/AgentRunStatus.js';
|
|
25
26
|
export type { AgentRuntimeConfig } from './models/AgentRuntimeConfig.js';
|
|
26
27
|
export type { AgentRuntimeProfileListResponse } from './models/AgentRuntimeProfileListResponse.js';
|
|
27
28
|
export type { AgentRuntimeProfileResponse } from './models/AgentRuntimeProfileResponse.js';
|
|
@@ -34,11 +35,13 @@ export type { ApplicationDetailResponseSchema } from './models/ApplicationDetail
|
|
|
34
35
|
export type { ApplicationListResponseSchema } from './models/ApplicationListResponseSchema.js';
|
|
35
36
|
export type { ApplicationResponseSchema } from './models/ApplicationResponseSchema.js';
|
|
36
37
|
export type { ApplicationSkillResponse } from './models/ApplicationSkillResponse.js';
|
|
38
|
+
export type { ApprovalDecisionResponse } from './models/ApprovalDecisionResponse.js';
|
|
37
39
|
export type { AppTriggerListResponseSchema } from './models/AppTriggerListResponseSchema.js';
|
|
38
40
|
export type { AppTriggerResponseSchema } from './models/AppTriggerResponseSchema.js';
|
|
39
41
|
export type { AuthConfigCreateSchema } from './models/AuthConfigCreateSchema.js';
|
|
40
42
|
export type { AuthConfigListResponseSchema } from './models/AuthConfigListResponseSchema.js';
|
|
41
43
|
export type { AuthConfigResponseSchema } from './models/AuthConfigResponseSchema.js';
|
|
44
|
+
export { AuthProvider } from './models/AuthProvider.js';
|
|
42
45
|
export { AuthScheme } from './models/AuthScheme.js';
|
|
43
46
|
export type { BulkCreateRecordsRequest } from './models/BulkCreateRecordsRequest.js';
|
|
44
47
|
export type { BulkDeleteRecordsRequest } from './models/BulkDeleteRecordsRequest.js';
|
|
@@ -106,6 +109,9 @@ export type { FileSearchRequest } from './models/FileSearchRequest.js';
|
|
|
106
109
|
export type { FileSearchResponse } from './models/FileSearchResponse.js';
|
|
107
110
|
export type { FileSearchResultSchema } from './models/FileSearchResultSchema.js';
|
|
108
111
|
export { FileSearchScopeMode } from './models/FileSearchScopeMode.js';
|
|
112
|
+
export type { FileSignedUrlRequest } from './models/FileSignedUrlRequest.js';
|
|
113
|
+
export type { FileSignedUrlResponse } from './models/FileSignedUrlResponse.js';
|
|
114
|
+
export type { FileUrlResponse } from './models/FileUrlResponse.js';
|
|
109
115
|
export type { FlowDetailResponse } from './models/FlowDetailResponse.js';
|
|
110
116
|
export { FlowRunStatus } from './models/FlowRunStatus.js';
|
|
111
117
|
export type { ForeignKeySpec } from './models/ForeignKeySpec.js';
|
|
@@ -144,10 +150,10 @@ export type { LoopNodeConfig } from './models/LoopNodeConfig.js';
|
|
|
144
150
|
export type { LoopNodeResponse } from './models/LoopNodeResponse.js';
|
|
145
151
|
export type { ManualWorkflowStartInput } from './models/ManualWorkflowStartInput.js';
|
|
146
152
|
export type { ManualWorkflowStartOutput } from './models/ManualWorkflowStartOutput.js';
|
|
153
|
+
export { MessageKind } from './models/MessageKind.js';
|
|
147
154
|
export type { MessageListResponse } from './models/MessageListResponse.js';
|
|
148
155
|
export type { MessageResponse } from './models/MessageResponse.js';
|
|
149
156
|
export type { MessageResponseSchema } from './models/MessageResponseSchema.js';
|
|
150
|
-
export type { NotificationContent } from './models/NotificationContent.js';
|
|
151
157
|
export type { OAuth2DefaultsResponseSchema } from './models/OAuth2DefaultsResponseSchema.js';
|
|
152
158
|
export type { OauthCredentialsResponseSchema } from './models/OauthCredentialsResponseSchema.js';
|
|
153
159
|
export type { OperationDetail } from './models/OperationDetail.js';
|
|
@@ -244,11 +250,7 @@ export type { SurfaceSetupStatusResponse } from './models/SurfaceSetupStatusResp
|
|
|
244
250
|
export type { SurfaceSetupStep } from './models/SurfaceSetupStep.js';
|
|
245
251
|
export type { TableDetailResponse } from './models/TableDetailResponse.js';
|
|
246
252
|
export type { TableListResponse } from './models/TableListResponse.js';
|
|
247
|
-
export type { TextContent } from './models/TextContent.js';
|
|
248
|
-
export type { ThinkingContent } from './models/ThinkingContent.js';
|
|
249
253
|
export type { ToggleSurfaceRequest } from './models/ToggleSurfaceRequest.js';
|
|
250
|
-
export type { ToolCallContent } from './models/ToolCallContent.js';
|
|
251
|
-
export type { ToolReturnContent } from './models/ToolReturnContent.js';
|
|
252
254
|
export type { update } from './models/update.js';
|
|
253
255
|
export type { UpdateAgentRequest } from './models/UpdateAgentRequest.js';
|
|
254
256
|
export type { UpdateConversationRequest } from './models/UpdateConversationRequest.js';
|
|
@@ -6,8 +6,10 @@ export { ApiError } from './core/ApiError.js';
|
|
|
6
6
|
export { CancelablePromise, CancelError } from './core/CancelablePromise.js';
|
|
7
7
|
export { OpenAPI } from './core/OpenAPI.js';
|
|
8
8
|
export { AgentRunApprovalDecision } from './models/AgentRunApprovalDecision.js';
|
|
9
|
+
export { AgentRunStatus } from './models/AgentRunStatus.js';
|
|
9
10
|
export { AgentSurfaceStatus } from './models/AgentSurfaceStatus.js';
|
|
10
11
|
export { AgentToolset } from './models/AgentToolset.js';
|
|
12
|
+
export { AuthProvider } from './models/AuthProvider.js';
|
|
11
13
|
export { AuthScheme } from './models/AuthScheme.js';
|
|
12
14
|
export { ConversationStatus } from './models/ConversationStatus.js';
|
|
13
15
|
export { ConversationType } from './models/ConversationType.js';
|
|
@@ -22,6 +24,7 @@ export { FunctionRunStatus } from './models/FunctionRunStatus.js';
|
|
|
22
24
|
export { FunctionStatus } from './models/FunctionStatus.js';
|
|
23
25
|
export { FunctionType } from './models/FunctionType.js';
|
|
24
26
|
export { HarnessKind } from './models/HarnessKind.js';
|
|
27
|
+
export { MessageKind } from './models/MessageKind.js';
|
|
25
28
|
export { OrganizationInvitationStatus } from './models/OrganizationInvitationStatus.js';
|
|
26
29
|
export { OrganizationRole } from './models/OrganizationRole.js';
|
|
27
30
|
export { PodAppMode } from './models/PodAppMode.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Internal lifecycle for one harness execution.
|
|
7
|
+
*/
|
|
8
|
+
export var AgentRunStatus;
|
|
9
|
+
(function (AgentRunStatus) {
|
|
10
|
+
AgentRunStatus["RUNNING"] = "RUNNING";
|
|
11
|
+
AgentRunStatus["STOP_REQUESTED"] = "STOP_REQUESTED";
|
|
12
|
+
AgentRunStatus["COMPLETED"] = "COMPLETED";
|
|
13
|
+
AgentRunStatus["FAILED"] = "FAILED";
|
|
14
|
+
AgentRunStatus["STOPPED"] = "STOPPED";
|
|
15
|
+
})(AgentRunStatus || (AgentRunStatus = {}));
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Known tool bundles an agent may request.
|
|
3
3
|
*/
|
|
4
4
|
export declare enum AgentToolset {
|
|
5
|
-
FILE_SYSTEM = "FILE_SYSTEM",
|
|
6
5
|
WORKSPACE_CLI = "WORKSPACE_CLI",
|
|
7
6
|
SKILLS = "SKILLS",
|
|
8
7
|
WEB_SEARCH = "WEB_SEARCH",
|
|
9
8
|
USER_INTERACTION = "USER_INTERACTION",
|
|
10
9
|
IMAGE_GENERATION = "IMAGE_GENERATION",
|
|
11
|
-
AUDIO_GENERATION = "AUDIO_GENERATION"
|
|
10
|
+
AUDIO_GENERATION = "AUDIO_GENERATION",
|
|
11
|
+
POD = "POD",
|
|
12
|
+
SUBAGENTS = "SUBAGENTS"
|
|
12
13
|
}
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export var AgentToolset;
|
|
9
9
|
(function (AgentToolset) {
|
|
10
|
-
AgentToolset["FILE_SYSTEM"] = "FILE_SYSTEM";
|
|
11
10
|
AgentToolset["WORKSPACE_CLI"] = "WORKSPACE_CLI";
|
|
12
11
|
AgentToolset["SKILLS"] = "SKILLS";
|
|
13
12
|
AgentToolset["WEB_SEARCH"] = "WEB_SEARCH";
|
|
14
13
|
AgentToolset["USER_INTERACTION"] = "USER_INTERACTION";
|
|
15
14
|
AgentToolset["IMAGE_GENERATION"] = "IMAGE_GENERATION";
|
|
16
15
|
AgentToolset["AUDIO_GENERATION"] = "AUDIO_GENERATION";
|
|
16
|
+
AgentToolset["POD"] = "POD";
|
|
17
|
+
AgentToolset["SUBAGENTS"] = "SUBAGENTS";
|
|
17
18
|
})(AgentToolset || (AgentToolset = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AuthProvider } from './AuthProvider.js';
|
|
1
2
|
/**
|
|
2
3
|
* Schema for trigger response.
|
|
3
4
|
*/
|
|
@@ -9,5 +10,6 @@ export type AppTriggerResponseSchema = {
|
|
|
9
10
|
id: string;
|
|
10
11
|
payload_example: (Record<string, any> | null);
|
|
11
12
|
payload_schema: (Record<string, any> | null);
|
|
13
|
+
provider: AuthProvider;
|
|
12
14
|
updated_at: string;
|
|
13
15
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
export var AuthProvider;
|
|
6
|
+
(function (AuthProvider) {
|
|
7
|
+
AuthProvider["LEMMA"] = "LEMMA";
|
|
8
|
+
AuthProvider["COMPOSIO"] = "COMPOSIO";
|
|
9
|
+
})(AuthProvider || (AuthProvider = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentRunStatus } from './AgentRunStatus.js';
|
|
1
2
|
import type { AgentRuntimeConfig } from './AgentRuntimeConfig.js';
|
|
2
3
|
import type { ConversationStatus } from './ConversationStatus.js';
|
|
3
4
|
import type { ConversationType } from './ConversationType.js';
|
|
@@ -7,6 +8,9 @@ export type ConversationResponse = {
|
|
|
7
8
|
created_at: string;
|
|
8
9
|
id: string;
|
|
9
10
|
instructions?: (string | null);
|
|
11
|
+
last_run_error?: (string | null);
|
|
12
|
+
last_run_finished_at?: (string | null);
|
|
13
|
+
last_run_status?: (AgentRunStatus | null);
|
|
10
14
|
metadata?: (Record<string, any> | null);
|
|
11
15
|
organization_id?: (string | null);
|
|
12
16
|
output?: null;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type DatastoreQueryRequest = {
|
|
5
5
|
/**
|
|
6
|
-
* Read-only SQL query executed inside this datastore schema.
|
|
6
|
+
* Read-only SQL query executed inside this datastore schema. A single SELECT statement only; mutating statements (INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, TRUNCATE, ...) and cross-schema references are rejected. Joins, aggregates, and subqueries across tables are allowed, including RLS-enabled tables — rows of an RLS table are scoped to the caller unless they administer it. Example: `SELECT id, amount FROM expenses WHERE amount > 100 ORDER BY created_at DESC LIMIT 20`.
|
|
7
7
|
*/
|
|
8
8
|
query: string;
|
|
9
9
|
};
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Status of a flow run.
|
|
3
3
|
*
|
|
4
4
|
* PENDING exists only in memory before the first advance; persisted runs
|
|
5
|
-
* are RUNNING, WAITING, or terminal.
|
|
6
|
-
*
|
|
5
|
+
* are RUNNING, WAITING, or terminal. WAITING is reserved for human form
|
|
6
|
+
* waits. Runs suspended on platform work such as an agent, function job, or
|
|
7
|
+
* timer remain RUNNING; the active wait row records the exact wait_type.
|
|
7
8
|
*/
|
|
8
9
|
export declare enum FlowRunStatus {
|
|
9
10
|
PENDING = "PENDING",
|