@xpert-ai/plugin-sdk 3.15.9 → 3.15.11

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.
@@ -0,0 +1,398 @@
1
+ function _extends() {
2
+ _extends = Object.assign || function assign(target) {
3
+ for(var i = 1; i < arguments.length; i++){
4
+ var source = arguments[i];
5
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
6
+ }
7
+ return target;
8
+ };
9
+ return _extends.apply(this, arguments);
10
+ }
11
+
12
+ function createSocketIoTransportAdapter(socket) {
13
+ return {
14
+ get connected () {
15
+ return socket.connected;
16
+ },
17
+ get clientId () {
18
+ var _socket_id;
19
+ return (_socket_id = socket.id) != null ? _socket_id : null;
20
+ },
21
+ connect: ()=>{
22
+ socket.connect();
23
+ },
24
+ disconnect: ()=>{
25
+ socket.disconnect();
26
+ },
27
+ emit: (event, payload = {})=>{
28
+ socket.emit(event, payload);
29
+ },
30
+ on: (event, handler)=>{
31
+ socket.on(event, handler);
32
+ return ()=>{
33
+ socket.off(event, handler);
34
+ };
35
+ }
36
+ };
37
+ }
38
+ /** Wrap a caller-owned `Y.Doc` without passing it across the runtime capability boundary. */ function createYjsDocumentAdapter(document, yjs) {
39
+ return {
40
+ applyUpdate: (update, origin)=>yjs.applyUpdate(document, update, origin),
41
+ encodeStateVector: ()=>yjs.encodeStateVector(document),
42
+ mergeUpdates: (updates)=>yjs.mergeUpdates(updates),
43
+ onUpdate: (handler)=>{
44
+ document.on('update', handler);
45
+ return ()=>document.off('update', handler);
46
+ }
47
+ };
48
+ }
49
+ /**
50
+ * Keep per-client sessions for cursors while exposing one collaborator per stable actor identity.
51
+ * This prevents a second tab owned by the same user from either duplicating or hiding that user.
52
+ */ function createCollaborationPresenceStore(options = {}) {
53
+ let selfClientId = null;
54
+ let sessions = new Map();
55
+ const readSnapshot = ()=>{
56
+ const activeSessions = Array.from(sessions.values()).sort((left, right)=>right.updatedAt - left.updatedAt);
57
+ const remoteSessions = activeSessions.filter((item)=>item.clientId !== selfClientId);
58
+ const actors = new Map();
59
+ for (const item of activeSessions)if (!actors.has(item.presenceId)) actors.set(item.presenceId, item);
60
+ if (options.includeSelf !== false && options.selfActor) {
61
+ const existing = activeSessions.find((item)=>{
62
+ var _options_selfActor;
63
+ return item.clientId === selfClientId || item.presenceId === ((_options_selfActor = options.selfActor) == null ? void 0 : _options_selfActor.presenceId);
64
+ });
65
+ actors.set(options.selfActor.presenceId, existing != null ? existing : actorPresence(options.selfActor, selfClientId));
66
+ }
67
+ const collaborators = Array.from(actors.values()).sort((left, right)=>{
68
+ var _options_selfActor, _options_selfActor1;
69
+ const leftSelf = left.presenceId === ((_options_selfActor = options.selfActor) == null ? void 0 : _options_selfActor.presenceId) ? 1 : 0;
70
+ const rightSelf = right.presenceId === ((_options_selfActor1 = options.selfActor) == null ? void 0 : _options_selfActor1.presenceId) ? 1 : 0;
71
+ return rightSelf - leftSelf || right.updatedAt - left.updatedAt;
72
+ });
73
+ return {
74
+ selfClientId,
75
+ sessions: activeSessions,
76
+ remoteSessions,
77
+ collaborators
78
+ };
79
+ };
80
+ const publish = ()=>options.onChange == null ? void 0 : options.onChange.call(options, readSnapshot());
81
+ return {
82
+ setSelfClientId: (clientId)=>{
83
+ selfClientId = clientId;
84
+ publish();
85
+ },
86
+ replace: (items, clientId = selfClientId)=>{
87
+ selfClientId = clientId;
88
+ sessions = new Map(items.map((item)=>[
89
+ item.clientId,
90
+ item
91
+ ]));
92
+ publish();
93
+ },
94
+ upsert: (item)=>{
95
+ sessions.set(item.clientId, item);
96
+ publish();
97
+ },
98
+ remove: (clientId)=>{
99
+ if (sessions.delete(clientId)) publish();
100
+ },
101
+ clear: ()=>{
102
+ sessions.clear();
103
+ selfClientId = null;
104
+ publish();
105
+ },
106
+ snapshot: readSnapshot
107
+ };
108
+ }
109
+ /**
110
+ * Create a collaboration client with update batching, state-vector repair, presence heartbeat,
111
+ * and reconnect synchronization. The caller retains ownership of the document and transport.
112
+ */ function createCollaborationClient(options) {
113
+ const remoteOrigin = Object.freeze({
114
+ kind: 'platform.collaboration.remote'
115
+ });
116
+ const batchMs = positiveInteger(options.batchMs, 40);
117
+ const syncIntervalMs = positiveInteger(options.syncIntervalMs, 2000);
118
+ const presenceHeartbeatMs = positiveInteger(options.presenceHeartbeatMs, 5000);
119
+ const presenceStaleMs = positiveInteger(options.presenceStaleMs, 15000);
120
+ var _options_initialPresence;
121
+ let presence = _extends({}, (_options_initialPresence = options.initialPresence) != null ? _options_initialPresence : {});
122
+ let pending = [];
123
+ let flushTimer;
124
+ let syncTimer;
125
+ let presenceTimer;
126
+ let presenceCleanupTimer;
127
+ var _options_transport_clientId;
128
+ let selfClientId = (_options_transport_clientId = options.transport.clientId) != null ? _options_transport_clientId : null;
129
+ let started = false;
130
+ const cleanups = [];
131
+ const presenceSeenAt = new Map();
132
+ const reportError = (error)=>options.onError == null ? void 0 : options.onError.call(options, error instanceof Error ? error : new Error(String(error)));
133
+ const emitPresence = ()=>options.transport.emit('presence', _extends({}, presence));
134
+ // Merge the short burst of local Yjs transactions into one network update.
135
+ const flush = ()=>{
136
+ if (flushTimer) clearTimeout(flushTimer);
137
+ flushTimer = undefined;
138
+ if (!pending.length || !options.transport.connected) return;
139
+ const updates = pending;
140
+ pending = [];
141
+ options.transport.emit('update', {
142
+ updateBase64: bytesToBase64(options.document.mergeUpdates(updates)),
143
+ origin: 'plugin-client'
144
+ });
145
+ };
146
+ // A state vector lets the server return only bytes missing from this client.
147
+ const requestSync = ()=>{
148
+ if (!options.transport.connected) return;
149
+ options.transport.emit('sync-request', {
150
+ stateVectorBase64: bytesToBase64(options.document.encodeStateVector())
151
+ });
152
+ };
153
+ // Mark server updates with `remoteOrigin` so the document observer does not send them back.
154
+ const applyRemote = (payload)=>{
155
+ const encoded = stringValue(payload['updateBase64']);
156
+ if (!encoded) return;
157
+ try {
158
+ options.document.applyUpdate(base64ToBytes(encoded), remoteOrigin);
159
+ } catch (error) {
160
+ reportError(error);
161
+ }
162
+ };
163
+ // Register listeners once, then start repair and presence heartbeats before opening the socket.
164
+ const connect = ()=>{
165
+ if (started) return;
166
+ started = true;
167
+ options.onConnectionChange == null ? void 0 : options.onConnectionChange.call(options, 'connecting');
168
+ cleanups.push(options.document.onUpdate((update, origin)=>{
169
+ if (origin === remoteOrigin) return;
170
+ pending.push(update);
171
+ if (!flushTimer) flushTimer = setTimeout(flush, batchMs);
172
+ }));
173
+ cleanups.push(options.transport.on('connect', ()=>{
174
+ var _options_transport_clientId;
175
+ selfClientId = (_options_transport_clientId = options.transport.clientId) != null ? _options_transport_clientId : selfClientId;
176
+ options.onConnectionChange == null ? void 0 : options.onConnectionChange.call(options, 'connected');
177
+ requestSync();
178
+ emitPresence();
179
+ }));
180
+ cleanups.push(options.transport.on('disconnect', ()=>options.onConnectionChange == null ? void 0 : options.onConnectionChange.call(options, 'disconnected')));
181
+ cleanups.push(options.transport.on('sync', applyRemote));
182
+ cleanups.push(options.transport.on('update', applyRemote));
183
+ cleanups.push(options.transport.on('update-ack', (payload)=>{
184
+ const ack = parseAck(payload);
185
+ if (ack) options.onAck == null ? void 0 : options.onAck.call(options, ack);
186
+ }));
187
+ cleanups.push(options.transport.on('presence', (payload)=>{
188
+ const item = parsePresence(payload);
189
+ if (item) {
190
+ presenceSeenAt.set(item.clientId, Date.now());
191
+ options.onPresence == null ? void 0 : options.onPresence.call(options, item);
192
+ }
193
+ }));
194
+ cleanups.push(options.transport.on('presence-snapshot', (payload)=>{
195
+ const rawItems = payload['items'];
196
+ const items = Array.isArray(rawItems) ? rawItems.map(parsePresence).filter(isPresence) : [];
197
+ var _stringValue, _ref;
198
+ selfClientId = (_ref = (_stringValue = stringValue(payload['selfClientId'])) != null ? _stringValue : options.transport.clientId) != null ? _ref : selfClientId;
199
+ presenceSeenAt.clear();
200
+ for (const item of items)presenceSeenAt.set(item.clientId, Date.now());
201
+ options.onPresenceSnapshot == null ? void 0 : options.onPresenceSnapshot.call(options, items, {
202
+ selfClientId
203
+ });
204
+ }));
205
+ cleanups.push(options.transport.on('presence-remove', (payload)=>{
206
+ const clientId = stringValue(payload['clientId']);
207
+ if (clientId) {
208
+ presenceSeenAt.delete(clientId);
209
+ options.onPresenceRemove == null ? void 0 : options.onPresenceRemove.call(options, clientId);
210
+ }
211
+ }));
212
+ cleanups.push(options.transport.on('error', (payload)=>{
213
+ var _stringValue;
214
+ return reportError((_stringValue = stringValue(payload['message'])) != null ? _stringValue : 'Collaboration failed.');
215
+ }));
216
+ syncTimer = setInterval(requestSync, syncIntervalMs);
217
+ presenceTimer = setInterval(emitPresence, presenceHeartbeatMs);
218
+ presenceCleanupTimer = setInterval(()=>{
219
+ const cutoff = Date.now() - presenceStaleMs;
220
+ for (const [clientId, seenAt] of presenceSeenAt){
221
+ if (clientId === selfClientId || seenAt >= cutoff) continue;
222
+ presenceSeenAt.delete(clientId);
223
+ options.onPresenceRemove == null ? void 0 : options.onPresenceRemove.call(options, clientId);
224
+ }
225
+ }, Math.min(5000, Math.max(1000, Math.floor(presenceStaleMs / 3))));
226
+ options.transport.connect();
227
+ };
228
+ // Flush best-effort pending state and release all timers/listeners owned by this client.
229
+ const disconnect = ()=>{
230
+ var _cleanups_pop;
231
+ if (!started) return;
232
+ flush();
233
+ started = false;
234
+ if (flushTimer) clearTimeout(flushTimer);
235
+ if (syncTimer) clearInterval(syncTimer);
236
+ if (presenceTimer) clearInterval(presenceTimer);
237
+ if (presenceCleanupTimer) clearInterval(presenceCleanupTimer);
238
+ flushTimer = undefined;
239
+ syncTimer = undefined;
240
+ presenceTimer = undefined;
241
+ presenceCleanupTimer = undefined;
242
+ presenceSeenAt.clear();
243
+ while(cleanups.length)(_cleanups_pop = cleanups.pop()) == null ? void 0 : _cleanups_pop();
244
+ options.transport.disconnect();
245
+ options.onConnectionChange == null ? void 0 : options.onConnectionChange.call(options, 'disconnected');
246
+ };
247
+ return {
248
+ get selfClientId () {
249
+ return selfClientId;
250
+ },
251
+ remoteOrigin,
252
+ connect,
253
+ disconnect,
254
+ flush,
255
+ requestSync,
256
+ setPresence: (patch)=>{
257
+ presence = _extends({}, presence, patch);
258
+ if (options.transport.connected) emitPresence();
259
+ }
260
+ };
261
+ }
262
+ function actorPresence(actor, clientId) {
263
+ return _extends({}, actor, {
264
+ clientId: clientId != null ? clientId : `self:${actor.presenceId}`,
265
+ pageId: null,
266
+ pointer: null,
267
+ focus: null,
268
+ selection: null,
269
+ viewport: null,
270
+ mode: null,
271
+ status: null,
272
+ toolName: null,
273
+ operationLabel: null,
274
+ updatedAt: Date.now()
275
+ });
276
+ }
277
+ /** Encode bytes in browsers without Node.js `Buffer`; chunks avoid argument-size limits. */ function bytesToBase64(bytes) {
278
+ let binary = '';
279
+ const chunkSize = 0x8000;
280
+ for(let offset = 0; offset < bytes.length; offset += chunkSize){
281
+ binary += String.fromCharCode(...bytes.subarray(offset, Math.min(offset + chunkSize, bytes.length)));
282
+ }
283
+ return globalThis.btoa(binary);
284
+ }
285
+ /** Decode base64 in browsers without requiring Node.js polyfills. */ function base64ToBytes(value) {
286
+ const binary = globalThis.atob(value);
287
+ const bytes = new Uint8Array(binary.length);
288
+ for(let index = 0; index < binary.length; index += 1)bytes[index] = binary.charCodeAt(index);
289
+ return bytes;
290
+ }
291
+ function parseAck(payload) {
292
+ const documentId = stringValue(payload['documentId']);
293
+ const stateVectorBase64 = stringValue(payload['stateVectorBase64']);
294
+ const sequenceNumber = payload['sequenceNumber'];
295
+ if (!documentId || !stateVectorBase64 || typeof sequenceNumber !== 'number') return null;
296
+ const materializationStatus = payload['materializationStatus'];
297
+ if (materializationStatus !== 'ready' && materializationStatus !== 'pending' && materializationStatus !== 'failed') return null;
298
+ return {
299
+ documentId,
300
+ duplicate: payload['duplicate'] === true,
301
+ sequenceNumber,
302
+ updateId: stringValue(payload['updateId']),
303
+ stateVectorBase64,
304
+ materializationStatus
305
+ };
306
+ }
307
+ function parsePresence(value) {
308
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return null;
309
+ const item = value;
310
+ const clientId = stringValue(item['clientId']);
311
+ const presenceId = stringValue(item['presenceId']);
312
+ const displayName = stringValue(item['displayName']);
313
+ const color = stringValue(item['color']);
314
+ const actorType = item['actorType'];
315
+ if (!clientId || !presenceId || !displayName || !color || actorType !== 'user' && actorType !== 'agent' && actorType !== 'system') return null;
316
+ return {
317
+ clientId,
318
+ presenceId,
319
+ displayName,
320
+ color,
321
+ actorType,
322
+ avatarUrl: nullableString(item['avatarUrl']),
323
+ pageId: nullableString(item['pageId']),
324
+ pointer: parsePointer(item['pointer']),
325
+ focus: parseFocus(item['focus']),
326
+ selection: parseSelection(item['selection']),
327
+ viewport: parseViewport(item['viewport']),
328
+ mode: nullableString(item['mode']),
329
+ status: actorStatus(item['status']),
330
+ toolName: nullableString(item['toolName']),
331
+ operationLabel: nullableString(item['operationLabel']),
332
+ updatedAt: typeof item['updatedAt'] === 'number' ? item['updatedAt'] : Date.now()
333
+ };
334
+ }
335
+ function parsePointer(value) {
336
+ const item = recordValue(value);
337
+ if (!item || typeof item['x'] !== 'number' || typeof item['y'] !== 'number') return null;
338
+ return {
339
+ pageId: nullableString(item['pageId']),
340
+ x: item['x'],
341
+ y: item['y'],
342
+ visible: item['visible'] !== false
343
+ };
344
+ }
345
+ function parseFocus(value) {
346
+ const item = recordValue(value);
347
+ const kind = item && stringValue(item['kind']);
348
+ if (!item || !kind) return null;
349
+ return {
350
+ kind,
351
+ key: nullableString(item['key']),
352
+ pageId: nullableString(item['pageId']),
353
+ elementId: nullableString(item['elementId']),
354
+ fieldKey: nullableString(item['fieldKey'])
355
+ };
356
+ }
357
+ function parseSelection(value) {
358
+ const item = recordValue(value);
359
+ const kind = item == null ? void 0 : item['kind'];
360
+ if (!item || kind !== 'text' && kind !== 'elements') return null;
361
+ return {
362
+ kind,
363
+ fieldKey: nullableString(item['fieldKey']),
364
+ elementIds: Array.isArray(item['elementIds']) ? item['elementIds'].filter((entry)=>typeof entry === 'string') : null,
365
+ anchorRelativeBase64: nullableString(item['anchorRelativeBase64']),
366
+ headRelativeBase64: nullableString(item['headRelativeBase64'])
367
+ };
368
+ }
369
+ function parseViewport(value) {
370
+ const item = recordValue(value);
371
+ if (!item || typeof item['zoom'] !== 'number' || typeof item['width'] !== 'number' || typeof item['height'] !== 'number') return null;
372
+ return {
373
+ zoom: item['zoom'],
374
+ width: item['width'],
375
+ height: item['height']
376
+ };
377
+ }
378
+ function recordValue(value) {
379
+ return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
380
+ }
381
+ function isPresence(value) {
382
+ return value !== null;
383
+ }
384
+ function stringValue(value) {
385
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
386
+ }
387
+ function nullableString(value) {
388
+ var _stringValue;
389
+ return (_stringValue = stringValue(value)) != null ? _stringValue : null;
390
+ }
391
+ function actorStatus(value) {
392
+ return value === 'thinking' || value === 'editing' || value === 'done' || value === 'failed' ? value : null;
393
+ }
394
+ function positiveInteger(value, fallback) {
395
+ return Number.isFinite(value) && Number(value) > 0 ? Math.trunc(Number(value)) : fallback;
396
+ }
397
+
398
+ export { _extends as _, bytesToBase64 as a, base64ToBytes as b, createCollaborationClient as c, createCollaborationPresenceStore as d, createSocketIoTransportAdapter as e, createYjsDocumentAdapter as f };
@@ -0,0 +1 @@
1
+ exports._default = require('./index.cjs.js').default;
package/index.cjs.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var common = require('@nestjs/common');
4
4
  var constants = require('@nestjs/common/constants');
5
5
  var lodashEs = require('lodash-es');
6
+ var collaborationClient = require('./collaboration-client.cjs2.js');
6
7
  var core = require('@nestjs/core');
7
8
  var rxjs = require('rxjs');
8
9
  var contracts = require('@xpert-ai/contracts');
@@ -151,28 +152,17 @@ function resolveTenantGlobalScopeKey(tenantId) {
151
152
  return GLOBAL_ORGANIZATION_SCOPE;
152
153
  }
153
154
 
154
- function _extends() {
155
- _extends = Object.assign || function assign(target) {
156
- for(var i = 1; i < arguments.length; i++){
157
- var source = arguments[i];
158
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
159
- }
160
- return target;
161
- };
162
- return _extends.apply(this, arguments);
163
- }
164
-
165
155
  function createPluginLogger(scope, baseMeta = {}) {
166
156
  const nestLogger = new common.Logger(scope);
167
157
  const wrap = (level, msg, meta)=>{
168
158
  var // Maintain alignment with the Nest Logger interface
169
159
  _nestLogger_level;
170
- const payload = meta ? _extends({}, baseMeta, meta) : baseMeta;
160
+ const payload = meta ? collaborationClient._extends({}, baseMeta, meta) : baseMeta;
171
161
  (_nestLogger_level = nestLogger[level]) == null ? void 0 : _nestLogger_level.call(nestLogger, msg + (Object.keys(payload).length ? ` ${JSON.stringify(payload)}` : ''));
172
162
  };
173
163
  return {
174
164
  child (meta) {
175
- return createPluginLogger(scope, _extends({}, baseMeta, meta));
165
+ return createPluginLogger(scope, collaborationClient._extends({}, baseMeta, meta));
176
166
  },
177
167
  debug: (msg, meta)=>wrap('debug', msg, meta),
178
168
  log: (msg, meta)=>wrap('log', msg, meta),
@@ -1005,7 +995,7 @@ class BuiltinToolset extends BaseToolset {
1005
995
  *
1006
996
  * @returns Credentials schema
1007
997
  */ getCredentialsSchema() {
1008
- return _extends({}, this.credentialsSchema);
998
+ return collaborationClient._extends({}, this.credentialsSchema);
1009
999
  }
1010
1000
  /**
1011
1001
  * Get toolset entity
@@ -1318,7 +1308,7 @@ class JsonSchemaValidator {
1318
1308
  const PLUGIN_WEBHOOK_AUTH_METADATA_KEY = 'xpert:plugin:webhook-auth';
1319
1309
  const PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = 'XPERT_PLUGIN_WEBHOOK_AUTH_SERVICE';
1320
1310
  function PluginWebhookAuth(metadata = {}) {
1321
- return common.SetMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, _extends({
1311
+ return common.SetMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, collaborationClient._extends({
1322
1312
  integrationParam: 'id',
1323
1313
  secretQueryParam: 'secret'
1324
1314
  }, metadata));
@@ -1352,7 +1342,7 @@ exports.PluginWebhookAuthGuard = class PluginWebhookAuthGuard {
1352
1342
  }
1353
1343
  request.user = principalContext.user;
1354
1344
  var _request_headers;
1355
- request.headers = _extends({}, (_request_headers = request.headers) != null ? _request_headers : {}, principalContext.headers);
1345
+ request.headers = collaborationClient._extends({}, (_request_headers = request.headers) != null ? _request_headers : {}, principalContext.headers);
1356
1346
  return true;
1357
1347
  }
1358
1348
  resolveMetadata(context) {
@@ -2067,7 +2057,7 @@ const CommonParameterRules = [
2067
2057
  }
2068
2058
  ];
2069
2059
  function mergeCredentials(credentials, modelProperties) {
2070
- return _extends({}, credentials != null ? credentials : {}, modelProperties != null ? modelProperties : {});
2060
+ return collaborationClient._extends({}, credentials != null ? credentials : {}, modelProperties != null ? modelProperties : {});
2071
2061
  }
2072
2062
 
2073
2063
  var AIModel_1;
@@ -2163,7 +2153,7 @@ let AIModel = AIModel_1 = class AIModel {
2163
2153
  try {
2164
2154
  const defaultParameterName = valueOf(DefaultParameterName, parameterRule.use_template);
2165
2155
  const defaultParameterRule = getDefaultParameterRuleVariableMap(defaultParameterName);
2166
- const copyDefaultParameterRule = _extends({}, defaultParameterRule, parameterRule);
2156
+ const copyDefaultParameterRule = collaborationClient._extends({}, defaultParameterRule, parameterRule);
2167
2157
  parameterRule = copyDefaultParameterRule;
2168
2158
  } catch (error) {
2169
2159
  // Handle error if necessary
@@ -2714,7 +2704,7 @@ class Speech2TextChatModel extends chat_models.BaseChatModel {
2714
2704
  if (!apiKey) {
2715
2705
  throw new Error(`Tongyi API key not found. Please set the DASHSCOPE_API_KEY environment variable or pass the key into "apiKey" field.`);
2716
2706
  }
2717
- super(_extends({}, fields));
2707
+ super(collaborationClient._extends({}, fields));
2718
2708
  this.fields = fields;
2719
2709
  this.apiKey = apiKey;
2720
2710
  }
@@ -2795,6 +2785,10 @@ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platfor
2795
2785
  description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2796
2786
  });
2797
2787
 
2788
+ const ArtifactsRuntimeCapability = createRuntimeCapability('platform.artifacts', {
2789
+ description: 'Create, version, preview, download, share, archive, and delete platform-managed plugin and Agent artifacts.'
2790
+ });
2791
+
2798
2792
  /** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
2799
2793
  const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2800
2794
  description: 'Upload, understand, read, and delete raw files in Xpert workspace volumes.'
@@ -4192,7 +4186,7 @@ function normalizePluginJobProcessorMetadata(options) {
4192
4186
  if (concurrency !== undefined && (!Number.isFinite(concurrency) || concurrency <= 0)) {
4193
4187
  throw new Error('PluginJobProcessor concurrency must be a positive number');
4194
4188
  }
4195
- return _extends({
4189
+ return collaborationClient._extends({
4196
4190
  pluginName,
4197
4191
  queueName,
4198
4192
  jobName
@@ -4686,6 +4680,32 @@ function escapeInlineScript(value) {
4686
4680
 
4687
4681
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4688
4682
 
4683
+ /** Platform-owned real-time collaboration capability available to scoped plugin runtimes. */ const CollaborationRuntimeCapability = createRuntimeCapability('platform.collaboration', {
4684
+ description: 'Create, synchronize, persist, authorize, and observe platform-managed real-time collaboration documents.'
4685
+ });
4686
+
4687
+ const COLLABORATION_DOCUMENT_PROVIDER = 'COLLABORATION_DOCUMENT_PROVIDER';
4688
+ /** Register a plugin adapter for one stable collaboration resource type. */ const CollaborationDocumentProvider = (providerKey)=>common.applyDecorators(common.SetMetadata(COLLABORATION_DOCUMENT_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, COLLABORATION_DOCUMENT_PROVIDER));
4689
+
4690
+ /** Discovers system and organization-scoped collaboration providers from loaded plugins. */ exports.CollaborationDocumentProviderRegistry = class CollaborationDocumentProviderRegistry extends BaseStrategyRegistry {
4691
+ constructor(discoveryService, reflector){
4692
+ super(COLLABORATION_DOCUMENT_PROVIDER, discoveryService, reflector);
4693
+ }
4694
+ };
4695
+ exports.CollaborationDocumentProviderRegistry = __decorate([
4696
+ common.Injectable(),
4697
+ __metadata("design:paramtypes", [
4698
+ core.DiscoveryService,
4699
+ core.Reflector
4700
+ ])
4701
+ ], exports.CollaborationDocumentProviderRegistry);
4702
+
4703
+ exports.base64ToBytes = collaborationClient.base64ToBytes;
4704
+ exports.bytesToBase64 = collaborationClient.bytesToBase64;
4705
+ exports.createCollaborationClient = collaborationClient.createCollaborationClient;
4706
+ exports.createCollaborationPresenceStore = collaborationClient.createCollaborationPresenceStore;
4707
+ exports.createSocketIoTransportAdapter = collaborationClient.createSocketIoTransportAdapter;
4708
+ exports.createYjsDocumentAdapter = collaborationClient.createYjsDocumentAdapter;
4689
4709
  Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
4690
4710
  enumerable: true,
4691
4711
  get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
@@ -4704,6 +4724,7 @@ exports.ANALYTICS_PERMISSION_SERVICE_TOKEN = ANALYTICS_PERMISSION_SERVICE_TOKEN;
4704
4724
  exports.AdapterDataSourceStrategy = AdapterDataSourceStrategy;
4705
4725
  exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
4706
4726
  exports.AiModelNotFoundException = AiModelNotFoundException;
4727
+ exports.ArtifactsRuntimeCapability = ArtifactsRuntimeCapability;
4707
4728
  exports.AssistantTaskRuntimeCapability = AssistantTaskRuntimeCapability;
4708
4729
  exports.BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN;
4709
4730
  exports.BUILTIN_GLOBAL_SCOPE = BUILTIN_GLOBAL_SCOPE;
@@ -4717,11 +4738,14 @@ exports.BaseToolset = BaseToolset;
4717
4738
  exports.BuiltinToolset = BuiltinToolset;
4718
4739
  exports.CHAT_CHANNEL = CHAT_CHANNEL;
4719
4740
  exports.CHAT_CHANNEL_TEXT_LIMITS = CHAT_CHANNEL_TEXT_LIMITS;
4741
+ exports.COLLABORATION_DOCUMENT_PROVIDER = COLLABORATION_DOCUMENT_PROVIDER;
4720
4742
  exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
4721
4743
  exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
4722
4744
  exports.CancelConversationCommand = CancelConversationCommand;
4723
4745
  exports.ChatChannel = ChatChannel;
4724
4746
  exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
4747
+ exports.CollaborationDocumentProvider = CollaborationDocumentProvider;
4748
+ exports.CollaborationRuntimeCapability = CollaborationRuntimeCapability;
4725
4749
  exports.CommonParameterRules = CommonParameterRules;
4726
4750
  exports.ConnectorRuntimeCapability = ConnectorRuntimeCapability;
4727
4751
  exports.ConnectorStrategyKey = ConnectorStrategyKey;
package/index.cjs.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from './index.cjs.js';
2
+ export { _default as default } from './index.cjs.default.js';
package/index.esm.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Module, Logger, applyDecorators, SetMetadata, HttpException, HttpStatus, BadRequestException, Injectable, Inject, Optional, UnauthorizedException, NotFoundException, ForbiddenException } from '@nestjs/common';
2
2
  import { MODULE_METADATA } from '@nestjs/common/constants';
3
3
  import { pick } from 'lodash-es';
4
+ import { _ as _extends } from './collaboration-client.esm2.js';
5
+ export { b as base64ToBytes, a as bytesToBase64, c as createCollaborationClient, d as createCollaborationPresenceStore, e as createSocketIoTransportAdapter, f as createYjsDocumentAdapter } from './collaboration-client.esm2.js';
4
6
  import { DiscoveryService, Reflector } from '@nestjs/core';
5
7
  import { Subject, filter } from 'rxjs';
6
8
  import { LanguagesEnum, AiModelTypeEnum, ParameterType, PriceType, FetchFrom, ModelFeature, ModelPropertyKey } from '@xpert-ai/contracts';
@@ -131,17 +133,6 @@ function resolveTenantGlobalScopeKey(tenantId) {
131
133
  return GLOBAL_ORGANIZATION_SCOPE;
132
134
  }
133
135
 
134
- function _extends() {
135
- _extends = Object.assign || function assign(target) {
136
- for(var i = 1; i < arguments.length; i++){
137
- var source = arguments[i];
138
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
139
- }
140
- return target;
141
- };
142
- return _extends.apply(this, arguments);
143
- }
144
-
145
136
  function createPluginLogger(scope, baseMeta = {}) {
146
137
  const nestLogger = new Logger(scope);
147
138
  const wrap = (level, msg, meta)=>{
@@ -2775,6 +2766,10 @@ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platfor
2775
2766
  description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2776
2767
  });
2777
2768
 
2769
+ const ArtifactsRuntimeCapability = createRuntimeCapability('platform.artifacts', {
2770
+ description: 'Create, version, preview, download, share, archive, and delete platform-managed plugin and Agent artifacts.'
2771
+ });
2772
+
2778
2773
  /** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
2779
2774
  const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2780
2775
  description: 'Upload, understand, read, and delete raw files in Xpert workspace volumes.'
@@ -4666,4 +4661,24 @@ function escapeInlineScript(value) {
4666
4661
 
4667
4662
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4668
4663
 
4669
- export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, ConnectorRuntimeCapability, ConnectorStrategyKey, ConnectorStrategyRegistry, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WORKSPACE_FILES_SOURCE, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, derivePluginArtifactNamespace, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, pluginArtifactTableName, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };
4664
+ /** Platform-owned real-time collaboration capability available to scoped plugin runtimes. */ const CollaborationRuntimeCapability = createRuntimeCapability('platform.collaboration', {
4665
+ description: 'Create, synchronize, persist, authorize, and observe platform-managed real-time collaboration documents.'
4666
+ });
4667
+
4668
+ const COLLABORATION_DOCUMENT_PROVIDER = 'COLLABORATION_DOCUMENT_PROVIDER';
4669
+ /** Register a plugin adapter for one stable collaboration resource type. */ const CollaborationDocumentProvider = (providerKey)=>applyDecorators(SetMetadata(COLLABORATION_DOCUMENT_PROVIDER, providerKey), SetMetadata(STRATEGY_META_KEY, COLLABORATION_DOCUMENT_PROVIDER));
4670
+
4671
+ /** Discovers system and organization-scoped collaboration providers from loaded plugins. */ let CollaborationDocumentProviderRegistry = class CollaborationDocumentProviderRegistry extends BaseStrategyRegistry {
4672
+ constructor(discoveryService, reflector){
4673
+ super(COLLABORATION_DOCUMENT_PROVIDER, discoveryService, reflector);
4674
+ }
4675
+ };
4676
+ CollaborationDocumentProviderRegistry = __decorate([
4677
+ Injectable(),
4678
+ __metadata("design:paramtypes", [
4679
+ DiscoveryService,
4680
+ Reflector
4681
+ ])
4682
+ ], CollaborationDocumentProviderRegistry);
4683
+
4684
+ export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, ArtifactsRuntimeCapability, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, COLLABORATION_DOCUMENT_PROVIDER, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CollaborationDocumentProvider, CollaborationDocumentProviderRegistry, CollaborationRuntimeCapability, CommonParameterRules, ConnectorRuntimeCapability, ConnectorStrategyKey, ConnectorStrategyRegistry, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WORKSPACE_FILES_SOURCE, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, derivePluginArtifactNamespace, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, pluginArtifactTableName, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };