@xpert-ai/plugin-sdk 3.19.0 → 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 +104 -0
- package/README.md +55 -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 +455 -107
- package/index.esm.js +412 -112
- 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/src/agent-results.d.ts +2 -0
- package/src/index.d.ts +2 -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 +1 -0
- 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 +7 -0
- 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 +13 -5
- 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 +7 -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 +3 -0
- package/src/lib/agent/runtime/task-wait.d.ts +35 -0
- package/src/lib/agent/runtime/types.d.ts +35 -11
- 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/mcp/app.d.ts +4 -1
- package/src/lib/project-task/index.d.ts +8 -1
- package/src/lib/project-type/index.d.ts +8 -1
- 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/project-provisioning.d.ts +10 -0
- package/src/lib/runtime/capabilities/tool-images.d.ts +24 -0
- package/src/lib/sandbox/execution-environment.d.ts +2 -0
- package/src/lib/sandbox/execution.d.ts +10 -0
- package/src/lib/sandbox/managed-service.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
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
13
|
var node_crypto = require('node:crypto');
|
|
@@ -34,10 +35,11 @@ var env = require('@langchain/core/utils/env');
|
|
|
34
35
|
var modelProviderHttpClient = require('./model-provider-http-client.cjs.js');
|
|
35
36
|
var jsTiktoken = require('js-tiktoken');
|
|
36
37
|
var base$1 = require('@langchain/core/language_models/base');
|
|
38
|
+
var v3 = require('zod/v3');
|
|
39
|
+
var results = require('./results.cjs.js');
|
|
37
40
|
var connector = require('./connector.cjs.js');
|
|
38
41
|
var collaborationClient = require('./collaboration-client.cjs.js');
|
|
39
42
|
var tools = require('@langchain/core/tools');
|
|
40
|
-
var v3 = require('zod/v3');
|
|
41
43
|
|
|
42
44
|
function _interopNamespaceDefault(e) {
|
|
43
45
|
var n = Object.create(null);
|
|
@@ -123,6 +125,10 @@ function assertPluginArtifactNamePart(value, label) {
|
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
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
|
+
|
|
126
132
|
const ORGANIZATION_METADATA_KEY = 'xpert:organizationId';
|
|
127
133
|
const PLUGIN_METADATA_KEY = 'xpert:pluginName';
|
|
128
134
|
const PLUGIN_VERSION_METADATA_KEY = 'xpert:pluginVersion';
|
|
@@ -159,27 +165,13 @@ function resolveTenantGlobalScopeKey(tenantId) {
|
|
|
159
165
|
return GLOBAL_ORGANIZATION_SCOPE;
|
|
160
166
|
}
|
|
161
167
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
return {
|
|
171
|
-
child (meta) {
|
|
172
|
-
return createPluginLogger(scope, _extends._extends({}, baseMeta, meta));
|
|
173
|
-
},
|
|
174
|
-
debug: (msg, meta)=>wrap('debug', msg, meta),
|
|
175
|
-
log: (msg, meta)=>wrap('log', msg, meta),
|
|
176
|
-
warn: (msg, meta)=>wrap('warn', msg, meta),
|
|
177
|
-
error: (msg, meta)=>wrap('error', msg, meta)
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const INTEGRATION_STRATEGY = 'INTEGRATION_STRATEGY';
|
|
182
|
-
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
|
+
};
|
|
183
175
|
|
|
184
176
|
function __decorate(decorators, target, key, desc) {
|
|
185
177
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -764,6 +756,102 @@ __decorate([
|
|
|
764
756
|
return typeof constructor === 'function' ? constructor : null;
|
|
765
757
|
}
|
|
766
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
|
+
|
|
767
855
|
exports.IntegrationStrategyRegistry = class IntegrationStrategyRegistry extends BaseStrategyRegistry {
|
|
768
856
|
constructor(discoveryService, reflector){
|
|
769
857
|
super(INTEGRATION_STRATEGY, discoveryService, reflector);
|
|
@@ -2616,6 +2704,9 @@ function normalizeCurrency(currency) {
|
|
|
2616
2704
|
|
|
2617
2705
|
var AIModel_1;
|
|
2618
2706
|
exports.AIModel = AIModel_1 = class AIModel {
|
|
2707
|
+
getRealtimeModel(_copilotModel) {
|
|
2708
|
+
throw new Error('Unsupported realtime model');
|
|
2709
|
+
}
|
|
2619
2710
|
getChatModel(copilotModel, options) {
|
|
2620
2711
|
throw new Error(`Unsupport chat model!`);
|
|
2621
2712
|
}
|
|
@@ -2859,6 +2950,75 @@ function _class_private_field_loose_key(name) {
|
|
|
2859
2950
|
return "__private_" + id++ + "_" + name;
|
|
2860
2951
|
}
|
|
2861
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
|
+
|
|
2862
3022
|
var _a;
|
|
2863
3023
|
class LLMUsage {
|
|
2864
3024
|
static emptyUsage() {
|
|
@@ -2904,6 +3064,18 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
2904
3064
|
_commonParameterRules(model) {
|
|
2905
3065
|
return CommonParameterRules;
|
|
2906
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
|
+
}
|
|
2907
3079
|
calcResponseUsage(model, credentials, promptTokens, completionTokens, startedAt = this.startedAt, tokenUsage, pricingContext = {}) {
|
|
2908
3080
|
var _this_getModelSchema;
|
|
2909
3081
|
const resolvedTokenUsage = tokenUsage != null ? tokenUsage : {
|
|
@@ -3051,12 +3223,15 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3051
3223
|
callback
|
|
3052
3224
|
];
|
|
3053
3225
|
}
|
|
3054
|
-
createHandleLLMErrorCallbacks(
|
|
3226
|
+
createHandleLLMErrorCallbacks(_fields, logger) {
|
|
3055
3227
|
return {
|
|
3056
|
-
handleLLMError: (
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
(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
|
+
});
|
|
3060
3235
|
}
|
|
3061
3236
|
};
|
|
3062
3237
|
}
|
|
@@ -3266,97 +3441,59 @@ function isAbortError(error) {
|
|
|
3266
3441
|
return error.name === 'AbortError' || /\babort(?:ed)?\b/i.test(error.message);
|
|
3267
3442
|
}
|
|
3268
3443
|
function calcTokenUsage(output) {
|
|
3269
|
-
|
|
3270
|
-
const tokenUsage = {
|
|
3444
|
+
const result = {
|
|
3271
3445
|
promptTokens: 0,
|
|
3272
3446
|
completionTokens: 0,
|
|
3273
3447
|
totalTokens: 0
|
|
3274
3448
|
};
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
if (message.
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
cacheReadInputTokens
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
}
|
|
3290
|
-
});
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
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;
|
|
3295
3479
|
}
|
|
3296
3480
|
function resolveTokenUsage(output) {
|
|
3297
3481
|
return resolveTokenUsageWithAuthority(output).usage;
|
|
3298
3482
|
}
|
|
3299
3483
|
function resolveTokenUsageWithAuthority(output) {
|
|
3300
3484
|
var _output_llmOutput, _output_llmOutput1, _output_llmOutput2;
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
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']
|
|
3304
3490
|
});
|
|
3305
|
-
if (actualUsage) {
|
|
3306
|
-
return {
|
|
3307
|
-
usage: actualUsage
|
|
3308
|
-
};
|
|
3309
|
-
}
|
|
3310
|
-
const estimatedUsage = normalizeTokenUsage((_output_llmOutput2 = output.llmOutput) == null ? void 0 : _output_llmOutput2['estimatedTokenUsage']);
|
|
3311
|
-
if (estimatedUsage) {
|
|
3312
|
-
return {
|
|
3313
|
-
usage: estimatedUsage,
|
|
3314
|
-
type: 'estimated'
|
|
3315
|
-
};
|
|
3316
|
-
}
|
|
3317
|
-
return {
|
|
3318
|
-
usage: {
|
|
3319
|
-
promptTokens: 0,
|
|
3320
|
-
completionTokens: 0,
|
|
3321
|
-
totalTokens: 0
|
|
3322
|
-
}
|
|
3323
|
-
};
|
|
3324
|
-
}
|
|
3325
|
-
function normalizeTokenUsage(candidate) {
|
|
3326
|
-
if (!candidate) {
|
|
3327
|
-
return null;
|
|
3328
|
-
}
|
|
3329
|
-
if (!isValidTokenCount(candidate.promptTokens) || !isValidTokenCount(candidate.completionTokens) || !isValidTokenCount(candidate.totalTokens)) {
|
|
3330
|
-
return null;
|
|
3331
|
-
}
|
|
3332
|
-
var _candidate_promptTokens;
|
|
3333
|
-
const promptTokens = (_candidate_promptTokens = candidate.promptTokens) != null ? _candidate_promptTokens : 0;
|
|
3334
|
-
var _candidate_completionTokens;
|
|
3335
|
-
const completionTokens = (_candidate_completionTokens = candidate.completionTokens) != null ? _candidate_completionTokens : 0;
|
|
3336
|
-
const totalTokens = candidate.totalTokens || promptTokens + completionTokens;
|
|
3337
|
-
if (promptTokens === 0 && completionTokens === 0 && totalTokens === 0) {
|
|
3338
|
-
return null;
|
|
3339
|
-
}
|
|
3340
|
-
var _candidate_cacheReadInputTokens;
|
|
3341
|
-
const cacheReadInputTokens = (_candidate_cacheReadInputTokens = candidate.cacheReadInputTokens) != null ? _candidate_cacheReadInputTokens : 0;
|
|
3342
|
-
var _candidate_cacheWriteInputTokens;
|
|
3343
|
-
const cacheWriteInputTokens = (_candidate_cacheWriteInputTokens = candidate.cacheWriteInputTokens) != null ? _candidate_cacheWriteInputTokens : 0;
|
|
3344
|
-
if (!isValidTokenCount(cacheReadInputTokens) || !isValidTokenCount(cacheWriteInputTokens)) {
|
|
3345
|
-
return null;
|
|
3346
|
-
}
|
|
3347
3491
|
return _extends._extends({
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
}, cacheReadInputTokens > 0 ? {
|
|
3352
|
-
cacheReadInputTokens
|
|
3353
|
-
} : {}, cacheWriteInputTokens > 0 ? {
|
|
3354
|
-
cacheWriteInputTokens
|
|
3492
|
+
usage: resolved.usage
|
|
3493
|
+
}, resolved.source === 'estimated' ? {
|
|
3494
|
+
type: 'estimated'
|
|
3355
3495
|
} : {});
|
|
3356
3496
|
}
|
|
3357
|
-
function isValidTokenCount(value) {
|
|
3358
|
-
return value === undefined || Number.isFinite(value) && value >= 0;
|
|
3359
|
-
}
|
|
3360
3497
|
function normalizeCacheTokenAccounting(tokenUsage, context) {
|
|
3361
3498
|
if (context.inputTokensIncludeCache !== false) return tokenUsage;
|
|
3362
3499
|
var _tokenUsage_cacheReadInputTokens, _tokenUsage_cacheWriteInputTokens;
|
|
@@ -3807,6 +3944,37 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
|
|
|
3807
3944
|
id: CreateModelClientCommand.type
|
|
3808
3945
|
}, CreateModelClientCommand);
|
|
3809
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
|
+
|
|
3810
3978
|
const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
|
|
3811
3979
|
const SkillSourceProviderStrategy = (provider)=>common.applyDecorators(common.SetMetadata(SKILL_SOURCE_PROVIDER, provider), common.SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
|
|
3812
3980
|
|
|
@@ -3881,6 +4049,18 @@ function isModelOutputValidationError(error) {
|
|
|
3881
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);
|
|
3882
4050
|
}
|
|
3883
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
|
+
|
|
3884
4064
|
const SEGMENT_PATTERN = /^[a-z][a-z0-9_-]*$/i;
|
|
3885
4065
|
const VERSION_PATTERN = /^v[1-9][0-9]*$/;
|
|
3886
4066
|
function assertSegment(input, name) {
|
|
@@ -3926,6 +4106,96 @@ function assertSegment(input, name) {
|
|
|
3926
4106
|
const AGENT_CHAT_DISPATCH_MESSAGE_TYPE = defineAgentMessageType('chat_dispatch', 1);
|
|
3927
4107
|
const AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = 'steer_target_not_running';
|
|
3928
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
|
+
|
|
3929
4199
|
/**
|
|
3930
4200
|
* Handoff Processor meta key。
|
|
3931
4201
|
*/ const HANDOFF_PROCESSOR_STRATEGY = 'HANDOFF_PROCESSOR_STRATEGY';
|
|
@@ -4001,6 +4271,30 @@ exports.AgentRuntimeRegistry = __decorate([
|
|
|
4001
4271
|
});
|
|
4002
4272
|
/** Platform factory capability. The wire key is stable across SDK naming changes. */ const AgentRuntimeFactoryCapability = modelProvider.createRuntimeCapability('platform.agent_invocation.factory');
|
|
4003
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
|
+
|
|
4004
4298
|
const ASSISTANT_CAPABILITY_PROVIDER = 'ASSISTANT_CAPABILITY_PROVIDER';
|
|
4005
4299
|
const AssistantCapabilityProvider = (key)=>common.applyDecorators(common.SetMetadata(ASSISTANT_CAPABILITY_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, ASSISTANT_CAPABILITY_PROVIDER));
|
|
4006
4300
|
exports.AssistantCapabilityProviderRegistry = class AssistantCapabilityProviderRegistry extends BaseStrategyRegistry {
|
|
@@ -4313,7 +4607,9 @@ function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHEL
|
|
|
4313
4607
|
return _extends._extends({
|
|
4314
4608
|
timeoutMs,
|
|
4315
4609
|
maxOutputBytes
|
|
4316
|
-
}, (options == null ? void 0 : options.
|
|
4610
|
+
}, (options == null ? void 0 : options.executionScope) ? {
|
|
4611
|
+
executionScope: options.executionScope
|
|
4612
|
+
} : {}, (options == null ? void 0 : options.signal) ? {
|
|
4317
4613
|
signal: options.signal
|
|
4318
4614
|
} : {});
|
|
4319
4615
|
}
|
|
@@ -5454,6 +5750,7 @@ exports.ViewExtensionProviderRegistry = __decorate([
|
|
|
5454
5750
|
|
|
5455
5751
|
const XPERT_REMOTE_UI_CSS = `
|
|
5456
5752
|
:root {
|
|
5753
|
+
font-size: var(--xui-density-root-font-size, 16px);
|
|
5457
5754
|
color-scheme: light;
|
|
5458
5755
|
--xui-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
5459
5756
|
--xui-color-background: #fff;
|
|
@@ -5488,6 +5785,7 @@ const XPERT_REMOTE_UI_CSS = `
|
|
|
5488
5785
|
--xui-radius-sm: 6px;
|
|
5489
5786
|
--xui-radius-md: 8px;
|
|
5490
5787
|
--xui-radius-lg: 10px;
|
|
5788
|
+
--xui-font-size: 14px;
|
|
5491
5789
|
--xui-font-size-xs: 0.75rem;
|
|
5492
5790
|
--xui-font-size-sm: 0.8125rem;
|
|
5493
5791
|
--xui-font-size-md: 0.875rem;
|
|
@@ -5775,6 +6073,7 @@ const XPERT_REMOTE_UI_BOOTSTRAP = `
|
|
|
5775
6073
|
var VERSION = 1
|
|
5776
6074
|
var TOKEN_MAP = {
|
|
5777
6075
|
fontFamily: '--xui-font-family',
|
|
6076
|
+
densityRootFontSize: '--xui-density-root-font-size',
|
|
5778
6077
|
colorBackground: '--xui-color-background',
|
|
5779
6078
|
colorForeground: '--xui-color-foreground',
|
|
5780
6079
|
colorCard: '--xui-color-card',
|
|
@@ -5807,6 +6106,7 @@ const XPERT_REMOTE_UI_BOOTSTRAP = `
|
|
|
5807
6106
|
radiusSm: '--xui-radius-sm',
|
|
5808
6107
|
radiusMd: '--xui-radius-md',
|
|
5809
6108
|
radiusLg: '--xui-radius-lg',
|
|
6109
|
+
fontSize: '--xui-font-size',
|
|
5810
6110
|
fontSizeXs: '--xui-font-size-xs',
|
|
5811
6111
|
fontSizeSm: '--xui-font-size-sm',
|
|
5812
6112
|
fontSizeMd: '--xui-font-size-md',
|
|
@@ -9828,6 +10128,26 @@ Object.defineProperty(exports, "ASSISTANT_CONTEXT_SET_COMMAND", {
|
|
|
9828
10128
|
enumerable: true,
|
|
9829
10129
|
get: function () { return contracts.ASSISTANT_CONTEXT_SET_COMMAND; }
|
|
9830
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
|
+
});
|
|
9831
10151
|
exports.ActorTokenRuntimeCapability = modelProvider.ActorTokenRuntimeCapability;
|
|
9832
10152
|
exports.ActorTokenRuntimeFactoryCapability = modelProvider.ActorTokenRuntimeFactoryCapability;
|
|
9833
10153
|
exports.ArtifactsRuntimeCapability = modelProvider.ArtifactsRuntimeCapability;
|
|
@@ -9851,6 +10171,7 @@ exports.SANDBOX_JOB_ERROR_CODES = modelProvider.SANDBOX_JOB_ERROR_CODES;
|
|
|
9851
10171
|
exports.SANDBOX_JOB_PROGRESS_PREFIX = modelProvider.SANDBOX_JOB_PROGRESS_PREFIX;
|
|
9852
10172
|
exports.SandboxJobRuntimeError = modelProvider.SandboxJobRuntimeError;
|
|
9853
10173
|
exports.SandboxJobsRuntimeCapability = modelProvider.SandboxJobsRuntimeCapability;
|
|
10174
|
+
exports.ToolImagesRuntimeCapability = modelProvider.ToolImagesRuntimeCapability;
|
|
9854
10175
|
exports.WORKSPACE_FILES_SOURCE = modelProvider.WORKSPACE_FILES_SOURCE;
|
|
9855
10176
|
exports.WorkspaceFilesRuntimeCapability = modelProvider.WorkspaceFilesRuntimeCapability;
|
|
9856
10177
|
exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = modelProvider.XPERT_RUNTIME_CAPABILITIES_TOKEN;
|
|
@@ -9863,6 +10184,9 @@ exports.requireReadStatement = dataWorkbench.requireReadStatement;
|
|
|
9863
10184
|
exports.splitWorkbenchSql = dataWorkbench.splitWorkbenchSql;
|
|
9864
10185
|
exports.ModelProviderHttpClient = modelProviderHttpClient.ModelProviderHttpClient;
|
|
9865
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;
|
|
9866
10190
|
exports.CONNECTOR_AUTHORIZATION_MODES = connector.CONNECTOR_AUTHORIZATION_MODES;
|
|
9867
10191
|
exports.CONNECTOR_SCOPE_TYPES = connector.CONNECTOR_SCOPE_TYPES;
|
|
9868
10192
|
exports.assertConnectorDefinition = connector.assertConnectorDefinition;
|
|
@@ -9878,12 +10202,15 @@ exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SE
|
|
|
9878
10202
|
exports.AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING;
|
|
9879
10203
|
exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
|
|
9880
10204
|
exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
|
|
10205
|
+
exports.AGENT_RUNTIME_EVENT_MESSAGE_TYPE = AGENT_RUNTIME_EVENT_MESSAGE_TYPE;
|
|
9881
10206
|
exports.AGENT_RUNTIME_STRATEGY = AGENT_RUNTIME_STRATEGY;
|
|
9882
10207
|
exports.AIModelProviderNotFoundException = AIModelProviderNotFoundException;
|
|
9883
10208
|
exports.AIModelProviderStrategy = AIModelProviderStrategy;
|
|
9884
10209
|
exports.AI_MODEL_PROVIDER = AI_MODEL_PROVIDER;
|
|
9885
10210
|
exports.ASSISTANT_CAPABILITY_PROVIDER = ASSISTANT_CAPABILITY_PROVIDER;
|
|
9886
10211
|
exports.AdapterDataSourceStrategy = AdapterDataSourceStrategy;
|
|
10212
|
+
exports.AgentExecutionRunnerCapability = AgentExecutionRunnerCapability;
|
|
10213
|
+
exports.AgentExecutionRunnerFactoryCapability = AgentExecutionRunnerFactoryCapability;
|
|
9887
10214
|
exports.AgentInvocationRuntimeCapability = AgentInvocationRuntimeCapability;
|
|
9888
10215
|
exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
|
|
9889
10216
|
exports.AgentRuntimeFactoryCapability = AgentRuntimeFactoryCapability;
|
|
@@ -9900,12 +10227,14 @@ exports.BaseSandbox = BaseSandbox;
|
|
|
9900
10227
|
exports.BaseStrategyRegistry = BaseStrategyRegistry;
|
|
9901
10228
|
exports.CHAT_CHANNEL = CHAT_CHANNEL;
|
|
9902
10229
|
exports.CHAT_CHANNEL_TEXT_LIMITS = CHAT_CHANNEL_TEXT_LIMITS;
|
|
10230
|
+
exports.CLI_MODEL_TOKEN_REFERENCE = CLI_MODEL_TOKEN_REFERENCE;
|
|
9903
10231
|
exports.COLLABORATION_DOCUMENT_PROVIDER = COLLABORATION_DOCUMENT_PROVIDER;
|
|
9904
10232
|
exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
|
|
9905
10233
|
exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
|
|
9906
10234
|
exports.CancelConversationCommand = CancelConversationCommand;
|
|
9907
10235
|
exports.ChatChannel = ChatChannel;
|
|
9908
10236
|
exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
|
|
10237
|
+
exports.CliModelProfilesCapability = CliModelProfilesCapability;
|
|
9909
10238
|
exports.CollaborationDocumentProvider = CollaborationDocumentProvider;
|
|
9910
10239
|
exports.CollaborationRuntimeCapability = CollaborationRuntimeCapability;
|
|
9911
10240
|
exports.CommonParameterRules = CommonParameterRules;
|
|
@@ -9968,6 +10297,7 @@ exports.MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN = MANAGED_QUEUE_HANDLER_REGISTRY_TO
|
|
|
9968
10297
|
exports.MANAGED_QUEUE_SERVICE_TOKEN = MANAGED_QUEUE_SERVICE_TOKEN;
|
|
9969
10298
|
exports.MCP_CAPABILITY_CHANGE_EVENT_TYPES = MCP_CAPABILITY_CHANGE_EVENT_TYPES;
|
|
9970
10299
|
exports.MODEL_OUTPUT_VALIDATION_ERROR_CODE = MODEL_OUTPUT_VALIDATION_ERROR_CODE;
|
|
10300
|
+
exports.ModelExecutionEnvironmentCapability = ModelExecutionEnvironmentCapability;
|
|
9971
10301
|
exports.ModelOutputValidationError = ModelOutputValidationError;
|
|
9972
10302
|
exports.ORGANIZATION_METADATA_KEY = ORGANIZATION_METADATA_KEY;
|
|
9973
10303
|
exports.OpenAICompatibleReranker = OpenAICompatibleReranker;
|
|
@@ -9992,10 +10322,13 @@ exports.PluginWebhookAuth = PluginWebhookAuth;
|
|
|
9992
10322
|
exports.ProjectTaskProvider = ProjectTaskProvider;
|
|
9993
10323
|
exports.ProjectTasksRuntimeCapability = ProjectTasksRuntimeCapability;
|
|
9994
10324
|
exports.ProjectTypeProvider = ProjectTypeProvider;
|
|
10325
|
+
exports.RESOURCE_CARD_EVENT = RESOURCE_CARD_EVENT;
|
|
10326
|
+
exports.RESOURCE_CARD_PROVIDER = RESOURCE_CARD_PROVIDER;
|
|
9995
10327
|
exports.RETRIEVER_STRATEGY = RETRIEVER_STRATEGY;
|
|
9996
10328
|
exports.RequestContext = RequestContext;
|
|
9997
10329
|
exports.RequirePermissionOperation = RequirePermissionOperation;
|
|
9998
10330
|
exports.RerankModel = RerankModel;
|
|
10331
|
+
exports.ResourceCardProvider = ResourceCardProvider;
|
|
9999
10332
|
exports.RetrieverStrategy = RetrieverStrategy;
|
|
10000
10333
|
exports.SANDBOX_PROVIDER = SANDBOX_PROVIDER;
|
|
10001
10334
|
exports.SANDBOX_RUNTIME_PROVIDER = SANDBOX_RUNTIME_PROVIDER;
|
|
@@ -10012,6 +10345,7 @@ exports.SYSTEM_GLOBAL_SCOPE = SYSTEM_GLOBAL_SCOPE;
|
|
|
10012
10345
|
exports.SandboxProviderStrategy = SandboxProviderStrategy;
|
|
10013
10346
|
exports.SandboxRuntimeProviderStrategy = SandboxRuntimeProviderStrategy;
|
|
10014
10347
|
exports.SandboxWorkspaceMapperStrategy = SandboxWorkspaceMapperStrategy;
|
|
10348
|
+
exports.ShellModelExecutionSourceCapability = ShellModelExecutionSourceCapability;
|
|
10015
10349
|
exports.SkillSourceProviderStrategy = SkillSourceProviderStrategy;
|
|
10016
10350
|
exports.Speech2TextChatModel = Speech2TextChatModel;
|
|
10017
10351
|
exports.SpeechToTextModel = SpeechToTextModel;
|
|
@@ -10050,6 +10384,14 @@ exports.XpertResourceTemplate = XpertResourceTemplate;
|
|
|
10050
10384
|
exports.XpertServerPlugin = XpertServerPlugin;
|
|
10051
10385
|
exports.XpertTool = XpertTool;
|
|
10052
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;
|
|
10053
10395
|
exports.als = als;
|
|
10054
10396
|
exports.appendSandboxMessage = appendSandboxMessage;
|
|
10055
10397
|
exports.buildSandboxTimeoutMessage = buildSandboxTimeoutMessage;
|
|
@@ -10073,6 +10415,7 @@ exports.defineXpertTool = defineXpertTool;
|
|
|
10073
10415
|
exports.derivePluginArtifactNamespace = derivePluginArtifactNamespace;
|
|
10074
10416
|
exports.describeXpertToolProvider = describeXpertToolProvider;
|
|
10075
10417
|
exports.downloadRemoteFile = downloadRemoteFile;
|
|
10418
|
+
exports.emitResourceCard = emitResourceCard;
|
|
10076
10419
|
exports.formatSandboxTimeout = formatSandboxTimeout;
|
|
10077
10420
|
exports.getDefaultTenantId = getDefaultTenantId;
|
|
10078
10421
|
exports.getErrorMessage = getErrorMessage;
|
|
@@ -10098,8 +10441,11 @@ exports.isStructuredMessageType = isStructuredMessageType;
|
|
|
10098
10441
|
exports.isTenantGlobalScopeKey = isTenantGlobalScopeKey;
|
|
10099
10442
|
exports.loadYamlFile = loadYamlFile;
|
|
10100
10443
|
exports.mergeCredentials = mergeCredentials;
|
|
10444
|
+
exports.mergeModelRequirements = mergeModelRequirements;
|
|
10101
10445
|
exports.mergeParentChildChunks = mergeParentChildChunks;
|
|
10446
|
+
exports.nativeModelTransport = nativeModelTransport;
|
|
10102
10447
|
exports.normalizeContextSize = normalizeContextSize;
|
|
10448
|
+
exports.normalizeTokenUsage = normalizeTokenUsage;
|
|
10103
10449
|
exports.pluginArtifactTableName = pluginArtifactTableName;
|
|
10104
10450
|
exports.prepareToolResult = prepareToolResult;
|
|
10105
10451
|
exports.processAsyncAIGCManagedJob = processAsyncAIGCManagedJob;
|
|
@@ -10115,10 +10461,12 @@ exports.resolveSandboxTerminalAdapter = resolveSandboxTerminalAdapter;
|
|
|
10115
10461
|
exports.resolveStrategyMetadataTarget = resolveStrategyMetadataTarget;
|
|
10116
10462
|
exports.resolveTenantGlobalScopeKey = resolveTenantGlobalScopeKey;
|
|
10117
10463
|
exports.resolveTokenUsage = resolveTokenUsage;
|
|
10464
|
+
exports.resolveTokenUsageCandidates = resolveTokenUsageCandidates;
|
|
10118
10465
|
exports.resolveXpertMcpExtensions = resolveXpertMcpExtensions;
|
|
10119
10466
|
exports.runWithRequestContext = runWithRequestContext;
|
|
10120
10467
|
exports.runtimeToolProviderComponent = runtimeToolProviderComponent;
|
|
10121
10468
|
exports.secondsToMilliseconds = secondsToMilliseconds;
|
|
10122
10469
|
exports.setDefaultTenantId = setDefaultTenantId;
|
|
10123
10470
|
exports.sumTokenUsage = sumTokenUsage;
|
|
10471
|
+
exports.taskWaitReason = taskWaitReason;
|
|
10124
10472
|
exports.textTokenBoundaries = textTokenBoundaries;
|