@vertesia/common 1.0.0-dev.20260227.112605Z → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/lib/cjs/apps.js +19 -0
  2. package/lib/cjs/apps.js.map +1 -1
  3. package/lib/cjs/environment.js.map +1 -1
  4. package/lib/cjs/index.js +1 -0
  5. package/lib/cjs/index.js.map +1 -1
  6. package/lib/cjs/interaction.js +2 -0
  7. package/lib/cjs/interaction.js.map +1 -1
  8. package/lib/cjs/oauth.js +7 -0
  9. package/lib/cjs/oauth.js.map +1 -0
  10. package/lib/cjs/project.js.map +1 -1
  11. package/lib/cjs/store/agent-run.js +16 -0
  12. package/lib/cjs/store/agent-run.js.map +1 -0
  13. package/lib/cjs/store/conversation-state.js +16 -0
  14. package/lib/cjs/store/conversation-state.js.map +1 -1
  15. package/lib/cjs/store/dsl-workflow.js.map +1 -1
  16. package/lib/cjs/store/index.js +1 -0
  17. package/lib/cjs/store/index.js.map +1 -1
  18. package/lib/cjs/store/store.js.map +1 -1
  19. package/lib/cjs/store/workflow.js +1 -0
  20. package/lib/cjs/store/workflow.js.map +1 -1
  21. package/lib/cjs/utils/schemas.js +45 -1
  22. package/lib/cjs/utils/schemas.js.map +1 -1
  23. package/lib/cjs/versions.js +1 -0
  24. package/lib/cjs/versions.js.map +1 -1
  25. package/lib/esm/apps.js +17 -0
  26. package/lib/esm/apps.js.map +1 -1
  27. package/lib/esm/environment.js.map +1 -1
  28. package/lib/esm/index.js +1 -0
  29. package/lib/esm/index.js.map +1 -1
  30. package/lib/esm/interaction.js +3 -1
  31. package/lib/esm/interaction.js.map +1 -1
  32. package/lib/esm/oauth.js +6 -0
  33. package/lib/esm/oauth.js.map +1 -0
  34. package/lib/esm/project.js.map +1 -1
  35. package/lib/esm/store/agent-run.js +15 -0
  36. package/lib/esm/store/agent-run.js.map +1 -0
  37. package/lib/esm/store/conversation-state.js +15 -1
  38. package/lib/esm/store/conversation-state.js.map +1 -1
  39. package/lib/esm/store/dsl-workflow.js.map +1 -1
  40. package/lib/esm/store/index.js +1 -0
  41. package/lib/esm/store/index.js.map +1 -1
  42. package/lib/esm/store/store.js.map +1 -1
  43. package/lib/esm/store/workflow.js +1 -0
  44. package/lib/esm/store/workflow.js.map +1 -1
  45. package/lib/esm/utils/schemas.js +44 -1
  46. package/lib/esm/utils/schemas.js.map +1 -1
  47. package/lib/esm/versions.js +1 -0
  48. package/lib/esm/versions.js.map +1 -1
  49. package/lib/tsconfig.tsbuildinfo +1 -1
  50. package/lib/types/apps.d.ts +61 -3
  51. package/lib/types/apps.d.ts.map +1 -1
  52. package/lib/types/audit-trail.d.ts +1 -1
  53. package/lib/types/audit-trail.d.ts.map +1 -1
  54. package/lib/types/common.d.ts +28 -1
  55. package/lib/types/common.d.ts.map +1 -1
  56. package/lib/types/environment.d.ts +11 -1
  57. package/lib/types/environment.d.ts.map +1 -1
  58. package/lib/types/index.d.ts +1 -0
  59. package/lib/types/index.d.ts.map +1 -1
  60. package/lib/types/interaction.d.ts +68 -5
  61. package/lib/types/interaction.d.ts.map +1 -1
  62. package/lib/types/oauth.d.ts +103 -0
  63. package/lib/types/oauth.d.ts.map +1 -0
  64. package/lib/types/payload.d.ts +13 -0
  65. package/lib/types/payload.d.ts.map +1 -1
  66. package/lib/types/project.d.ts +85 -44
  67. package/lib/types/project.d.ts.map +1 -1
  68. package/lib/types/query.d.ts +1 -0
  69. package/lib/types/query.d.ts.map +1 -1
  70. package/lib/types/store/agent-run.d.ts +254 -0
  71. package/lib/types/store/agent-run.d.ts.map +1 -0
  72. package/lib/types/store/conversation-state.d.ts +21 -0
  73. package/lib/types/store/conversation-state.d.ts.map +1 -1
  74. package/lib/types/store/dsl-workflow.d.ts +24 -6
  75. package/lib/types/store/dsl-workflow.d.ts.map +1 -1
  76. package/lib/types/store/index.d.ts +1 -0
  77. package/lib/types/store/index.d.ts.map +1 -1
  78. package/lib/types/store/signals.d.ts +5 -5
  79. package/lib/types/store/signals.d.ts.map +1 -1
  80. package/lib/types/store/store.d.ts +22 -0
  81. package/lib/types/store/store.d.ts.map +1 -1
  82. package/lib/types/store/workflow.d.ts +59 -10
  83. package/lib/types/store/workflow.d.ts.map +1 -1
  84. package/lib/types/utils/schemas.d.ts +7 -0
  85. package/lib/types/utils/schemas.d.ts.map +1 -1
  86. package/lib/types/versions.d.ts +2 -1
  87. package/lib/types/versions.d.ts.map +1 -1
  88. package/lib/types/workflow-analytics.d.ts +5 -1
  89. package/lib/types/workflow-analytics.d.ts.map +1 -1
  90. package/lib/vertesia-common.js +1 -1
  91. package/lib/vertesia-common.js.map +1 -1
  92. package/package.json +2 -2
  93. package/src/apps.ts +78 -4
  94. package/src/audit-trail.ts +1 -0
  95. package/src/common.ts +24 -1
  96. package/src/environment.ts +11 -1
  97. package/src/index.ts +1 -0
  98. package/src/interaction.ts +79 -9
  99. package/src/oauth.ts +119 -0
  100. package/src/payload.ts +15 -0
  101. package/src/project.ts +91 -46
  102. package/src/query.ts +1 -0
  103. package/src/store/agent-run.ts +347 -0
  104. package/src/store/conversation-state.ts +33 -0
  105. package/src/store/dsl-workflow.ts +26 -6
  106. package/src/store/index.ts +1 -0
  107. package/src/store/signals.ts +5 -5
  108. package/src/store/store.ts +22 -0
  109. package/src/store/workflow.ts +70 -10
  110. package/src/utils/schemas.ts +49 -1
  111. package/src/versions.ts +1 -0
  112. package/src/workflow-analytics.ts +5 -1
  113. 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.20260227.112605Z",
3
+ "version": "1.0.0",
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.20260224.234313Z"
29
+ "@llumiverse/common": "1.0.0"
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.
@@ -91,6 +91,14 @@ export interface MCPToolCollectionObject extends BaseToolCollectionObject {
91
91
  * Provides clean, readable tool names (e.g., "jira" instead of "https://mcp.atlassian.com/v1/mcp")
92
92
  */
93
93
  namespace: string;
94
+
95
+ /**
96
+ * Reference to an OAuth Application name for this collection.
97
+ * When set, uses the OAuth Application's config (endpoints, client_id, client_secret)
98
+ * instead of MCP dynamic client registration or random fallback.
99
+ * The referenced OAuth Application must exist in the same project.
100
+ */
101
+ oauth_app?: string;
94
102
  }
95
103
 
96
104
  /**
@@ -190,6 +198,33 @@ export interface AgentToolDefinition extends ToolDefinition {
190
198
  related_tools?: string[];
191
199
  }
192
200
 
201
+ /**
202
+ * Definition of a remote activity exposed by a tool server for use in DSL workflows.
203
+ * Remote activities are identified in workflow steps using colon-separated names:
204
+ * `app:<app_name>:<collection>:<activity_name>` (e.g. `app:my-nlp-app:examples:word_count`).
205
+ */
206
+ export interface RemoteActivityDefinition {
207
+ /** Activity name (snake_case, unique within the collection) */
208
+ name: string;
209
+ /** Collection name this activity belongs to */
210
+ collection?: string;
211
+ /** Display title */
212
+ title?: string;
213
+ /** Description of what the activity does */
214
+ description?: string;
215
+ /** JSON Schema for the activity input parameters */
216
+ input_schema?: Record<string, any>;
217
+ /** JSON Schema for the activity output */
218
+ output_schema?: Record<string, any>;
219
+ /**
220
+ * The activity execution URL. Can be absolute or relative to the tool server base URL.
221
+ * If not provided, the collection-specific activities endpoint is used.
222
+ */
223
+ url?: string;
224
+ /** Suggested timeout and retry configuration */
225
+ options?: DSLActivityOptions;
226
+ }
227
+
193
228
  export type AppCapabilities = 'ui' | 'tools' | 'interactions' | 'types' | 'templates';
194
229
  export type AppAvailableIn = 'app_portal' | 'composite_app';
195
230
  export interface AppManifestData {
@@ -278,8 +313,39 @@ export interface AppManifestData {
278
313
  * - ?scope=ui,tools - returns only the UI configuration
279
314
  */
280
315
  endpoint?: string;
316
+
317
+ /**
318
+ * Optional endpoint overrides keyed by environment name.
319
+ * When resolving the app endpoint, if the current environment name matches a key,
320
+ * the corresponding URL is used instead of the main `endpoint`.
321
+ * Only dev environment names are allowed as keys (starting with "desktop-" or "dev-").
322
+ */
323
+ endpoint_overrides?: Record<string, string>;
324
+ }
325
+
326
+ /**
327
+ * Returns true if the given environment name is allowed as an endpoint override key.
328
+ * Only "desktop-" or "dev-" prefixed names are valid.
329
+ */
330
+ export function isValidEndpointOverrideEnv(envName: string): boolean {
331
+ return envName.startsWith('desktop-') || envName.startsWith('dev-');
281
332
  }
282
- export type AppPackageScope = 'ui' | 'tools' | 'interactions' | 'types' | 'templates' | 'settings' | 'widgets' | 'all';
333
+
334
+ /**
335
+ * Resolves the effective endpoint for an app given an optional environment name.
336
+ * Returns the override endpoint if the env name matches a valid dev environment, otherwise the default endpoint.
337
+ */
338
+ export function resolveAppEndpoint(
339
+ manifest: Pick<AppManifestData, 'endpoint' | 'endpoint_overrides'>,
340
+ envName?: string
341
+ ): string | undefined {
342
+ if (envName && manifest.endpoint_overrides?.[envName] && isValidEndpointOverrideEnv(envName)) {
343
+ return manifest.endpoint_overrides[envName];
344
+ }
345
+ return manifest.endpoint;
346
+ }
347
+
348
+ export type AppPackageScope = 'ui' | 'tools' | 'interactions' | 'types' | 'templates' | 'settings' | 'widgets' | 'activities' | 'all';
283
349
  export interface AppPackage {
284
350
  /**
285
351
  * The UI configuration of the app
@@ -311,6 +377,13 @@ export interface AppPackage {
311
377
  */
312
378
  widgets?: Record<string, AppWidgetInfo>;
313
379
 
380
+ /**
381
+ * Remote activities exposed by the app for use in DSL workflows.
382
+ * Activities are discovered via `?scope=activities` and referenced in workflow steps
383
+ * using colon-separated names: `app:<app_name>:<collection>:<activity_name>`.
384
+ */
385
+ activities?: RemoteActivityDefinition[];
386
+
314
387
  /**
315
388
  * A JSON chema for the app installation settings.
316
389
  */
@@ -349,7 +422,8 @@ export type RenderingTemplateDefinitionRef = Omit<RenderingTemplateDefinition, '
349
422
 
350
423
  export interface AppManifest extends AppManifestData {
351
424
  id: string;
352
- account: string;
425
+ /** The owning account. Undefined for apps imported from a master region. */
426
+ account?: string;
353
427
  created_at: string;
354
428
  updated_at: string;
355
429
  }
@@ -391,7 +465,7 @@ export interface AppToolCollection {
391
465
  /**
392
466
  * the tools provided by this collection
393
467
  */
394
- tools: { name: string, description?: string }[]
468
+ tools: { name: string, description?: string, related_tools?: string[] }[]
395
469
  }
396
470
 
397
471
  /**
@@ -2,6 +2,7 @@ export type AuditAction =
2
2
  | 'create'
3
3
  | 'update'
4
4
  | 'delete'
5
+ | 'bulk_create'
5
6
  | 'bulk_update'
6
7
  | 'bulk_delete'
7
8
  | 'attach'
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
+ }
@@ -60,7 +60,7 @@ export interface VirtualEnvEntry {
60
60
  **/
61
61
  export interface LoadBalancingEnvConfig {
62
62
  entries?: LoadBalancingEnvEntryConfig[];
63
- balance_if_failed?: boolean;
63
+ failover?: boolean;
64
64
  }
65
65
 
66
66
  export interface LoadBalancingEnvEntryConfig extends VirtualEnvEntry {
@@ -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';
@@ -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,33 @@ 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 AgentRun MongoDB _id. Used for artifact storage paths: agents/{agent_run_id}/
765
+ * Flows into ConversationState and down to workstreams.
766
+ * Undefined for legacy workflows started before the AgentRun system.
767
+ */
768
+ agent_run_id?: string;
769
+
770
+ /**
771
+ * The Schedule MongoDB _id. Set when this execution was triggered by a Temporal schedule.
772
+ * Used by the workflow to create an AgentRun on first run if agent_run_id is absent.
773
+ */
774
+ schedule_id?: string;
775
+
735
776
  }
736
777
 
737
778
  export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
@@ -751,8 +792,6 @@ export type AsyncExecutionPayload = AsyncConversationExecutionPayload | AsyncInt
751
792
  * Contains info not available in current_state needed to send LlmCallEvent.
752
793
  */
753
794
  export interface StreamingTelemetryContext {
754
- /** Workflow ID for ingestEvents API call */
755
- workflowId: string;
756
795
  /** Type of LLM call: start, resume after user message, or resume after tool results */
757
796
  callType: LlmCallType;
758
797
  /** Activity retry attempt number */
@@ -889,6 +928,7 @@ export enum RunSourceTypes {
889
928
  webhook = "webhook",
890
929
  test = "test-data",
891
930
  system = "system",
931
+ schedule = "schedule",
892
932
  }
893
933
 
894
934
  export interface RunSource {
@@ -974,6 +1014,10 @@ export interface ExecutionRunWorkflow {
974
1014
  *
975
1015
  * A Run ID is a globally unique, platform-level identifier for a Workflow Execution.
976
1016
  *
1017
+ * @deprecated For agent runs, use the Agent Runs API (`/api/v1/agents`) instead.
1018
+ * The AgentRun object provides a stable ID that survives workflow restarts.
1019
+ * This field is only relevant for legacy non-agent interaction executions.
1020
+ *
977
1021
  * @example 01970d37-a890-70c0-9f44-1256d063e69a
978
1022
  * @see https://docs.temporal.io/workflow-execution/workflowid-runid
979
1023
  */
@@ -981,6 +1025,10 @@ export interface ExecutionRunWorkflow {
981
1025
  /**
982
1026
  * The Temporal Workflow ID related to this Interaction Run.
983
1027
  *
1028
+ * @deprecated For agent runs, use the Agent Runs API (`/api/v1/agents`) instead.
1029
+ * The AgentRun object provides a stable ID that survives workflow restarts.
1030
+ * This field is only relevant for legacy non-agent interaction executions.
1031
+ *
984
1032
  * @example Standard Document Intake:6834841e4f828d4e36192796
985
1033
  * @see https://docs.temporal.io/workflow-execution/workflowid-runid
986
1034
  */
@@ -1168,6 +1216,23 @@ export interface BuiltinToolDefinition {
1168
1216
  params: JSONSchema;
1169
1217
  }
1170
1218
 
1219
+ /**
1220
+ * A system skill entry in the tools catalog.
1221
+ * System skills are built into the platform and unlock hidden tools.
1222
+ */
1223
+ export interface SystemSkillCatalogEntry {
1224
+ /** Skill name without the learn_ prefix, e.g. "document_search" */
1225
+ name: string;
1226
+ /** Tool name used in agent selection, i.e. "learn_document_search" */
1227
+ tool_name: string;
1228
+ /** Human-readable display title */
1229
+ title: string;
1230
+ /** Description of what the skill unlocks */
1231
+ description: string;
1232
+ /** Builtin tools that become available when this skill is called */
1233
+ related_tools: string[];
1234
+ }
1235
+
1171
1236
  /**
1172
1237
  * Response from the builtin tools catalog endpoint
1173
1238
  */
@@ -1186,4 +1251,9 @@ export interface BuiltinToolsCatalogResponse {
1186
1251
  * Total number of tools in the catalog
1187
1252
  */
1188
1253
  total_tools: number;
1254
+
1255
+ /**
1256
+ * System skills bundled in the platform, available without app installation
1257
+ */
1258
+ skills?: SystemSkillCatalogEntry[];
1189
1259
  }
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 {