@vertesia/common 0.80.0 → 0.80.1

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 (278) hide show
  1. package/package.json +1 -1
  2. package/src/store/index.ts +3 -2
  3. package/src/store/worker.ts +19 -0
  4. package/lib/cjs/Progress.js +0 -61
  5. package/lib/cjs/Progress.js.map +0 -1
  6. package/lib/cjs/access-control.js +0 -56
  7. package/lib/cjs/access-control.js.map +0 -1
  8. package/lib/cjs/analytics.js +0 -3
  9. package/lib/cjs/analytics.js.map +0 -1
  10. package/lib/cjs/apikey.js +0 -16
  11. package/lib/cjs/apikey.js.map +0 -1
  12. package/lib/cjs/apps.js +0 -3
  13. package/lib/cjs/apps.js.map +0 -1
  14. package/lib/cjs/common.js +0 -3
  15. package/lib/cjs/common.js.map +0 -1
  16. package/lib/cjs/environment.js +0 -44
  17. package/lib/cjs/environment.js.map +0 -1
  18. package/lib/cjs/facets.js +0 -3
  19. package/lib/cjs/facets.js.map +0 -1
  20. package/lib/cjs/group.js +0 -5
  21. package/lib/cjs/group.js.map +0 -1
  22. package/lib/cjs/index.js +0 -49
  23. package/lib/cjs/index.js.map +0 -1
  24. package/lib/cjs/integrations.js +0 -12
  25. package/lib/cjs/integrations.js.map +0 -1
  26. package/lib/cjs/interaction.js +0 -74
  27. package/lib/cjs/interaction.js.map +0 -1
  28. package/lib/cjs/json-schema.js +0 -3
  29. package/lib/cjs/json-schema.js.map +0 -1
  30. package/lib/cjs/json.js +0 -3
  31. package/lib/cjs/json.js.map +0 -1
  32. package/lib/cjs/meters.js +0 -13
  33. package/lib/cjs/meters.js.map +0 -1
  34. package/lib/cjs/model_utility.js +0 -6
  35. package/lib/cjs/model_utility.js.map +0 -1
  36. package/lib/cjs/package.json +0 -3
  37. package/lib/cjs/payload.js +0 -3
  38. package/lib/cjs/payload.js.map +0 -1
  39. package/lib/cjs/project.js +0 -107
  40. package/lib/cjs/project.js.map +0 -1
  41. package/lib/cjs/prompt.js +0 -20
  42. package/lib/cjs/prompt.js.map +0 -1
  43. package/lib/cjs/query.js +0 -3
  44. package/lib/cjs/query.js.map +0 -1
  45. package/lib/cjs/rate-limiter.js +0 -6
  46. package/lib/cjs/rate-limiter.js.map +0 -1
  47. package/lib/cjs/refs.js +0 -14
  48. package/lib/cjs/refs.js.map +0 -1
  49. package/lib/cjs/runs.js +0 -3
  50. package/lib/cjs/runs.js.map +0 -1
  51. package/lib/cjs/skill.js +0 -14
  52. package/lib/cjs/skill.js.map +0 -1
  53. package/lib/cjs/store/activity-catalog.js +0 -3
  54. package/lib/cjs/store/activity-catalog.js.map +0 -1
  55. package/lib/cjs/store/agent.js +0 -3
  56. package/lib/cjs/store/agent.js.map +0 -1
  57. package/lib/cjs/store/collections.js +0 -9
  58. package/lib/cjs/store/collections.js.map +0 -1
  59. package/lib/cjs/store/common.js +0 -3
  60. package/lib/cjs/store/common.js.map +0 -1
  61. package/lib/cjs/store/doc-analyzer.js +0 -3
  62. package/lib/cjs/store/doc-analyzer.js.map +0 -1
  63. package/lib/cjs/store/dsl-workflow.js +0 -5
  64. package/lib/cjs/store/dsl-workflow.js.map +0 -1
  65. package/lib/cjs/store/index.js +0 -28
  66. package/lib/cjs/store/index.js.map +0 -1
  67. package/lib/cjs/store/object-types.js +0 -98
  68. package/lib/cjs/store/object-types.js.map +0 -1
  69. package/lib/cjs/store/signals.js +0 -3
  70. package/lib/cjs/store/signals.js.map +0 -1
  71. package/lib/cjs/store/store.js +0 -55
  72. package/lib/cjs/store/store.js.map +0 -1
  73. package/lib/cjs/store/temporalio.js +0 -44
  74. package/lib/cjs/store/temporalio.js.map +0 -1
  75. package/lib/cjs/store/workflow.js +0 -49
  76. package/lib/cjs/store/workflow.js.map +0 -1
  77. package/lib/cjs/sts-token-types.js +0 -32
  78. package/lib/cjs/sts-token-types.js.map +0 -1
  79. package/lib/cjs/tenant.js +0 -3
  80. package/lib/cjs/tenant.js.map +0 -1
  81. package/lib/cjs/training.js +0 -14
  82. package/lib/cjs/training.js.map +0 -1
  83. package/lib/cjs/transient-tokens.js +0 -9
  84. package/lib/cjs/transient-tokens.js.map +0 -1
  85. package/lib/cjs/user.js +0 -17
  86. package/lib/cjs/user.js.map +0 -1
  87. package/lib/cjs/utils/auth.js +0 -15
  88. package/lib/cjs/utils/auth.js.map +0 -1
  89. package/lib/cjs/utils/schemas.js +0 -114
  90. package/lib/cjs/utils/schemas.js.map +0 -1
  91. package/lib/cjs/utils/type-helpers.js +0 -3
  92. package/lib/cjs/utils/type-helpers.js.map +0 -1
  93. package/lib/cjs/versions.js +0 -8
  94. package/lib/cjs/versions.js.map +0 -1
  95. package/lib/esm/Progress.js +0 -57
  96. package/lib/esm/Progress.js.map +0 -1
  97. package/lib/esm/access-control.js +0 -53
  98. package/lib/esm/access-control.js.map +0 -1
  99. package/lib/esm/analytics.js +0 -2
  100. package/lib/esm/analytics.js.map +0 -1
  101. package/lib/esm/apikey.js +0 -13
  102. package/lib/esm/apikey.js.map +0 -1
  103. package/lib/esm/apps.js +0 -2
  104. package/lib/esm/apps.js.map +0 -1
  105. package/lib/esm/common.js +0 -2
  106. package/lib/esm/common.js.map +0 -1
  107. package/lib/esm/environment.js +0 -41
  108. package/lib/esm/environment.js.map +0 -1
  109. package/lib/esm/facets.js +0 -2
  110. package/lib/esm/facets.js.map +0 -1
  111. package/lib/esm/group.js +0 -2
  112. package/lib/esm/group.js.map +0 -1
  113. package/lib/esm/index.js +0 -33
  114. package/lib/esm/index.js.map +0 -1
  115. package/lib/esm/integrations.js +0 -9
  116. package/lib/esm/integrations.js.map +0 -1
  117. package/lib/esm/interaction.js +0 -71
  118. package/lib/esm/interaction.js.map +0 -1
  119. package/lib/esm/json-schema.js +0 -2
  120. package/lib/esm/json-schema.js.map +0 -1
  121. package/lib/esm/json.js +0 -2
  122. package/lib/esm/json.js.map +0 -1
  123. package/lib/esm/meters.js +0 -10
  124. package/lib/esm/meters.js.map +0 -1
  125. package/lib/esm/model_utility.js +0 -2
  126. package/lib/esm/model_utility.js.map +0 -1
  127. package/lib/esm/payload.js +0 -2
  128. package/lib/esm/payload.js.map +0 -1
  129. package/lib/esm/project.js +0 -102
  130. package/lib/esm/project.js.map +0 -1
  131. package/lib/esm/prompt.js +0 -17
  132. package/lib/esm/prompt.js.map +0 -1
  133. package/lib/esm/query.js +0 -2
  134. package/lib/esm/query.js.map +0 -1
  135. package/lib/esm/rate-limiter.js +0 -5
  136. package/lib/esm/rate-limiter.js.map +0 -1
  137. package/lib/esm/refs.js +0 -11
  138. package/lib/esm/refs.js.map +0 -1
  139. package/lib/esm/runs.js +0 -2
  140. package/lib/esm/runs.js.map +0 -1
  141. package/lib/esm/skill.js +0 -13
  142. package/lib/esm/skill.js.map +0 -1
  143. package/lib/esm/store/activity-catalog.js +0 -2
  144. package/lib/esm/store/activity-catalog.js.map +0 -1
  145. package/lib/esm/store/agent.js +0 -2
  146. package/lib/esm/store/agent.js.map +0 -1
  147. package/lib/esm/store/collections.js +0 -6
  148. package/lib/esm/store/collections.js.map +0 -1
  149. package/lib/esm/store/common.js +0 -2
  150. package/lib/esm/store/common.js.map +0 -1
  151. package/lib/esm/store/doc-analyzer.js +0 -2
  152. package/lib/esm/store/doc-analyzer.js.map +0 -1
  153. package/lib/esm/store/dsl-workflow.js +0 -2
  154. package/lib/esm/store/dsl-workflow.js.map +0 -1
  155. package/lib/esm/store/index.js +0 -12
  156. package/lib/esm/store/index.js.map +0 -1
  157. package/lib/esm/store/object-types.js +0 -95
  158. package/lib/esm/store/object-types.js.map +0 -1
  159. package/lib/esm/store/signals.js +0 -2
  160. package/lib/esm/store/signals.js.map +0 -1
  161. package/lib/esm/store/store.js +0 -52
  162. package/lib/esm/store/store.js.map +0 -1
  163. package/lib/esm/store/temporalio.js +0 -41
  164. package/lib/esm/store/temporalio.js.map +0 -1
  165. package/lib/esm/store/workflow.js +0 -45
  166. package/lib/esm/store/workflow.js.map +0 -1
  167. package/lib/esm/sts-token-types.js +0 -24
  168. package/lib/esm/sts-token-types.js.map +0 -1
  169. package/lib/esm/tenant.js +0 -2
  170. package/lib/esm/tenant.js.map +0 -1
  171. package/lib/esm/training.js +0 -11
  172. package/lib/esm/training.js.map +0 -1
  173. package/lib/esm/transient-tokens.js +0 -6
  174. package/lib/esm/transient-tokens.js.map +0 -1
  175. package/lib/esm/user.js +0 -14
  176. package/lib/esm/user.js.map +0 -1
  177. package/lib/esm/utils/auth.js +0 -11
  178. package/lib/esm/utils/auth.js.map +0 -1
  179. package/lib/esm/utils/schemas.js +0 -107
  180. package/lib/esm/utils/schemas.js.map +0 -1
  181. package/lib/esm/utils/type-helpers.js +0 -2
  182. package/lib/esm/utils/type-helpers.js.map +0 -1
  183. package/lib/esm/versions.js +0 -5
  184. package/lib/esm/versions.js.map +0 -1
  185. package/lib/tsconfig.tsbuildinfo +0 -1
  186. package/lib/types/Progress.d.ts +0 -21
  187. package/lib/types/Progress.d.ts.map +0 -1
  188. package/lib/types/access-control.d.ts +0 -73
  189. package/lib/types/access-control.d.ts.map +0 -1
  190. package/lib/types/analytics.d.ts +0 -36
  191. package/lib/types/analytics.d.ts.map +0 -1
  192. package/lib/types/apikey.d.ts +0 -80
  193. package/lib/types/apikey.d.ts.map +0 -1
  194. package/lib/types/apps.d.ts +0 -100
  195. package/lib/types/apps.d.ts.map +0 -1
  196. package/lib/types/common.d.ts +0 -31
  197. package/lib/types/common.d.ts.map +0 -1
  198. package/lib/types/environment.d.ts +0 -84
  199. package/lib/types/environment.d.ts.map +0 -1
  200. package/lib/types/facets.d.ts +0 -34
  201. package/lib/types/facets.d.ts.map +0 -1
  202. package/lib/types/group.d.ts +0 -21
  203. package/lib/types/group.d.ts.map +0 -1
  204. package/lib/types/index.d.ts +0 -33
  205. package/lib/types/index.d.ts.map +0 -1
  206. package/lib/types/integrations.d.ts +0 -28
  207. package/lib/types/integrations.d.ts.map +0 -1
  208. package/lib/types/interaction.d.ts +0 -726
  209. package/lib/types/interaction.d.ts.map +0 -1
  210. package/lib/types/json-schema.d.ts +0 -1
  211. package/lib/types/json-schema.d.ts.map +0 -1
  212. package/lib/types/json.d.ts +0 -1
  213. package/lib/types/json.d.ts.map +0 -1
  214. package/lib/types/meters.d.ts +0 -23
  215. package/lib/types/meters.d.ts.map +0 -1
  216. package/lib/types/model_utility.d.ts +0 -1
  217. package/lib/types/model_utility.d.ts.map +0 -1
  218. package/lib/types/payload.d.ts +0 -60
  219. package/lib/types/payload.d.ts.map +0 -1
  220. package/lib/types/project.d.ts +0 -173
  221. package/lib/types/project.d.ts.map +0 -1
  222. package/lib/types/prompt.d.ts +0 -77
  223. package/lib/types/prompt.d.ts.map +0 -1
  224. package/lib/types/query.d.ts +0 -118
  225. package/lib/types/query.d.ts.map +0 -1
  226. package/lib/types/rate-limiter.d.ts +0 -28
  227. package/lib/types/rate-limiter.d.ts.map +0 -1
  228. package/lib/types/refs.d.ts +0 -22
  229. package/lib/types/refs.d.ts.map +0 -1
  230. package/lib/types/runs.d.ts +0 -32
  231. package/lib/types/runs.d.ts.map +0 -1
  232. package/lib/types/skill.d.ts +0 -78
  233. package/lib/types/skill.d.ts.map +0 -1
  234. package/lib/types/store/activity-catalog.d.ts +0 -26
  235. package/lib/types/store/activity-catalog.d.ts.map +0 -1
  236. package/lib/types/store/agent.d.ts +0 -18
  237. package/lib/types/store/agent.d.ts.map +0 -1
  238. package/lib/types/store/collections.d.ts +0 -78
  239. package/lib/types/store/collections.d.ts.map +0 -1
  240. package/lib/types/store/common.d.ts +0 -22
  241. package/lib/types/store/common.d.ts.map +0 -1
  242. package/lib/types/store/doc-analyzer.d.ts +0 -140
  243. package/lib/types/store/doc-analyzer.d.ts.map +0 -1
  244. package/lib/types/store/dsl-workflow.d.ts +0 -238
  245. package/lib/types/store/dsl-workflow.d.ts.map +0 -1
  246. package/lib/types/store/index.d.ts +0 -11
  247. package/lib/types/store/index.d.ts.map +0 -1
  248. package/lib/types/store/object-types.d.ts +0 -23
  249. package/lib/types/store/object-types.d.ts.map +0 -1
  250. package/lib/types/store/signals.d.ts +0 -5
  251. package/lib/types/store/signals.d.ts.map +0 -1
  252. package/lib/types/store/store.d.ts +0 -358
  253. package/lib/types/store/store.d.ts.map +0 -1
  254. package/lib/types/store/temporalio.d.ts +0 -16
  255. package/lib/types/store/temporalio.d.ts.map +0 -1
  256. package/lib/types/store/workflow.d.ts +0 -412
  257. package/lib/types/store/workflow.d.ts.map +0 -1
  258. package/lib/types/sts-token-types.d.ts +0 -72
  259. package/lib/types/sts-token-types.d.ts.map +0 -1
  260. package/lib/types/tenant.d.ts +0 -10
  261. package/lib/types/tenant.d.ts.map +0 -1
  262. package/lib/types/training.d.ts +0 -38
  263. package/lib/types/training.d.ts.map +0 -1
  264. package/lib/types/transient-tokens.d.ts +0 -24
  265. package/lib/types/transient-tokens.d.ts.map +0 -1
  266. package/lib/types/user.d.ts +0 -108
  267. package/lib/types/user.d.ts.map +0 -1
  268. package/lib/types/utils/auth.d.ts +0 -3
  269. package/lib/types/utils/auth.d.ts.map +0 -1
  270. package/lib/types/utils/schemas.d.ts +0 -9
  271. package/lib/types/utils/schemas.d.ts.map +0 -1
  272. package/lib/types/utils/type-helpers.d.ts +0 -3
  273. package/lib/types/utils/type-helpers.d.ts.map +0 -1
  274. package/lib/types/versions.d.ts +0 -3
  275. package/lib/types/versions.d.ts.map +0 -1
  276. package/lib/vertesia-common.js +0 -2
  277. package/lib/vertesia-common.js.map +0 -1
  278. package/src/store/agent.ts +0 -19
@@ -1,726 +0,0 @@
1
- import type { CompletionResult, JSONObject, JSONSchema, Modalities, ModelOptions, PromptRole, StatelessExecutionOptions, ToolDefinition, ToolUse } from "@llumiverse/common";
2
- import type { JSONSchema4 } from "json-schema";
3
- import { ExecutionTokenUsage } from "@llumiverse/common";
4
- import { ExecutionEnvironmentRef } from "./environment.js";
5
- import { ProjectRef } from "./project.js";
6
- import { ExecutablePromptSegmentDef, PopulatedPromptSegmentDef, PromptSegmentDef, PromptTemplateRef, PromptTemplateRefWithSchema, TemplateType } from "./prompt.js";
7
- import { ExecutionRunDocRef } from "./runs.js";
8
- import { AccountRef } from "./user.js";
9
- export interface InteractionExecutionError {
10
- code: string;
11
- message: string;
12
- data?: any;
13
- }
14
- /**
15
- * Reference to an interaction in the catalog.
16
- * Used in catalog listing. The id is composed of the namespace and the interaction name.
17
- * Stored interactions can use `oid:` prefix.
18
- * If no prefix is used it fallback on `oid:`.
19
- */
20
- export interface CatalogInteractionRef {
21
- /**
22
- * The type of interaction
23
- */
24
- type: "sys" | "app" | "stored" | "draft";
25
- /**
26
- * the interaction id that can be used to execute the interaction.
27
- */
28
- id: string;
29
- /**
30
- * The interaction name which identify the interaction in the provider interaction list.
31
- * For the stored interactions this is the same as the endpoint property.
32
- * For other types of interactions this is the local name of the interaction.
33
- */
34
- name: string;
35
- /**
36
- * Only applies for stored interactions. The version of the interaction.
37
- * Undefined for non stored interactions
38
- */
39
- version?: number;
40
- /**
41
- * Only applies for stored interactions. Whether the interaction is published or not.
42
- */
43
- published?: boolean;
44
- /**
45
- * The tags associated with the interaction.
46
- */
47
- tags: string[];
48
- /**
49
- * Agent Runner configuration options.
50
- */
51
- agent_runner_options?: AgentRunnerOptions;
52
- /**
53
- * The name of the interaction. For display purposes only.
54
- */
55
- title: string;
56
- /**
57
- * Optional description of the interaction.
58
- */
59
- description?: string;
60
- }
61
- export interface InCodePrompt {
62
- role: PromptRole;
63
- content: string;
64
- content_type: TemplateType;
65
- schema?: JSONSchema;
66
- /**
67
- * optional name of the prompt segment. Use kebab case for prompt names
68
- */
69
- name?: string;
70
- /**
71
- * optional reference to an external resource if any.
72
- * Used internally by the system to synchronize stored prompts with in-code prompts.
73
- */
74
- externalId?: string;
75
- }
76
- export interface InCodeInteraction {
77
- /**
78
- * The interaction type.
79
- */
80
- type: "sys" | "app" | "stored" | "draft";
81
- /**
82
- * The id of the interaction. Required.
83
- * The id is a unique identifier for the interaction.
84
- * It is recommended to use a URL safe string and not include spaces.
85
- * The id composaed by some namespace or prefix and the interaction name.
86
- * Example: sys:generic_question, app:review_contract, tmp:my_temp_interaction
87
- */
88
- id: string;
89
- /**
90
- * The interaction code name. Required.
91
- * Should be a URL safe string and not include spaces. It is recommended to use kebab-case or camel-case.
92
- * The endpoints must satisfy the following regexp: /^[a-zA-Z0-9-_]+$/. No whitespaces or special characters are allowed.
93
- */
94
- name: string;
95
- /**
96
- * Only applies for stored interactions. The version of the interaction.
97
- * Undefined for non stored interactions
98
- */
99
- version?: number;
100
- /**
101
- * Only applies for stored interactions. Whether the interaction is published or not.
102
- */
103
- published?: boolean;
104
- /**
105
- * A title for the interaction. If not provided, the endpoint will be used.
106
- */
107
- title?: string;
108
- /**
109
- * An optional description of the interaction.
110
- */
111
- description?: string;
112
- /**
113
- * The JSON schema to be used for the result if any.
114
- */
115
- result_schema?: JSONSchema | SchemaRef;
116
- /**
117
- * The modality of the interaction output.
118
- * If not specified Modalities.Text is assumed.
119
- */
120
- output_modality?: Modalities;
121
- /**
122
- * How to store the run data for executions of this interaction.
123
- * Defaults to STANDARD.
124
- */
125
- storage?: RunDataStorageLevel;
126
- /**
127
- * Optional tags for the interaction.
128
- */
129
- tags?: string[];
130
- /**
131
- * Agent Runner configuration options.
132
- */
133
- agent_runner_options?: AgentRunnerOptions;
134
- /**
135
- * Default options for the model to be used when executing this interaction.
136
- * (like temperature etc)
137
- */
138
- model_options?: ModelOptions;
139
- /**
140
- * The prompts composing the interaction. Required.
141
- */
142
- prompts: InCodePrompt[];
143
- /**
144
- * Optional reference to an external resource if any.
145
- * Used internally by the system to synchronize stored interactions with in-code interactions.
146
- */
147
- externalId?: string;
148
- /**
149
- * Runtime configuration (system use only)
150
- *
151
- * This field is populated by the system when converting stored interactions
152
- * and contains runtime-specific defaults like target model/environment IDs.
153
- *
154
- * DO NOT set this field manually when writing interaction definitions.
155
- * These values are environment-specific and not portable.
156
- *
157
- * @internal
158
- */
159
- runtime?: {
160
- /**
161
- * Default target environment for the interaction execution
162
- */
163
- environment?: string;
164
- /**
165
- * Default (recommended) target model for the interaction execution
166
- */
167
- model?: string;
168
- };
169
- }
170
- export interface InteractionSpec extends Omit<InCodeInteraction, 'id' | 'runtime' | 'type' | 'published' | 'version'> {
171
- }
172
- /**
173
- * The payload to query the interaction endpoints
174
- */
175
- export interface InteractionEndpointQuery {
176
- limit?: number;
177
- offset?: number;
178
- status?: InteractionStatus;
179
- visibility?: InteractionVisibility;
180
- version?: number;
181
- tags?: string[];
182
- /**
183
- * Filter by interaction endpoint name to include only the specified endpoints
184
- * * If both includes and excludes are specified then only the includes filter will be used.
185
- */
186
- includes?: string[];
187
- /**
188
- * Filter by interaction endpoint name to excludes the specified endpoints.
189
- * If both includes and excludes are specified then only the includes filter will be used.
190
- */
191
- excludes?: string[];
192
- /**
193
- * Whether or not to return the parameters schema.
194
- * The parameters schema is an array of JSON schemas.
195
- * Each schema is a JSON schema that describes the parameters of an interaction prompt.
196
- */
197
- include_params_schema?: boolean;
198
- /**
199
- * Whether or not to return the result schema
200
- */
201
- include_result_schema?: boolean;
202
- }
203
- /**
204
- * A description of an interaction endpoint.
205
- */
206
- export interface InteractionEndpoint {
207
- id: string;
208
- name: string;
209
- endpoint: string;
210
- description?: string;
211
- status: InteractionStatus;
212
- visibility?: InteractionVisibility;
213
- version: number;
214
- tags: string[];
215
- agent_runner_options?: AgentRunnerOptions;
216
- /**
217
- * @deprecated This is deprecated. Use CompletionResult.type information instead.
218
- */
219
- output_modality?: Modalities;
220
- result_schema?: JSONSchema;
221
- params_schema?: JSONSchema;
222
- }
223
- export interface InteractionTags {
224
- tag: string;
225
- count: number;
226
- interactions: InteractionRef[];
227
- }
228
- export interface InteractionRef {
229
- id: string;
230
- name: string;
231
- endpoint: string;
232
- parent?: string;
233
- description?: string;
234
- status: InteractionStatus;
235
- visibility?: InteractionVisibility;
236
- version: number;
237
- tags: string[];
238
- agent_runner_options?: AgentRunnerOptions;
239
- prompts?: PromptSegmentDef<PromptTemplateRef>[];
240
- updated_at: Date;
241
- }
242
- export declare const InteractionRefPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts";
243
- export declare const InteractionRefWithSchemaPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts result_schema";
244
- export interface InteractionRefWithSchema extends Omit<InteractionRef, "prompts"> {
245
- result_schema?: JSONSchema4;
246
- prompts?: PromptSegmentDef<PromptTemplateRefWithSchema>[];
247
- }
248
- export interface InteractionsExportPayload {
249
- /**
250
- * The name of the interaction. If not specified all the interactions in the current project will be exported
251
- */
252
- name?: string;
253
- tags?: string[];
254
- versions?: (number | "draft" | "latest")[];
255
- }
256
- export declare enum InteractionStatus {
257
- draft = "draft",
258
- published = "published",
259
- archived = "archived"
260
- }
261
- export declare enum ExecutionRunStatus {
262
- created = "created",
263
- processing = "processing",
264
- completed = "completed",
265
- failed = "failed"
266
- }
267
- export declare enum RunDataStorageLevel {
268
- STANDARD = "STANDARD",
269
- RESTRICTED = "RESTRICTED",
270
- DEBUG = "DEBUG"
271
- }
272
- export declare enum RunDataStorageDescription {
273
- STANDARD = "Run data is stored for both the model inputs and output.",
274
- RESTRICTED = "No run data is stored for the model inputs \u2014 only the model output.",
275
- DEBUG = "Run data is stored for the model inputs and output, schema, and final prompt."
276
- }
277
- export declare const RunDataStorageOptions: Record<RunDataStorageLevel, RunDataStorageDescription>;
278
- /**
279
- * Schema can be stored or specified as a reference to an external schema.
280
- * We only support "store:" references for now
281
- */
282
- export interface SchemaRef {
283
- $uri: string;
284
- }
285
- export interface CachePolicy {
286
- type: "cache" | "no_cache" | "cache_and_refresh";
287
- refresh_probability: number;
288
- varies_on: string[];
289
- ttl: number;
290
- }
291
- export type InteractionVisibility = "public" | "private";
292
- export interface InteractionData {
293
- readonly id: string;
294
- name: string;
295
- endpoint: string;
296
- description?: string;
297
- project: string | ProjectRef;
298
- tags: string[];
299
- agent_runner_options?: AgentRunnerOptions;
300
- result_schema?: JSONSchema4 | SchemaRef;
301
- environment?: string | ExecutionEnvironmentRef;
302
- model?: string;
303
- model_options?: ModelOptions;
304
- restriction?: RunDataStorageLevel;
305
- /**
306
- * @deprecated This is deprecated. Use CompletionResult.type information instead.
307
- */
308
- output_modality?: Modalities;
309
- }
310
- export interface Interaction extends InteractionData {
311
- status: InteractionStatus;
312
- parent?: string;
313
- visibility: InteractionVisibility;
314
- version: number;
315
- test_data?: JSONObject;
316
- interaction_schema?: JSONSchema4 | SchemaRef;
317
- cache_policy?: CachePolicy;
318
- prompts: PromptSegmentDef[];
319
- last_published_at?: Date;
320
- created_by: string;
321
- updated_by: string;
322
- created_at: Date;
323
- updated_at: Date;
324
- }
325
- export interface PopulatedInteraction extends Omit<Interaction, "prompts"> {
326
- prompts: PopulatedPromptSegmentDef[];
327
- }
328
- /**
329
- * Used to describe an interaction that can be executed. Contains only the interaction data useful
330
- * to execute the interaction plus the prompt templates
331
- */
332
- export interface ExecutableInteraction extends InteractionData {
333
- prompts: ExecutablePromptSegmentDef[];
334
- }
335
- export interface InteractionCreatePayload extends Omit<Interaction, "id" | "created_at" | "updated_at" | "created_by" | "updated_by" | "project" | "formatter" | "tags" | "parent" | "version" | "visibility" | "endpoint"> {
336
- visibility?: InteractionVisibility;
337
- tags?: string[];
338
- }
339
- export interface InteractionUpdatePayload extends Partial<Omit<Interaction, "result_schema" | "id" | "created_at" | "updated_at" | "created_by" | "updated_by" | "project">> {
340
- result_schema?: JSONSchema4 | null;
341
- }
342
- export interface InteractionPublishPayload {
343
- visibility?: InteractionVisibility;
344
- tags?: string[];
345
- }
346
- export interface InteractionForkPayload {
347
- keepTags?: boolean;
348
- forkPrompts?: boolean;
349
- targetProject?: string;
350
- }
351
- export interface InteractionExecutionPayload {
352
- /**
353
- * If a `@memory` property exists on the input data then the value will be used as the value of a memory pack location.
354
- * and the other properties of the data will contain the memory pack mapping.
355
- */
356
- data?: Record<string, any> | `memory:${string}`;
357
- config?: InteractionExecutionConfiguration;
358
- result_schema?: JSONSchema4 | null;
359
- stream?: boolean;
360
- do_validate?: boolean;
361
- tags?: string | string[];
362
- /**
363
- * The conversation state to be used in the execution if any.
364
- * If the `true` is passed then the conversation will be returned in the result.
365
- * The true value must be used for the first execution that starts the conversation.
366
- * If conversation is falsy then no conversation is returned back.
367
- * For regular executions the conversation is not returned back to save memory.
368
- */
369
- conversation?: true | unknown;
370
- /**
371
- * The tools to be used in the execution
372
- */
373
- tool_definitions?: ToolDefinition[];
374
- /**
375
- * The workflow related to this Interaction Run.
376
- */
377
- workflow?: ExecutionRunWorkflow;
378
- /**
379
- * Only used by ad-hoc interactions which defines the prompt in the execution payload itself
380
- * These are temporary interactions using "tmp:" suffix.
381
- */
382
- prompts?: InCodePrompt[];
383
- }
384
- export interface NamedInteractionExecutionPayload extends InteractionExecutionPayload {
385
- /**
386
- * The interaction name and suffixed by an optional tag or version separated from the name using a @ character
387
- * If no version/tag part is specified then the latest version is used.
388
- * Example: ReviewContract, ReviewContract@draft, ReviewContract@1, ReviewContract@some-tag
389
- */
390
- interaction: string;
391
- }
392
- export type ToolRef = string | {
393
- name: string;
394
- description: string;
395
- };
396
- interface AsyncExecutionPayloadBase extends Omit<NamedInteractionExecutionPayload, "toolDefinitions" | "stream"> {
397
- type: "conversation" | "interaction";
398
- /**
399
- * An array of endpoint URLs to be notified upon execution
400
- */
401
- notify_endpoints?: string[];
402
- task_queue?: string;
403
- }
404
- export type ConversationVisibility = 'private' | 'project';
405
- /**
406
- * Defines the scope for agent search operations.
407
- */
408
- export declare enum AgentSearchScope {
409
- /**
410
- * Search is scoped to a specific collection.
411
- */
412
- Collection = "collection"
413
- }
414
- /**
415
- * Context triggers for auto-injection of skills.
416
- * When these conditions match, the skill is automatically injected into the agent context.
417
- */
418
- export interface SkillContextTriggers {
419
- /**
420
- * Keywords in user input that should trigger this skill
421
- */
422
- keywords?: string[];
423
- /**
424
- * If these tools are being used, suggest this skill
425
- */
426
- tool_names?: string[];
427
- /**
428
- * Regex patterns to match against input data
429
- */
430
- data_patterns?: string[];
431
- }
432
- /**
433
- * Configuration options for Agent Runner functionality.
434
- * These options control how interactions are exposed and executed in the Agent Runner.
435
- */
436
- export interface AgentRunnerOptions {
437
- /**
438
- * Whether this interaction is an agent (executable in Agent Runner).
439
- */
440
- is_agent?: boolean;
441
- /**
442
- * Whether this interaction is available as a tool (sub-agent).
443
- */
444
- is_tool?: boolean;
445
- /**
446
- * Whether this interaction is a skill (provides instructions without execution).
447
- * Skills are injected into the agent's context based on context_triggers.
448
- */
449
- is_skill?: boolean;
450
- /**
451
- * Context triggers for auto-injection of this skill.
452
- * Only used when is_skill is true.
453
- */
454
- context_triggers?: SkillContextTriggers;
455
- /**
456
- * Injection priority for skills (higher = more likely to be selected when multiple match).
457
- * Only used when is_skill is true.
458
- */
459
- skill_priority?: number;
460
- /**
461
- * Array of default tool names available to this agent.
462
- * For interactions: defines default tools.
463
- * For execution payloads: you can use + and - to add or remove from default,
464
- * if no sign, then list replaces default.
465
- */
466
- tool_names?: string[];
467
- /**
468
- * On which scope should the search be applied by the search_tool.
469
- * Only supports 'collection' scope or undefined for now.
470
- */
471
- search_scope?: AgentSearchScope;
472
- /**
473
- * The ID of the collection to restrict agent operations to.
474
- * When specified, the agent's search and retrieval operations are limited to documents
475
- * within this collection'.
476
- */
477
- collection_id?: string;
478
- }
479
- export interface AsyncConversationExecutionPayload extends AsyncExecutionPayloadBase {
480
- type: "conversation";
481
- /**
482
- * Visibility determine if the conversation should be seen by the user only or by anyone with access to the project
483
- * If not specified, the default is project
484
- **/
485
- visibility?: ConversationVisibility;
486
- /**
487
- * The tools to use, list of tool or function names.
488
- * You can use + and - to add or remove from default, if no sign, then list replaces default
489
- */
490
- tool_names?: string[];
491
- /**
492
- * The maximum number of iterations in case of a conversation. If <=0 the default of 20 will be used.
493
- */
494
- max_iterations?: number;
495
- /**
496
- * Whether the conversation should be interactive or not
497
- */
498
- interactive?: boolean;
499
- /**
500
- * Whether to disable the generation of interaction tools or not.
501
- */
502
- disable_interaction_tools?: boolean;
503
- /**
504
- * On which scope should the searched by applied, by the search_tool.
505
- * Only supports collection scope or null for now.
506
- */
507
- search_scope?: AgentSearchScope.Collection;
508
- /**
509
- * The collection in which this workflow is executing
510
- */
511
- collection_id?: string;
512
- /**
513
- * The token threshold in thousands (K) for creating checkpoints.
514
- * If total tokens exceed this value, a checkpoint will be created.
515
- * If not specified, default value of 150K tokens will be used.
516
- */
517
- checkpoint_tokens?: number;
518
- /** In child execution workflow, this is the curent task_id */
519
- task_id?: string;
520
- /** Whether to enable debug mode */
521
- debug_mode?: boolean;
522
- /** Maximum depth for nested conversations to prevent infinite recursion (default: 5) */
523
- max_nested_conversation_depth?: number;
524
- }
525
- export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
526
- type: "interaction";
527
- /**
528
- * Only used for non conversation workflows to include the error on next retry.
529
- * If tools is defined this is not used
530
- */
531
- include_previous_error?: boolean;
532
- }
533
- export type AsyncExecutionPayload = AsyncConversationExecutionPayload | AsyncInteractionExecutionPayload;
534
- interface ResumeConversationPayload {
535
- run: ExecutionRunDocRef;
536
- environment: string;
537
- options: StatelessExecutionOptions;
538
- conversation: unknown;
539
- tools: ToolDefinition[];
540
- }
541
- export interface ToolResultContent {
542
- content: string;
543
- is_error: boolean;
544
- files?: string[];
545
- /**
546
- * Can contain metadata returned by the tool executor.
547
- */
548
- meta?: Record<string, any>;
549
- }
550
- export interface ToolResult extends ToolResultContent {
551
- tool_use_id: string;
552
- }
553
- /**
554
- * The payload to sent the tool responses back to the target LLM
555
- */
556
- export interface ToolResultsPayload extends ResumeConversationPayload {
557
- results: ToolResult[];
558
- }
559
- export interface UserMessagePayload extends ResumeConversationPayload {
560
- message: string;
561
- }
562
- export type CheckpointConversationPayload = Omit<ToolResultsPayload, "results" | "tools">;
563
- export declare enum RunSourceTypes {
564
- api = "api",
565
- cli = "cli",
566
- ui = "ui",
567
- webhook = "webhook",
568
- test = "test-data",
569
- system = "system"
570
- }
571
- export interface RunSource {
572
- type: RunSourceTypes;
573
- label: string;
574
- principal_type: "user" | "apikey";
575
- principal_id: string;
576
- client_ip: string;
577
- }
578
- export interface BaseExecutionRun<P = any> {
579
- readonly id: string;
580
- /**
581
- * Only used by runs that were created by a virtual run to point toward the virtual run parent
582
- */
583
- parent?: string | ExecutionRun;
584
- evaluation?: {
585
- score?: number;
586
- selected?: boolean;
587
- scores?: Record<string, number>;
588
- };
589
- result: CompletionResult[];
590
- /**
591
- * The parameters used to create the interaction.
592
- * If the parameters contains the special property "@memory" it will be used
593
- * to locate a memory pack and the other properties will be used as the memory pack mapping.
594
- */
595
- parameters: P;
596
- tags?: string[];
597
- interaction?: string | Interaction;
598
- interaction_code?: string;
599
- environment: ExecutionEnvironmentRef;
600
- modelId: string;
601
- result_schema: JSONSchema4;
602
- ttl: number;
603
- status: ExecutionRunStatus;
604
- finish_reason?: string;
605
- prompt: any;
606
- token_use?: ExecutionTokenUsage;
607
- chunks?: number;
608
- execution_time?: number;
609
- created_at: Date;
610
- updated_at: Date;
611
- account: AccountRef;
612
- project: ProjectRef;
613
- config: InteractionExecutionConfiguration;
614
- error?: InteractionExecutionError;
615
- source: RunSource;
616
- /**
617
- * @deprecated This is deprecated. Use CompletionResult.type information instead.
618
- */
619
- output_modality?: Modalities;
620
- created_by: string;
621
- updated_by: string;
622
- /**
623
- * The Vertesia Workflow related to this Interaction Run.
624
- *
625
- * This is only set when the interaction is executed as part of a workflow.
626
- *
627
- * @since 0.60.0
628
- */
629
- workflow?: ExecutionRunWorkflow;
630
- }
631
- export interface ExecutionRun<P = any> extends BaseExecutionRun<P> {
632
- interaction?: Interaction;
633
- }
634
- export interface PopulatedExecutionRun<P = any> extends BaseExecutionRun<P> {
635
- interaction?: Interaction;
636
- }
637
- export interface ExecutionRunWorkflow {
638
- /**
639
- * The Temporal Workflow Run ID related to this Interaction Run.
640
- *
641
- * A Run ID is a globally unique, platform-level identifier for a Workflow Execution.
642
- *
643
- * @example 01970d37-a890-70c0-9f44-1256d063e69a
644
- * @see https://docs.temporal.io/workflow-execution/workflowid-runid
645
- */
646
- run_id: string;
647
- /**
648
- * The Temporal Workflow ID related to this Interaction Run.
649
- *
650
- * @example Standard Document Intake:6834841e4f828d4e36192796
651
- * @see https://docs.temporal.io/workflow-execution/workflowid-runid
652
- */
653
- workflow_id: string;
654
- /**
655
- * The Temporal Activity Type used for executing this Interaction. Undefined if the interaction
656
- * was not executed as part of a workflow (such as Agent Runner).
657
- *
658
- * @example generateDocumentProperties
659
- */
660
- activity_type?: string;
661
- }
662
- export interface PromptModalities {
663
- hasVideo: boolean;
664
- hasImage: boolean;
665
- }
666
- export interface InteractionExecutionResult<P = any> extends ExecutionRun<P> {
667
- tool_use?: ToolUse[];
668
- conversation?: unknown;
669
- options?: StatelessExecutionOptions;
670
- }
671
- export interface ExecutionRunRef extends Omit<ExecutionRun, "result" | "parameters" | "interaction"> {
672
- interaction?: InteractionRef;
673
- interaction_code?: string;
674
- }
675
- export declare const ExecutionRunRefSelect = "-result -parameters -result_schema -prompt";
676
- export declare enum ConfigModes {
677
- RUN_AND_INTERACTION_CONFIG = "RUN_AND_INTERACTION_CONFIG",
678
- RUN_CONFIG_ONLY = "RUN_CONFIG_ONLY",
679
- INTERACTION_CONFIG_ONLY = "INTERACTION_CONFIG_ONLY"
680
- }
681
- export declare enum ConfigModesDescription {
682
- RUN_AND_INTERACTION_CONFIG = "This run configuration is used. Undefined options are filled with interaction configuration.",
683
- RUN_CONFIG_ONLY = "Only this run configuration is used. Undefined options remain undefined.",
684
- INTERACTION_CONFIG_ONLY = "Only interaction configuration is used."
685
- }
686
- export declare const ConfigModesOptions: Record<ConfigModes, ConfigModesDescription>;
687
- export interface InteractionExecutionConfiguration {
688
- environment?: string;
689
- model?: string;
690
- do_validate?: boolean;
691
- run_data?: RunDataStorageLevel;
692
- configMode?: ConfigModes;
693
- model_options?: ModelOptions;
694
- }
695
- export interface GenerateInteractionPayload {
696
- description: string;
697
- config: InteractionExecutionConfiguration;
698
- }
699
- export interface GenerateTestDataPayload {
700
- message?: string;
701
- count?: number;
702
- config: InteractionExecutionConfiguration;
703
- }
704
- export interface ImprovePromptPayloadConfig {
705
- config: InteractionExecutionConfiguration;
706
- }
707
- export interface ImprovePromptPayload extends ImprovePromptPayloadConfig {
708
- interaction_name: string;
709
- context?: string;
710
- prompt: {
711
- name: string;
712
- content: string;
713
- }[];
714
- result_schema?: JSONSchema;
715
- }
716
- export interface RateLimitRequestPayload {
717
- interaction: string;
718
- environment_id?: string;
719
- model_id?: string;
720
- workflow_run_id?: string;
721
- modalities?: PromptModalities;
722
- }
723
- export interface RateLimitRequestResponse {
724
- delay_ms: number;
725
- }
726
- export {};