@vertesia/common 0.24.0-dev.202601221707
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/LICENSE +13 -0
- package/README.md +53 -0
- package/lib/cjs/Progress.js +61 -0
- package/lib/cjs/Progress.js.map +1 -0
- package/lib/cjs/access-control.js +56 -0
- package/lib/cjs/access-control.js.map +1 -0
- package/lib/cjs/analytics.js +3 -0
- package/lib/cjs/analytics.js.map +1 -0
- package/lib/cjs/apikey.js +16 -0
- package/lib/cjs/apikey.js.map +1 -0
- package/lib/cjs/apps.js +35 -0
- package/lib/cjs/apps.js.map +1 -0
- package/lib/cjs/ask-user.js +8 -0
- package/lib/cjs/ask-user.js.map +1 -0
- package/lib/cjs/channels.js +63 -0
- package/lib/cjs/channels.js.map +1 -0
- package/lib/cjs/common.js +3 -0
- package/lib/cjs/common.js.map +1 -0
- package/lib/cjs/data-platform.js +127 -0
- package/lib/cjs/data-platform.js.map +1 -0
- package/lib/cjs/email.js +20 -0
- package/lib/cjs/email.js.map +1 -0
- package/lib/cjs/environment.js +44 -0
- package/lib/cjs/environment.js.map +1 -0
- package/lib/cjs/facets.js +3 -0
- package/lib/cjs/facets.js.map +1 -0
- package/lib/cjs/group.js +5 -0
- package/lib/cjs/group.js.map +1 -0
- package/lib/cjs/index.js +55 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/integrations.js +14 -0
- package/lib/cjs/integrations.js.map +1 -0
- package/lib/cjs/interaction.js +97 -0
- package/lib/cjs/interaction.js.map +1 -0
- package/lib/cjs/json-schema.js +3 -0
- package/lib/cjs/json-schema.js.map +1 -0
- package/lib/cjs/json.js +3 -0
- package/lib/cjs/json.js.map +1 -0
- package/lib/cjs/meters.js +13 -0
- package/lib/cjs/meters.js.map +1 -0
- package/lib/cjs/model_utility.js +6 -0
- package/lib/cjs/model_utility.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/payload.js +3 -0
- package/lib/cjs/payload.js.map +1 -0
- package/lib/cjs/pending-asks.js +7 -0
- package/lib/cjs/pending-asks.js.map +1 -0
- package/lib/cjs/project.js +107 -0
- package/lib/cjs/project.js.map +1 -0
- package/lib/cjs/prompt.js +21 -0
- package/lib/cjs/prompt.js.map +1 -0
- package/lib/cjs/query.js +3 -0
- package/lib/cjs/query.js.map +1 -0
- package/lib/cjs/rate-limiter.js +6 -0
- package/lib/cjs/rate-limiter.js.map +1 -0
- package/lib/cjs/refs.js +14 -0
- package/lib/cjs/refs.js.map +1 -0
- package/lib/cjs/runs.js +3 -0
- package/lib/cjs/runs.js.map +1 -0
- package/lib/cjs/skill.js +14 -0
- package/lib/cjs/skill.js.map +1 -0
- package/lib/cjs/store/activity-catalog.js +3 -0
- package/lib/cjs/store/activity-catalog.js.map +1 -0
- package/lib/cjs/store/collections.js +9 -0
- package/lib/cjs/store/collections.js.map +1 -0
- package/lib/cjs/store/common.js +3 -0
- package/lib/cjs/store/common.js.map +1 -0
- package/lib/cjs/store/conversation-state.js +3 -0
- package/lib/cjs/store/conversation-state.js.map +1 -0
- package/lib/cjs/store/doc-analyzer.js +3 -0
- package/lib/cjs/store/doc-analyzer.js.map +1 -0
- package/lib/cjs/store/dsl-workflow.js +5 -0
- package/lib/cjs/store/dsl-workflow.js.map +1 -0
- package/lib/cjs/store/index.js +30 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/object-types.js +98 -0
- package/lib/cjs/store/object-types.js.map +1 -0
- package/lib/cjs/store/schedule.js +32 -0
- package/lib/cjs/store/schedule.js.map +1 -0
- package/lib/cjs/store/signals.js +3 -0
- package/lib/cjs/store/signals.js.map +1 -0
- package/lib/cjs/store/store.js +166 -0
- package/lib/cjs/store/store.js.map +1 -0
- package/lib/cjs/store/temporalio.js +44 -0
- package/lib/cjs/store/temporalio.js.map +1 -0
- package/lib/cjs/store/worker.js +3 -0
- package/lib/cjs/store/worker.js.map +1 -0
- package/lib/cjs/store/workflow.js +241 -0
- package/lib/cjs/store/workflow.js.map +1 -0
- package/lib/cjs/sts-token-types.js +32 -0
- package/lib/cjs/sts-token-types.js.map +1 -0
- package/lib/cjs/tenant.js +3 -0
- package/lib/cjs/tenant.js.map +1 -0
- package/lib/cjs/tool-execution.js +6 -0
- package/lib/cjs/tool-execution.js.map +1 -0
- package/lib/cjs/training.js +14 -0
- package/lib/cjs/training.js.map +1 -0
- package/lib/cjs/transient-tokens.js +9 -0
- package/lib/cjs/transient-tokens.js.map +1 -0
- package/lib/cjs/user.js +25 -0
- package/lib/cjs/user.js.map +1 -0
- package/lib/cjs/utils/auth.js +15 -0
- package/lib/cjs/utils/auth.js.map +1 -0
- package/lib/cjs/utils/schemas.js +114 -0
- package/lib/cjs/utils/schemas.js.map +1 -0
- package/lib/cjs/utils/type-helpers.js +3 -0
- package/lib/cjs/utils/type-helpers.js.map +1 -0
- package/lib/cjs/versions.js +8 -0
- package/lib/cjs/versions.js.map +1 -0
- package/lib/cjs/workflow-analytics.js +52 -0
- package/lib/cjs/workflow-analytics.js.map +1 -0
- package/lib/esm/Progress.js +57 -0
- package/lib/esm/Progress.js.map +1 -0
- package/lib/esm/access-control.js +53 -0
- package/lib/esm/access-control.js.map +1 -0
- package/lib/esm/analytics.js +2 -0
- package/lib/esm/analytics.js.map +1 -0
- package/lib/esm/apikey.js +13 -0
- package/lib/esm/apikey.js.map +1 -0
- package/lib/esm/apps.js +32 -0
- package/lib/esm/apps.js.map +1 -0
- package/lib/esm/ask-user.js +7 -0
- package/lib/esm/ask-user.js.map +1 -0
- package/lib/esm/channels.js +57 -0
- package/lib/esm/channels.js.map +1 -0
- package/lib/esm/common.js +2 -0
- package/lib/esm/common.js.map +1 -0
- package/lib/esm/data-platform.js +124 -0
- package/lib/esm/data-platform.js.map +1 -0
- package/lib/esm/email.js +16 -0
- package/lib/esm/email.js.map +1 -0
- package/lib/esm/environment.js +41 -0
- package/lib/esm/environment.js.map +1 -0
- package/lib/esm/facets.js +2 -0
- package/lib/esm/facets.js.map +1 -0
- package/lib/esm/group.js +2 -0
- package/lib/esm/group.js.map +1 -0
- package/lib/esm/index.js +39 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/integrations.js +11 -0
- package/lib/esm/integrations.js.map +1 -0
- package/lib/esm/interaction.js +92 -0
- package/lib/esm/interaction.js.map +1 -0
- package/lib/esm/json-schema.js +2 -0
- package/lib/esm/json-schema.js.map +1 -0
- package/lib/esm/json.js +2 -0
- package/lib/esm/json.js.map +1 -0
- package/lib/esm/meters.js +10 -0
- package/lib/esm/meters.js.map +1 -0
- package/lib/esm/model_utility.js +2 -0
- package/lib/esm/model_utility.js.map +1 -0
- package/lib/esm/payload.js +2 -0
- package/lib/esm/payload.js.map +1 -0
- package/lib/esm/pending-asks.js +6 -0
- package/lib/esm/pending-asks.js.map +1 -0
- package/lib/esm/project.js +102 -0
- package/lib/esm/project.js.map +1 -0
- package/lib/esm/prompt.js +18 -0
- package/lib/esm/prompt.js.map +1 -0
- package/lib/esm/query.js +2 -0
- package/lib/esm/query.js.map +1 -0
- package/lib/esm/rate-limiter.js +5 -0
- package/lib/esm/rate-limiter.js.map +1 -0
- package/lib/esm/refs.js +11 -0
- package/lib/esm/refs.js.map +1 -0
- package/lib/esm/runs.js +2 -0
- package/lib/esm/runs.js.map +1 -0
- package/lib/esm/skill.js +13 -0
- package/lib/esm/skill.js.map +1 -0
- package/lib/esm/store/activity-catalog.js +2 -0
- package/lib/esm/store/activity-catalog.js.map +1 -0
- package/lib/esm/store/collections.js +6 -0
- package/lib/esm/store/collections.js.map +1 -0
- package/lib/esm/store/common.js +2 -0
- package/lib/esm/store/common.js.map +1 -0
- package/lib/esm/store/conversation-state.js +2 -0
- package/lib/esm/store/conversation-state.js.map +1 -0
- package/lib/esm/store/doc-analyzer.js +2 -0
- package/lib/esm/store/doc-analyzer.js.map +1 -0
- package/lib/esm/store/dsl-workflow.js +2 -0
- package/lib/esm/store/dsl-workflow.js.map +1 -0
- package/lib/esm/store/index.js +14 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/object-types.js +95 -0
- package/lib/esm/store/object-types.js.map +1 -0
- package/lib/esm/store/schedule.js +29 -0
- package/lib/esm/store/schedule.js.map +1 -0
- package/lib/esm/store/signals.js +2 -0
- package/lib/esm/store/signals.js.map +1 -0
- package/lib/esm/store/store.js +160 -0
- package/lib/esm/store/store.js.map +1 -0
- package/lib/esm/store/temporalio.js +41 -0
- package/lib/esm/store/temporalio.js.map +1 -0
- package/lib/esm/store/worker.js +2 -0
- package/lib/esm/store/worker.js.map +1 -0
- package/lib/esm/store/workflow.js +228 -0
- package/lib/esm/store/workflow.js.map +1 -0
- package/lib/esm/sts-token-types.js +24 -0
- package/lib/esm/sts-token-types.js.map +1 -0
- package/lib/esm/tenant.js +2 -0
- package/lib/esm/tenant.js.map +1 -0
- package/lib/esm/tool-execution.js +5 -0
- package/lib/esm/tool-execution.js.map +1 -0
- package/lib/esm/training.js +11 -0
- package/lib/esm/training.js.map +1 -0
- package/lib/esm/transient-tokens.js +6 -0
- package/lib/esm/transient-tokens.js.map +1 -0
- package/lib/esm/user.js +22 -0
- package/lib/esm/user.js.map +1 -0
- package/lib/esm/utils/auth.js +11 -0
- package/lib/esm/utils/auth.js.map +1 -0
- package/lib/esm/utils/schemas.js +107 -0
- package/lib/esm/utils/schemas.js.map +1 -0
- package/lib/esm/utils/type-helpers.js +2 -0
- package/lib/esm/utils/type-helpers.js.map +1 -0
- package/lib/esm/versions.js +5 -0
- package/lib/esm/versions.js.map +1 -0
- package/lib/esm/workflow-analytics.js +49 -0
- package/lib/esm/workflow-analytics.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/Progress.d.ts +21 -0
- package/lib/types/Progress.d.ts.map +1 -0
- package/lib/types/access-control.d.ts +73 -0
- package/lib/types/access-control.d.ts.map +1 -0
- package/lib/types/analytics.d.ts +87 -0
- package/lib/types/analytics.d.ts.map +1 -0
- package/lib/types/apikey.d.ts +98 -0
- package/lib/types/apikey.d.ts.map +1 -0
- package/lib/types/apps.d.ts +236 -0
- package/lib/types/apps.d.ts.map +1 -0
- package/lib/types/ask-user.d.ts +32 -0
- package/lib/types/ask-user.d.ts.map +1 -0
- package/lib/types/channels.d.ts +21 -0
- package/lib/types/channels.d.ts.map +1 -0
- package/lib/types/common.d.ts +31 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/data-platform.d.ts +860 -0
- package/lib/types/data-platform.d.ts.map +1 -0
- package/lib/types/email.d.ts +66 -0
- package/lib/types/email.d.ts.map +1 -0
- package/lib/types/environment.d.ts +106 -0
- package/lib/types/environment.d.ts.map +1 -0
- package/lib/types/facets.d.ts +34 -0
- package/lib/types/facets.d.ts.map +1 -0
- package/lib/types/group.d.ts +21 -0
- package/lib/types/group.d.ts.map +1 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/integrations.d.ts +60 -0
- package/lib/types/integrations.d.ts.map +1 -0
- package/lib/types/interaction.d.ts +958 -0
- package/lib/types/interaction.d.ts.map +1 -0
- package/lib/types/json-schema.d.ts +1 -0
- package/lib/types/json-schema.d.ts.map +1 -0
- package/lib/types/json.d.ts +1 -0
- package/lib/types/json.d.ts.map +1 -0
- package/lib/types/meters.d.ts +23 -0
- package/lib/types/meters.d.ts.map +1 -0
- package/lib/types/model_utility.d.ts +1 -0
- package/lib/types/model_utility.d.ts.map +1 -0
- package/lib/types/payload.d.ts +60 -0
- package/lib/types/payload.d.ts.map +1 -0
- package/lib/types/pending-asks.d.ts +93 -0
- package/lib/types/pending-asks.d.ts.map +1 -0
- package/lib/types/project.d.ts +179 -0
- package/lib/types/project.d.ts.map +1 -0
- package/lib/types/prompt.d.ts +78 -0
- package/lib/types/prompt.d.ts.map +1 -0
- package/lib/types/query.d.ts +118 -0
- package/lib/types/query.d.ts.map +1 -0
- package/lib/types/rate-limiter.d.ts +28 -0
- package/lib/types/rate-limiter.d.ts.map +1 -0
- package/lib/types/refs.d.ts +22 -0
- package/lib/types/refs.d.ts.map +1 -0
- package/lib/types/runs.d.ts +32 -0
- package/lib/types/runs.d.ts.map +1 -0
- package/lib/types/skill.d.ts +78 -0
- package/lib/types/skill.d.ts.map +1 -0
- package/lib/types/store/activity-catalog.d.ts +26 -0
- package/lib/types/store/activity-catalog.d.ts.map +1 -0
- package/lib/types/store/collections.d.ts +78 -0
- package/lib/types/store/collections.d.ts.map +1 -0
- package/lib/types/store/common.d.ts +22 -0
- package/lib/types/store/common.d.ts.map +1 -0
- package/lib/types/store/conversation-state.d.ts +120 -0
- package/lib/types/store/conversation-state.d.ts.map +1 -0
- package/lib/types/store/doc-analyzer.d.ts +140 -0
- package/lib/types/store/doc-analyzer.d.ts.map +1 -0
- package/lib/types/store/dsl-workflow.d.ts +244 -0
- package/lib/types/store/dsl-workflow.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +13 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/object-types.d.ts +23 -0
- package/lib/types/store/object-types.d.ts.map +1 -0
- package/lib/types/store/schedule.d.ts +182 -0
- package/lib/types/store/schedule.d.ts.map +1 -0
- package/lib/types/store/signals.d.ts +24 -0
- package/lib/types/store/signals.d.ts.map +1 -0
- package/lib/types/store/store.d.ts +407 -0
- package/lib/types/store/store.d.ts.map +1 -0
- package/lib/types/store/temporalio.d.ts +16 -0
- package/lib/types/store/temporalio.d.ts.map +1 -0
- package/lib/types/store/worker.d.ts +18 -0
- package/lib/types/store/worker.d.ts.map +1 -0
- package/lib/types/store/workflow.d.ts +730 -0
- package/lib/types/store/workflow.d.ts.map +1 -0
- package/lib/types/sts-token-types.d.ts +72 -0
- package/lib/types/sts-token-types.d.ts.map +1 -0
- package/lib/types/tenant.d.ts +10 -0
- package/lib/types/tenant.d.ts.map +1 -0
- package/lib/types/tool-execution.d.ts +45 -0
- package/lib/types/tool-execution.d.ts.map +1 -0
- package/lib/types/training.d.ts +38 -0
- package/lib/types/training.d.ts.map +1 -0
- package/lib/types/transient-tokens.d.ts +24 -0
- package/lib/types/transient-tokens.d.ts.map +1 -0
- package/lib/types/user.d.ts +116 -0
- package/lib/types/user.d.ts.map +1 -0
- package/lib/types/utils/auth.d.ts +3 -0
- package/lib/types/utils/auth.d.ts.map +1 -0
- package/lib/types/utils/schemas.d.ts +9 -0
- package/lib/types/utils/schemas.d.ts.map +1 -0
- package/lib/types/utils/type-helpers.d.ts +3 -0
- package/lib/types/utils/type-helpers.d.ts.map +1 -0
- package/lib/types/versions.d.ts +3 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/types/workflow-analytics.d.ts +777 -0
- package/lib/types/workflow-analytics.d.ts.map +1 -0
- package/lib/vertesia-common.js +2 -0
- package/lib/vertesia-common.js.map +1 -0
- package/package.json +54 -0
- package/src/Progress.ts +57 -0
- package/src/access-control.ts +98 -0
- package/src/analytics.ts +106 -0
- package/src/apikey.ts +116 -0
- package/src/apps.ts +296 -0
- package/src/ask-user.ts +35 -0
- package/src/channels.ts +70 -0
- package/src/common.ts +37 -0
- package/src/data-platform.ts +976 -0
- package/src/email.ts +80 -0
- package/src/environment.ts +137 -0
- package/src/facets.ts +44 -0
- package/src/group.ts +26 -0
- package/src/index.ts +40 -0
- package/src/integrations.ts +72 -0
- package/src/interaction.ts +1182 -0
- package/src/json-schema.ts +7 -0
- package/src/json.ts +4 -0
- package/src/meters.ts +30 -0
- package/src/model_utility.ts +1 -0
- package/src/payload.ts +83 -0
- package/src/pending-asks.ts +106 -0
- package/src/project.ts +263 -0
- package/src/prompt.ts +103 -0
- package/src/query.ts +137 -0
- package/src/rate-limiter.ts +34 -0
- package/src/refs.ts +30 -0
- package/src/runs.ts +36 -0
- package/src/skill.ts +90 -0
- package/src/store/activity-catalog.ts +44 -0
- package/src/store/collections.ts +87 -0
- package/src/store/common.ts +30 -0
- package/src/store/conversation-state.ts +146 -0
- package/src/store/doc-analyzer.ts +161 -0
- package/src/store/dsl-workflow.ts +288 -0
- package/src/store/index.ts +14 -0
- package/src/store/ms.d.ts +11 -0
- package/src/store/object-types.ts +127 -0
- package/src/store/schedule.ts +238 -0
- package/src/store/signals.ts +25 -0
- package/src/store/store.ts +579 -0
- package/src/store/temporalio.ts +54 -0
- package/src/store/worker.ts +19 -0
- package/src/store/workflow.test.ts +578 -0
- package/src/store/workflow.ts +973 -0
- package/src/sts-token-types.ts +117 -0
- package/src/tenant.ts +10 -0
- package/src/tool-execution.ts +47 -0
- package/src/training.ts +44 -0
- package/src/transient-tokens.ts +30 -0
- package/src/user.ts +153 -0
- package/src/utils/auth.ts +12 -0
- package/src/utils/schemas.ts +108 -0
- package/src/utils/type-helpers.ts +6 -0
- package/src/versions.ts +3 -0
- package/src/workflow-analytics.ts +925 -0
- package/tsconfig.dist.json +20 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module access-control
|
|
3
|
+
* @description
|
|
4
|
+
* Access control interfaces
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ProjectRoles } from "./project.js";
|
|
8
|
+
|
|
9
|
+
export enum Permission {
|
|
10
|
+
int_read = "interaction:read",
|
|
11
|
+
int_write = "interaction:write",
|
|
12
|
+
int_delete = "interaction:delete",
|
|
13
|
+
|
|
14
|
+
int_execute = "interaction:execute",
|
|
15
|
+
run_read = "run:read",
|
|
16
|
+
run_write = "run:write",
|
|
17
|
+
|
|
18
|
+
env_admin = "environment:admin",
|
|
19
|
+
|
|
20
|
+
project_admin = "project:admin",
|
|
21
|
+
project_integration_read = "project:integration_read",
|
|
22
|
+
project_settings_write = "project:settings_write",
|
|
23
|
+
|
|
24
|
+
api_key_create = "api_key:create",
|
|
25
|
+
api_key_read = "api_key:read",
|
|
26
|
+
api_key_update = "api_key:update",
|
|
27
|
+
api_key_delete = "api_key:delete",
|
|
28
|
+
|
|
29
|
+
account_read = "account:read",
|
|
30
|
+
account_write = "account:write",
|
|
31
|
+
account_admin = "account:admin",
|
|
32
|
+
manage_billing = "account:billing",
|
|
33
|
+
account_member = "account:member",
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
content_read = "content:read",
|
|
37
|
+
content_write = "content:write",
|
|
38
|
+
content_delete = "content:delete",
|
|
39
|
+
content_admin = "content:admin", //manage schemas
|
|
40
|
+
content_superadmin = "content:superadmin", // list all objects and collections
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
workflow_run = "workflow:run",
|
|
44
|
+
workflow_admin = "workflow:admin",
|
|
45
|
+
workflow_superadmin = "workflow:superadmin",
|
|
46
|
+
|
|
47
|
+
iam_impersonate = "iam:impersonate",
|
|
48
|
+
|
|
49
|
+
/** whether the user has access to Sutdio App. */
|
|
50
|
+
studio_access = "studio:access",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export enum AccessControlResourceType {
|
|
54
|
+
project = "project",
|
|
55
|
+
environment = "environment",
|
|
56
|
+
account = "account",
|
|
57
|
+
interaction = "interaction",
|
|
58
|
+
app = "application",
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export enum AccessControlPrincipalType {
|
|
62
|
+
user = "user",
|
|
63
|
+
group = "group",
|
|
64
|
+
apikey = "apikey",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export interface AccessControlEntry {
|
|
70
|
+
role: ProjectRoles;
|
|
71
|
+
resource_type: AccessControlResourceType;
|
|
72
|
+
resource: string; //objectId
|
|
73
|
+
principal_type: AccessControlPrincipalType;
|
|
74
|
+
principal: string; //objectId
|
|
75
|
+
tags?: string[];
|
|
76
|
+
expires_at?: string;
|
|
77
|
+
created_at?: string;
|
|
78
|
+
updated_at?: string;
|
|
79
|
+
id: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface ACECreatePayload extends
|
|
83
|
+
Omit<AccessControlEntry, "created_at" | "updated_at" | "id"> {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ACEUpdatePayload extends Partial<ACECreatePayload> {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export interface AcesQueryOptions {
|
|
91
|
+
|
|
92
|
+
level?: 'resource' | 'project' | 'projects' | 'account'
|
|
93
|
+
resource?: string
|
|
94
|
+
principal?: string
|
|
95
|
+
role?: string
|
|
96
|
+
type?: AccessControlResourceType
|
|
97
|
+
|
|
98
|
+
}
|
package/src/analytics.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
|
|
2
|
+
export interface AnalyticsAxis {
|
|
3
|
+
environment?: string;
|
|
4
|
+
project?: string;
|
|
5
|
+
interactions?: string[];
|
|
6
|
+
models?: string[];
|
|
7
|
+
status?: string[];
|
|
8
|
+
tags?: string[];
|
|
9
|
+
selectedOnly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RunAnalyticsQuery {
|
|
13
|
+
|
|
14
|
+
/** filters to apply to the query */
|
|
15
|
+
filterBy: AnalyticsAxis;
|
|
16
|
+
|
|
17
|
+
/** The field to group by */
|
|
18
|
+
groupBy?: RunAnalyticsGroupBy
|
|
19
|
+
|
|
20
|
+
/** The start date of the query in EPOCH format */
|
|
21
|
+
from?: number;
|
|
22
|
+
/** The end date of the query in EPOCH format */
|
|
23
|
+
to?: number;
|
|
24
|
+
|
|
25
|
+
/** The time resolution unit of the analytics query */
|
|
26
|
+
resolution?: TimeResolution;
|
|
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
|
+
|
|
31
|
+
/** The field to sort by */
|
|
32
|
+
virtual?: boolean;
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export type RunAnalyticsGroupBy = "interaction" | "modelId" | "project" | "status" | "tags" | "environment";
|
|
38
|
+
|
|
39
|
+
export type TimeResolution = "minute" | "hour" | "day" | "week" | "month" | "year";
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export interface RunAnalyticsResult {
|
|
43
|
+
date: string,
|
|
44
|
+
timestamp: string,
|
|
45
|
+
group: string
|
|
46
|
+
count: number,
|
|
47
|
+
execution_time: {
|
|
48
|
+
avg: number,
|
|
49
|
+
min: number,
|
|
50
|
+
max: number
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Entity with status breakdown (requires compound index for covered queries) */
|
|
55
|
+
export interface EntityStatusCounts {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
/** Total count, or null if query failed */
|
|
59
|
+
total: number | null;
|
|
60
|
+
/** Counts by status, values are null if individual status query failed */
|
|
61
|
+
byStatus: Record<string, number | null>;
|
|
62
|
+
/** True if any query for this entity failed */
|
|
63
|
+
hasErrors?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Lightweight analytics summary using covered queries - scalable to 1M+ documents */
|
|
67
|
+
export interface RunsAnalyticsSummary {
|
|
68
|
+
/** Total count of runs (from estimatedDocumentCount), null if failed */
|
|
69
|
+
total: number | null;
|
|
70
|
+
/** Counts by status, values are null if individual query failed */
|
|
71
|
+
byStatus: Record<string, number | null>;
|
|
72
|
+
/** Counts by environment with status breakdown (uses { environment: 1, status: 1 } compound index) */
|
|
73
|
+
byEnvironment: EntityStatusCounts[];
|
|
74
|
+
/** Counts by interaction with status breakdown (uses { interaction: 1, status: 1 } compound index) */
|
|
75
|
+
byInteraction: EntityStatusCounts[];
|
|
76
|
+
/** Number of queries that failed out of total */
|
|
77
|
+
queryStats: {
|
|
78
|
+
total: number;
|
|
79
|
+
failed: number;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Date range filter for analytics queries (uses created_at field) */
|
|
84
|
+
export interface DateRangeQuery {
|
|
85
|
+
/** Start date in ISO format, optional (unbounded if omitted) */
|
|
86
|
+
start?: string;
|
|
87
|
+
/** End date in ISO format, optional (unbounded if omitted) */
|
|
88
|
+
end?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Token usage for a single environment */
|
|
92
|
+
export interface TokenUsageByEnvironment {
|
|
93
|
+
environmentId: string;
|
|
94
|
+
environmentName: string;
|
|
95
|
+
/** Total prompt tokens, null if query failed */
|
|
96
|
+
totalPromptTokens: number | null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Summary of token usage by environment (requires { environment: 1, created_at: -1, "token_use.prompt": 1 } index) */
|
|
100
|
+
export interface TokenUsageSummary {
|
|
101
|
+
byEnvironment: TokenUsageByEnvironment[];
|
|
102
|
+
queryStats: {
|
|
103
|
+
total: number;
|
|
104
|
+
failed: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
package/src/apikey.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { UserGroupRef } from "./group.js";
|
|
2
|
+
import { ProjectRef, ProjectRoles } from "./project.js";
|
|
3
|
+
import { AccountRef } from "./user.js";
|
|
4
|
+
|
|
5
|
+
export enum ApiKeyTypes {
|
|
6
|
+
secret = "sk",
|
|
7
|
+
}
|
|
8
|
+
export interface ApiKey {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type: ApiKeyTypes;
|
|
12
|
+
role: ProjectRoles;
|
|
13
|
+
maskedValue?: string; //masked value
|
|
14
|
+
account: string; // the account id
|
|
15
|
+
project: ProjectRef; // the project id if any
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
created_by: string;
|
|
18
|
+
updated_by: string;
|
|
19
|
+
created_at: Date;
|
|
20
|
+
updated_at: Date;
|
|
21
|
+
expires_at?: Date; // in case of public key only
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CreateOrUpdateApiKeyPayload extends Partial<ApiKey> {}
|
|
25
|
+
|
|
26
|
+
export interface ApiKeyWithValue extends Omit<ApiKey, "maskedValue"> {
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CreatePublicKeyPayload {
|
|
31
|
+
name?: string;
|
|
32
|
+
projectId?: string;
|
|
33
|
+
ttl?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AuthTokenResponse {
|
|
37
|
+
token: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface AuthTokenPayload {
|
|
41
|
+
sub: string;
|
|
42
|
+
name: string;
|
|
43
|
+
email?: string;
|
|
44
|
+
picture?: string;
|
|
45
|
+
|
|
46
|
+
type: PrincipalType;
|
|
47
|
+
account: AccountRef;
|
|
48
|
+
|
|
49
|
+
account_roles: ProjectRoles[];
|
|
50
|
+
accounts: AccountRef[];
|
|
51
|
+
|
|
52
|
+
project?: ProjectRef;
|
|
53
|
+
project_roles?: ProjectRoles[];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The app names enabled for this token. Defaults to an empty array if no apps are enabled.
|
|
57
|
+
*/
|
|
58
|
+
apps: string[];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The user ID (if any) attached to the token.
|
|
62
|
+
* This is set when the token is a user token or an agent token running as a user.
|
|
63
|
+
* Not set for impersonating tokens like project tokens.
|
|
64
|
+
*/
|
|
65
|
+
user_id?: string;
|
|
66
|
+
|
|
67
|
+
/** groups */
|
|
68
|
+
groups?: UserGroupRef[]; //group ids
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* API endpoints information to be used with this token.
|
|
72
|
+
* Either a n API domain like 'api.vertesia.io' | 'api-preview.vertesia.io' | 'api-staging.vertesia.io' | 'local'
|
|
73
|
+
* or explicit studio, store, and token URLs.
|
|
74
|
+
*/
|
|
75
|
+
endpoints?:
|
|
76
|
+
| string
|
|
77
|
+
| {
|
|
78
|
+
studio: string;
|
|
79
|
+
store: string;
|
|
80
|
+
token?: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
iss: string; //issuer
|
|
84
|
+
aud: string; //audience
|
|
85
|
+
exp: number; //expires in (EPOC seconds)
|
|
86
|
+
tags?: string[]; //tags
|
|
87
|
+
|
|
88
|
+
permissions?: string[]; //permissions
|
|
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
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export enum PrincipalType {
|
|
111
|
+
User = "user",
|
|
112
|
+
Group = "group",
|
|
113
|
+
ApiKey = "apikey",
|
|
114
|
+
ServiceAccount = "service_account",
|
|
115
|
+
Agent = "agent",
|
|
116
|
+
}
|
package/src/apps.ts
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { JSONSchema } from "@llumiverse/common";
|
|
2
|
+
|
|
3
|
+
export interface AppUIConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The source URL of the app. The src can be a template which contain
|
|
6
|
+
* a variable named `buildId` which will be replaced with the current build id.
|
|
7
|
+
* For example: `/plugins/vertesia-review-center-${buildId}`
|
|
8
|
+
*/
|
|
9
|
+
src: string;
|
|
10
|
+
/**
|
|
11
|
+
* The isolation strategy. If not specified it defaults to shadow
|
|
12
|
+
* - shadow - use Shadow DOM to fully isolate the plugin from the host.
|
|
13
|
+
* - css - use CSS processing (like prefixing or other isolation techniques). Ligther but plugins may conflict with the host
|
|
14
|
+
*/
|
|
15
|
+
isolation?: "shadow" | "css";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Authentication type for tool collections
|
|
20
|
+
*/
|
|
21
|
+
export type ToolCollectionAuthType = "oauth" | "other";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Tool collection type
|
|
25
|
+
*/
|
|
26
|
+
export type ToolCollectionType = "mcp" | "vertesia_sdk";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Base tool collection configuration
|
|
30
|
+
*/
|
|
31
|
+
interface BaseToolCollectionObject {
|
|
32
|
+
/**
|
|
33
|
+
* The URL endpoint for the tool collection
|
|
34
|
+
*/
|
|
35
|
+
url: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Optional authentication type required for this tool collection
|
|
39
|
+
*/
|
|
40
|
+
auth?: ToolCollectionAuthType;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* MCP tool collection configuration (requires name, description, and namespace)
|
|
45
|
+
*/
|
|
46
|
+
export interface MCPToolCollectionObject extends BaseToolCollectionObject {
|
|
47
|
+
type: "mcp";
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Name for the tool collection.
|
|
51
|
+
* Used as an identifier for the collection (e.g., for OAuth authentication).
|
|
52
|
+
*/
|
|
53
|
+
name: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Description for the tool collection.
|
|
57
|
+
* Helps users understand what tools this collection provides.
|
|
58
|
+
*/
|
|
59
|
+
description: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Prefix to use for tool names from this collection.
|
|
63
|
+
* Provides clean, readable tool names (e.g., "jira" instead of "https://mcp.atlassian.com/v1/mcp")
|
|
64
|
+
*/
|
|
65
|
+
namespace: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Vertesia SDK tool collection configuration
|
|
70
|
+
*/
|
|
71
|
+
export interface VertesiaSDKToolCollectionObject extends BaseToolCollectionObject {
|
|
72
|
+
type: "vertesia_sdk";
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Optional namespace to use for tool names from this collection.
|
|
76
|
+
* If not provided, the tool server default will be used.
|
|
77
|
+
*/
|
|
78
|
+
namespace?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Optional name for the tool collection.
|
|
82
|
+
* If not provided, the tool server default will be used.
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Optional description for the tool collection.
|
|
88
|
+
* If not provided, the tool server default will be used.
|
|
89
|
+
*/
|
|
90
|
+
description?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Tool collection configuration (object format)
|
|
95
|
+
*/
|
|
96
|
+
export type ToolCollectionObject = MCPToolCollectionObject | VertesiaSDKToolCollectionObject;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Tool collection can be either:
|
|
100
|
+
* - A string URL (legacy format, with "mcp:" prefix for MCP servers)
|
|
101
|
+
* - An object with url, type, and optional auth (new format)
|
|
102
|
+
*/
|
|
103
|
+
export type ToolCollection = string | ToolCollectionObject;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Normalizes a tool collection to the object format.
|
|
107
|
+
* Handles backward compatibility with string URLs.
|
|
108
|
+
*
|
|
109
|
+
* @param collection - String URL or ToolCollectionObject
|
|
110
|
+
* @returns Normalized ToolCollectionObject
|
|
111
|
+
*/
|
|
112
|
+
export function normalizeToolCollection(collection: ToolCollection): ToolCollectionObject {
|
|
113
|
+
if (typeof collection === 'string') {
|
|
114
|
+
// Legacy string format
|
|
115
|
+
if (collection.startsWith('mcp:')) {
|
|
116
|
+
const url = collection.substring('mcp:'.length);
|
|
117
|
+
// For legacy MCP strings, derive name and prefix from URL
|
|
118
|
+
const urlObj = new URL(url);
|
|
119
|
+
const name = urlObj.hostname.replace(/\./g, '-');
|
|
120
|
+
return {
|
|
121
|
+
url,
|
|
122
|
+
type: 'mcp',
|
|
123
|
+
name,
|
|
124
|
+
description: `MCP server at ${url}`,
|
|
125
|
+
namespace: name
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
url: collection,
|
|
130
|
+
type: 'vertesia_sdk'
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// Already in object format
|
|
134
|
+
return collection;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface AppManifestData {
|
|
138
|
+
/**
|
|
139
|
+
* The name of the app, used as the id in the system.
|
|
140
|
+
* Must be in kebab case (e.g. my-app).
|
|
141
|
+
*/
|
|
142
|
+
name: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Visibility level of the app:
|
|
146
|
+
* - "public": visible to all accounts
|
|
147
|
+
* - "private": visible only to the owning account
|
|
148
|
+
* - "vertesia": visible only to Vertesia team members (any project)
|
|
149
|
+
*/
|
|
150
|
+
visibility: "public" | "private" | "vertesia";
|
|
151
|
+
|
|
152
|
+
title: string;
|
|
153
|
+
description: string;
|
|
154
|
+
publisher: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A svg icon for the app.
|
|
158
|
+
*/
|
|
159
|
+
icon?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* A color name to be used as the color of the app card (e.g. blue, red, green, etc.)
|
|
163
|
+
* If not specified a random color will be picked.
|
|
164
|
+
*/
|
|
165
|
+
color?: string;
|
|
166
|
+
|
|
167
|
+
status: "beta" | "stable" | "deprecated"
|
|
168
|
+
|
|
169
|
+
ui?: AppUIConfig
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A list of tool collections endpoints to be used by this app.
|
|
173
|
+
* A tools collection endpoint is an URL which may end with a `?import` query string.
|
|
174
|
+
* 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.
|
|
175
|
+
*/
|
|
176
|
+
tool_collections?: ToolCollection[]
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* An URL providing interactions definitions in JSON format.
|
|
180
|
+
* The URL must provide 2 endpoints:
|
|
181
|
+
* 1. GET URL - must return a JSON array with the list of interactions (as AppInteractionRef[])
|
|
182
|
+
* 2. GET URL/{interaction_name} - must return the full interaction definition for the specified interaction.
|
|
183
|
+
*/
|
|
184
|
+
interactions?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A JSON chema for the app installation settings.
|
|
188
|
+
*/
|
|
189
|
+
settings_schema?: JSONSchema;
|
|
190
|
+
}
|
|
191
|
+
export interface AppManifest extends AppManifestData {
|
|
192
|
+
id: string;
|
|
193
|
+
account: string;
|
|
194
|
+
created_at: string;
|
|
195
|
+
updated_at: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface AppInstallation {
|
|
199
|
+
id: string;
|
|
200
|
+
project: string; // the project where the app is installed
|
|
201
|
+
manifest: string; // the app manifest
|
|
202
|
+
settings?: Record<string, any>; // settings for the app installation
|
|
203
|
+
created_at: string;
|
|
204
|
+
updated_at: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface AppInstallationWithManifest extends Omit<AppInstallation, 'manifest'> {
|
|
208
|
+
manifest: AppManifest; // the app manifest data
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface AppInstallationPayload {
|
|
212
|
+
app_id: string,
|
|
213
|
+
settings?: Record<string, any>
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export type AppInstallationKind = 'ui' | 'tools' | 'all';
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A description of the tools provided by an app
|
|
220
|
+
*/
|
|
221
|
+
export interface AppToolCollection {
|
|
222
|
+
/**
|
|
223
|
+
* The collection name
|
|
224
|
+
*/
|
|
225
|
+
name: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Optional collection description
|
|
229
|
+
*/
|
|
230
|
+
description?: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* the tools provided by this collection
|
|
234
|
+
*/
|
|
235
|
+
tools: { name: string, description?: string }[]
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Information about a tool and its associated app installation.
|
|
240
|
+
* Used to look up which app provides a specific tool.
|
|
241
|
+
*/
|
|
242
|
+
export interface ProjectToolInfo {
|
|
243
|
+
/**
|
|
244
|
+
* The tool name
|
|
245
|
+
*/
|
|
246
|
+
tool_name: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Optional tool description
|
|
250
|
+
*/
|
|
251
|
+
tool_description?: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The app name that provides this tool
|
|
255
|
+
*/
|
|
256
|
+
app_name: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The app installation ID
|
|
260
|
+
*/
|
|
261
|
+
app_install_id: string;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The app installation settings.
|
|
265
|
+
* Only included for agent tokens, not user tokens (security: may contain API keys).
|
|
266
|
+
*/
|
|
267
|
+
settings?: Record<string, any>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* OAuth authentication status for an MCP tool collection
|
|
272
|
+
*/
|
|
273
|
+
export interface OAuthAuthStatus {
|
|
274
|
+
collection_name: string;
|
|
275
|
+
authenticated: boolean;
|
|
276
|
+
mcp_server_url: string;
|
|
277
|
+
expires_at?: string;
|
|
278
|
+
scope?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Response from OAuth authorization endpoint
|
|
283
|
+
*/
|
|
284
|
+
export interface OAuthAuthorizeResponse {
|
|
285
|
+
authorization_url: string;
|
|
286
|
+
state: string;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Response from OAuth metadata endpoint
|
|
291
|
+
*/
|
|
292
|
+
export interface OAuthMetadataResponse {
|
|
293
|
+
collection_name: string;
|
|
294
|
+
mcp_server_url: string;
|
|
295
|
+
metadata: any;
|
|
296
|
+
}
|
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
|
+
}
|