@vertesia/appgen-docs 1.5.0-dev.20260725.083715Z

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.
@@ -0,0 +1,4404 @@
1
+ // Generated by @vertesia/appgen-docs.
2
+ // Do not edit by hand. This concatenates selected @vertesia/common declaration files
3
+ // for generated app agents.
4
+ //
5
+ // Use this file before defining app package capabilities or data-backed screens:
6
+ // - AppPackage, app capabilities, app UI/runtime metadata
7
+ // - In-code types, processes, dashboards, and tool execution contracts
8
+ // - ContentObject, ContentObjectItem, ObjectSearchResponse, collections, and store process types
9
+
10
+ // -----------------------------------------------------------------------------
11
+ // @vertesia/common: index.d.ts
12
+ // -----------------------------------------------------------------------------
13
+ export * from './access-control.js';
14
+ export * from './agent-request-template.js';
15
+ export * from './analytics.js';
16
+ /**
17
+ * Schema-derived API types. MUST stay `export type` — tsc erases it, so `lib/index.js` never
18
+ * references `./api-schemas/*` and zod stays out of the browser bundle. A runtime `export *` here
19
+ * would ship zod to every UI user; see `./api-schemas/index.ts` for why.
20
+ */
21
+ export type { UserGroupArrayFromSchema } from './api-schemas/group.js';
22
+ export type { PrincipalContextFromSchema, UserArrayFromSchema, UserRefArrayFromSchema, } from './api-schemas/user.js';
23
+ export * from './apikey.js';
24
+ export * from './apps.js';
25
+ export * from './ask-user.js';
26
+ export * from './audit-trail.js';
27
+ export * from './browser-credentials.js';
28
+ export * from './channels.js';
29
+ export * from './common.js';
30
+ export * from './cost-analytics.js';
31
+ export * from './data-platform.js';
32
+ export * from './embeddings.js';
33
+ export * from './environment.js';
34
+ export * from './facets.js';
35
+ export * from './group.js';
36
+ export * from './host-utils.js';
37
+ export * from './integrations.js';
38
+ export * from './interaction.js';
39
+ export * from './json.js';
40
+ export * from './json-schema.js';
41
+ export * from './meters.js';
42
+ export * from './model_utility.js';
43
+ export * from './oauth.js';
44
+ export * from './oauth-scopes.js';
45
+ export * from './oauth-server.js';
46
+ export * from './Progress.js';
47
+ export * from './payload.js';
48
+ export * from './pending-asks.js';
49
+ export * from './platform-event.js';
50
+ export * from './platform-event-validation.js';
51
+ export * from './principal-context.js';
52
+ export * from './project.js';
53
+ export * from './prompt.js';
54
+ export * from './query.js';
55
+ export * from './rate-limiter.js';
56
+ export * from './refs.js';
57
+ export * from './roles/types.js';
58
+ export * from './runs.js';
59
+ export * from './schema-for-extraction.js';
60
+ export * from './secrets.js';
61
+ export * from './skill.js';
62
+ export * from './store/index.js';
63
+ export type { ContentObjectExportArtifact, ContentObjectExportArtifactFile, ContentObjectExportProgress, ContentObjectExportResult, ContentObjectExportStatusResponse, DeleteContentObjectExportResponse, ExportContentObjectsFilter, ExportContentObjectsIncludeOptions, ExportedContentObjectRecord, ListContentObjectExportsResponse, StartContentObjectExportRequest, StartContentObjectExportResponse, ZenoBulkContentObjectExportComposeRequest, ZenoBulkContentObjectExportPlanRequest, ZenoBulkContentObjectExportPlanResponse, ZenoBulkContentObjectExportRequest, ZenoBulkContentObjectExportShardRange, ZenoBulkContentObjectExportShardRequest, ZenoBulkContentObjectExportShardResult, ZenoBulkContentObjectExportSplitShardRequest, ZenoBulkContentObjectExportSplitShardResponse, } from './store/store.js';
64
+ export * from './sts-token-types.js';
65
+ export * from './tenant.js';
66
+ export * from './tool-execution.js';
67
+ export * from './tools.js';
68
+ export * from './training.js';
69
+ export * from './transient-tokens.js';
70
+ export * from './user.js';
71
+ export * from './utils/auth.js';
72
+ export * from './utils/schemas.js';
73
+ export type * from './utils/type-helpers.js';
74
+ export * from './versions.js';
75
+ export * from './view-configuration-validation.js';
76
+ export * from './view-query-validation.js';
77
+ export * from './view-validation-helpers.js';
78
+ export * from './views.js';
79
+ export * from './views-schema.js';
80
+ export { type AppViewExperienceId, parseAppViewExperienceId, type ViewValidationIssue, validateViewExperienceId, } from './views-validation.js';
81
+ export * from './workflow-analytics.js';
82
+
83
+ // -----------------------------------------------------------------------------
84
+ // @vertesia/common: apps.d.ts
85
+ // -----------------------------------------------------------------------------
86
+ import type { z } from 'zod';
87
+ import type { AgentToolApprovalClassSchema, AgentToolDefinitionSchema, AppBuildProgressSchema, AppBuildProgressStatusSchema, AppBuildTriggerSchema, AppDevelopmentTaskDetailsSchema, AppDevelopmentTaskListSchema, AppDevelopmentTaskSchema, AppInspectionCapabilityReportSchema, AppInspectionIssueSchema, AppInspectionResultSchema, AppInstallationKindSchema, AppInstallationOAuthBindingSchema, AppInstallationPayloadSchema, AppInstallationProjectsQuerySchema, AppInstallationProviderBindingSchema, AppInstallationsQuerySchema, AppOAuthCollectionParamsSchema, AppOAuthProviderParamsSchema, AppRepoBranchSchema, AppRepoCommitSchema, AppRepoCommitsSchema, AppRepoDocumentCommitSchema, AppRepoRefSchema, AppRepoRefsSchema, AppRepoTreeEntrySchema, AppRepoTreeSchema, AppScaffoldModuleSchema, AppScaffoldProgressSchema, AppScaffoldProgressStatusSchema, AppToolCollectionSchema, AppVersionGitRefTypeSchema, AppVersionGitSourceSchema, AppVersionKindSchema, AppVersionRecordSchema, AppVersionStateSchema, AppVersionStorageSchema, AppVersionTargetSchema, AppVersionUrlsSchema, DeleteAppVersionResponseSchema, OAuthClientCredentialsSchema, StartAppBuildRequestSchema, StartAppBuildResponseSchema, StartAppScaffoldRequestSchema, StartAppScaffoldResponseSchema, UpdateAppInstallationToolAllowlistPayloadSchema, UpsertAppVersionRequestSchema, ValidateUrlRequestSchema, ValidateUrlResponseSchema } from './api-schemas/app-lifecycle.js';
88
+ import type { AppInstallationListEntrySchema, AppInstallationSchema, AppInstallationWithManifestSchema, AppManifestDataSchema, AppManifestSchema, AppPackageSchema, AppWidgetInfoSchema, CompositeAppCardOverridesSchema, CompositeAppConfigPayloadSchema, CompositeAppConfigSchema, CompositeAppEntrySchema, CompositeAppHeaderItemKindSchema, CompositeAppHeaderItemSchema, CompositeAppHeaderItemTargetSchema, CompositeAppHeaderOverridesSchema, CompositeAppHomePluginSchema, CompositeAppLogoOverridesSchema, CompositeAppMenuSectionSchema, CompositeAppMessageOverridesSchema, CompositeAppMessageStyleSchema, CompositeAppNavItemPermissionsSchema, CompositeAppSidebarOverridesSchema, CompositeAppSwitchersOverridesSchema, CompositeAppThemeOverridesSchema, CompositeAppUserMenuOverridesSchema, PromoteAppVersionResponseSchema } from './api-schemas/app-runtime.js';
89
+ import type { AppAccessControlSchema, AppAvailableInSchema, AppCapabilitiesSchema, AppGitSourceConfigSchema, AppManifestSourceSchema, AppSourceConfigSchema, AppUIConfigSchema, MCPOAuthConfigSchema, MCPToolAnnotationsSchema, MCPToolCollectionObjectSchema, McpOAuthConnectResponseSchema, McpOAuthDisconnectResponseSchema, McpOAuthTokenRequestSchema, McpOAuthTokenResponseSchema, OAuthAuthorizeResponseSchema, OAuthAuthStatusSchema, OAuthMetadataResponseSchema, ToolCollectionAuthTypeSchema, ToolCollectionObjectSchema, VertesiaSDKToolCollectionObjectSchema } from './api-schemas/apps.js';
90
+ import type { RemoteActivityDefinitionSchema } from './api-schemas/integrations.js';
91
+ import type { ProjectToolInfoSchema, RenderingTemplateDefinitionRefSchema, RenderingTemplateDefinitionSchema } from './api-schemas/project.js';
92
+ /** Allowed values for AppUINavItem.preferredSection */
93
+ export declare const PREFERRED_SECTIONS: readonly ["default", "footer", "settings"];
94
+ /**
95
+ * Additional navigation item for an app's UI configuration.
96
+ * Used in AppUIConfig.navigation to define sidebar navigation entries in CompositeApp shell contexts.
97
+ * Icon values are Lucide icon component names or SVG content strings.
98
+ */
99
+ export interface AppUINavItem {
100
+ /** Display label */
101
+ label: string;
102
+ /** Lucide icon name or SVG content string */
103
+ icon: string;
104
+ /** Route path relative to app base */
105
+ route: string;
106
+ /** Optional description shown on dashboard cards and other summary views */
107
+ description?: string;
108
+ /** Nested sub-items displayed within this item's collapsible section */
109
+ children?: AppUINavItem[];
110
+ /** When true, this item appears as an independent entry in the sidebar (outside its parent app group) */
111
+ topLevel?: boolean;
112
+ /**
113
+ * Which sidebar section this item should be placed in when first added.
114
+ * - "default" or unset: normal behavior (child of its app group)
115
+ * - "footer": placed in the footer section
116
+ * - "settings": placed in the settings section
117
+ */
118
+ preferredSection?: (typeof PREFERRED_SECTIONS)[number];
119
+ }
120
+ export type AppUIConfig = z.infer<typeof AppUIConfigSchema>;
121
+ export type AppInstallationProjectsQuery = z.infer<typeof AppInstallationProjectsQuerySchema>;
122
+ export type AppInstallationsQuery = z.infer<typeof AppInstallationsQuerySchema>;
123
+ export type ToolCollectionAuthType = z.infer<typeof ToolCollectionAuthTypeSchema>;
124
+ /**
125
+ * Tool collection type
126
+ */
127
+ export type ToolCollectionType = 'mcp' | 'vertesia_sdk';
128
+ export type MCPOAuthConfig = z.infer<typeof MCPOAuthConfigSchema>;
129
+ export type MCPToolCollectionObject = z.infer<typeof MCPToolCollectionObjectSchema>;
130
+ export type VertesiaSDKToolCollectionObject = z.infer<typeof VertesiaSDKToolCollectionObjectSchema>;
131
+ export type ToolCollectionObject = z.infer<typeof ToolCollectionObjectSchema>;
132
+ /**
133
+ * Backward-compatible TypeScript alias. Public API payloads should reference
134
+ * ToolCollectionObject directly so generated clients do not create a wrapper
135
+ * model around the discriminated union.
136
+ */
137
+ export type ToolCollection = ToolCollectionObject;
138
+ export declare const MCP_COLLECTION_ID_PATTERN: RegExp;
139
+ export declare const MCP_COLLECTION_NAMESPACE_PATTERN: RegExp;
140
+ export declare function isValidMCPCollectionId(id: string): boolean;
141
+ export declare function isValidMCPCollectionNamespace(namespace: string): boolean;
142
+ export declare function deriveMCPCollectionId(input: string): string;
143
+ export declare function getDefaultOAuthAppNameForCollectionId(collectionId: string): string;
144
+ /**
145
+ * Normalizes a tool collection to the object format.
146
+ * Applies optional `{{var}}` substitution to the URL so manifests can reference
147
+ * deployment-time variables like `{{studio_ui}}`.
148
+ *
149
+ * @param collection - ToolCollectionObject
150
+ * @param vars - Optional endpoint variables to substitute in URLs
151
+ * @returns Normalized ToolCollectionObject
152
+ */
153
+ export declare function normalizeToolCollection(collection: ToolCollectionObject, vars?: Endpoints): ToolCollectionObject;
154
+ /**
155
+ * Metadata hints from MCP tool annotations (per MCP spec).
156
+ */
157
+ export type MCPToolAnnotations = z.infer<typeof MCPToolAnnotationsSchema>;
158
+ /**
159
+ * Approval behavior class for a tool exposed to agents.
160
+ *
161
+ * - `read_only`: reads or inspects state without changing Vertesia, external systems, or user-visible artifacts.
162
+ * - `side_effecting`: can create, update, delete, send, execute, schedule, or otherwise change state.
163
+ * - `control`: affects agent control flow or tool availability, not user data or external systems.
164
+ * - `requires_confirmation`: high-impact action that must ask the user even in interactive full-control mode.
165
+ */
166
+ export type AgentToolApprovalClass = z.infer<typeof AgentToolApprovalClassSchema>;
167
+ /**
168
+ * Tool definition with optional activation control for agent exposure.
169
+ */
170
+ export type AgentToolDefinition = z.infer<typeof AgentToolDefinitionSchema>;
171
+ /**
172
+ * Definition of a remote activity exposed by a tool server for use in DSL workflows.
173
+ * Remote activities are identified in workflow steps using colon-separated names:
174
+ * `app:<app_name>:<collection>:<activity_name>` (e.g. `app:my-nlp-app:examples:word_count`).
175
+ */
176
+ export type RemoteActivityDefinition = z.infer<typeof RemoteActivityDefinitionSchema>;
177
+ /**
178
+ * Canonical app capabilities Studio renders/supports. The public type is derived from
179
+ * this list so runtime validation and TypeScript cannot drift.
180
+ */
181
+ export declare const APP_CAPABILITIES: readonly ["ui", "tools", "interactions", "types", "processes", "views", "templates", "dashboards"];
182
+ export type AppCapabilities = z.infer<typeof AppCapabilitiesSchema>;
183
+ /**
184
+ * Header carrying the app version a generated-app UI is running, so studio/zeno resolve app-owned
185
+ * capability refs (`app:<app>:...`) against that exact version instead of the promoted version.
186
+ * Resolution-time only; never persisted. Set by the generated app template via client.withAppVersion.
187
+ */
188
+ export declare const APP_VERSION_HEADER = "x-vertesia-app-version";
189
+ /**
190
+ * The platform-artifact types an app build can be required to create. A finer-grained
191
+ * counterpart to {@link AppCapabilities}: a single `interactions` capability may comprise
192
+ * several `interaction` artifacts plus `agent`, `activity`, and `tool` artifacts that
193
+ * {@link AppCapabilities} folds together. Used by the App Solution Architect manifest and
194
+ * the publish-time capability gate.
195
+ */
196
+ export declare const APP_ARTIFACT_TYPES: readonly ["interaction", "agent", "type", "process", "view", "template", "dashboard", "activity", "tool"];
197
+ export type AppArtifactType = (typeof APP_ARTIFACT_TYPES)[number];
198
+ /**
199
+ * A single platform artifact the App Solution Architect requires the build to create.
200
+ * `id` is the app-owned in-code id the implementation must register and reference
201
+ * (e.g. `app:<name>:main:extract-item` for interactions/agents, `app:<name>:<type>` for
202
+ * types, `app:<name>:<process>` for processes).
203
+ */
204
+ /**
205
+ * Build progress for one artifact, maintained by the developer agent as a living checklist:
206
+ * - `pending` — defined by the architect, not yet built.
207
+ * - `built` — registered in the package, not yet successfully exercised.
208
+ * - `done` — built AND successfully exercised against real data.
209
+ * This is the agent's self-reported claim for tracking/handoff; the capability gate verifies
210
+ * the truth independently via package registration + run/data telemetry and does not trust it.
211
+ */
212
+ export type AppArtifactStatus = 'pending' | 'built' | 'done';
213
+ export declare const APP_ARTIFACT_STATUSES: readonly AppArtifactStatus[];
214
+ export interface AppPlannedArtifact {
215
+ /** App-owned in-code id the build must register and reference. */
216
+ id: string;
217
+ type: AppArtifactType;
218
+ /** Short human label. */
219
+ name?: string;
220
+ /** Why this artifact exists / what it does — carried into the build checklist. */
221
+ purpose?: string;
222
+ /**
223
+ * When false, the artifact is planned but optional: the capability gate warns rather
224
+ * than blocks if it is missing or never exercised. Defaults to required (true).
225
+ */
226
+ required?: boolean;
227
+ /** Build progress, updated by the developer agent. Defaults to `pending`. */
228
+ status?: AppArtifactStatus;
229
+ }
230
+ /**
231
+ * Structured result the App Solution Architect emits alongside its prose artifacts — the
232
+ * machine-readable contract for the build. The implementation MUST create and successfully
233
+ * exercise every required artifact before building a deployable version. Persisted into the app repo as
234
+ * {@link APP_CAPABILITY_MANIFEST_PATH} so it survives across runs and the version-build
235
+ * capability gate can verify against it deterministically. If the builder finds the plan
236
+ * wrong or insufficient, the orchestrator relaunches the architect to revise the manifest;
237
+ * the gate always checks against the latest committed copy.
238
+ */
239
+ export interface AppCapabilityManifest {
240
+ /** Artifact-storage ref to the prose architecture spec (e.g. the architecture `.md`). */
241
+ spec_artifact: string;
242
+ /** Platform artifacts the build must create. */
243
+ artifacts: AppPlannedArtifact[];
244
+ /**
245
+ * Monotonic revision, starting at 1, bumped each time the architect evolves the manifest for
246
+ * the SAME app on a later iteration (read the committed manifest, preserve untouched artifacts,
247
+ * add/modify/remove, then bump). Lets downstream agents tell which contract they are building to.
248
+ */
249
+ revision?: number;
250
+ /**
251
+ * Newest-first change notes, one entry per revision (what was added/modified/removed and why).
252
+ * How manifest changes are communicated to downstream agents across iterations.
253
+ */
254
+ changelog?: string[];
255
+ /** Optional free-form notes the architect wants the builder to honor. */
256
+ notes?: string;
257
+ }
258
+ /** Repo-relative path the capability manifest is committed to, read by version-build gates. */
259
+ export declare const APP_CAPABILITY_MANIFEST_PATH = "docs/app-capability-manifest.json";
260
+ export type AppAvailableIn = z.infer<typeof AppAvailableInSchema>;
261
+ export type AppVersionKind = z.infer<typeof AppVersionKindSchema>;
262
+ export type AppVersionState = z.infer<typeof AppVersionStateSchema>;
263
+ export type AppVersionTarget = z.infer<typeof AppVersionTargetSchema>;
264
+ export type AppVersionGitRefType = z.infer<typeof AppVersionGitRefTypeSchema>;
265
+ export type AppBuildTrigger = z.infer<typeof AppBuildTriggerSchema>;
266
+ export type AppVersionStorage = z.infer<typeof AppVersionStorageSchema>;
267
+ export type AppVersionGitSource = z.infer<typeof AppVersionGitSourceSchema>;
268
+ export type AppVersionUrls = z.infer<typeof AppVersionUrlsSchema>;
269
+ export type AppVersionRecord = z.infer<typeof AppVersionRecordSchema>;
270
+ export type DeleteAppVersionResponse = z.infer<typeof DeleteAppVersionResponseSchema>;
271
+ export type UpsertAppVersionRequest = z.infer<typeof UpsertAppVersionRequestSchema>;
272
+ export interface AppVersionListQuery {
273
+ app_id?: string;
274
+ kind?: AppVersionKind;
275
+ include_expired?: boolean;
276
+ limit?: number;
277
+ }
278
+ export type PromoteAppVersionResponse = z.infer<typeof PromoteAppVersionResponseSchema>;
279
+ export type StartAppBuildRequest = z.infer<typeof StartAppBuildRequestSchema>;
280
+ export type StartAppBuildResponse = z.infer<typeof StartAppBuildResponseSchema>;
281
+ export interface AppBuildWorkflowInput extends StartAppBuildRequest {
282
+ app_id: string;
283
+ app_record_id?: string;
284
+ /** Rebuild this persisted version record at its original commit and target. */
285
+ rebuild_version_record_id?: string;
286
+ app_title?: string;
287
+ app_description?: string;
288
+ source_git_url?: string;
289
+ }
290
+ export interface AppBuildWorkflowResult {
291
+ app_id: string;
292
+ version_id: string;
293
+ kind: Extract<AppVersionKind, 'version'>;
294
+ state: AppVersionState;
295
+ source_commit: string;
296
+ source_git?: AppVersionGitSource;
297
+ urls?: AppVersionUrls;
298
+ file_count?: number;
299
+ }
300
+ export type AppBuildProgressStatus = z.infer<typeof AppBuildProgressStatusSchema>;
301
+ export type AppBuildProgress = z.infer<typeof AppBuildProgressSchema>;
302
+ export type AppScaffoldModule = z.infer<typeof AppScaffoldModuleSchema>;
303
+ export type StartAppScaffoldRequest = z.infer<typeof StartAppScaffoldRequestSchema>;
304
+ export type StartAppScaffoldResponse = z.infer<typeof StartAppScaffoldResponseSchema>;
305
+ export interface AppScaffoldWorkflowInput extends StartAppScaffoldRequest {
306
+ }
307
+ export interface AppScaffoldWorkflowResult {
308
+ app_id: string;
309
+ app_record_id?: string;
310
+ installation_id?: string;
311
+ git_url?: string;
312
+ source_git?: AppVersionGitSource;
313
+ files?: number;
314
+ initial_version_build?: StartAppBuildResponse;
315
+ }
316
+ export type AppScaffoldProgressStatus = z.infer<typeof AppScaffoldProgressStatusSchema>;
317
+ export type AppScaffoldProgress = z.infer<typeof AppScaffoldProgressSchema>;
318
+ /**
319
+ * Access control policy for an app installation.
320
+ * Declares which access surfaces are gated by per-user ACEs.
321
+ *
322
+ * - 'all' (default): every surface (UI portal, tool/endpoint use, contributions) requires
323
+ * an explicit app_member ACE — the historical behavior.
324
+ * - 'ui': UI portal visibility requires an ACE, but tool/endpoint use and contributions
325
+ * are open to anyone in the project.
326
+ * - 'none': fully open within the project — no ACE required for any surface.
327
+ *
328
+ * Declared on the manifest as the app's default. May be overridden per-installation.
329
+ */
330
+ export type AppAccessControl = z.infer<typeof AppAccessControlSchema>;
331
+ /**
332
+ * Resolve the effective access_control policy for an installed app:
333
+ * installation override wins, then manifest default, then `'all'`.
334
+ *
335
+ * Shared by the STS (JWT generation), the studio-server (validation), and the UI (badge display)
336
+ * so the resolution rule lives in exactly one place. Named `effectiveAppAccessControl` (not just
337
+ * `effectiveAccessControl`) because exports from `@vertesia/common` are flattened — the broader
338
+ * name would risk colliding with other access-control families added later.
339
+ */
340
+ export declare function effectiveAppAccessControl(installation: {
341
+ access_control?: AppAccessControl;
342
+ } | null | undefined, manifest: {
343
+ access_control?: AppAccessControl;
344
+ } | null | undefined): AppAccessControl;
345
+ export type AppManifestData = z.infer<typeof AppManifestDataSchema>;
346
+ export type AppGitSourceConfig = z.infer<typeof AppGitSourceConfigSchema>;
347
+ export type AppSourceConfig = z.infer<typeof AppSourceConfigSchema>;
348
+ /**
349
+ * Deployment-time URL endpoints that can be referenced in app manifest URLs
350
+ * via `{{key}}` placeholders. The caller (typically studio-server) supplies
351
+ * these from environment config so that system apps can ship a single manifest
352
+ * with endpoints like `{{studio}}/api/package` that resolve per deployment.
353
+ */
354
+ export interface Endpoints {
355
+ /** The Studio API (studio-server) base URL */
356
+ studio?: string;
357
+ /** The Store API (zeno-server) base URL */
358
+ store?: string;
359
+ /** The token server base URL */
360
+ token?: string;
361
+ /** The browser-facing Studio UI (composable-ui) base URL */
362
+ ui?: string;
363
+ /** The Smart HTTP app source git server base URL */
364
+ git?: string;
365
+ /** The appgen app-gateway base URL (serves promoted app bundles + their `/api` runtime). */
366
+ gateway?: string;
367
+ }
368
+ /** One entry in an app git-repo directory listing (see {@link AppRepoTree}). */
369
+ export type AppRepoTreeEntry = z.infer<typeof AppRepoTreeEntrySchema>;
370
+ /** A non-recursive listing of an app git repo directory at a given ref. */
371
+ export type AppRepoTree = z.infer<typeof AppRepoTreeSchema>;
372
+ /** Browser-side limits mirrored by the app Git service document endpoint. */
373
+ export declare const APP_REPO_DOCUMENT_UPLOAD_MAX_FILE_BYTES: number;
374
+ export declare const APP_REPO_DOCUMENT_UPLOAD_MAX_TOTAL_BYTES: number;
375
+ export declare const APP_REPO_DOCUMENT_UPLOAD_MAX_FILES = 20;
376
+ export declare const APP_REPO_DOCUMENT_UPLOAD_PREFIX = "docs/";
377
+ /** Result of committing one or more uploaded documents to an app repository. */
378
+ export type AppRepoDocumentCommit = z.infer<typeof AppRepoDocumentCommitSchema>;
379
+ /** One commit that inserted or changed a file in an app git repository. */
380
+ export type AppRepoCommit = z.infer<typeof AppRepoCommitSchema>;
381
+ /** Commit history in an app git repository, optionally filtered to a file. */
382
+ export type AppRepoCommits = z.infer<typeof AppRepoCommitsSchema>;
383
+ /** A branch or tag in an app git repo, resolved to its latest commit. */
384
+ export type AppRepoRef = z.infer<typeof AppRepoRefSchema>;
385
+ /** The branches and tags of an app git repo (see {@link AppRepoRef}). */
386
+ export type AppRepoRefs = z.infer<typeof AppRepoRefsSchema>;
387
+ /** A mutable app development task represented by an `agent/*` Git branch. */
388
+ export type AppDevelopmentTask = z.infer<typeof AppDevelopmentTaskSchema>;
389
+ /** Git-backed development tasks and the branch used for new tasks by default. */
390
+ export type AppDevelopmentTaskList = z.infer<typeof AppDevelopmentTaskListSchema>;
391
+ /** Development task details, including the latest parent assistant run when one exists. */
392
+ export type AppDevelopmentTaskDetails = z.infer<typeof AppDevelopmentTaskDetailsSchema>;
393
+ /** Request to create a branch from an existing branch, tag, or commit. */
394
+ export interface CreateAppRepoBranchRequest {
395
+ name: string;
396
+ source_ref: string;
397
+ }
398
+ /** A newly created app repository branch. */
399
+ export type AppRepoBranch = z.infer<typeof AppRepoBranchSchema>;
400
+ /**
401
+ * Canonical package scopes, including the catch-all `all`. The public type is derived
402
+ * from this list so request parsing and TypeScript cannot drift.
403
+ */
404
+ export declare const APP_PACKAGE_SCOPES: readonly ["ui", "tools", "interactions", "types", "processes", "views", "templates", "dashboards", "settings", "widgets", "activities", "all"];
405
+ export type AppPackageScope = (typeof APP_PACKAGE_SCOPES)[number];
406
+ export type AppPackage = z.infer<typeof AppPackageSchema>;
407
+ /**
408
+ * A single diagnostic produced while inspecting an app's registration state.
409
+ */
410
+ export type AppInspectionIssue = z.infer<typeof AppInspectionIssueSchema>;
411
+ /**
412
+ * Per-capability report of what an app's promoted package actually exposes,
413
+ * compared against what its manifest declares.
414
+ */
415
+ export type AppInspectionCapabilityReport = z.infer<typeof AppInspectionCapabilityReportSchema>;
416
+ /**
417
+ * Result of inspecting an app's registration: the resolved manifest state, what
418
+ * the promoted package actually exposes per capability, and diagnostics. This
419
+ * is the ground truth used by the `app_inspect_registration` agent tool and the
420
+ * Build › App inspection UI to verify what is registered vs declared, instead of
421
+ * inferring it from failed object/import calls.
422
+ */
423
+ export type AppInspectionResult = z.infer<typeof AppInspectionResultSchema>;
424
+ export type AppWidgetInfo = z.infer<typeof AppWidgetInfoSchema>;
425
+ export type RenderingTemplateDefinition = z.infer<typeof RenderingTemplateDefinitionSchema>;
426
+ export type RenderingTemplateDefinitionRef = z.infer<typeof RenderingTemplateDefinitionRefSchema>;
427
+ export type AppManifest = z.infer<typeof AppManifestSchema>;
428
+ export type AppManifestSource = z.infer<typeof AppManifestSourceSchema>;
429
+ /**
430
+ * Binding between an MCP collection and an OAuth provider created at install time.
431
+ * Stored on AppInstallation so the runtime can look up the correct OAuth provider by ID,
432
+ * independent of manifest oauth_provider references (which may change).
433
+ */
434
+ export type AppInstallationOAuthBinding = z.infer<typeof AppInstallationOAuthBindingSchema>;
435
+ /**
436
+ * Binding between a named OAuth provider and the OAuth provider created for it at install time.
437
+ * Stored on AppInstallation so the runtime can resolve the correct OAuth provider for collections
438
+ * that reference a shared provider via MCPToolCollectionObject.oauth_provider.
439
+ */
440
+ export type AppInstallationProviderBinding = z.infer<typeof AppInstallationProviderBindingSchema>;
441
+ export type AppInstallation = z.infer<typeof AppInstallationSchema>;
442
+ export type AppInstallationWithManifest = z.infer<typeof AppInstallationWithManifestSchema>;
443
+ export type AppInstallationListEntry = z.infer<typeof AppInstallationListEntrySchema>;
444
+ export interface OrphanedAppInstallation extends Omit<AppInstallation, 'manifest'> {
445
+ manifest: null;
446
+ }
447
+ export type OAuthClientCredentials = z.infer<typeof OAuthClientCredentialsSchema>;
448
+ export type AppOAuthCollectionParams = z.infer<typeof AppOAuthCollectionParamsSchema>;
449
+ export type AppOAuthProviderParams = z.infer<typeof AppOAuthProviderParamsSchema>;
450
+ export type AppInstallationPayload = z.infer<typeof AppInstallationPayloadSchema>;
451
+ export type UpdateAppInstallationToolAllowlistPayload = z.infer<typeof UpdateAppInstallationToolAllowlistPayloadSchema>;
452
+ export type AppInstallationKind = z.infer<typeof AppInstallationKindSchema>;
453
+ /**
454
+ * A description of the tools provided by an app
455
+ */
456
+ export type AppToolCollection = z.infer<typeof AppToolCollectionSchema>;
457
+ /**
458
+ * A tool and the app installation that provides it, inferred from `./api-schemas/project.js` — the
459
+ * module that owns it, because it converted with the Projects batch rather than with Apps.
460
+ */
461
+ export type ProjectToolInfo = z.infer<typeof ProjectToolInfoSchema>;
462
+ /**
463
+ * OAuth authentication status for an MCP tool collection
464
+ */
465
+ export type OAuthAuthStatus = z.infer<typeof OAuthAuthStatusSchema>;
466
+ /**
467
+ * Response from OAuth authorization endpoint
468
+ */
469
+ export type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>;
470
+ export interface McpOAuthCollectionRef {
471
+ app_install_id: string;
472
+ collection_id: string;
473
+ }
474
+ export type McpOAuthTokenRequest = z.infer<typeof McpOAuthTokenRequestSchema>;
475
+ export type McpOAuthTokenResponse = z.infer<typeof McpOAuthTokenResponseSchema>;
476
+ export type McpOAuthConnectResponse = z.infer<typeof McpOAuthConnectResponseSchema>;
477
+ export type McpOAuthDisconnectResponse = z.infer<typeof McpOAuthDisconnectResponseSchema>;
478
+ /**
479
+ * Response from OAuth metadata endpoint
480
+ */
481
+ export type OAuthMetadataResponse = z.infer<typeof OAuthMetadataResponseSchema>;
482
+ /**
483
+ * Configuration entry for an individual app in the CompositeApp shell.
484
+ * References an app installation by name.
485
+ */
486
+ export type CompositeAppEntry = z.infer<typeof CompositeAppEntrySchema>;
487
+ /**
488
+ * Logo overrides for the CompositeApp shell header.
489
+ * When provided, these URLs replace the default Vertesia logo.
490
+ */
491
+ export type CompositeAppLogoOverrides = z.infer<typeof CompositeAppLogoOverridesSchema>;
492
+ /**
493
+ * Message banner overrides for the shell header.
494
+ */
495
+ export type CompositeAppMessageStyle = z.infer<typeof CompositeAppMessageStyleSchema>;
496
+ export type CompositeAppMessageOverrides = z.infer<typeof CompositeAppMessageOverridesSchema>;
497
+ /**
498
+ * Switcher visibility overrides for the CompositeApp header.
499
+ */
500
+ export type CompositeAppSwitchersOverrides = z.infer<typeof CompositeAppSwitchersOverridesSchema>;
501
+ /**
502
+ * Header button visibility overrides for the CompositeApp header.
503
+ *
504
+ * @deprecated Superseded by `CompositeAppConfig.headerMenu` (free-form header items).
505
+ * Retained for backward compatibility and to seed the default header menu when no
506
+ * `headerMenu` has been configured yet.
507
+ */
508
+ export type CompositeAppHeaderOverrides = z.infer<typeof CompositeAppHeaderOverridesSchema>;
509
+ /**
510
+ * User menu overrides for the CompositeApp.
511
+ *
512
+ * @deprecated Superseded by the `user_menu` item in `CompositeAppConfig.headerMenu`.
513
+ * Retained for backward compatibility and to seed the default header menu when no
514
+ * `headerMenu` has been configured yet.
515
+ */
516
+ export type CompositeAppUserMenuOverrides = z.infer<typeof CompositeAppUserMenuOverridesSchema>;
517
+ /**
518
+ * Theme overrides for the CompositeApp.
519
+ */
520
+ export type CompositeAppThemeOverrides = z.infer<typeof CompositeAppThemeOverridesSchema>;
521
+ /**
522
+ * Sidebar display overrides for the CompositeApp.
523
+ */
524
+ export type CompositeAppSidebarOverrides = z.infer<typeof CompositeAppSidebarOverridesSchema>;
525
+ /**
526
+ * Card display overrides for the CompositeApp in the App Portal.
527
+ * Similar to AppManifest display properties, but specific to the CompositeApp card.
528
+ * Allows customers to customize the app portal card (not otherwise possible if using a
529
+ * shared, Vertesia-managed manifest across accounts).
530
+ */
531
+ export type CompositeAppCardOverrides = z.infer<typeof CompositeAppCardOverridesSchema>;
532
+ /**
533
+ * Access control settings for a composite app nav item.
534
+ *
535
+ * If any of `groupsAllowed`, `usersAllowed`, or `rolesAllowed` are set,
536
+ * access is granted when the user matches ANY list (OR logic).
537
+ * All empty/absent means visible to everyone. Admin users bypass all checks.
538
+ */
539
+ export type CompositeAppNavItemPermissions = z.infer<typeof CompositeAppNavItemPermissionsSchema>;
540
+ /**
541
+ * A navigable item in the sidebar menu.
542
+ * An "app" is just a nav-item with `appName` + `route: "/"` that has children.
543
+ * Nav-items carry their own `appName` for routing, independent of position in the tree.
544
+ */
545
+ export interface CompositeAppMenuNavItem {
546
+ /** Stable unique identifier */
547
+ id: string;
548
+ /** Display label shown in the sidebar */
549
+ label: string;
550
+ /** Lucide icon name or SVG content string */
551
+ icon?: string;
552
+ /** Which installed app this item routes to */
553
+ appName?: string;
554
+ /** Route path within the app (e.g. "/" or "/dashboard") */
555
+ route?: string;
556
+ /** When true, this item is hidden from the sidebar */
557
+ hidden?: boolean;
558
+ /**
559
+ * Optional description for dashboard cards and summary views.
560
+ * `null` = user explicitly cleared it (show no description, skip fallback).
561
+ * `undefined` / absent = no override (fall back to manifest description).
562
+ */
563
+ description?: string | null;
564
+ /** When true, this item is excluded from the Composite App dashboard cards */
565
+ hideFromDashboard?: boolean;
566
+ /** Optional access control settings for this nav item */
567
+ permissions?: CompositeAppNavItemPermissions;
568
+ /** Ordered child nav-items */
569
+ children?: CompositeAppMenuNavItem[];
570
+ }
571
+ /**
572
+ * A top-level section heading in the sidebar menu.
573
+ * Sections are always at root level and contain nav-items.
574
+ */
575
+ export type CompositeAppMenuSection = z.infer<typeof CompositeAppMenuSectionSchema>;
576
+ export type CompositeAppHomePlugin = z.infer<typeof CompositeAppHomePluginSchema>;
577
+ /**
578
+ * Discriminator for a header item.
579
+ * The four built-ins (`app_portal`, `docs`, `help`, `user_menu`) seed the default
580
+ * header and cannot be deleted (only hidden/customized); `custom` items are fully
581
+ * user-defined buttons.
582
+ */
583
+ export type CompositeAppHeaderItemKind = z.infer<typeof CompositeAppHeaderItemKindSchema>;
584
+ /** Where a header link opens. */
585
+ export type CompositeAppHeaderItemTarget = z.infer<typeof CompositeAppHeaderItemTargetSchema>;
586
+ /** Stable identifiers for the built-in header items. */
587
+ export declare const COMPOSITE_APP_HEADER_BUILTIN_IDS: readonly ["app_portal", "docs", "help", "user_menu"];
588
+ /**
589
+ * A single button in the CompositeApp header bar.
590
+ *
591
+ * Unlike sidebar nav-items, header items are free-form and not tied to an installed
592
+ * app: each is a labelled, icon-bearing button linking to a route or external URL.
593
+ * The `user_menu` item is special — it renders the account dropdown, so its `icon`,
594
+ * `href`, and `target` are ignored.
595
+ */
596
+ export type CompositeAppHeaderItem = z.infer<typeof CompositeAppHeaderItemSchema>;
597
+ /**
598
+ * CompositeApp shell configuration.
599
+ * This is the main configuration interface for storing CompositeApp settings.
600
+ * Used as the MongoDB model for persisting CompositeApp configurations.
601
+ */
602
+ export type CompositeAppConfig = z.infer<typeof CompositeAppConfigSchema>;
603
+ export type CompositeAppConfigPayload = z.infer<typeof CompositeAppConfigPayloadSchema>;
604
+ export type ValidateUrlRequest = z.infer<typeof ValidateUrlRequestSchema>;
605
+ export type ValidateUrlResponse = z.infer<typeof ValidateUrlResponseSchema>;
606
+ /**
607
+ * Result of DELETE /api/v1/apps/:id. With `?confirm=true` the cascade runs and
608
+ * `deleted: true` is set; without it the endpoint returns a dry-run summary so
609
+ * the UI can show what would be removed.
610
+ */
611
+ export interface AppDeleteSummary {
612
+ confirmed: boolean;
613
+ app_id: string;
614
+ app_name: string;
615
+ versions: number;
616
+ installations: number;
617
+ storage_prefix: string;
618
+ git_repo_url?: string;
619
+ deleted: boolean;
620
+ warnings: string[];
621
+ }
622
+
623
+ // -----------------------------------------------------------------------------
624
+ // @vertesia/common: data-platform.d.ts
625
+ // -----------------------------------------------------------------------------
626
+ import type { AppDashboardDefinitionSchema } from './api-schemas/app-runtime.js';
627
+ /**
628
+ * Data Platform Types
629
+ *
630
+ * Types for managing versioned analytical data stores with DuckDB + GCS storage.
631
+ * Supports AI-manageable schemas and multi-table atomic operations.
632
+ */
633
+ import type { z } from 'zod';
634
+ import type { CreateDashboardPayloadSchema, CreateDashboardSnapshotPayloadSchema, DashboardArchiveResultSchema, DashboardBulkArchiveResultSchema, DashboardBulkDeleteResultSchema, DashboardDataSourceSchema, DashboardElasticsearchDslSchema, DashboardElasticsearchResultMappingSchema, DashboardItemSchema, DashboardLayoutSchema, DashboardPanelPositionSchema, DashboardPanelSchema, DashboardQuerySchema, DashboardSchema, DashboardSqlDataSourceSchema, DashboardStatusSchema, DashboardStoreElasticsearchDataSourceSchema, DashboardVersionItemSchema, DashboardVersioningPayloadSchema, DashboardVersioningStatusResponseSchema, DashboardVersionSchema, PromoteDashboardVersionPayloadSchema, UpdateDashboardPayloadSchema } from './api-schemas/dashboard.js';
635
+ import type { AlterTableOperationSchema, AlterTablePayloadSchema, BatchQueryPayloadSchema, BatchQueryResultItemSchema, BatchQueryResultSchema, CreateDataStorePayloadSchema, CreateSnapshotPayloadSchema, CreateTablePayloadSchema, CreateTablesPayloadSchema, DataColumnForAISchema, DataColumnSchema, DataColumnTypeSchema, DataForeignKeyForAISchema, DataForeignKeySchema, DataIndexSchema, DataRelationshipForAISchema, DataRelationshipSchema, DataRelationshipTypeSchema, DataSchemaForAISchema, DataSchemaSchema, DataStoreArchiveResultSchema, DataStoreDownloadInfoSchema, DataStoreFullSchemaResponseSchema, DataStoreItemSchema, DataStoreMutateRowsPayloadSchema, DataStoreMutateRowsResultSchema, DataStoreSchema, DataStoreSchemaResponseSchema, DataStoreStatusSchema, DataStoreTableDetailSchema, DataStoreTableDropResultSchema, DataStoreVersionSchema, DataStoreVersionTableStateSchema, DataTableForAISchema, DataTableSchema, DataTableSemanticTypeSchema, DataTableSummarySchema, GetDataStoreTableQuerySchema, ImportDataFormatSchema, ImportDataPayloadSchema, ImportDataSourceSchema, ImportJobSchema, ImportStatusSchema, ImportTableDataSchema, ListDataStoreVersionsQuerySchema, QueryPayloadSchema, QueryResultColumnSchema, QueryResultSchema, QueryValidationErrorSchema, QueryValidationPayloadSchema, QueryValidationResultSchema, SemanticColumnTypeSchema, UpdateSchemaPayloadSchema } from './api-schemas/data-store.js';
636
+ /**
637
+ * Supported column data types for DuckDB tables.
638
+ */
639
+ export declare const DataColumnType: {
640
+ readonly STRING: "STRING";
641
+ readonly INTEGER: "INTEGER";
642
+ readonly BIGINT: "BIGINT";
643
+ readonly FLOAT: "FLOAT";
644
+ readonly DOUBLE: "DOUBLE";
645
+ readonly DECIMAL: "DECIMAL";
646
+ readonly BOOLEAN: "BOOLEAN";
647
+ readonly DATE: "DATE";
648
+ readonly TIMESTAMP: "TIMESTAMP";
649
+ readonly JSON: "JSON";
650
+ };
651
+ export type DataColumnType = z.infer<typeof DataColumnTypeSchema>;
652
+ /**
653
+ * Semantic types that provide AI agents with context about column meaning.
654
+ */
655
+ export declare const SemanticColumnType: {
656
+ readonly EMAIL: "email";
657
+ readonly PHONE: "phone";
658
+ readonly URL: "url";
659
+ readonly CURRENCY: "currency";
660
+ readonly PERCENTAGE: "percentage";
661
+ readonly PERSON_NAME: "person_name";
662
+ readonly ADDRESS: "address";
663
+ readonly COUNTRY: "country";
664
+ readonly DATE_ISO: "date_iso";
665
+ readonly IDENTIFIER: "identifier";
666
+ };
667
+ export type SemanticColumnType = z.infer<typeof SemanticColumnTypeSchema>;
668
+ /**
669
+ * Mapping from DataColumnType to DuckDB SQL types.
670
+ */
671
+ export declare const DATA_COLUMN_TYPE_TO_DUCKDB: Record<DataColumnType, string>;
672
+ /**
673
+ * Column definition for a data table.
674
+ */
675
+ export type DataColumn = z.infer<typeof DataColumnSchema>;
676
+ /**
677
+ * Foreign key constraint definition.
678
+ */
679
+ export type DataForeignKey = z.infer<typeof DataForeignKeySchema>;
680
+ /**
681
+ * Index definition for a table.
682
+ */
683
+ export type DataIndex = z.infer<typeof DataIndexSchema>;
684
+ /**
685
+ * Semantic type categorization for tables.
686
+ */
687
+ export type DataTableSemanticType = z.infer<typeof DataTableSemanticTypeSchema>;
688
+ /**
689
+ * Table definition within a data schema.
690
+ */
691
+ export type DataTable = z.infer<typeof DataTableSchema>;
692
+ /**
693
+ * Summary view of a data table (for listings).
694
+ */
695
+ export type DataTableSummary = z.infer<typeof DataTableSummarySchema>;
696
+ /**
697
+ * Relationship type between tables.
698
+ */
699
+ export type DataRelationshipType = z.infer<typeof DataRelationshipTypeSchema>;
700
+ /**
701
+ * Semantic relationship between tables for AI understanding.
702
+ */
703
+ export type DataRelationship = z.infer<typeof DataRelationshipSchema>;
704
+ /**
705
+ * Complete schema definition for a data store.
706
+ */
707
+ export type DataSchema = z.infer<typeof DataSchemaSchema>;
708
+ export type DataStoreFullSchemaResponse = z.infer<typeof DataStoreFullSchemaResponseSchema>;
709
+ /**
710
+ * Data store lifecycle status.
711
+ */
712
+ export declare const DataStoreStatus: {
713
+ readonly CREATING: "creating";
714
+ readonly ACTIVE: "active";
715
+ readonly ERROR: "error";
716
+ readonly ARCHIVED: "archived";
717
+ };
718
+ export type DataStoreStatus = z.infer<typeof DataStoreStatusSchema>;
719
+ /**
720
+ * Summary view of a data store (for listings).
721
+ */
722
+ export type DataStoreItem = z.infer<typeof DataStoreItemSchema>;
723
+ /**
724
+ * Full data store with schema details.
725
+ */
726
+ export type DataStore = z.infer<typeof DataStoreSchema>;
727
+ /**
728
+ * Table state within a version.
729
+ */
730
+ export type DataStoreVersionTableState = z.infer<typeof DataStoreVersionTableStateSchema>;
731
+ /**
732
+ * A point-in-time version of a data store.
733
+ */
734
+ export type DataStoreVersion = z.infer<typeof DataStoreVersionSchema>;
735
+ export type ListDataStoreVersionsQuery = z.infer<typeof ListDataStoreVersionsQuerySchema>;
736
+ export type GetDataStoreTableQuery = z.infer<typeof GetDataStoreTableQuerySchema>;
737
+ /**
738
+ * Import job status.
739
+ */
740
+ export declare const ImportStatus: {
741
+ readonly PENDING: "pending";
742
+ readonly PROCESSING: "processing";
743
+ readonly COMPLETED: "completed";
744
+ readonly FAILED: "failed";
745
+ readonly ROLLED_BACK: "rolled_back";
746
+ };
747
+ export type ImportStatus = z.infer<typeof ImportStatusSchema>;
748
+ /**
749
+ * Import job tracking.
750
+ */
751
+ export type ImportJob = z.infer<typeof ImportJobSchema>;
752
+ /**
753
+ * Payload for creating a new data store.
754
+ */
755
+ export type CreateDataStorePayload = z.infer<typeof CreateDataStorePayloadSchema>;
756
+ /**
757
+ * Payload for creating a new table.
758
+ */
759
+ export type CreateTablePayload = z.infer<typeof CreateTablePayloadSchema>;
760
+ /**
761
+ * Payload for creating multiple tables atomically.
762
+ */
763
+ export type CreateTablesPayload = z.infer<typeof CreateTablesPayloadSchema>;
764
+ export type QueryValidationPayload = z.infer<typeof QueryValidationPayloadSchema>;
765
+ export type BatchQueryPayload = z.infer<typeof BatchQueryPayloadSchema>;
766
+ /**
767
+ * Schema change operation types.
768
+ */
769
+ /**
770
+ * @discriminator op
771
+ */
772
+ export type AlterTableOperation = z.infer<typeof AlterTableOperationSchema>;
773
+ /**
774
+ * Payload for altering a table schema.
775
+ */
776
+ export type AlterTablePayload = z.infer<typeof AlterTablePayloadSchema>;
777
+ /**
778
+ * Payload for AI-driven bulk schema updates.
779
+ */
780
+ export type UpdateSchemaPayload = z.infer<typeof UpdateSchemaPayloadSchema>;
781
+ /**
782
+ * Data source for import.
783
+ * - 'inline': data provided directly in the payload
784
+ * - 'gcs': data in Google Cloud Storage (gs://bucket/path)
785
+ * - 'url': data at an HTTPS URL
786
+ * - 'artifact': data from workflow artifact (resolved to GCS by tool)
787
+ */
788
+ export type ImportDataSource = z.infer<typeof ImportDataSourceSchema>;
789
+ /**
790
+ * Data format for external sources.
791
+ */
792
+ export type ImportDataFormat = z.infer<typeof ImportDataFormatSchema>;
793
+ /**
794
+ * Table data specification for import.
795
+ */
796
+ export type ImportTableData = z.infer<typeof ImportTableDataSchema>;
797
+ /**
798
+ * Payload for importing data into tables.
799
+ */
800
+ export type ImportDataPayload = z.infer<typeof ImportDataPayloadSchema>;
801
+ /**
802
+ * Payload for creating a named snapshot.
803
+ */
804
+ export type CreateSnapshotPayload = z.infer<typeof CreateSnapshotPayloadSchema>;
805
+ /**
806
+ * Payload for executing a query.
807
+ */
808
+ export type QueryPayload = z.infer<typeof QueryPayloadSchema>;
809
+ /**
810
+ * Payload for mutating data rows with a single SQL statement.
811
+ */
812
+ export type DataStoreMutateRowsPayload = z.infer<typeof DataStoreMutateRowsPayloadSchema>;
813
+ /**
814
+ * Result from mutating rows in a data store.
815
+ */
816
+ export type DataStoreMutateRowsResult = z.infer<typeof DataStoreMutateRowsResultSchema>;
817
+ /**
818
+ * Column metadata in query results.
819
+ */
820
+ export type QueryResultColumn = z.infer<typeof QueryResultColumnSchema>;
821
+ /**
822
+ * Query execution result.
823
+ */
824
+ export type QueryResult = z.infer<typeof QueryResultSchema>;
825
+ export type BatchQueryResultItem = z.infer<typeof BatchQueryResultItemSchema>;
826
+ export type BatchQueryResult = z.infer<typeof BatchQueryResultSchema>;
827
+ export type QueryValidationError = z.infer<typeof QueryValidationErrorSchema>;
828
+ export type QueryValidationResult = z.infer<typeof QueryValidationResultSchema>;
829
+ export type DataStoreDownloadInfo = z.infer<typeof DataStoreDownloadInfoSchema>;
830
+ export type DataStoreArchiveResult = z.infer<typeof DataStoreArchiveResultSchema>;
831
+ /**
832
+ * @discriminator schema_format
833
+ */
834
+ export type DataStoreSchemaResponse = z.infer<typeof DataStoreSchemaResponseSchema>;
835
+ export type DataStoreTableDetail = z.infer<typeof DataStoreTableDetailSchema>;
836
+ export type DataStoreTableDropResult = z.infer<typeof DataStoreTableDropResultSchema>;
837
+ export type DashboardArchiveResult = z.infer<typeof DashboardArchiveResultSchema>;
838
+ export type DashboardBulkArchiveResult = z.infer<typeof DashboardBulkArchiveResultSchema>;
839
+ export type DashboardBulkDeleteResult = z.infer<typeof DashboardBulkDeleteResultSchema>;
840
+ export type DashboardVersioningStatusResponse = z.infer<typeof DashboardVersioningStatusResponseSchema>;
841
+ export type DashboardVersioningPayload = z.infer<typeof DashboardVersioningPayloadSchema>;
842
+ /**
843
+ * Simplified column representation for AI agents.
844
+ */
845
+ export type DataColumnForAI = z.infer<typeof DataColumnForAISchema>;
846
+ /**
847
+ * Simplified foreign key representation for AI agents.
848
+ */
849
+ export type DataForeignKeyForAI = z.infer<typeof DataForeignKeyForAISchema>;
850
+ /**
851
+ * Simplified table representation for AI agents.
852
+ */
853
+ export type DataTableForAI = z.infer<typeof DataTableForAISchema>;
854
+ /**
855
+ * Simplified relationship representation for AI agents.
856
+ */
857
+ export type DataRelationshipForAI = z.infer<typeof DataRelationshipForAISchema>;
858
+ /**
859
+ * Simplified schema representation optimized for AI agent consumption.
860
+ * Provides semantic context for understanding the data model.
861
+ */
862
+ export type DataSchemaForAI = z.infer<typeof DataSchemaForAISchema>;
863
+ /**
864
+ * Version retention configuration.
865
+ */
866
+ export interface DataStoreRetentionConfig {
867
+ /** Keep versions for this many days */
868
+ retention_days: number;
869
+ /** Named snapshots are exempt from retention */
870
+ snapshots_exempt: boolean;
871
+ }
872
+ /**
873
+ * Default retention configuration: 30 days, snapshots exempt.
874
+ */
875
+ export declare const DEFAULT_RETENTION_CONFIG: DataStoreRetentionConfig;
876
+ /**
877
+ * Dashboard lifecycle status.
878
+ */
879
+ export declare const DashboardStatus: {
880
+ /** Dashboard is active and usable */
881
+ readonly ACTIVE: "active";
882
+ /** Dashboard has been archived (soft deleted) */
883
+ readonly ARCHIVED: "archived";
884
+ };
885
+ export type DashboardStatus = z.infer<typeof DashboardStatusSchema>;
886
+ /**
887
+ * Named SQL query that maps to a Vega data source.
888
+ * Supports parameterized SQL with {{param_name}} placeholders.
889
+ *
890
+ * @deprecated Use single `query` field on Dashboard instead. Multiple queries
891
+ * prevent cross-panel interactivity. Use JOINs/CTEs in a single query.
892
+ */
893
+ export type DashboardQuery = z.infer<typeof DashboardQuerySchema>;
894
+ /**
895
+ * Panel position within the dashboard grid.
896
+ *
897
+ * @deprecated Use combined Vega-Lite spec with vconcat/hconcat instead.
898
+ */
899
+ export type DashboardPanelPosition = z.infer<typeof DashboardPanelPositionSchema>;
900
+ /**
901
+ * Dashboard panel with Vega/Vega-Lite visualization.
902
+ *
903
+ * @deprecated Use combined Vega-Lite spec with vconcat/hconcat instead.
904
+ * Combined specs enable cross-panel interactivity (selections filtering other panels).
905
+ */
906
+ export type DashboardPanel = z.infer<typeof DashboardPanelSchema>;
907
+ /**
908
+ * Dashboard layout configuration.
909
+ *
910
+ * @deprecated Layout is now handled within the Vega-Lite spec via vconcat/hconcat.
911
+ */
912
+ export type DashboardLayout = z.infer<typeof DashboardLayoutSchema>;
913
+ /**
914
+ * Default layout configuration for dashboards.
915
+ *
916
+ * @deprecated Use combined Vega-Lite spec with vconcat/hconcat instead.
917
+ */
918
+ export declare const DEFAULT_DASHBOARD_LAYOUT: DashboardLayout;
919
+ /**
920
+ * SQL query parameters with default values.
921
+ * Supports {{param_name}} placeholders in SQL that get substituted at runtime.
922
+ */
923
+ export interface DashboardQueryParameters {
924
+ /** Default values for SQL parameters. Keys are parameter names (without braces). */
925
+ defaults: Record<string, string>;
926
+ }
927
+ /**
928
+ * Elasticsearch DSL supported by dashboard data sources.
929
+ * Queries execute through Vertesia Store, so project/security filtering remains server-side.
930
+ */
931
+ export type DashboardElasticsearchDsl = z.infer<typeof DashboardElasticsearchDslSchema>;
932
+ /**
933
+ * How an Elasticsearch DSL result should be converted into Vega rows.
934
+ */
935
+ export type DashboardElasticsearchResultMapping = z.infer<typeof DashboardElasticsearchResultMappingSchema>;
936
+ /**
937
+ * Dashboard data source backed by a Data Platform SQL query.
938
+ */
939
+ export type DashboardSqlDataSource = z.infer<typeof DashboardSqlDataSourceSchema>;
940
+ /**
941
+ * Dashboard data source backed by Vertesia Store Elasticsearch DSL.
942
+ */
943
+ export type DashboardStoreElasticsearchDataSource = z.infer<typeof DashboardStoreElasticsearchDataSourceSchema>;
944
+ /**
945
+ * Data source for a Vega dashboard.
946
+ */
947
+ export type DashboardDataSource = z.infer<typeof DashboardDataSourceSchema>;
948
+ /**
949
+ * Dashboard definition contributed by an app package.
950
+ *
951
+ * App dashboard IDs are local to the app. The platform exposes them as
952
+ * `app:<app_name>:<id>` when listing or retrieving dashboards.
953
+ */
954
+ export type AppDashboardDefinition = z.infer<typeof AppDashboardDefinitionSchema>;
955
+ /**
956
+ * Summary view of a dashboard (for listings).
957
+ */
958
+ export type DashboardItem = z.infer<typeof DashboardItemSchema>;
959
+ /**
960
+ * Full dashboard with SQL query and Vega-Lite specification.
961
+ *
962
+ * **New architecture (v2):**
963
+ * - `dataSource` field with either SQL or Store Elasticsearch DSL
964
+ * - Single `spec` field with complete Vega-Lite spec (vconcat/hconcat for multiple panels)
965
+ * - Cross-panel interactivity via Vega selections
966
+ * - Legacy top-level `query` fields are treated as a SQL data source
967
+ *
968
+ * **Legacy architecture (v1, deprecated):**
969
+ * - Multiple `queries` with named data sources
970
+ * - Multiple `panels` with separate specs and dataSources references
971
+ * - `layout` for grid positioning
972
+ * - No cross-panel interactivity
973
+ */
974
+ export type Dashboard = z.infer<typeof DashboardSchema>;
975
+ /**
976
+ * Payload for creating a new dashboard.
977
+ * Requires a data source and spec (Vega-Lite).
978
+ */
979
+ export type CreateDashboardPayload = z.infer<typeof CreateDashboardPayloadSchema>;
980
+ /**
981
+ * Payload for updating a dashboard.
982
+ */
983
+ export type UpdateDashboardPayload = z.infer<typeof UpdateDashboardPayloadSchema>;
984
+ /**
985
+ * Payload for previewing a dashboard (render without saving).
986
+ */
987
+ export interface PreviewDashboardPayload {
988
+ /** Data source used to populate Vega `data.values`. */
989
+ dataSource?: DashboardDataSource;
990
+ /** SQL query that returns all data for the dashboard */
991
+ query?: string;
992
+ /** Maximum rows to return from the query (default: 10000) */
993
+ queryLimit?: number;
994
+ /** Default values for SQL parameters */
995
+ queryParameters?: Record<string, string>;
996
+ /** Complete Vega-Lite specification for the entire dashboard */
997
+ spec?: Record<string, unknown>;
998
+ /** @deprecated Use single `query` field instead */
999
+ queries?: DashboardQuery[];
1000
+ /** @deprecated Use single `spec` field with vconcat/hconcat instead */
1001
+ panels?: DashboardPanel[];
1002
+ /** @deprecated Layout is now handled within the Vega-Lite spec */
1003
+ layout?: Partial<DashboardLayout>;
1004
+ }
1005
+ /**
1006
+ * Options for rendering a dashboard.
1007
+ */
1008
+ export interface RenderDashboardOptions {
1009
+ /** Scale factor for higher resolution (default: 1) */
1010
+ scale?: number;
1011
+ /** Force re-render even if cached (default: false) */
1012
+ force?: boolean;
1013
+ /** Background color (default: white) */
1014
+ backgroundColor?: string;
1015
+ }
1016
+ /**
1017
+ * Result of rendering a dashboard.
1018
+ */
1019
+ export interface RenderDashboardResult {
1020
+ /** URL to the rendered PNG image */
1021
+ url: string;
1022
+ /** When the URL expires (seconds from now) */
1023
+ expires_in: number;
1024
+ /** When the dashboard was rendered */
1025
+ rendered_at: string;
1026
+ /** Image width in pixels */
1027
+ width: number;
1028
+ /** Image height in pixels */
1029
+ height: number;
1030
+ }
1031
+ /**
1032
+ * A point-in-time version of a dashboard.
1033
+ * Stores full snapshot inline (no external storage needed for small JSON documents).
1034
+ */
1035
+ export type DashboardVersion = z.infer<typeof DashboardVersionSchema>;
1036
+ /**
1037
+ * Summary view of a dashboard version (for listings).
1038
+ */
1039
+ export type DashboardVersionItem = z.infer<typeof DashboardVersionItemSchema>;
1040
+ /**
1041
+ * Payload for creating a named snapshot.
1042
+ */
1043
+ export type CreateDashboardSnapshotPayload = z.infer<typeof CreateDashboardSnapshotPayloadSchema>;
1044
+ /**
1045
+ * Payload for promoting a version to current.
1046
+ */
1047
+ export type PromoteDashboardVersionPayload = z.infer<typeof PromoteDashboardVersionPayloadSchema>;
1048
+
1049
+ // -----------------------------------------------------------------------------
1050
+ // @vertesia/common: interaction.d.ts
1051
+ // -----------------------------------------------------------------------------
1052
+ import type { CompletionResult, ExecutionTokenUsage, JSONObject, JSONSchema, Modalities, ModelOptions, StatelessExecutionOptions, ToolUse } from '@llumiverse/common';
1053
+ import type { z } from 'zod';
1054
+ import type { AgentResourceActionSchema, AgentResourceReferenceSchema, AgentResourceTypeSchema, AgentRunnerOptionsSchema, AsyncCompletionModeSchema, AsyncCompletionOptionsSchema, AsyncConversationExecutionPayloadSchema, AsyncExecutionPayloadSchema, AsyncExecutionResultSchema, AsyncInteractionExecutionPayloadSchema, CachePolicySchema, CatalogInteractionRefSchema, ConversationStripOptionsSchema, ConversationVisibilitySchema, ExecutionRunInteractionSchema, ExecutionRunRefSchema, ExecutionRunWorkflowSchema, GeneratedInteractionDefinitionSchema, GeneratedInteractionPromptSegmentSchema, GeneratedInteractionPromptTemplateSchema, GeneratedTestDataRecordSchema, GenerateInteractionPayloadSchema, GenerateTestDataPayloadSchema, ImprovePromptPayloadConfigSchema, ImprovePromptPayloadSchema, InCodePromptSchema, InitialToolCallSchema, InteractionCreatePayloadSchema, InteractionEndpointQuerySchema, InteractionEndpointSchema, InteractionExecutionErrorSchema, InteractionExecutionPayloadSchema, InteractionForkPayloadSchema, InteractionNameSchema, InteractionPublishPayloadSchema, InteractionRefSchema, InteractionRefWithSchemaSchema, InteractionSchema, InteractionsExportPayloadSchema, InteractionTagsSchema, InteractionUpdatePayloadSchema, InteractionVisibilitySchema, NamedInteractionExecutionPayloadSchema, PromptImprovementResponseSchema, PromptModalitiesSchema, RateLimitRequestPayloadSchema, RateLimitRequestResponseSchema, ResolvedEnvironmentInfoSchema, ResolvedInteractionExecutionInfoSchema, ResolvedRuntimeConfigSchema, ResultStorageOptionsSchema, RunSourceSchema, SchemaRefSchema, SkillContextTriggersSchema, StreamingOptionsSchema, StreamingTelemetryContextSchema, ToolResultMetaSchema, ToolResultSchema, ToolResultsPayloadSchema, UserMessagePayloadSchema } from './api-schemas/interaction.js';
1055
+ import type { InteractionExecutionConfigurationSchema } from './api-schemas/store.js';
1056
+ import type { MCPToolAnnotations } from './apps.js';
1057
+ import type { ExecutionEnvironmentRef } from './environment.js';
1058
+ import type { ProjectRef } from './project.js';
1059
+ import type { ExecutablePromptSegmentDef, PopulatedPromptSegmentDef } from './prompt.js';
1060
+ import type { TextArtifactReference } from './store/conversation-state.js';
1061
+ import type { AccountRef } from './user.js';
1062
+ /**
1063
+ * `RunDataStorageLevel` and `ConfigModes` live in `./interaction-values.js` so the API schemas can
1064
+ * read them without importing this module back. Re-exported here so every existing import path keeps
1065
+ * working.
1066
+ */
1067
+ export * from './interaction-values.js';
1068
+ import { ConfigModes, RunDataStorageLevel } from './interaction-values.js';
1069
+ export type InteractionExecutionError = z.infer<typeof InteractionExecutionErrorSchema>;
1070
+ /**
1071
+ * Configuration for stripping large data from conversation history
1072
+ * to prevent JSON serialization issues and reduce storage bloat.
1073
+ */
1074
+ export type ConversationStripOptions = z.infer<typeof ConversationStripOptionsSchema>;
1075
+ /**
1076
+ * Reference to an interaction in the catalog.
1077
+ * Used in catalog listing. The id is composed of the namespace and the interaction name.
1078
+ * Stored interactions can use `oid:` prefix.
1079
+ * If no prefix is used it fallback on `oid:`.
1080
+ */
1081
+ export type CatalogInteractionRef = z.infer<typeof CatalogInteractionRefSchema>;
1082
+ export interface CatalogTagQuery {
1083
+ tag?: string;
1084
+ }
1085
+ export interface StoredCatalogInteractionsQuery extends CatalogTagQuery {
1086
+ status?: string;
1087
+ published?: boolean;
1088
+ }
1089
+ export interface ExecuteInteractionByEndpointQuery {
1090
+ tag?: string;
1091
+ }
1092
+ export interface ExecuteInteractionByEndpointHeaders {
1093
+ 'x-interaction-tag'?: string;
1094
+ }
1095
+ export interface ResolveInteractionQuery {
1096
+ environment?: string;
1097
+ model?: string;
1098
+ hasImage?: boolean;
1099
+ hasVideo?: boolean;
1100
+ }
1101
+ export type InCodePrompt = z.infer<typeof InCodePromptSchema>;
1102
+ export interface InCodeInteraction {
1103
+ /**
1104
+ * The interaction type.
1105
+ */
1106
+ type: 'sys' | 'app' | 'stored' | 'draft';
1107
+ /**
1108
+ * The id of the interaction. Required.
1109
+ * The id is a unique identifier for the interaction.
1110
+ * It is recommended to use a URL safe string and not include spaces.
1111
+ * The id is composed of some namespace or prefix and the interaction name.
1112
+ * Example: sys:generic_question, app:review_contract, tmp:my_temp_interaction
1113
+ */
1114
+ id: string;
1115
+ /**
1116
+ * The interaction code name. Required.
1117
+ * Should be a URL safe string and not include spaces. It is recommended to use kebab-case or camel-case.
1118
+ * The endpoints must satisfy the following regexp: /^[a-zA-Z0-9-_]+$/. No whitespaces or special characters are allowed.
1119
+ */
1120
+ name: string;
1121
+ /**
1122
+ * Only applies for stored interactions. The version of the interaction.
1123
+ * Undefined for non stored interactions
1124
+ */
1125
+ version?: number;
1126
+ /**
1127
+ * Only applies for stored interactions. Whether the interaction is published or not.
1128
+ */
1129
+ published?: boolean;
1130
+ /**
1131
+ * A title for the interaction. If not provided, the endpoint will be used.
1132
+ */
1133
+ title?: string;
1134
+ /**
1135
+ * An optional description of the interaction.
1136
+ */
1137
+ description?: string;
1138
+ /**
1139
+ * The JSON schema to be used for the result if any.
1140
+ */
1141
+ result_schema?: JSONSchema | SchemaRef;
1142
+ /**
1143
+ * The modality of the interaction output.
1144
+ * If not specified Modalities.Text is assumed.
1145
+ */
1146
+ output_modality?: Modalities;
1147
+ /**
1148
+ * How to store the run data for executions of this interaction.
1149
+ * Defaults to STANDARD.
1150
+ */
1151
+ storage?: RunDataStorageLevel;
1152
+ /**
1153
+ * Optional tags for the interaction.
1154
+ */
1155
+ tags?: string[];
1156
+ /**
1157
+ * Agent Runner configuration options.
1158
+ */
1159
+ agent_runner_options?: AgentRunnerOptions;
1160
+ /**
1161
+ * Default options for the model to be used when executing this interaction.
1162
+ * (like temperature etc)
1163
+ */
1164
+ model_options?: ModelOptions;
1165
+ /**
1166
+ * The prompts composing the interaction. Required.
1167
+ */
1168
+ prompts: InCodePrompt[];
1169
+ /**
1170
+ * Optional reference to an external resource if any.
1171
+ * Used internally by the system to synchronize stored interactions with in-code interactions.
1172
+ */
1173
+ externalId?: string;
1174
+ /**
1175
+ * Runtime configuration (system use only)
1176
+ *
1177
+ * This field is populated by the system when converting stored interactions
1178
+ * and contains runtime-specific defaults like target model/environment IDs.
1179
+ *
1180
+ * DO NOT set this field manually when writing interaction definitions.
1181
+ * These values are environment-specific and not portable.
1182
+ *
1183
+ * @internal
1184
+ */
1185
+ runtime?: {
1186
+ /**
1187
+ * Default target environment for the interaction execution
1188
+ */
1189
+ environment?: string;
1190
+ /**
1191
+ * Default (recommended) target model for the interaction execution
1192
+ */
1193
+ model?: string;
1194
+ };
1195
+ }
1196
+ export interface InteractionSpec extends Omit<InCodeInteraction, 'id' | 'runtime' | 'type' | 'published' | 'version'> {
1197
+ }
1198
+ /**
1199
+ * The payload to query the interaction endpoints
1200
+ */
1201
+ export type InteractionEndpointQuery = z.infer<typeof InteractionEndpointQuerySchema>;
1202
+ /**
1203
+ * A description of an interaction endpoint.
1204
+ */
1205
+ export type InteractionEndpoint = z.infer<typeof InteractionEndpointSchema>;
1206
+ export type InteractionTags = z.infer<typeof InteractionTagsSchema>;
1207
+ export type InteractionRef = z.infer<typeof InteractionRefSchema>;
1208
+ /** An interaction reduced to the fields a name picker needs. */
1209
+ export type InteractionName = z.infer<typeof InteractionNameSchema>;
1210
+ export declare const InteractionNamePopulate = "id name";
1211
+ export declare const InteractionRefPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts";
1212
+ export declare const InteractionRefWithSchemaPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts result_schema";
1213
+ /**
1214
+ * An interaction reference carrying the schemas an export needs to reconstruct it.
1215
+ *
1216
+ * An alias of the published component rather than the `Omit<InteractionRef, 'prompts'>` interface it
1217
+ * replaces. That `Omit` could not be resolved by the schema generator once `InteractionRef` became a
1218
+ * canonical alias — the alias publishes as a bare reference, with no members to omit — and the
1219
+ * interface also overstated each prompt template, which an export populates with `inputSchema` alone.
1220
+ */
1221
+ export type InteractionRefWithSchema = z.infer<typeof InteractionRefWithSchemaSchema>;
1222
+ export type InteractionsExportPayload = z.infer<typeof InteractionsExportPayloadSchema>;
1223
+ export declare enum InteractionStatus {
1224
+ draft = "draft",
1225
+ published = "published",
1226
+ archived = "archived",
1227
+ code = "code",// for in-code interactions that are not stored in the database
1228
+ unknown = "unknown"
1229
+ }
1230
+ export declare enum ExecutionRunStatus {
1231
+ created = "created",
1232
+ processing = "processing",
1233
+ completed = "completed",
1234
+ failed = "failed"
1235
+ }
1236
+ export declare enum RunDataStorageDescription {
1237
+ STANDARD = "Run data is stored for both the model inputs and output.",
1238
+ RESTRICTED = "No run data is stored for the model inputs \u2014 only the model output.",
1239
+ DEBUG = "Run data is stored for the model inputs and output, schema, and final prompt."
1240
+ }
1241
+ export declare const RunDataStorageOptions: Record<RunDataStorageLevel, RunDataStorageDescription>;
1242
+ /**
1243
+ * Schema can be stored or specified as a reference to an external schema.
1244
+ * We only support "store:" references for now
1245
+ */
1246
+ export type SchemaRef = z.infer<typeof SchemaRefSchema>;
1247
+ export type CachePolicy = z.infer<typeof CachePolicySchema>;
1248
+ export type InteractionVisibility = z.infer<typeof InteractionVisibilitySchema>;
1249
+ export interface InteractionData {
1250
+ readonly id: string;
1251
+ name: string;
1252
+ endpoint: string;
1253
+ description?: string;
1254
+ project: string | ProjectRef;
1255
+ tags: string[];
1256
+ agent_runner_options?: AgentRunnerOptions;
1257
+ result_schema?: JSONSchema | SchemaRef;
1258
+ environment?: string | ExecutionEnvironmentRef;
1259
+ model?: string;
1260
+ model_options?: ModelOptions;
1261
+ restriction?: RunDataStorageLevel;
1262
+ /**
1263
+ * @deprecated This is deprecated. Use CompletionResult.type information instead.
1264
+ */
1265
+ output_modality?: Modalities;
1266
+ }
1267
+ export type Interaction = z.infer<typeof InteractionSchema>;
1268
+ export interface PopulatedInteraction extends Omit<Interaction, 'prompts'> {
1269
+ prompts: PopulatedPromptSegmentDef[];
1270
+ }
1271
+ /**
1272
+ * Used to describe an interaction that can be executed. Contains only the interaction data useful
1273
+ * to execute the interaction plus the prompt templates
1274
+ */
1275
+ export interface ExecutableInteraction extends InteractionData {
1276
+ prompts: ExecutablePromptSegmentDef[];
1277
+ }
1278
+ export type InteractionCreatePayload = z.infer<typeof InteractionCreatePayloadSchema>;
1279
+ export type InteractionUpdatePayload = z.infer<typeof InteractionUpdatePayloadSchema>;
1280
+ export type InteractionPublishPayload = z.infer<typeof InteractionPublishPayloadSchema>;
1281
+ export interface InteractionDeletePayload {
1282
+ /**
1283
+ * When true, also delete every interaction in the same family as the target:
1284
+ * - If the target is the root draft, its forks and published versions are deleted.
1285
+ * - If the target is a published version (or fork), the parent draft and all siblings are deleted.
1286
+ * Forward-only cascade — never deletes outside the target's family.
1287
+ */
1288
+ cascade?: boolean;
1289
+ }
1290
+ export type InteractionForkPayload = z.infer<typeof InteractionForkPayloadSchema>;
1291
+ export type InteractionExecutionPayload = z.infer<typeof InteractionExecutionPayloadSchema>;
1292
+ export type NamedInteractionExecutionPayload = z.infer<typeof NamedInteractionExecutionPayloadSchema>;
1293
+ export type ToolRef = string | {
1294
+ name: string;
1295
+ description: string;
1296
+ };
1297
+ export type ConversationVisibility = z.infer<typeof ConversationVisibilitySchema>;
1298
+ /**
1299
+ * Defines the scope for agent search operations.
1300
+ */
1301
+ export declare enum AgentSearchScope {
1302
+ /**
1303
+ * Search is scoped to a specific collection.
1304
+ */
1305
+ Collection = "collection"
1306
+ }
1307
+ /**
1308
+ * Context triggers for auto-injection of skills.
1309
+ * When these conditions match, the skill is automatically injected into the agent context.
1310
+ */
1311
+ export type SkillContextTriggers = z.infer<typeof SkillContextTriggersSchema>;
1312
+ /**
1313
+ * Configuration options for Agent Runner functionality.
1314
+ * These options control how interactions are exposed and executed in the Agent Runner.
1315
+ */
1316
+ export type AgentRunnerOptions = z.infer<typeof AgentRunnerOptionsSchema>;
1317
+ export type { EmailChannel, EmailRouteData, InteractiveChannel, UserChannel, } from './email.js';
1318
+ export { isEmailChannel, isInteractiveChannel, } from './email.js';
1319
+ /**
1320
+ * A tool invocation executed before the first model turn of a conversation.
1321
+ * Results are injected into the initial context so the agent starts with them in hand.
1322
+ */
1323
+ export type InitialToolCall = z.infer<typeof InitialToolCallSchema>;
1324
+ export type AsyncConversationExecutionPayload = z.infer<typeof AsyncConversationExecutionPayloadSchema>;
1325
+ export type AsyncInteractionExecutionPayload = z.infer<typeof AsyncInteractionExecutionPayloadSchema>;
1326
+ /**
1327
+ * @discriminator type
1328
+ */
1329
+ export type AsyncExecutionPayload = z.infer<typeof AsyncExecutionPayloadSchema>;
1330
+ export type AsyncExecutionResult = z.infer<typeof AsyncExecutionResultSchema>;
1331
+ /**
1332
+ * Telemetry context for streaming mode.
1333
+ * Contains info not available in current_state needed to send LlmCallEvent.
1334
+ */
1335
+ export type StreamingTelemetryContext = z.infer<typeof StreamingTelemetryContextSchema>;
1336
+ /**
1337
+ * Options for storing inference results to cloud storage
1338
+ */
1339
+ export type ResultStorageOptions = z.infer<typeof ResultStorageOptionsSchema>;
1340
+ export type AsyncCompletionMode = z.infer<typeof AsyncCompletionModeSchema>;
1341
+ /**
1342
+ * Streaming-specific options (only needed when stream=true)
1343
+ */
1344
+ export type StreamingOptions = z.infer<typeof StreamingOptionsSchema>;
1345
+ /**
1346
+ * Options for async completion and/or streaming LLM responses
1347
+ */
1348
+ export type AsyncCompletionOptions = z.infer<typeof AsyncCompletionOptionsSchema>;
1349
+ /**
1350
+ * The kinds of Vertesia resource an agent tool can report having created, updated, or deleted.
1351
+ * Restricted to resources that have a real detail route to navigate to — do not emit a reference
1352
+ * for a mutation with no meaningful navigation target. Add new kinds only once their route exists.
1353
+ */
1354
+ export type AgentResourceType = z.infer<typeof AgentResourceTypeSchema>;
1355
+ export type AgentResourceAction = z.infer<typeof AgentResourceActionSchema>;
1356
+ /**
1357
+ * A navigable reference to a resource an agent tool mutated. Tools return these as tool-result
1358
+ * metadata (see {@link ToolResultMeta.resources}); the conversation runtime promotes them onto the
1359
+ * tool's completed lifecycle message so the UI can render deterministic deep links and an
1360
+ * end-of-turn "resources changed" summary — independent of any link the model writes in prose.
1361
+ */
1362
+ export type AgentResourceReference = z.infer<typeof AgentResourceReferenceSchema>;
1363
+ /**
1364
+ * Metadata a tool executor may attach to its result. Kept as an open record for forward
1365
+ * compatibility while typing the fields the runtime interprets.
1366
+ */
1367
+ export type ToolResultMeta = z.infer<typeof ToolResultMetaSchema>;
1368
+ export interface ToolResultContent {
1369
+ content: string;
1370
+ /**
1371
+ * Reference to text content stored outside Temporal/API payloads. Servers that
1372
+ * execute the next model turn should resolve this before constructing the
1373
+ * provider prompt.
1374
+ */
1375
+ content_ref?: TextArtifactReference;
1376
+ is_error: boolean;
1377
+ files?: string[];
1378
+ /**
1379
+ * Optional message to display in the UI instead of the content.
1380
+ * Use this when the content is large or technical (e.g., document text)
1381
+ * and you want to show a friendly message to the user.
1382
+ */
1383
+ display_message?: string;
1384
+ /**
1385
+ * Can contain metadata returned by the tool executor.
1386
+ */
1387
+ meta?: ToolResultMeta;
1388
+ }
1389
+ /**
1390
+ * Validate and normalize an untrusted value into a clean list of resource references. References
1391
+ * cross the wire and may originate from external/MCP tools, so malformed entries are dropped
1392
+ * rather than throwing, and an empty/absent label falls back to the id.
1393
+ */
1394
+ export declare function normalizeAgentResources(value: unknown): AgentResourceReference[];
1395
+ /** Extract the normalized resource references a tool declared in its result metadata. */
1396
+ export declare function getResourcesFromToolResult(result: Pick<ToolResultContent, 'meta'>): AgentResourceReference[];
1397
+ export type ToolResult = z.infer<typeof ToolResultSchema>;
1398
+ /**
1399
+ * The payload to sent the tool responses back to the target LLM
1400
+ */
1401
+ export type ToolResultsPayload = z.infer<typeof ToolResultsPayloadSchema>;
1402
+ export type UserMessagePayload = z.infer<typeof UserMessagePayloadSchema>;
1403
+ export type CheckpointConversationPayload = Omit<ToolResultsPayload, 'results' | 'tools'>;
1404
+ export declare enum RunSourceTypes {
1405
+ api = "api",
1406
+ cli = "cli",
1407
+ ui = "ui",
1408
+ webhook = "webhook",
1409
+ test = "test-data",
1410
+ system = "system",
1411
+ schedule = "schedule"
1412
+ }
1413
+ export type RunSource = z.infer<typeof RunSourceSchema>;
1414
+ export type ExecutionRunInteraction = z.infer<typeof ExecutionRunInteractionSchema>;
1415
+ export interface BaseExecutionRun<P = unknown> {
1416
+ readonly id: string;
1417
+ /**
1418
+ * Only used by runs that were created by a virtual run to point toward the virtual run parent
1419
+ */
1420
+ parent?: string | ExecutionRun;
1421
+ evaluation?: {
1422
+ score?: number;
1423
+ selected?: boolean;
1424
+ scores?: Record<string, number>;
1425
+ };
1426
+ result: CompletionResult[];
1427
+ /**
1428
+ * The parameters used to create the interaction.
1429
+ * If the parameters contains the special property "@memory" it will be used
1430
+ * to locate a memory pack and the other properties will be used as the memory pack mapping.
1431
+ */
1432
+ parameters: P;
1433
+ tags?: string[];
1434
+ interaction?: string | ExecutionRunInteraction;
1435
+ /** Environment reference - populated with full object in API responses */
1436
+ environment: ExecutionEnvironmentRef;
1437
+ modelId?: string;
1438
+ result_schema?: JSONSchema;
1439
+ ttl: number;
1440
+ status: ExecutionRunStatus;
1441
+ finish_reason?: string;
1442
+ prompt?: unknown;
1443
+ token_use?: ExecutionTokenUsage;
1444
+ chunks?: number;
1445
+ execution_time?: number;
1446
+ /** @format date-time */
1447
+ created_at: string;
1448
+ /** @format date-time */
1449
+ updated_at: string;
1450
+ account: AccountRef;
1451
+ project: ProjectRef;
1452
+ config: InteractionExecutionConfiguration;
1453
+ error?: InteractionExecutionError;
1454
+ source: RunSource;
1455
+ /**
1456
+ * @deprecated This is deprecated. Use CompletionResult.type information instead.
1457
+ */
1458
+ output_modality?: Modalities;
1459
+ created_by: string;
1460
+ updated_by: string;
1461
+ /**
1462
+ * The Vertesia Workflow related to this Interaction Run.
1463
+ *
1464
+ * This is only set when the interaction is executed as part of a workflow.
1465
+ *
1466
+ * @since 0.60.0
1467
+ */
1468
+ workflow?: ExecutionRunWorkflow;
1469
+ }
1470
+ export interface ExecutionRun<P = unknown> extends BaseExecutionRun<P> {
1471
+ interaction?: ExecutionRunInteraction;
1472
+ }
1473
+ export interface PopulatedExecutionRun<P = unknown> extends BaseExecutionRun<P> {
1474
+ interaction?: ExecutionRunInteraction;
1475
+ }
1476
+ export type ExecutionRunWorkflow = z.infer<typeof ExecutionRunWorkflowSchema>;
1477
+ export type PromptModalities = z.infer<typeof PromptModalitiesSchema>;
1478
+ export interface InteractionExecutionResult<P = unknown> extends Omit<ExecutionRun<P>, 'account' | 'project' | 'interaction'> {
1479
+ account: string;
1480
+ project: string;
1481
+ interaction?: string;
1482
+ tool_use?: ToolUse[];
1483
+ conversation?: unknown;
1484
+ options?: StatelessExecutionOptions;
1485
+ }
1486
+ export interface LegacyInteractionExecutionResult<P = unknown> extends Omit<InteractionExecutionResult<P>, 'result' | 'account' | 'project'> {
1487
+ account: string | AccountRef;
1488
+ project: string | ProjectRef;
1489
+ result?: JSONObject | string | null;
1490
+ }
1491
+ export type ExecutionRunRef = z.infer<typeof ExecutionRunRefSchema>;
1492
+ export declare const ExecutionRunRefSelect = "-result -parameters -result_schema -prompt";
1493
+ export declare enum ConfigModesDescription {
1494
+ RUN_AND_INTERACTION_CONFIG = "This run configuration is used. Undefined options are filled with interaction configuration.",
1495
+ RUN_CONFIG_ONLY = "Only this run configuration is used. Undefined options remain undefined.",
1496
+ INTERACTION_CONFIG_ONLY = "Only interaction configuration is used."
1497
+ }
1498
+ export declare const ConfigModesOptions: Record<ConfigModes, ConfigModesDescription>;
1499
+ export type InteractionExecutionConfiguration = z.infer<typeof InteractionExecutionConfigurationSchema>;
1500
+ export type GenerateInteractionPayload = z.infer<typeof GenerateInteractionPayloadSchema>;
1501
+ export type GenerateTestDataPayload = z.infer<typeof GenerateTestDataPayloadSchema>;
1502
+ export type GeneratedTestDataRecord = z.infer<typeof GeneratedTestDataRecordSchema>;
1503
+ export type ImprovePromptPayloadConfig = z.infer<typeof ImprovePromptPayloadConfigSchema>;
1504
+ export type ImprovePromptPayload = z.infer<typeof ImprovePromptPayloadSchema>;
1505
+ export type GeneratedInteractionPromptTemplate = z.infer<typeof GeneratedInteractionPromptTemplateSchema>;
1506
+ export type GeneratedInteractionPromptSegment = z.infer<typeof GeneratedInteractionPromptSegmentSchema>;
1507
+ export type GeneratedInteractionDefinition = z.infer<typeof GeneratedInteractionDefinitionSchema>;
1508
+ export type PromptImprovementResponse = z.infer<typeof PromptImprovementResponseSchema>;
1509
+ export type RateLimitRequestPayload = z.infer<typeof RateLimitRequestPayloadSchema>;
1510
+ export type RateLimitRequestResponse = z.infer<typeof RateLimitRequestResponseSchema>;
1511
+ /**
1512
+ * Source of the resolved model configuration
1513
+ */
1514
+ export declare enum ModelSource {
1515
+ /** Model was explicitly provided in the execution config */
1516
+ config = "config",
1517
+ /** Model comes from the interaction definition */
1518
+ interaction = "interaction",
1519
+ /** Model comes from environment's default_model */
1520
+ environmentDefault = "environmentDefault",
1521
+ /** Model comes from project system interaction defaults */
1522
+ projectSystemDefault = "projectSystemDefault",
1523
+ /** Model comes from project base defaults */
1524
+ projectBaseDefault = "projectBaseDefault",
1525
+ /** Model comes from project modality-specific defaults */
1526
+ projectModalityDefault = "projectModalityDefault",
1527
+ /** Model comes from legacy project defaults */
1528
+ projectLegacyDefault = "projectLegacyDefault"
1529
+ }
1530
+ /**
1531
+ * Resolved environment information
1532
+ */
1533
+ export type ResolvedEnvironmentInfo = z.infer<typeof ResolvedEnvironmentInfoSchema>;
1534
+ /**
1535
+ * Resolved runtime configuration for an interaction
1536
+ */
1537
+ export type ResolvedRuntimeConfig = z.infer<typeof ResolvedRuntimeConfigSchema>;
1538
+ /**
1539
+ * Resolved execution info for an interaction.
1540
+ * Contains the interaction ID, basic metadata, and the resolved runtime configuration
1541
+ * (environment, model) that would be used at execution time.
1542
+ */
1543
+ export type ResolvedInteractionExecutionInfo = z.infer<typeof ResolvedInteractionExecutionInfoSchema>;
1544
+ /**
1545
+ * A builtin tool definition from the tools catalog
1546
+ */
1547
+ export interface BuiltinToolDefinition {
1548
+ /**
1549
+ * The unique tool name
1550
+ */
1551
+ name: string;
1552
+ /**
1553
+ * One-line summary shown in the tool selector UI
1554
+ */
1555
+ summary?: string;
1556
+ /**
1557
+ * JSON schema for the tool's parameters
1558
+ */
1559
+ params: JSONSchema;
1560
+ /**
1561
+ * Whether this tool is active by default when no explicit tool list is provided.
1562
+ * Tools with default: false are only activated by skills.
1563
+ */
1564
+ default: boolean;
1565
+ /**
1566
+ * Behavioral hints following the MCP ToolAnnotations spec.
1567
+ * Used for display purposes only — not sent to LLMs.
1568
+ */
1569
+ annotations?: MCPToolAnnotations;
1570
+ }
1571
+ /**
1572
+ * A system skill entry in the tools catalog.
1573
+ * System skills are built into the platform and unlock hidden tools.
1574
+ */
1575
+ export interface SystemSkillCatalogEntry {
1576
+ /** Skill name without the learn_ prefix, e.g. "document_search" */
1577
+ name: string;
1578
+ /** Tool name used in agent selection, i.e. "learn_document_search" */
1579
+ tool_name: string;
1580
+ /** Human-readable display title */
1581
+ title: string;
1582
+ /** Description of what the skill unlocks */
1583
+ description: string;
1584
+ /** Tool names this skill enables (unlocks) when called */
1585
+ tools: string[];
1586
+ /** Whether this skill is part of the default agent toolkit */
1587
+ default?: boolean;
1588
+ }
1589
+ /**
1590
+ * Response from the builtin tools catalog endpoint
1591
+ */
1592
+ export interface BuiltinToolsCatalogResponse {
1593
+ /**
1594
+ * List of available builtin tools
1595
+ */
1596
+ tools: BuiltinToolDefinition[];
1597
+ /**
1598
+ * When the catalog was generated
1599
+ */
1600
+ generated_at: string;
1601
+ /**
1602
+ * Total number of tools in the catalog
1603
+ */
1604
+ total_tools: number;
1605
+ /**
1606
+ * System skills bundled in the platform, available without app installation
1607
+ */
1608
+ skills?: SystemSkillCatalogEntry[];
1609
+ }
1610
+
1611
+ // -----------------------------------------------------------------------------
1612
+ // @vertesia/common: prompt.d.ts
1613
+ // -----------------------------------------------------------------------------
1614
+ import type { JSONSchema, PromptRole } from '@llumiverse/common';
1615
+ import type { z } from 'zod';
1616
+ import type { PromptTemplateCreatePayloadSchema, PromptTemplateRefSchema, PromptTemplateSchema, PromptTemplateUpdatePayloadSchema } from './api-schemas/interaction.js';
1617
+ import type { PromptTemplateForkPayloadSchema, PromptTemplateInteractionsResponseSchema, PromptTemplateInteractionUsageSchema, PromptTemplateInteractionVersionSchema, RenderPromptPayloadSchema, RenderPromptResponseSchema } from './api-schemas/prompt.js';
1618
+ export interface ChatPromptSchema {
1619
+ role: PromptRole.user | PromptRole.assistant;
1620
+ content: string;
1621
+ }
1622
+ export declare enum PromptStatus {
1623
+ draft = "draft",
1624
+ published = "published",
1625
+ archived = "archived"
1626
+ }
1627
+ export declare enum PromptSegmentDefType {
1628
+ chat = "chat",
1629
+ template = "template"
1630
+ }
1631
+ export interface PromptSegmentDef<T = string | PromptTemplate | PromptTemplateRef> {
1632
+ id?: string;
1633
+ type: PromptSegmentDefType;
1634
+ template?: T;
1635
+ configuration?: unknown;
1636
+ }
1637
+ export interface PromptSegmentRef<T = string | PromptTemplate | PromptTemplateRef> extends PromptSegmentDef<T> {
1638
+ id: string;
1639
+ }
1640
+ export interface PopulatedPromptSegmentDef extends Omit<PromptSegmentDef, 'template'> {
1641
+ template?: PromptTemplate;
1642
+ }
1643
+ /**
1644
+ * Used for prompt rendering at interaction execution
1645
+ */
1646
+ export interface ExecutablePromptSegmentDef extends Omit<PromptSegmentDef, 'template'> {
1647
+ template?: ExecutablePromptTemplate;
1648
+ }
1649
+ export type PromptTemplateRef = z.infer<typeof PromptTemplateRefSchema>;
1650
+ export interface PromptTemplateRefWithSchema extends PromptTemplateRef {
1651
+ inputSchema?: JSONSchema;
1652
+ }
1653
+ export declare enum TemplateType {
1654
+ jst = "jst",
1655
+ handlebars = "handlebars",
1656
+ text = "text"
1657
+ }
1658
+ export interface ExecutablePromptTemplate {
1659
+ role: PromptRole;
1660
+ content: string;
1661
+ content_type: TemplateType;
1662
+ inputSchema?: JSONSchema;
1663
+ }
1664
+ export type PromptTemplate = z.infer<typeof PromptTemplateSchema>;
1665
+ export type PromptTemplateForkPayload = z.infer<typeof PromptTemplateForkPayloadSchema>;
1666
+ export type PromptTemplateCreatePayload = z.infer<typeof PromptTemplateCreatePayloadSchema>;
1667
+ export type PromptTemplateUpdatePayload = z.infer<typeof PromptTemplateUpdatePayloadSchema>;
1668
+ export type PromptTemplateInteractionVersion = z.infer<typeof PromptTemplateInteractionVersionSchema>;
1669
+ export type PromptTemplateInteractionUsage = z.infer<typeof PromptTemplateInteractionUsageSchema>;
1670
+ export type PromptTemplateInteractionsResponse = z.infer<typeof PromptTemplateInteractionsResponseSchema>;
1671
+ export type RenderPromptPayload = z.infer<typeof RenderPromptPayloadSchema>;
1672
+ /**
1673
+ * What `POST /prompts/:id/render` answers with: the segment identity plus the rendered body.
1674
+ *
1675
+ * Stated here for the first time — the endpoint declared its response inline, so there has never
1676
+ * been a name for it on either side of the wire.
1677
+ */
1678
+ export type RenderPromptResponse = z.infer<typeof RenderPromptResponseSchema>;
1679
+
1680
+ // -----------------------------------------------------------------------------
1681
+ // @vertesia/common: project.d.ts
1682
+ // -----------------------------------------------------------------------------
1683
+ import type { z } from 'zod';
1684
+ import type { ProjectRefSchema } from './api-schemas/apikey.js';
1685
+ import type { EmbeddingsStatusResponseSchema, ProjectConfigurationEmbeddingEnablePayloadSchema } from './api-schemas/embeddings.js';
1686
+ import type { DriftAnalysisProgressSchema, DriftAnalysisResultSchema, DriftAnalysisStatusResponseSchema, IndexingStatusResponseSchema, ReindexAgentRunsPayloadSchema, ReindexAgentRunsResponseSchema, StartProjectReindexPayloadSchema } from './api-schemas/indexing.js';
1687
+ import type { CreateProjectPayloadFromSchema, ListProjectsQuerySchema, ProjectIntegrationListEntrySchema, ProjectIntegrationListResponseSchema, ProjectPluginsUpdatePayloadSchema, ProjectSchema, ProjectTagQuerySchema } from './api-schemas/project.js';
1688
+ import type { AgentCheckpointConfigurationSchema, AgentProjectConfigurationSchema, BrowserUseProjectConfigurationSchema, BrowserUseRiskPolicySchema, BrowserUseScreenshotCaptureSchema, ElasticsearchBackendSchema, ModalityDefaultsSchema, ModelDefaultSchema, ProjectConfigurationEmbeddingSchema, ProjectConfigurationSchema, ProjectIndexingConfigurationSchema, ProjectIntakeConfigurationSchema, ProjectIntakeSniffConfigurationSchema, ProjectModelDefaultsSchema, ProjectSearchPropertyMappingSchema, ProjectSearchPropertyTypeSchema, ProjectSearchTierSchema, SystemDefaultsSchema } from './api-schemas/project-configuration.js';
1689
+ import type { AccountRef } from './user.js';
1690
+ /**
1691
+ * `SystemRoles` lives in `./project-values.js` so the API schemas can read it without importing this
1692
+ * module back. Re-exported here so every existing import path keeps working.
1693
+ */
1694
+ export * from './project-values.js';
1695
+ export type ICreateProjectPayload = CreateProjectPayloadFromSchema;
1696
+ export declare function isRoleIncludedIn(role: string, includingRole: string): boolean;
1697
+ export interface PopulatedProjectRef {
1698
+ id: string;
1699
+ name: string;
1700
+ account: AccountRef;
1701
+ }
1702
+ export type ProjectRef = z.infer<typeof ProjectRefSchema>;
1703
+ export type ProjectTagQuery = z.infer<typeof ProjectTagQuerySchema>;
1704
+ export type ListProjectsQuery = z.infer<typeof ListProjectsQuerySchema>;
1705
+ export type ModelDefault = z.infer<typeof ModelDefaultSchema>;
1706
+ export type ModalityDefaults = z.infer<typeof ModalityDefaultsSchema>;
1707
+ /**
1708
+ * System interaction category enum.
1709
+ * Categories group one or more system interactions for default model assignment.
1710
+ */
1711
+ export declare enum SystemInteractionCategory {
1712
+ content_type = "content_type",
1713
+ intake = "intake",
1714
+ analysis = "analysis",
1715
+ agent = "agent",
1716
+ non_applicable = "non_applicable"
1717
+ }
1718
+ /**
1719
+ * Map system interaction endpoints to categories.
1720
+ */
1721
+ export declare const SYSTEM_INTERACTION_CATEGORIES: Record<string, SystemInteractionCategory>;
1722
+ /**
1723
+ * Get category for a system interaction endpoint.
1724
+ * Returns undefined if category is non-applicable or endpoint is not recognized.
1725
+ * Note: Caller is responsible for determining if the interaction is a system interaction.
1726
+ * @param endpoint - The interaction endpoint name
1727
+ */
1728
+ export declare function getSystemInteractionCategory(endpoint: string): SystemInteractionCategory | undefined;
1729
+ /**
1730
+ * One optional default per {@link SystemInteractionCategory}.
1731
+ *
1732
+ * The schema writes the categories out rather than mapping over the enum, so `project.contract.test`
1733
+ * asserts that its keys are exactly the category union — a new category has to be added in both
1734
+ * places, and fails to compile until it is.
1735
+ */
1736
+ export type SystemDefaults = z.infer<typeof SystemDefaultsSchema>;
1737
+ export type ProjectModelDefaults = z.infer<typeof ProjectModelDefaultsSchema>;
1738
+ export type BrowserUseRiskPolicy = z.infer<typeof BrowserUseRiskPolicySchema>;
1739
+ export type BrowserUseScreenshotCapture = z.infer<typeof BrowserUseScreenshotCaptureSchema>;
1740
+ /**
1741
+ * Project defaults and caps for `browser_use` agent workstreams.
1742
+ *
1743
+ * A hand-written `JSONSchemaType<BrowserUseProjectConfiguration>` used to sit here beside the
1744
+ * interface. Nothing read it, and its descriptions had already drifted from the TSDoc the published
1745
+ * component was derived from — the schema module is now the only statement of the shape.
1746
+ */
1747
+ export type BrowserUseProjectConfiguration = z.infer<typeof BrowserUseProjectConfigurationSchema>;
1748
+ export type ProjectSearchTier = z.infer<typeof ProjectSearchTierSchema>;
1749
+ export type ElasticsearchBackend = z.infer<typeof ElasticsearchBackendSchema>;
1750
+ export type ProjectIntakeSniffConfiguration = z.infer<typeof ProjectIntakeSniffConfigurationSchema>;
1751
+ export type ProjectIntakeConfiguration = z.infer<typeof ProjectIntakeConfigurationSchema>;
1752
+ export type ProjectConfiguration = z.infer<typeof ProjectConfigurationSchema>;
1753
+ export type AgentProjectConfiguration = z.infer<typeof AgentProjectConfigurationSchema>;
1754
+ export type AgentCheckpointConfiguration = z.infer<typeof AgentCheckpointConfigurationSchema>;
1755
+ export type ProjectSearchPropertyType = z.infer<typeof ProjectSearchPropertyTypeSchema>;
1756
+ export type ProjectSearchPropertyMapping = z.infer<typeof ProjectSearchPropertyMappingSchema>;
1757
+ export declare const PROJECT_SEARCH_PROPERTY_TYPES: readonly ProjectSearchPropertyType[];
1758
+ /**
1759
+ * Validate property mappings at API and index-creation boundaries.
1760
+ *
1761
+ * Returns user-facing issue strings instead of throwing so callers can map the
1762
+ * result to the error type appropriate for their boundary.
1763
+ */
1764
+ export declare function validateProjectSearchPropertyMappings(value: unknown): string[];
1765
+ export type ProjectIndexingConfiguration = z.infer<typeof ProjectIndexingConfigurationSchema>;
1766
+ export declare enum SupportedEmbeddingTypes {
1767
+ text = "text",
1768
+ image = "image",
1769
+ properties = "properties"
1770
+ }
1771
+ export declare enum FullTextType {
1772
+ full_text = "full_text"
1773
+ }
1774
+ export type SearchTypes = SupportedEmbeddingTypes | FullTextType;
1775
+ export declare const SearchTypes: {
1776
+ readonly full_text: FullTextType.full_text;
1777
+ readonly text: SupportedEmbeddingTypes.text;
1778
+ readonly image: SupportedEmbeddingTypes.image;
1779
+ readonly properties: SupportedEmbeddingTypes.properties;
1780
+ };
1781
+ export type ProjectConfigurationEmbedding = z.infer<typeof ProjectConfigurationEmbeddingSchema>;
1782
+ export type ProjectConfigurationEmbeddingEnablePayload = z.infer<typeof ProjectConfigurationEmbeddingEnablePayloadSchema>;
1783
+ export type Project = z.infer<typeof ProjectSchema>;
1784
+ export interface ProjectCreatePayload {
1785
+ name: string;
1786
+ description?: string;
1787
+ }
1788
+ export interface ProjectUpdatePayload extends Partial<Project> {
1789
+ }
1790
+ export type ProjectPluginsUpdatePayload = z.infer<typeof ProjectPluginsUpdatePayloadSchema>;
1791
+ export declare const ProjectRefPopulate = "id name account";
1792
+ export type EmbeddingsStatusResponse = z.infer<typeof EmbeddingsStatusResponseSchema>;
1793
+ /**
1794
+ * Response from indexing status endpoint
1795
+ */
1796
+ export type IndexingStatusResponse = z.infer<typeof IndexingStatusResponseSchema>;
1797
+ export type StartProjectReindexPayload = z.infer<typeof StartProjectReindexPayloadSchema>;
1798
+ /**
1799
+ * Auto-tunes shard sizing based on project doc count.
1800
+ *
1801
+ * Returns:
1802
+ * - shard_size: target docs per shard (workflow path uses this; zeno-bulk
1803
+ * computes shard count from total/shard_size).
1804
+ * - parallel_shard_count: max in-flight shard activities (workflow path only).
1805
+ * - max_shards: hard cap on shard count for the direct path. Direct path
1806
+ * passes this as `shards` to zeno-bulk so all shards run as cursors in
1807
+ * ONE process; without this cap, an under-estimated shard_size (e.g.
1808
+ * from stale estimatedDocumentCount) can spawn 10+ in-flight cursors
1809
+ * and exceed Cloud Run memory.
1810
+ *
1811
+ * Explicit overrides should bypass this function and use user-provided values.
1812
+ */
1813
+ export declare function autoTuneReindexParams(docCount: number): {
1814
+ shard_size: number;
1815
+ parallel_shard_count: number;
1816
+ max_shards: number;
1817
+ };
1818
+ export type ReindexAgentRunsPayload = z.infer<typeof ReindexAgentRunsPayloadSchema>;
1819
+ export type ReindexAgentRunsResponse = z.infer<typeof ReindexAgentRunsResponseSchema>;
1820
+ /**
1821
+ * Indexed (`_source`) shape of the content type ref. Unlike the public
1822
+ * ContentObjectTypeRef discriminated union, the index stores BOTH kinds under
1823
+ * `id` — the ObjectId hex for stored types, the namespaced code for in-code
1824
+ * types — so search filters and facets work on a single keyword field
1825
+ * regardless of the kind. `ref_type` is kept to rebuild the public union on
1826
+ * read. `code` only exists on documents written before the field was unified.
1827
+ */
1828
+ export interface IndexedContentTypeRef {
1829
+ ref_type: 'stored' | 'incode';
1830
+ id: string;
1831
+ code?: string;
1832
+ name: string;
1833
+ }
1834
+ /**
1835
+ * Document data structure for Elasticsearch indexing
1836
+ */
1837
+ export interface ElasticsearchDocumentData {
1838
+ name?: string;
1839
+ text?: string;
1840
+ properties?: Record<string, unknown>;
1841
+ status?: string;
1842
+ type?: IndexedContentTypeRef;
1843
+ security?: {
1844
+ 'content:read'?: string[];
1845
+ 'content:write'?: string[];
1846
+ 'content:delete'?: string[];
1847
+ };
1848
+ revision?: {
1849
+ head?: boolean;
1850
+ root?: string;
1851
+ };
1852
+ embeddings_text?: number[];
1853
+ embeddings_image?: number[];
1854
+ embeddings_properties?: number[];
1855
+ created_at?: Date | string;
1856
+ updated_at?: Date | string;
1857
+ }
1858
+ /**
1859
+ * Result from bulk indexing
1860
+ */
1861
+ export interface BulkIndexResult {
1862
+ successful: number;
1863
+ failed: number;
1864
+ }
1865
+ /**
1866
+ * Result from creating a reindex target
1867
+ */
1868
+ export interface CreateReindexTargetResult {
1869
+ created: boolean;
1870
+ index_name: string;
1871
+ alias_name: string;
1872
+ version: number;
1873
+ backend?: ElasticsearchBackend;
1874
+ dimensions?: {
1875
+ text?: number;
1876
+ image?: number;
1877
+ properties?: number;
1878
+ };
1879
+ language?: string;
1880
+ }
1881
+ /**
1882
+ * Result from fetching a batch
1883
+ */
1884
+ export interface FetchBatchResult {
1885
+ documents: Array<{
1886
+ id: string;
1887
+ document: ElasticsearchDocumentData;
1888
+ }>;
1889
+ next_cursor: string | null;
1890
+ done: boolean;
1891
+ }
1892
+ /**
1893
+ * Result from discovering the next cursor boundary for batch partitioning
1894
+ */
1895
+ export interface NextIndexCursorResult {
1896
+ next_cursors: string[];
1897
+ count: number;
1898
+ done: boolean;
1899
+ }
1900
+ /**
1901
+ * Result from triggering a reindex
1902
+ */
1903
+ export interface TriggerReindexResult {
1904
+ status: string;
1905
+ workflow?: string;
1906
+ workflow_id?: string;
1907
+ run_id?: string;
1908
+ object_count?: number;
1909
+ reason?: string;
1910
+ enabled?: boolean;
1911
+ }
1912
+ export interface ComputeShardsRequest {
1913
+ tenant_id: string;
1914
+ shard_size?: number;
1915
+ updated_since?: string;
1916
+ backend?: ElasticsearchBackend;
1917
+ }
1918
+ export interface ComputeShardsResult {
1919
+ shards: Array<{
1920
+ min?: string;
1921
+ max?: string;
1922
+ }>;
1923
+ count: number;
1924
+ }
1925
+ export interface IndexShardParams {
1926
+ tenant_id: string;
1927
+ target_index: string;
1928
+ shard_min: string;
1929
+ shard_max?: string;
1930
+ backend?: ElasticsearchBackend;
1931
+ embedding_dimensions?: {
1932
+ text?: number;
1933
+ image?: number;
1934
+ properties?: number;
1935
+ };
1936
+ dry_run?: boolean;
1937
+ concurrency?: number;
1938
+ batch_size?: number;
1939
+ bulk_size_bytes?: number;
1940
+ bulk_concurrency?: number;
1941
+ updated_since?: string;
1942
+ }
1943
+ export interface IndexShardRequest {
1944
+ force?: boolean;
1945
+ params: IndexShardParams;
1946
+ }
1947
+ export interface IndexShardResult {
1948
+ status: string;
1949
+ projects_done: number;
1950
+ projects_total: number;
1951
+ scanned: number;
1952
+ written: number;
1953
+ skipped: number;
1954
+ errors: number;
1955
+ /** Per-document ES bulk-item errors (e.g. mapping timeouts). Doc-level data-quality, not pipeline failure. */
1956
+ bulk_errors?: number;
1957
+ /** Sampled details of bulk-item failures (capped at 100 per shard). */
1958
+ bulk_error_sample?: Array<{
1959
+ tenant?: string;
1960
+ doc_id: string;
1961
+ type: string;
1962
+ reason: string;
1963
+ }>;
1964
+ embeddings_written?: number;
1965
+ skipped_embeddings?: number;
1966
+ embeddings_text_written?: number;
1967
+ embeddings_image_written?: number;
1968
+ embeddings_properties_written?: number;
1969
+ embeddings_text_skipped?: number;
1970
+ embeddings_image_skipped?: number;
1971
+ embeddings_properties_skipped?: number;
1972
+ properties_values_trimmed?: number;
1973
+ properties_bytes_dropped?: number;
1974
+ batches_flushed?: number;
1975
+ bulk_chunks_written?: number;
1976
+ avg_docs_per_batch?: number;
1977
+ avg_chunks_per_batch?: number;
1978
+ avg_bytes_per_doc?: number;
1979
+ avg_bytes_per_chunk?: number;
1980
+ read_docs_s: string;
1981
+ write_docs_s: string;
1982
+ read_mb: string;
1983
+ write_mb: string;
1984
+ mongo_read_mb?: string;
1985
+ gcs_read_mb?: string;
1986
+ es_bulk_mb?: string;
1987
+ read_mb_s: string;
1988
+ write_mb_s: string;
1989
+ mongo_read_mb_s?: string;
1990
+ gcs_read_mb_s?: string;
1991
+ es_bulk_mb_s?: string;
1992
+ duration_sec: number;
1993
+ failed_projects?: Array<{
1994
+ tenant: string;
1995
+ error: string;
1996
+ }>;
1997
+ }
1998
+ export interface SwapAliasRequest {
1999
+ tenant_id: string;
2000
+ target_index: string;
2001
+ backend?: ElasticsearchBackend;
2002
+ /** ES alias name. If not provided, the Go service derives it from the tenant ID. */
2003
+ alias?: string;
2004
+ }
2005
+ export interface SwapAliasResult {
2006
+ status: string;
2007
+ alias: string;
2008
+ old_index: string;
2009
+ new_index: string;
2010
+ }
2011
+ export interface ReindexViaBulkRequest {
2012
+ tenant_id: string;
2013
+ project_id?: string;
2014
+ backend?: ElasticsearchBackend;
2015
+ dry_run?: boolean;
2016
+ /** Approximate documents per shard; drives auto-shard count (total / shard_size). Default 250_000. */
2017
+ shard_size?: number;
2018
+ /** Explicit shard count. When set, overrides shard_size-based auto-sharding. Useful to cap in-process concurrency for the direct path. */
2019
+ shards?: number;
2020
+ /** Number of ES bulk-write workers per shard. Default 10. */
2021
+ bulk_concurrency?: number;
2022
+ /** Hard cap per ES bulk request body in bytes. Default 12 MB. */
2023
+ bulk_size_bytes?: number;
2024
+ /** Max documents per batcher flush (size cap still regulates ES bulk requests). Default 200. */
2025
+ bulk_max_docs?: number;
2026
+ }
2027
+ export interface ReindexViaBulkResult {
2028
+ status: string;
2029
+ error?: string;
2030
+ projects_done: number;
2031
+ projects_total: number;
2032
+ scanned: number;
2033
+ written: number;
2034
+ errors: number;
2035
+ embeddings_written?: number;
2036
+ skipped_embeddings?: number;
2037
+ embeddings_text_written?: number;
2038
+ embeddings_image_written?: number;
2039
+ embeddings_properties_written?: number;
2040
+ embeddings_text_skipped?: number;
2041
+ embeddings_image_skipped?: number;
2042
+ embeddings_properties_skipped?: number;
2043
+ properties_values_trimmed?: number;
2044
+ properties_bytes_dropped?: number;
2045
+ batches_flushed?: number;
2046
+ bulk_chunks_written?: number;
2047
+ avg_docs_per_batch?: number;
2048
+ avg_chunks_per_batch?: number;
2049
+ avg_bytes_per_doc?: number;
2050
+ avg_bytes_per_chunk?: number;
2051
+ read_docs_s: string;
2052
+ write_docs_s: string;
2053
+ read_mb: string;
2054
+ write_mb: string;
2055
+ mongo_read_mb?: string;
2056
+ gcs_read_mb?: string;
2057
+ es_bulk_mb?: string;
2058
+ read_mb_s?: string;
2059
+ write_mb_s?: string;
2060
+ mongo_read_mb_s?: string;
2061
+ gcs_read_mb_s?: string;
2062
+ es_bulk_mb_s?: string;
2063
+ duration_sec: number;
2064
+ }
2065
+ /**
2066
+ * Elasticsearch index statistics
2067
+ */
2068
+ export interface ElasticsearchIndexStats {
2069
+ enabled: boolean;
2070
+ backend?: ElasticsearchBackend;
2071
+ exists?: boolean;
2072
+ document_count?: number;
2073
+ size_in_bytes?: number;
2074
+ index_name?: string;
2075
+ alias_name?: string;
2076
+ }
2077
+ /**
2078
+ * Embedding configuration for a single type
2079
+ */
2080
+ export interface EmbeddingTypeConfig {
2081
+ environment?: string;
2082
+ dimensions?: number;
2083
+ model?: string;
2084
+ provider?: string;
2085
+ enabled?: boolean;
2086
+ }
2087
+ /**
2088
+ * Detailed index configuration
2089
+ */
2090
+ export interface IndexConfiguration {
2091
+ enabled: boolean;
2092
+ exists?: boolean;
2093
+ index_name?: string;
2094
+ alias_name?: string;
2095
+ version?: number;
2096
+ document_count?: number;
2097
+ size_in_bytes?: number;
2098
+ embedding_dimensions?: {
2099
+ text?: number;
2100
+ image?: number;
2101
+ properties?: number;
2102
+ };
2103
+ /** ISO 639-1 language code for text analysis */
2104
+ language?: string;
2105
+ /** Explicit mappings for selected content-object property paths. */
2106
+ property_mappings?: Record<string, ProjectSearchPropertyMapping>;
2107
+ field_mappings?: Record<string, unknown>;
2108
+ project_embeddings_config?: {
2109
+ text?: EmbeddingTypeConfig;
2110
+ image?: EmbeddingTypeConfig;
2111
+ properties?: EmbeddingTypeConfig;
2112
+ };
2113
+ created_at?: Date | null;
2114
+ }
2115
+ /**
2116
+ * Supported languages for full-text search with their display names.
2117
+ * Maps ISO 639-1 codes to human-readable language names.
2118
+ */
2119
+ export declare const SUPPORTED_SEARCH_LANGUAGES: Record<string, string>;
2120
+ /**
2121
+ * Result from fetching documents by IDs
2122
+ */
2123
+ export interface FetchDocumentsByIdsResult {
2124
+ documents: Array<{
2125
+ id: string;
2126
+ document: ElasticsearchDocumentData;
2127
+ }>;
2128
+ not_found: string[];
2129
+ }
2130
+ /**
2131
+ * Result from bulk delete
2132
+ */
2133
+ export interface BulkDeleteResult {
2134
+ successful: number;
2135
+ failed: number;
2136
+ }
2137
+ /**
2138
+ * Result from ensure index operation
2139
+ */
2140
+ export interface EnsureIndexResult {
2141
+ created: boolean;
2142
+ recreated?: boolean;
2143
+ existed?: boolean;
2144
+ enabled?: boolean;
2145
+ status?: string;
2146
+ dimensions?: {
2147
+ text?: number;
2148
+ image?: number;
2149
+ properties?: number;
2150
+ };
2151
+ language?: string;
2152
+ }
2153
+ export interface AnalyzeDriftBatchResult {
2154
+ processed: number;
2155
+ missing: number;
2156
+ stale: number;
2157
+ next_cursor: string | null;
2158
+ done: boolean;
2159
+ sample_missing_ids: string[];
2160
+ sample_stale_ids: string[];
2161
+ }
2162
+ export type DriftAnalysisProgress = z.infer<typeof DriftAnalysisProgressSchema>;
2163
+ export type DriftAnalysisResult = z.infer<typeof DriftAnalysisResultSchema>;
2164
+ export type DriftAnalysisStatusResponse = z.infer<typeof DriftAnalysisStatusResponseSchema>;
2165
+ export type ProjectIntegrationListEntry = z.infer<typeof ProjectIntegrationListEntrySchema>;
2166
+ export type ProjectIntegrationListResponse = z.infer<typeof ProjectIntegrationListResponseSchema>;
2167
+
2168
+ // -----------------------------------------------------------------------------
2169
+ // @vertesia/common: runs.d.ts
2170
+ // -----------------------------------------------------------------------------
2171
+ import type { z } from 'zod';
2172
+ import type { ExecutionRunDocRefSchema, RunClonePayloadSchema, RunCreatePayloadSchema, RunSearchMetaResponseSchema } from './api-schemas/interaction.js';
2173
+ /**
2174
+ * The run ref is used to identify a run document in the storage
2175
+ */
2176
+ export type ExecutionRunDocRef = z.infer<typeof ExecutionRunDocRefSchema>;
2177
+ /**
2178
+ * Interaction execution payload for creating a new run
2179
+ * It uses interaction field (from NamedInteractionExecutionPayload) to pass the interaction ID to run
2180
+ */
2181
+ export type RunCreatePayload = z.infer<typeof RunCreatePayloadSchema>;
2182
+ /**
2183
+ * Payload for cloning an existing ExecutionRun.
2184
+ * Creates a new run document with the same interaction/config but fresh status.
2185
+ * Used by fork flows to create a new ExecutionRun for the forked workflow.
2186
+ */
2187
+ export type RunClonePayload = z.infer<typeof RunClonePayloadSchema>;
2188
+ /**
2189
+ * To be used as a value for a numeric or date filters
2190
+ */
2191
+ export interface RangeValue {
2192
+ gt?: number | string;
2193
+ gte?: number | string;
2194
+ lt?: number | string;
2195
+ lte?: number | string;
2196
+ }
2197
+ export type RunSearchMetaResponse = z.infer<typeof RunSearchMetaResponseSchema>;
2198
+
2199
+ // -----------------------------------------------------------------------------
2200
+ // @vertesia/common: skill.d.ts
2201
+ // -----------------------------------------------------------------------------
2202
+ /**
2203
+ * Skill types for interaction-based skills.
2204
+ *
2205
+ * Skills are interactions with `agent_runner_options.is_skill = true`.
2206
+ * They provide contextual instructions to agents without executing code.
2207
+ * When a skill is called, its rendered prompt is returned as instructions.
2208
+ *
2209
+ * Skills can have associated scripts stored at:
2210
+ * skills/{skill_name}/*.py, *.js, etc.
2211
+ * These are automatically synced to the sandbox when the skill is used.
2212
+ */
2213
+ /**
2214
+ * Context provided when searching for relevant skills
2215
+ */
2216
+ export interface SkillContext {
2217
+ /**
2218
+ * The task description or user prompt
2219
+ */
2220
+ task_description?: string;
2221
+ /**
2222
+ * Tools currently being used or available
2223
+ */
2224
+ tool_names?: string[];
2225
+ /**
2226
+ * Sample of input data for pattern matching
2227
+ */
2228
+ data_sample?: string;
2229
+ /**
2230
+ * Additional keywords to consider
2231
+ */
2232
+ keywords?: string[];
2233
+ }
2234
+ /**
2235
+ * Payload for finding relevant skills
2236
+ */
2237
+ export interface FindRelevantSkillsPayload {
2238
+ context: SkillContext;
2239
+ limit?: number;
2240
+ }
2241
+ /**
2242
+ * Result from skill injection into agent context.
2243
+ * Contains the rendered prompt/instructions from a skill interaction.
2244
+ */
2245
+ export interface InjectedSkill {
2246
+ /**
2247
+ * The skill/interaction name
2248
+ */
2249
+ name: string;
2250
+ /**
2251
+ * The skill's rendered instructions (from the interaction prompt)
2252
+ */
2253
+ instructions: string;
2254
+ /**
2255
+ * Tools related to this skill
2256
+ */
2257
+ tools?: string[];
2258
+ /**
2259
+ * UI module for rendering results
2260
+ */
2261
+ ui_module?: string;
2262
+ /**
2263
+ * Match score (0-1) indicating relevance
2264
+ */
2265
+ match_score?: number;
2266
+ }
2267
+ /**
2268
+ * Result from generateTools activity with skills
2269
+ */
2270
+ export interface ToolsWithSkills {
2271
+ /**
2272
+ * Array of tool definitions
2273
+ */
2274
+ tools: unknown[];
2275
+ /**
2276
+ * Skills injected based on context
2277
+ */
2278
+ injected_skills: InjectedSkill[];
2279
+ }
2280
+
2281
+ // -----------------------------------------------------------------------------
2282
+ // @vertesia/common: store/store.d.ts
2283
+ // -----------------------------------------------------------------------------
2284
+ import type { z } from 'zod';
2285
+ import type { ContentObjectTypeRefSchema } from '../api-schemas/app-lifecycle.js';
2286
+ import type { ComplexSearchPayloadSchema, ContentObjectApiResponseSchema, ContentObjectApiRevisionSchema, ContentObjectApiTypeRefSchema, ContentObjectExportArtifactFileSchema, ContentObjectExportArtifactSchema, ContentObjectExportProgressSchema, ContentObjectExportResultSchema, ContentObjectExportStatusResponseSchema, ContentObjectItemApiResponseSchema, ContentObjectTextResponseSchema, ContentObjectUserPermissionsSchema, ContentSourceSchema, CreateContentObjectHeadersSchema, CreateContentObjectPayloadSchema, CreateContentObjectQuerySchema, DeleteContentObjectExportResponseSchema, DeleteContentObjectResultSchema, EmbeddingSchema, ExportContentObjectsFilterSchema, ExportContentObjectsIncludeOptionsSchema, GenerationRunMetadataSchema, GetObjectRenditionQuerySchema, GetRenditionResponseSchema, InheritedPropertyMetadataSchema, ListContentObjectExportsResponseSchema, ObjectSearchResponseSchema, RevisionInfoSchema, SetObjectEmbeddingsResponseSchema, StartContentObjectExportRequestSchema, StartContentObjectExportResponseSchema, TranscriptSchema, TranscriptSegmentSchema, UpdateContentObjectHeadersSchema, UpdateContentObjectQuerySchema } from '../api-schemas/content.js';
2287
+ import type { MarkdownRenditionFormatSchema } from '../api-schemas/document-processing.js';
2288
+ import type { CreateWorkflowRulePayloadSchema, WorkflowRuleItemSchema, WorkflowRuleSchema } from '../api-schemas/events.js';
2289
+ import type { BucketReadAccessStatusResponseSchema, BulkUploadUrlsPayloadSchema, BulkUploadUrlsResponseSchema, CopyFilePayloadSchema, CopyFileResponseSchema, DeleteFileResultSchema, EnsureBucketReadAccessPayloadSchema, EnsureBucketReadAccessResponseSchema, FileBucketResponseSchema, FileDeleteQuerySchema, FileListQuerySchema, FileListResponseSchema, FileMetadataQuerySchema, FileMetadataResponseSchema, FileMetadataUpdateResultSchema, GetFileUrlPayloadSchema, GetFileUrlResponseSchema, GetUploadUrlPayloadSchema, SetFileMetadataPayloadSchema } from '../api-schemas/files.js';
2290
+ import type { ColumnLayoutSchema, ContentObjectTypeCatalogEntrySchema, ContentObjectTypeCatalogQuerySchema, ContentObjectTypeItemSchema, ContentObjectTypeListQuerySchema, ContentObjectTypeSchema, ContentObjectTypeStatusSchema, ContentTypeEditingPolicySchema, ContentTypeExtractionGroundingPolicySchema, ContentTypeExtractionGroundingReviewPolicySchema, ContentTypeIntakePolicySchema, CreateContentObjectTypePayloadSchema, InCodeTypeDefinitionSchema, IntakePageRangesSchema, IntakePageScopeSchema, IntakeVisionDetailSchema, UpdateContentObjectTypePayloadSchema } from '../api-schemas/store.js';
2291
+ import type { JSONObject } from '../json.js';
2292
+ import type { SupportedEmbeddingTypes } from '../project.js';
2293
+ import type { BaseObject } from './common.js';
2294
+ export declare enum ContentObjectApiHeaders {
2295
+ COLLECTION_ID = "x-collection-id",
2296
+ PROCESSING_PRIORITY = "x-processing-priority",
2297
+ CREATE_REVISION = "x-create-revision",
2298
+ REVISION_LABEL = "x-revision-label",
2299
+ /**
2300
+ * @deprecated Events are now always emitted. This suppresses the Temporal-backed delivery targets (workflow, agent, and process) — webhook deliveries still fire.
2301
+ */
2302
+ SUPPRESS_WORKFLOWS = "x-suppress-workflows"
2303
+ }
2304
+ export type CreateContentObjectQuery = z.infer<typeof CreateContentObjectQuerySchema>;
2305
+ export type CreateContentObjectHeaders = z.infer<typeof CreateContentObjectHeadersSchema>;
2306
+ export type UpdateContentObjectQuery = z.infer<typeof UpdateContentObjectQuerySchema>;
2307
+ export type UpdateContentObjectHeaders = z.infer<typeof UpdateContentObjectHeadersSchema>;
2308
+ export type GetObjectRenditionQuery = z.infer<typeof GetObjectRenditionQuerySchema>;
2309
+ /**
2310
+ * Headers for Data Store API calls.
2311
+ * Used for Cloud Run session affinity to route requests to the same instance.
2312
+ */
2313
+ export declare enum DataStoreApiHeaders {
2314
+ /** Data store ID for session affinity - routes requests for same store to same instance */
2315
+ DATA_STORE_ID = "x-data-store-id"
2316
+ }
2317
+ export declare enum ContentObjectStatus {
2318
+ created = "created",
2319
+ processing = "processing",// the was created and still processing
2320
+ ready = "ready",// the object is rendered and ready to be used
2321
+ completed = "completed",
2322
+ failed = "failed",
2323
+ archived = "archived"
2324
+ }
2325
+ export type Embedding = z.infer<typeof EmbeddingSchema>;
2326
+ export type ExportContentObjectsIncludeOptions = z.infer<typeof ExportContentObjectsIncludeOptionsSchema>;
2327
+ export type ExportContentObjectsFilter = z.infer<typeof ExportContentObjectsFilterSchema>;
2328
+ /**
2329
+ * Exported object identity and context for a single content object row.
2330
+ */
2331
+ export interface ExportedContentObjectRecord {
2332
+ id: string;
2333
+ name: string;
2334
+ location: string;
2335
+ external_id?: string;
2336
+ type?: {
2337
+ ref_type?: 'stored' | 'incode' | 'untyped';
2338
+ id?: string;
2339
+ code?: string;
2340
+ name?: string;
2341
+ };
2342
+ status?: ContentObjectStatus;
2343
+ content?: {
2344
+ source?: string;
2345
+ type?: string;
2346
+ name?: string;
2347
+ etag?: string;
2348
+ };
2349
+ created_at: string;
2350
+ updated_at: string;
2351
+ revision?: RevisionInfo;
2352
+ properties?: Record<string, unknown>;
2353
+ metadata?: Record<string, unknown>;
2354
+ embeddings?: Partial<Record<SupportedEmbeddingTypes, Embedding>>;
2355
+ }
2356
+ export type StartContentObjectExportRequest = z.infer<typeof StartContentObjectExportRequestSchema>;
2357
+ export type StartContentObjectExportResponse = z.infer<typeof StartContentObjectExportResponseSchema>;
2358
+ export interface ZenoBulkContentObjectExportRequest extends Omit<StartContentObjectExportRequest, 'compression'> {
2359
+ tenant_id: string;
2360
+ project_id: string;
2361
+ export_id: string;
2362
+ output_path: string;
2363
+ filename: string;
2364
+ manifest_path: string;
2365
+ manifest_filename: string;
2366
+ compression: boolean;
2367
+ }
2368
+ export interface ZenoBulkContentObjectExportShardRange {
2369
+ min_id?: string;
2370
+ max_id?: string;
2371
+ }
2372
+ export interface ZenoBulkContentObjectExportPlanRequest extends ZenoBulkContentObjectExportRequest {
2373
+ target_shard_records?: number;
2374
+ max_shards?: number;
2375
+ }
2376
+ export interface ZenoBulkContentObjectExportPlanResponse {
2377
+ shards: ZenoBulkContentObjectExportShardRange[];
2378
+ }
2379
+ export interface ZenoBulkContentObjectExportShardRequest extends ZenoBulkContentObjectExportRequest {
2380
+ shard_index: number;
2381
+ shard_count: number;
2382
+ shard: ZenoBulkContentObjectExportShardRange;
2383
+ }
2384
+ export interface ZenoBulkContentObjectExportSplitShardRequest extends ZenoBulkContentObjectExportRequest {
2385
+ shard: ZenoBulkContentObjectExportShardRange;
2386
+ min_split_records?: number;
2387
+ }
2388
+ export interface ZenoBulkContentObjectExportSplitShardResponse {
2389
+ shards: ZenoBulkContentObjectExportShardRange[];
2390
+ splittable: boolean;
2391
+ records: number;
2392
+ }
2393
+ export interface ZenoBulkContentObjectExportShardResult {
2394
+ status: 'completed';
2395
+ shard_index: number;
2396
+ shard_count: number;
2397
+ path: string;
2398
+ filename: string;
2399
+ content_type: string;
2400
+ records: number;
2401
+ bytes: number;
2402
+ started_at: string;
2403
+ completed_at: string;
2404
+ duration_ms: number;
2405
+ }
2406
+ export interface ZenoBulkContentObjectExportComposeRequest extends ZenoBulkContentObjectExportRequest {
2407
+ parts: string[];
2408
+ records?: number;
2409
+ /**
2410
+ * Export workflow start timestamp. Used to report end-to-end duration after final compose.
2411
+ */
2412
+ started_at?: string;
2413
+ }
2414
+ export type ContentObjectExportResult = z.infer<typeof ContentObjectExportResultSchema>;
2415
+ export type ContentObjectExportProgress = z.infer<typeof ContentObjectExportProgressSchema>;
2416
+ export type ContentObjectExportStatusResponse = z.infer<typeof ContentObjectExportStatusResponseSchema>;
2417
+ export type ContentObjectExportArtifact = z.infer<typeof ContentObjectExportArtifactSchema>;
2418
+ export type ContentObjectExportArtifactFile = z.infer<typeof ContentObjectExportArtifactFileSchema>;
2419
+ export type ListContentObjectExportsResponse = z.infer<typeof ListContentObjectExportsResponseSchema>;
2420
+ export type DeleteContentObjectExportResponse = z.infer<typeof DeleteContentObjectExportResponseSchema>;
2421
+ export type InheritedPropertyMetadata = z.infer<typeof InheritedPropertyMetadataSchema>;
2422
+ export type ContentObjectUserPermissions = z.infer<typeof ContentObjectUserPermissionsSchema>;
2423
+ export type ContentObjectTextResponse = z.infer<typeof ContentObjectTextResponseSchema>;
2424
+ export type DeleteContentObjectResult = z.infer<typeof DeleteContentObjectResultSchema>;
2425
+ export type SetObjectEmbeddingsResponse = z.infer<typeof SetObjectEmbeddingsResponseSchema>;
2426
+ export type ContentObjectApiTypeRef = z.infer<typeof ContentObjectApiTypeRefSchema>;
2427
+ export type ContentObjectApiRevision = z.infer<typeof ContentObjectApiRevisionSchema>;
2428
+ export type ContentObjectItemApiResponse = z.infer<typeof ContentObjectItemApiResponseSchema>;
2429
+ export type ContentObjectApiResponse = z.infer<typeof ContentObjectApiResponseSchema>;
2430
+ export interface ContentObject<T = JSONObject> extends ContentObjectItem<T> {
2431
+ text?: string;
2432
+ text_etag?: string;
2433
+ embeddings: Partial<Record<SupportedEmbeddingTypes, Embedding>>;
2434
+ parts?: string[];
2435
+ parts_etag?: string;
2436
+ transcript?: Transcript;
2437
+ security?: Record<string, string[]>;
2438
+ /** BLP sensitivity level — set directly or inherited from collections (max across collections). */
2439
+ sensitivity?: number;
2440
+ /** Compartments — set directly or inherited from collections (union across collections). */
2441
+ compartments?: string[];
2442
+ /**
2443
+ * Inherited properties metadata - tracks which properties were inherited from parent collections.
2444
+ * Used to display readonly inherited properties in the UI and enable incremental sync optimization.
2445
+ */
2446
+ inherited_properties?: InheritedPropertyMetadata[];
2447
+ }
2448
+ export declare enum ContentNature {
2449
+ Video = "video",
2450
+ Image = "image",
2451
+ Audio = "audio",
2452
+ Document = "document",
2453
+ Code = "code",
2454
+ Other = "other"
2455
+ }
2456
+ export interface Dimensions {
2457
+ width: number;
2458
+ height: number;
2459
+ }
2460
+ export interface Location {
2461
+ latitude: number;
2462
+ longitude: number;
2463
+ }
2464
+ export type GenerationRunMetadata = z.infer<typeof GenerationRunMetadataSchema>;
2465
+ export interface Rendition {
2466
+ name: string;
2467
+ content: ContentSource;
2468
+ }
2469
+ export interface RenditionWithDimensions extends Rendition {
2470
+ dimensions: Dimensions;
2471
+ }
2472
+ export declare const POSTER_RENDITION_NAME = "Poster";
2473
+ export declare const AUDIO_RENDITION_NAME = "Audio";
2474
+ export declare const WEB_VIDEO_RENDITION_NAME = "Web";
2475
+ export declare const PDF_RENDITION_NAME = "PDF";
2476
+ export interface ContentMetadata {
2477
+ type?: ContentNature;
2478
+ size?: number;
2479
+ languages?: string[];
2480
+ location?: Location;
2481
+ generation_runs?: GenerationRunMetadata[];
2482
+ etag?: string;
2483
+ /** ETag of text materialized from object properties by intake rendering. */
2484
+ rendered_text_etag?: string;
2485
+ renditions?: Rendition[];
2486
+ /**
2487
+ * Embedded/technical metadata harvested from the source file by intake
2488
+ * (office docProps, PDF docinfo). Free-form, nature-appropriate keys.
2489
+ */
2490
+ embedded?: Record<string, unknown>;
2491
+ /** Type-detection provenance recorded by the intake sniff pipeline. */
2492
+ type_detection?: TypeDetectionMetadata;
2493
+ /** Locate-pass provenance: which pages the document map found relevant. */
2494
+ locate?: LocateMetadata;
2495
+ /** Vision-evidence provenance for the last visual extraction run. */
2496
+ vision_evidence?: VisionEvidenceMetadata;
2497
+ }
2498
+ /**
2499
+ * Provenance persisted at `metadata.locate` when the intake locate (document-map) pass runs.
2500
+ * The page list doubles as navigation metadata for the UI.
2501
+ */
2502
+ export interface LocateMetadata {
2503
+ /** Relevant pages proposed by the locate pass, in plan-ranked order (1-based). */
2504
+ pages: number[];
2505
+ /** Detail profile the plan requested for visual extraction. */
2506
+ visual_detail?: 'low' | 'standard' | 'high';
2507
+ /** Whether the plan asked for color rendering. */
2508
+ needs_color?: boolean;
2509
+ /** The model's one-line explanation of the selection. */
2510
+ reason?: string;
2511
+ page_count?: number;
2512
+ /** Pages per contact sheet used for the pass (8 or 16). */
2513
+ detail?: number;
2514
+ sheet_count?: number;
2515
+ located_at: string;
2516
+ }
2517
+ /**
2518
+ * Provenance persisted at `metadata.vision_evidence` whenever intake prepares scoped page
2519
+ * images for visual extraction (design: vision evidence spec — dropped pages are recorded,
2520
+ * never silently batched).
2521
+ */
2522
+ export interface VisionEvidenceMetadata {
2523
+ /** Extraction source that requested the evidence. */
2524
+ source_requested?: 'auto' | 'text' | 'vision' | 'mixed';
2525
+ /** Pages rendered and sent as evidence, in ranked order (1-based). */
2526
+ pages_sent: number[];
2527
+ /** Resolved detail profile name. */
2528
+ detail: 'low' | 'standard' | 'high';
2529
+ /** Candidate pages dropped by budget clamping (recorded, not batched). */
2530
+ dropped_pages?: number[];
2531
+ /** The locate plan's reason, when the plan drove the page selection. */
2532
+ plan_reason?: string;
2533
+ /** Which clamps fired (page_count, allowed_details, token budget, page caps, payload). */
2534
+ clamps_applied?: string[];
2535
+ /** Estimated image tokens for the pages sent. */
2536
+ est_tokens?: number;
2537
+ page_count?: number;
2538
+ prepared_at: string;
2539
+ }
2540
+ /**
2541
+ * Durable provenance persisted at `metadata.type_detection` whenever the intake sniff pipeline
2542
+ * runs. `method` records which mechanism decides the type: the sniff itself (high confidence),
2543
+ * the post-conversion selector (medium/low/other), or the post-conversion selector because the
2544
+ * document was below the small-doc page threshold.
2545
+ */
2546
+ export interface TypeDetectionMetadata {
2547
+ method: 'sniff' | 'post_conversion' | 'post_conversion_small_doc';
2548
+ /** Sniffed type id, or 'other'. */
2549
+ type?: string;
2550
+ type_name?: string;
2551
+ /** Sniff confidence, 0..1. */
2552
+ confidence?: number;
2553
+ band?: 'high' | 'medium' | 'low';
2554
+ rationale?: string;
2555
+ alternates?: string[];
2556
+ /** Which evidence kinds the sniff saw. */
2557
+ evidence?: 'text' | 'image' | 'both';
2558
+ page_count?: number;
2559
+ /** Why the sniff LLM call was skipped (e.g. 'below_min_pages'). */
2560
+ skipped_reason?: string;
2561
+ min_pages?: number;
2562
+ detected_at: string;
2563
+ }
2564
+ export interface TemporalMediaMetadata extends ContentMetadata {
2565
+ duration?: number;
2566
+ transcript?: Transcript;
2567
+ }
2568
+ export interface ImageMetadata extends ContentMetadata {
2569
+ type: ContentNature.Image;
2570
+ dimensions?: Dimensions;
2571
+ renditions?: RenditionWithDimensions[];
2572
+ }
2573
+ export interface AudioMetadata extends TemporalMediaMetadata {
2574
+ type: ContentNature.Audio;
2575
+ }
2576
+ export interface VideoMetadata extends TemporalMediaMetadata {
2577
+ type: ContentNature.Video;
2578
+ dimensions?: Dimensions;
2579
+ renditions?: RenditionWithDimensions[];
2580
+ hasAudio?: boolean;
2581
+ }
2582
+ export interface TextSection {
2583
+ description: string;
2584
+ first_line_index: number;
2585
+ last_line_index: number;
2586
+ }
2587
+ export interface DocumentMetadata extends ContentMetadata {
2588
+ type: ContentNature.Document;
2589
+ page_count?: number;
2590
+ content_processor?: {
2591
+ type?: string;
2592
+ features_requested?: string[];
2593
+ zones_requested?: string[];
2594
+ table_count?: number;
2595
+ image_count?: number;
2596
+ zone_count?: number;
2597
+ needs_ocr_count?: number;
2598
+ /** Fingerprint of source+policy used for custom conversion, to skip re-converting unchanged docs. */
2599
+ conversion_fingerprint?: string;
2600
+ };
2601
+ /**
2602
+ * Grounded-extraction trust signal + key data. Written by the grounded pipeline
2603
+ * (verdict, confidence, citation counts, review status, source etag, ...) and
2604
+ * queryable for list/filter. Open-ended so more grounded key-data can be stored
2605
+ * without a type change.
2606
+ */
2607
+ grounded?: GroundedMetadata;
2608
+ sections?: TextSection[];
2609
+ }
2610
+ /** Grounded-extraction summary stored on document metadata. Additional keys allowed. */
2611
+ export interface GroundedMetadata {
2612
+ verdict?: string;
2613
+ confidence?: number;
2614
+ citation_count?: number;
2615
+ verified_citations?: number;
2616
+ reviewed_at?: string;
2617
+ generated_at?: string;
2618
+ /** Source PDF content etag used by the grounded extraction. */
2619
+ source_content_etag?: string | null;
2620
+ /** @deprecated Grounded source identity is tracked by source_content_etag. */
2621
+ source_text_etag?: string | null;
2622
+ [key: string]: unknown;
2623
+ }
2624
+ export type Transcript = z.infer<typeof TranscriptSchema>;
2625
+ export declare const TextExtractionStatus: {
2626
+ readonly success: "success";
2627
+ };
2628
+ export interface TranscriptMediaResult {
2629
+ hasText: boolean;
2630
+ status: typeof TextExtractionStatus.success;
2631
+ message?: string;
2632
+ gladiaTranscriptionId?: string;
2633
+ }
2634
+ export type TranscriptSegment = z.infer<typeof TranscriptSegmentSchema>;
2635
+ export type ContentSource = z.infer<typeof ContentSourceSchema>;
2636
+ export type RevisionInfo = z.infer<typeof RevisionInfoSchema>;
2637
+ /**
2638
+ * The content object item is a simplified version of the ContentObject that is returned by the store API when listing objects.
2639
+ */
2640
+ export interface ContentObjectItem<T = JSONObject> extends BaseObject {
2641
+ parent?: string;
2642
+ /** An optional path based location for the object */
2643
+ location: string;
2644
+ /**
2645
+ * Object status.
2646
+ * - created: the object was created and is being processed
2647
+ * - processing: the object is being processed
2648
+ * - completed: the object was processed and is ready to use
2649
+ * - failed: the object processing failed
2650
+ * - archived: the object was archived and is no longer available
2651
+ */
2652
+ status: ContentObjectStatus;
2653
+ /**
2654
+ * Object type id.
2655
+ */
2656
+ type?: ContentObjectTypeRef;
2657
+ /**
2658
+ * Content source information, typically a link to an object store
2659
+ */
2660
+ content?: ContentSource;
2661
+ /**
2662
+ * External identifier for integration with other systems
2663
+ */
2664
+ external_id?: string;
2665
+ /** The object properties. This is a JSON object that describes the object, matching the object type schema */
2666
+ properties: T;
2667
+ /** Technical metadata of the object */
2668
+ metadata?: VideoMetadata | AudioMetadata | ImageMetadata | DocumentMetadata | ContentMetadata | Record<string, unknown>;
2669
+ /** Token information */
2670
+ tokens?: {
2671
+ count?: number;
2672
+ encoding?: string;
2673
+ etag?: string;
2674
+ };
2675
+ /**
2676
+ * Revision information. This is used to track the history of the object.
2677
+ */
2678
+ revision: RevisionInfo;
2679
+ /**
2680
+ * Soft delete flag. When true, the object should be considered deleted
2681
+ * but is still retained in the database for historical purposes.
2682
+ */
2683
+ is_deleted?: boolean;
2684
+ /**
2685
+ * Soft lock flag. When true, the object should be considered read-only
2686
+ * and modification attempts should be rejected.
2687
+ */
2688
+ is_locked?: boolean;
2689
+ /**
2690
+ * The document score, used for ranking and sorting.
2691
+ */
2692
+ score?: number;
2693
+ /**
2694
+ * Computed per-request: the current user's effective permissions on this object.
2695
+ */
2696
+ user_permissions?: ContentObjectUserPermissions;
2697
+ }
2698
+ type CreateContentObjectPayloadWire = z.infer<typeof CreateContentObjectPayloadSchema>;
2699
+ export type CreateContentObjectPayload<T = JSONObject> = Omit<CreateContentObjectPayloadWire, 'properties' | 'metadata'> & {
2700
+ properties?: T;
2701
+ /** Known metadata interfaces remain assignable; the runtime contract deliberately accepts any object keys. */
2702
+ metadata?: ContentObjectItem['metadata'];
2703
+ };
2704
+ type LegacyContentObjectTypeRef = Partial<ContentObjectTypeRef> & {
2705
+ ref_type?: 'stored' | 'incode';
2706
+ id?: string;
2707
+ code?: string;
2708
+ name?: string;
2709
+ };
2710
+ export declare function getContentTypeRefId(type: ContentObjectTypeRef): string;
2711
+ export declare function withContentObjectTypeRefDiscriminator(type: ContentObjectTypeRef | LegacyContentObjectTypeRef): ContentObjectTypeRef;
2712
+ export type ContentObjectTypeRef = z.infer<typeof ContentObjectTypeRefSchema>;
2713
+ export type ComplexSearchPayload = z.infer<typeof ComplexSearchPayloadSchema>;
2714
+ export type ColumnLayout = z.infer<typeof ColumnLayoutSchema>;
2715
+ export type ContentObjectTypeStatus = z.infer<typeof ContentObjectTypeStatusSchema>;
2716
+ export type IntakeVisionDetail = z.infer<typeof IntakeVisionDetailSchema>;
2717
+ export type IntakePageScope = z.infer<typeof IntakePageScopeSchema>;
2718
+ /**
2719
+ * Inclusive `[start, end]` pairs.
2720
+ *
2721
+ * Inferred as `number[][]` rather than the `[number, number][]` this used to declare: the published
2722
+ * component is a uniform-items array with `minItems`/`maxItems`, which is what the scanner made of the
2723
+ * tuple, and reproducing it is what keeps the generated clients unchanged. The length is still
2724
+ * enforced at runtime.
2725
+ */
2726
+ export type IntakePageRanges = z.infer<typeof IntakePageRangesSchema>;
2727
+ /** Rendering settings behind a vision detail name (platform defaults, project-overridable
2728
+ * via `configuration.intake.vision_profiles`). */
2729
+ export interface IntakeVisionProfileSettings {
2730
+ /** Render resolution in dots per inch. */
2731
+ dpi: number;
2732
+ /** Maximum height/width of the rendered page image in pixels. */
2733
+ max_hw: number;
2734
+ /** JPEG quality (0-100). */
2735
+ quality: number;
2736
+ /** grayscale renders gray always; auto keeps color when the plan asks for it. */
2737
+ color_mode: 'grayscale' | 'auto';
2738
+ }
2739
+ export type ContentTypeExtractionGroundingReviewPolicy = z.infer<typeof ContentTypeExtractionGroundingReviewPolicySchema>;
2740
+ export type ContentTypeExtractionGroundingPolicy = z.infer<typeof ContentTypeExtractionGroundingPolicySchema>;
2741
+ export type ContentTypeIntakePolicy = z.infer<typeof ContentTypeIntakePolicySchema>;
2742
+ export type ContentTypeEditingPolicy = z.infer<typeof ContentTypeEditingPolicySchema>;
2743
+ export type ContentObjectType = z.infer<typeof ContentObjectTypeSchema>;
2744
+ export type ContentObjectTypeItem = z.infer<typeof ContentObjectTypeItemSchema>;
2745
+ export type InCodeTypeDefinition = z.infer<typeof InCodeTypeDefinitionSchema>;
2746
+ export type ContentObjectTypeCatalogEntry = z.infer<typeof ContentObjectTypeCatalogEntrySchema>;
2747
+ /**
2748
+ * The itnerface to be used whend efining types in a plugin app.
2749
+ */
2750
+ export type InCodeTypeSpec = Omit<InCodeTypeDefinition, 'id'>;
2751
+ /**
2752
+ * Returns true if the type id represents an in-code type (system or app-contributed).
2753
+ * In-code types use colon-separated ids like "sys:Invoice" or "app:myapp:Article".
2754
+ * These types are read-only and cannot be edited through the UI.
2755
+ */
2756
+ export declare function isInCodeType(typeId: string): boolean;
2757
+ export type CreateContentObjectTypePayload = z.infer<typeof CreateContentObjectTypePayloadSchema>;
2758
+ export type UpdateContentObjectTypePayload = z.infer<typeof UpdateContentObjectTypePayloadSchema>;
2759
+ export declare enum WorkflowRuleInputType {
2760
+ single = "single",
2761
+ multiple = "multiple",
2762
+ none = "none"
2763
+ }
2764
+ export type WorkflowRuleItem = z.infer<typeof WorkflowRuleItemSchema>;
2765
+ export type WorkflowRule = z.infer<typeof WorkflowRuleSchema>;
2766
+ export type CreateWorkflowRulePayload = z.infer<typeof CreateWorkflowRulePayloadSchema>;
2767
+ export interface UploadWorkflowRulePayload extends Partial<Omit<WorkflowRule, 'id' | 'created_at' | 'updated_at' | 'owner'>> {
2768
+ }
2769
+ export declare enum ImageRenditionFormat {
2770
+ jpeg = "jpeg",
2771
+ png = "png",
2772
+ webp = "webp"
2773
+ }
2774
+ export declare const MarkdownRenditionFormat: {
2775
+ readonly docx: "docx";
2776
+ readonly pdf: "pdf";
2777
+ };
2778
+ export type MarkdownRenditionFormat = z.infer<typeof MarkdownRenditionFormatSchema>;
2779
+ export interface GetRenditionParams {
2780
+ format: ImageRenditionFormat | MarkdownRenditionFormat;
2781
+ max_hw?: number;
2782
+ generate_if_missing?: boolean;
2783
+ sign_url?: boolean;
2784
+ block_on_generation?: boolean;
2785
+ }
2786
+ export type GetRenditionResponse = z.infer<typeof GetRenditionResponseSchema>;
2787
+ export type ObjectSearchResponse = z.infer<typeof ObjectSearchResponseSchema>;
2788
+ export type RenditionFormat = ImageRenditionFormat | MarkdownRenditionFormat;
2789
+ /**
2790
+ * Check if a specific rendition format can be generated from a content type.
2791
+ *
2792
+ * @param contentType - The MIME type of the source content (e.g., 'image/png', 'text/markdown')
2793
+ * @param format - The desired rendition format (e.g., ImageRenditionFormat.jpeg)
2794
+ * @returns true if the format can be generated from the content type
2795
+ *
2796
+ * @example
2797
+ * canGenerateRendition('image/png', ImageRenditionFormat.jpeg) // true
2798
+ * canGenerateRendition('text/markdown', ImageRenditionFormat.jpeg) // false
2799
+ * canGenerateRendition('text/markdown', MarkdownRenditionFormat.pdf) // true
2800
+ */
2801
+ export declare function canGenerateRendition(contentType: string | undefined, format: RenditionFormat | string): boolean;
2802
+ /**
2803
+ * Get the list of rendition formats supported for a given content type.
2804
+ *
2805
+ * @param contentType - The MIME type of the source content
2806
+ * @returns Array of supported rendition formats, or empty array if none
2807
+ *
2808
+ * @example
2809
+ * getSupportedRenditionFormats('image/png') // [jpeg, png, webp]
2810
+ * getSupportedRenditionFormats('text/markdown') // [pdf, docx]
2811
+ * getSupportedRenditionFormats('text/html') // []
2812
+ */
2813
+ export declare function getSupportedRenditionFormats(contentType: string | undefined): RenditionFormat[];
2814
+ /**
2815
+ * Check if a content type supports visual (image) renditions.
2816
+ * This is useful for determining if a document can have thumbnails/previews.
2817
+ *
2818
+ * @param contentType - The MIME type of the source content
2819
+ * @returns true if the content type can generate JPEG renditions
2820
+ *
2821
+ * @example
2822
+ * supportsVisualRendition('image/png') // true
2823
+ * supportsVisualRendition('application/pdf') // true
2824
+ * supportsVisualRendition('text/markdown') // false
2825
+ */
2826
+ export declare function supportsVisualRendition(contentType: string | undefined): boolean;
2827
+ export type GetUploadUrlPayload = z.infer<typeof GetUploadUrlPayloadSchema>;
2828
+ export type GetFileUrlPayload = z.infer<typeof GetFileUrlPayloadSchema>;
2829
+ export type GetFileUrlResponse = z.infer<typeof GetFileUrlResponseSchema>;
2830
+ export type EnsureBucketReadAccessPayload = z.infer<typeof EnsureBucketReadAccessPayloadSchema>;
2831
+ export type EnsureBucketReadAccessResponse = z.infer<typeof EnsureBucketReadAccessResponseSchema>;
2832
+ export type BucketReadAccessStatusResponse = z.infer<typeof BucketReadAccessStatusResponseSchema>;
2833
+ export type FileMetadataResponse = z.infer<typeof FileMetadataResponseSchema>;
2834
+ export type SetFileMetadataPayload = z.infer<typeof SetFileMetadataPayloadSchema>;
2835
+ export type FileMetadataUpdateResult = z.infer<typeof FileMetadataUpdateResultSchema>;
2836
+ export type BulkUploadUrlsPayload = z.infer<typeof BulkUploadUrlsPayloadSchema>;
2837
+ export type BulkUploadUrlsResponse = z.infer<typeof BulkUploadUrlsResponseSchema>;
2838
+ export type FileBucketResponse = z.infer<typeof FileBucketResponseSchema>;
2839
+ export type FileListResponse = z.infer<typeof FileListResponseSchema>;
2840
+ export type FileMetadataQuery = z.infer<typeof FileMetadataQuerySchema>;
2841
+ export type FileListQuery = z.infer<typeof FileListQuerySchema>;
2842
+ export type FileDeleteQuery = z.infer<typeof FileDeleteQuerySchema>;
2843
+ export type ContentObjectTypeCatalogQuery = z.infer<typeof ContentObjectTypeCatalogQuerySchema>;
2844
+ export type ContentObjectTypeListQuery = z.infer<typeof ContentObjectTypeListQuerySchema>;
2845
+ export type CopyFilePayload = z.infer<typeof CopyFilePayloadSchema>;
2846
+ export type CopyFileResponse = z.infer<typeof CopyFileResponseSchema>;
2847
+ export type DeleteFileResult = z.infer<typeof DeleteFileResultSchema>;
2848
+ export declare enum ContentObjectProcessingPriority {
2849
+ normal = "normal",
2850
+ low = "low"
2851
+ }
2852
+ export {};
2853
+
2854
+ // -----------------------------------------------------------------------------
2855
+ // @vertesia/common: store/object-types.d.ts
2856
+ // -----------------------------------------------------------------------------
2857
+ import type { JSONSchemaType } from 'ajv';
2858
+ export interface RenditionProperties {
2859
+ mime_type: string;
2860
+ source_etag?: string;
2861
+ height?: number;
2862
+ width?: number;
2863
+ multipart?: boolean;
2864
+ total_parts?: number;
2865
+ }
2866
+ export declare const RenditionSchema: JSONSchemaType<RenditionProperties>;
2867
+ export interface DocumentPartProperties {
2868
+ source_etag?: string;
2869
+ part_number: number;
2870
+ title?: string;
2871
+ source_line_start?: number;
2872
+ source_line_end?: number;
2873
+ type?: 'text' | 'image' | 'table' | 'chart' | 'diagram' | 'code' | 'other';
2874
+ page_number?: number;
2875
+ description?: string;
2876
+ height?: number;
2877
+ width?: number;
2878
+ }
2879
+ export declare const DocumentPartSchema: JSONSchemaType<DocumentPartProperties>;
2880
+
2881
+ // -----------------------------------------------------------------------------
2882
+ // @vertesia/common: store/collections.d.ts
2883
+ // -----------------------------------------------------------------------------
2884
+ import type { z } from 'zod';
2885
+ import type { CollectionChildrenUpdatePayloadSchema, CollectionChildrenUpdateResultSchema, CollectionMembersQuerySchema, CollectionMembersUpdatePayloadSchema, CollectionMembersUpdateResultSchema, CollectionPropagationResponseSchema, CollectionSchema, CollectionSecuritySettingsResponseSchema, CreateCollectionPayloadSchema } from '../api-schemas/content.js';
2886
+ import type { BaseObject } from './common.js';
2887
+ import type { ColumnLayout, ContentObjectTypeRef } from './store.js';
2888
+ export declare enum CollectionStatus {
2889
+ active = "active",
2890
+ archived = "archived"
2891
+ }
2892
+ export type CreateCollectionPayload = z.infer<typeof CreateCollectionPayloadSchema>;
2893
+ export interface CollectionItem extends BaseObject {
2894
+ /**
2895
+ * A flag to indicate if the collection is dynamic or static.
2896
+ * If the collection is dynamic, the members are determined by a query using the query field.
2897
+ * If the collection is static, the members are explicitly defined using the members array.
2898
+ */
2899
+ dynamic: boolean;
2900
+ status: CollectionStatus;
2901
+ type?: ContentObjectTypeRef;
2902
+ /**
2903
+ * A flag to indicate whether to track and sync member HEAD revisions.
2904
+ * The default is to sync HEAD revisions for collection members (skip_head_sync: false)
2905
+ */
2906
+ skip_head_sync: boolean;
2907
+ /**
2908
+ * The parent collections if any.
2909
+ * A collection can have multiple parents.
2910
+ */
2911
+ parents?: string[] | null;
2912
+ /**
2913
+ * The table layout to use for the collection.
2914
+ * The layout defined in the type could serve as a fallback if not defined here.
2915
+ */
2916
+ table_layout?: ColumnLayout[];
2917
+ /**
2918
+ * The allowed types for the collection.
2919
+ */
2920
+ allowed_types?: string[];
2921
+ }
2922
+ export type Collection = z.infer<typeof CollectionSchema>;
2923
+ export interface StaticCollection extends Collection {
2924
+ dynamic: false;
2925
+ members: string[];
2926
+ query: never;
2927
+ }
2928
+ export interface DynamicCollection extends Collection {
2929
+ dynamic: true;
2930
+ }
2931
+ export interface CollectionSearchPayload {
2932
+ parent?: string | null;
2933
+ dynamic?: boolean;
2934
+ status?: CollectionStatus;
2935
+ limit?: number;
2936
+ offset?: number;
2937
+ name?: string;
2938
+ type?: string;
2939
+ types?: string[];
2940
+ }
2941
+ export type CollectionMembersUpdateResult = z.infer<typeof CollectionMembersUpdateResultSchema>;
2942
+ export type CollectionSecuritySettingsResponse = z.infer<typeof CollectionSecuritySettingsResponseSchema>;
2943
+ export type CollectionPropagationResponse = z.infer<typeof CollectionPropagationResponseSchema>;
2944
+ export type CollectionChildrenUpdateResult = z.infer<typeof CollectionChildrenUpdateResultSchema>;
2945
+ export type CollectionMembersUpdatePayload = z.infer<typeof CollectionMembersUpdatePayloadSchema>;
2946
+ export type CollectionChildrenUpdatePayload = z.infer<typeof CollectionChildrenUpdatePayloadSchema>;
2947
+ export type CollectionMembersQuery = z.infer<typeof CollectionMembersQuerySchema>;
2948
+
2949
+ // -----------------------------------------------------------------------------
2950
+ // @vertesia/common: store/process.d.ts
2951
+ // -----------------------------------------------------------------------------
2952
+ import type { z } from 'zod';
2953
+ import type { BranchDefinitionSchema, BranchJoinPolicySchema, HumanTaskDefinitionSchema, JsonLogicRuleSchema, ListProcessDefinitionsQuerySchema, NodeHistoryEntrySchema, ParallelCollectDefinitionSchema, ParallelCollectFieldSchema, ParallelCollectModeSchema, ParallelFailurePolicySchema, ProcessContextDefinitionSchema, ProcessDefinitionFormatVersionSchema, ProcessDefinitionMetadataSchema, ProcessDefinitionRevisionInfoSchema, ProcessDefinitionStatusSchema, ProcessHistoryRefSchema, ProcessNodeReturnsDefinitionSchema, ProcessNodeRunTypeSchema, ProcessNodeTypeSchema, ProcessResourcesDefinitionSchema, ProcessScriptInlineSourceSchema, ProcessScriptLanguageSchema, ProcessScriptResourceSchema, ProcessScriptSourceSchema, ProcessStateSchema, PublishProcessDefinitionPayloadSchema, RevertProcessDefinitionPayloadSchema, TransitionDefinitionSchema, TransitionTriggerSchema } from '../api-schemas/process.js';
2954
+ import type { JSONSchema } from '../json-schema.js';
2955
+ export type JsonLogicRule = z.infer<typeof JsonLogicRuleSchema>;
2956
+ export type ProcessDefinitionStatus = z.infer<typeof ProcessDefinitionStatusSchema>;
2957
+ export type ListProcessDefinitionsQuery = z.infer<typeof ListProcessDefinitionsQuerySchema>;
2958
+ export declare const PROCESS_DEFINITION_FORMAT_VERSION: 1;
2959
+ export type ProcessDefinitionFormatVersion = z.infer<typeof ProcessDefinitionFormatVersionSchema>;
2960
+ export type ProcessNodeType = z.infer<typeof ProcessNodeTypeSchema>;
2961
+ export type TransitionTrigger = z.infer<typeof TransitionTriggerSchema>;
2962
+ export type ParallelFailurePolicy = z.infer<typeof ParallelFailurePolicySchema>;
2963
+ export type ProcessNodeRunType = z.infer<typeof ProcessNodeRunTypeSchema>;
2964
+ export type ParallelCollectMode = z.infer<typeof ParallelCollectModeSchema>;
2965
+ export type BranchJoinPolicy = z.infer<typeof BranchJoinPolicySchema>;
2966
+ export type ProcessDefinitionMetadata = z.infer<typeof ProcessDefinitionMetadataSchema>;
2967
+ export type ProcessScriptLanguage = z.infer<typeof ProcessScriptLanguageSchema>;
2968
+ export type ProcessScriptInlineSource = z.infer<typeof ProcessScriptInlineSourceSchema>;
2969
+ export type ProcessScriptSource = z.infer<typeof ProcessScriptSourceSchema>;
2970
+ export type ProcessScriptResource = z.infer<typeof ProcessScriptResourceSchema>;
2971
+ export type ProcessResourcesDefinition = z.infer<typeof ProcessResourcesDefinitionSchema>;
2972
+ export type ParallelCollectField = z.infer<typeof ParallelCollectFieldSchema>;
2973
+ export type TransitionDefinition = z.infer<typeof TransitionDefinitionSchema>;
2974
+ export type BranchDefinition = z.infer<typeof BranchDefinitionSchema>;
2975
+ export interface BranchNodeBranchDefinition {
2976
+ id: string;
2977
+ title?: string;
2978
+ description?: string;
2979
+ node: NodeDefinition;
2980
+ metadata?: ProcessDefinitionMetadata;
2981
+ }
2982
+ export type HumanTaskDefinition = z.infer<typeof HumanTaskDefinitionSchema>;
2983
+ export type ProcessNodeReturnsDefinition = z.infer<typeof ProcessNodeReturnsDefinitionSchema>;
2984
+ export type ParallelCollectDefinition = z.infer<typeof ParallelCollectDefinitionSchema>;
2985
+ export interface NodeDefinition {
2986
+ type: ProcessNodeType;
2987
+ tool?: string;
2988
+ /** Named entry in process resources.scripts for script nodes. */
2989
+ script?: string;
2990
+ /** Script execution timeout in seconds. Defaults to 300 and is capped at 600. */
2991
+ timeout?: number;
2992
+ interaction?: string;
2993
+ process?: string;
2994
+ process_definition?: ProcessDefinitionBody;
2995
+ process_version?: number;
2996
+ run_type?: ProcessNodeRunType;
2997
+ returns?: ProcessNodeReturnsDefinition;
2998
+ /**
2999
+ * Optional JSON Schema for structured output produced by interaction and
3000
+ * agent nodes. When omitted, the process engine derives a schema from
3001
+ * `writes` and the process context schema.
3002
+ */
3003
+ result_schema?: JSONSchema;
3004
+ prompt?: string;
3005
+ input?: Record<string, unknown>;
3006
+ config?: Record<string, unknown>;
3007
+ title?: string;
3008
+ description?: string;
3009
+ /**
3010
+ * End-user-facing explanation of what this node does. Authored by the
3011
+ * process designer (often an LLM) in plain language — one or two
3012
+ * sentences — and rendered in run observability so a human reading the
3013
+ * run can understand why this node exists without reading the config.
3014
+ * Distinct from `description`, which is developer-facing.
3015
+ */
3016
+ human_description?: string;
3017
+ writes?: string[];
3018
+ skippable?: boolean;
3019
+ max_retries?: number;
3020
+ transitions?: TransitionDefinition[];
3021
+ tools?: string[];
3022
+ /**
3023
+ * Model id override for this node. If unset, falls back to the process
3024
+ * run's `config.model`, then to the project's default. Useful when a
3025
+ * specific node needs heavier reasoning (e.g. Opus for legal flagging)
3026
+ * while the rest of the process uses a cheaper default.
3027
+ */
3028
+ model?: string;
3029
+ task?: HumanTaskDefinition;
3030
+ foreach?: string;
3031
+ as?: string;
3032
+ item_id?: string;
3033
+ node?: NodeDefinition;
3034
+ max_concurrency?: number;
3035
+ collect?: string | ParallelCollectDefinition;
3036
+ failure_policy?: ParallelFailurePolicy;
3037
+ join?: BranchJoinPolicy;
3038
+ branches?: BranchDefinition[] | BranchNodeBranchDefinition[];
3039
+ metadata?: ProcessDefinitionMetadata;
3040
+ }
3041
+ export type ProcessContextDefinition = z.infer<typeof ProcessContextDefinitionSchema>;
3042
+ export interface ProcessDefinitionBody {
3043
+ format_version: ProcessDefinitionFormatVersion;
3044
+ process: string;
3045
+ description?: string;
3046
+ initial: string;
3047
+ model?: string;
3048
+ resources?: ProcessResourcesDefinition;
3049
+ context: ProcessContextDefinition;
3050
+ nodes: Record<string, NodeDefinition>;
3051
+ metadata?: ProcessDefinitionMetadata;
3052
+ }
3053
+ export interface InCodeProcessDefinition {
3054
+ /**
3055
+ * Process identifier exposed by an app package. App-local ids are normalized
3056
+ * by Studio to `app:<app-name>:<id>` when returned to callers.
3057
+ */
3058
+ id: string;
3059
+ /** Human-readable or app-local process name. */
3060
+ name: string;
3061
+ title?: string;
3062
+ description?: string;
3063
+ tags?: string[];
3064
+ definition: ProcessDefinitionBody;
3065
+ }
3066
+ export type ProcessDefinitionRevisionInfo = z.infer<typeof ProcessDefinitionRevisionInfoSchema>;
3067
+ export interface ProcessDefinition {
3068
+ id: string;
3069
+ account: string;
3070
+ project: string;
3071
+ name: string;
3072
+ description?: string;
3073
+ status: ProcessDefinitionStatus;
3074
+ version: number;
3075
+ revision?: ProcessDefinitionRevisionInfo;
3076
+ tags?: string[];
3077
+ definition: ProcessDefinitionBody;
3078
+ created_at: Date;
3079
+ updated_at: Date;
3080
+ created_by: string;
3081
+ updated_by: string;
3082
+ }
3083
+ export type NodeHistoryEntry = z.infer<typeof NodeHistoryEntrySchema>;
3084
+ export type ProcessHistoryRef = z.infer<typeof ProcessHistoryRefSchema>;
3085
+ export interface ProcessHistoryCheckpoint {
3086
+ sequence: number;
3087
+ current_node: string;
3088
+ written_at: Date | string;
3089
+ entries: NodeHistoryEntry[];
3090
+ }
3091
+ export type ProcessState = z.infer<typeof ProcessStateSchema>;
3092
+ export interface CreateProcessDefinitionPayload {
3093
+ name: string;
3094
+ description?: string;
3095
+ /**
3096
+ * @deprecated Process definitions are created as drafts. Use the publish endpoint
3097
+ * to create immutable published versions.
3098
+ */
3099
+ status?: ProcessDefinitionStatus;
3100
+ /**
3101
+ * @deprecated Version is server-owned. Use the publish endpoint to create the next version.
3102
+ */
3103
+ version?: number;
3104
+ tags?: string[];
3105
+ definition: ProcessDefinitionBody;
3106
+ }
3107
+ export interface UpdateProcessDefinitionPayload {
3108
+ name?: string;
3109
+ description?: string;
3110
+ /**
3111
+ * @deprecated Status is server-owned. Use publish/archive endpoints instead of updating it directly.
3112
+ */
3113
+ status?: ProcessDefinitionStatus;
3114
+ /**
3115
+ * @deprecated Version is server-owned. Use the publish endpoint to create the next version.
3116
+ */
3117
+ version?: number;
3118
+ tags?: string[];
3119
+ definition?: ProcessDefinitionBody;
3120
+ }
3121
+ export type PublishProcessDefinitionPayload = z.infer<typeof PublishProcessDefinitionPayloadSchema>;
3122
+ export type RevertProcessDefinitionPayload = z.infer<typeof RevertProcessDefinitionPayloadSchema>;
3123
+
3124
+ // -----------------------------------------------------------------------------
3125
+ // @vertesia/common: store/process-schema.d.ts
3126
+ // -----------------------------------------------------------------------------
3127
+ export declare const PROCESS_DEFINITION_JSON_SCHEMA_ID = "https://schemas.vertesia.com/process-definition.v1.schema.json";
3128
+ export declare const ProcessDefinitionBodyJsonSchema: {
3129
+ $id: string;
3130
+ type: string;
3131
+ description: string;
3132
+ properties: {
3133
+ format_version: {
3134
+ type: string;
3135
+ const: number;
3136
+ description: string;
3137
+ };
3138
+ process: {
3139
+ type: string;
3140
+ minLength: number;
3141
+ description: string;
3142
+ };
3143
+ description: {
3144
+ type: string;
3145
+ nullable: true;
3146
+ description: string;
3147
+ };
3148
+ initial: {
3149
+ type: string;
3150
+ minLength: number;
3151
+ description: string;
3152
+ };
3153
+ model: {
3154
+ type: string;
3155
+ nullable: true;
3156
+ description: string;
3157
+ };
3158
+ resources: {
3159
+ $ref: string;
3160
+ };
3161
+ context: {
3162
+ $ref: string;
3163
+ };
3164
+ nodes: {
3165
+ type: string;
3166
+ description: string;
3167
+ minProperties: number;
3168
+ required: never[];
3169
+ additionalProperties: {
3170
+ $ref: string;
3171
+ };
3172
+ };
3173
+ metadata: {
3174
+ $ref: string;
3175
+ };
3176
+ };
3177
+ required: string[];
3178
+ additionalProperties: false;
3179
+ $defs: {
3180
+ metadataDefinition: {
3181
+ type: string;
3182
+ nullable: true;
3183
+ description: string;
3184
+ required: never[];
3185
+ additionalProperties: true;
3186
+ };
3187
+ processContextDefinition: {
3188
+ type: string;
3189
+ properties: {
3190
+ schema: {
3191
+ description: string;
3192
+ anyOf: ({
3193
+ type: string;
3194
+ additionalProperties?: undefined;
3195
+ } | {
3196
+ type: string;
3197
+ additionalProperties: true;
3198
+ })[];
3199
+ };
3200
+ initial: {
3201
+ type: string;
3202
+ description: string;
3203
+ required: never[];
3204
+ additionalProperties: true;
3205
+ };
3206
+ };
3207
+ required: string[];
3208
+ additionalProperties: false;
3209
+ };
3210
+ nodeDefinition: {
3211
+ type: string;
3212
+ description: string;
3213
+ properties: {
3214
+ type: {
3215
+ type: string;
3216
+ enum: string[];
3217
+ description: string;
3218
+ };
3219
+ tool: {
3220
+ type: string;
3221
+ nullable: true;
3222
+ description: string;
3223
+ };
3224
+ script: {
3225
+ type: string;
3226
+ nullable: true;
3227
+ description: string;
3228
+ };
3229
+ timeout: {
3230
+ type: string;
3231
+ minimum: number;
3232
+ maximum: number;
3233
+ nullable: true;
3234
+ description: string;
3235
+ };
3236
+ interaction: {
3237
+ type: string;
3238
+ nullable: true;
3239
+ description: string;
3240
+ };
3241
+ process: {
3242
+ type: string;
3243
+ nullable: true;
3244
+ description: string;
3245
+ };
3246
+ process_definition: {
3247
+ $ref: string;
3248
+ description: string;
3249
+ };
3250
+ process_version: {
3251
+ type: string;
3252
+ nullable: true;
3253
+ description: string;
3254
+ };
3255
+ run_type: {
3256
+ type: string;
3257
+ enum: string[];
3258
+ nullable: true;
3259
+ description: string;
3260
+ };
3261
+ returns: {
3262
+ $ref: string;
3263
+ };
3264
+ result_schema: {
3265
+ $ref: string;
3266
+ description: string;
3267
+ };
3268
+ prompt: {
3269
+ type: string;
3270
+ nullable: true;
3271
+ description: string;
3272
+ };
3273
+ input: {
3274
+ type: string;
3275
+ nullable: true;
3276
+ description: string;
3277
+ required: never[];
3278
+ additionalProperties: true;
3279
+ };
3280
+ config: {
3281
+ type: string;
3282
+ nullable: true;
3283
+ description: string;
3284
+ required: never[];
3285
+ additionalProperties: true;
3286
+ };
3287
+ title: {
3288
+ type: string;
3289
+ nullable: true;
3290
+ description: string;
3291
+ };
3292
+ description: {
3293
+ type: string;
3294
+ nullable: true;
3295
+ description: string;
3296
+ };
3297
+ human_description: {
3298
+ type: string;
3299
+ nullable: true;
3300
+ description: string;
3301
+ };
3302
+ writes: {
3303
+ type: string;
3304
+ nullable: true;
3305
+ description: string;
3306
+ items: {
3307
+ type: string;
3308
+ };
3309
+ };
3310
+ skippable: {
3311
+ type: string;
3312
+ nullable: true;
3313
+ description: string;
3314
+ };
3315
+ max_retries: {
3316
+ type: string;
3317
+ nullable: true;
3318
+ description: string;
3319
+ };
3320
+ transitions: {
3321
+ type: string;
3322
+ nullable: true;
3323
+ description: string;
3324
+ items: {
3325
+ $ref: string;
3326
+ };
3327
+ };
3328
+ tools: {
3329
+ type: string;
3330
+ nullable: true;
3331
+ description: string;
3332
+ items: {
3333
+ type: string;
3334
+ };
3335
+ };
3336
+ model: {
3337
+ type: string;
3338
+ nullable: true;
3339
+ description: string;
3340
+ };
3341
+ task: {
3342
+ $ref: string;
3343
+ };
3344
+ foreach: {
3345
+ type: string;
3346
+ nullable: true;
3347
+ description: string;
3348
+ };
3349
+ as: {
3350
+ type: string;
3351
+ nullable: true;
3352
+ description: string;
3353
+ };
3354
+ item_id: {
3355
+ type: string;
3356
+ nullable: true;
3357
+ description: string;
3358
+ };
3359
+ node: {
3360
+ $ref: string;
3361
+ description: string;
3362
+ };
3363
+ max_concurrency: {
3364
+ type: string;
3365
+ minimum: number;
3366
+ nullable: true;
3367
+ description: string;
3368
+ };
3369
+ collect: {
3370
+ description: string;
3371
+ oneOf: ({
3372
+ type: string;
3373
+ minLength: number;
3374
+ $ref?: undefined;
3375
+ } | {
3376
+ $ref: string;
3377
+ type?: undefined;
3378
+ minLength?: undefined;
3379
+ })[];
3380
+ };
3381
+ failure_policy: {
3382
+ type: string;
3383
+ enum: string[];
3384
+ nullable: true;
3385
+ description: string;
3386
+ };
3387
+ join: {
3388
+ type: string;
3389
+ enum: string[];
3390
+ nullable: true;
3391
+ description: string;
3392
+ };
3393
+ branches: {
3394
+ type: string;
3395
+ nullable: true;
3396
+ description: string;
3397
+ items: {
3398
+ oneOf: {
3399
+ $ref: string;
3400
+ }[];
3401
+ };
3402
+ };
3403
+ metadata: {
3404
+ $ref: string;
3405
+ };
3406
+ };
3407
+ required: string[];
3408
+ additionalProperties: false;
3409
+ };
3410
+ transitionDefinition: {
3411
+ type: string;
3412
+ properties: {
3413
+ to: {
3414
+ type: string;
3415
+ minLength: number;
3416
+ description: string;
3417
+ };
3418
+ guard: {
3419
+ $ref: string;
3420
+ description: string;
3421
+ };
3422
+ trigger: {
3423
+ type: string;
3424
+ enum: string[];
3425
+ nullable: true;
3426
+ description: string;
3427
+ };
3428
+ label: {
3429
+ type: string;
3430
+ nullable: true;
3431
+ description: string;
3432
+ };
3433
+ metadata: {
3434
+ $ref: string;
3435
+ };
3436
+ };
3437
+ required: string[];
3438
+ additionalProperties: false;
3439
+ };
3440
+ processResourcesDefinition: {
3441
+ type: string;
3442
+ nullable: true;
3443
+ properties: {
3444
+ scripts: {
3445
+ type: string;
3446
+ nullable: true;
3447
+ description: string;
3448
+ required: never[];
3449
+ additionalProperties: {
3450
+ $ref: string;
3451
+ };
3452
+ };
3453
+ };
3454
+ required: never[];
3455
+ additionalProperties: false;
3456
+ };
3457
+ processScriptResource: {
3458
+ type: string;
3459
+ properties: {
3460
+ language: {
3461
+ type: string;
3462
+ enum: string[];
3463
+ };
3464
+ entrypoint: {
3465
+ type: string;
3466
+ minLength: number;
3467
+ };
3468
+ source: {
3469
+ $ref: string;
3470
+ };
3471
+ packages: {
3472
+ type: string;
3473
+ nullable: true;
3474
+ items: {
3475
+ type: string;
3476
+ };
3477
+ };
3478
+ };
3479
+ required: string[];
3480
+ additionalProperties: false;
3481
+ };
3482
+ processScriptSource: {
3483
+ $ref: string;
3484
+ };
3485
+ processScriptInlineSource: {
3486
+ type: string;
3487
+ properties: {
3488
+ type: {
3489
+ type: string;
3490
+ const: string;
3491
+ description: string;
3492
+ };
3493
+ files: {
3494
+ type: string;
3495
+ minProperties: number;
3496
+ required: never[];
3497
+ additionalProperties: {
3498
+ type: string;
3499
+ };
3500
+ };
3501
+ };
3502
+ required: string[];
3503
+ additionalProperties: false;
3504
+ };
3505
+ branchDefinition: {
3506
+ type: string;
3507
+ properties: {
3508
+ to: {
3509
+ type: string;
3510
+ minLength: number;
3511
+ description: string;
3512
+ };
3513
+ when: {
3514
+ $ref: string;
3515
+ description: string;
3516
+ };
3517
+ default: {
3518
+ type: string;
3519
+ nullable: true;
3520
+ description: string;
3521
+ };
3522
+ metadata: {
3523
+ $ref: string;
3524
+ };
3525
+ };
3526
+ required: string[];
3527
+ additionalProperties: false;
3528
+ };
3529
+ branchNodeBranchDefinition: {
3530
+ type: string;
3531
+ properties: {
3532
+ id: {
3533
+ type: string;
3534
+ minLength: number;
3535
+ description: string;
3536
+ };
3537
+ title: {
3538
+ type: string;
3539
+ nullable: true;
3540
+ description: string;
3541
+ };
3542
+ description: {
3543
+ type: string;
3544
+ nullable: true;
3545
+ description: string;
3546
+ };
3547
+ node: {
3548
+ $ref: string;
3549
+ description: string;
3550
+ };
3551
+ metadata: {
3552
+ $ref: string;
3553
+ };
3554
+ };
3555
+ required: string[];
3556
+ additionalProperties: false;
3557
+ };
3558
+ humanTaskDefinition: {
3559
+ type: string;
3560
+ properties: {
3561
+ title: {
3562
+ type: string;
3563
+ minLength: number;
3564
+ description: string;
3565
+ };
3566
+ description: {
3567
+ type: string;
3568
+ nullable: true;
3569
+ description: string;
3570
+ };
3571
+ assignee: {
3572
+ type: string;
3573
+ nullable: true;
3574
+ description: string;
3575
+ };
3576
+ fields: {
3577
+ type: string;
3578
+ description: string;
3579
+ items: {
3580
+ $ref: string;
3581
+ };
3582
+ };
3583
+ };
3584
+ required: string[];
3585
+ additionalProperties: false;
3586
+ };
3587
+ taskField: {
3588
+ type: string;
3589
+ properties: {
3590
+ name: {
3591
+ type: string;
3592
+ minLength: number;
3593
+ description: string;
3594
+ };
3595
+ type: {
3596
+ type: string;
3597
+ enum: string[];
3598
+ description: string;
3599
+ };
3600
+ required: {
3601
+ type: string;
3602
+ nullable: true;
3603
+ description: string;
3604
+ };
3605
+ label: {
3606
+ type: string;
3607
+ nullable: true;
3608
+ description: string;
3609
+ };
3610
+ options: {
3611
+ type: string;
3612
+ nullable: true;
3613
+ description: string;
3614
+ items: {
3615
+ type: string;
3616
+ };
3617
+ };
3618
+ default: {
3619
+ description: string;
3620
+ };
3621
+ };
3622
+ required: string[];
3623
+ additionalProperties: false;
3624
+ };
3625
+ processNodeReturnsDefinition: {
3626
+ type: string;
3627
+ properties: {
3628
+ from: {
3629
+ type: string;
3630
+ nullable: true;
3631
+ description: string;
3632
+ };
3633
+ context: {
3634
+ type: string;
3635
+ nullable: true;
3636
+ description: string;
3637
+ items: {
3638
+ type: string;
3639
+ };
3640
+ };
3641
+ };
3642
+ required: never[];
3643
+ additionalProperties: false;
3644
+ };
3645
+ parallelCollectDefinition: {
3646
+ type: string;
3647
+ properties: {
3648
+ into: {
3649
+ type: string;
3650
+ minLength: number;
3651
+ description: string;
3652
+ };
3653
+ mode: {
3654
+ type: string;
3655
+ enum: string[];
3656
+ nullable: true;
3657
+ description: string;
3658
+ };
3659
+ include: {
3660
+ type: string;
3661
+ nullable: true;
3662
+ description: string;
3663
+ items: {
3664
+ type: string;
3665
+ enum: string[];
3666
+ };
3667
+ };
3668
+ };
3669
+ required: string[];
3670
+ additionalProperties: false;
3671
+ };
3672
+ jsonLogicRule: {
3673
+ type: string;
3674
+ description: string;
3675
+ required: never[];
3676
+ additionalProperties: true;
3677
+ };
3678
+ jsonSchemaDefinition: {
3679
+ type: string;
3680
+ nullable: true;
3681
+ description: string;
3682
+ required: never[];
3683
+ additionalProperties: true;
3684
+ };
3685
+ };
3686
+ };
3687
+
3688
+ // -----------------------------------------------------------------------------
3689
+ // @vertesia/common: store/workflow.d.ts
3690
+ // -----------------------------------------------------------------------------
3691
+ import type { HttpTimeoutOptions, ModelOptions } from '@llumiverse/common';
3692
+ import type { z } from 'zod';
3693
+ import type { AgentMessageDetailsSchema, CompactMessageSchema, ConversationFileSchema } from '../api-schemas/agent-runs.js';
3694
+ import type { ConversationActivityStateSchema } from '../api-schemas/app-lifecycle.js';
3695
+ import type { WorkflowExecutionStatusSchema } from '../api-schemas/document-processing.js';
3696
+ import type { PlanSchema, PlanTaskSchema, WorkflowAncestorSchema } from '../api-schemas/interaction.js';
3697
+ import type { WorkflowExecutionStartResultSchema } from '../api-schemas/process.js';
3698
+ import type { ActivityTaskSchema, AgentTaskSchema, ChildWorkflowTaskSchema, EventErrorSchema, ExecuteWorkflowPayloadSchema, ListWorkflowInteractionsResponseSchema, ListWorkflowRunsPayloadSchema, ListWorkflowRunsResponseSchema, PendingActivitySchema, SignalEventPropertiesSchema, SignalTaskSchema, TimerTaskSchema, WorkflowActionResponseSchema, WorkflowHistorySchema, WorkflowInteractionVarsSchema, WorkflowQueryResultSchema, WorkflowRunDetailsQuerySchema, WorkflowRunEventSchema, WorkflowRunSchema, WorkflowRunStreamQuerySchema, WorkflowRunUpdatesQuerySchema, WorkflowRunUpdatesResponseSchema, WorkflowRunWithDetailsSchema, WorkflowTaskSchema, WorkflowUpdatePublishResponseSchema } from '../api-schemas/workflow-runs.js';
3699
+ import type { AgentResourceReference, InteractionExecutionConfiguration } from '../interaction.js';
3700
+ import type { SupportedEmbeddingTypes } from '../project.js';
3701
+ import type { WorkflowInput } from './dsl-workflow.js';
3702
+ export declare enum ContentEventName {
3703
+ create = "create",
3704
+ change_type = "change_type",
3705
+ update = "update",
3706
+ revision_created = "revision_created",
3707
+ delete = "delete",
3708
+ workflow_finished = "workflow_finished",
3709
+ workflow_execution_request = "workflow_execution_request",
3710
+ api_request = "api_request"
3711
+ }
3712
+ export interface Queue {
3713
+ name: string;
3714
+ queue_suffix?: string;
3715
+ queue_full_name?: string;
3716
+ }
3717
+ export type WorkflowAncestor = z.infer<typeof WorkflowAncestorSchema>;
3718
+ export interface WorkflowExecutionBaseParams<T = Record<string, unknown>> {
3719
+ /**
3720
+ * The ref of the user who initiated the workflow.
3721
+ */
3722
+ initiated_by?: string;
3723
+ /**
3724
+ * The account ID of the user who created the activity.
3725
+ * This is useful to select the right database to work on.
3726
+ */
3727
+ account_id: string;
3728
+ /**
3729
+ * The project ID of the account who created the activity.
3730
+ */
3731
+ project_id: string;
3732
+ /**
3733
+ * The vars field is mainly used to pass the user input to the workflow.
3734
+ * The user input ar custom user options that can be used to configure the workflow.
3735
+ * You can see the user input as the arguments for a command line app.
3736
+ *
3737
+ * In the case of workflows started by event subscriptions, the user input vars
3738
+ * are initialized from the subscription target configuration.
3739
+ *
3740
+ * In case of dsl workflows the workflow execution payload vars will be applied over the default vars values stored in the DSL vars field.
3741
+ */
3742
+ vars: T;
3743
+ /**
3744
+ * Auth Token to access Zeno and Composable from the workers
3745
+ */
3746
+ auth_token?: string;
3747
+ /**
3748
+ * The configuration for the workflow execution.
3749
+ */
3750
+ config?: {
3751
+ studio_url: string;
3752
+ store_url: string;
3753
+ slack_app_url?: string;
3754
+ enabled_integrations?: string[];
3755
+ };
3756
+ /**
3757
+ * The list of endpoints to notify when the workflow finishes.
3758
+ * It is handled by a sub-workflow execution, so the main workflow will not wait for the notification to be sent.
3759
+ */
3760
+ notify_endpoints?: (string | WebHookSpec)[];
3761
+ /** If this is a child workflow, parent contains parent's ids */
3762
+ parent?: WorkflowAncestor;
3763
+ /**
3764
+ * Full ancestry chain from root to immediate parent (for hierarchical aggregation)
3765
+ */
3766
+ ancestors?: WorkflowAncestor[];
3767
+ /**
3768
+ * List of enabled processing queues. Managed by the application.
3769
+ */
3770
+ _enabled_queues?: Queue[];
3771
+ }
3772
+ export interface WebHookSpec {
3773
+ /**
3774
+ * The webhook URL to call using POST method
3775
+ */
3776
+ url: string;
3777
+ /**
3778
+ * the API version to use if any
3779
+ */
3780
+ version?: number;
3781
+ /**
3782
+ * Custom headers to include in the webhook request
3783
+ */
3784
+ headers?: Record<string, string>;
3785
+ /**
3786
+ * Additional custom data to include in the webhook body.
3787
+ * When custom data is provided, the workflow result will always be nested
3788
+ * to prevent field collisions. Use result_path to control where it's nested.
3789
+ */
3790
+ data?: Record<string, unknown>;
3791
+ /**
3792
+ * Path where the workflow result should be nested in the webhook body.
3793
+ * Defaults to "result" when custom data is provided.
3794
+ *
3795
+ * Example: With result_path="workflow_result" and data={customer_id: "123"}:
3796
+ * {
3797
+ * "workflow_result": { ...workflow result... },
3798
+ * "customer_id": "123"
3799
+ * }
3800
+ *
3801
+ * Example: With data={customer_id: "123"} but no result_path (uses default):
3802
+ * {
3803
+ * "result": { ...workflow result... },
3804
+ * "customer_id": "123"
3805
+ * }
3806
+ */
3807
+ result_path?: string;
3808
+ }
3809
+ export interface WorkflowExecutionPayload<T = Record<string, unknown>, EventName extends string = string> extends WorkflowExecutionBaseParams<T> {
3810
+ /**
3811
+ * The event which started the workflow who created the activity.
3812
+ */
3813
+ event: EventName;
3814
+ wf_rule_name?: string;
3815
+ /**
3816
+ * The ID of the target objects processed by the workflow (legacy format).
3817
+ * For backward compatibility. New workflows should use the `input` field.
3818
+ */
3819
+ objectIds?: string[];
3820
+ /**
3821
+ * New format: Workflow input (either objectIds or files).
3822
+ * Takes precedence over the legacy `objectIds` field.
3823
+ */
3824
+ input?: WorkflowInput;
3825
+ /**
3826
+ * Auth Token to access Zeno and Composable from the workers
3827
+ */
3828
+ auth_token: string;
3829
+ }
3830
+ export declare function getDocumentIds(payload: WorkflowExecutionPayload<Record<string, unknown>>): string[];
3831
+ export type ExecuteWorkflowPayload = z.infer<typeof ExecuteWorkflowPayloadSchema>;
3832
+ export type ConversationActivityState = z.infer<typeof ConversationActivityStateSchema>;
3833
+ export type ListWorkflowRunsPayload = z.infer<typeof ListWorkflowRunsPayloadSchema>;
3834
+ export type SignalEventProperties = z.infer<typeof SignalEventPropertiesSchema>;
3835
+ export type EventError = z.infer<typeof EventErrorSchema>;
3836
+ export type WorkflowRunEvent = z.infer<typeof WorkflowRunEventSchema>;
3837
+ export declare enum TaskStatus {
3838
+ SCHEDULED = "scheduled",
3839
+ RUNNING = "running",
3840
+ COMPLETED = "completed",
3841
+ FAILED = "failed",
3842
+ CANCELED = "canceled",
3843
+ TIMED_OUT = "timed_out",
3844
+ TERMINATED = "terminated",
3845
+ SENT = "sent",// for signals
3846
+ RECEIVED = "received"
3847
+ }
3848
+ export declare enum TaskType {
3849
+ ACTIVITY = "activity",
3850
+ CHILD_WORKFLOW = "childWorkflow",
3851
+ SIGNAL = "signal",
3852
+ TIMER = "timer"
3853
+ }
3854
+ export type ActivityTask = z.infer<typeof ActivityTaskSchema>;
3855
+ export type ChildWorkflowTask = z.infer<typeof ChildWorkflowTaskSchema>;
3856
+ export type SignalTask = z.infer<typeof SignalTaskSchema>;
3857
+ export type TimerTask = z.infer<typeof TimerTaskSchema>;
3858
+ export type WorkflowTask = z.infer<typeof WorkflowTaskSchema>;
3859
+ export type WorkflowHistory = z.infer<typeof WorkflowHistorySchema>;
3860
+ export type HistoryFormat = 'events' | 'tasks' | 'agent';
3861
+ export type AgentTask = z.infer<typeof AgentTaskSchema>;
3862
+ export type WorkflowRun = z.infer<typeof WorkflowRunSchema>;
3863
+ export type PendingActivity = z.infer<typeof PendingActivitySchema>;
3864
+ export type WorkflowRunWithDetails = z.infer<typeof WorkflowRunWithDetailsSchema>;
3865
+ export type ListWorkflowRunsResponse = z.infer<typeof ListWorkflowRunsResponseSchema>;
3866
+ export type WorkflowExecutionStartResult = z.infer<typeof WorkflowExecutionStartResultSchema>;
3867
+ export type ListWorkflowInteractionsResponse = z.infer<typeof ListWorkflowInteractionsResponseSchema>;
3868
+ export type WorkflowRunUpdatesResponse = z.infer<typeof WorkflowRunUpdatesResponseSchema>;
3869
+ export type WorkflowRunDetailsQuery = z.infer<typeof WorkflowRunDetailsQuerySchema>;
3870
+ export type WorkflowRunUpdatesQuery = z.infer<typeof WorkflowRunUpdatesQuerySchema>;
3871
+ export type WorkflowRunStreamQuery = z.infer<typeof WorkflowRunStreamQuerySchema>;
3872
+ export type WorkflowUpdatePublishResponse = z.infer<typeof WorkflowUpdatePublishResponseSchema>;
3873
+ export type WorkflowActionResponse = z.infer<typeof WorkflowActionResponseSchema>;
3874
+ export type WorkflowQueryResult = z.infer<typeof WorkflowQueryResultSchema>;
3875
+ export type WorkflowInteractionVars = z.infer<typeof WorkflowInteractionVarsSchema>;
3876
+ export interface MultiDocumentsInteractionParams extends Omit<WorkflowExecutionPayload, 'config'> {
3877
+ config: {
3878
+ interactionName: string;
3879
+ action: DocumentActionConfig;
3880
+ data: Record<string, unknown>;
3881
+ };
3882
+ }
3883
+ export interface DocumentActionConfig {
3884
+ contentTypeName?: string;
3885
+ setAsProperties: boolean;
3886
+ setAsText: string;
3887
+ setNameFrom: string;
3888
+ upsert: boolean;
3889
+ documentId?: string;
3890
+ parentId?: string;
3891
+ }
3892
+ export declare const WorkflowExecutionStatusValues: {
3893
+ readonly UNKNOWN: 0;
3894
+ readonly RUNNING: 1;
3895
+ readonly COMPLETED: 2;
3896
+ readonly FAILED: 3;
3897
+ readonly CANCELED: 4;
3898
+ readonly TERMINATED: 5;
3899
+ readonly CONTINUED_AS_NEW: 6;
3900
+ readonly TIMED_OUT: 7;
3901
+ };
3902
+ export declare const WorkflowExecutionStatus: typeof WorkflowExecutionStatusValues & Readonly<Record<number, string>>;
3903
+ export type WorkflowExecutionStatus = z.infer<typeof WorkflowExecutionStatusSchema>;
3904
+ /**
3905
+ * Basic response for anything run with an async workflow
3906
+ */
3907
+ export interface WorkflowRunStatus {
3908
+ workflow_id: string | null;
3909
+ workflow_run_id: string | null;
3910
+ status: WorkflowExecutionStatus;
3911
+ }
3912
+ /**
3913
+ * Workflow Update Message
3914
+ */
3915
+ export interface AgentMessage {
3916
+ timestamp: number;
3917
+ workflow_run_id: string;
3918
+ type: AgentMessageType;
3919
+ message: string;
3920
+ details?: AgentMessageDetails;
3921
+ workstream_id?: string;
3922
+ }
3923
+ export declare enum AgentMessageType {
3924
+ SYSTEM = 0,
3925
+ THOUGHT = 1,
3926
+ PLAN = 2,
3927
+ UPDATE = 3,
3928
+ COMPLETE = 4,
3929
+ WARNING = 5,
3930
+ ERROR = 6,
3931
+ ANSWER = 7,
3932
+ QUESTION = 8,
3933
+ REQUEST_INPUT = 9,
3934
+ IDLE = 10,
3935
+ TERMINATED = 11,
3936
+ STREAMING_CHUNK = 12,
3937
+ BATCH_PROGRESS = 13,
3938
+ RESTARTING = 14
3939
+ }
3940
+ export type AgentMessageDetails = z.infer<typeof AgentMessageDetailsSchema>;
3941
+ /**
3942
+ * Details for THOUGHT messages representing tool calls (event_class: 'activity').
3943
+ */
3944
+ export interface ToolCallDetails {
3945
+ event_class: 'activity';
3946
+ tool: string;
3947
+ tool_event?: 'started' | 'progress' | 'completed' | 'failed';
3948
+ tool_run_id?: string;
3949
+ tool_use_id?: string;
3950
+ tool_status?: 'running' | 'completed' | 'error' | 'warning';
3951
+ tool_iteration?: number;
3952
+ message_to_human?: string;
3953
+ duration_ms?: number;
3954
+ activity_group_id?: string;
3955
+ activity_id?: string;
3956
+ files?: string[];
3957
+ outputFiles?: string[];
3958
+ [key: string]: unknown;
3959
+ }
3960
+ /**
3961
+ * Details for UPDATE messages signaling document creation or update.
3962
+ */
3963
+ export interface DocumentEventDetails {
3964
+ event_class: 'document_created' | 'document_updated';
3965
+ document_id: string;
3966
+ title?: string;
3967
+ [key: string]: unknown;
3968
+ }
3969
+ /**
3970
+ * Details for REQUEST_INPUT messages with UX configuration.
3971
+ */
3972
+ export interface RequestInputDetails {
3973
+ ux?: {
3974
+ options?: Array<{
3975
+ id: string;
3976
+ label: string;
3977
+ }>;
3978
+ variant?: string;
3979
+ multiSelect?: boolean;
3980
+ };
3981
+ [key: string]: unknown;
3982
+ }
3983
+ /**
3984
+ * Details for PLAN messages containing the plan structure.
3985
+ */
3986
+ export interface PlanMessageDetails {
3987
+ plan: PlanTask[];
3988
+ comment?: string;
3989
+ [key: string]: unknown;
3990
+ }
3991
+ export declare function isToolCallMessage(msg: AgentMessage): msg is AgentMessage & {
3992
+ details: ToolCallDetails;
3993
+ };
3994
+ /** Extract the normalized resource references carried on a message's details, if any. */
3995
+ export declare function getResourcesFromMessage(msg: AgentMessage): AgentResourceReference[];
3996
+ export declare function isDocumentEventMessage(msg: AgentMessage): msg is AgentMessage & {
3997
+ details: DocumentEventDetails;
3998
+ };
3999
+ export declare function isFileProcessingMessage(msg: AgentMessage): msg is AgentMessage & {
4000
+ details: FileProcessingDetails;
4001
+ };
4002
+ export declare function isPlanMessage(msg: AgentMessage): msg is AgentMessage & {
4003
+ details: PlanMessageDetails;
4004
+ };
4005
+ export declare function isRequestInputMessage(msg: AgentMessage): msg is AgentMessage & {
4006
+ details: RequestInputDetails;
4007
+ };
4008
+ /**
4009
+ * Details for STREAMING_CHUNK messages used for real-time LLM response streaming
4010
+ * @deprecated Use CompactMessage with f field for streaming chunks
4011
+ */
4012
+ export interface StreamingChunkDetails {
4013
+ /** Unique identifier grouping chunks from the same stream */
4014
+ streaming_id: string;
4015
+ /** Order of this chunk within the stream (0-indexed) */
4016
+ chunk_index?: number;
4017
+ /** True if this is the final chunk of the stream */
4018
+ is_final: boolean;
4019
+ /** Activity ID for deduplication with final THOUGHT/ANSWER message */
4020
+ activity_id?: string;
4021
+ }
4022
+ /**
4023
+ * Compact message format for efficient wire transfer.
4024
+ * Primary type used throughout the system.
4025
+ * ~85% smaller than legacy AgentMessage format.
4026
+ */
4027
+ export type CompactMessage = z.infer<typeof CompactMessageSchema>;
4028
+ /**
4029
+ * Legacy message format for backward compatibility.
4030
+ * @deprecated Use CompactMessage instead
4031
+ */
4032
+ export type LegacyAgentMessage = AgentMessage;
4033
+ /**
4034
+ * Check if a message is in compact format
4035
+ */
4036
+ export declare function isCompactMessage(msg: unknown): msg is CompactMessage;
4037
+ /**
4038
+ * Check if a message is in legacy format
4039
+ */
4040
+ export declare function isLegacyMessage(msg: unknown): msg is LegacyAgentMessage;
4041
+ /**
4042
+ * Normalize message type from string or number to AgentMessageType
4043
+ */
4044
+ export declare function normalizeMessageType(type: string | number | AgentMessageType): AgentMessageType;
4045
+ /**
4046
+ * Convert legacy AgentMessage to CompactMessage
4047
+ */
4048
+ export declare function toCompactMessage(legacy: LegacyAgentMessage): CompactMessage;
4049
+ /**
4050
+ * Parse any message format (compact or legacy) into CompactMessage.
4051
+ * Use this as the entry point for all received messages.
4052
+ */
4053
+ export declare function parseMessage(data: string | object): CompactMessage;
4054
+ /**
4055
+ * Create a compact message (convenience function for server-side)
4056
+ */
4057
+ export declare function createCompactMessage(type: AgentMessageType, options?: {
4058
+ message?: string;
4059
+ workstreamId?: string;
4060
+ details?: AgentMessageDetails;
4061
+ isFinal?: boolean;
4062
+ timestamp?: number;
4063
+ }): CompactMessage;
4064
+ /**
4065
+ * Convert CompactMessage back to AgentMessage (for UI components).
4066
+ * This allows UI to continue using familiar field names while wire format is compact.
4067
+ * @param compact The compact message to convert
4068
+ * @param workflowRunId Optional workflow_run_id (known from SSE context, not in compact format)
4069
+ */
4070
+ export declare function toAgentMessage(compact: CompactMessage, workflowRunId?: string): AgentMessage;
4071
+ /**
4072
+ * Status of a single item in a batch execution
4073
+ */
4074
+ export interface BatchItemStatus {
4075
+ /** Unique identifier for this batch item */
4076
+ id: string;
4077
+ /** Current status of the item */
4078
+ status: 'pending' | 'running' | 'success' | 'error';
4079
+ /** Optional message (e.g., error message or result summary) */
4080
+ message?: string;
4081
+ /** Execution duration in milliseconds (when completed) */
4082
+ duration_ms?: number;
4083
+ }
4084
+ /**
4085
+ * Details for BATCH_PROGRESS messages used for batch tool execution progress
4086
+ */
4087
+ export interface BatchProgressDetails {
4088
+ /** Unique identifier for this batch execution */
4089
+ batch_id: string;
4090
+ /** Name of the tool being batch executed */
4091
+ tool_name: string;
4092
+ /** Total number of items in the batch */
4093
+ total: number;
4094
+ /** Number of items completed */
4095
+ completed: number;
4096
+ /** Number of items that succeeded */
4097
+ succeeded: number;
4098
+ /** Number of items that failed */
4099
+ failed: number;
4100
+ /** Status of individual items */
4101
+ items: BatchItemStatus[];
4102
+ /** Timestamp when batch started */
4103
+ started_at: number;
4104
+ /** Timestamp when batch completed (if done) */
4105
+ completed_at?: number;
4106
+ }
4107
+ /**
4108
+ * Status of a file being processed for conversation use.
4109
+ */
4110
+ export declare enum FileProcessingStatus {
4111
+ /** File is being uploaded to artifact storage */
4112
+ UPLOADING = "uploading",
4113
+ /** File uploaded, text extraction in progress */
4114
+ PROCESSING = "processing",
4115
+ /** File is ready for use in conversation */
4116
+ READY = "ready",
4117
+ /** File processing failed */
4118
+ ERROR = "error"
4119
+ }
4120
+ export type ConversationFile = z.infer<typeof ConversationFileSchema>;
4121
+ /**
4122
+ * Details for file processing SYSTEM messages.
4123
+ * Used when type is AgentMessageType.SYSTEM with system_type: 'file_processing'.
4124
+ */
4125
+ export interface FileProcessingDetails {
4126
+ /** Discriminator for SYSTEM message subtypes */
4127
+ system_type: 'file_processing';
4128
+ /** Batch ID for grouping related file operations */
4129
+ batch_id: string;
4130
+ /** All files in this batch with their current status */
4131
+ files: ConversationFile[];
4132
+ /** Number of files still being processed */
4133
+ pending_count: number;
4134
+ /** Number of files ready for use */
4135
+ ready_count: number;
4136
+ /** Number of files that failed */
4137
+ error_count: number;
4138
+ }
4139
+ /**
4140
+ * Reference to a file uploaded via the UI for conversation use.
4141
+ */
4142
+ export interface ConversationFileRef {
4143
+ /** Client-generated unique ID */
4144
+ id: string;
4145
+ /** Original filename */
4146
+ name: string;
4147
+ /** MIME type */
4148
+ content_type: string;
4149
+ /** Artifact reference (e.g., "artifact:files/document.pdf") */
4150
+ reference: string;
4151
+ /** Artifact path without prefix (e.g., "files/document.pdf") */
4152
+ artifact_path: string;
4153
+ }
4154
+ /**
4155
+ * Reference to a file removed from the conversation attachment set.
4156
+ */
4157
+ export interface ConversationFileRemovedRef {
4158
+ /** Client-generated unique ID */
4159
+ id: string;
4160
+ }
4161
+ /**
4162
+ * Get the Redis pub/sub channel name for workflow messages.
4163
+ * Used by both publishers (workflow activities, studio-server) and subscribers (zeno-server, clients).
4164
+ * @param workflowRunId - The Temporal workflow run ID (NOT the interaction execution run ID)
4165
+ */
4166
+ export declare function getWorkflowChannel(workflowRunId: string): string;
4167
+ /**
4168
+ * Get the Redis list key for storing workflow message history.
4169
+ * Messages are stored here for retrieval by reconnecting clients.
4170
+ * @param workflowRunId - The Temporal workflow run ID (NOT the interaction execution run ID)
4171
+ */
4172
+ export declare function getWorkflowUpdatesKey(workflowRunId: string): string;
4173
+ export type PlanTask = z.infer<typeof PlanTaskSchema>;
4174
+ export type Plan = z.infer<typeof PlanSchema>;
4175
+ export declare const LOW_PRIORITY_TASK_QUEUE = "low_priority";
4176
+ /**
4177
+ * WebSocket message types for bidirectional communication
4178
+ */
4179
+ export interface WebSocketSignalMessage {
4180
+ type: 'signal';
4181
+ signalName: string;
4182
+ data: unknown;
4183
+ requestId?: string | number;
4184
+ }
4185
+ export interface WebSocketPingMessage {
4186
+ type: 'ping';
4187
+ }
4188
+ export interface WebSocketPongMessage {
4189
+ type: 'pong';
4190
+ }
4191
+ export interface WebSocketAckMessage {
4192
+ type: 'ack';
4193
+ requestId: string | number;
4194
+ }
4195
+ export interface WebSocketErrorMessage {
4196
+ type: 'error';
4197
+ requestId?: string | number;
4198
+ error: string;
4199
+ }
4200
+ export type WebSocketClientMessage = WebSocketSignalMessage | WebSocketPingMessage;
4201
+ export type WebSocketServerMessage = WebSocketPongMessage | WebSocketAckMessage | WebSocketErrorMessage | AgentMessage;
4202
+ /**
4203
+ * Payload for applying actions to a workflow run (e.g., cancel, terminate).
4204
+ */
4205
+ export interface WorkflowActionPayload {
4206
+ /**
4207
+ * Optional reason for the action.
4208
+ */
4209
+ reason?: string;
4210
+ }
4211
+ /**
4212
+ * Parameters for the AgentIntakeWorkflow.
4213
+ * This workflow uses an intelligent agent to process documents:
4214
+ * - Select or create appropriate content types
4215
+ * - Extract properties using schema-enforced interactions
4216
+ * - File documents into relevant collections
4217
+ */
4218
+ export interface AgentIntakeWorkflowParams {
4219
+ /**
4220
+ * The interaction to use for document intake agent.
4221
+ * Defaults to "sys:DocumentIntakeAgent" if not specified.
4222
+ * Can be overridden with a project-level interaction.
4223
+ */
4224
+ intakeInteraction?: string;
4225
+ /**
4226
+ * The interaction to use for property extraction.
4227
+ * Defaults to "sys:ExtractInformation" if not specified.
4228
+ * Can be overridden with a project-level interaction.
4229
+ */
4230
+ extractionInteraction?: string;
4231
+ /**
4232
+ * Whether to generate table of contents for documents.
4233
+ * Defaults to true for documents, false for images/videos.
4234
+ */
4235
+ generateTableOfContents?: boolean;
4236
+ /**
4237
+ * Whether to generate embeddings after processing.
4238
+ * Defaults to true.
4239
+ */
4240
+ generateEmbeddings?: boolean;
4241
+ /**
4242
+ * Max iterations for the agent workflow.
4243
+ * Defaults to 50.
4244
+ */
4245
+ maxIterations?: number;
4246
+ /**
4247
+ * Environment ID for LLM execution.
4248
+ */
4249
+ environment?: string;
4250
+ /**
4251
+ * Model to use for the agent.
4252
+ */
4253
+ model?: string;
4254
+ /**
4255
+ * Additional model options.
4256
+ */
4257
+ model_options?: ModelOptions;
4258
+ /**
4259
+ * Per-run HTTP timeouts for upstream LLM-provider calls.
4260
+ */
4261
+ http_timeout?: HttpTimeoutOptions;
4262
+ /**
4263
+ * LLM execution config. Prefer this for event-subscription-driven execution settings.
4264
+ */
4265
+ config?: InteractionExecutionConfiguration;
4266
+ /**
4267
+ * Whether to use semantic layer (MagicPDF) for PDF processing.
4268
+ */
4269
+ useSemanticLayer?: boolean;
4270
+ /**
4271
+ * Whether to use vision for image-based extraction.
4272
+ */
4273
+ useVision?: boolean;
4274
+ }
4275
+ /**
4276
+ * Result of the AgentIntakeWorkflow
4277
+ */
4278
+ export interface AgentIntakeWorkflowResult {
4279
+ /** The object ID that was processed */
4280
+ objectId: string;
4281
+ /** Whether text was extracted */
4282
+ hasText: boolean;
4283
+ /** Whether table of contents was generated */
4284
+ hasTableOfContents: boolean;
4285
+ /** The type ID assigned to the document */
4286
+ typeId?: string;
4287
+ /** Whether properties were extracted */
4288
+ hasProperties: boolean;
4289
+ /** Collection IDs the document was added to */
4290
+ collectionIds?: string[];
4291
+ /** Whether embeddings were generated */
4292
+ hasEmbeddings: boolean;
4293
+ /** Embedding kinds that were actually generated. Skipped or failed activity results are omitted. */
4294
+ generatedEmbeddings?: SupportedEmbeddingTypes[];
4295
+ }
4296
+ /** Progress reported by a child workstream */
4297
+ export interface WorkstreamProgressInfo {
4298
+ launch_id: string;
4299
+ workstream_id: string;
4300
+ phase: 'planning' | 'executing_tool' | 'synthesizing' | 'blocked' | 'done';
4301
+ current_step?: string;
4302
+ current_tool?: string;
4303
+ percent?: number;
4304
+ updated_at: number;
4305
+ }
4306
+ /** Entry returned by the ActiveWorkstreams query */
4307
+ export interface ActiveWorkstreamEntry {
4308
+ launch_id: string;
4309
+ workstream_id: string;
4310
+ kind?: 'agent' | 'process';
4311
+ interaction: string;
4312
+ started_at: number;
4313
+ elapsed_ms: number;
4314
+ deadline_ms: number;
4315
+ status: 'running' | 'canceling';
4316
+ latest_progress?: WorkstreamProgressInfo;
4317
+ /** Child workflow ID — use to fetch per-workstream messages */
4318
+ child_workflow_id: string;
4319
+ /** Child workflow run ID — use with retrieveMessages / streamMessages */
4320
+ child_workflow_run_id?: string;
4321
+ process_run_id?: string;
4322
+ process_workflow_id?: string;
4323
+ process_name?: string;
4324
+ process_run_type?: 'programmatic' | 'supervised';
4325
+ }
4326
+ /** Recently completed workstream entry returned by the ActiveWorkstreams query */
4327
+ export interface CompletedWorkstreamEntry {
4328
+ launch_id: string;
4329
+ workstream_id: string;
4330
+ kind?: 'agent' | 'process';
4331
+ status: 'completed' | 'failed' | 'canceled' | 'timeout';
4332
+ summary?: string;
4333
+ error?: string;
4334
+ duration_ms?: number;
4335
+ started_at?: number;
4336
+ interaction?: string;
4337
+ last_progress?: WorkstreamProgressInfo;
4338
+ child_workflow_id?: string;
4339
+ child_workflow_run_id?: string;
4340
+ process_run_id?: string;
4341
+ process_workflow_id?: string;
4342
+ process_name?: string;
4343
+ }
4344
+ /** Result of the ActiveWorkstreams Temporal query */
4345
+ export interface ActiveWorkstreamsQueryResult {
4346
+ running: ActiveWorkstreamEntry[];
4347
+ completed?: CompletedWorkstreamEntry[];
4348
+ /** True when the workflow could not answer this optional query. */
4349
+ unavailable?: boolean;
4350
+ }
4351
+
4352
+ // -----------------------------------------------------------------------------
4353
+ // @vertesia/common: tool-execution.d.ts
4354
+ // -----------------------------------------------------------------------------
4355
+ /**
4356
+ * Types for tool execution payloads shared between workflows and tool servers
4357
+ */
4358
+ /**
4359
+ * Endpoint configuration that can override JWT-embedded endpoints
4360
+ */
4361
+ export interface ToolEndpointOverrides {
4362
+ /**
4363
+ * Studio server URL
4364
+ */
4365
+ studio?: string;
4366
+ /**
4367
+ * Store/Zeno server URL
4368
+ */
4369
+ store?: string;
4370
+ /**
4371
+ * Token server URL
4372
+ */
4373
+ token?: string;
4374
+ }
4375
+ /**
4376
+ * Metadata passed with tool execution requests from workflows to tool servers
4377
+ */
4378
+ export interface ToolExecutionMetadata {
4379
+ /**
4380
+ * Workflow run ID
4381
+ */
4382
+ run_id?: string;
4383
+ /**
4384
+ * Conversation storage ID for artifact operations
4385
+ */
4386
+ conversation_storage_id?: string;
4387
+ /**
4388
+ * App installation ID
4389
+ */
4390
+ app_install_id?: string;
4391
+ /**
4392
+ * App-specific settings
4393
+ */
4394
+ app_settings?: Record<string, unknown>;
4395
+ /**
4396
+ * Endpoint overrides from workflow config (takes precedence over JWT endpoints)
4397
+ */
4398
+ endpoints?: ToolEndpointOverrides;
4399
+ /**
4400
+ * Additional metadata fields
4401
+ */
4402
+ [key: string]: unknown;
4403
+ }
4404
+