@vertesia/common 1.0.0-dev.20260305.083323Z → 1.0.0-dev.20260331.091034Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/apps.js +19 -0
- package/lib/cjs/apps.js.map +1 -1
- package/lib/cjs/environment.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interaction.js +2 -0
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/oauth.js +7 -0
- package/lib/cjs/oauth.js.map +1 -0
- package/lib/cjs/project.js.map +1 -1
- package/lib/cjs/store/agent-run.js +16 -0
- package/lib/cjs/store/agent-run.js.map +1 -0
- package/lib/cjs/store/conversation-state.js +16 -0
- package/lib/cjs/store/conversation-state.js.map +1 -1
- package/lib/cjs/store/dsl-workflow.js.map +1 -1
- package/lib/cjs/store/index.js +1 -0
- package/lib/cjs/store/index.js.map +1 -1
- package/lib/cjs/store/store.js.map +1 -1
- package/lib/cjs/store/workflow.js +1 -0
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/cjs/utils/schemas.js +45 -1
- package/lib/cjs/utils/schemas.js.map +1 -1
- package/lib/cjs/versions.js +1 -0
- package/lib/cjs/versions.js.map +1 -1
- package/lib/esm/apps.js +17 -0
- package/lib/esm/apps.js.map +1 -1
- package/lib/esm/environment.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interaction.js +3 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/oauth.js +6 -0
- package/lib/esm/oauth.js.map +1 -0
- package/lib/esm/project.js.map +1 -1
- package/lib/esm/store/agent-run.js +15 -0
- package/lib/esm/store/agent-run.js.map +1 -0
- package/lib/esm/store/conversation-state.js +15 -1
- package/lib/esm/store/conversation-state.js.map +1 -1
- package/lib/esm/store/dsl-workflow.js.map +1 -1
- package/lib/esm/store/index.js +1 -0
- package/lib/esm/store/index.js.map +1 -1
- package/lib/esm/store/store.js.map +1 -1
- package/lib/esm/store/workflow.js +1 -0
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/esm/utils/schemas.js +44 -1
- package/lib/esm/utils/schemas.js.map +1 -1
- package/lib/esm/versions.js +1 -0
- package/lib/esm/versions.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/apps.d.ts +152 -29
- package/lib/types/apps.d.ts.map +1 -1
- package/lib/types/audit-trail.d.ts +1 -1
- package/lib/types/audit-trail.d.ts.map +1 -1
- package/lib/types/common.d.ts +28 -1
- package/lib/types/common.d.ts.map +1 -1
- package/lib/types/environment.d.ts +10 -0
- package/lib/types/environment.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/interaction.d.ts +58 -5
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/oauth.d.ts +103 -0
- package/lib/types/oauth.d.ts.map +1 -0
- package/lib/types/payload.d.ts +13 -0
- package/lib/types/payload.d.ts.map +1 -1
- package/lib/types/project.d.ts +105 -44
- package/lib/types/project.d.ts.map +1 -1
- package/lib/types/query.d.ts +2 -0
- package/lib/types/query.d.ts.map +1 -1
- package/lib/types/runs.d.ts +14 -0
- package/lib/types/runs.d.ts.map +1 -1
- package/lib/types/store/agent-run.d.ts +256 -0
- package/lib/types/store/agent-run.d.ts.map +1 -0
- package/lib/types/store/conversation-state.d.ts +21 -0
- package/lib/types/store/conversation-state.d.ts.map +1 -1
- package/lib/types/store/dsl-workflow.d.ts +24 -6
- package/lib/types/store/dsl-workflow.d.ts.map +1 -1
- package/lib/types/store/index.d.ts +1 -0
- package/lib/types/store/index.d.ts.map +1 -1
- package/lib/types/store/signals.d.ts +5 -5
- package/lib/types/store/signals.d.ts.map +1 -1
- package/lib/types/store/store.d.ts +22 -0
- package/lib/types/store/store.d.ts.map +1 -1
- package/lib/types/store/workflow.d.ts +59 -10
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/types/utils/schemas.d.ts +7 -0
- package/lib/types/utils/schemas.d.ts.map +1 -1
- package/lib/types/versions.d.ts +2 -1
- package/lib/types/versions.d.ts.map +1 -1
- package/lib/types/workflow-analytics.d.ts +5 -1
- package/lib/types/workflow-analytics.d.ts.map +1 -1
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/package.json +2 -2
- package/src/apps.ts +179 -31
- package/src/audit-trail.ts +1 -0
- package/src/common.ts +24 -1
- package/src/environment.ts +10 -0
- package/src/index.ts +1 -0
- package/src/interaction.ts +69 -9
- package/src/oauth.ts +119 -0
- package/src/payload.ts +15 -0
- package/src/project.ts +111 -46
- package/src/query.ts +2 -0
- package/src/runs.ts +15 -0
- package/src/store/agent-run.ts +350 -0
- package/src/store/conversation-state.ts +33 -0
- package/src/store/dsl-workflow.ts +26 -6
- package/src/store/index.ts +1 -0
- package/src/store/signals.ts +5 -5
- package/src/store/store.ts +22 -0
- package/src/store/workflow.ts +70 -10
- package/src/utils/schemas.ts +49 -1
- package/src/versions.ts +1 -0
- package/src/workflow-analytics.ts +5 -1
- package/tsconfig.dist.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/common",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.20260331.091034Z",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/types/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"ajv": "^8.17.1",
|
|
29
|
-
"@llumiverse/common": "1.0.0-dev.
|
|
29
|
+
"@llumiverse/common": "1.0.0-dev.20260331.080752Z"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
package/src/apps.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSONSchema, ToolDefinition } from "@llumiverse/common";
|
|
2
2
|
import { CatalogInteractionRef } from "./interaction.js";
|
|
3
|
-
import { InCodeTypeDefinition } from "./store/index.js";
|
|
3
|
+
import { DSLActivityOptions, InCodeTypeDefinition } from "./store/index.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Additional navigation item for an app's UI configuration.
|
|
@@ -14,6 +14,10 @@ export interface AppUINavItem {
|
|
|
14
14
|
icon: string;
|
|
15
15
|
/** Route path relative to app base */
|
|
16
16
|
route: string;
|
|
17
|
+
/** Nested sub-items displayed within this item's collapsible section */
|
|
18
|
+
children?: AppUINavItem[];
|
|
19
|
+
/** When true, this item appears as an independent entry in the sidebar (outside its parent app group) */
|
|
20
|
+
topLevel?: boolean;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
export interface AppUIConfig {
|
|
@@ -91,6 +95,14 @@ export interface MCPToolCollectionObject extends BaseToolCollectionObject {
|
|
|
91
95
|
* Provides clean, readable tool names (e.g., "jira" instead of "https://mcp.atlassian.com/v1/mcp")
|
|
92
96
|
*/
|
|
93
97
|
namespace: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Reference to an OAuth Application name for this collection.
|
|
101
|
+
* When set, uses the OAuth Application's config (endpoints, client_id, client_secret)
|
|
102
|
+
* instead of MCP dynamic client registration or random fallback.
|
|
103
|
+
* The referenced OAuth Application must exist in the same project.
|
|
104
|
+
*/
|
|
105
|
+
oauth_app?: string;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
108
|
/**
|
|
@@ -190,6 +202,33 @@ export interface AgentToolDefinition extends ToolDefinition {
|
|
|
190
202
|
related_tools?: string[];
|
|
191
203
|
}
|
|
192
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Definition of a remote activity exposed by a tool server for use in DSL workflows.
|
|
207
|
+
* Remote activities are identified in workflow steps using colon-separated names:
|
|
208
|
+
* `app:<app_name>:<collection>:<activity_name>` (e.g. `app:my-nlp-app:examples:word_count`).
|
|
209
|
+
*/
|
|
210
|
+
export interface RemoteActivityDefinition {
|
|
211
|
+
/** Activity name (snake_case, unique within the collection) */
|
|
212
|
+
name: string;
|
|
213
|
+
/** Collection name this activity belongs to */
|
|
214
|
+
collection?: string;
|
|
215
|
+
/** Display title */
|
|
216
|
+
title?: string;
|
|
217
|
+
/** Description of what the activity does */
|
|
218
|
+
description?: string;
|
|
219
|
+
/** JSON Schema for the activity input parameters */
|
|
220
|
+
input_schema?: Record<string, any>;
|
|
221
|
+
/** JSON Schema for the activity output */
|
|
222
|
+
output_schema?: Record<string, any>;
|
|
223
|
+
/**
|
|
224
|
+
* The activity execution URL. Can be absolute or relative to the tool server base URL.
|
|
225
|
+
* If not provided, the collection-specific activities endpoint is used.
|
|
226
|
+
*/
|
|
227
|
+
url?: string;
|
|
228
|
+
/** Suggested timeout and retry configuration */
|
|
229
|
+
options?: DSLActivityOptions;
|
|
230
|
+
}
|
|
231
|
+
|
|
193
232
|
export type AppCapabilities = 'ui' | 'tools' | 'interactions' | 'types' | 'templates';
|
|
194
233
|
export type AppAvailableIn = 'app_portal' | 'composite_app';
|
|
195
234
|
export interface AppManifestData {
|
|
@@ -278,8 +317,39 @@ export interface AppManifestData {
|
|
|
278
317
|
* - ?scope=ui,tools - returns only the UI configuration
|
|
279
318
|
*/
|
|
280
319
|
endpoint?: string;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Optional endpoint overrides keyed by environment name.
|
|
323
|
+
* When resolving the app endpoint, if the current environment name matches a key,
|
|
324
|
+
* the corresponding URL is used instead of the main `endpoint`.
|
|
325
|
+
* Only dev environment names are allowed as keys (starting with "desktop-" or "dev-").
|
|
326
|
+
*/
|
|
327
|
+
endpoint_overrides?: Record<string, string>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Returns true if the given environment name is allowed as an endpoint override key.
|
|
332
|
+
* Only "desktop-" or "dev-" prefixed names are valid.
|
|
333
|
+
*/
|
|
334
|
+
export function isValidEndpointOverrideEnv(envName: string): boolean {
|
|
335
|
+
return envName.startsWith('desktop-') || envName.startsWith('dev-');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Resolves the effective endpoint for an app given an optional environment name.
|
|
340
|
+
* Returns the override endpoint if the env name matches a valid dev environment, otherwise the default endpoint.
|
|
341
|
+
*/
|
|
342
|
+
export function resolveAppEndpoint(
|
|
343
|
+
manifest: Pick<AppManifestData, 'endpoint' | 'endpoint_overrides'>,
|
|
344
|
+
envName?: string
|
|
345
|
+
): string | undefined {
|
|
346
|
+
if (envName && manifest.endpoint_overrides?.[envName] && isValidEndpointOverrideEnv(envName)) {
|
|
347
|
+
return manifest.endpoint_overrides[envName];
|
|
348
|
+
}
|
|
349
|
+
return manifest.endpoint;
|
|
281
350
|
}
|
|
282
|
-
|
|
351
|
+
|
|
352
|
+
export type AppPackageScope = 'ui' | 'tools' | 'interactions' | 'types' | 'templates' | 'settings' | 'widgets' | 'activities' | 'all';
|
|
283
353
|
export interface AppPackage {
|
|
284
354
|
/**
|
|
285
355
|
* The UI configuration of the app
|
|
@@ -311,6 +381,13 @@ export interface AppPackage {
|
|
|
311
381
|
*/
|
|
312
382
|
widgets?: Record<string, AppWidgetInfo>;
|
|
313
383
|
|
|
384
|
+
/**
|
|
385
|
+
* Remote activities exposed by the app for use in DSL workflows.
|
|
386
|
+
* Activities are discovered via `?scope=activities` and referenced in workflow steps
|
|
387
|
+
* using colon-separated names: `app:<app_name>:<collection>:<activity_name>`.
|
|
388
|
+
*/
|
|
389
|
+
activities?: RemoteActivityDefinition[];
|
|
390
|
+
|
|
314
391
|
/**
|
|
315
392
|
* A JSON chema for the app installation settings.
|
|
316
393
|
*/
|
|
@@ -349,7 +426,8 @@ export type RenderingTemplateDefinitionRef = Omit<RenderingTemplateDefinition, '
|
|
|
349
426
|
|
|
350
427
|
export interface AppManifest extends AppManifestData {
|
|
351
428
|
id: string;
|
|
352
|
-
account
|
|
429
|
+
/** The owning account. Undefined for apps imported from a master region. */
|
|
430
|
+
account?: string;
|
|
353
431
|
created_at: string;
|
|
354
432
|
updated_at: string;
|
|
355
433
|
}
|
|
@@ -460,35 +538,13 @@ export interface OAuthMetadataResponse {
|
|
|
460
538
|
// multiple apps into a unified experience with shared navigation and branding.
|
|
461
539
|
// ============================================================================
|
|
462
540
|
|
|
463
|
-
/**
|
|
464
|
-
* App navigation item display overrides.
|
|
465
|
-
* Allows customizing individual nav items for an app installation within the CompositeApp shell.
|
|
466
|
-
*/
|
|
467
|
-
export interface CompositeAppNavItemOverride {
|
|
468
|
-
/** Used as identifier to match the nav item to override -- does not change route path */
|
|
469
|
-
route: string;
|
|
470
|
-
/** Hide this nav item from the sidebar */
|
|
471
|
-
hidden?: boolean;
|
|
472
|
-
/** Override the displayed nav item label */
|
|
473
|
-
label?: string;
|
|
474
|
-
/** Override the displayed nav item icon (Lucide icon name or SVG content string) */
|
|
475
|
-
icon?: string;
|
|
476
|
-
//TODO: Set permissions for routes
|
|
477
|
-
}
|
|
478
|
-
|
|
479
541
|
/**
|
|
480
542
|
* Configuration entry for an individual app in the CompositeApp shell.
|
|
481
|
-
* References an app installation by name
|
|
543
|
+
* References an app installation by name.
|
|
482
544
|
*/
|
|
483
545
|
export interface CompositeAppEntry {
|
|
484
546
|
/** App installation name (must match an installed app) */
|
|
485
547
|
appName: string;
|
|
486
|
-
/** Override the label displayed for the app */
|
|
487
|
-
labelOverride?: string;
|
|
488
|
-
/** Override the icon displayed for the app (Lucide icon name or SVG content string) */
|
|
489
|
-
iconOverride?: string;
|
|
490
|
-
/** Overrides for navigation items provided by the app */
|
|
491
|
-
navigationOverrides?: CompositeAppNavItemOverride[];
|
|
492
548
|
}
|
|
493
549
|
|
|
494
550
|
/**
|
|
@@ -520,10 +576,40 @@ export interface CompositeAppMessageOverrides {
|
|
|
520
576
|
* Switcher visibility overrides for the CompositeApp header.
|
|
521
577
|
*/
|
|
522
578
|
export interface CompositeAppSwitchersOverrides {
|
|
523
|
-
/** Whether to
|
|
524
|
-
|
|
525
|
-
/** Whether to
|
|
526
|
-
|
|
579
|
+
/** Whether to hide the organization switcher (defaults to false) */
|
|
580
|
+
hideOrganization?: boolean;
|
|
581
|
+
/** Whether to hide the project switcher (defaults to false) */
|
|
582
|
+
hideProject?: boolean;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Header button visibility overrides for the CompositeApp header.
|
|
587
|
+
*/
|
|
588
|
+
export interface CompositeAppHeaderOverrides {
|
|
589
|
+
/** Whether to hide the App Portal button (defaults to false) */
|
|
590
|
+
hideAppPortal?: boolean;
|
|
591
|
+
/** Whether to hide the Docs button (defaults to false) */
|
|
592
|
+
hideDocs?: boolean;
|
|
593
|
+
/** Whether to hide the Help button (defaults to false) */
|
|
594
|
+
hideHelp?: boolean;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* User menu overrides for the CompositeApp.
|
|
599
|
+
*/
|
|
600
|
+
export interface CompositeAppUserMenuOverrides {
|
|
601
|
+
/** Whether to hide the User Menu (defaults to false) */
|
|
602
|
+
hidden?: boolean;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Sidebar display overrides for the CompositeApp.
|
|
607
|
+
*/
|
|
608
|
+
export interface CompositeAppSidebarOverrides {
|
|
609
|
+
/** Whether to hide section title headers in the sidebar (defaults to false) */
|
|
610
|
+
hideSectionHeaders?: boolean;
|
|
611
|
+
/** Whether menu items auto-collapse when navigating (accordion behavior). When false, all items stay expanded. Defaults to true. */
|
|
612
|
+
autoCollapse?: boolean;
|
|
527
613
|
}
|
|
528
614
|
|
|
529
615
|
/**
|
|
@@ -545,6 +631,54 @@ export interface CompositeAppCardOverrides {
|
|
|
545
631
|
color?: string;
|
|
546
632
|
}
|
|
547
633
|
|
|
634
|
+
// ============================================================================
|
|
635
|
+
// Sidebar Menu Types
|
|
636
|
+
// ============================================================================
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* A navigable item in the sidebar menu.
|
|
640
|
+
* An "app" is just a nav-item with `appName` + `route: "/"` that has children.
|
|
641
|
+
* Nav-items carry their own `appName` for routing, independent of position in the tree.
|
|
642
|
+
*/
|
|
643
|
+
export interface CompositeAppMenuNavItem {
|
|
644
|
+
/** Stable unique identifier */
|
|
645
|
+
id: string;
|
|
646
|
+
/** Display label shown in the sidebar */
|
|
647
|
+
label: string;
|
|
648
|
+
/** Lucide icon name or SVG content string */
|
|
649
|
+
icon?: string;
|
|
650
|
+
/** Which installed app this item routes to */
|
|
651
|
+
appName?: string;
|
|
652
|
+
/** Route path within the app (e.g. "/" or "/dashboard") */
|
|
653
|
+
route?: string;
|
|
654
|
+
/** When true, this item is hidden from the sidebar */
|
|
655
|
+
hidden?: boolean;
|
|
656
|
+
/** Ordered child nav-items */
|
|
657
|
+
children?: CompositeAppMenuNavItem[];
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* A top-level section heading in the sidebar menu.
|
|
662
|
+
* Sections are always at root level and contain nav-items.
|
|
663
|
+
*/
|
|
664
|
+
export interface CompositeAppMenuSection {
|
|
665
|
+
/** Stable unique identifier */
|
|
666
|
+
id: string;
|
|
667
|
+
/** Section heading label */
|
|
668
|
+
label: string;
|
|
669
|
+
/** When true, this section and its items are hidden from the sidebar */
|
|
670
|
+
hidden?: boolean;
|
|
671
|
+
/** Ordered nav-items within this section */
|
|
672
|
+
items: CompositeAppMenuNavItem[];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export interface CompositeAppHomePlugin {
|
|
676
|
+
/** The app name to use as the home page */
|
|
677
|
+
appName: string;
|
|
678
|
+
/** Optional route within the app (e.g. "/dashboard"). Defaults to "/" */
|
|
679
|
+
appRoute?: string;
|
|
680
|
+
}
|
|
681
|
+
|
|
548
682
|
/**
|
|
549
683
|
* CompositeApp shell configuration.
|
|
550
684
|
* This is the main configuration interface for storing CompositeApp settings.
|
|
@@ -566,8 +700,22 @@ export interface CompositeAppConfig {
|
|
|
566
700
|
message?: CompositeAppMessageOverrides;
|
|
567
701
|
/** Optional switcher visibility overrides */
|
|
568
702
|
switchers?: CompositeAppSwitchersOverrides;
|
|
569
|
-
/**
|
|
703
|
+
/** Optional sidebar display overrides */
|
|
704
|
+
sidebar?: CompositeAppSidebarOverrides;
|
|
705
|
+
/** Optional header button visibility overrides */
|
|
706
|
+
header?: CompositeAppHeaderOverrides;
|
|
707
|
+
/** Optional user menu overrides */
|
|
708
|
+
userMenu?: CompositeAppUserMenuOverrides;
|
|
709
|
+
/** Optional home page override. When set, redirects "/" to the specified app route instead of the dashboard. Send null to unset. */
|
|
710
|
+
homePlugin?: CompositeAppHomePlugin | null;
|
|
711
|
+
/** List of apps to include in the CompositeApp (used for installation tracking and fallback sidebar) */
|
|
570
712
|
apps: CompositeAppEntry[];
|
|
713
|
+
/**
|
|
714
|
+
* Optional sidebar menu. When present, the sidebar renders from this
|
|
715
|
+
* instead of the apps-based pipeline. Top-level array is sections;
|
|
716
|
+
* each section contains nav-items.
|
|
717
|
+
*/
|
|
718
|
+
menu?: CompositeAppMenuSection[];
|
|
571
719
|
}
|
|
572
720
|
|
|
573
721
|
export type CompositeAppConfigPayload = Partial<Omit<CompositeAppConfig, 'id' | 'project'>>;
|
package/src/audit-trail.ts
CHANGED
package/src/common.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface BulkOperationPayload {
|
|
|
19
19
|
/**
|
|
20
20
|
* The operation name
|
|
21
21
|
*/
|
|
22
|
-
name: "change_type" | "delete" | "start_workflow" | "update";
|
|
22
|
+
name: "change_type" | "create" | "delete" | "start_workflow" | "update";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The IDs of the objects to operate on
|
|
@@ -35,3 +35,26 @@ export interface BulkOperationPayload {
|
|
|
35
35
|
export interface BulkOperationResult {
|
|
36
36
|
status: "in_progress" | "completed" | "failed";
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
export interface BulkObjectDeleteResult extends BulkOperationResult {
|
|
40
|
+
/** Number of documents deleted (including revisions) */
|
|
41
|
+
deleted: number;
|
|
42
|
+
/** IDs that were not found or user had no permission to delete */
|
|
43
|
+
failed: string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface BulkObjectUpdateResult extends BulkOperationResult {
|
|
47
|
+
/** Number of documents successfully updated */
|
|
48
|
+
updated: number;
|
|
49
|
+
/** IDs that were not found, not authorized, or failed to update */
|
|
50
|
+
failed: string[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface BulkObjectCreateResult extends BulkOperationResult {
|
|
54
|
+
/** Number of documents successfully created */
|
|
55
|
+
created: number;
|
|
56
|
+
/** Successfully created objects with their IDs */
|
|
57
|
+
objects: { id: string; external_id?: string }[];
|
|
58
|
+
/** Objects that failed to create */
|
|
59
|
+
failed: { external_id?: string; index: number; error: string }[];
|
|
60
|
+
}
|
package/src/environment.ts
CHANGED
|
@@ -85,7 +85,17 @@ export interface ExecutionEnvironment {
|
|
|
85
85
|
default_model?: string;
|
|
86
86
|
enabled_models?: AIModel[];
|
|
87
87
|
apiKey?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Hint showing first and last characters of the API key (e.g. "AKIA...3xQf").
|
|
90
|
+
* Stored alongside the encrypted key so the UI can display which key is configured.
|
|
91
|
+
*/
|
|
92
|
+
apikey_hint?: string;
|
|
88
93
|
config?: any;
|
|
94
|
+
/**
|
|
95
|
+
* Additional provider-specific settings passed through to the driver.
|
|
96
|
+
* For example, custom headers for Apigee-proxied endpoints.
|
|
97
|
+
*/
|
|
98
|
+
settings?: Record<string, unknown>;
|
|
89
99
|
account: string;
|
|
90
100
|
allowed_projects?: string[];
|
|
91
101
|
created_by: string,
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './environment.js';
|
|
|
11
11
|
export * from "./facets.js";
|
|
12
12
|
export * from './group.js';
|
|
13
13
|
export * from './integrations.js';
|
|
14
|
+
export * from './oauth.js';
|
|
14
15
|
export * from './interaction.js';
|
|
15
16
|
export * from './pending-asks.js';
|
|
16
17
|
export * from './json-schema.js';
|
package/src/interaction.ts
CHANGED
|
@@ -53,6 +53,17 @@ export interface ConversationStripOptions {
|
|
|
53
53
|
* Uses ~4 characters per token estimate.
|
|
54
54
|
*/
|
|
55
55
|
text_max_tokens?: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Number of turns to keep heartbeat messages before stripping them.
|
|
59
|
+
* Heartbeat messages are periodic workstream status updates wrapped in
|
|
60
|
+
* `<heartbeat>...</heartbeat>` tags that clutter conversation history.
|
|
61
|
+
* - 0: Strip heartbeats immediately after each turn
|
|
62
|
+
* - 1 (default): Keep only the most recent heartbeat
|
|
63
|
+
* - N > 0: Keep heartbeats for N turns before stripping
|
|
64
|
+
* - Infinity: Never strip heartbeats
|
|
65
|
+
*/
|
|
66
|
+
heartbeats_after_turns?: number;
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
|
|
@@ -406,6 +417,7 @@ export interface InteractionData {
|
|
|
406
417
|
model?: string;
|
|
407
418
|
model_options?: ModelOptions;
|
|
408
419
|
restriction?: RunDataStorageLevel;
|
|
420
|
+
|
|
409
421
|
/**
|
|
410
422
|
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
411
423
|
*/
|
|
@@ -642,15 +654,13 @@ export interface AgentRunnerOptions {
|
|
|
642
654
|
// Import for local use
|
|
643
655
|
import type { UserChannel } from "./email.js";
|
|
644
656
|
// Re-exported from email.ts for backwards compatibility
|
|
645
|
-
export type {
|
|
646
|
-
EmailChannel,
|
|
647
|
-
InteractiveChannel,
|
|
648
|
-
UserChannel,
|
|
649
|
-
EmailRouteData,
|
|
650
|
-
} from "./email.js";
|
|
651
657
|
export {
|
|
652
658
|
isEmailChannel,
|
|
653
|
-
isInteractiveChannel
|
|
659
|
+
isInteractiveChannel
|
|
660
|
+
} from "./email.js";
|
|
661
|
+
export type {
|
|
662
|
+
EmailChannel, EmailRouteData, InteractiveChannel,
|
|
663
|
+
UserChannel
|
|
654
664
|
} from "./email.js";
|
|
655
665
|
// ================= end user communication channels ====================
|
|
656
666
|
|
|
@@ -718,6 +728,10 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
|
|
|
718
728
|
/** In child execution workflow, this is the curent task_id */
|
|
719
729
|
task_id?: string;
|
|
720
730
|
|
|
731
|
+
/** Parent-assigned launch ID for non-blocking workstreams.
|
|
732
|
+
* The child uses this when signaling progress/completion back to the parent. */
|
|
733
|
+
launch_id?: string;
|
|
734
|
+
|
|
721
735
|
/** Whether to enable debug mode */
|
|
722
736
|
debug_mode?: boolean;
|
|
723
737
|
|
|
@@ -732,6 +746,45 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
|
|
|
732
746
|
*/
|
|
733
747
|
parent_metadata?: Record<string, any>;
|
|
734
748
|
|
|
749
|
+
/**
|
|
750
|
+
* When true, subagent/workstream tool calls use fire-and-forget `startChild()`
|
|
751
|
+
* instead of blocking `executeChild()`. The parent continues reasoning while
|
|
752
|
+
* children run, receiving progress/completion via Temporal signals.
|
|
753
|
+
*/
|
|
754
|
+
non_blocking_subagents?: boolean;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Temporal runId of a previous workflow to restart/fork from.
|
|
758
|
+
* When set, conversation history is loaded from the old run's GCS storage
|
|
759
|
+
* instead of calling startConversation fresh.
|
|
760
|
+
*/
|
|
761
|
+
restart_from_workflow_run_id?: string;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* The Temporal firstExecutionRunId of the original workflow being restarted/forked.
|
|
765
|
+
* Used by loadConversationForRestart to look up the original ExecutionRun
|
|
766
|
+
* so that token accumulation and status updates target a valid run.
|
|
767
|
+
*/
|
|
768
|
+
source_first_workflow_run_id?: string;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* When true, indicates this is a fork (new ExecutionRun) rather than a restart (reuse original).
|
|
772
|
+
*/
|
|
773
|
+
is_fork?: boolean;
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* The AgentRun MongoDB _id. Used for artifact storage paths: agents/{agent_run_id}/
|
|
777
|
+
* Flows into ConversationState and down to workstreams.
|
|
778
|
+
* Undefined for legacy workflows started before the AgentRun system.
|
|
779
|
+
*/
|
|
780
|
+
agent_run_id?: string;
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* The Schedule MongoDB _id. Set when this execution was triggered by a Temporal schedule.
|
|
784
|
+
* Used by the workflow to create an AgentRun on first run if agent_run_id is absent.
|
|
785
|
+
*/
|
|
786
|
+
schedule_id?: string;
|
|
787
|
+
|
|
735
788
|
}
|
|
736
789
|
|
|
737
790
|
export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
|
|
@@ -751,8 +804,6 @@ export type AsyncExecutionPayload = AsyncConversationExecutionPayload | AsyncInt
|
|
|
751
804
|
* Contains info not available in current_state needed to send LlmCallEvent.
|
|
752
805
|
*/
|
|
753
806
|
export interface StreamingTelemetryContext {
|
|
754
|
-
/** Workflow ID for ingestEvents API call */
|
|
755
|
-
workflowId: string;
|
|
756
807
|
/** Type of LLM call: start, resume after user message, or resume after tool results */
|
|
757
808
|
callType: LlmCallType;
|
|
758
809
|
/** Activity retry attempt number */
|
|
@@ -889,6 +940,7 @@ export enum RunSourceTypes {
|
|
|
889
940
|
webhook = "webhook",
|
|
890
941
|
test = "test-data",
|
|
891
942
|
system = "system",
|
|
943
|
+
schedule = "schedule",
|
|
892
944
|
}
|
|
893
945
|
|
|
894
946
|
export interface RunSource {
|
|
@@ -974,6 +1026,10 @@ export interface ExecutionRunWorkflow {
|
|
|
974
1026
|
*
|
|
975
1027
|
* A Run ID is a globally unique, platform-level identifier for a Workflow Execution.
|
|
976
1028
|
*
|
|
1029
|
+
* @deprecated For agent runs, use the Agent Runs API (`/api/v1/agents`) instead.
|
|
1030
|
+
* The AgentRun object provides a stable ID that survives workflow restarts.
|
|
1031
|
+
* This field is only relevant for legacy non-agent interaction executions.
|
|
1032
|
+
*
|
|
977
1033
|
* @example 01970d37-a890-70c0-9f44-1256d063e69a
|
|
978
1034
|
* @see https://docs.temporal.io/workflow-execution/workflowid-runid
|
|
979
1035
|
*/
|
|
@@ -981,6 +1037,10 @@ export interface ExecutionRunWorkflow {
|
|
|
981
1037
|
/**
|
|
982
1038
|
* The Temporal Workflow ID related to this Interaction Run.
|
|
983
1039
|
*
|
|
1040
|
+
* @deprecated For agent runs, use the Agent Runs API (`/api/v1/agents`) instead.
|
|
1041
|
+
* The AgentRun object provides a stable ID that survives workflow restarts.
|
|
1042
|
+
* This field is only relevant for legacy non-agent interaction executions.
|
|
1043
|
+
*
|
|
984
1044
|
* @example Standard Document Intake:6834841e4f828d4e36192796
|
|
985
1045
|
* @see https://docs.temporal.io/workflow-execution/workflowid-runid
|
|
986
1046
|
*/
|
package/src/oauth.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Application types for generic, project-level OAuth 2.0 integration.
|
|
3
|
+
* Decoupled from MCP — can be used by MCP collections, tool activities, or any OAuth-protected API.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* OAuth Application data stored in MongoDB.
|
|
8
|
+
* Represents the configuration for an OAuth 2.0 provider at the project level.
|
|
9
|
+
*/
|
|
10
|
+
export interface OAuthApplicationData {
|
|
11
|
+
/**
|
|
12
|
+
* Unique name within the project (kebab-case identifier).
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Human-readable display name.
|
|
18
|
+
*/
|
|
19
|
+
display_name: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The project this OAuth application belongs to.
|
|
23
|
+
*/
|
|
24
|
+
project: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The OAuth 2.0 authorization endpoint URL.
|
|
28
|
+
* Optional when endpoints are discovered via .well-known (e.g. MCP servers).
|
|
29
|
+
*/
|
|
30
|
+
authorization_endpoint?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The OAuth 2.0 token endpoint URL.
|
|
34
|
+
* Optional when endpoints are discovered via .well-known (e.g. MCP servers).
|
|
35
|
+
*/
|
|
36
|
+
token_endpoint?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The OAuth client ID (always required).
|
|
40
|
+
*/
|
|
41
|
+
client_id: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether a client_secret is configured (never exposes the actual secret).
|
|
45
|
+
*/
|
|
46
|
+
has_client_secret?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Default scopes to request during authorization.
|
|
50
|
+
*/
|
|
51
|
+
default_scopes?: string[];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Whether to use PKCE (Proof Key for Code Exchange) in the authorization flow.
|
|
55
|
+
* Defaults to true.
|
|
56
|
+
*/
|
|
57
|
+
use_pkce: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Optional OAuth 2.0 revocation endpoint URL.
|
|
61
|
+
*/
|
|
62
|
+
revocation_endpoint?: string;
|
|
63
|
+
|
|
64
|
+
created_at: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* OAuth Application as returned by the API (with id).
|
|
70
|
+
*/
|
|
71
|
+
export interface OAuthApplication extends OAuthApplicationData {
|
|
72
|
+
id: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Payload for creating an OAuth Application.
|
|
77
|
+
* The client_secret is accepted as plaintext on create and stored encrypted.
|
|
78
|
+
*/
|
|
79
|
+
export interface CreateOAuthApplicationPayload {
|
|
80
|
+
name: string;
|
|
81
|
+
display_name: string;
|
|
82
|
+
authorization_endpoint?: string;
|
|
83
|
+
token_endpoint?: string;
|
|
84
|
+
client_id: string;
|
|
85
|
+
/**
|
|
86
|
+
* Optional client secret for confidential clients.
|
|
87
|
+
* Will be encrypted at rest and never returned in API responses.
|
|
88
|
+
*/
|
|
89
|
+
client_secret?: string;
|
|
90
|
+
default_scopes?: string[];
|
|
91
|
+
use_pkce?: boolean;
|
|
92
|
+
revocation_endpoint?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Payload for updating an OAuth Application.
|
|
97
|
+
* All fields are optional — only provided fields are updated.
|
|
98
|
+
* To clear the client_secret, set it to an empty string.
|
|
99
|
+
*/
|
|
100
|
+
export type UpdateOAuthApplicationPayload = Partial<CreateOAuthApplicationPayload>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* OAuth authentication status for a user against an OAuth Application.
|
|
104
|
+
*/
|
|
105
|
+
export interface OAuthAppAuthStatus {
|
|
106
|
+
oauth_app_id: string;
|
|
107
|
+
oauth_app_name: string;
|
|
108
|
+
authenticated: boolean;
|
|
109
|
+
expires_at?: string;
|
|
110
|
+
scope?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Response from the OAuth authorize endpoint.
|
|
115
|
+
*/
|
|
116
|
+
export interface OAuthAppAuthorizeResponse {
|
|
117
|
+
authorization_url: string;
|
|
118
|
+
state: string;
|
|
119
|
+
}
|
package/src/payload.ts
CHANGED
|
@@ -9,6 +9,16 @@ import {
|
|
|
9
9
|
RunSearchQuery,
|
|
10
10
|
SimpleSearchQuery
|
|
11
11
|
} from "./query.js";
|
|
12
|
+
import { ColumnLayout } from "./store/store.js";
|
|
13
|
+
|
|
14
|
+
export type SortOrder = 'asc' | 'desc';
|
|
15
|
+
|
|
16
|
+
export interface SortOption {
|
|
17
|
+
/** Field path to sort by (e.g. 'updated_at', 'name', 'properties.title') */
|
|
18
|
+
field: string;
|
|
19
|
+
/** Sort direction. Defaults to 'desc'. */
|
|
20
|
+
order?: SortOrder;
|
|
21
|
+
}
|
|
12
22
|
|
|
13
23
|
export interface SearchPayload {
|
|
14
24
|
facets?: FacetSpec[];
|
|
@@ -23,6 +33,10 @@ export interface SearchPayload {
|
|
|
23
33
|
select?: string;
|
|
24
34
|
all_revisions?: boolean;
|
|
25
35
|
from_root?: string;
|
|
36
|
+
/** Sort criteria. Multiple entries enable multi-field sorting (first entry is primary). */
|
|
37
|
+
sort?: SortOption[];
|
|
38
|
+
/** Arbitrary Elasticsearch aggregation definitions. Ignored when search falls back to MongoDB. */
|
|
39
|
+
aggs?: Record<string, unknown>;
|
|
26
40
|
}
|
|
27
41
|
|
|
28
42
|
export interface ComputeFacetPayload {
|
|
@@ -74,6 +88,7 @@ export interface ExportPropertiesPayload {
|
|
|
74
88
|
objectIds: string[];
|
|
75
89
|
type: string;
|
|
76
90
|
query?: ComplexSearchQuery;
|
|
91
|
+
table_layout?: ColumnLayout[];
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
export interface ExportPropertiesResponse {
|