@vertesia/client 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z
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/lib/AppsApi.d.ts +9 -8
- package/lib/AppsApi.d.ts.map +1 -1
- package/lib/AppsApi.js +11 -4
- package/lib/AppsApi.js.map +1 -1
- package/lib/GroupsApi.d.ts +4 -11
- package/lib/GroupsApi.d.ts.map +1 -1
- package/lib/GroupsApi.js.map +1 -1
- package/lib/InteractionBase.d.ts +114 -0
- package/lib/InteractionBase.d.ts.map +1 -1
- package/lib/InteractionCatalogApi.d.ts +3 -3
- package/lib/InteractionCatalogApi.d.ts.map +1 -1
- package/lib/InteractionCatalogApi.js +1 -1
- package/lib/InteractionOutput.d.ts +13 -3
- package/lib/InteractionOutput.d.ts.map +1 -1
- package/lib/InteractionOutput.js +33 -3
- package/lib/InteractionOutput.js.map +1 -1
- package/lib/OAuthServerApi.d.ts +1 -1
- package/lib/OAuthServerApi.d.ts.map +1 -1
- package/lib/OAuthServerApi.js +9 -2
- package/lib/OAuthServerApi.js.map +1 -1
- package/lib/ProjectsApi.d.ts +3 -3
- package/lib/ProjectsApi.d.ts.map +1 -1
- package/lib/ProjectsApi.js.map +1 -1
- package/lib/RunsApi.d.ts +6 -28
- package/lib/RunsApi.d.ts.map +1 -1
- package/lib/RunsApi.js +3 -3
- package/lib/RunsApi.js.map +1 -1
- package/lib/ToolsApi.d.ts +2 -1
- package/lib/ToolsApi.d.ts.map +1 -1
- package/lib/ToolsApi.js +9 -0
- package/lib/ToolsApi.js.map +1 -1
- package/lib/ViewsApi.d.ts +1 -1
- package/lib/ViewsApi.js +1 -1
- package/lib/client.d.ts +1 -0
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +3 -0
- package/lib/client.js.map +1 -1
- package/lib/execute.js +2 -2
- package/lib/execute.js.map +1 -1
- package/lib/store/AgentsApi.d.ts +4 -1
- package/lib/store/AgentsApi.d.ts.map +1 -1
- package/lib/store/AgentsApi.js +6 -4
- package/lib/store/AgentsApi.js.map +1 -1
- package/lib/store/CollectionsApi.d.ts +5 -2
- package/lib/store/CollectionsApi.d.ts.map +1 -1
- package/lib/store/CollectionsApi.js.map +1 -1
- package/lib/store/EmailApi.d.ts +9 -107
- package/lib/store/EmailApi.d.ts.map +1 -1
- package/lib/store/EmailApi.js.map +1 -1
- package/lib/store/FilesApi.d.ts +3 -1
- package/lib/store/FilesApi.d.ts.map +1 -1
- package/lib/store/FilesApi.js +7 -0
- package/lib/store/FilesApi.js.map +1 -1
- package/lib/store/ObjectsApi.d.ts +29 -4
- package/lib/store/ObjectsApi.d.ts.map +1 -1
- package/lib/store/ObjectsApi.js +0 -2
- package/lib/store/ObjectsApi.js.map +1 -1
- package/lib/store/PendingAsksApi.d.ts +2 -53
- package/lib/store/PendingAsksApi.d.ts.map +1 -1
- package/lib/store/PendingAsksApi.js.map +1 -1
- package/lib/store/ProcessApi.d.ts +15 -8
- package/lib/store/ProcessApi.d.ts.map +1 -1
- package/lib/store/ProcessApi.js +27 -1
- package/lib/store/ProcessApi.js.map +1 -1
- package/lib/store/ProcessTestRunApi.d.ts +26 -0
- package/lib/store/ProcessTestRunApi.d.ts.map +1 -0
- package/lib/store/ProcessTestRunApi.js +36 -0
- package/lib/store/ProcessTestRunApi.js.map +1 -0
- package/lib/store/QueryApi.d.ts +9 -51
- package/lib/store/QueryApi.d.ts.map +1 -1
- package/lib/store/QueryApi.js.map +1 -1
- package/lib/store/WorkflowsApi.d.ts +3 -3
- package/lib/store/WorkflowsApi.d.ts.map +1 -1
- package/lib/store/WorkflowsApi.js.map +1 -1
- package/lib/store/client.d.ts +2 -2
- package/lib/store/client.d.ts.map +1 -1
- package/lib/store/client.js +2 -2
- package/lib/store/client.js.map +1 -1
- package/lib/store/index.d.ts +1 -1
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +1 -1
- package/lib/store/index.js.map +1 -1
- package/lib/store/stream-termination.d.ts +2 -2
- package/lib/store/stream-termination.d.ts.map +1 -1
- package/lib/store/stream-termination.js +6 -4
- package/lib/store/stream-termination.js.map +1 -1
- package/lib/vertesia-client.js +8 -9
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +7 -7
- package/src/AppsApi.ts +22 -8
- package/src/GroupsApi.ts +4 -10
- package/src/InteractionCatalogApi.ts +3 -3
- package/src/InteractionOutput.test.ts +41 -5
- package/src/InteractionOutput.ts +39 -3
- package/src/OAuthServerApi.test.ts +56 -0
- package/src/OAuthServerApi.ts +12 -2
- package/src/ProjectsApi.ts +4 -2
- package/src/RunsApi.ts +15 -14
- package/src/ToolsApi.ts +10 -0
- package/src/ViewsApi.test.ts +3 -1
- package/src/ViewsApi.ts +1 -1
- package/src/client.ts +4 -0
- package/src/execute.ts +2 -2
- package/src/store/AgentsApi.stream.test.ts +56 -0
- package/src/store/AgentsApi.ts +8 -4
- package/src/store/CollectionsApi.ts +8 -1
- package/src/store/EmailApi.ts +25 -107
- package/src/store/FilesApi.ts +12 -0
- package/src/store/ObjectsApi.ts +28 -4
- package/src/store/PendingAsksApi.ts +15 -57
- package/src/store/ProcessApi.test.ts +24 -0
- package/src/store/ProcessApi.ts +49 -8
- package/src/store/ProcessTestRunApi.ts +41 -0
- package/src/store/QueryApi.ts +9 -45
- package/src/store/WorkflowsApi.ts +4 -3
- package/src/store/client.ts +2 -2
- package/src/store/index.ts +1 -1
- package/src/store/stream-termination.test.ts +24 -0
- package/src/store/stream-termination.ts +10 -4
- package/lib/store/HiveMemoryApi.d.ts +0 -161
- package/lib/store/HiveMemoryApi.d.ts.map +0 -1
- package/lib/store/HiveMemoryApi.js +0 -170
- package/lib/store/HiveMemoryApi.js.map +0 -1
- package/src/store/HiveMemoryApi.ts +0 -220
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
-
import type {
|
|
3
|
-
CreateHiveMemoryPayload,
|
|
4
|
-
FormattedMemoryForAgent,
|
|
5
|
-
HiveMemory,
|
|
6
|
-
HiveMemorySearchParams,
|
|
7
|
-
HiveMemorySearchResult,
|
|
8
|
-
UpdateHiveMemoryPayload,
|
|
9
|
-
} from '@vertesia/common';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Statistics about hive memories in the project
|
|
13
|
-
*/
|
|
14
|
-
export interface HiveMemoryStats {
|
|
15
|
-
total_memories: number;
|
|
16
|
-
by_category: Array<{
|
|
17
|
-
category: string;
|
|
18
|
-
count: number;
|
|
19
|
-
avg_confidence: number;
|
|
20
|
-
total_usage: number;
|
|
21
|
-
}>;
|
|
22
|
-
overall: {
|
|
23
|
-
avgConfidence: number;
|
|
24
|
-
avgUsage: number;
|
|
25
|
-
totalContributions: number;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Result from recall endpoint
|
|
31
|
-
*/
|
|
32
|
-
export interface RecallResult {
|
|
33
|
-
memories: FormattedMemoryForAgent[];
|
|
34
|
-
count: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Client API for managing hive memories.
|
|
39
|
-
*
|
|
40
|
-
* Hive memory is a system for storing and retrieving agent learnings,
|
|
41
|
-
* enabling agents to learn from past runs and share knowledge.
|
|
42
|
-
*/
|
|
43
|
-
export class HiveMemoryApi extends ApiTopic {
|
|
44
|
-
constructor(parent: ClientBase) {
|
|
45
|
-
super(parent, '/api/v1/hive-memory');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* List memories in the project.
|
|
50
|
-
*
|
|
51
|
-
* @param options - Optional filters and pagination
|
|
52
|
-
*/
|
|
53
|
-
list(options?: { category?: string; scope?: string; limit?: number; offset?: number }): Promise<HiveMemory[]> {
|
|
54
|
-
const params = new URLSearchParams();
|
|
55
|
-
if (options?.category) params.set('category', options.category);
|
|
56
|
-
if (options?.scope) params.set('scope', options.scope);
|
|
57
|
-
if (options?.limit) params.set('limit', String(options.limit));
|
|
58
|
-
if (options?.offset) params.set('offset', String(options.offset));
|
|
59
|
-
|
|
60
|
-
const queryString = params.toString();
|
|
61
|
-
return this.get(queryString ? `/?${queryString}` : '/');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Retrieve a memory by ID.
|
|
66
|
-
*/
|
|
67
|
-
retrieve(id: string): Promise<HiveMemory> {
|
|
68
|
-
return this.get(`/${id}`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Create a new hive memory.
|
|
73
|
-
*
|
|
74
|
-
* @param payload - Memory content including category, summary, and learnings
|
|
75
|
-
*/
|
|
76
|
-
create(payload: CreateHiveMemoryPayload): Promise<HiveMemory> {
|
|
77
|
-
return this.post('/', { payload });
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Update an existing memory with new learnings.
|
|
82
|
-
*
|
|
83
|
-
* This merges new learnings with existing ones rather than replacing them.
|
|
84
|
-
*
|
|
85
|
-
* @param id - Memory ID
|
|
86
|
-
* @param payload - Fields to update/merge
|
|
87
|
-
*/
|
|
88
|
-
update(id: string, payload: UpdateHiveMemoryPayload): Promise<HiveMemory> {
|
|
89
|
-
return this.put(`/${id}`, { payload });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Delete a memory.
|
|
94
|
-
*
|
|
95
|
-
* @param id - Memory ID
|
|
96
|
-
*/
|
|
97
|
-
delete(id: string): Promise<{ id: string; deleted: boolean }> {
|
|
98
|
-
return this.del(`/${id}`);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Search memories using semantic and keyword search.
|
|
103
|
-
*
|
|
104
|
-
* @param params - Search parameters including query, filters, and pagination
|
|
105
|
-
*/
|
|
106
|
-
search(params: HiveMemorySearchParams): Promise<HiveMemorySearchResult> {
|
|
107
|
-
return this.post('/search', { payload: params });
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Recall memories for an agent.
|
|
112
|
-
*
|
|
113
|
-
* This is the primary method for agents to retrieve relevant learnings.
|
|
114
|
-
* It searches for memories matching the task description and returns
|
|
115
|
-
* them formatted for agent consumption.
|
|
116
|
-
*
|
|
117
|
-
* @param taskDescription - Description of the current task
|
|
118
|
-
* @param options - Optional filters
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* const result = await client.hiveMemory.recall(
|
|
123
|
-
* "Extract financial data from PDF documents",
|
|
124
|
-
* {
|
|
125
|
-
* tools: ["extract_text", "analyze_document"],
|
|
126
|
-
* maxResults: 5
|
|
127
|
-
* }
|
|
128
|
-
* );
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
recall(
|
|
132
|
-
taskDescription: string,
|
|
133
|
-
options?: {
|
|
134
|
-
tools?: string[];
|
|
135
|
-
category?: string;
|
|
136
|
-
maxResults?: number;
|
|
137
|
-
},
|
|
138
|
-
): Promise<RecallResult> {
|
|
139
|
-
return this.post('/recall', {
|
|
140
|
-
payload: {
|
|
141
|
-
task_description: taskDescription,
|
|
142
|
-
tools: options?.tools,
|
|
143
|
-
category: options?.category,
|
|
144
|
-
max_results: options?.maxResults,
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Get a memory formatted for agent consumption.
|
|
151
|
-
*
|
|
152
|
-
* @param id - Memory ID
|
|
153
|
-
*/
|
|
154
|
-
getFormatted(id: string): Promise<FormattedMemoryForAgent> {
|
|
155
|
-
return this.get(`/${id}/formatted`);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Record that a memory was used.
|
|
160
|
-
*
|
|
161
|
-
* This increments the usage count and helps track memory effectiveness.
|
|
162
|
-
*
|
|
163
|
-
* @param id - Memory ID
|
|
164
|
-
*/
|
|
165
|
-
recordUsage(id: string): Promise<{ success: boolean }> {
|
|
166
|
-
return this.post(`/${id}/usage`, {});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Get memories by category.
|
|
171
|
-
*
|
|
172
|
-
* @param category - Task category (e.g., "document-analysis", "data-extraction")
|
|
173
|
-
* @param options - Pagination options
|
|
174
|
-
*/
|
|
175
|
-
getByCategory(category: string, options?: { limit?: number; offset?: number }): Promise<HiveMemory[]> {
|
|
176
|
-
const params = new URLSearchParams();
|
|
177
|
-
if (options?.limit) params.set('limit', String(options.limit));
|
|
178
|
-
if (options?.offset) params.set('offset', String(options.offset));
|
|
179
|
-
|
|
180
|
-
const queryString = params.toString();
|
|
181
|
-
return this.get(`/category/${category}${queryString ? `?${queryString}` : ''}`);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Get memory statistics for the project.
|
|
186
|
-
*/
|
|
187
|
-
getStats(): Promise<HiveMemoryStats> {
|
|
188
|
-
return this.get('/stats');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Apply confidence decay to unused memories.
|
|
193
|
-
*
|
|
194
|
-
* Admin operation that reduces confidence scores for memories
|
|
195
|
-
* that haven't been used recently.
|
|
196
|
-
*
|
|
197
|
-
* @param options - Decay parameters
|
|
198
|
-
*/
|
|
199
|
-
applyDecay(options?: { daysThreshold?: number; decayRate?: number }): Promise<{ modified_count: number }> {
|
|
200
|
-
return this.post('/admin/decay', {
|
|
201
|
-
payload: {
|
|
202
|
-
days_threshold: options?.daysThreshold,
|
|
203
|
-
decay_rate: options?.decayRate,
|
|
204
|
-
},
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Archive memories with low confidence scores.
|
|
210
|
-
*
|
|
211
|
-
* Admin operation that removes memories below a confidence threshold.
|
|
212
|
-
*
|
|
213
|
-
* @param threshold - Confidence threshold (0-1), default 0.2
|
|
214
|
-
*/
|
|
215
|
-
archiveLowConfidence(threshold?: number): Promise<{ archived_count: number }> {
|
|
216
|
-
return this.post('/admin/archive', {
|
|
217
|
-
payload: { threshold },
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|