lemma-sdk 0.2.37 → 0.2.40
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 +30 -14
- package/dist/browser/lemma-client.js +260 -206
- package/dist/client.d.ts +2 -2
- package/dist/client.js +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -2
- package/dist/namespaces/conversations.d.ts +0 -5
- package/dist/namespaces/conversations.js +0 -15
- package/dist/namespaces/pod-members.d.ts +5 -3
- package/dist/namespaces/pod-members.js +12 -6
- package/dist/namespaces/schedules.d.ts +22 -0
- package/dist/namespaces/schedules.js +24 -0
- package/dist/namespaces/workflows.d.ts +4 -5
- package/dist/namespaces/workflows.js +1 -4
- package/dist/openapi_client/index.d.ts +12 -12
- package/dist/openapi_client/index.js +5 -3
- package/dist/openapi_client/models/AgentModelName.d.ts +1 -1
- package/dist/openapi_client/models/AgentModelName.js +1 -1
- package/dist/openapi_client/models/CreateScheduleRequest.d.ts +14 -0
- package/dist/openapi_client/models/FlowResponse.d.ts +2 -2
- package/dist/openapi_client/models/FlowRunEntity.d.ts +5 -4
- package/dist/openapi_client/models/FormNodeConfig.d.ts +8 -0
- package/dist/openapi_client/models/MessageResponse.d.ts +0 -1
- package/dist/openapi_client/models/PodConfigResponse.d.ts +0 -2
- package/dist/openapi_client/models/PodMemberDetailResponse.d.ts +2 -0
- package/dist/openapi_client/models/PodMemberResponse.d.ts +2 -0
- package/dist/openapi_client/models/ScheduleListResponse.d.ts +9 -0
- package/dist/openapi_client/models/{TriggerResponse.d.ts → ScheduleResponse.d.ts} +8 -4
- package/dist/openapi_client/models/{TriggerType.d.ts → ScheduleType.d.ts} +2 -2
- package/dist/openapi_client/models/ScheduleType.js +13 -0
- package/dist/openapi_client/models/ScheduledFlowStartInput.d.ts +1 -1
- package/dist/openapi_client/models/ScheduledFlowStartOutput.d.ts +1 -1
- package/dist/openapi_client/models/SendMessageRequest.d.ts +0 -2
- package/dist/openapi_client/models/{UpdateTriggerRequest.d.ts → UpdateScheduleRequest.d.ts} +4 -2
- package/dist/openapi_client/models/WorkflowCreateRequest.d.ts +3 -3
- package/dist/openapi_client/models/WorkflowMode.d.ts +7 -0
- package/dist/openapi_client/models/WorkflowMode.js +12 -0
- package/dist/openapi_client/models/WorkflowRunWaitAssignment.d.ts +6 -0
- package/dist/openapi_client/models/WorkflowRunWaitAssignmentListResponse.d.ts +6 -0
- package/dist/openapi_client/models/WorkflowRunWaitEntity.d.ts +20 -0
- package/dist/openapi_client/models/WorkflowRunWaitStatus.d.ts +6 -0
- package/dist/openapi_client/models/WorkflowRunWaitStatus.js +11 -0
- package/dist/openapi_client/models/WorkflowRunWaitType.d.ts +7 -0
- package/dist/openapi_client/models/WorkflowRunWaitType.js +12 -0
- package/dist/openapi_client/models/WorkflowUpdateRequest.d.ts +3 -3
- package/dist/openapi_client/services/AgentConversationsService.d.ts +4 -14
- package/dist/openapi_client/services/AgentConversationsService.js +4 -30
- package/dist/openapi_client/services/PodMembersService.d.ts +25 -7
- package/dist/openapi_client/services/PodMembersService.js +57 -13
- package/dist/openapi_client/services/SchedulesService.d.ts +59 -0
- package/dist/openapi_client/services/SchedulesService.js +125 -0
- package/dist/openapi_client/services/WebhooksService.d.ts +4 -4
- package/dist/openapi_client/services/WebhooksService.js +6 -6
- package/dist/openapi_client/services/WorkflowsService.d.ts +12 -33
- package/dist/openapi_client/services/WorkflowsService.js +26 -69
- package/dist/react/AuthGuard.js +1 -1
- package/dist/react/index.d.ts +10 -8
- package/dist/react/index.js +5 -4
- package/dist/react/useAssistantController.js +0 -2
- package/dist/react/useAssistantSession.d.ts +0 -2
- package/dist/react/useAssistantSession.js +8 -14
- package/dist/react/useCreateSchedule.d.ts +17 -0
- package/dist/react/useCreateSchedule.js +45 -0
- package/dist/react/useDeleteSchedule.d.ts +19 -0
- package/dist/react/useDeleteSchedule.js +49 -0
- package/dist/react/usePodAccess.js +1 -1
- package/dist/react/useSchedules.d.ts +30 -0
- package/dist/react/useSchedules.js +123 -0
- package/dist/react/useUpdateSchedule.d.ts +20 -0
- package/dist/react/useUpdateSchedule.js +49 -0
- package/dist/react/useWorkflowRun.js +1 -1
- package/dist/react/useWorkflowRunWaitAssignments.d.ts +26 -0
- package/dist/react/useWorkflowRunWaitAssignments.js +102 -0
- package/dist/react/useWorkflowStart.js +1 -1
- package/dist/run-utils.d.ts +1 -5
- package/dist/run-utils.js +0 -10
- package/dist/types.d.ts +3 -43
- package/package.json +1 -1
- package/dist/namespaces/tasks.d.ts +0 -25
- package/dist/namespaces/tasks.js +0 -91
- package/dist/openapi_client/models/CreateTriggerRequest.d.ts +0 -13
- package/dist/openapi_client/models/FlowInstallResponse.d.ts +0 -15
- package/dist/openapi_client/models/PodFlowConfigItem.d.ts +0 -7
- package/dist/openapi_client/models/TriggerListResponse.d.ts +0 -9
- package/dist/openapi_client/models/TriggerType.js +0 -13
- package/dist/openapi_client/models/WorkflowInstallListResponse.d.ts +0 -4
- package/dist/openapi_client/models/WorkflowInstallMode.d.ts +0 -7
- package/dist/openapi_client/models/WorkflowInstallMode.js +0 -12
- package/dist/openapi_client/models/WorkflowInstallRequest.d.ts +0 -11
- package/dist/openapi_client/models/WorkflowInstallRequest.js +0 -1
- package/dist/openapi_client/models/WorkflowTimeInstallConfig.d.ts +0 -19
- package/dist/openapi_client/models/WorkflowTimeInstallConfig.js +0 -1
- package/dist/openapi_client/services/TriggersService.d.ts +0 -53
- package/dist/openapi_client/services/TriggersService.js +0 -109
- package/dist/react/useAgentRun.d.ts +0 -38
- package/dist/react/useAgentRun.js +0 -149
- package/dist/react/useAgentRuns.d.ts +0 -33
- package/dist/react/useAgentRuns.js +0 -149
- package/dist/react/useAssistantRun.d.ts +0 -27
- package/dist/react/useAssistantRun.js +0 -47
- package/dist/react/useTaskSession.d.ts +0 -35
- package/dist/react/useTaskSession.js +0 -269
- package/dist/task-events.d.ts +0 -8
- package/dist/task-events.js +0 -115
- /package/dist/openapi_client/models/{CreateTriggerRequest.js → CreateScheduleRequest.js} +0 -0
- /package/dist/openapi_client/models/{FlowInstallResponse.js → ScheduleListResponse.js} +0 -0
- /package/dist/openapi_client/models/{PodFlowConfigItem.js → ScheduleResponse.js} +0 -0
- /package/dist/openapi_client/models/{TriggerListResponse.js → UpdateScheduleRequest.js} +0 -0
- /package/dist/openapi_client/models/{TriggerResponse.js → WorkflowRunWaitAssignment.js} +0 -0
- /package/dist/openapi_client/models/{UpdateTriggerRequest.js → WorkflowRunWaitAssignmentListResponse.js} +0 -0
- /package/dist/openapi_client/models/{WorkflowInstallListResponse.js → WorkflowRunWaitEntity.js} +0 -0
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ const tables = await client.tables.list();
|
|
|
43
43
|
const records = await client.records.list("tickets");
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Pod-scoped namespaces include `tables`, `records`, `agents`, `conversations`, `workflows`, `functions`, `files`, `desks`, `integrations`, `resources`, and `datastore`. New runtime code should use agents plus conversations.
|
|
46
|
+
Pod-scoped namespaces include `tables`, `records`, `agents`, `conversations`, `workflows`, `schedules`, `functions`, `files`, `desks`, `integrations`, `resources`, and `datastore`. New runtime code should use agents plus conversations.
|
|
47
47
|
|
|
48
48
|
Org and user surfaces include `users`, `organizations`, `pods`, `podMembers`, `podJoinRequests`, and `podSurfaces`.
|
|
49
49
|
|
|
@@ -60,7 +60,6 @@ npm install react react-dom
|
|
|
60
60
|
```tsx
|
|
61
61
|
import {
|
|
62
62
|
AuthGuard,
|
|
63
|
-
useAgentRun,
|
|
64
63
|
useConversationMessages,
|
|
65
64
|
useConversations,
|
|
66
65
|
useRecordForm,
|
|
@@ -78,12 +77,13 @@ import {
|
|
|
78
77
|
| Record mutations | `useCreateRecord`, `useUpdateRecord`, `useDeleteRecord`, `useBulkRecords` | Stable | Create, update, delete, or bulk-delete rows from headless UI. Function-backed mutations via `createVia`/`updateVia` options. |
|
|
79
78
|
| Record forms | `useRecordSchema`, `useRecordForm`, `useForeignKeyOptions`, `useSchemaForm` | Stable | Render schema-driven record forms, enum fields, and foreign-key selectors. `useRecordForm` is the canonical table-bound form hook; `useSchemaForm` remains available for raw JSON-schema flows. |
|
|
80
79
|
| Files | `useFiles`, `useFile`, `useUploadFile`, `useUpdateFile`, `useDeleteFile`, `useCreateFolder`, `useFileSearch`, `useFileTree`, `useFilePreview`, `useGlobalSearch` | Stable | Browse private or pod folders, mutate file state, search indexed files, load directory trees, preview content, and compose multi-source desk search. |
|
|
81
|
-
| Conversations | `useConversations`, `useConversation`, `useConversationMessages`, `
|
|
82
|
-
| Agents | `
|
|
83
|
-
| Workflows | `useWorkflowStart`, `useWorkflowRun`, `useWorkflowRuns`, `useWorkflowResume` | Stable | Start, poll, resume, cancel, retry,
|
|
80
|
+
| Conversations | `useConversations`, `useConversation`, `useConversationMessages`, `useAssistantSession`, `useAssistantRuntime`, `useAssistantController` | Stable except controller/runtime | Build custom chat, conversation lists, streaming output, and final-answer views for default assistant conversations or named agents. |
|
|
81
|
+
| Agents | `useAgentInputSchema` | Stable | Inspect structured input/output schemas for named agents. Agent execution goes through conversations. |
|
|
82
|
+
| Workflows | `useWorkflowStart`, `useWorkflowRun`, `useWorkflowRuns`, `useWorkflowRunWaitAssignments`, `useWorkflowResume` | Stable | Start, poll, resume, cancel, retry, inspect workflow runs, and show human form waits assigned to the current pod member. |
|
|
83
|
+
| Schedules | `useSchedules`, `useCreateSchedule`, `useUpdateSchedule`, `useDeleteSchedule` | Stable | Schedule workflows or agents on time, webhook, datastore, or application-trigger events. |
|
|
84
84
|
| Workflow compatibility | `useFlowSession`, `useFlowRunHistory` | Deprecated naming | Kept for existing callers; prefer workflow-named hooks for new code. |
|
|
85
85
|
| Functions | `useFunctionRun`, `useFunctionRuns`, `useFunctionSession` | Stable except raw session | Run functions, poll function runs, and list function history. |
|
|
86
|
-
| Members and org | `useMembers`, `useAddPodMember`, `useUpdatePodMemberRole`, `useRemovePodMember`, `useOrganizationMembers` | Stable | Read pod and organization members, add existing org members into a pod, update pod roles, and remove pod access. The current checked-in client does not yet expose direct email-to-pod invites. |
|
|
86
|
+
| Members and org | `useMembers`, `useAddPodMember`, `useUpdatePodMemberRole`, `useRemovePodMember`, `useOrganizationMembers` | Stable | Read pod and organization members, add existing org members into a pod, look up pod members by user id or email, update pod-member roles, and remove pod access. The current checked-in client does not yet expose direct email-to-pod invites. |
|
|
87
87
|
|
|
88
88
|
### Headless Helpers
|
|
89
89
|
|
|
@@ -107,7 +107,7 @@ List hooks generally expose:
|
|
|
107
107
|
|
|
108
108
|
Run hooks generally expose:
|
|
109
109
|
|
|
110
|
-
- `run`
|
|
110
|
+
- `run`
|
|
111
111
|
- `status`
|
|
112
112
|
- `isPolling`, `isStreaming`, or `isRunning`
|
|
113
113
|
- `output`
|
|
@@ -168,25 +168,35 @@ function SupportThread({ client }: { client: LemmaClient }) {
|
|
|
168
168
|
}
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
Start an agent conversation:
|
|
172
172
|
|
|
173
173
|
```tsx
|
|
174
|
-
import {
|
|
174
|
+
import { useConversationMessages } from "lemma-sdk/react";
|
|
175
175
|
|
|
176
176
|
function AgentButton({ client }: { client: LemmaClient }) {
|
|
177
|
-
const
|
|
177
|
+
const conversation = useConversationMessages({
|
|
178
178
|
client,
|
|
179
179
|
agentName: "triage_agent",
|
|
180
|
+
autoResume: true,
|
|
180
181
|
});
|
|
181
182
|
|
|
182
183
|
return (
|
|
183
184
|
<button
|
|
184
|
-
disabled={
|
|
185
|
+
disabled={conversation.isStreaming}
|
|
185
186
|
onClick={() => {
|
|
186
|
-
void
|
|
187
|
+
void (async () => {
|
|
188
|
+
const thread = await conversation.createConversation({
|
|
189
|
+
title: "Triage ticket ticket_123",
|
|
190
|
+
setActive: true,
|
|
191
|
+
});
|
|
192
|
+
await conversation.sendMessage(JSON.stringify({
|
|
193
|
+
ticket_id: "ticket_123",
|
|
194
|
+
prompt: "Triage this ticket.",
|
|
195
|
+
}), { conversationId: thread.id });
|
|
196
|
+
})();
|
|
187
197
|
}}
|
|
188
198
|
>
|
|
189
|
-
{
|
|
199
|
+
{conversation.status ?? "Message agent"}
|
|
190
200
|
</button>
|
|
191
201
|
);
|
|
192
202
|
}
|
|
@@ -446,9 +456,15 @@ From `0.2.30` onward:
|
|
|
446
456
|
From `0.2.37` onward:
|
|
447
457
|
|
|
448
458
|
- Agent APIs are the runtime abstraction. `client.assistants` is removed; use `client.agents` for definitions and `client.conversations` for turns/messages.
|
|
449
|
-
- Conversations are pod-scoped under the agent conversation API; message sends stream
|
|
459
|
+
- Conversations are pod-scoped under the agent conversation API; message sends stream conversation events until final output.
|
|
450
460
|
- File APIs are namespace-aware. Shared pod files are the default for backwards-compatible file workspaces; pass `namespace: "PRIVATE"` for personal file input/upload flows and `namespace: "POD"` when you want to be explicit. The live OpenAPI currently names the private namespace `PERSONAL`; the SDK accepts `PRIVATE` as the product-facing alias.
|
|
451
461
|
|
|
462
|
+
From `0.2.39` onward:
|
|
463
|
+
|
|
464
|
+
- Workflow install/trigger APIs moved to `client.schedules`; create schedules with `workflow_name` or `agent_name` plus `schedule_type`.
|
|
465
|
+
- Human form nodes can assign waits to a pod member id. Use `useWorkflowRunWaitAssignments` or `client.workflows.runs.waitingAssignedToMe()` to show work waiting for the signed-in member.
|
|
466
|
+
- Pod member role updates, lookup, and removal use `pod_member_id`. Use `client.podMembers.lookupByUserId(...)` or `lookupByEmail(...)` when starting from user identity.
|
|
467
|
+
|
|
452
468
|
## Local Development
|
|
453
469
|
|
|
454
470
|
From the root of this repository:
|