@vertesia/common 0.81.1 → 1.0.0-dev.20260203.130115Z
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/package.json +5 -5
- package/src/analytics.ts +5 -2
- package/src/apikey.ts +20 -1
- package/src/apps.ts +269 -4
- package/src/ask-user.ts +35 -0
- package/src/channels.ts +70 -0
- package/src/data-platform.ts +976 -0
- package/src/email.ts +80 -0
- package/src/index.ts +7 -1
- package/src/integrations.ts +34 -0
- package/src/interaction.ts +280 -1
- package/src/pending-asks.ts +106 -0
- package/src/project.ts +90 -1
- package/src/prompt.ts +2 -1
- package/src/skill.ts +1 -0
- package/src/store/conversation-state.ts +152 -0
- package/src/store/dsl-workflow.ts +12 -0
- package/src/store/hive-memory.ts +167 -0
- package/src/store/index.ts +3 -0
- package/src/store/schedule.ts +238 -0
- package/src/store/signals.ts +20 -0
- package/src/store/store.ts +124 -0
- package/src/store/workflow.test.ts +578 -0
- package/src/store/workflow.ts +612 -53
- package/src/tool-execution.ts +47 -0
- package/src/user.ts +14 -1
- package/src/workflow-analytics.ts +925 -0
- package/lib/cjs/Progress.js +0 -61
- package/lib/cjs/Progress.js.map +0 -1
- package/lib/cjs/access-control.js +0 -56
- package/lib/cjs/access-control.js.map +0 -1
- package/lib/cjs/analytics.js +0 -3
- package/lib/cjs/analytics.js.map +0 -1
- package/lib/cjs/apikey.js +0 -16
- package/lib/cjs/apikey.js.map +0 -1
- package/lib/cjs/apps.js +0 -3
- package/lib/cjs/apps.js.map +0 -1
- package/lib/cjs/common.js +0 -3
- package/lib/cjs/common.js.map +0 -1
- package/lib/cjs/environment.js +0 -44
- package/lib/cjs/environment.js.map +0 -1
- package/lib/cjs/facets.js +0 -3
- package/lib/cjs/facets.js.map +0 -1
- package/lib/cjs/group.js +0 -5
- package/lib/cjs/group.js.map +0 -1
- package/lib/cjs/index.js +0 -49
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/integrations.js +0 -12
- package/lib/cjs/integrations.js.map +0 -1
- package/lib/cjs/interaction.js +0 -74
- package/lib/cjs/interaction.js.map +0 -1
- package/lib/cjs/json-schema.js +0 -3
- package/lib/cjs/json-schema.js.map +0 -1
- package/lib/cjs/json.js +0 -3
- package/lib/cjs/json.js.map +0 -1
- package/lib/cjs/meters.js +0 -13
- package/lib/cjs/meters.js.map +0 -1
- package/lib/cjs/model_utility.js +0 -6
- package/lib/cjs/model_utility.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/payload.js +0 -3
- package/lib/cjs/payload.js.map +0 -1
- package/lib/cjs/project.js +0 -107
- package/lib/cjs/project.js.map +0 -1
- package/lib/cjs/prompt.js +0 -20
- package/lib/cjs/prompt.js.map +0 -1
- package/lib/cjs/query.js +0 -3
- package/lib/cjs/query.js.map +0 -1
- package/lib/cjs/rate-limiter.js +0 -6
- package/lib/cjs/rate-limiter.js.map +0 -1
- package/lib/cjs/refs.js +0 -14
- package/lib/cjs/refs.js.map +0 -1
- package/lib/cjs/runs.js +0 -3
- package/lib/cjs/runs.js.map +0 -1
- package/lib/cjs/skill.js +0 -14
- package/lib/cjs/skill.js.map +0 -1
- package/lib/cjs/store/activity-catalog.js +0 -3
- package/lib/cjs/store/activity-catalog.js.map +0 -1
- package/lib/cjs/store/collections.js +0 -9
- package/lib/cjs/store/collections.js.map +0 -1
- package/lib/cjs/store/common.js +0 -3
- package/lib/cjs/store/common.js.map +0 -1
- package/lib/cjs/store/doc-analyzer.js +0 -3
- package/lib/cjs/store/doc-analyzer.js.map +0 -1
- package/lib/cjs/store/dsl-workflow.js +0 -5
- package/lib/cjs/store/dsl-workflow.js.map +0 -1
- package/lib/cjs/store/index.js +0 -28
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/cjs/store/object-types.js +0 -98
- package/lib/cjs/store/object-types.js.map +0 -1
- package/lib/cjs/store/signals.js +0 -3
- package/lib/cjs/store/signals.js.map +0 -1
- package/lib/cjs/store/store.js +0 -55
- package/lib/cjs/store/store.js.map +0 -1
- package/lib/cjs/store/temporalio.js +0 -44
- package/lib/cjs/store/temporalio.js.map +0 -1
- package/lib/cjs/store/worker.js +0 -3
- package/lib/cjs/store/worker.js.map +0 -1
- package/lib/cjs/store/workflow.js +0 -49
- package/lib/cjs/store/workflow.js.map +0 -1
- package/lib/cjs/sts-token-types.js +0 -32
- package/lib/cjs/sts-token-types.js.map +0 -1
- package/lib/cjs/tenant.js +0 -3
- package/lib/cjs/tenant.js.map +0 -1
- package/lib/cjs/training.js +0 -14
- package/lib/cjs/training.js.map +0 -1
- package/lib/cjs/transient-tokens.js +0 -9
- package/lib/cjs/transient-tokens.js.map +0 -1
- package/lib/cjs/user.js +0 -25
- package/lib/cjs/user.js.map +0 -1
- package/lib/cjs/utils/auth.js +0 -15
- package/lib/cjs/utils/auth.js.map +0 -1
- package/lib/cjs/utils/schemas.js +0 -114
- package/lib/cjs/utils/schemas.js.map +0 -1
- package/lib/cjs/utils/type-helpers.js +0 -3
- package/lib/cjs/utils/type-helpers.js.map +0 -1
- package/lib/cjs/versions.js +0 -8
- package/lib/cjs/versions.js.map +0 -1
- package/lib/esm/Progress.js +0 -57
- package/lib/esm/Progress.js.map +0 -1
- package/lib/esm/access-control.js +0 -53
- package/lib/esm/access-control.js.map +0 -1
- package/lib/esm/analytics.js +0 -2
- package/lib/esm/analytics.js.map +0 -1
- package/lib/esm/apikey.js +0 -13
- package/lib/esm/apikey.js.map +0 -1
- package/lib/esm/apps.js +0 -2
- package/lib/esm/apps.js.map +0 -1
- package/lib/esm/common.js +0 -2
- package/lib/esm/common.js.map +0 -1
- package/lib/esm/environment.js +0 -41
- package/lib/esm/environment.js.map +0 -1
- package/lib/esm/facets.js +0 -2
- package/lib/esm/facets.js.map +0 -1
- package/lib/esm/group.js +0 -2
- package/lib/esm/group.js.map +0 -1
- package/lib/esm/index.js +0 -33
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/integrations.js +0 -9
- package/lib/esm/integrations.js.map +0 -1
- package/lib/esm/interaction.js +0 -71
- package/lib/esm/interaction.js.map +0 -1
- package/lib/esm/json-schema.js +0 -2
- package/lib/esm/json-schema.js.map +0 -1
- package/lib/esm/json.js +0 -2
- package/lib/esm/json.js.map +0 -1
- package/lib/esm/meters.js +0 -10
- package/lib/esm/meters.js.map +0 -1
- package/lib/esm/model_utility.js +0 -2
- package/lib/esm/model_utility.js.map +0 -1
- package/lib/esm/payload.js +0 -2
- package/lib/esm/payload.js.map +0 -1
- package/lib/esm/project.js +0 -102
- package/lib/esm/project.js.map +0 -1
- package/lib/esm/prompt.js +0 -17
- package/lib/esm/prompt.js.map +0 -1
- package/lib/esm/query.js +0 -2
- package/lib/esm/query.js.map +0 -1
- package/lib/esm/rate-limiter.js +0 -5
- package/lib/esm/rate-limiter.js.map +0 -1
- package/lib/esm/refs.js +0 -11
- package/lib/esm/refs.js.map +0 -1
- package/lib/esm/runs.js +0 -2
- package/lib/esm/runs.js.map +0 -1
- package/lib/esm/skill.js +0 -13
- package/lib/esm/skill.js.map +0 -1
- package/lib/esm/store/activity-catalog.js +0 -2
- package/lib/esm/store/activity-catalog.js.map +0 -1
- package/lib/esm/store/collections.js +0 -6
- package/lib/esm/store/collections.js.map +0 -1
- package/lib/esm/store/common.js +0 -2
- package/lib/esm/store/common.js.map +0 -1
- package/lib/esm/store/doc-analyzer.js +0 -2
- package/lib/esm/store/doc-analyzer.js.map +0 -1
- package/lib/esm/store/dsl-workflow.js +0 -2
- package/lib/esm/store/dsl-workflow.js.map +0 -1
- package/lib/esm/store/index.js +0 -12
- package/lib/esm/store/index.js.map +0 -1
- package/lib/esm/store/object-types.js +0 -95
- package/lib/esm/store/object-types.js.map +0 -1
- package/lib/esm/store/signals.js +0 -2
- package/lib/esm/store/signals.js.map +0 -1
- package/lib/esm/store/store.js +0 -52
- package/lib/esm/store/store.js.map +0 -1
- package/lib/esm/store/temporalio.js +0 -41
- package/lib/esm/store/temporalio.js.map +0 -1
- package/lib/esm/store/worker.js +0 -2
- package/lib/esm/store/worker.js.map +0 -1
- package/lib/esm/store/workflow.js +0 -45
- package/lib/esm/store/workflow.js.map +0 -1
- package/lib/esm/sts-token-types.js +0 -24
- package/lib/esm/sts-token-types.js.map +0 -1
- package/lib/esm/tenant.js +0 -2
- package/lib/esm/tenant.js.map +0 -1
- package/lib/esm/training.js +0 -11
- package/lib/esm/training.js.map +0 -1
- package/lib/esm/transient-tokens.js +0 -6
- package/lib/esm/transient-tokens.js.map +0 -1
- package/lib/esm/user.js +0 -22
- package/lib/esm/user.js.map +0 -1
- package/lib/esm/utils/auth.js +0 -11
- package/lib/esm/utils/auth.js.map +0 -1
- package/lib/esm/utils/schemas.js +0 -107
- package/lib/esm/utils/schemas.js.map +0 -1
- package/lib/esm/utils/type-helpers.js +0 -2
- package/lib/esm/utils/type-helpers.js.map +0 -1
- package/lib/esm/versions.js +0 -5
- package/lib/esm/versions.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/Progress.d.ts +0 -21
- package/lib/types/Progress.d.ts.map +0 -1
- package/lib/types/access-control.d.ts +0 -73
- package/lib/types/access-control.d.ts.map +0 -1
- package/lib/types/analytics.d.ts +0 -85
- package/lib/types/analytics.d.ts.map +0 -1
- package/lib/types/apikey.d.ts +0 -80
- package/lib/types/apikey.d.ts.map +0 -1
- package/lib/types/apps.d.ts +0 -102
- package/lib/types/apps.d.ts.map +0 -1
- package/lib/types/common.d.ts +0 -31
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/environment.d.ts +0 -106
- package/lib/types/environment.d.ts.map +0 -1
- package/lib/types/facets.d.ts +0 -34
- package/lib/types/facets.d.ts.map +0 -1
- package/lib/types/group.d.ts +0 -21
- package/lib/types/group.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -33
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/integrations.d.ts +0 -28
- package/lib/types/integrations.d.ts.map +0 -1
- package/lib/types/interaction.d.ts +0 -727
- package/lib/types/interaction.d.ts.map +0 -1
- package/lib/types/json-schema.d.ts +0 -1
- package/lib/types/json-schema.d.ts.map +0 -1
- package/lib/types/json.d.ts +0 -1
- package/lib/types/json.d.ts.map +0 -1
- package/lib/types/meters.d.ts +0 -23
- package/lib/types/meters.d.ts.map +0 -1
- package/lib/types/model_utility.d.ts +0 -1
- package/lib/types/model_utility.d.ts.map +0 -1
- package/lib/types/payload.d.ts +0 -60
- package/lib/types/payload.d.ts.map +0 -1
- package/lib/types/project.d.ts +0 -173
- package/lib/types/project.d.ts.map +0 -1
- package/lib/types/prompt.d.ts +0 -77
- package/lib/types/prompt.d.ts.map +0 -1
- package/lib/types/query.d.ts +0 -118
- package/lib/types/query.d.ts.map +0 -1
- package/lib/types/rate-limiter.d.ts +0 -28
- package/lib/types/rate-limiter.d.ts.map +0 -1
- package/lib/types/refs.d.ts +0 -22
- package/lib/types/refs.d.ts.map +0 -1
- package/lib/types/runs.d.ts +0 -32
- package/lib/types/runs.d.ts.map +0 -1
- package/lib/types/skill.d.ts +0 -78
- package/lib/types/skill.d.ts.map +0 -1
- package/lib/types/store/activity-catalog.d.ts +0 -26
- package/lib/types/store/activity-catalog.d.ts.map +0 -1
- package/lib/types/store/collections.d.ts +0 -78
- package/lib/types/store/collections.d.ts.map +0 -1
- package/lib/types/store/common.d.ts +0 -22
- package/lib/types/store/common.d.ts.map +0 -1
- package/lib/types/store/doc-analyzer.d.ts +0 -140
- package/lib/types/store/doc-analyzer.d.ts.map +0 -1
- package/lib/types/store/dsl-workflow.d.ts +0 -238
- package/lib/types/store/dsl-workflow.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -11
- package/lib/types/store/index.d.ts.map +0 -1
- package/lib/types/store/object-types.d.ts +0 -23
- package/lib/types/store/object-types.d.ts.map +0 -1
- package/lib/types/store/signals.d.ts +0 -5
- package/lib/types/store/signals.d.ts.map +0 -1
- package/lib/types/store/store.d.ts +0 -358
- package/lib/types/store/store.d.ts.map +0 -1
- package/lib/types/store/temporalio.d.ts +0 -16
- package/lib/types/store/temporalio.d.ts.map +0 -1
- package/lib/types/store/worker.d.ts +0 -18
- package/lib/types/store/worker.d.ts.map +0 -1
- package/lib/types/store/workflow.d.ts +0 -439
- package/lib/types/store/workflow.d.ts.map +0 -1
- package/lib/types/sts-token-types.d.ts +0 -72
- package/lib/types/sts-token-types.d.ts.map +0 -1
- package/lib/types/tenant.d.ts +0 -10
- package/lib/types/tenant.d.ts.map +0 -1
- package/lib/types/training.d.ts +0 -38
- package/lib/types/training.d.ts.map +0 -1
- package/lib/types/transient-tokens.d.ts +0 -24
- package/lib/types/transient-tokens.d.ts.map +0 -1
- package/lib/types/user.d.ts +0 -116
- package/lib/types/user.d.ts.map +0 -1
- package/lib/types/utils/auth.d.ts +0 -3
- package/lib/types/utils/auth.d.ts.map +0 -1
- package/lib/types/utils/schemas.d.ts +0 -9
- package/lib/types/utils/schemas.d.ts.map +0 -1
- package/lib/types/utils/type-helpers.d.ts +0 -3
- package/lib/types/utils/type-helpers.d.ts.map +0 -1
- package/lib/types/versions.d.ts +0 -3
- package/lib/types/versions.d.ts.map +0 -1
- package/lib/vertesia-common.js +0 -2
- package/lib/vertesia-common.js.map +0 -1
package/src/project.ts
CHANGED
|
@@ -176,6 +176,36 @@ export interface ProjectConfiguration {
|
|
|
176
176
|
datacenter?: string;
|
|
177
177
|
storage_bucket?: string;
|
|
178
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Enable real-time streaming of agent LLM responses to clients.
|
|
181
|
+
* When enabled, LLM responses are streamed chunk-by-chunk via Redis pub/sub.
|
|
182
|
+
* Defaults to true if not specified.
|
|
183
|
+
*/
|
|
184
|
+
agent_streaming_enabled?: boolean;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Indexing configuration for this project.
|
|
188
|
+
* Controls whether indexing and querying are enabled at the project level.
|
|
189
|
+
*/
|
|
190
|
+
indexing?: {
|
|
191
|
+
/**
|
|
192
|
+
* Enable indexing for content objects in this project.
|
|
193
|
+
* When enabled, content changes trigger indexing workflows.
|
|
194
|
+
* Defaults to true - indexing is always on when ES infrastructure is available.
|
|
195
|
+
*/
|
|
196
|
+
enabled?: boolean;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Primary language for full-text search analysis.
|
|
201
|
+
* ISO 639-1 code (e.g., 'en', 'fr', 'ja', 'de').
|
|
202
|
+
* Determines which Elasticsearch analyzer is used for the text field.
|
|
203
|
+
* Defaults to 'en' (English/standard analyzer).
|
|
204
|
+
*
|
|
205
|
+
* Changing this value requires a full reindex to take effect.
|
|
206
|
+
*/
|
|
207
|
+
main_language?: string;
|
|
208
|
+
|
|
179
209
|
}
|
|
180
210
|
|
|
181
211
|
// export interface ProjectConfigurationEmbeddings {
|
|
@@ -239,7 +269,6 @@ export const ProjectRefPopulate = "id name account";
|
|
|
239
269
|
export interface EmbeddingsStatusResponse {
|
|
240
270
|
status: string;
|
|
241
271
|
embeddingRunsInProgress?: number;
|
|
242
|
-
totalRunsInProgress?: number;
|
|
243
272
|
totalIndexableObjects?: number;
|
|
244
273
|
embeddingsModels?: string[];
|
|
245
274
|
objectsWithEmbeddings?: number;
|
|
@@ -250,6 +279,66 @@ export interface EmbeddingsStatusResponse {
|
|
|
250
279
|
}
|
|
251
280
|
}
|
|
252
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Response from indexing status endpoint
|
|
284
|
+
*/
|
|
285
|
+
export interface IndexingStatusResponse {
|
|
286
|
+
/** Whether indexing infrastructure is available globally */
|
|
287
|
+
infrastructureEnabled: boolean;
|
|
288
|
+
/** Whether indexing is enabled for this project */
|
|
289
|
+
indexingEnabled: boolean;
|
|
290
|
+
/** @deprecated Now derived from indexingEnabled - queries automatically route to index when indexing is enabled */
|
|
291
|
+
query_enabled: boolean;
|
|
292
|
+
/** Index status */
|
|
293
|
+
index: {
|
|
294
|
+
/** Whether the index exists */
|
|
295
|
+
exists: boolean;
|
|
296
|
+
/** Alias name (used for queries) */
|
|
297
|
+
aliasName: string;
|
|
298
|
+
/** Actual index name (versioned) */
|
|
299
|
+
indexName: string;
|
|
300
|
+
/** Index version (timestamp when created) */
|
|
301
|
+
version: number;
|
|
302
|
+
/** When the current index was created */
|
|
303
|
+
createdAt: string | null;
|
|
304
|
+
/** Number of documents in the index */
|
|
305
|
+
documentCount: number;
|
|
306
|
+
/** Index size in bytes */
|
|
307
|
+
sizeBytes: number;
|
|
308
|
+
};
|
|
309
|
+
/** MongoDB document count for comparison */
|
|
310
|
+
mongoDocumentCount: number;
|
|
311
|
+
/** Whether a reindex is currently in progress */
|
|
312
|
+
reindexInProgress: boolean;
|
|
313
|
+
/** Reindex progress (if reindex is in progress) */
|
|
314
|
+
reindexProgress?: {
|
|
315
|
+
/** Total documents to reindex */
|
|
316
|
+
total: number;
|
|
317
|
+
/** Documents processed so far */
|
|
318
|
+
processed: number;
|
|
319
|
+
/** Successfully indexed documents */
|
|
320
|
+
successful: number;
|
|
321
|
+
/** Failed documents */
|
|
322
|
+
failed: number;
|
|
323
|
+
/** Current status (e.g., "indexing", "complete") */
|
|
324
|
+
status: string;
|
|
325
|
+
/** Current batch number */
|
|
326
|
+
currentBatch: number;
|
|
327
|
+
/** Total number of batches */
|
|
328
|
+
totalBatches: number;
|
|
329
|
+
/** Percentage complete (0-100) */
|
|
330
|
+
percentComplete: number;
|
|
331
|
+
/** Batches processed per second */
|
|
332
|
+
batchesPerSecond: number;
|
|
333
|
+
/** Documents processed per second */
|
|
334
|
+
docsPerSecond: number;
|
|
335
|
+
/** Elapsed time in seconds */
|
|
336
|
+
elapsedSeconds: number;
|
|
337
|
+
/** Estimated seconds remaining (null if unknown) */
|
|
338
|
+
estimatedSecondsRemaining: number | null;
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
253
342
|
export interface ProjectIntegrationListEntry {
|
|
254
343
|
id: SupportedIntegrations;
|
|
255
344
|
enabled: boolean;
|
package/src/prompt.ts
CHANGED
|
@@ -53,8 +53,9 @@ export interface PromptTemplateRefWithSchema extends PromptTemplateRef {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export enum TemplateType {
|
|
56
|
-
text = "text",
|
|
57
56
|
jst = "jst",
|
|
57
|
+
handlebars = "handlebars",
|
|
58
|
+
text = "text",
|
|
58
59
|
}
|
|
59
60
|
export interface ExecutablePromptTemplate {
|
|
60
61
|
role: PromptRole;
|
package/src/skill.ts
CHANGED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { CompletionResult, ExecutionTokenUsage, StatelessExecutionOptions, ToolUse } from "@llumiverse/common";
|
|
2
|
+
import { ConversationStripOptions, ResolvedInteractionExecutionInfo, UserChannel } from "../interaction.js";
|
|
3
|
+
import { ExecutionRunDocRef } from "../runs.js";
|
|
4
|
+
import { Plan, WorkflowAncestor } from "./workflow.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lightweight tool reference for activity payloads.
|
|
8
|
+
* References tools stored in GCP instead of embedding full tool definitions.
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolReference {
|
|
11
|
+
storage_key: string;
|
|
12
|
+
tool_count: number;
|
|
13
|
+
stored_at: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Conversation state passed between workflow activities.
|
|
18
|
+
* Contains all context needed to continue a multi-turn agent conversation.
|
|
19
|
+
*/
|
|
20
|
+
export interface ConversationState {
|
|
21
|
+
/**
|
|
22
|
+
* A reference to the run that started the conversation
|
|
23
|
+
*/
|
|
24
|
+
run: ExecutionRunDocRef;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The execution environment with provider info for LLM calls.
|
|
28
|
+
*/
|
|
29
|
+
environment: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The options to use on the next call.
|
|
33
|
+
*/
|
|
34
|
+
options: StatelessExecutionOptions;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The tools to call next.
|
|
38
|
+
*/
|
|
39
|
+
tool_use?: ToolUse[];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The output of the this conversation step
|
|
43
|
+
*/
|
|
44
|
+
output: CompletionResult[];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The token usage of the this conversation step
|
|
48
|
+
*/
|
|
49
|
+
token_usage?: ExecutionTokenUsage;
|
|
50
|
+
|
|
51
|
+
/** If a sub workflow execution, contains the parent's info */
|
|
52
|
+
parent?: WorkflowAncestor;
|
|
53
|
+
|
|
54
|
+
/** Full ancestry chain from root to immediate parent (for hierarchical aggregation) */
|
|
55
|
+
ancestors: WorkflowAncestor[];
|
|
56
|
+
|
|
57
|
+
/** If part of a larger agentic workflow, task id of this task */
|
|
58
|
+
task_id?: string;
|
|
59
|
+
|
|
60
|
+
/** Stores the most recent plan for reference by plan-related tools */
|
|
61
|
+
plan?: Plan;
|
|
62
|
+
|
|
63
|
+
/** Debug mode (more logs and persisted artifacts) */
|
|
64
|
+
debug?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Configuration for stripping large data from conversation history.
|
|
68
|
+
* Passed to llumiverse ExecutionOptions.stripImagesAfterTurns.
|
|
69
|
+
*/
|
|
70
|
+
strip_options?: ConversationStripOptions;
|
|
71
|
+
|
|
72
|
+
/** Conversation artifacts base url */
|
|
73
|
+
conversation_artifacts_base_url?: string;
|
|
74
|
+
|
|
75
|
+
/** Reference to tools stored in GCP instead of embedding full tool definitions */
|
|
76
|
+
tool_reference?: ToolReference;
|
|
77
|
+
|
|
78
|
+
/** Names of currently active tools (base + unlocked). Tool definitions loaded from tool_reference. */
|
|
79
|
+
active_tool_names?: string[];
|
|
80
|
+
|
|
81
|
+
/** Skills that have been used in this conversation (for auto-syncing scripts and package installation) */
|
|
82
|
+
used_skills?: UsedSkill[];
|
|
83
|
+
|
|
84
|
+
/** All available skills from registered tool collections (for upfront hydration in sandbox) */
|
|
85
|
+
available_skills?: AvailableSkill[];
|
|
86
|
+
|
|
87
|
+
/** Whether to stream LLM responses to Redis (cached from project config) */
|
|
88
|
+
streaming_enabled?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Active communication channels with their current state.
|
|
92
|
+
* Channels can be updated as conversation progresses (e.g., email threading info).
|
|
93
|
+
*/
|
|
94
|
+
user_channels?: UserChannel[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The resolved interaction execution info.
|
|
98
|
+
* Contains interaction ID, name, version, and environment details.
|
|
99
|
+
*/
|
|
100
|
+
resolvedInteraction?: ResolvedInteractionExecutionInfo;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* End conversation metadata set when end_conversation tool is called.
|
|
104
|
+
* Signals the workflow to terminate gracefully.
|
|
105
|
+
*/
|
|
106
|
+
end_conversation?: {
|
|
107
|
+
final_result?: string;
|
|
108
|
+
status?: 'success' | 'failure';
|
|
109
|
+
reason?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Tools that have been unlocked by skills during the conversation.
|
|
114
|
+
* These tools were initially hidden (default: false) but became available
|
|
115
|
+
* when a skill with related_tools was called.
|
|
116
|
+
*/
|
|
117
|
+
unlocked_tools?: string[];
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Activity ID from the latest LLM call (for deduplication with streamed content).
|
|
121
|
+
* Set by streamToRedis when completing async activities.
|
|
122
|
+
*/
|
|
123
|
+
latest_activity_id?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Mapping of skill names to their related tools.
|
|
127
|
+
* When a skill is called, its related tools are added to unlocked_tools.
|
|
128
|
+
*/
|
|
129
|
+
skill_tool_map?: Record<string, string[]>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Skill metadata collected at workflow start for upfront sandbox hydration */
|
|
133
|
+
export interface AvailableSkill {
|
|
134
|
+
/** Skill name (e.g., "analyze_data") - without the "learn_" prefix */
|
|
135
|
+
name: string;
|
|
136
|
+
/** Source URL of the skill collection (e.g., "https://tools.vertesia.io/api/skills/data-analysis") */
|
|
137
|
+
src: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Skill metadata tracked when a skill is used */
|
|
141
|
+
export interface UsedSkill {
|
|
142
|
+
/** Skill name (e.g., "analyze_data") */
|
|
143
|
+
name: string;
|
|
144
|
+
/** Source URL of the skill collection (e.g., "https://tools.vertesia.io/api/skills/data-analysis") */
|
|
145
|
+
src: string;
|
|
146
|
+
/** Programming language (e.g., "python") */
|
|
147
|
+
language?: string;
|
|
148
|
+
/** Required packages (e.g., ["pandas", "numpy"]) */
|
|
149
|
+
packages?: string[];
|
|
150
|
+
/** System-level packages to install via sudo apt-get (e.g., ["poppler-utils"]) */
|
|
151
|
+
system_packages?: string[];
|
|
152
|
+
}
|
|
@@ -190,11 +190,23 @@ export interface DSLChildWorkflowStep extends DSLWorkflowStepBase {
|
|
|
190
190
|
* since it may contain references to workflow execution vars.
|
|
191
191
|
*/
|
|
192
192
|
output?: string;
|
|
193
|
+
/**
|
|
194
|
+
* A JSON expression which evaluates to true or false similar to mongo matches.
|
|
195
|
+
* The child workflow will only execute if the condition is satisfied.
|
|
196
|
+
* Example: {$eq: {wfVarName: value}}
|
|
197
|
+
*/
|
|
198
|
+
condition?: Record<string, any>;
|
|
193
199
|
/**
|
|
194
200
|
* In case the dslWorkflow is used as a child workflow the spec is used to define the child workflow.
|
|
195
201
|
* If spec is defined then the name must be "dslWorkflow"
|
|
196
202
|
*/
|
|
197
203
|
spec?: DSLWorkflowSpec;
|
|
204
|
+
/**
|
|
205
|
+
* If true, copy the parent's workspace artifacts (scripts/, files/, skills/, docs/, out/)
|
|
206
|
+
* to the child workflow's agent space before execution. Defaults to true.
|
|
207
|
+
* conversation.json and tools.json are never copied.
|
|
208
|
+
*/
|
|
209
|
+
inherit_artifacts?: boolean;
|
|
198
210
|
options?: {
|
|
199
211
|
memo?: Record<string, any>;
|
|
200
212
|
retry?: DSLRetryPolicy;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { BaseObject } from "./common.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tool recommendation within a hive memory unit
|
|
5
|
+
*/
|
|
6
|
+
export interface HiveMemoryToolRecommendation {
|
|
7
|
+
tool_name: string;
|
|
8
|
+
guidance: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Memory unit scope - project-scoped by default, can be elevated to account
|
|
13
|
+
*/
|
|
14
|
+
export type HiveMemoryScope = 'project' | 'account';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Base interface for hive memory items (list/summary view)
|
|
18
|
+
*/
|
|
19
|
+
export interface HiveMemoryItem extends BaseObject {
|
|
20
|
+
// Classification
|
|
21
|
+
task_category: string; // "document-analysis", "data-extraction", etc.
|
|
22
|
+
domain?: string; // "financial", "legal", etc.
|
|
23
|
+
|
|
24
|
+
// Summary
|
|
25
|
+
summary: string;
|
|
26
|
+
|
|
27
|
+
// Tools involved in the learnings
|
|
28
|
+
tools_involved: string[];
|
|
29
|
+
|
|
30
|
+
// Quality metrics
|
|
31
|
+
confidence_score: number; // 0-1
|
|
32
|
+
usage_count: number;
|
|
33
|
+
success_correlation: number; // correlation with successful runs
|
|
34
|
+
contribution_count: number; // number of runs that contributed
|
|
35
|
+
|
|
36
|
+
// Scoping
|
|
37
|
+
scope: HiveMemoryScope;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Full hive memory unit with all learnings and patterns
|
|
42
|
+
*/
|
|
43
|
+
export interface HiveMemory extends HiveMemoryItem {
|
|
44
|
+
// Objective patterns this memory applies to
|
|
45
|
+
objective_patterns: string[];
|
|
46
|
+
|
|
47
|
+
// Learnings
|
|
48
|
+
general_learnings: string[];
|
|
49
|
+
best_practices: string[];
|
|
50
|
+
pitfalls_to_avoid: string[];
|
|
51
|
+
tool_recommendations: HiveMemoryToolRecommendation[];
|
|
52
|
+
|
|
53
|
+
// Vector search
|
|
54
|
+
embedding?: number[];
|
|
55
|
+
|
|
56
|
+
// Security field for granular permissions
|
|
57
|
+
security?: Record<string, string[]>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Payload for creating a new hive memory unit
|
|
62
|
+
*/
|
|
63
|
+
export interface CreateHiveMemoryPayload {
|
|
64
|
+
// Classification
|
|
65
|
+
task_category: string;
|
|
66
|
+
domain?: string;
|
|
67
|
+
|
|
68
|
+
// Content
|
|
69
|
+
summary: string;
|
|
70
|
+
objective_patterns: string[];
|
|
71
|
+
|
|
72
|
+
// Learnings
|
|
73
|
+
general_learnings: string[];
|
|
74
|
+
best_practices?: string[];
|
|
75
|
+
pitfalls_to_avoid?: string[];
|
|
76
|
+
tool_recommendations?: HiveMemoryToolRecommendation[];
|
|
77
|
+
|
|
78
|
+
// Metadata
|
|
79
|
+
tools_involved?: string[];
|
|
80
|
+
|
|
81
|
+
// Quality (optional, defaults applied)
|
|
82
|
+
confidence_score?: number;
|
|
83
|
+
|
|
84
|
+
// Scoping
|
|
85
|
+
scope?: HiveMemoryScope;
|
|
86
|
+
|
|
87
|
+
// Standard fields
|
|
88
|
+
name?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
tags?: string[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Payload for updating an existing hive memory unit
|
|
95
|
+
*/
|
|
96
|
+
export interface UpdateHiveMemoryPayload {
|
|
97
|
+
// Classification updates
|
|
98
|
+
task_category?: string;
|
|
99
|
+
domain?: string;
|
|
100
|
+
|
|
101
|
+
// Content updates
|
|
102
|
+
summary?: string;
|
|
103
|
+
|
|
104
|
+
// Array additions (merged with existing)
|
|
105
|
+
add_objective_patterns?: string[];
|
|
106
|
+
add_general_learnings?: string[];
|
|
107
|
+
add_best_practices?: string[];
|
|
108
|
+
add_pitfalls_to_avoid?: string[];
|
|
109
|
+
add_tool_recommendations?: HiveMemoryToolRecommendation[];
|
|
110
|
+
add_tools_involved?: string[];
|
|
111
|
+
|
|
112
|
+
// Quality updates
|
|
113
|
+
confidence_score?: number;
|
|
114
|
+
increment_usage_count?: boolean;
|
|
115
|
+
increment_contribution_count?: boolean;
|
|
116
|
+
success_correlation?: number;
|
|
117
|
+
|
|
118
|
+
// Scoping
|
|
119
|
+
scope?: HiveMemoryScope;
|
|
120
|
+
|
|
121
|
+
// Standard fields
|
|
122
|
+
name?: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
tags?: string[];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Search parameters for finding relevant memories
|
|
129
|
+
*/
|
|
130
|
+
export interface HiveMemorySearchParams {
|
|
131
|
+
// Semantic search
|
|
132
|
+
query?: string; // Natural language query
|
|
133
|
+
embedding?: number[]; // Pre-computed embedding for vector search
|
|
134
|
+
|
|
135
|
+
// Filters
|
|
136
|
+
task_category?: string;
|
|
137
|
+
domain?: string;
|
|
138
|
+
tools_involved?: string[];
|
|
139
|
+
scope?: HiveMemoryScope;
|
|
140
|
+
min_confidence?: number; // Minimum confidence score (0-1)
|
|
141
|
+
|
|
142
|
+
// Pagination
|
|
143
|
+
limit?: number; // Default: 5
|
|
144
|
+
offset?: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Response from memory search
|
|
149
|
+
*/
|
|
150
|
+
export interface HiveMemorySearchResult {
|
|
151
|
+
memories: HiveMemory[];
|
|
152
|
+
total: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Formatted memory for agent consumption
|
|
157
|
+
*/
|
|
158
|
+
export interface FormattedMemoryForAgent {
|
|
159
|
+
category: string;
|
|
160
|
+
domain?: string;
|
|
161
|
+
summary: string;
|
|
162
|
+
learnings: string[];
|
|
163
|
+
best_practices: string[];
|
|
164
|
+
pitfalls_to_avoid: string[];
|
|
165
|
+
tool_guidance: { tool: string; guidance: string }[];
|
|
166
|
+
confidence: number;
|
|
167
|
+
}
|
package/src/store/index.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export * from "./activity-catalog.js";
|
|
2
2
|
export * from "./collections.js";
|
|
3
3
|
export * from "./common.js";
|
|
4
|
+
export * from "./conversation-state.js";
|
|
4
5
|
export * from "./doc-analyzer.js";
|
|
5
6
|
export * from "./dsl-workflow.js";
|
|
7
|
+
export * from "./hive-memory.js";
|
|
6
8
|
export * from "./object-types.js";
|
|
9
|
+
export * from "./schedule.js";
|
|
7
10
|
export * from "./signals.js";
|
|
8
11
|
export * from "./store.js";
|
|
9
12
|
export * from "./temporalio.js";
|