@xpert-ai/plugin-sdk 3.18.7 → 3.19.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.
- package/CHANGELOG.md +19 -0
- package/MIDDLEWARE_APPS.md +71 -0
- package/README.md +2 -0
- package/index.cjs.js +132 -56
- package/index.esm.js +120 -57
- package/package.json +2 -2
- package/runtime-capabilities.md +35 -0
- package/src/index.d.ts +3 -0
- package/src/lib/agent/index.d.ts +1 -0
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +55 -20
- package/src/lib/agent/middleware/types.d.ts +13 -3
- package/src/lib/agent/runtime/capability.d.ts +29 -0
- package/src/lib/agent/runtime/index.d.ts +3 -0
- package/src/lib/agent/runtime/strategy.d.ts +50 -0
- package/src/lib/agent/runtime/types.d.ts +132 -0
- package/src/lib/assistant-capability/index.d.ts +42 -0
- package/src/lib/connector/runtime-capability.d.ts +2 -0
- package/src/lib/connector/strategy.interface.d.ts +8 -0
- package/src/lib/core/context/request-context.d.ts +6 -0
- package/src/lib/core/strategy-bus.d.ts +0 -3
- package/src/lib/evolution/runtime-capability.d.ts +2 -1
- package/src/lib/integration/strategy.interface.d.ts +22 -0
- package/src/lib/mcp/app.d.ts +10 -0
- package/src/lib/project-task/index.d.ts +59 -0
- package/src/lib/project-type/index.d.ts +64 -0
- package/src/lib/runtime/capabilities/knowledge-graph.d.ts +59 -0
- package/src/lib/runtime/capabilities/knowledgebase-documents.d.ts +21 -0
- package/src/lib/runtime/capabilities/knowledgebase.d.ts +8 -3
- package/src/lib/runtime/capabilities/project-access.d.ts +2 -1
- package/src/lib/runtime/capabilities/project-provisioning.d.ts +3 -0
- package/src/lib/runtime/runtime-scope.d.ts +7 -1
- package/src/lib/sandbox/execution-environment.d.ts +10 -0
- package/src/lib/sandbox/execution.d.ts +3 -0
- package/src/lib/sandbox/index.d.ts +1 -0
- package/src/lib/sandbox/protocol.d.ts +2 -0
- package/src/lib/tool-provider/types.d.ts +6 -0
- package/src/lib/types.d.ts +2 -1
- package/src/lib/workflow/trigger/strategy.interface.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @xpert-ai/plugin-sdk
|
|
2
2
|
|
|
3
|
+
## 3.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 99d09ec: Release a coordinated minor update across all Xpert workspace packages, including the API, Web and Bosi applications, shared SDK and contracts, backend and UI libraries, bundled plugins, sandbox runtimes and documentation.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 8a78318: Add explicit application Project types, provider-backed domain bindings, and typed Project provisioning/access contracts. App plugins using ProjectTypeProvider require these releases (3.19.0 or newer) and the matching host Project type endpoints/schema migration.
|
|
12
|
+
- Updated dependencies [8a78318]
|
|
13
|
+
- Updated dependencies [1e44173]
|
|
14
|
+
- Updated dependencies [c953822]
|
|
15
|
+
- Updated dependencies [b7983c8]
|
|
16
|
+
- Updated dependencies [08f66e7]
|
|
17
|
+
- Updated dependencies [b62543f]
|
|
18
|
+
- Updated dependencies [5f26e05]
|
|
19
|
+
- Updated dependencies [99d09ec]
|
|
20
|
+
- @xpert-ai/contracts@3.19.0
|
|
21
|
+
|
|
3
22
|
## 3.18.7
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# MCP Apps in Agent middleware
|
|
2
|
+
|
|
3
|
+
An `AgentMiddleware` can return `apps` alongside `tools`. It does not need a remote
|
|
4
|
+
MCP server or a published Toolset. The host renders the bundled HTML using its
|
|
5
|
+
existing MCP App sandbox and RPC bridge.
|
|
6
|
+
|
|
7
|
+
ChatKit accesses resources, RPC, approvals and teardown through `/api/ai/mcp-apps`,
|
|
8
|
+
using the AI module's `ApiKeyOrClientSecretAuthGuard`. The ordinary management
|
|
9
|
+
routes keep the platform's standard authorization. Use an SDK version whose
|
|
10
|
+
`client.mcp.apps` targets this AI endpoint.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
return {
|
|
14
|
+
name: 'ProjectSettings',
|
|
15
|
+
tools: [configure, readSettings, saveSettings],
|
|
16
|
+
apps: {
|
|
17
|
+
definitions: [{ key: 'settings', entry: 'dist/mcp-apps/settings.html' }],
|
|
18
|
+
tools: {
|
|
19
|
+
configure: { resourceKey: 'settings', visibility: ['model', 'app'] },
|
|
20
|
+
read_settings: { visibility: ['app'], approval: 'none' },
|
|
21
|
+
save_settings: { visibility: ['app'], approval: 'none' }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Keys in `apps.tools` must match actual tool names. App-only tools are excluded
|
|
28
|
+
from the model's tool list. `approval: 'none'` is a trusted plugin declaration for
|
|
29
|
+
operations whose own services enforce scope, revision and validation. Omit it
|
|
30
|
+
to retain host approval. App access never grants access to another middleware.
|
|
31
|
+
For decorated providers, use `@XpertToolProvider({ apps: [...] })` and
|
|
32
|
+
`@XpertTool({ middleware: true, app: { ... } })` with the same binding contract.
|
|
33
|
+
|
|
34
|
+
To pause after a successful tool, configure the Assistant:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
team:
|
|
38
|
+
agentConfig:
|
|
39
|
+
interruptAfter: [configure]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The completed tool result is checkpointed before a separate gate calls
|
|
43
|
+
LangGraph `interrupt`. Resume targets the gate, so tool side effects are not
|
|
44
|
+
replayed. Ordinary tools display a Continue control; an App sends a standard
|
|
45
|
+
`ui/message` after saving. The host supplies the original tool-call and execution
|
|
46
|
+
identity, and ChatKit uses the existing `action: resume` protocol. No `ui/resume`
|
|
47
|
+
extension is required. The App's message is added once at user priority on resume,
|
|
48
|
+
so the Agent can distinguish the confirmed input from the pre-pause tool result.
|
|
49
|
+
Inline images, audio and binary resources are retained in this message (25 MiB
|
|
50
|
+
combined); arbitrary file paths and remote attachment URLs are rejected. ChatKit
|
|
51
|
+
acknowledges continuation only after the run response supplies `Content-Location`,
|
|
52
|
+
not when the local thread is resolved. Cross-origin hosts must expose that header.
|
|
53
|
+
Error ToolMessages skip this gate so the Agent can repair
|
|
54
|
+
the failure. Prefer calling interactive tools alone rather than mixing them with
|
|
55
|
+
unrelated parallel work.
|
|
56
|
+
|
|
57
|
+
The runtime re-resolves middleware bindings and enabled tools for each App RPC.
|
|
58
|
+
UI teardown retains paused native form snapshots for 7 days; it does not cancel
|
|
59
|
+
the Agent. Business settings must still be persisted by domain services before
|
|
60
|
+
continuation. This requires the host capability `platform.middleware.mcp-apps`
|
|
61
|
+
and the corresponding ChatKit continuation support; it adds no ORM dependency
|
|
62
|
+
to the SDK.
|
|
63
|
+
|
|
64
|
+
On hosts with schema synchronization disabled, apply
|
|
65
|
+
`packages/server-ai/src/mcp-app-runtime/migrations/20260928-middleware-app-audit.sql`
|
|
66
|
+
before enabling native middleware Apps. Their audit rows retain provider identity
|
|
67
|
+
in `source` and leave `toolsetId` null. Interactive ChatKit user sessions are
|
|
68
|
+
accepted only for their bound Assistant; existing user JWT access remains valid.
|
|
69
|
+
An App produced by an external Assistant is also accessible when its persisted
|
|
70
|
+
execution parent chain terminates at the session's entry Assistant in the same
|
|
71
|
+
thread. Each execution remains subject to the normal access check.
|
package/README.md
CHANGED
|
@@ -115,6 +115,8 @@ For completed operations, `prepareToolResult(() => project(result), () => minima
|
|
|
115
115
|
|
|
116
116
|
For a host-native MCP App, declare each static HTML bundle once in the Provider's `apps` array, then bind a Tool with `mcp.app.resourceKey` and include `app` visibility. The App key must exist in the same Provider and its entry must be a relative `.html` path inside the packaged plugin. The host publishes the bundle as a `ui://` resource; plugins must not create a stdio server or put CSP/credentials in Tool results.
|
|
117
117
|
|
|
118
|
+
Agent middleware can also expose these Apps without a published Toolset. See [middleware Apps and post-tool continuation](./MIDDLEWARE_APPS.md) for `app` bindings and `interruptAfter` checkpoints.
|
|
119
|
+
|
|
118
120
|
The host owns the public MCP endpoint identity. It combines the plugin's stable `artifactNamespace`, the Provider key, and an opaque scope hash; client names and product-specific identifiers do not belong in the slug. A tenant- or system-level plugin has one tenant-scoped Publication and capability snapshot, while each organization receives an independent access grant and organization-bound credential. An organization-level plugin receives a dedicated organization-scoped Publication.
|
|
119
121
|
|
|
120
122
|
## View extensions
|
package/index.cjs.js
CHANGED
|
@@ -9,7 +9,6 @@ var rxjs = require('rxjs');
|
|
|
9
9
|
var contracts = require('@xpert-ai/contracts');
|
|
10
10
|
var node_async_hooks = require('node:async_hooks');
|
|
11
11
|
var passportJwt = require('passport-jwt');
|
|
12
|
-
var jsonwebtoken = require('jsonwebtoken');
|
|
13
12
|
var node_crypto = require('node:crypto');
|
|
14
13
|
var cqrs = require('@nestjs/cqrs');
|
|
15
14
|
var fs = require('fs');
|
|
@@ -350,22 +349,15 @@ class RequestContext {
|
|
|
350
349
|
}
|
|
351
350
|
return scope.organizationId;
|
|
352
351
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
if (found.length === findPermissions.length) {
|
|
363
|
-
return true;
|
|
364
|
-
}
|
|
365
|
-
} else {
|
|
366
|
-
return false;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
352
|
+
/**
|
|
353
|
+
* Check the authenticated principal's enabled role permissions, matching the
|
|
354
|
+
* server RequestContext. Authentication guards resolve JWTs, API keys and
|
|
355
|
+
* ChatKit client secrets before this check; the bearer is not always a JWT.
|
|
356
|
+
*/ static hasPermissions(findPermissions, throwError) {
|
|
357
|
+
const permissions = this.currentPermissions();
|
|
358
|
+
if (permissions.length > 0) {
|
|
359
|
+
const found = permissions.filter((value)=>findPermissions.indexOf(value) >= 0);
|
|
360
|
+
if (found.length === findPermissions.length) return true;
|
|
369
361
|
}
|
|
370
362
|
if (throwError) {
|
|
371
363
|
throw new common.HttpException('Unauthorized', common.HttpStatus.UNAUTHORIZED);
|
|
@@ -373,17 +365,9 @@ class RequestContext {
|
|
|
373
365
|
return false;
|
|
374
366
|
}
|
|
375
367
|
static hasAnyPermission(findPermissions, throwError) {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
const token = passportJwt.ExtractJwt.fromAuthHeaderAsBearerToken()(requestContext.request);
|
|
380
|
-
if (token) {
|
|
381
|
-
const { permissions } = jsonwebtoken.verify(token, process.env['JWT_SECRET']);
|
|
382
|
-
const found = permissions.filter((value)=>findPermissions.indexOf(value) >= 0);
|
|
383
|
-
if (found.length > 0) {
|
|
384
|
-
return true;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
368
|
+
const permissions = this.currentPermissions();
|
|
369
|
+
if (permissions.some((value)=>findPermissions.includes(value))) {
|
|
370
|
+
return true;
|
|
387
371
|
}
|
|
388
372
|
if (throwError) {
|
|
389
373
|
throw new common.HttpException('Unauthorized', common.HttpStatus.UNAUTHORIZED);
|
|
@@ -421,20 +405,6 @@ class RequestContext {
|
|
|
421
405
|
const context = RequestContext.currentRequestContext();
|
|
422
406
|
if (context) {
|
|
423
407
|
var _this_currentUser_role, _this_currentUser;
|
|
424
|
-
// tslint:disable-next-line
|
|
425
|
-
const token = this.currentToken();
|
|
426
|
-
if (token) {
|
|
427
|
-
try {
|
|
428
|
-
const { role } = jsonwebtoken.verify(token, process.env['JWT_SECRET']);
|
|
429
|
-
if (role) {
|
|
430
|
-
return roles.includes(role);
|
|
431
|
-
}
|
|
432
|
-
} catch (error) {
|
|
433
|
-
if (!(error instanceof jsonwebtoken.JsonWebTokenError)) {
|
|
434
|
-
throw error;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
408
|
const role = (_this_currentUser = this.currentUser()) == null ? void 0 : (_this_currentUser_role = _this_currentUser.role) == null ? void 0 : _this_currentUser_role.name;
|
|
439
409
|
if (role) {
|
|
440
410
|
return roles.includes(role);
|
|
@@ -445,6 +415,11 @@ class RequestContext {
|
|
|
445
415
|
}
|
|
446
416
|
return false;
|
|
447
417
|
}
|
|
418
|
+
static currentPermissions() {
|
|
419
|
+
var _this_currentUser_role, _this_currentUser;
|
|
420
|
+
var _this_currentUser_role_rolePermissions;
|
|
421
|
+
return ((_this_currentUser_role_rolePermissions = (_this_currentUser = this.currentUser()) == null ? void 0 : (_this_currentUser_role = _this_currentUser.role) == null ? void 0 : _this_currentUser_role.rolePermissions) != null ? _this_currentUser_role_rolePermissions : []).filter((rolePermission)=>rolePermission == null ? void 0 : rolePermission.enabled).map((rolePermission)=>rolePermission == null ? void 0 : rolePermission.permission).filter((permission)=>!!permission);
|
|
422
|
+
}
|
|
448
423
|
constructor(request, response, reqId, userId, extras = {}){
|
|
449
424
|
this.request = request;
|
|
450
425
|
this.response = response;
|
|
@@ -515,15 +490,6 @@ function runWithRequestContext(req, res, next) {
|
|
|
515
490
|
}
|
|
516
491
|
|
|
517
492
|
exports.StrategyBus = class StrategyBus {
|
|
518
|
-
registerRemovalGuard(guard) {
|
|
519
|
-
this.removalGuards.add(guard);
|
|
520
|
-
return ()=>{
|
|
521
|
-
this.removalGuards.delete(guard);
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
async assertCanRemove(scopeKey, pluginNames) {
|
|
525
|
-
for (const guard of this.removalGuards)await guard(scopeKey, pluginNames);
|
|
526
|
-
}
|
|
527
493
|
upsert(strategyType, entry) {
|
|
528
494
|
this.subject.next({
|
|
529
495
|
type: 'UPSERT',
|
|
@@ -541,7 +507,6 @@ exports.StrategyBus = class StrategyBus {
|
|
|
541
507
|
} : {}));
|
|
542
508
|
}
|
|
543
509
|
constructor(){
|
|
544
|
-
this.removalGuards = new Set();
|
|
545
510
|
this.subject = new rxjs.Subject();
|
|
546
511
|
this.events$ = this.subject.asObservable();
|
|
547
512
|
}
|
|
@@ -3882,7 +3847,7 @@ exports.AgentMiddlewareRegistry = __decorate([
|
|
|
3882
3847
|
'end'
|
|
3883
3848
|
];
|
|
3884
3849
|
|
|
3885
|
-
const AssistantTaskRuntimeCapability = modelProvider.createRuntimeCapability('platform.assistant_task', {
|
|
3850
|
+
/** Scoped runtime capability for platform Assistant tasks. */ const AssistantTaskRuntimeCapability = modelProvider.createRuntimeCapability('platform.assistant_task', {
|
|
3886
3851
|
description: 'Start asynchronous tasks on the current platform assistant.'
|
|
3887
3852
|
});
|
|
3888
3853
|
|
|
@@ -4005,6 +3970,52 @@ exports.HandoffProcessorRegistry = __decorate([
|
|
|
4005
3970
|
runTtlMs: 10 * 60 * 1000
|
|
4006
3971
|
};
|
|
4007
3972
|
|
|
3973
|
+
/** Checks confirmed completion; unknown remains non-terminal. */ function isAgentInvocationTerminal(status) {
|
|
3974
|
+
return status === 'succeeded' || status === 'failed' || status === 'cancelled';
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
/** Nest discovery metadata key for runtime strategies. */ const AGENT_RUNTIME_STRATEGY = 'AGENT_RUNTIME_STRATEGY';
|
|
3978
|
+
/** Associate a stable provider key with an adapter. Also declare @Injectable() and register the provider. */ const AgentRuntimeStrategy = (provider)=>common.applyDecorators(common.SetMetadata(AGENT_RUNTIME_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, AGENT_RUNTIME_STRATEGY));
|
|
3979
|
+
/** Scoped strategy registry with pinned provider/version lookup for continuation. */ exports.AgentRuntimeRegistry = class AgentRuntimeRegistry extends BaseStrategyRegistry {
|
|
3980
|
+
/** Find the exact original scope/plugin/version, without fallback. Returns undefined if unavailable. */ getPinned(provider, source) {
|
|
3981
|
+
var _this_strategies_get;
|
|
3982
|
+
const strategy = (_this_strategies_get = this.strategies.get(source.scopeKey)) == null ? void 0 : _this_strategies_get.get(provider);
|
|
3983
|
+
if (!strategy) return undefined;
|
|
3984
|
+
const actual = this.getSource(strategy);
|
|
3985
|
+
return actual.kind === source.kind && actual.scopeKey === source.scopeKey && (actual.kind !== 'plugin' || source.kind !== 'plugin' || actual.pluginName === source.pluginName && actual.pluginVersion === source.pluginVersion) ? strategy : undefined;
|
|
3986
|
+
}
|
|
3987
|
+
constructor(discoveryService, reflector){
|
|
3988
|
+
super(AGENT_RUNTIME_STRATEGY, discoveryService, reflector);
|
|
3989
|
+
}
|
|
3990
|
+
};
|
|
3991
|
+
exports.AgentRuntimeRegistry = __decorate([
|
|
3992
|
+
common.Injectable(),
|
|
3993
|
+
__metadata("design:paramtypes", [
|
|
3994
|
+
core.DiscoveryService,
|
|
3995
|
+
core.Reflector
|
|
3996
|
+
])
|
|
3997
|
+
], exports.AgentRuntimeRegistry);
|
|
3998
|
+
|
|
3999
|
+
/** Caller-scoped API obtained through runtime.capabilities.require(...). */ const AgentInvocationRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent_invocation', {
|
|
4000
|
+
description: 'Scoped, versioned Agent invocation and lifecycle control'
|
|
4001
|
+
});
|
|
4002
|
+
/** Platform factory capability. The wire key is stable across SDK naming changes. */ const AgentRuntimeFactoryCapability = modelProvider.createRuntimeCapability('platform.agent_invocation.factory');
|
|
4003
|
+
|
|
4004
|
+
const ASSISTANT_CAPABILITY_PROVIDER = 'ASSISTANT_CAPABILITY_PROVIDER';
|
|
4005
|
+
const AssistantCapabilityProvider = (key)=>common.applyDecorators(common.SetMetadata(ASSISTANT_CAPABILITY_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, ASSISTANT_CAPABILITY_PROVIDER));
|
|
4006
|
+
exports.AssistantCapabilityProviderRegistry = class AssistantCapabilityProviderRegistry extends BaseStrategyRegistry {
|
|
4007
|
+
constructor(discovery, reflector){
|
|
4008
|
+
super(ASSISTANT_CAPABILITY_PROVIDER, discovery, reflector);
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
exports.AssistantCapabilityProviderRegistry = __decorate([
|
|
4012
|
+
common.Injectable(),
|
|
4013
|
+
__metadata("design:paramtypes", [
|
|
4014
|
+
core.DiscoveryService,
|
|
4015
|
+
core.Reflector
|
|
4016
|
+
])
|
|
4017
|
+
], exports.AssistantCapabilityProviderRegistry);
|
|
4018
|
+
|
|
4008
4019
|
/**
|
|
4009
4020
|
* Common platform message length limits
|
|
4010
4021
|
*/ const CHAT_CHANNEL_TEXT_LIMITS = {
|
|
@@ -4299,10 +4310,12 @@ function appendSandboxMessage(output, message) {
|
|
|
4299
4310
|
function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS) {
|
|
4300
4311
|
const timeoutMs = typeof (options == null ? void 0 : options.timeoutMs) === 'number' && Number.isFinite(options.timeoutMs) && options.timeoutMs > 0 ? Math.trunc(options.timeoutMs) : typeof defaults.timeoutMs === 'number' && Number.isFinite(defaults.timeoutMs) && defaults.timeoutMs > 0 ? Math.trunc(defaults.timeoutMs) : DEFAULT_SANDBOX_SHELL_TIMEOUT_MS;
|
|
4301
4312
|
const maxOutputBytes = typeof (options == null ? void 0 : options.maxOutputBytes) === 'number' && Number.isFinite(options.maxOutputBytes) && options.maxOutputBytes > 0 ? Math.trunc(options.maxOutputBytes) : typeof defaults.maxOutputBytes === 'number' && Number.isFinite(defaults.maxOutputBytes) && defaults.maxOutputBytes > 0 ? Math.trunc(defaults.maxOutputBytes) : DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES;
|
|
4302
|
-
return {
|
|
4313
|
+
return _extends._extends({
|
|
4303
4314
|
timeoutMs,
|
|
4304
4315
|
maxOutputBytes
|
|
4305
|
-
}
|
|
4316
|
+
}, (options == null ? void 0 : options.signal) ? {
|
|
4317
|
+
signal: options.signal
|
|
4318
|
+
} : {});
|
|
4306
4319
|
}
|
|
4307
4320
|
|
|
4308
4321
|
function isObjectLike$2(value) {
|
|
@@ -5955,6 +5968,9 @@ exports.EvolutionTargetProviderRegistry = __decorate([
|
|
|
5955
5968
|
], exports.EvolutionTargetProviderRegistry);
|
|
5956
5969
|
|
|
5957
5970
|
const EVOLUTION_RUNTIME_SERVICE_TOKEN = 'XPERT_EVOLUTION_RUNTIME_SERVICE';
|
|
5971
|
+
const EvolutionBaselineRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.baselines', {
|
|
5972
|
+
description: 'Inspect and initialize organization rule baselines with administrator authorization and revision checks.'
|
|
5973
|
+
});
|
|
5958
5974
|
const EvolutionRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution', {
|
|
5959
5975
|
description: 'Ingest learning signals and resolve immutable capability versions for domain runtimes.'
|
|
5960
5976
|
});
|
|
@@ -6195,6 +6211,11 @@ function describeXpertToolProvider(instance) {
|
|
|
6195
6211
|
if (middlewareProvider && !middlewareProviders.has(middlewareProvider)) {
|
|
6196
6212
|
throw new Error(`Tool '${toolOptions.name}' references undeclared Middleware provider '${middlewareProvider}'.`);
|
|
6197
6213
|
}
|
|
6214
|
+
if (toolOptions.app) {
|
|
6215
|
+
if (!middlewareProvider || !toolOptions.app.visibility.length || toolOptions.app.visibility.some((item)=>item !== 'model' && item !== 'app') || toolOptions.app.resourceKey && (!appKeys.has(toolOptions.app.resourceKey) || !toolOptions.app.visibility.includes('app'))) {
|
|
6216
|
+
throw new Error(`Tool '${toolOptions.name}' has an invalid middleware App binding.`);
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6198
6219
|
const appKey = toolOptions.mcp && ((_toolOptions_mcp_app = toolOptions.mcp.app) == null ? void 0 : _toolOptions_mcp_app.resourceKey);
|
|
6199
6220
|
if (appKey && !appKeys.has(appKey)) {
|
|
6200
6221
|
throw new Error(`MCP Tool '${toolOptions.name}' references undeclared App '${appKey}'.`);
|
|
@@ -6592,12 +6613,21 @@ class DecoratedAgentMiddlewareStrategy {
|
|
|
6592
6613
|
return this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>item.options.name);
|
|
6593
6614
|
}
|
|
6594
6615
|
async createMiddleware(options, context) {
|
|
6616
|
+
var _this_descriptor_options_apps;
|
|
6595
6617
|
const tools = this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>createAgentTool(this.instance, item, context, options));
|
|
6596
6618
|
const extensions = await (this.instance.getMiddlewareExtensions == null ? void 0 : this.instance.getMiddlewareExtensions.call(this.instance, this.provider, options, context));
|
|
6597
6619
|
return _extends._extends({}, extensions != null ? extensions : {}, {
|
|
6598
6620
|
name: this.provider,
|
|
6599
6621
|
tools
|
|
6600
|
-
})
|
|
6622
|
+
}, ((_this_descriptor_options_apps = this.descriptor.options.apps) == null ? void 0 : _this_descriptor_options_apps.length) ? {
|
|
6623
|
+
apps: {
|
|
6624
|
+
definitions: this.descriptor.options.apps,
|
|
6625
|
+
tools: Object.fromEntries(this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider && item.options.app).map((item)=>[
|
|
6626
|
+
item.options.name,
|
|
6627
|
+
item.options.app
|
|
6628
|
+
]))
|
|
6629
|
+
}
|
|
6630
|
+
} : {});
|
|
6601
6631
|
}
|
|
6602
6632
|
constructor(instance, descriptor, provider){
|
|
6603
6633
|
var _descriptor_options_middlewares;
|
|
@@ -9757,6 +9787,39 @@ function stableJson(value) {
|
|
|
9757
9787
|
return `{${entries.map(([key, item])=>`${JSON.stringify(key)}:${stableJson(item)}`).join(',')}}`;
|
|
9758
9788
|
}
|
|
9759
9789
|
|
|
9790
|
+
const PROJECT_TYPE_PROVIDER = 'PROJECT_TYPE_PROVIDER';
|
|
9791
|
+
/** Register the stable provider key used by entity-backed App project type declarations. */ const ProjectTypeProvider = (key)=>common.applyDecorators(common.SetMetadata(PROJECT_TYPE_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, PROJECT_TYPE_PROVIDER));
|
|
9792
|
+
exports.ProjectTypeProviderRegistry = class ProjectTypeProviderRegistry extends BaseStrategyRegistry {
|
|
9793
|
+
constructor(discovery, reflector){
|
|
9794
|
+
super(PROJECT_TYPE_PROVIDER, discovery, reflector);
|
|
9795
|
+
}
|
|
9796
|
+
};
|
|
9797
|
+
exports.ProjectTypeProviderRegistry = __decorate([
|
|
9798
|
+
common.Injectable(),
|
|
9799
|
+
__metadata("design:paramtypes", [
|
|
9800
|
+
core.DiscoveryService,
|
|
9801
|
+
core.Reflector
|
|
9802
|
+
])
|
|
9803
|
+
], exports.ProjectTypeProviderRegistry);
|
|
9804
|
+
|
|
9805
|
+
const PROJECT_TASK_PROVIDER = 'PROJECT_TASK_PROVIDER';
|
|
9806
|
+
const ProjectTaskProvider = (key)=>common.applyDecorators(common.SetMetadata(PROJECT_TASK_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, PROJECT_TASK_PROVIDER));
|
|
9807
|
+
exports.ProjectTaskProviderRegistry = class ProjectTaskProviderRegistry extends BaseStrategyRegistry {
|
|
9808
|
+
constructor(discovery, reflector){
|
|
9809
|
+
super(PROJECT_TASK_PROVIDER, discovery, reflector);
|
|
9810
|
+
}
|
|
9811
|
+
};
|
|
9812
|
+
exports.ProjectTaskProviderRegistry = __decorate([
|
|
9813
|
+
common.Injectable(),
|
|
9814
|
+
__metadata("design:paramtypes", [
|
|
9815
|
+
core.DiscoveryService,
|
|
9816
|
+
core.Reflector
|
|
9817
|
+
])
|
|
9818
|
+
], exports.ProjectTaskProviderRegistry);
|
|
9819
|
+
const ProjectTasksRuntimeCapability = modelProvider.createRuntimeCapability('platform.project.tasks', {
|
|
9820
|
+
description: 'Read project task graphs, manage schedules, and resolve exact execution conversations.'
|
|
9821
|
+
});
|
|
9822
|
+
|
|
9760
9823
|
Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
|
|
9761
9824
|
enumerable: true,
|
|
9762
9825
|
get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
|
|
@@ -9815,12 +9878,18 @@ exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SE
|
|
|
9815
9878
|
exports.AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING;
|
|
9816
9879
|
exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
|
|
9817
9880
|
exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
|
|
9881
|
+
exports.AGENT_RUNTIME_STRATEGY = AGENT_RUNTIME_STRATEGY;
|
|
9818
9882
|
exports.AIModelProviderNotFoundException = AIModelProviderNotFoundException;
|
|
9819
9883
|
exports.AIModelProviderStrategy = AIModelProviderStrategy;
|
|
9820
9884
|
exports.AI_MODEL_PROVIDER = AI_MODEL_PROVIDER;
|
|
9885
|
+
exports.ASSISTANT_CAPABILITY_PROVIDER = ASSISTANT_CAPABILITY_PROVIDER;
|
|
9821
9886
|
exports.AdapterDataSourceStrategy = AdapterDataSourceStrategy;
|
|
9887
|
+
exports.AgentInvocationRuntimeCapability = AgentInvocationRuntimeCapability;
|
|
9822
9888
|
exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
|
|
9889
|
+
exports.AgentRuntimeFactoryCapability = AgentRuntimeFactoryCapability;
|
|
9890
|
+
exports.AgentRuntimeStrategy = AgentRuntimeStrategy;
|
|
9823
9891
|
exports.AiModelNotFoundException = AiModelNotFoundException;
|
|
9892
|
+
exports.AssistantCapabilityProvider = AssistantCapabilityProvider;
|
|
9824
9893
|
exports.AssistantTaskRuntimeCapability = AssistantTaskRuntimeCapability;
|
|
9825
9894
|
exports.BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN;
|
|
9826
9895
|
exports.BUILTIN_GLOBAL_SCOPE = BUILTIN_GLOBAL_SCOPE;
|
|
@@ -9866,6 +9935,7 @@ exports.DocumentSourceStrategy = DocumentSourceStrategy;
|
|
|
9866
9935
|
exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
|
|
9867
9936
|
exports.EVOLUTION_RUNTIME_SERVICE_TOKEN = EVOLUTION_RUNTIME_SERVICE_TOKEN;
|
|
9868
9937
|
exports.EVOLUTION_TARGET_PROVIDER = EVOLUTION_TARGET_PROVIDER;
|
|
9938
|
+
exports.EvolutionBaselineRuntimeCapability = EvolutionBaselineRuntimeCapability;
|
|
9869
9939
|
exports.EvolutionChangeRuntimeCapability = EvolutionChangeRuntimeCapability;
|
|
9870
9940
|
exports.EvolutionRuntimeCapability = EvolutionRuntimeCapability;
|
|
9871
9941
|
exports.EvolutionTargetProviderStrategy = EvolutionTargetProviderStrategy;
|
|
@@ -9909,6 +9979,8 @@ exports.PLUGIN_METADATA_KEY = PLUGIN_METADATA_KEY;
|
|
|
9909
9979
|
exports.PLUGIN_VERSION_METADATA_KEY = PLUGIN_VERSION_METADATA_KEY;
|
|
9910
9980
|
exports.PLUGIN_WEBHOOK_AUTH_METADATA_KEY = PLUGIN_WEBHOOK_AUTH_METADATA_KEY;
|
|
9911
9981
|
exports.PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN;
|
|
9982
|
+
exports.PROJECT_TASK_PROVIDER = PROJECT_TASK_PROVIDER;
|
|
9983
|
+
exports.PROJECT_TYPE_PROVIDER = PROJECT_TYPE_PROVIDER;
|
|
9912
9984
|
exports.PROVIDE_AI_MODEL_LLM = PROVIDE_AI_MODEL_LLM;
|
|
9913
9985
|
exports.PROVIDE_AI_MODEL_MODERATION = PROVIDE_AI_MODEL_MODERATION;
|
|
9914
9986
|
exports.PROVIDE_AI_MODEL_RERANK = PROVIDE_AI_MODEL_RERANK;
|
|
@@ -9917,6 +9989,9 @@ exports.PROVIDE_AI_MODEL_TEXT_EMBEDDING = PROVIDE_AI_MODEL_TEXT_EMBEDDING;
|
|
|
9917
9989
|
exports.PROVIDE_AI_MODEL_TTS = PROVIDE_AI_MODEL_TTS;
|
|
9918
9990
|
exports.PluginJobProcessor = PluginJobProcessor;
|
|
9919
9991
|
exports.PluginWebhookAuth = PluginWebhookAuth;
|
|
9992
|
+
exports.ProjectTaskProvider = ProjectTaskProvider;
|
|
9993
|
+
exports.ProjectTasksRuntimeCapability = ProjectTasksRuntimeCapability;
|
|
9994
|
+
exports.ProjectTypeProvider = ProjectTypeProvider;
|
|
9920
9995
|
exports.RETRIEVER_STRATEGY = RETRIEVER_STRATEGY;
|
|
9921
9996
|
exports.RequestContext = RequestContext;
|
|
9922
9997
|
exports.RequirePermissionOperation = RequirePermissionOperation;
|
|
@@ -10009,6 +10084,7 @@ exports.getRequestContext = getRequestContext;
|
|
|
10009
10084
|
exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
|
|
10010
10085
|
exports.getTenantGlobalScopeKey = getTenantGlobalScopeKey;
|
|
10011
10086
|
exports.getXpertToolMethod = getXpertToolMethod;
|
|
10087
|
+
exports.isAgentInvocationTerminal = isAgentInvocationTerminal;
|
|
10012
10088
|
exports.isDevelopmentSandboxRuntimeEnvironment = isDevelopmentSandboxRuntimeEnvironment;
|
|
10013
10089
|
exports.isModelOutputValidationError = isModelOutputValidationError;
|
|
10014
10090
|
exports.isModelUsagePricingConfig = isModelUsagePricingConfig;
|