@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.
Files changed (124) hide show
  1. package/lib/AppsApi.d.ts +9 -8
  2. package/lib/AppsApi.d.ts.map +1 -1
  3. package/lib/AppsApi.js +11 -4
  4. package/lib/AppsApi.js.map +1 -1
  5. package/lib/GroupsApi.d.ts +4 -11
  6. package/lib/GroupsApi.d.ts.map +1 -1
  7. package/lib/GroupsApi.js.map +1 -1
  8. package/lib/InteractionBase.d.ts +114 -0
  9. package/lib/InteractionBase.d.ts.map +1 -1
  10. package/lib/InteractionCatalogApi.d.ts +3 -3
  11. package/lib/InteractionCatalogApi.d.ts.map +1 -1
  12. package/lib/InteractionCatalogApi.js +1 -1
  13. package/lib/InteractionOutput.d.ts +13 -3
  14. package/lib/InteractionOutput.d.ts.map +1 -1
  15. package/lib/InteractionOutput.js +33 -3
  16. package/lib/InteractionOutput.js.map +1 -1
  17. package/lib/OAuthServerApi.d.ts +1 -1
  18. package/lib/OAuthServerApi.d.ts.map +1 -1
  19. package/lib/OAuthServerApi.js +9 -2
  20. package/lib/OAuthServerApi.js.map +1 -1
  21. package/lib/ProjectsApi.d.ts +3 -3
  22. package/lib/ProjectsApi.d.ts.map +1 -1
  23. package/lib/ProjectsApi.js.map +1 -1
  24. package/lib/RunsApi.d.ts +6 -28
  25. package/lib/RunsApi.d.ts.map +1 -1
  26. package/lib/RunsApi.js +3 -3
  27. package/lib/RunsApi.js.map +1 -1
  28. package/lib/ToolsApi.d.ts +2 -1
  29. package/lib/ToolsApi.d.ts.map +1 -1
  30. package/lib/ToolsApi.js +9 -0
  31. package/lib/ToolsApi.js.map +1 -1
  32. package/lib/ViewsApi.d.ts +1 -1
  33. package/lib/ViewsApi.js +1 -1
  34. package/lib/client.d.ts +1 -0
  35. package/lib/client.d.ts.map +1 -1
  36. package/lib/client.js +3 -0
  37. package/lib/client.js.map +1 -1
  38. package/lib/execute.js +2 -2
  39. package/lib/execute.js.map +1 -1
  40. package/lib/store/AgentsApi.d.ts +4 -1
  41. package/lib/store/AgentsApi.d.ts.map +1 -1
  42. package/lib/store/AgentsApi.js +6 -4
  43. package/lib/store/AgentsApi.js.map +1 -1
  44. package/lib/store/CollectionsApi.d.ts +5 -2
  45. package/lib/store/CollectionsApi.d.ts.map +1 -1
  46. package/lib/store/CollectionsApi.js.map +1 -1
  47. package/lib/store/EmailApi.d.ts +9 -107
  48. package/lib/store/EmailApi.d.ts.map +1 -1
  49. package/lib/store/EmailApi.js.map +1 -1
  50. package/lib/store/FilesApi.d.ts +3 -1
  51. package/lib/store/FilesApi.d.ts.map +1 -1
  52. package/lib/store/FilesApi.js +7 -0
  53. package/lib/store/FilesApi.js.map +1 -1
  54. package/lib/store/ObjectsApi.d.ts +29 -4
  55. package/lib/store/ObjectsApi.d.ts.map +1 -1
  56. package/lib/store/ObjectsApi.js +0 -2
  57. package/lib/store/ObjectsApi.js.map +1 -1
  58. package/lib/store/PendingAsksApi.d.ts +2 -53
  59. package/lib/store/PendingAsksApi.d.ts.map +1 -1
  60. package/lib/store/PendingAsksApi.js.map +1 -1
  61. package/lib/store/ProcessApi.d.ts +15 -8
  62. package/lib/store/ProcessApi.d.ts.map +1 -1
  63. package/lib/store/ProcessApi.js +27 -1
  64. package/lib/store/ProcessApi.js.map +1 -1
  65. package/lib/store/ProcessTestRunApi.d.ts +26 -0
  66. package/lib/store/ProcessTestRunApi.d.ts.map +1 -0
  67. package/lib/store/ProcessTestRunApi.js +36 -0
  68. package/lib/store/ProcessTestRunApi.js.map +1 -0
  69. package/lib/store/QueryApi.d.ts +9 -51
  70. package/lib/store/QueryApi.d.ts.map +1 -1
  71. package/lib/store/QueryApi.js.map +1 -1
  72. package/lib/store/WorkflowsApi.d.ts +3 -3
  73. package/lib/store/WorkflowsApi.d.ts.map +1 -1
  74. package/lib/store/WorkflowsApi.js.map +1 -1
  75. package/lib/store/client.d.ts +2 -2
  76. package/lib/store/client.d.ts.map +1 -1
  77. package/lib/store/client.js +2 -2
  78. package/lib/store/client.js.map +1 -1
  79. package/lib/store/index.d.ts +1 -1
  80. package/lib/store/index.d.ts.map +1 -1
  81. package/lib/store/index.js +1 -1
  82. package/lib/store/index.js.map +1 -1
  83. package/lib/store/stream-termination.d.ts +2 -2
  84. package/lib/store/stream-termination.d.ts.map +1 -1
  85. package/lib/store/stream-termination.js +6 -4
  86. package/lib/store/stream-termination.js.map +1 -1
  87. package/lib/vertesia-client.js +8 -9
  88. package/lib/vertesia-client.js.map +1 -1
  89. package/package.json +7 -7
  90. package/src/AppsApi.ts +22 -8
  91. package/src/GroupsApi.ts +4 -10
  92. package/src/InteractionCatalogApi.ts +3 -3
  93. package/src/InteractionOutput.test.ts +41 -5
  94. package/src/InteractionOutput.ts +39 -3
  95. package/src/OAuthServerApi.test.ts +56 -0
  96. package/src/OAuthServerApi.ts +12 -2
  97. package/src/ProjectsApi.ts +4 -2
  98. package/src/RunsApi.ts +15 -14
  99. package/src/ToolsApi.ts +10 -0
  100. package/src/ViewsApi.test.ts +3 -1
  101. package/src/ViewsApi.ts +1 -1
  102. package/src/client.ts +4 -0
  103. package/src/execute.ts +2 -2
  104. package/src/store/AgentsApi.stream.test.ts +56 -0
  105. package/src/store/AgentsApi.ts +8 -4
  106. package/src/store/CollectionsApi.ts +8 -1
  107. package/src/store/EmailApi.ts +25 -107
  108. package/src/store/FilesApi.ts +12 -0
  109. package/src/store/ObjectsApi.ts +28 -4
  110. package/src/store/PendingAsksApi.ts +15 -57
  111. package/src/store/ProcessApi.test.ts +24 -0
  112. package/src/store/ProcessApi.ts +49 -8
  113. package/src/store/ProcessTestRunApi.ts +41 -0
  114. package/src/store/QueryApi.ts +9 -45
  115. package/src/store/WorkflowsApi.ts +4 -3
  116. package/src/store/client.ts +2 -2
  117. package/src/store/index.ts +1 -1
  118. package/src/store/stream-termination.test.ts +24 -0
  119. package/src/store/stream-termination.ts +10 -4
  120. package/lib/store/HiveMemoryApi.d.ts +0 -161
  121. package/lib/store/HiveMemoryApi.d.ts.map +0 -1
  122. package/lib/store/HiveMemoryApi.js +0 -170
  123. package/lib/store/HiveMemoryApi.js.map +0 -1
  124. 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
- }