@xpert-ai/plugin-sdk 3.18.7 → 3.20.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 +123 -0
- package/MIDDLEWARE_APPS.md +71 -0
- package/README.md +57 -0
- package/RESOURCE-CARDS-VALIDATION.md +51 -0
- package/RESOURCE-CARDS.md +361 -0
- package/TOOL-IMAGES.md +85 -0
- package/agent-results.cjs.default.js +1 -0
- package/agent-results.cjs.js +20 -0
- package/agent-results.cjs.mjs +2 -0
- package/agent-results.d.ts +1 -0
- package/agent-results.esm.js +4 -0
- package/index.cjs.js +586 -162
- package/index.esm.js +530 -167
- package/model-provider.cjs.js +5 -0
- package/model-provider.esm.js +5 -1
- package/package.json +8 -2
- package/results.cjs.js +50 -0
- package/results.esm.js +46 -0
- package/runtime-capabilities.md +35 -0
- package/src/agent-results.d.ts +2 -0
- package/src/index.d.ts +5 -0
- package/src/lib/agent/handoff/agent-chat.contract.d.ts +6 -1
- package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +319 -0
- package/src/lib/agent/handoff/index.d.ts +1 -0
- package/src/lib/agent/index.d.ts +2 -0
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +55 -20
- package/src/lib/agent/middleware/index.d.ts +1 -0
- package/src/lib/agent/middleware/model-requirements.d.ts +9 -0
- package/src/lib/agent/middleware/strategy.interface.d.ts +4 -0
- package/src/lib/agent/middleware/types.d.ts +20 -3
- package/src/lib/agent/resource-card.d.ts +3 -0
- package/src/lib/agent/runtime/activity.d.ts +6 -0
- package/src/lib/agent/runtime/capability.d.ts +37 -0
- package/src/lib/agent/runtime/cli-model-profile.d.ts +62 -0
- package/src/lib/agent/runtime/dispatch.d.ts +517 -0
- package/src/lib/agent/runtime/execution-runner.d.ts +66 -0
- package/src/lib/agent/runtime/index.d.ts +10 -0
- package/src/lib/agent/runtime/model-execution.d.ts +15 -0
- package/src/lib/agent/runtime/results.d.ts +335 -0
- package/src/lib/agent/runtime/strategy.d.ts +53 -0
- package/src/lib/agent/runtime/task-wait.d.ts +35 -0
- package/src/lib/agent/runtime/types.d.ts +156 -0
- package/src/lib/ai-model/ai-model-provider.interface.d.ts +2 -0
- package/src/lib/ai-model/ai-model.d.ts +2 -0
- package/src/lib/ai-model/index.d.ts +3 -0
- package/src/lib/ai-model/llm.d.ts +4 -2
- package/src/lib/ai-model/native-model.d.ts +22 -0
- package/src/lib/ai-model/realtime.d.ts +36 -0
- package/src/lib/ai-model/token-usage.d.ts +13 -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 +14 -1
- package/src/lib/project-task/index.d.ts +66 -0
- package/src/lib/project-type/index.d.ts +71 -0
- package/src/lib/resource-card-provider/index.d.ts +3 -0
- package/src/lib/resource-card-provider/provider.decorator.d.ts +4 -0
- package/src/lib/resource-card-provider/provider.registry.d.ts +14 -0
- package/src/lib/resource-card-provider/types.d.ts +36 -0
- package/src/lib/resource-card.d.ts +6 -0
- package/src/lib/runtime/capabilities/index.d.ts +1 -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 +13 -0
- package/src/lib/runtime/capabilities/tool-images.d.ts +24 -0
- package/src/lib/runtime/runtime-scope.d.ts +7 -1
- package/src/lib/sandbox/execution-environment.d.ts +12 -0
- package/src/lib/sandbox/execution.d.ts +13 -0
- package/src/lib/sandbox/index.d.ts +1 -0
- package/src/lib/sandbox/managed-service.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/index.cjs.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var common = require('@nestjs/common');
|
|
4
4
|
var constants = require('@nestjs/common/constants');
|
|
5
5
|
var lodashEs = require('lodash-es');
|
|
6
|
-
var
|
|
6
|
+
var dispatch = require('@langchain/core/callbacks/dispatch');
|
|
7
|
+
var contracts = require('@xpert-ai/contracts');
|
|
7
8
|
var core = require('@nestjs/core');
|
|
8
9
|
var rxjs = require('rxjs');
|
|
9
|
-
var
|
|
10
|
+
var _extends = require('./_extends.cjs.js');
|
|
10
11
|
var node_async_hooks = require('node:async_hooks');
|
|
11
12
|
var passportJwt = require('passport-jwt');
|
|
12
|
-
var jsonwebtoken = require('jsonwebtoken');
|
|
13
13
|
var node_crypto = require('node:crypto');
|
|
14
14
|
var cqrs = require('@nestjs/cqrs');
|
|
15
15
|
var fs = require('fs');
|
|
@@ -35,10 +35,11 @@ var env = require('@langchain/core/utils/env');
|
|
|
35
35
|
var modelProviderHttpClient = require('./model-provider-http-client.cjs.js');
|
|
36
36
|
var jsTiktoken = require('js-tiktoken');
|
|
37
37
|
var base$1 = require('@langchain/core/language_models/base');
|
|
38
|
+
var v3 = require('zod/v3');
|
|
39
|
+
var results = require('./results.cjs.js');
|
|
38
40
|
var connector = require('./connector.cjs.js');
|
|
39
41
|
var collaborationClient = require('./collaboration-client.cjs.js');
|
|
40
42
|
var tools = require('@langchain/core/tools');
|
|
41
|
-
var v3 = require('zod/v3');
|
|
42
43
|
|
|
43
44
|
function _interopNamespaceDefault(e) {
|
|
44
45
|
var n = Object.create(null);
|
|
@@ -124,6 +125,10 @@ function assertPluginArtifactNamePart(value, label) {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
/** Call after the business mutation commits. A display failure must not retry that mutation. */ async function emitResourceCard(card, config) {
|
|
129
|
+
await dispatch.dispatchCustomEvent(contracts.ChatMessageEventTypeEnum.ON_CHAT_EVENT, contracts.createResourceCardContent(card), config);
|
|
130
|
+
}
|
|
131
|
+
|
|
127
132
|
const ORGANIZATION_METADATA_KEY = 'xpert:organizationId';
|
|
128
133
|
const PLUGIN_METADATA_KEY = 'xpert:pluginName';
|
|
129
134
|
const PLUGIN_VERSION_METADATA_KEY = 'xpert:pluginVersion';
|
|
@@ -160,27 +165,13 @@ function resolveTenantGlobalScopeKey(tenantId) {
|
|
|
160
165
|
return GLOBAL_ORGANIZATION_SCOPE;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
};
|
|
171
|
-
return {
|
|
172
|
-
child (meta) {
|
|
173
|
-
return createPluginLogger(scope, _extends._extends({}, baseMeta, meta));
|
|
174
|
-
},
|
|
175
|
-
debug: (msg, meta)=>wrap('debug', msg, meta),
|
|
176
|
-
log: (msg, meta)=>wrap('log', msg, meta),
|
|
177
|
-
warn: (msg, meta)=>wrap('warn', msg, meta),
|
|
178
|
-
error: (msg, meta)=>wrap('error', msg, meta)
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const INTEGRATION_STRATEGY = 'INTEGRATION_STRATEGY';
|
|
183
|
-
const IntegrationStrategyKey = (provider)=>common.applyDecorators(common.SetMetadata(INTEGRATION_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, INTEGRATION_STRATEGY));
|
|
168
|
+
const RESOURCE_CARD_PROVIDER = 'RESOURCE_CARD_PROVIDER';
|
|
169
|
+
/** Register exact resource types whose message cards opt in to live refresh. */ const ResourceCardProvider = (...resources)=>{
|
|
170
|
+
if (!resources.length || resources.some(({ namespace, type })=>!(namespace == null ? void 0 : namespace.trim()) || !(type == null ? void 0 : type.trim()))) {
|
|
171
|
+
throw new Error('ResourceCardProvider requires explicit resource namespaces and types');
|
|
172
|
+
}
|
|
173
|
+
return common.applyDecorators(common.SetMetadata(RESOURCE_CARD_PROVIDER, resources), common.SetMetadata(STRATEGY_META_KEY, RESOURCE_CARD_PROVIDER));
|
|
174
|
+
};
|
|
184
175
|
|
|
185
176
|
function __decorate(decorators, target, key, desc) {
|
|
186
177
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -350,22 +341,15 @@ class RequestContext {
|
|
|
350
341
|
}
|
|
351
342
|
return scope.organizationId;
|
|
352
343
|
}
|
|
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
|
-
}
|
|
344
|
+
/**
|
|
345
|
+
* Check the authenticated principal's enabled role permissions, matching the
|
|
346
|
+
* server RequestContext. Authentication guards resolve JWTs, API keys and
|
|
347
|
+
* ChatKit client secrets before this check; the bearer is not always a JWT.
|
|
348
|
+
*/ static hasPermissions(findPermissions, throwError) {
|
|
349
|
+
const permissions = this.currentPermissions();
|
|
350
|
+
if (permissions.length > 0) {
|
|
351
|
+
const found = permissions.filter((value)=>findPermissions.indexOf(value) >= 0);
|
|
352
|
+
if (found.length === findPermissions.length) return true;
|
|
369
353
|
}
|
|
370
354
|
if (throwError) {
|
|
371
355
|
throw new common.HttpException('Unauthorized', common.HttpStatus.UNAUTHORIZED);
|
|
@@ -373,17 +357,9 @@ class RequestContext {
|
|
|
373
357
|
return false;
|
|
374
358
|
}
|
|
375
359
|
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
|
-
}
|
|
360
|
+
const permissions = this.currentPermissions();
|
|
361
|
+
if (permissions.some((value)=>findPermissions.includes(value))) {
|
|
362
|
+
return true;
|
|
387
363
|
}
|
|
388
364
|
if (throwError) {
|
|
389
365
|
throw new common.HttpException('Unauthorized', common.HttpStatus.UNAUTHORIZED);
|
|
@@ -421,20 +397,6 @@ class RequestContext {
|
|
|
421
397
|
const context = RequestContext.currentRequestContext();
|
|
422
398
|
if (context) {
|
|
423
399
|
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
400
|
const role = (_this_currentUser = this.currentUser()) == null ? void 0 : (_this_currentUser_role = _this_currentUser.role) == null ? void 0 : _this_currentUser_role.name;
|
|
439
401
|
if (role) {
|
|
440
402
|
return roles.includes(role);
|
|
@@ -445,6 +407,11 @@ class RequestContext {
|
|
|
445
407
|
}
|
|
446
408
|
return false;
|
|
447
409
|
}
|
|
410
|
+
static currentPermissions() {
|
|
411
|
+
var _this_currentUser_role, _this_currentUser;
|
|
412
|
+
var _this_currentUser_role_rolePermissions;
|
|
413
|
+
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);
|
|
414
|
+
}
|
|
448
415
|
constructor(request, response, reqId, userId, extras = {}){
|
|
449
416
|
this.request = request;
|
|
450
417
|
this.response = response;
|
|
@@ -515,15 +482,6 @@ function runWithRequestContext(req, res, next) {
|
|
|
515
482
|
}
|
|
516
483
|
|
|
517
484
|
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
485
|
upsert(strategyType, entry) {
|
|
528
486
|
this.subject.next({
|
|
529
487
|
type: 'UPSERT',
|
|
@@ -541,7 +499,6 @@ exports.StrategyBus = class StrategyBus {
|
|
|
541
499
|
} : {}));
|
|
542
500
|
}
|
|
543
501
|
constructor(){
|
|
544
|
-
this.removalGuards = new Set();
|
|
545
502
|
this.subject = new rxjs.Subject();
|
|
546
503
|
this.events$ = this.subject.asObservable();
|
|
547
504
|
}
|
|
@@ -799,6 +756,102 @@ __decorate([
|
|
|
799
756
|
return typeof constructor === 'function' ? constructor : null;
|
|
800
757
|
}
|
|
801
758
|
|
|
759
|
+
var ResourceCardProviderRegistry_1;
|
|
760
|
+
const resourceTypeKey = ({ namespace, type })=>JSON.stringify([
|
|
761
|
+
namespace,
|
|
762
|
+
type
|
|
763
|
+
]);
|
|
764
|
+
function isProvider(value) {
|
|
765
|
+
return !!value && typeof value === 'object' && 'resolveMany' in value && typeof value.resolveMany === 'function';
|
|
766
|
+
}
|
|
767
|
+
exports.ResourceCardProviderRegistry = ResourceCardProviderRegistry_1 = class ResourceCardProviderRegistry extends BaseStrategyRegistry {
|
|
768
|
+
onModuleInit() {
|
|
769
|
+
this.subscription = this.bus.events$.pipe(rxjs.filter((event)=>!event.strategyType || event.strategyType === RESOURCE_CARD_PROVIDER)).subscribe((event)=>{
|
|
770
|
+
try {
|
|
771
|
+
if (event.type === 'UPSERT') this.upsert(event.entry.instance);
|
|
772
|
+
else this.remove(event.orgId, event.pluginName);
|
|
773
|
+
} catch (e) {
|
|
774
|
+
// Reject the conflicting provider without terminating the lifecycle subscription.
|
|
775
|
+
this.resourceLogger.warn('Rejected invalid or conflicting resource card provider registration');
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
for (const { instance } of this.discoveryService.getProviders())if (instance) this.upsert(instance);
|
|
779
|
+
}
|
|
780
|
+
onModuleDestroy() {
|
|
781
|
+
var _this_subscription;
|
|
782
|
+
(_this_subscription = this.subscription) == null ? void 0 : _this_subscription.unsubscribe();
|
|
783
|
+
}
|
|
784
|
+
remove(scopeKey, pluginName) {
|
|
785
|
+
for (const entry of this.listAllRegistrations()){
|
|
786
|
+
if (entry.source.kind === 'plugin' && entry.source.pluginName === pluginName && entry.source.scopeKey === scopeKey) {
|
|
787
|
+
this.unregister(entry.type, entry.source, entry.strategy);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
upsert(instance) {
|
|
792
|
+
const target = resolveStrategyMetadataTarget(instance);
|
|
793
|
+
const resources = target && this.reflector.get(RESOURCE_CARD_PROVIDER, target);
|
|
794
|
+
if (!resources) return;
|
|
795
|
+
if (!isProvider(instance)) throw new Error('ResourceCardProvider must implement resolveMany');
|
|
796
|
+
const source = this.getSource(instance);
|
|
797
|
+
const keys = resources.map(resourceTypeKey);
|
|
798
|
+
// A route belongs to one plugin across scopes; a different plugin cannot shadow it.
|
|
799
|
+
// Preflight the whole batch so a conflicting multi-type provider is never partly installed.
|
|
800
|
+
for (const key of keys){
|
|
801
|
+
for (const existing of this.listAllRegistrations().filter((entry)=>entry.type === key)){
|
|
802
|
+
const samePlugin = source.kind === 'plugin' && existing.source.kind === 'plugin' && source.pluginName === existing.source.pluginName;
|
|
803
|
+
if (existing.strategy !== instance && !samePlugin) {
|
|
804
|
+
throw new Error(`Resource card type ${key} is already registered`);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
this.assertCanRegister(key, instance, source);
|
|
808
|
+
}
|
|
809
|
+
for (const key of keys)this.register(key, instance, source);
|
|
810
|
+
}
|
|
811
|
+
find(resource, organizationId) {
|
|
812
|
+
const key = resourceTypeKey(resource);
|
|
813
|
+
for (const scopeKey of this.resolveStrategyScopeKeys(organizationId)){
|
|
814
|
+
var _this_strategies_get;
|
|
815
|
+
const provider = (_this_strategies_get = this.strategies.get(scopeKey)) == null ? void 0 : _this_strategies_get.get(key);
|
|
816
|
+
if (provider) return provider;
|
|
817
|
+
}
|
|
818
|
+
return undefined;
|
|
819
|
+
}
|
|
820
|
+
constructor(discovery, reflector){
|
|
821
|
+
super(RESOURCE_CARD_PROVIDER, discovery, reflector);
|
|
822
|
+
this.resourceLogger = new common.Logger(ResourceCardProviderRegistry_1.name);
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
exports.ResourceCardProviderRegistry = ResourceCardProviderRegistry_1 = __decorate([
|
|
826
|
+
common.Injectable(),
|
|
827
|
+
__metadata("design:paramtypes", [
|
|
828
|
+
core.DiscoveryService,
|
|
829
|
+
core.Reflector
|
|
830
|
+
])
|
|
831
|
+
], exports.ResourceCardProviderRegistry);
|
|
832
|
+
|
|
833
|
+
function createPluginLogger(scope, baseMeta = {}) {
|
|
834
|
+
const nestLogger = new common.Logger(scope);
|
|
835
|
+
const wrap = (level, msg, meta)=>{
|
|
836
|
+
var // Maintain alignment with the Nest Logger interface
|
|
837
|
+
_nestLogger_level;
|
|
838
|
+
const payload = meta ? _extends._extends({}, baseMeta, meta) : baseMeta;
|
|
839
|
+
(_nestLogger_level = nestLogger[level]) == null ? void 0 : _nestLogger_level.call(nestLogger, msg + (Object.keys(payload).length ? ` ${JSON.stringify(payload)}` : ''));
|
|
840
|
+
};
|
|
841
|
+
return {
|
|
842
|
+
child (meta) {
|
|
843
|
+
return createPluginLogger(scope, _extends._extends({}, baseMeta, meta));
|
|
844
|
+
},
|
|
845
|
+
debug: (msg, meta)=>wrap('debug', msg, meta),
|
|
846
|
+
log: (msg, meta)=>wrap('log', msg, meta),
|
|
847
|
+
warn: (msg, meta)=>wrap('warn', msg, meta),
|
|
848
|
+
error: (msg, meta)=>wrap('error', msg, meta)
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
const INTEGRATION_STRATEGY = 'INTEGRATION_STRATEGY';
|
|
853
|
+
const IntegrationStrategyKey = (provider)=>common.applyDecorators(common.SetMetadata(INTEGRATION_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, INTEGRATION_STRATEGY));
|
|
854
|
+
|
|
802
855
|
exports.IntegrationStrategyRegistry = class IntegrationStrategyRegistry extends BaseStrategyRegistry {
|
|
803
856
|
constructor(discoveryService, reflector){
|
|
804
857
|
super(INTEGRATION_STRATEGY, discoveryService, reflector);
|
|
@@ -2651,6 +2704,9 @@ function normalizeCurrency(currency) {
|
|
|
2651
2704
|
|
|
2652
2705
|
var AIModel_1;
|
|
2653
2706
|
exports.AIModel = AIModel_1 = class AIModel {
|
|
2707
|
+
getRealtimeModel(_copilotModel) {
|
|
2708
|
+
throw new Error('Unsupported realtime model');
|
|
2709
|
+
}
|
|
2654
2710
|
getChatModel(copilotModel, options) {
|
|
2655
2711
|
throw new Error(`Unsupport chat model!`);
|
|
2656
2712
|
}
|
|
@@ -2894,6 +2950,75 @@ function _class_private_field_loose_key(name) {
|
|
|
2894
2950
|
return "__private_" + id++ + "_" + name;
|
|
2895
2951
|
}
|
|
2896
2952
|
|
|
2953
|
+
function resolveTokenUsageCandidates(input) {
|
|
2954
|
+
const candidates = [
|
|
2955
|
+
{
|
|
2956
|
+
value: input.canonical,
|
|
2957
|
+
source: 'provider'
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
value: input.actual,
|
|
2961
|
+
source: 'provider'
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
value: input.estimated,
|
|
2965
|
+
source: 'estimated'
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
value: {
|
|
2969
|
+
totalTokens: input.legacyTotal
|
|
2970
|
+
},
|
|
2971
|
+
source: 'legacy'
|
|
2972
|
+
}
|
|
2973
|
+
];
|
|
2974
|
+
for (const candidate of candidates){
|
|
2975
|
+
const usage = normalizeTokenUsage(candidate.value);
|
|
2976
|
+
if (usage) return {
|
|
2977
|
+
usage,
|
|
2978
|
+
source: candidate.source
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
return {
|
|
2982
|
+
usage: {
|
|
2983
|
+
promptTokens: 0,
|
|
2984
|
+
completionTokens: 0,
|
|
2985
|
+
totalTokens: 0
|
|
2986
|
+
},
|
|
2987
|
+
source: 'unavailable'
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
function normalizeTokenUsage(candidate) {
|
|
2991
|
+
if (!candidate) return null;
|
|
2992
|
+
const counts = [
|
|
2993
|
+
candidate.promptTokens,
|
|
2994
|
+
candidate.completionTokens,
|
|
2995
|
+
candidate.totalTokens,
|
|
2996
|
+
candidate.cacheReadInputTokens,
|
|
2997
|
+
candidate.cacheWriteInputTokens,
|
|
2998
|
+
candidate.reasoningTokens
|
|
2999
|
+
];
|
|
3000
|
+
if (counts.some((count)=>count !== undefined && (!Number.isSafeInteger(count) || count < 0))) return null;
|
|
3001
|
+
var _candidate_promptTokens;
|
|
3002
|
+
const promptTokens = (_candidate_promptTokens = candidate.promptTokens) != null ? _candidate_promptTokens : 0;
|
|
3003
|
+
var _candidate_completionTokens;
|
|
3004
|
+
const completionTokens = (_candidate_completionTokens = candidate.completionTokens) != null ? _candidate_completionTokens : 0;
|
|
3005
|
+
const totalTokens = candidate.totalTokens || promptTokens + completionTokens;
|
|
3006
|
+
if (!Number.isSafeInteger(totalTokens) || totalTokens <= 0 || totalTokens < promptTokens + completionTokens) return null;
|
|
3007
|
+
var _candidate_cacheReadInputTokens, _candidate_cacheWriteInputTokens, _candidate_reasoningTokens;
|
|
3008
|
+
if (((_candidate_cacheReadInputTokens = candidate.cacheReadInputTokens) != null ? _candidate_cacheReadInputTokens : 0) + ((_candidate_cacheWriteInputTokens = candidate.cacheWriteInputTokens) != null ? _candidate_cacheWriteInputTokens : 0) > promptTokens || ((_candidate_reasoningTokens = candidate.reasoningTokens) != null ? _candidate_reasoningTokens : 0) > completionTokens) return null;
|
|
3009
|
+
return _extends._extends({
|
|
3010
|
+
promptTokens,
|
|
3011
|
+
completionTokens,
|
|
3012
|
+
totalTokens
|
|
3013
|
+
}, candidate.cacheReadInputTokens ? {
|
|
3014
|
+
cacheReadInputTokens: candidate.cacheReadInputTokens
|
|
3015
|
+
} : {}, candidate.cacheWriteInputTokens ? {
|
|
3016
|
+
cacheWriteInputTokens: candidate.cacheWriteInputTokens
|
|
3017
|
+
} : {}, candidate.reasoningTokens ? {
|
|
3018
|
+
reasoningTokens: candidate.reasoningTokens
|
|
3019
|
+
} : {});
|
|
3020
|
+
}
|
|
3021
|
+
|
|
2897
3022
|
var _a;
|
|
2898
3023
|
class LLMUsage {
|
|
2899
3024
|
static emptyUsage() {
|
|
@@ -2939,6 +3064,18 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
2939
3064
|
_commonParameterRules(model) {
|
|
2940
3065
|
return CommonParameterRules;
|
|
2941
3066
|
}
|
|
3067
|
+
/** Price already normalized provider facts without starting another inference or writing a ledger. */ priceActualTokenUsage(model, tokenUsage, context = {}) {
|
|
3068
|
+
var _this_getModelSchema;
|
|
3069
|
+
const usage = normalizeTokenUsage(tokenUsage);
|
|
3070
|
+
if (!usage) throw new Error('Actual token usage is required');
|
|
3071
|
+
const priced = this.calcResponseUsage(model, {}, usage.promptTokens, usage.completionTokens, performance.now(), usage, _extends._extends({}, context, {
|
|
3072
|
+
inputTokensIncludeCache: true
|
|
3073
|
+
}));
|
|
3074
|
+
return _extends._extends({}, priced, usage, !((_this_getModelSchema = this.getModelSchema(model, {})) == null ? void 0 : _this_getModelSchema.pricing) ? {
|
|
3075
|
+
pricingStatus: 'unpriced',
|
|
3076
|
+
totalPrice: undefined
|
|
3077
|
+
} : {});
|
|
3078
|
+
}
|
|
2942
3079
|
calcResponseUsage(model, credentials, promptTokens, completionTokens, startedAt = this.startedAt, tokenUsage, pricingContext = {}) {
|
|
2943
3080
|
var _this_getModelSchema;
|
|
2944
3081
|
const resolvedTokenUsage = tokenUsage != null ? tokenUsage : {
|
|
@@ -3086,12 +3223,15 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3086
3223
|
callback
|
|
3087
3224
|
];
|
|
3088
3225
|
}
|
|
3089
|
-
createHandleLLMErrorCallbacks(
|
|
3226
|
+
createHandleLLMErrorCallbacks(_fields, logger) {
|
|
3090
3227
|
return {
|
|
3091
|
-
handleLLMError: (
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
(logger != null ? logger : _class_private_field_loose_base(this, _logger)[_logger]).error(
|
|
3228
|
+
handleLLMError: (error)=>{
|
|
3229
|
+
// Provider errors and constructor fields can contain credentials or request bodies.
|
|
3230
|
+
const errorType = error instanceof Error && /^[A-Za-z]{1,60}$/.test(error.name) ? error.name : 'Error';
|
|
3231
|
+
(logger != null ? logger : _class_private_field_loose_base(this, _logger)[_logger]).error({
|
|
3232
|
+
event: 'model_provider_request_failed',
|
|
3233
|
+
errorType
|
|
3234
|
+
});
|
|
3095
3235
|
}
|
|
3096
3236
|
};
|
|
3097
3237
|
}
|
|
@@ -3301,97 +3441,59 @@ function isAbortError(error) {
|
|
|
3301
3441
|
return error.name === 'AbortError' || /\babort(?:ed)?\b/i.test(error.message);
|
|
3302
3442
|
}
|
|
3303
3443
|
function calcTokenUsage(output) {
|
|
3304
|
-
|
|
3305
|
-
const tokenUsage = {
|
|
3444
|
+
const result = {
|
|
3306
3445
|
promptTokens: 0,
|
|
3307
3446
|
completionTokens: 0,
|
|
3308
3447
|
totalTokens: 0
|
|
3309
3448
|
};
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
if (message.
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
cacheReadInputTokens
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
}
|
|
3325
|
-
});
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3449
|
+
var _output_generations;
|
|
3450
|
+
for (const choices of (_output_generations = output.generations) != null ? _output_generations : []){
|
|
3451
|
+
// Each inner array contains choices from one request, not independent provider attempts.
|
|
3452
|
+
const usage = choices.map((choice)=>{
|
|
3453
|
+
var _metadata_input_token_details, _metadata_input_token_details1, _metadata_output_token_details;
|
|
3454
|
+
if (!('message' in choice) || !messages.isBaseMessage(choice.message) || !messages.isAIMessage(choice.message)) return null;
|
|
3455
|
+
const metadata = choice.message.usage_metadata;
|
|
3456
|
+
return metadata ? normalizeTokenUsage({
|
|
3457
|
+
promptTokens: metadata.input_tokens,
|
|
3458
|
+
completionTokens: metadata.output_tokens,
|
|
3459
|
+
totalTokens: metadata.total_tokens,
|
|
3460
|
+
cacheReadInputTokens: (_metadata_input_token_details = metadata.input_token_details) == null ? void 0 : _metadata_input_token_details.cache_read,
|
|
3461
|
+
cacheWriteInputTokens: (_metadata_input_token_details1 = metadata.input_token_details) == null ? void 0 : _metadata_input_token_details1.cache_creation,
|
|
3462
|
+
reasoningTokens: (_metadata_output_token_details = metadata.output_token_details) == null ? void 0 : _metadata_output_token_details.reasoning
|
|
3463
|
+
}) : null;
|
|
3464
|
+
}).find((candidate)=>candidate !== null);
|
|
3465
|
+
if (!usage) continue;
|
|
3466
|
+
result.promptTokens += usage.promptTokens;
|
|
3467
|
+
result.completionTokens += usage.completionTokens;
|
|
3468
|
+
result.totalTokens += usage.totalTokens;
|
|
3469
|
+
for (const key of [
|
|
3470
|
+
'cacheReadInputTokens',
|
|
3471
|
+
'cacheWriteInputTokens',
|
|
3472
|
+
'reasoningTokens'
|
|
3473
|
+
]){
|
|
3474
|
+
var _result_key;
|
|
3475
|
+
if (usage[key] !== undefined) result[key] = ((_result_key = result[key]) != null ? _result_key : 0) + usage[key];
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3478
|
+
return result;
|
|
3330
3479
|
}
|
|
3331
3480
|
function resolveTokenUsage(output) {
|
|
3332
3481
|
return resolveTokenUsageWithAuthority(output).usage;
|
|
3333
3482
|
}
|
|
3334
3483
|
function resolveTokenUsageWithAuthority(output) {
|
|
3335
3484
|
var _output_llmOutput, _output_llmOutput1, _output_llmOutput2;
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3485
|
+
const resolved = resolveTokenUsageCandidates({
|
|
3486
|
+
canonical: calcTokenUsage(output),
|
|
3487
|
+
actual: (_output_llmOutput = output.llmOutput) == null ? void 0 : _output_llmOutput['tokenUsage'],
|
|
3488
|
+
estimated: (_output_llmOutput1 = output.llmOutput) == null ? void 0 : _output_llmOutput1['estimatedTokenUsage'],
|
|
3489
|
+
legacyTotal: (_output_llmOutput2 = output.llmOutput) == null ? void 0 : _output_llmOutput2['totalTokens']
|
|
3339
3490
|
});
|
|
3340
|
-
if (actualUsage) {
|
|
3341
|
-
return {
|
|
3342
|
-
usage: actualUsage
|
|
3343
|
-
};
|
|
3344
|
-
}
|
|
3345
|
-
const estimatedUsage = normalizeTokenUsage((_output_llmOutput2 = output.llmOutput) == null ? void 0 : _output_llmOutput2['estimatedTokenUsage']);
|
|
3346
|
-
if (estimatedUsage) {
|
|
3347
|
-
return {
|
|
3348
|
-
usage: estimatedUsage,
|
|
3349
|
-
type: 'estimated'
|
|
3350
|
-
};
|
|
3351
|
-
}
|
|
3352
|
-
return {
|
|
3353
|
-
usage: {
|
|
3354
|
-
promptTokens: 0,
|
|
3355
|
-
completionTokens: 0,
|
|
3356
|
-
totalTokens: 0
|
|
3357
|
-
}
|
|
3358
|
-
};
|
|
3359
|
-
}
|
|
3360
|
-
function normalizeTokenUsage(candidate) {
|
|
3361
|
-
if (!candidate) {
|
|
3362
|
-
return null;
|
|
3363
|
-
}
|
|
3364
|
-
if (!isValidTokenCount(candidate.promptTokens) || !isValidTokenCount(candidate.completionTokens) || !isValidTokenCount(candidate.totalTokens)) {
|
|
3365
|
-
return null;
|
|
3366
|
-
}
|
|
3367
|
-
var _candidate_promptTokens;
|
|
3368
|
-
const promptTokens = (_candidate_promptTokens = candidate.promptTokens) != null ? _candidate_promptTokens : 0;
|
|
3369
|
-
var _candidate_completionTokens;
|
|
3370
|
-
const completionTokens = (_candidate_completionTokens = candidate.completionTokens) != null ? _candidate_completionTokens : 0;
|
|
3371
|
-
const totalTokens = candidate.totalTokens || promptTokens + completionTokens;
|
|
3372
|
-
if (promptTokens === 0 && completionTokens === 0 && totalTokens === 0) {
|
|
3373
|
-
return null;
|
|
3374
|
-
}
|
|
3375
|
-
var _candidate_cacheReadInputTokens;
|
|
3376
|
-
const cacheReadInputTokens = (_candidate_cacheReadInputTokens = candidate.cacheReadInputTokens) != null ? _candidate_cacheReadInputTokens : 0;
|
|
3377
|
-
var _candidate_cacheWriteInputTokens;
|
|
3378
|
-
const cacheWriteInputTokens = (_candidate_cacheWriteInputTokens = candidate.cacheWriteInputTokens) != null ? _candidate_cacheWriteInputTokens : 0;
|
|
3379
|
-
if (!isValidTokenCount(cacheReadInputTokens) || !isValidTokenCount(cacheWriteInputTokens)) {
|
|
3380
|
-
return null;
|
|
3381
|
-
}
|
|
3382
3491
|
return _extends._extends({
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
}, cacheReadInputTokens > 0 ? {
|
|
3387
|
-
cacheReadInputTokens
|
|
3388
|
-
} : {}, cacheWriteInputTokens > 0 ? {
|
|
3389
|
-
cacheWriteInputTokens
|
|
3492
|
+
usage: resolved.usage
|
|
3493
|
+
}, resolved.source === 'estimated' ? {
|
|
3494
|
+
type: 'estimated'
|
|
3390
3495
|
} : {});
|
|
3391
3496
|
}
|
|
3392
|
-
function isValidTokenCount(value) {
|
|
3393
|
-
return value === undefined || Number.isFinite(value) && value >= 0;
|
|
3394
|
-
}
|
|
3395
3497
|
function normalizeCacheTokenAccounting(tokenUsage, context) {
|
|
3396
3498
|
if (context.inputTokensIncludeCache !== false) return tokenUsage;
|
|
3397
3499
|
var _tokenUsage_cacheReadInputTokens, _tokenUsage_cacheWriteInputTokens;
|
|
@@ -3842,6 +3944,37 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
|
|
|
3842
3944
|
id: CreateModelClientCommand.type
|
|
3843
3945
|
}, CreateModelClientCommand);
|
|
3844
3946
|
|
|
3947
|
+
/** A single fetch is one billable attempt. No SDK retries or redirects to another credential origin. */ function nativeModelTransport(input) {
|
|
3948
|
+
const base = new URL(input.baseUrl);
|
|
3949
|
+
if (![
|
|
3950
|
+
'http:',
|
|
3951
|
+
'https:'
|
|
3952
|
+
].includes(base.protocol) || base.username || base.password || base.search || base.hash) throw new Error('Invalid native model endpoint');
|
|
3953
|
+
const suffix = input.protocol === 'openai_responses' ? '/responses' : '/v1/messages';
|
|
3954
|
+
const url = `${base.href.replace(/\/$/, '')}${suffix}`;
|
|
3955
|
+
return (body, forwarded, signal)=>{
|
|
3956
|
+
const headers = new Headers({
|
|
3957
|
+
'content-type': 'application/json'
|
|
3958
|
+
});
|
|
3959
|
+
if (input.protocol === 'anthropic_messages') {
|
|
3960
|
+
headers.set('anthropic-version', '2023-06-01');
|
|
3961
|
+
for (const [name, value] of Object.entries(forwarded)){
|
|
3962
|
+
// Native Anthropic feature/version headers must survive protocol evolution.
|
|
3963
|
+
if (/^anthropic-[a-z0-9-]+$/.test(name)) headers.set(name, value);
|
|
3964
|
+
}
|
|
3965
|
+
headers.set('x-api-key', input.authorization);
|
|
3966
|
+
} else headers.set('authorization', input.authorization);
|
|
3967
|
+
var _input_fetch;
|
|
3968
|
+
return ((_input_fetch = input.fetch) != null ? _input_fetch : fetch)(url, {
|
|
3969
|
+
method: 'POST',
|
|
3970
|
+
headers,
|
|
3971
|
+
body: JSON.stringify(body),
|
|
3972
|
+
signal,
|
|
3973
|
+
redirect: 'error'
|
|
3974
|
+
});
|
|
3975
|
+
};
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3845
3978
|
const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
|
|
3846
3979
|
const SkillSourceProviderStrategy = (provider)=>common.applyDecorators(common.SetMetadata(SKILL_SOURCE_PROVIDER, provider), common.SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
|
|
3847
3980
|
|
|
@@ -3882,7 +4015,7 @@ exports.AgentMiddlewareRegistry = __decorate([
|
|
|
3882
4015
|
'end'
|
|
3883
4016
|
];
|
|
3884
4017
|
|
|
3885
|
-
const AssistantTaskRuntimeCapability = modelProvider.createRuntimeCapability('platform.assistant_task', {
|
|
4018
|
+
/** Scoped runtime capability for platform Assistant tasks. */ const AssistantTaskRuntimeCapability = modelProvider.createRuntimeCapability('platform.assistant_task', {
|
|
3886
4019
|
description: 'Start asynchronous tasks on the current platform assistant.'
|
|
3887
4020
|
});
|
|
3888
4021
|
|
|
@@ -3916,6 +4049,18 @@ function isModelOutputValidationError(error) {
|
|
|
3916
4049
|
return candidate.code === MODEL_OUTPUT_VALIDATION_ERROR_CODE && candidate.retryable === true && ((_candidate_repairContext = candidate.repairContext) == null ? void 0 : _candidate_repairContext.kind) === 'invalid_tool_calls' && Array.isArray(candidate.repairContext.issues);
|
|
3917
4050
|
}
|
|
3918
4051
|
|
|
4052
|
+
/** Combine middleware contributions without mutating or weakening existing requirements. */ function mergeModelRequirements(...requirements) {
|
|
4053
|
+
const features = [
|
|
4054
|
+
...new Set(requirements.flatMap((item)=>{
|
|
4055
|
+
var _item_features;
|
|
4056
|
+
return (_item_features = item == null ? void 0 : item.features) != null ? _item_features : [];
|
|
4057
|
+
}))
|
|
4058
|
+
];
|
|
4059
|
+
return features.length ? {
|
|
4060
|
+
features
|
|
4061
|
+
} : undefined;
|
|
4062
|
+
}
|
|
4063
|
+
|
|
3919
4064
|
const SEGMENT_PATTERN = /^[a-z][a-z0-9_-]*$/i;
|
|
3920
4065
|
const VERSION_PATTERN = /^v[1-9][0-9]*$/;
|
|
3921
4066
|
function assertSegment(input, name) {
|
|
@@ -3961,6 +4106,96 @@ function assertSegment(input, name) {
|
|
|
3961
4106
|
const AGENT_CHAT_DISPATCH_MESSAGE_TYPE = defineAgentMessageType('chat_dispatch', 1);
|
|
3962
4107
|
const AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = 'steer_target_not_running';
|
|
3963
4108
|
|
|
4109
|
+
/** Captured by an authorized host command. Describing a recipient never authorizes delivery. */ const replyConversation = {
|
|
4110
|
+
conversationId: v3.z.string().uuid(),
|
|
4111
|
+
threadId: v3.z.string().trim().min(1).max(256)
|
|
4112
|
+
};
|
|
4113
|
+
const agentRuntimeReplyTargetSchema = v3.z.discriminatedUnion('type', [
|
|
4114
|
+
v3.z.object(_extends._extends({}, replyConversation, {
|
|
4115
|
+
type: v3.z.literal('xpert').optional(),
|
|
4116
|
+
xpertId: v3.z.string().uuid(),
|
|
4117
|
+
agentKey: v3.z.string().trim().min(1).max(256)
|
|
4118
|
+
})).strict(),
|
|
4119
|
+
v3.z.object(_extends._extends({}, replyConversation, {
|
|
4120
|
+
type: v3.z.literal('project_agent'),
|
|
4121
|
+
projectId: v3.z.string().uuid(),
|
|
4122
|
+
agentKey: v3.z.literal('general_agent')
|
|
4123
|
+
})).strict()
|
|
4124
|
+
]);
|
|
4125
|
+
/** Persist with the immutable invocation request before launch. No credentials or arbitrary routing headers. */ const agentInvocationDispatchContextSchema = v3.z.object({
|
|
4126
|
+
version: v3.z.literal(1),
|
|
4127
|
+
requestId: v3.z.string().uuid(),
|
|
4128
|
+
sourceMessageId: v3.z.string().trim().min(1).max(256),
|
|
4129
|
+
replyTo: agentRuntimeReplyTargetSchema,
|
|
4130
|
+
projectTask: contracts.projectTaskExecutionContextSchema.optional()
|
|
4131
|
+
}).strict();
|
|
4132
|
+
|
|
4133
|
+
const AGENT_RUNTIME_EVENT_MESSAGE_TYPE = defineAgentMessageType('runtime_event', 1);
|
|
4134
|
+
const reference = {
|
|
4135
|
+
version: v3.z.literal(1),
|
|
4136
|
+
invocationId: v3.z.string().uuid(),
|
|
4137
|
+
/** Revision of the persisted observation, never a queue delivery attempt. */ revision: v3.z.number().int().nonnegative(),
|
|
4138
|
+
projectTask: contracts.projectTaskExecutionReferenceSchema.optional()
|
|
4139
|
+
};
|
|
4140
|
+
/** Host-produced references. Consumers reload and authorize the invocation and its pinned observation. */ const agentRuntimeEventSchema = v3.z.discriminatedUnion('kind', [
|
|
4141
|
+
v3.z.object(_extends._extends({}, reference, {
|
|
4142
|
+
kind: v3.z.literal('progress'),
|
|
4143
|
+
progress: contracts.agentRuntimeProgressSchema
|
|
4144
|
+
})).strict(),
|
|
4145
|
+
v3.z.object(_extends._extends({}, reference, {
|
|
4146
|
+
kind: v3.z.literal('result'),
|
|
4147
|
+
status: contracts.agentInvocationTerminalStatusSchema
|
|
4148
|
+
})).strict(),
|
|
4149
|
+
v3.z.object(_extends._extends({}, reference, {
|
|
4150
|
+
kind: v3.z.literal('input_request'),
|
|
4151
|
+
interactionId: v3.z.string().trim().min(1).max(256)
|
|
4152
|
+
})).strict()
|
|
4153
|
+
]);
|
|
4154
|
+
/** Same observation always has the same HandoffMessage.id across retries and process restarts. */ function agentRuntimeEventMessageId(event) {
|
|
4155
|
+
return `runtime-${event.invocationId}-${event.kind}-${event.revision}`;
|
|
4156
|
+
}
|
|
4157
|
+
/** Transport states are deliberately separate from Task and Invocation status. */ const agentRuntimeDeliveryStateSchema = v3.z.enum([
|
|
4158
|
+
'pending',
|
|
4159
|
+
'received',
|
|
4160
|
+
'blocked',
|
|
4161
|
+
'failed'
|
|
4162
|
+
]);
|
|
4163
|
+
const agentRuntimeConsumptionStateSchema = v3.z.enum([
|
|
4164
|
+
'pending',
|
|
4165
|
+
'processing',
|
|
4166
|
+
'processed',
|
|
4167
|
+
'blocked',
|
|
4168
|
+
'failed'
|
|
4169
|
+
]);
|
|
4170
|
+
/** Store under a unique scoped key in the same transaction as the continuation reservation. */ const agentRuntimeResultClaimSchema = v3.z.object({
|
|
4171
|
+
invocationId: v3.z.string().uuid(),
|
|
4172
|
+
resultRevision: v3.z.number().int().nonnegative(),
|
|
4173
|
+
recipient: agentRuntimeReplyTargetSchema,
|
|
4174
|
+
consumer: v3.z.discriminatedUnion('type', [
|
|
4175
|
+
v3.z.object({
|
|
4176
|
+
type: v3.z.literal('follow_up'),
|
|
4177
|
+
executionId: v3.z.string().uuid()
|
|
4178
|
+
}).strict(),
|
|
4179
|
+
v3.z.object({
|
|
4180
|
+
type: v3.z.literal('wait'),
|
|
4181
|
+
executionId: v3.z.string().uuid(),
|
|
4182
|
+
callId: v3.z.string().trim().min(1).max(1024)
|
|
4183
|
+
}).strict()
|
|
4184
|
+
])
|
|
4185
|
+
}).strict();
|
|
4186
|
+
/**
|
|
4187
|
+
* Wait and asynchronous reply compete for this same key, regardless of delivery revision.
|
|
4188
|
+
* The storage key must additionally include tenant, organization and owner from trusted scope.
|
|
4189
|
+
*/ function agentRuntimeResultConsumptionKey(invocationId, recipient) {
|
|
4190
|
+
return JSON.stringify([
|
|
4191
|
+
invocationId,
|
|
4192
|
+
recipient.conversationId,
|
|
4193
|
+
recipient.threadId,
|
|
4194
|
+
recipient.type === 'project_agent' ? `project:${recipient.projectId}` : recipient.xpertId,
|
|
4195
|
+
recipient.agentKey
|
|
4196
|
+
]);
|
|
4197
|
+
}
|
|
4198
|
+
|
|
3964
4199
|
/**
|
|
3965
4200
|
* Handoff Processor meta key。
|
|
3966
4201
|
*/ const HANDOFF_PROCESSOR_STRATEGY = 'HANDOFF_PROCESSOR_STRATEGY';
|
|
@@ -4005,6 +4240,76 @@ exports.HandoffProcessorRegistry = __decorate([
|
|
|
4005
4240
|
runTtlMs: 10 * 60 * 1000
|
|
4006
4241
|
};
|
|
4007
4242
|
|
|
4243
|
+
/** Checks confirmed completion; unknown remains non-terminal. */ function isAgentInvocationTerminal(status) {
|
|
4244
|
+
return status === 'succeeded' || status === 'failed' || status === 'cancelled';
|
|
4245
|
+
}
|
|
4246
|
+
|
|
4247
|
+
/** Nest discovery metadata key for runtime strategies. */ const AGENT_RUNTIME_STRATEGY = 'AGENT_RUNTIME_STRATEGY';
|
|
4248
|
+
/** 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));
|
|
4249
|
+
/** Scoped strategy registry with pinned provider/version lookup for continuation. */ exports.AgentRuntimeRegistry = class AgentRuntimeRegistry extends BaseStrategyRegistry {
|
|
4250
|
+
/** Find the exact original scope/plugin/version, without fallback. Returns undefined if unavailable. */ getPinned(provider, source) {
|
|
4251
|
+
var _this_strategies_get;
|
|
4252
|
+
const strategy = (_this_strategies_get = this.strategies.get(source.scopeKey)) == null ? void 0 : _this_strategies_get.get(provider);
|
|
4253
|
+
if (!strategy) return undefined;
|
|
4254
|
+
const actual = this.getSource(strategy);
|
|
4255
|
+
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;
|
|
4256
|
+
}
|
|
4257
|
+
constructor(discoveryService, reflector){
|
|
4258
|
+
super(AGENT_RUNTIME_STRATEGY, discoveryService, reflector);
|
|
4259
|
+
}
|
|
4260
|
+
};
|
|
4261
|
+
exports.AgentRuntimeRegistry = __decorate([
|
|
4262
|
+
common.Injectable(),
|
|
4263
|
+
__metadata("design:paramtypes", [
|
|
4264
|
+
core.DiscoveryService,
|
|
4265
|
+
core.Reflector
|
|
4266
|
+
])
|
|
4267
|
+
], exports.AgentRuntimeRegistry);
|
|
4268
|
+
|
|
4269
|
+
/** Caller-scoped API obtained through runtime.capabilities.require(...). */ const AgentInvocationRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent_invocation', {
|
|
4270
|
+
description: 'Scoped, versioned Agent invocation and lifecycle control'
|
|
4271
|
+
});
|
|
4272
|
+
/** Platform factory capability. The wire key is stable across SDK naming changes. */ const AgentRuntimeFactoryCapability = modelProvider.createRuntimeCapability('platform.agent_invocation.factory');
|
|
4273
|
+
|
|
4274
|
+
/**
|
|
4275
|
+
* Keeps shared OS model authorization independent of Pro Computer/Docker lifecycle details.
|
|
4276
|
+
* Grant issuance, authentication, revalidation and renewal delegate environment checks to this host adapter.
|
|
4277
|
+
* Implementations validate ownership and instance identity so a replaced runtime cannot keep its old grant.
|
|
4278
|
+
* Execution validity is independent of desktop viewing sessions; managed runners may also require an operation lease.
|
|
4279
|
+
* Other environments can supply their own checks without changing the grant service.
|
|
4280
|
+
* This capability validates the bound environment; model selection and usage accounting remain separate concerns.
|
|
4281
|
+
*/ const ModelExecutionEnvironmentCapability = modelProvider.createRuntimeCapability('platform.model_execution.environment');
|
|
4282
|
+
|
|
4283
|
+
/** Configuration adapters describe secrets by reference; only the host materializes credentials. */ const CLI_MODEL_TOKEN_REFERENCE = '${XPERT_EXECUTION_TOKEN}';
|
|
4284
|
+
const CliModelProfilesCapability = modelProvider.createRuntimeCapability('platform.cli_model_profiles');
|
|
4285
|
+
/** Additional execution sources can validate lifecycle without making OS depend on Pro entities. */ const ShellModelExecutionSourceCapability = modelProvider.createRuntimeCapability('platform.model_execution.shell_source');
|
|
4286
|
+
|
|
4287
|
+
function taskWaitReason(states, mode) {
|
|
4288
|
+
if (states.length && (mode === 'all' ? states.every((state)=>state === 'completed') : states.includes('completed'))) return 'completed';
|
|
4289
|
+
if (states.includes('attention')) return 'attention';
|
|
4290
|
+
return undefined;
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
const AgentExecutionRunnerCapability = modelProvider.createRuntimeCapability('platform.agent_execution.runner');
|
|
4294
|
+
const AgentExecutionRunnerFactoryCapability = modelProvider.createRuntimeCapability('platform.agent_execution.runner.factory');
|
|
4295
|
+
|
|
4296
|
+
/** Older runtime plugins can still send this event; new emissions use ON_CHAT_EVENT. */ const RESOURCE_CARD_EVENT = 'xpert.resource_card';
|
|
4297
|
+
|
|
4298
|
+
const ASSISTANT_CAPABILITY_PROVIDER = 'ASSISTANT_CAPABILITY_PROVIDER';
|
|
4299
|
+
const AssistantCapabilityProvider = (key)=>common.applyDecorators(common.SetMetadata(ASSISTANT_CAPABILITY_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, ASSISTANT_CAPABILITY_PROVIDER));
|
|
4300
|
+
exports.AssistantCapabilityProviderRegistry = class AssistantCapabilityProviderRegistry extends BaseStrategyRegistry {
|
|
4301
|
+
constructor(discovery, reflector){
|
|
4302
|
+
super(ASSISTANT_CAPABILITY_PROVIDER, discovery, reflector);
|
|
4303
|
+
}
|
|
4304
|
+
};
|
|
4305
|
+
exports.AssistantCapabilityProviderRegistry = __decorate([
|
|
4306
|
+
common.Injectable(),
|
|
4307
|
+
__metadata("design:paramtypes", [
|
|
4308
|
+
core.DiscoveryService,
|
|
4309
|
+
core.Reflector
|
|
4310
|
+
])
|
|
4311
|
+
], exports.AssistantCapabilityProviderRegistry);
|
|
4312
|
+
|
|
4008
4313
|
/**
|
|
4009
4314
|
* Common platform message length limits
|
|
4010
4315
|
*/ const CHAT_CHANNEL_TEXT_LIMITS = {
|
|
@@ -4299,10 +4604,14 @@ function appendSandboxMessage(output, message) {
|
|
|
4299
4604
|
function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS) {
|
|
4300
4605
|
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
4606
|
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 {
|
|
4607
|
+
return _extends._extends({
|
|
4303
4608
|
timeoutMs,
|
|
4304
4609
|
maxOutputBytes
|
|
4305
|
-
}
|
|
4610
|
+
}, (options == null ? void 0 : options.executionScope) ? {
|
|
4611
|
+
executionScope: options.executionScope
|
|
4612
|
+
} : {}, (options == null ? void 0 : options.signal) ? {
|
|
4613
|
+
signal: options.signal
|
|
4614
|
+
} : {});
|
|
4306
4615
|
}
|
|
4307
4616
|
|
|
4308
4617
|
function isObjectLike$2(value) {
|
|
@@ -5441,6 +5750,7 @@ exports.ViewExtensionProviderRegistry = __decorate([
|
|
|
5441
5750
|
|
|
5442
5751
|
const XPERT_REMOTE_UI_CSS = `
|
|
5443
5752
|
:root {
|
|
5753
|
+
font-size: var(--xui-density-root-font-size, 16px);
|
|
5444
5754
|
color-scheme: light;
|
|
5445
5755
|
--xui-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
5446
5756
|
--xui-color-background: #fff;
|
|
@@ -5475,6 +5785,7 @@ const XPERT_REMOTE_UI_CSS = `
|
|
|
5475
5785
|
--xui-radius-sm: 6px;
|
|
5476
5786
|
--xui-radius-md: 8px;
|
|
5477
5787
|
--xui-radius-lg: 10px;
|
|
5788
|
+
--xui-font-size: 14px;
|
|
5478
5789
|
--xui-font-size-xs: 0.75rem;
|
|
5479
5790
|
--xui-font-size-sm: 0.8125rem;
|
|
5480
5791
|
--xui-font-size-md: 0.875rem;
|
|
@@ -5762,6 +6073,7 @@ const XPERT_REMOTE_UI_BOOTSTRAP = `
|
|
|
5762
6073
|
var VERSION = 1
|
|
5763
6074
|
var TOKEN_MAP = {
|
|
5764
6075
|
fontFamily: '--xui-font-family',
|
|
6076
|
+
densityRootFontSize: '--xui-density-root-font-size',
|
|
5765
6077
|
colorBackground: '--xui-color-background',
|
|
5766
6078
|
colorForeground: '--xui-color-foreground',
|
|
5767
6079
|
colorCard: '--xui-color-card',
|
|
@@ -5794,6 +6106,7 @@ const XPERT_REMOTE_UI_BOOTSTRAP = `
|
|
|
5794
6106
|
radiusSm: '--xui-radius-sm',
|
|
5795
6107
|
radiusMd: '--xui-radius-md',
|
|
5796
6108
|
radiusLg: '--xui-radius-lg',
|
|
6109
|
+
fontSize: '--xui-font-size',
|
|
5797
6110
|
fontSizeXs: '--xui-font-size-xs',
|
|
5798
6111
|
fontSizeSm: '--xui-font-size-sm',
|
|
5799
6112
|
fontSizeMd: '--xui-font-size-md',
|
|
@@ -5955,6 +6268,9 @@ exports.EvolutionTargetProviderRegistry = __decorate([
|
|
|
5955
6268
|
], exports.EvolutionTargetProviderRegistry);
|
|
5956
6269
|
|
|
5957
6270
|
const EVOLUTION_RUNTIME_SERVICE_TOKEN = 'XPERT_EVOLUTION_RUNTIME_SERVICE';
|
|
6271
|
+
const EvolutionBaselineRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.baselines', {
|
|
6272
|
+
description: 'Inspect and initialize organization rule baselines with administrator authorization and revision checks.'
|
|
6273
|
+
});
|
|
5958
6274
|
const EvolutionRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution', {
|
|
5959
6275
|
description: 'Ingest learning signals and resolve immutable capability versions for domain runtimes.'
|
|
5960
6276
|
});
|
|
@@ -6195,6 +6511,11 @@ function describeXpertToolProvider(instance) {
|
|
|
6195
6511
|
if (middlewareProvider && !middlewareProviders.has(middlewareProvider)) {
|
|
6196
6512
|
throw new Error(`Tool '${toolOptions.name}' references undeclared Middleware provider '${middlewareProvider}'.`);
|
|
6197
6513
|
}
|
|
6514
|
+
if (toolOptions.app) {
|
|
6515
|
+
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'))) {
|
|
6516
|
+
throw new Error(`Tool '${toolOptions.name}' has an invalid middleware App binding.`);
|
|
6517
|
+
}
|
|
6518
|
+
}
|
|
6198
6519
|
const appKey = toolOptions.mcp && ((_toolOptions_mcp_app = toolOptions.mcp.app) == null ? void 0 : _toolOptions_mcp_app.resourceKey);
|
|
6199
6520
|
if (appKey && !appKeys.has(appKey)) {
|
|
6200
6521
|
throw new Error(`MCP Tool '${toolOptions.name}' references undeclared App '${appKey}'.`);
|
|
@@ -6592,12 +6913,21 @@ class DecoratedAgentMiddlewareStrategy {
|
|
|
6592
6913
|
return this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>item.options.name);
|
|
6593
6914
|
}
|
|
6594
6915
|
async createMiddleware(options, context) {
|
|
6916
|
+
var _this_descriptor_options_apps;
|
|
6595
6917
|
const tools = this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>createAgentTool(this.instance, item, context, options));
|
|
6596
6918
|
const extensions = await (this.instance.getMiddlewareExtensions == null ? void 0 : this.instance.getMiddlewareExtensions.call(this.instance, this.provider, options, context));
|
|
6597
6919
|
return _extends._extends({}, extensions != null ? extensions : {}, {
|
|
6598
6920
|
name: this.provider,
|
|
6599
6921
|
tools
|
|
6600
|
-
})
|
|
6922
|
+
}, ((_this_descriptor_options_apps = this.descriptor.options.apps) == null ? void 0 : _this_descriptor_options_apps.length) ? {
|
|
6923
|
+
apps: {
|
|
6924
|
+
definitions: this.descriptor.options.apps,
|
|
6925
|
+
tools: Object.fromEntries(this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider && item.options.app).map((item)=>[
|
|
6926
|
+
item.options.name,
|
|
6927
|
+
item.options.app
|
|
6928
|
+
]))
|
|
6929
|
+
}
|
|
6930
|
+
} : {});
|
|
6601
6931
|
}
|
|
6602
6932
|
constructor(instance, descriptor, provider){
|
|
6603
6933
|
var _descriptor_options_middlewares;
|
|
@@ -9757,6 +10087,39 @@ function stableJson(value) {
|
|
|
9757
10087
|
return `{${entries.map(([key, item])=>`${JSON.stringify(key)}:${stableJson(item)}`).join(',')}}`;
|
|
9758
10088
|
}
|
|
9759
10089
|
|
|
10090
|
+
const PROJECT_TYPE_PROVIDER = 'PROJECT_TYPE_PROVIDER';
|
|
10091
|
+
/** 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));
|
|
10092
|
+
exports.ProjectTypeProviderRegistry = class ProjectTypeProviderRegistry extends BaseStrategyRegistry {
|
|
10093
|
+
constructor(discovery, reflector){
|
|
10094
|
+
super(PROJECT_TYPE_PROVIDER, discovery, reflector);
|
|
10095
|
+
}
|
|
10096
|
+
};
|
|
10097
|
+
exports.ProjectTypeProviderRegistry = __decorate([
|
|
10098
|
+
common.Injectable(),
|
|
10099
|
+
__metadata("design:paramtypes", [
|
|
10100
|
+
core.DiscoveryService,
|
|
10101
|
+
core.Reflector
|
|
10102
|
+
])
|
|
10103
|
+
], exports.ProjectTypeProviderRegistry);
|
|
10104
|
+
|
|
10105
|
+
const PROJECT_TASK_PROVIDER = 'PROJECT_TASK_PROVIDER';
|
|
10106
|
+
const ProjectTaskProvider = (key)=>common.applyDecorators(common.SetMetadata(PROJECT_TASK_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, PROJECT_TASK_PROVIDER));
|
|
10107
|
+
exports.ProjectTaskProviderRegistry = class ProjectTaskProviderRegistry extends BaseStrategyRegistry {
|
|
10108
|
+
constructor(discovery, reflector){
|
|
10109
|
+
super(PROJECT_TASK_PROVIDER, discovery, reflector);
|
|
10110
|
+
}
|
|
10111
|
+
};
|
|
10112
|
+
exports.ProjectTaskProviderRegistry = __decorate([
|
|
10113
|
+
common.Injectable(),
|
|
10114
|
+
__metadata("design:paramtypes", [
|
|
10115
|
+
core.DiscoveryService,
|
|
10116
|
+
core.Reflector
|
|
10117
|
+
])
|
|
10118
|
+
], exports.ProjectTaskProviderRegistry);
|
|
10119
|
+
const ProjectTasksRuntimeCapability = modelProvider.createRuntimeCapability('platform.project.tasks', {
|
|
10120
|
+
description: 'Read project task graphs, manage schedules, and resolve exact execution conversations.'
|
|
10121
|
+
});
|
|
10122
|
+
|
|
9760
10123
|
Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
|
|
9761
10124
|
enumerable: true,
|
|
9762
10125
|
get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
|
|
@@ -9765,6 +10128,26 @@ Object.defineProperty(exports, "ASSISTANT_CONTEXT_SET_COMMAND", {
|
|
|
9765
10128
|
enumerable: true,
|
|
9766
10129
|
get: function () { return contracts.ASSISTANT_CONTEXT_SET_COMMAND; }
|
|
9767
10130
|
});
|
|
10131
|
+
Object.defineProperty(exports, "agentOutputDeliverySchema", {
|
|
10132
|
+
enumerable: true,
|
|
10133
|
+
get: function () { return contracts.agentOutputDeliverySchema; }
|
|
10134
|
+
});
|
|
10135
|
+
Object.defineProperty(exports, "agentResultPathSchema", {
|
|
10136
|
+
enumerable: true,
|
|
10137
|
+
get: function () { return contracts.agentResultPathSchema; }
|
|
10138
|
+
});
|
|
10139
|
+
Object.defineProperty(exports, "createResourceCardContent", {
|
|
10140
|
+
enumerable: true,
|
|
10141
|
+
get: function () { return contracts.createResourceCardContent; }
|
|
10142
|
+
});
|
|
10143
|
+
Object.defineProperty(exports, "parseResourceCard", {
|
|
10144
|
+
enumerable: true,
|
|
10145
|
+
get: function () { return contracts.parseResourceCard; }
|
|
10146
|
+
});
|
|
10147
|
+
Object.defineProperty(exports, "resourceCardId", {
|
|
10148
|
+
enumerable: true,
|
|
10149
|
+
get: function () { return contracts.resourceCardId; }
|
|
10150
|
+
});
|
|
9768
10151
|
exports.ActorTokenRuntimeCapability = modelProvider.ActorTokenRuntimeCapability;
|
|
9769
10152
|
exports.ActorTokenRuntimeFactoryCapability = modelProvider.ActorTokenRuntimeFactoryCapability;
|
|
9770
10153
|
exports.ArtifactsRuntimeCapability = modelProvider.ArtifactsRuntimeCapability;
|
|
@@ -9788,6 +10171,7 @@ exports.SANDBOX_JOB_ERROR_CODES = modelProvider.SANDBOX_JOB_ERROR_CODES;
|
|
|
9788
10171
|
exports.SANDBOX_JOB_PROGRESS_PREFIX = modelProvider.SANDBOX_JOB_PROGRESS_PREFIX;
|
|
9789
10172
|
exports.SandboxJobRuntimeError = modelProvider.SandboxJobRuntimeError;
|
|
9790
10173
|
exports.SandboxJobsRuntimeCapability = modelProvider.SandboxJobsRuntimeCapability;
|
|
10174
|
+
exports.ToolImagesRuntimeCapability = modelProvider.ToolImagesRuntimeCapability;
|
|
9791
10175
|
exports.WORKSPACE_FILES_SOURCE = modelProvider.WORKSPACE_FILES_SOURCE;
|
|
9792
10176
|
exports.WorkspaceFilesRuntimeCapability = modelProvider.WorkspaceFilesRuntimeCapability;
|
|
9793
10177
|
exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = modelProvider.XPERT_RUNTIME_CAPABILITIES_TOKEN;
|
|
@@ -9800,6 +10184,9 @@ exports.requireReadStatement = dataWorkbench.requireReadStatement;
|
|
|
9800
10184
|
exports.splitWorkbenchSql = dataWorkbench.splitWorkbenchSql;
|
|
9801
10185
|
exports.ModelProviderHttpClient = modelProviderHttpClient.ModelProviderHttpClient;
|
|
9802
10186
|
exports.ModelProviderHttpError = modelProviderHttpClient.ModelProviderHttpError;
|
|
10187
|
+
exports.AGENT_TASK_RESULTS_FEATURE = results.AGENT_TASK_RESULTS_FEATURE;
|
|
10188
|
+
exports.agentResultItemSchema = results.agentResultItemSchema;
|
|
10189
|
+
exports.agentTaskResultSchema = results.agentTaskResultSchema;
|
|
9803
10190
|
exports.CONNECTOR_AUTHORIZATION_MODES = connector.CONNECTOR_AUTHORIZATION_MODES;
|
|
9804
10191
|
exports.CONNECTOR_SCOPE_TYPES = connector.CONNECTOR_SCOPE_TYPES;
|
|
9805
10192
|
exports.assertConnectorDefinition = connector.assertConnectorDefinition;
|
|
@@ -9815,12 +10202,21 @@ exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SE
|
|
|
9815
10202
|
exports.AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING;
|
|
9816
10203
|
exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
|
|
9817
10204
|
exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
|
|
10205
|
+
exports.AGENT_RUNTIME_EVENT_MESSAGE_TYPE = AGENT_RUNTIME_EVENT_MESSAGE_TYPE;
|
|
10206
|
+
exports.AGENT_RUNTIME_STRATEGY = AGENT_RUNTIME_STRATEGY;
|
|
9818
10207
|
exports.AIModelProviderNotFoundException = AIModelProviderNotFoundException;
|
|
9819
10208
|
exports.AIModelProviderStrategy = AIModelProviderStrategy;
|
|
9820
10209
|
exports.AI_MODEL_PROVIDER = AI_MODEL_PROVIDER;
|
|
10210
|
+
exports.ASSISTANT_CAPABILITY_PROVIDER = ASSISTANT_CAPABILITY_PROVIDER;
|
|
9821
10211
|
exports.AdapterDataSourceStrategy = AdapterDataSourceStrategy;
|
|
10212
|
+
exports.AgentExecutionRunnerCapability = AgentExecutionRunnerCapability;
|
|
10213
|
+
exports.AgentExecutionRunnerFactoryCapability = AgentExecutionRunnerFactoryCapability;
|
|
10214
|
+
exports.AgentInvocationRuntimeCapability = AgentInvocationRuntimeCapability;
|
|
9822
10215
|
exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
|
|
10216
|
+
exports.AgentRuntimeFactoryCapability = AgentRuntimeFactoryCapability;
|
|
10217
|
+
exports.AgentRuntimeStrategy = AgentRuntimeStrategy;
|
|
9823
10218
|
exports.AiModelNotFoundException = AiModelNotFoundException;
|
|
10219
|
+
exports.AssistantCapabilityProvider = AssistantCapabilityProvider;
|
|
9824
10220
|
exports.AssistantTaskRuntimeCapability = AssistantTaskRuntimeCapability;
|
|
9825
10221
|
exports.BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN;
|
|
9826
10222
|
exports.BUILTIN_GLOBAL_SCOPE = BUILTIN_GLOBAL_SCOPE;
|
|
@@ -9831,12 +10227,14 @@ exports.BaseSandbox = BaseSandbox;
|
|
|
9831
10227
|
exports.BaseStrategyRegistry = BaseStrategyRegistry;
|
|
9832
10228
|
exports.CHAT_CHANNEL = CHAT_CHANNEL;
|
|
9833
10229
|
exports.CHAT_CHANNEL_TEXT_LIMITS = CHAT_CHANNEL_TEXT_LIMITS;
|
|
10230
|
+
exports.CLI_MODEL_TOKEN_REFERENCE = CLI_MODEL_TOKEN_REFERENCE;
|
|
9834
10231
|
exports.COLLABORATION_DOCUMENT_PROVIDER = COLLABORATION_DOCUMENT_PROVIDER;
|
|
9835
10232
|
exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
|
|
9836
10233
|
exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
|
|
9837
10234
|
exports.CancelConversationCommand = CancelConversationCommand;
|
|
9838
10235
|
exports.ChatChannel = ChatChannel;
|
|
9839
10236
|
exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
|
|
10237
|
+
exports.CliModelProfilesCapability = CliModelProfilesCapability;
|
|
9840
10238
|
exports.CollaborationDocumentProvider = CollaborationDocumentProvider;
|
|
9841
10239
|
exports.CollaborationRuntimeCapability = CollaborationRuntimeCapability;
|
|
9842
10240
|
exports.CommonParameterRules = CommonParameterRules;
|
|
@@ -9866,6 +10264,7 @@ exports.DocumentSourceStrategy = DocumentSourceStrategy;
|
|
|
9866
10264
|
exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
|
|
9867
10265
|
exports.EVOLUTION_RUNTIME_SERVICE_TOKEN = EVOLUTION_RUNTIME_SERVICE_TOKEN;
|
|
9868
10266
|
exports.EVOLUTION_TARGET_PROVIDER = EVOLUTION_TARGET_PROVIDER;
|
|
10267
|
+
exports.EvolutionBaselineRuntimeCapability = EvolutionBaselineRuntimeCapability;
|
|
9869
10268
|
exports.EvolutionChangeRuntimeCapability = EvolutionChangeRuntimeCapability;
|
|
9870
10269
|
exports.EvolutionRuntimeCapability = EvolutionRuntimeCapability;
|
|
9871
10270
|
exports.EvolutionTargetProviderStrategy = EvolutionTargetProviderStrategy;
|
|
@@ -9898,6 +10297,7 @@ exports.MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN = MANAGED_QUEUE_HANDLER_REGISTRY_TO
|
|
|
9898
10297
|
exports.MANAGED_QUEUE_SERVICE_TOKEN = MANAGED_QUEUE_SERVICE_TOKEN;
|
|
9899
10298
|
exports.MCP_CAPABILITY_CHANGE_EVENT_TYPES = MCP_CAPABILITY_CHANGE_EVENT_TYPES;
|
|
9900
10299
|
exports.MODEL_OUTPUT_VALIDATION_ERROR_CODE = MODEL_OUTPUT_VALIDATION_ERROR_CODE;
|
|
10300
|
+
exports.ModelExecutionEnvironmentCapability = ModelExecutionEnvironmentCapability;
|
|
9901
10301
|
exports.ModelOutputValidationError = ModelOutputValidationError;
|
|
9902
10302
|
exports.ORGANIZATION_METADATA_KEY = ORGANIZATION_METADATA_KEY;
|
|
9903
10303
|
exports.OpenAICompatibleReranker = OpenAICompatibleReranker;
|
|
@@ -9909,6 +10309,8 @@ exports.PLUGIN_METADATA_KEY = PLUGIN_METADATA_KEY;
|
|
|
9909
10309
|
exports.PLUGIN_VERSION_METADATA_KEY = PLUGIN_VERSION_METADATA_KEY;
|
|
9910
10310
|
exports.PLUGIN_WEBHOOK_AUTH_METADATA_KEY = PLUGIN_WEBHOOK_AUTH_METADATA_KEY;
|
|
9911
10311
|
exports.PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN;
|
|
10312
|
+
exports.PROJECT_TASK_PROVIDER = PROJECT_TASK_PROVIDER;
|
|
10313
|
+
exports.PROJECT_TYPE_PROVIDER = PROJECT_TYPE_PROVIDER;
|
|
9912
10314
|
exports.PROVIDE_AI_MODEL_LLM = PROVIDE_AI_MODEL_LLM;
|
|
9913
10315
|
exports.PROVIDE_AI_MODEL_MODERATION = PROVIDE_AI_MODEL_MODERATION;
|
|
9914
10316
|
exports.PROVIDE_AI_MODEL_RERANK = PROVIDE_AI_MODEL_RERANK;
|
|
@@ -9917,10 +10319,16 @@ exports.PROVIDE_AI_MODEL_TEXT_EMBEDDING = PROVIDE_AI_MODEL_TEXT_EMBEDDING;
|
|
|
9917
10319
|
exports.PROVIDE_AI_MODEL_TTS = PROVIDE_AI_MODEL_TTS;
|
|
9918
10320
|
exports.PluginJobProcessor = PluginJobProcessor;
|
|
9919
10321
|
exports.PluginWebhookAuth = PluginWebhookAuth;
|
|
10322
|
+
exports.ProjectTaskProvider = ProjectTaskProvider;
|
|
10323
|
+
exports.ProjectTasksRuntimeCapability = ProjectTasksRuntimeCapability;
|
|
10324
|
+
exports.ProjectTypeProvider = ProjectTypeProvider;
|
|
10325
|
+
exports.RESOURCE_CARD_EVENT = RESOURCE_CARD_EVENT;
|
|
10326
|
+
exports.RESOURCE_CARD_PROVIDER = RESOURCE_CARD_PROVIDER;
|
|
9920
10327
|
exports.RETRIEVER_STRATEGY = RETRIEVER_STRATEGY;
|
|
9921
10328
|
exports.RequestContext = RequestContext;
|
|
9922
10329
|
exports.RequirePermissionOperation = RequirePermissionOperation;
|
|
9923
10330
|
exports.RerankModel = RerankModel;
|
|
10331
|
+
exports.ResourceCardProvider = ResourceCardProvider;
|
|
9924
10332
|
exports.RetrieverStrategy = RetrieverStrategy;
|
|
9925
10333
|
exports.SANDBOX_PROVIDER = SANDBOX_PROVIDER;
|
|
9926
10334
|
exports.SANDBOX_RUNTIME_PROVIDER = SANDBOX_RUNTIME_PROVIDER;
|
|
@@ -9937,6 +10345,7 @@ exports.SYSTEM_GLOBAL_SCOPE = SYSTEM_GLOBAL_SCOPE;
|
|
|
9937
10345
|
exports.SandboxProviderStrategy = SandboxProviderStrategy;
|
|
9938
10346
|
exports.SandboxRuntimeProviderStrategy = SandboxRuntimeProviderStrategy;
|
|
9939
10347
|
exports.SandboxWorkspaceMapperStrategy = SandboxWorkspaceMapperStrategy;
|
|
10348
|
+
exports.ShellModelExecutionSourceCapability = ShellModelExecutionSourceCapability;
|
|
9940
10349
|
exports.SkillSourceProviderStrategy = SkillSourceProviderStrategy;
|
|
9941
10350
|
exports.Speech2TextChatModel = Speech2TextChatModel;
|
|
9942
10351
|
exports.SpeechToTextModel = SpeechToTextModel;
|
|
@@ -9975,6 +10384,14 @@ exports.XpertResourceTemplate = XpertResourceTemplate;
|
|
|
9975
10384
|
exports.XpertServerPlugin = XpertServerPlugin;
|
|
9976
10385
|
exports.XpertTool = XpertTool;
|
|
9977
10386
|
exports.XpertToolProvider = XpertToolProvider;
|
|
10387
|
+
exports.agentInvocationDispatchContextSchema = agentInvocationDispatchContextSchema;
|
|
10388
|
+
exports.agentRuntimeConsumptionStateSchema = agentRuntimeConsumptionStateSchema;
|
|
10389
|
+
exports.agentRuntimeDeliveryStateSchema = agentRuntimeDeliveryStateSchema;
|
|
10390
|
+
exports.agentRuntimeEventMessageId = agentRuntimeEventMessageId;
|
|
10391
|
+
exports.agentRuntimeEventSchema = agentRuntimeEventSchema;
|
|
10392
|
+
exports.agentRuntimeReplyTargetSchema = agentRuntimeReplyTargetSchema;
|
|
10393
|
+
exports.agentRuntimeResultClaimSchema = agentRuntimeResultClaimSchema;
|
|
10394
|
+
exports.agentRuntimeResultConsumptionKey = agentRuntimeResultConsumptionKey;
|
|
9978
10395
|
exports.als = als;
|
|
9979
10396
|
exports.appendSandboxMessage = appendSandboxMessage;
|
|
9980
10397
|
exports.buildSandboxTimeoutMessage = buildSandboxTimeoutMessage;
|
|
@@ -9998,6 +10415,7 @@ exports.defineXpertTool = defineXpertTool;
|
|
|
9998
10415
|
exports.derivePluginArtifactNamespace = derivePluginArtifactNamespace;
|
|
9999
10416
|
exports.describeXpertToolProvider = describeXpertToolProvider;
|
|
10000
10417
|
exports.downloadRemoteFile = downloadRemoteFile;
|
|
10418
|
+
exports.emitResourceCard = emitResourceCard;
|
|
10001
10419
|
exports.formatSandboxTimeout = formatSandboxTimeout;
|
|
10002
10420
|
exports.getDefaultTenantId = getDefaultTenantId;
|
|
10003
10421
|
exports.getErrorMessage = getErrorMessage;
|
|
@@ -10009,6 +10427,7 @@ exports.getRequestContext = getRequestContext;
|
|
|
10009
10427
|
exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
|
|
10010
10428
|
exports.getTenantGlobalScopeKey = getTenantGlobalScopeKey;
|
|
10011
10429
|
exports.getXpertToolMethod = getXpertToolMethod;
|
|
10430
|
+
exports.isAgentInvocationTerminal = isAgentInvocationTerminal;
|
|
10012
10431
|
exports.isDevelopmentSandboxRuntimeEnvironment = isDevelopmentSandboxRuntimeEnvironment;
|
|
10013
10432
|
exports.isModelOutputValidationError = isModelOutputValidationError;
|
|
10014
10433
|
exports.isModelUsagePricingConfig = isModelUsagePricingConfig;
|
|
@@ -10022,8 +10441,11 @@ exports.isStructuredMessageType = isStructuredMessageType;
|
|
|
10022
10441
|
exports.isTenantGlobalScopeKey = isTenantGlobalScopeKey;
|
|
10023
10442
|
exports.loadYamlFile = loadYamlFile;
|
|
10024
10443
|
exports.mergeCredentials = mergeCredentials;
|
|
10444
|
+
exports.mergeModelRequirements = mergeModelRequirements;
|
|
10025
10445
|
exports.mergeParentChildChunks = mergeParentChildChunks;
|
|
10446
|
+
exports.nativeModelTransport = nativeModelTransport;
|
|
10026
10447
|
exports.normalizeContextSize = normalizeContextSize;
|
|
10448
|
+
exports.normalizeTokenUsage = normalizeTokenUsage;
|
|
10027
10449
|
exports.pluginArtifactTableName = pluginArtifactTableName;
|
|
10028
10450
|
exports.prepareToolResult = prepareToolResult;
|
|
10029
10451
|
exports.processAsyncAIGCManagedJob = processAsyncAIGCManagedJob;
|
|
@@ -10039,10 +10461,12 @@ exports.resolveSandboxTerminalAdapter = resolveSandboxTerminalAdapter;
|
|
|
10039
10461
|
exports.resolveStrategyMetadataTarget = resolveStrategyMetadataTarget;
|
|
10040
10462
|
exports.resolveTenantGlobalScopeKey = resolveTenantGlobalScopeKey;
|
|
10041
10463
|
exports.resolveTokenUsage = resolveTokenUsage;
|
|
10464
|
+
exports.resolveTokenUsageCandidates = resolveTokenUsageCandidates;
|
|
10042
10465
|
exports.resolveXpertMcpExtensions = resolveXpertMcpExtensions;
|
|
10043
10466
|
exports.runWithRequestContext = runWithRequestContext;
|
|
10044
10467
|
exports.runtimeToolProviderComponent = runtimeToolProviderComponent;
|
|
10045
10468
|
exports.secondsToMilliseconds = secondsToMilliseconds;
|
|
10046
10469
|
exports.setDefaultTenantId = setDefaultTenantId;
|
|
10047
10470
|
exports.sumTokenUsage = sumTokenUsage;
|
|
10471
|
+
exports.taskWaitReason = taskWaitReason;
|
|
10048
10472
|
exports.textTokenBoundaries = textTokenBoundaries;
|