@vertesia/common 0.81.1 → 1.0.0-dev.20260203.130115Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/analytics.ts +5 -2
- package/src/apikey.ts +20 -1
- package/src/apps.ts +269 -4
- package/src/ask-user.ts +35 -0
- package/src/channels.ts +70 -0
- package/src/data-platform.ts +976 -0
- package/src/email.ts +80 -0
- package/src/index.ts +7 -1
- package/src/integrations.ts +34 -0
- package/src/interaction.ts +280 -1
- package/src/pending-asks.ts +106 -0
- package/src/project.ts +90 -1
- package/src/prompt.ts +2 -1
- package/src/skill.ts +1 -0
- package/src/store/conversation-state.ts +152 -0
- package/src/store/dsl-workflow.ts +12 -0
- package/src/store/hive-memory.ts +167 -0
- package/src/store/index.ts +3 -0
- package/src/store/schedule.ts +238 -0
- package/src/store/signals.ts +20 -0
- package/src/store/store.ts +124 -0
- package/src/store/workflow.test.ts +578 -0
- package/src/store/workflow.ts +612 -53
- package/src/tool-execution.ts +47 -0
- package/src/user.ts +14 -1
- package/src/workflow-analytics.ts +925 -0
- package/lib/cjs/Progress.js +0 -61
- package/lib/cjs/Progress.js.map +0 -1
- package/lib/cjs/access-control.js +0 -56
- package/lib/cjs/access-control.js.map +0 -1
- package/lib/cjs/analytics.js +0 -3
- package/lib/cjs/analytics.js.map +0 -1
- package/lib/cjs/apikey.js +0 -16
- package/lib/cjs/apikey.js.map +0 -1
- package/lib/cjs/apps.js +0 -3
- package/lib/cjs/apps.js.map +0 -1
- package/lib/cjs/common.js +0 -3
- package/lib/cjs/common.js.map +0 -1
- package/lib/cjs/environment.js +0 -44
- package/lib/cjs/environment.js.map +0 -1
- package/lib/cjs/facets.js +0 -3
- package/lib/cjs/facets.js.map +0 -1
- package/lib/cjs/group.js +0 -5
- package/lib/cjs/group.js.map +0 -1
- package/lib/cjs/index.js +0 -49
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/integrations.js +0 -12
- package/lib/cjs/integrations.js.map +0 -1
- package/lib/cjs/interaction.js +0 -74
- package/lib/cjs/interaction.js.map +0 -1
- package/lib/cjs/json-schema.js +0 -3
- package/lib/cjs/json-schema.js.map +0 -1
- package/lib/cjs/json.js +0 -3
- package/lib/cjs/json.js.map +0 -1
- package/lib/cjs/meters.js +0 -13
- package/lib/cjs/meters.js.map +0 -1
- package/lib/cjs/model_utility.js +0 -6
- package/lib/cjs/model_utility.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/payload.js +0 -3
- package/lib/cjs/payload.js.map +0 -1
- package/lib/cjs/project.js +0 -107
- package/lib/cjs/project.js.map +0 -1
- package/lib/cjs/prompt.js +0 -20
- package/lib/cjs/prompt.js.map +0 -1
- package/lib/cjs/query.js +0 -3
- package/lib/cjs/query.js.map +0 -1
- package/lib/cjs/rate-limiter.js +0 -6
- package/lib/cjs/rate-limiter.js.map +0 -1
- package/lib/cjs/refs.js +0 -14
- package/lib/cjs/refs.js.map +0 -1
- package/lib/cjs/runs.js +0 -3
- package/lib/cjs/runs.js.map +0 -1
- package/lib/cjs/skill.js +0 -14
- package/lib/cjs/skill.js.map +0 -1
- package/lib/cjs/store/activity-catalog.js +0 -3
- package/lib/cjs/store/activity-catalog.js.map +0 -1
- package/lib/cjs/store/collections.js +0 -9
- package/lib/cjs/store/collections.js.map +0 -1
- package/lib/cjs/store/common.js +0 -3
- package/lib/cjs/store/common.js.map +0 -1
- package/lib/cjs/store/doc-analyzer.js +0 -3
- package/lib/cjs/store/doc-analyzer.js.map +0 -1
- package/lib/cjs/store/dsl-workflow.js +0 -5
- package/lib/cjs/store/dsl-workflow.js.map +0 -1
- package/lib/cjs/store/index.js +0 -28
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/cjs/store/object-types.js +0 -98
- package/lib/cjs/store/object-types.js.map +0 -1
- package/lib/cjs/store/signals.js +0 -3
- package/lib/cjs/store/signals.js.map +0 -1
- package/lib/cjs/store/store.js +0 -55
- package/lib/cjs/store/store.js.map +0 -1
- package/lib/cjs/store/temporalio.js +0 -44
- package/lib/cjs/store/temporalio.js.map +0 -1
- package/lib/cjs/store/worker.js +0 -3
- package/lib/cjs/store/worker.js.map +0 -1
- package/lib/cjs/store/workflow.js +0 -49
- package/lib/cjs/store/workflow.js.map +0 -1
- package/lib/cjs/sts-token-types.js +0 -32
- package/lib/cjs/sts-token-types.js.map +0 -1
- package/lib/cjs/tenant.js +0 -3
- package/lib/cjs/tenant.js.map +0 -1
- package/lib/cjs/training.js +0 -14
- package/lib/cjs/training.js.map +0 -1
- package/lib/cjs/transient-tokens.js +0 -9
- package/lib/cjs/transient-tokens.js.map +0 -1
- package/lib/cjs/user.js +0 -25
- package/lib/cjs/user.js.map +0 -1
- package/lib/cjs/utils/auth.js +0 -15
- package/lib/cjs/utils/auth.js.map +0 -1
- package/lib/cjs/utils/schemas.js +0 -114
- package/lib/cjs/utils/schemas.js.map +0 -1
- package/lib/cjs/utils/type-helpers.js +0 -3
- package/lib/cjs/utils/type-helpers.js.map +0 -1
- package/lib/cjs/versions.js +0 -8
- package/lib/cjs/versions.js.map +0 -1
- package/lib/esm/Progress.js +0 -57
- package/lib/esm/Progress.js.map +0 -1
- package/lib/esm/access-control.js +0 -53
- package/lib/esm/access-control.js.map +0 -1
- package/lib/esm/analytics.js +0 -2
- package/lib/esm/analytics.js.map +0 -1
- package/lib/esm/apikey.js +0 -13
- package/lib/esm/apikey.js.map +0 -1
- package/lib/esm/apps.js +0 -2
- package/lib/esm/apps.js.map +0 -1
- package/lib/esm/common.js +0 -2
- package/lib/esm/common.js.map +0 -1
- package/lib/esm/environment.js +0 -41
- package/lib/esm/environment.js.map +0 -1
- package/lib/esm/facets.js +0 -2
- package/lib/esm/facets.js.map +0 -1
- package/lib/esm/group.js +0 -2
- package/lib/esm/group.js.map +0 -1
- package/lib/esm/index.js +0 -33
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/integrations.js +0 -9
- package/lib/esm/integrations.js.map +0 -1
- package/lib/esm/interaction.js +0 -71
- package/lib/esm/interaction.js.map +0 -1
- package/lib/esm/json-schema.js +0 -2
- package/lib/esm/json-schema.js.map +0 -1
- package/lib/esm/json.js +0 -2
- package/lib/esm/json.js.map +0 -1
- package/lib/esm/meters.js +0 -10
- package/lib/esm/meters.js.map +0 -1
- package/lib/esm/model_utility.js +0 -2
- package/lib/esm/model_utility.js.map +0 -1
- package/lib/esm/payload.js +0 -2
- package/lib/esm/payload.js.map +0 -1
- package/lib/esm/project.js +0 -102
- package/lib/esm/project.js.map +0 -1
- package/lib/esm/prompt.js +0 -17
- package/lib/esm/prompt.js.map +0 -1
- package/lib/esm/query.js +0 -2
- package/lib/esm/query.js.map +0 -1
- package/lib/esm/rate-limiter.js +0 -5
- package/lib/esm/rate-limiter.js.map +0 -1
- package/lib/esm/refs.js +0 -11
- package/lib/esm/refs.js.map +0 -1
- package/lib/esm/runs.js +0 -2
- package/lib/esm/runs.js.map +0 -1
- package/lib/esm/skill.js +0 -13
- package/lib/esm/skill.js.map +0 -1
- package/lib/esm/store/activity-catalog.js +0 -2
- package/lib/esm/store/activity-catalog.js.map +0 -1
- package/lib/esm/store/collections.js +0 -6
- package/lib/esm/store/collections.js.map +0 -1
- package/lib/esm/store/common.js +0 -2
- package/lib/esm/store/common.js.map +0 -1
- package/lib/esm/store/doc-analyzer.js +0 -2
- package/lib/esm/store/doc-analyzer.js.map +0 -1
- package/lib/esm/store/dsl-workflow.js +0 -2
- package/lib/esm/store/dsl-workflow.js.map +0 -1
- package/lib/esm/store/index.js +0 -12
- package/lib/esm/store/index.js.map +0 -1
- package/lib/esm/store/object-types.js +0 -95
- package/lib/esm/store/object-types.js.map +0 -1
- package/lib/esm/store/signals.js +0 -2
- package/lib/esm/store/signals.js.map +0 -1
- package/lib/esm/store/store.js +0 -52
- package/lib/esm/store/store.js.map +0 -1
- package/lib/esm/store/temporalio.js +0 -41
- package/lib/esm/store/temporalio.js.map +0 -1
- package/lib/esm/store/worker.js +0 -2
- package/lib/esm/store/worker.js.map +0 -1
- package/lib/esm/store/workflow.js +0 -45
- package/lib/esm/store/workflow.js.map +0 -1
- package/lib/esm/sts-token-types.js +0 -24
- package/lib/esm/sts-token-types.js.map +0 -1
- package/lib/esm/tenant.js +0 -2
- package/lib/esm/tenant.js.map +0 -1
- package/lib/esm/training.js +0 -11
- package/lib/esm/training.js.map +0 -1
- package/lib/esm/transient-tokens.js +0 -6
- package/lib/esm/transient-tokens.js.map +0 -1
- package/lib/esm/user.js +0 -22
- package/lib/esm/user.js.map +0 -1
- package/lib/esm/utils/auth.js +0 -11
- package/lib/esm/utils/auth.js.map +0 -1
- package/lib/esm/utils/schemas.js +0 -107
- package/lib/esm/utils/schemas.js.map +0 -1
- package/lib/esm/utils/type-helpers.js +0 -2
- package/lib/esm/utils/type-helpers.js.map +0 -1
- package/lib/esm/versions.js +0 -5
- package/lib/esm/versions.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/Progress.d.ts +0 -21
- package/lib/types/Progress.d.ts.map +0 -1
- package/lib/types/access-control.d.ts +0 -73
- package/lib/types/access-control.d.ts.map +0 -1
- package/lib/types/analytics.d.ts +0 -85
- package/lib/types/analytics.d.ts.map +0 -1
- package/lib/types/apikey.d.ts +0 -80
- package/lib/types/apikey.d.ts.map +0 -1
- package/lib/types/apps.d.ts +0 -102
- package/lib/types/apps.d.ts.map +0 -1
- package/lib/types/common.d.ts +0 -31
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/environment.d.ts +0 -106
- package/lib/types/environment.d.ts.map +0 -1
- package/lib/types/facets.d.ts +0 -34
- package/lib/types/facets.d.ts.map +0 -1
- package/lib/types/group.d.ts +0 -21
- package/lib/types/group.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -33
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/integrations.d.ts +0 -28
- package/lib/types/integrations.d.ts.map +0 -1
- package/lib/types/interaction.d.ts +0 -727
- package/lib/types/interaction.d.ts.map +0 -1
- package/lib/types/json-schema.d.ts +0 -1
- package/lib/types/json-schema.d.ts.map +0 -1
- package/lib/types/json.d.ts +0 -1
- package/lib/types/json.d.ts.map +0 -1
- package/lib/types/meters.d.ts +0 -23
- package/lib/types/meters.d.ts.map +0 -1
- package/lib/types/model_utility.d.ts +0 -1
- package/lib/types/model_utility.d.ts.map +0 -1
- package/lib/types/payload.d.ts +0 -60
- package/lib/types/payload.d.ts.map +0 -1
- package/lib/types/project.d.ts +0 -173
- package/lib/types/project.d.ts.map +0 -1
- package/lib/types/prompt.d.ts +0 -77
- package/lib/types/prompt.d.ts.map +0 -1
- package/lib/types/query.d.ts +0 -118
- package/lib/types/query.d.ts.map +0 -1
- package/lib/types/rate-limiter.d.ts +0 -28
- package/lib/types/rate-limiter.d.ts.map +0 -1
- package/lib/types/refs.d.ts +0 -22
- package/lib/types/refs.d.ts.map +0 -1
- package/lib/types/runs.d.ts +0 -32
- package/lib/types/runs.d.ts.map +0 -1
- package/lib/types/skill.d.ts +0 -78
- package/lib/types/skill.d.ts.map +0 -1
- package/lib/types/store/activity-catalog.d.ts +0 -26
- package/lib/types/store/activity-catalog.d.ts.map +0 -1
- package/lib/types/store/collections.d.ts +0 -78
- package/lib/types/store/collections.d.ts.map +0 -1
- package/lib/types/store/common.d.ts +0 -22
- package/lib/types/store/common.d.ts.map +0 -1
- package/lib/types/store/doc-analyzer.d.ts +0 -140
- package/lib/types/store/doc-analyzer.d.ts.map +0 -1
- package/lib/types/store/dsl-workflow.d.ts +0 -238
- package/lib/types/store/dsl-workflow.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -11
- package/lib/types/store/index.d.ts.map +0 -1
- package/lib/types/store/object-types.d.ts +0 -23
- package/lib/types/store/object-types.d.ts.map +0 -1
- package/lib/types/store/signals.d.ts +0 -5
- package/lib/types/store/signals.d.ts.map +0 -1
- package/lib/types/store/store.d.ts +0 -358
- package/lib/types/store/store.d.ts.map +0 -1
- package/lib/types/store/temporalio.d.ts +0 -16
- package/lib/types/store/temporalio.d.ts.map +0 -1
- package/lib/types/store/worker.d.ts +0 -18
- package/lib/types/store/worker.d.ts.map +0 -1
- package/lib/types/store/workflow.d.ts +0 -439
- package/lib/types/store/workflow.d.ts.map +0 -1
- package/lib/types/sts-token-types.d.ts +0 -72
- package/lib/types/sts-token-types.d.ts.map +0 -1
- package/lib/types/tenant.d.ts +0 -10
- package/lib/types/tenant.d.ts.map +0 -1
- package/lib/types/training.d.ts +0 -38
- package/lib/types/training.d.ts.map +0 -1
- package/lib/types/transient-tokens.d.ts +0 -24
- package/lib/types/transient-tokens.d.ts.map +0 -1
- package/lib/types/user.d.ts +0 -116
- package/lib/types/user.d.ts.map +0 -1
- package/lib/types/utils/auth.d.ts +0 -3
- package/lib/types/utils/auth.d.ts.map +0 -1
- package/lib/types/utils/schemas.d.ts +0 -9
- package/lib/types/utils/schemas.d.ts.map +0 -1
- package/lib/types/utils/type-helpers.d.ts +0 -3
- package/lib/types/utils/type-helpers.d.ts.map +0 -1
- package/lib/types/versions.d.ts +0 -3
- package/lib/types/versions.d.ts.map +0 -1
- package/lib/vertesia-common.js +0 -2
- package/lib/vertesia-common.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-dev.20260203.130115Z",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/types/index.d.ts",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"rollup": "^4.40.2",
|
|
23
23
|
"rollup-plugin-terser": "^7.0.2",
|
|
24
24
|
"ts-dual-module": "^0.6.3",
|
|
25
|
-
"typescript": "^5.
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"vitest": "^4.0.16"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"ajv": "^8.
|
|
29
|
+
"ajv": "^8.17.1",
|
|
30
30
|
"json-schema": "^0.4.0",
|
|
31
|
-
"@llumiverse/common": "0.
|
|
31
|
+
"@llumiverse/common": "1.0.0-dev.20260202.145450Z"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
package/src/analytics.ts
CHANGED
|
@@ -22,9 +22,12 @@ export interface RunAnalyticsQuery {
|
|
|
22
22
|
/** The end date of the query in EPOCH format */
|
|
23
23
|
to?: number;
|
|
24
24
|
|
|
25
|
-
/** The time resolution of the analytics query */
|
|
25
|
+
/** The time resolution unit of the analytics query */
|
|
26
26
|
resolution?: TimeResolution;
|
|
27
27
|
|
|
28
|
+
/** The step size for the resolution (e.g., 4 with resolution='hour' means 4-hour intervals). Defaults to 1. */
|
|
29
|
+
resolutionStep?: number;
|
|
30
|
+
|
|
28
31
|
/** The field to sort by */
|
|
29
32
|
virtual?: boolean;
|
|
30
33
|
|
|
@@ -33,7 +36,7 @@ export interface RunAnalyticsQuery {
|
|
|
33
36
|
|
|
34
37
|
export type RunAnalyticsGroupBy = "interaction" | "modelId" | "project" | "status" | "tags" | "environment";
|
|
35
38
|
|
|
36
|
-
export type TimeResolution = "hour" | "day" | "week" | "month" | "year";
|
|
39
|
+
export type TimeResolution = "minute" | "hour" | "day" | "week" | "month" | "year";
|
|
37
40
|
|
|
38
41
|
|
|
39
42
|
export interface RunAnalyticsResult {
|
package/src/apikey.ts
CHANGED
|
@@ -70,13 +70,14 @@ export interface AuthTokenPayload {
|
|
|
70
70
|
/**
|
|
71
71
|
* API endpoints information to be used with this token.
|
|
72
72
|
* Either a n API domain like 'api.vertesia.io' | 'api-preview.vertesia.io' | 'api-staging.vertesia.io' | 'local'
|
|
73
|
-
* or explicit studio and
|
|
73
|
+
* or explicit studio, store, and token URLs.
|
|
74
74
|
*/
|
|
75
75
|
endpoints?:
|
|
76
76
|
| string
|
|
77
77
|
| {
|
|
78
78
|
studio: string;
|
|
79
79
|
store: string;
|
|
80
|
+
token?: string;
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
iss: string; //issuer
|
|
@@ -86,6 +87,24 @@ export interface AuthTokenPayload {
|
|
|
86
87
|
|
|
87
88
|
permissions?: string[]; //permissions
|
|
88
89
|
scopes?: string[]; //scopes
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Service caller information for agent and service account tokens.
|
|
93
|
+
* Contains audit information about who/what initiated the token request.
|
|
94
|
+
* For agent tokens, includes `onBehalfOf` with the original user's token payload.
|
|
95
|
+
*/
|
|
96
|
+
service_caller?: {
|
|
97
|
+
/** The principal that requested the token (e.g., service account identity) */
|
|
98
|
+
id?: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
email?: string;
|
|
101
|
+
/**
|
|
102
|
+
* For agent tokens: the verified token payload of the user/apikey the agent acts on behalf of.
|
|
103
|
+
* Contains the original user's name, email, picture, user_id, etc.
|
|
104
|
+
*/
|
|
105
|
+
onBehalfOf?: AuthTokenPayload;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
};
|
|
89
108
|
}
|
|
90
109
|
|
|
91
110
|
export enum PrincipalType {
|
package/src/apps.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { JSONSchema } from "@llumiverse/common";
|
|
1
|
+
import { JSONSchema, ToolDefinition } from "@llumiverse/common";
|
|
2
|
+
import { CatalogInteractionRef } from "./interaction.js";
|
|
3
|
+
import { InCodeTypeDefinition } from "./store/index.js";
|
|
2
4
|
|
|
3
5
|
export interface AppUIConfig {
|
|
4
6
|
/**
|
|
@@ -8,13 +10,155 @@ export interface AppUIConfig {
|
|
|
8
10
|
*/
|
|
9
11
|
src: string;
|
|
10
12
|
/**
|
|
11
|
-
* The isolation strategy. If not specified it defaults to shadow
|
|
13
|
+
* The isolation strategy. If not specified it defaults to shadow
|
|
12
14
|
* - shadow - use Shadow DOM to fully isolate the plugin from the host.
|
|
13
15
|
* - css - use CSS processing (like prefixing or other isolation techniques). Ligther but plugins may conflict with the host
|
|
14
16
|
*/
|
|
15
17
|
isolation?: "shadow" | "css";
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Authentication type for tool collections
|
|
22
|
+
*/
|
|
23
|
+
export type ToolCollectionAuthType = "oauth" | "other";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Tool collection type
|
|
27
|
+
*/
|
|
28
|
+
export type ToolCollectionType = "mcp" | "vertesia_sdk";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Base tool collection configuration
|
|
32
|
+
*/
|
|
33
|
+
interface BaseToolCollectionObject {
|
|
34
|
+
/**
|
|
35
|
+
* The URL endpoint for the tool collection
|
|
36
|
+
*/
|
|
37
|
+
url: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional authentication type required for this tool collection
|
|
41
|
+
*/
|
|
42
|
+
auth?: ToolCollectionAuthType;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* MCP tool collection configuration (requires name, description, and namespace)
|
|
47
|
+
*/
|
|
48
|
+
export interface MCPToolCollectionObject extends BaseToolCollectionObject {
|
|
49
|
+
type: "mcp";
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Name for the tool collection.
|
|
53
|
+
* Used as an identifier for the collection (e.g., for OAuth authentication).
|
|
54
|
+
*/
|
|
55
|
+
name: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Description for the tool collection.
|
|
59
|
+
* Helps users understand what tools this collection provides.
|
|
60
|
+
*/
|
|
61
|
+
description: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Prefix to use for tool names from this collection.
|
|
65
|
+
* Provides clean, readable tool names (e.g., "jira" instead of "https://mcp.atlassian.com/v1/mcp")
|
|
66
|
+
*/
|
|
67
|
+
namespace: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Vertesia SDK tool collection configuration
|
|
72
|
+
*/
|
|
73
|
+
export interface VertesiaSDKToolCollectionObject extends BaseToolCollectionObject {
|
|
74
|
+
type: "vertesia_sdk";
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Optional namespace to use for tool names from this collection.
|
|
78
|
+
* If not provided, the tool server default will be used.
|
|
79
|
+
*/
|
|
80
|
+
namespace?: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Optional name for the tool collection.
|
|
84
|
+
* If not provided, the tool server default will be used.
|
|
85
|
+
*/
|
|
86
|
+
name?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Optional description for the tool collection.
|
|
90
|
+
* If not provided, the tool server default will be used.
|
|
91
|
+
*/
|
|
92
|
+
description?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Tool collection configuration (object format)
|
|
97
|
+
*/
|
|
98
|
+
export type ToolCollectionObject = MCPToolCollectionObject | VertesiaSDKToolCollectionObject;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Tool collection can be either:
|
|
102
|
+
* - A string URL (legacy format, with "mcp:" prefix for MCP servers)
|
|
103
|
+
* - An object with url, type, and optional auth (new format)
|
|
104
|
+
*/
|
|
105
|
+
export type ToolCollection = string | ToolCollectionObject;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Normalizes a tool collection to the object format.
|
|
109
|
+
* Handles backward compatibility with string URLs.
|
|
110
|
+
*
|
|
111
|
+
* @param collection - String URL or ToolCollectionObject
|
|
112
|
+
* @returns Normalized ToolCollectionObject
|
|
113
|
+
*/
|
|
114
|
+
export function normalizeToolCollection(collection: ToolCollection): ToolCollectionObject {
|
|
115
|
+
if (typeof collection === 'string') {
|
|
116
|
+
// Legacy string format
|
|
117
|
+
if (collection.startsWith('mcp:')) {
|
|
118
|
+
const url = collection.substring('mcp:'.length);
|
|
119
|
+
// For legacy MCP strings, derive name and prefix from URL
|
|
120
|
+
const urlObj = new URL(url);
|
|
121
|
+
const name = urlObj.hostname.replace(/\./g, '-');
|
|
122
|
+
return {
|
|
123
|
+
url,
|
|
124
|
+
type: 'mcp',
|
|
125
|
+
name,
|
|
126
|
+
description: `MCP server at ${url}`,
|
|
127
|
+
namespace: name
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
url: collection,
|
|
132
|
+
type: 'vertesia_sdk'
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Already in object format
|
|
136
|
+
return collection;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Tool definition with optional activation control for agent exposure.
|
|
142
|
+
*/
|
|
143
|
+
export interface AgentToolDefinition extends ToolDefinition {
|
|
144
|
+
/**
|
|
145
|
+
* The tool category if any - for UI purposes.
|
|
146
|
+
*/
|
|
147
|
+
category?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Whether this tool is available by default.
|
|
150
|
+
* - true/undefined: Tool is always available to agents
|
|
151
|
+
* - false: Tool is only available when activated by a skill's related_tools
|
|
152
|
+
*/
|
|
153
|
+
default?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* For skill tools (learn_*): list of related tool names that become available
|
|
156
|
+
* when this skill is called. Used for dynamic tool discovery.
|
|
157
|
+
*/
|
|
158
|
+
related_tools?: string[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type AppCapabilities = 'ui' | 'tools' | 'interactions' | 'types';
|
|
18
162
|
export interface AppManifestData {
|
|
19
163
|
/**
|
|
20
164
|
* The name of the app, used as the id in the system.
|
|
@@ -47,28 +191,89 @@ export interface AppManifestData {
|
|
|
47
191
|
|
|
48
192
|
status: "beta" | "stable" | "deprecated"
|
|
49
193
|
|
|
194
|
+
/**
|
|
195
|
+
* The UI configuration of the app. If not specified and the app "ui" is in the app capabilities
|
|
196
|
+
* then the ui configuration will be fetched from the endpoint property.
|
|
197
|
+
*/
|
|
50
198
|
ui?: AppUIConfig
|
|
51
199
|
|
|
52
200
|
/**
|
|
53
201
|
* A list of tool collections endpoints to be used by this app.
|
|
54
202
|
* A tools collection endpoint is an URL which may end with a `?import` query string.
|
|
55
203
|
* If the `?import` query string is used the tool will be imported as a javascript module and not executed through a POST on the collections endpoint.
|
|
204
|
+
* This feature is for advanced composition of tools. Prefer using endpoint.
|
|
56
205
|
*/
|
|
57
|
-
tool_collections?:
|
|
206
|
+
tool_collections?: ToolCollection[]
|
|
58
207
|
|
|
59
208
|
/**
|
|
60
209
|
* An URL providing interactions definitions in JSON format.
|
|
61
210
|
* The URL must provide 2 endpoints:
|
|
62
211
|
* 1. GET URL - must return a JSON array with the list of interactions (as AppInteractionRef[])
|
|
63
212
|
* 2. GET URL/{interaction_name} - must return the full interaction definition for the specified interaction.
|
|
213
|
+
* This feature is for advanced composition of interactions. Prefer using endpoint.
|
|
64
214
|
*/
|
|
65
215
|
interactions?: string;
|
|
66
216
|
|
|
67
217
|
/**
|
|
68
218
|
* A JSON chema for the app installation settings.
|
|
219
|
+
* @deprecated Use endpoint to provide settings_schema instead
|
|
69
220
|
*/
|
|
70
221
|
settings_schema?: JSONSchema;
|
|
222
|
+
|
|
223
|
+
/** The following API is part of the second version of the manifest and deprectaes similar properties included directly in the manifest */
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Describe the capabiltities of this app - which kind of contributions it provides.
|
|
227
|
+
*/
|
|
228
|
+
capabilities?: AppCapabilities[];
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The app endpoint URL
|
|
232
|
+
* This URL should return a JSON object describing the contributions provided by the app.
|
|
233
|
+
* The object shape must satisfies AppPackage interface.
|
|
234
|
+
* The endpoint must support GET method and a `scope` parameter to filter which resources are included in the returned AppPackage:
|
|
235
|
+
* The supported scope values are:
|
|
236
|
+
* - ui
|
|
237
|
+
* - tools
|
|
238
|
+
* - interactions
|
|
239
|
+
* - types
|
|
240
|
+
* - settings
|
|
241
|
+
* - all (the default if no scope is provided)
|
|
242
|
+
* You can also use comma-separated values to combine scopes (e.g. "ui,tools").
|
|
243
|
+
*
|
|
244
|
+
* Example:
|
|
245
|
+
* - ?scope=ui,tools - returns only the UI configuration
|
|
246
|
+
*/
|
|
247
|
+
endpoint?: string;
|
|
71
248
|
}
|
|
249
|
+
export type AppPackageScope = 'ui' | 'tools' | 'interactions' | 'types' | 'settings' | 'all';
|
|
250
|
+
export interface AppPackage {
|
|
251
|
+
/**
|
|
252
|
+
* The UI configuration of the app
|
|
253
|
+
*/
|
|
254
|
+
ui?: AppUIConfig
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* A list of tools exposed by the app.
|
|
258
|
+
*/
|
|
259
|
+
tools?: AgentToolDefinition[]
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* A list of interactions exposed by the app
|
|
263
|
+
*/
|
|
264
|
+
interactions?: CatalogInteractionRef[];
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* A list of types.
|
|
268
|
+
*/
|
|
269
|
+
types?: InCodeTypeDefinition[];
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* A JSON chema for the app installation settings.
|
|
273
|
+
*/
|
|
274
|
+
settings_schema?: JSONSchema;
|
|
275
|
+
}
|
|
276
|
+
|
|
72
277
|
export interface AppManifest extends AppManifestData {
|
|
73
278
|
id: string;
|
|
74
279
|
account: string;
|
|
@@ -97,7 +302,7 @@ export interface AppInstallationPayload {
|
|
|
97
302
|
export type AppInstallationKind = 'ui' | 'tools' | 'all';
|
|
98
303
|
|
|
99
304
|
/**
|
|
100
|
-
* A
|
|
305
|
+
* A description of the tools provided by an app
|
|
101
306
|
*/
|
|
102
307
|
export interface AppToolCollection {
|
|
103
308
|
/**
|
|
@@ -115,3 +320,63 @@ export interface AppToolCollection {
|
|
|
115
320
|
*/
|
|
116
321
|
tools: { name: string, description?: string }[]
|
|
117
322
|
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Information about a tool and its associated app installation.
|
|
326
|
+
* Used to look up which app provides a specific tool.
|
|
327
|
+
*/
|
|
328
|
+
export interface ProjectToolInfo {
|
|
329
|
+
/**
|
|
330
|
+
* The tool name
|
|
331
|
+
*/
|
|
332
|
+
tool_name: string;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Optional tool description
|
|
336
|
+
*/
|
|
337
|
+
tool_description?: string;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* The app name that provides this tool
|
|
341
|
+
*/
|
|
342
|
+
app_name: string;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* The app installation ID
|
|
346
|
+
*/
|
|
347
|
+
app_install_id: string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* The app installation settings.
|
|
351
|
+
* Only included for agent tokens, not user tokens (security: may contain API keys).
|
|
352
|
+
*/
|
|
353
|
+
settings?: Record<string, any>;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* OAuth authentication status for an MCP tool collection
|
|
358
|
+
*/
|
|
359
|
+
export interface OAuthAuthStatus {
|
|
360
|
+
collection_name: string;
|
|
361
|
+
authenticated: boolean;
|
|
362
|
+
mcp_server_url: string;
|
|
363
|
+
expires_at?: string;
|
|
364
|
+
scope?: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Response from OAuth authorization endpoint
|
|
369
|
+
*/
|
|
370
|
+
export interface OAuthAuthorizeResponse {
|
|
371
|
+
authorization_url: string;
|
|
372
|
+
state: string;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Response from OAuth metadata endpoint
|
|
377
|
+
*/
|
|
378
|
+
export interface OAuthMetadataResponse {
|
|
379
|
+
collection_name: string;
|
|
380
|
+
mcp_server_url: string;
|
|
381
|
+
metadata: any;
|
|
382
|
+
}
|
package/src/ask-user.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for ask_user tool UX configuration.
|
|
3
|
+
* These types enable the model to transmit structured UX parameters
|
|
4
|
+
* that render as interactive widgets instead of plain text.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Option for user selection in ask_user widget */
|
|
8
|
+
export interface AskUserOption {
|
|
9
|
+
/** Unique identifier returned when this option is selected */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Display text for the option */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Optional tooltip/description shown on hover */
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** UX configuration for ask_user messages */
|
|
18
|
+
export interface AskUserUxConfig {
|
|
19
|
+
/** Predefined options for the user to select from */
|
|
20
|
+
options?: AskUserOption[];
|
|
21
|
+
/** Visual style variant */
|
|
22
|
+
variant?: 'default' | 'warning' | 'info' | 'success';
|
|
23
|
+
/** Allow selecting multiple options (renders checkboxes instead of buttons) */
|
|
24
|
+
multiSelect?: boolean;
|
|
25
|
+
/** Show text input for free-form response */
|
|
26
|
+
allowFreeResponse?: boolean;
|
|
27
|
+
/** Placeholder text for free-form input */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Message details structure for REQUEST_INPUT messages with UX config */
|
|
32
|
+
export interface AskUserMessageDetails {
|
|
33
|
+
/** UX configuration for rendering the ask_user widget */
|
|
34
|
+
ux?: AskUserUxConfig;
|
|
35
|
+
}
|
package/src/channels.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EmailChannel, isEmailChannel, UserChannel } from "./interaction.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Find the email channel from a list of channels.
|
|
5
|
+
* @returns The email channel if found, undefined otherwise
|
|
6
|
+
*/
|
|
7
|
+
export function findEmailChannel(channels?: UserChannel[]): EmailChannel | undefined {
|
|
8
|
+
return channels?.find(isEmailChannel);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Check if email channel is enabled in the channels list.
|
|
13
|
+
*/
|
|
14
|
+
export function hasEmailChannel(channels?: UserChannel[]): boolean {
|
|
15
|
+
return !!findEmailChannel(channels);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Update the email channel in a channels array (immutable).
|
|
20
|
+
* Returns a new array with the updated channel.
|
|
21
|
+
* If no email channel exists and to_email is provided, creates one.
|
|
22
|
+
*/
|
|
23
|
+
export function updateEmailChannel(
|
|
24
|
+
channels: UserChannel[] | undefined,
|
|
25
|
+
updates: Partial<Omit<EmailChannel, "type">>
|
|
26
|
+
): UserChannel[] {
|
|
27
|
+
const existing = channels || [];
|
|
28
|
+
const emailIndex = existing.findIndex(isEmailChannel);
|
|
29
|
+
|
|
30
|
+
if (emailIndex === -1) {
|
|
31
|
+
// No email channel exists, create one if we have required fields
|
|
32
|
+
if (updates.to_email) {
|
|
33
|
+
return [...existing, { type: "email", ...updates } as EmailChannel];
|
|
34
|
+
}
|
|
35
|
+
return existing;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Update existing email channel
|
|
39
|
+
const updated = [...existing];
|
|
40
|
+
updated[emailIndex] = {
|
|
41
|
+
...updated[emailIndex],
|
|
42
|
+
...updates,
|
|
43
|
+
type: "email",
|
|
44
|
+
} as EmailChannel;
|
|
45
|
+
return updated;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Update email threading info after sending or receiving an email.
|
|
50
|
+
* Adds the new messageId to references and updates in_reply_to.
|
|
51
|
+
*/
|
|
52
|
+
export function updateEmailThreading(
|
|
53
|
+
channels: UserChannel[] | undefined,
|
|
54
|
+
messageId: string,
|
|
55
|
+
subject?: string
|
|
56
|
+
): UserChannel[] {
|
|
57
|
+
const emailChannel = findEmailChannel(channels);
|
|
58
|
+
if (!emailChannel) return channels || [];
|
|
59
|
+
|
|
60
|
+
const newReferences = emailChannel.references ? [...emailChannel.references] : [];
|
|
61
|
+
if (!newReferences.includes(messageId)) {
|
|
62
|
+
newReferences.push(messageId);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return updateEmailChannel(channels, {
|
|
66
|
+
in_reply_to: messageId,
|
|
67
|
+
references: newReferences,
|
|
68
|
+
thread_subject: subject || emailChannel.thread_subject,
|
|
69
|
+
});
|
|
70
|
+
}
|