@xpert-ai/plugin-sdk 3.26.2 → 3.28.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/artifact-document.cjs.js +55 -16
- package/artifact-document.esm.js +53 -17
- package/collaboration-client.cjs.js +31 -5
- package/collaboration-client.esm.js +31 -5
- package/data-workbench.cjs.js +4 -2
- package/data-workbench.esm.js +4 -2
- package/docs/artifact-documents.md +8 -2
- package/docs/en/runtime-capabilities.md +103 -0
- package/index.cjs.js +479 -70
- package/index.esm.js +461 -73
- package/model-provider.cjs.js +17 -1
- package/model-provider.esm.js +15 -2
- package/package.json +2 -2
- package/src/artifact-document.d.ts +1 -0
- package/src/index.d.ts +2 -0
- package/src/lib/agent/handoff/types.d.ts +5 -0
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +6 -1
- package/src/lib/agent/middleware/runtime.d.ts +2 -0
- package/src/lib/agent/runtime/capability.d.ts +4 -0
- package/src/lib/agent/runtime/cli-model-profile.d.ts +1 -1
- package/src/lib/agent/runtime/execution-runner.d.ts +11 -0
- package/src/lib/agent/runtime/index.d.ts +2 -0
- package/src/lib/agent/runtime/managed.d.ts +94 -0
- package/src/lib/agent/runtime/process-supervisor.d.ts +1 -0
- package/src/lib/agent/runtime/strategy.d.ts +14 -0
- package/src/lib/agent/runtime/types.d.ts +30 -1
- package/src/lib/ai-model/native-model.d.ts +5 -1
- package/src/lib/artifact-document/host.d.ts +3 -0
- package/src/lib/artifact-document/network.d.ts +21 -0
- package/src/lib/artifact-document/runtime.d.ts +2 -1
- package/src/lib/assistant-capability/index.d.ts +3 -0
- package/src/lib/assistant-capability/middleware.d.ts +10 -0
- package/src/lib/collaboration/types.d.ts +12 -1
- package/src/lib/connector/document-source.d.ts +31 -0
- package/src/lib/connector/documents.d.ts +38 -0
- package/src/lib/connector/index.d.ts +1 -0
- package/src/lib/connector/strategy.interface.d.ts +3 -0
- package/src/lib/content-resource/catalog.d.ts +88 -0
- package/src/lib/content-resource/document.d.ts +142 -0
- package/src/lib/content-resource/editor-compatibility.d.ts +3 -0
- package/src/lib/content-resource/editor.d.ts +105 -0
- package/src/lib/content-resource/index.d.ts +94 -0
- package/src/lib/content-resource/reference.d.ts +38 -0
- package/src/lib/data/datasource/workbench-adapter.d.ts +5 -3
- package/src/lib/data/datasource/workbench-sql.d.ts +0 -4
- package/src/lib/execution-control/context.d.ts +7 -0
- package/src/lib/execution-control/index.d.ts +2 -0
- package/src/lib/managed-queue/index.d.ts +12 -0
- package/src/lib/project-pipeline/contribution-failure.d.ts +17 -0
- package/src/lib/project-pipeline/registry.d.ts +16 -1
- package/src/lib/runtime/actor.d.ts +10 -0
- package/src/lib/runtime/capabilities/artifact-drafts.d.ts +10 -1
- package/src/lib/runtime/capabilities/artifacts.d.ts +5 -0
- package/src/lib/runtime/capabilities/assistant-middleware-access.d.ts +28 -0
- package/src/lib/runtime/capabilities/index.d.ts +4 -0
- package/src/lib/runtime/capabilities/mcp-client-runtime.d.ts +2 -0
- package/src/lib/runtime/capabilities/project-access.d.ts +10 -7
- package/src/lib/runtime/capabilities/project-files.d.ts +40 -0
- package/src/lib/runtime/capabilities/project-knowledge.d.ts +14 -0
- package/src/lib/runtime/capabilities/project-provisioning.d.ts +6 -0
- package/src/lib/runtime/capabilities/sandbox-jobs.d.ts +12 -3
- package/src/lib/runtime/capabilities/workspace-files.d.ts +2 -0
- package/src/lib/sandbox/file-edit-command.d.ts +2 -0
- package/src/lib/sandbox/file-edit-diff.d.ts +1 -0
- package/src/lib/sandbox/protocol.d.ts +13 -1
- package/src/lib/sandbox/runtime-provider.d.ts +12 -0
- package/src/lib/view-extension/middleware-runtime.d.ts +2 -3
package/index.cjs.js
CHANGED
|
@@ -39,8 +39,8 @@ var jsTiktoken = require('js-tiktoken');
|
|
|
39
39
|
var zod = require('zod');
|
|
40
40
|
var results = require('./results.cjs.js');
|
|
41
41
|
var connector = require('./connector.cjs.js');
|
|
42
|
-
var collaborationClient = require('./collaboration-client.cjs.js');
|
|
43
42
|
var _object_without_properties_loose$2 = require('./_object_without_properties_loose.cjs.js');
|
|
43
|
+
var collaborationClient = require('./collaboration-client.cjs.js');
|
|
44
44
|
var tools = require('@langchain/core/tools');
|
|
45
45
|
|
|
46
46
|
function _interopNamespaceDefault(e) {
|
|
@@ -3307,30 +3307,22 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3307
3307
|
const promptRate = (_promptBreakdown_find = promptBreakdown.find((item)=>item.component === 'input')) != null ? _promptBreakdown_find : promptBreakdown[0];
|
|
3308
3308
|
const completionRate = completionBreakdown[0];
|
|
3309
3309
|
var _promptRate_unitPrice, _promptRate_unit, _completionRate_unitPrice, _completionRate_unit;
|
|
3310
|
-
return _extends._extends({
|
|
3311
|
-
promptTokens,
|
|
3310
|
+
return _extends._extends({}, resolvedTokenUsage, {
|
|
3312
3311
|
promptUnitPrice: (_promptRate_unitPrice = promptRate == null ? void 0 : promptRate.unitPrice) != null ? _promptRate_unitPrice : 0,
|
|
3313
3312
|
promptPriceUnit: (_promptRate_unit = promptRate == null ? void 0 : promptRate.unit) != null ? _promptRate_unit : 0,
|
|
3314
3313
|
promptPrice: Number(promptBreakdown.reduce((total, item)=>{
|
|
3315
3314
|
var _item_amount;
|
|
3316
3315
|
return total + ((_item_amount = item.amount) != null ? _item_amount : 0);
|
|
3317
3316
|
}, 0).toFixed(7)),
|
|
3318
|
-
completionTokens,
|
|
3319
3317
|
completionUnitPrice: (_completionRate_unitPrice = completionRate == null ? void 0 : completionRate.unitPrice) != null ? _completionRate_unitPrice : 0,
|
|
3320
3318
|
completionPriceUnit: (_completionRate_unit = completionRate == null ? void 0 : completionRate.unit) != null ? _completionRate_unit : 0,
|
|
3321
3319
|
completionPrice: Number(completionBreakdown.reduce((total, item)=>{
|
|
3322
3320
|
var _item_amount;
|
|
3323
3321
|
return total + ((_item_amount = item.amount) != null ? _item_amount : 0);
|
|
3324
3322
|
}, 0).toFixed(7)),
|
|
3325
|
-
totalTokens: resolvedTokenUsage.totalTokens,
|
|
3326
3323
|
totalPrice: calculation.totalAmount,
|
|
3327
3324
|
currency: calculation.currency,
|
|
3328
|
-
latency: performance.now() - startedAt
|
|
3329
|
-
}, resolvedTokenUsage.cacheReadInputTokens ? {
|
|
3330
|
-
cacheReadInputTokens: resolvedTokenUsage.cacheReadInputTokens
|
|
3331
|
-
} : {}, resolvedTokenUsage.cacheWriteInputTokens ? {
|
|
3332
|
-
cacheWriteInputTokens: resolvedTokenUsage.cacheWriteInputTokens
|
|
3333
|
-
} : {}, {
|
|
3325
|
+
latency: performance.now() - startedAt,
|
|
3334
3326
|
pricingStatus: calculation.pricingStatus,
|
|
3335
3327
|
priceAuthority: 'catalog',
|
|
3336
3328
|
pricingBreakdown: calculation.breakdown
|
|
@@ -3340,22 +3332,19 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3340
3332
|
const completionPriceInfo = this.getPrice(model, credentials, contracts.PriceType.OUTPUT, completionTokens, promptTokens);
|
|
3341
3333
|
const totalPrice = Number((promptPriceInfo.totalAmount + completionPriceInfo.totalAmount).toFixed(7));
|
|
3342
3334
|
// Conversion usage
|
|
3343
|
-
const usage = {
|
|
3344
|
-
promptTokens: promptTokens,
|
|
3335
|
+
const usage = _extends._extends({}, resolvedTokenUsage, {
|
|
3345
3336
|
promptUnitPrice: promptPriceInfo.unitPrice,
|
|
3346
3337
|
promptPriceUnit: promptPriceInfo.unit,
|
|
3347
3338
|
promptPrice: promptPriceInfo.totalAmount,
|
|
3348
|
-
completionTokens: completionTokens,
|
|
3349
3339
|
completionUnitPrice: completionPriceInfo.unitPrice,
|
|
3350
3340
|
completionPriceUnit: completionPriceInfo.unit,
|
|
3351
3341
|
completionPrice: completionPriceInfo.totalAmount,
|
|
3352
|
-
totalTokens: promptTokens + completionTokens,
|
|
3353
3342
|
totalPrice,
|
|
3354
3343
|
currency: promptPriceInfo.currency,
|
|
3355
3344
|
latency: performance.now() - startedAt,
|
|
3356
3345
|
pricingStatus: totalPrice === 0 ? 'free' : 'priced',
|
|
3357
3346
|
priceAuthority: 'catalog'
|
|
3358
|
-
};
|
|
3347
|
+
});
|
|
3359
3348
|
return usage;
|
|
3360
3349
|
}
|
|
3361
3350
|
createHandleUsageCallbacks(copilot, model, credentials, handleLLMTokens, pricingConfiguration = {}) {
|
|
@@ -3373,7 +3362,7 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3373
3362
|
}
|
|
3374
3363
|
let usage = _extends._extends({}, this.calcResponseUsage(model, credentials, normalizedTokenUsage.promptTokens, normalizedTokenUsage.completionTokens, startedAt, normalizedTokenUsage, _extends._extends({}, pricingContext, {
|
|
3375
3364
|
inputTokensIncludeCache: true
|
|
3376
|
-
})), type ? {
|
|
3365
|
+
})), normalizedTokenUsage, type ? {
|
|
3377
3366
|
type
|
|
3378
3367
|
} : {});
|
|
3379
3368
|
const reportedPrice = output ? pricingOptions.resolveReportedPrice == null ? void 0 : pricingOptions.resolveReportedPrice.call(pricingOptions, output) : undefined;
|
|
@@ -3382,7 +3371,6 @@ class LargeLanguageModel extends exports.AIModel {
|
|
|
3382
3371
|
} else if (pricingOptions.reportedPriceRequired) {
|
|
3383
3372
|
usage = markUsagePriceUnpriced(usage, 'provider');
|
|
3384
3373
|
}
|
|
3385
|
-
usage.totalTokens = normalizedTokenUsage.totalTokens;
|
|
3386
3374
|
await handleLLMTokens({
|
|
3387
3375
|
copilot,
|
|
3388
3376
|
model,
|
|
@@ -4586,6 +4574,107 @@ function taskWaitReason(states, mode) {
|
|
|
4586
4574
|
const AgentExecutionRunnerCapability = modelProvider.createRuntimeCapability('platform.agent_execution.runner');
|
|
4587
4575
|
const AgentExecutionRunnerFactoryCapability = modelProvider.createRuntimeCapability('platform.agent_execution.runner.factory');
|
|
4588
4576
|
|
|
4577
|
+
// Invariants: this payload has no runtime imports; protocol streams are not exit evidence.
|
|
4578
|
+
// The device supervisor regression test enforces identical process supervision semantics.
|
|
4579
|
+
const AGENT_PROCESS_SUPERVISOR = String.raw`
|
|
4580
|
+
import ctypes, errno, json, os, signal, subprocess, sys, time
|
|
4581
|
+
owner = int(sys.argv[1])
|
|
4582
|
+
stopping = False
|
|
4583
|
+
strong = False
|
|
4584
|
+
if sys.platform.startswith('linux'):
|
|
4585
|
+
strong = ctypes.CDLL(None, use_errno=True).prctl(36, 1, 0, 0, 0) == 0
|
|
4586
|
+
def stop(*args):
|
|
4587
|
+
global stopping
|
|
4588
|
+
stopping = True
|
|
4589
|
+
signal.signal(signal.SIGTERM, stop)
|
|
4590
|
+
signal.signal(signal.SIGINT, stop)
|
|
4591
|
+
# The supervisor is the process-group leader. Its live PID reserves the group identity.
|
|
4592
|
+
os.write(3, b'{"ready":true}\n')
|
|
4593
|
+
try:
|
|
4594
|
+
if os.getppid() != owner: raise OSError('Original host exited before admission')
|
|
4595
|
+
child = subprocess.Popen(sys.argv[2:], close_fds=True)
|
|
4596
|
+
except OSError:
|
|
4597
|
+
os.write(3, json.dumps({'version': 1, 'state': 'not_started', 'coverage': 'descendants', 'exitCode': 127}).encode())
|
|
4598
|
+
sys.exit(0)
|
|
4599
|
+
# Only the protocol child owns stdin, so a closed transport still produces EPIPE.
|
|
4600
|
+
os.close(0)
|
|
4601
|
+
code = None
|
|
4602
|
+
deadline = None
|
|
4603
|
+
while True:
|
|
4604
|
+
if os.getppid() != owner: stopping = True
|
|
4605
|
+
if code is None:
|
|
4606
|
+
value = child.poll()
|
|
4607
|
+
if value is not None: code = value; stopping = True
|
|
4608
|
+
if stopping and deadline is None:
|
|
4609
|
+
deadline = time.monotonic() + 2
|
|
4610
|
+
os.killpg(os.getpgrp(), signal.SIGTERM)
|
|
4611
|
+
if deadline is not None and time.monotonic() >= deadline:
|
|
4612
|
+
if not strong:
|
|
4613
|
+
# No subreaper means escaped descendants cannot be certified. No receipt is emitted.
|
|
4614
|
+
os.killpg(os.getpgrp(), signal.SIGKILL)
|
|
4615
|
+
# Kill only still-waitable direct children. Orphans are adopted by this subreaper;
|
|
4616
|
+
# holding them until waitpid prevents PID reuse between selection and signalling.
|
|
4617
|
+
try:
|
|
4618
|
+
ids = open('/proc/self/task/' + str(os.getpid()) + '/children').read().split()
|
|
4619
|
+
for value in ids:
|
|
4620
|
+
try: os.kill(int(value), signal.SIGKILL)
|
|
4621
|
+
except ProcessLookupError: pass
|
|
4622
|
+
except OSError:
|
|
4623
|
+
os.killpg(os.getpgrp(), signal.SIGKILL)
|
|
4624
|
+
if stopping and strong:
|
|
4625
|
+
empty = False
|
|
4626
|
+
while True:
|
|
4627
|
+
try:
|
|
4628
|
+
pid, status = os.waitpid(-1, os.WNOHANG)
|
|
4629
|
+
if pid == 0: break
|
|
4630
|
+
if pid == child.pid and code is None: code = os.waitstatus_to_exitcode(status)
|
|
4631
|
+
except ChildProcessError:
|
|
4632
|
+
empty = True
|
|
4633
|
+
break
|
|
4634
|
+
if empty:
|
|
4635
|
+
os.write(3, json.dumps({'version': 1, 'state': 'exited', 'coverage': 'descendants', 'exitCode': code}).encode())
|
|
4636
|
+
sys.exit(0)
|
|
4637
|
+
time.sleep(.02)
|
|
4638
|
+
`;
|
|
4639
|
+
|
|
4640
|
+
/** Persisted host ownership marker. Only built-in presets are supported. */ const managedAgentRuntimeSchema = v3.z.object({
|
|
4641
|
+
type: v3.z.literal('builtin'),
|
|
4642
|
+
version: v3.z.string().min(1)
|
|
4643
|
+
}).strict();
|
|
4644
|
+
/** Launch settings supplied by the installed strategy, never by tool input or host provider lists. */ const agentRuntimeDeploymentSpecSchema = v3.z.discriminatedUnion('type', [
|
|
4645
|
+
v3.z.object({
|
|
4646
|
+
type: v3.z.literal('process'),
|
|
4647
|
+
command: v3.z.string().min(1).refine((value)=>!value.includes('\0')),
|
|
4648
|
+
args: v3.z.array(v3.z.string().refine((value)=>!value.includes('\0'))),
|
|
4649
|
+
environment: v3.z.record(v3.z.string(), v3.z.string()),
|
|
4650
|
+
model: v3.z.string().min(1).optional(),
|
|
4651
|
+
timeoutMs: v3.z.number().int().min(1000).max(3600000)
|
|
4652
|
+
}).strict(),
|
|
4653
|
+
v3.z.object({
|
|
4654
|
+
type: v3.z.literal('sdk'),
|
|
4655
|
+
environment: v3.z.record(v3.z.string(), v3.z.string()),
|
|
4656
|
+
model: v3.z.string().min(1).optional(),
|
|
4657
|
+
timeoutMs: v3.z.number().int().min(1000).max(3600000)
|
|
4658
|
+
}).strict(),
|
|
4659
|
+
v3.z.object({
|
|
4660
|
+
type: v3.z.literal('service'),
|
|
4661
|
+
serverUrl: v3.z.string().url().refine((value)=>{
|
|
4662
|
+
try {
|
|
4663
|
+
const url = new URL(value);
|
|
4664
|
+
return [
|
|
4665
|
+
'http:',
|
|
4666
|
+
'https:'
|
|
4667
|
+
].includes(url.protocol) && !url.username && !url.password && !url.search && !url.hash;
|
|
4668
|
+
} catch (e) {
|
|
4669
|
+
return false;
|
|
4670
|
+
}
|
|
4671
|
+
}),
|
|
4672
|
+
authorization: v3.z.string().optional(),
|
|
4673
|
+
timeoutMs: v3.z.number().int().min(1000).max(3600000)
|
|
4674
|
+
}).strict()
|
|
4675
|
+
]);
|
|
4676
|
+
/** Used by SDK/process/service adapters. The host pins the target and rechecks access; no caller-selected scope. */ const AgentRuntimeDeploymentCapability = modelProvider.createRuntimeCapability('platform.agent_runtime.deployment');
|
|
4677
|
+
|
|
4589
4678
|
/** Host-only provenance. This describes a saved operation; it never grants access by itself. */ const projectPipelineInvocationScopeSchema = v3.z.object({
|
|
4590
4679
|
tenantId: v3.z.string().uuid(),
|
|
4591
4680
|
organizationId: v3.z.string().uuid(),
|
|
@@ -4605,6 +4694,69 @@ const AgentExecutionRunnerFactoryCapability = modelProvider.createRuntimeCapabil
|
|
|
4605
4694
|
|
|
4606
4695
|
/** Older runtime plugins can still send this event; new emissions use ON_CHAT_EVENT. */ const RESOURCE_CARD_EVENT = 'xpert.resource_card';
|
|
4607
4696
|
|
|
4697
|
+
function middleware(node) {
|
|
4698
|
+
return node.type === 'workflow' && node.entity.type === contracts.WorkflowNodeTypeEnum.MIDDLEWARE;
|
|
4699
|
+
}
|
|
4700
|
+
function hasAssistantMiddleware(draft, provider) {
|
|
4701
|
+
return draft.nodes.some((node)=>middleware(node) && node.entity.provider === provider && draft.connections.some((edge)=>{
|
|
4702
|
+
var _draft_team_agent;
|
|
4703
|
+
return edge.type === 'workflow' && edge.from === ((_draft_team_agent = draft.team.agent) == null ? void 0 : _draft_team_agent.key) && edge.to.split('/')[0] === node.key;
|
|
4704
|
+
}));
|
|
4705
|
+
}
|
|
4706
|
+
/** Compose only the draft graph. The platform records the contribution for safe removal.
|
|
4707
|
+
* No Project, permission, external resource or implicit replacement is created here. */ function applyAssistantMiddleware(draft, input) {
|
|
4708
|
+
var _agent_entity_prompt;
|
|
4709
|
+
const agent = draft.nodes.find((node)=>{
|
|
4710
|
+
var _draft_team_agent;
|
|
4711
|
+
return node.type === 'agent' && node.key === ((_draft_team_agent = draft.team.agent) == null ? void 0 : _draft_team_agent.key);
|
|
4712
|
+
});
|
|
4713
|
+
if ((agent == null ? void 0 : agent.type) !== 'agent') throw new common.BadRequestException('assistant.invalid_draft');
|
|
4714
|
+
if (!hasAssistantMiddleware(draft, input.provider)) {
|
|
4715
|
+
var _agent_entity_options, _agent_entity_options_middlewares, _agent_entity_options1;
|
|
4716
|
+
let key = input.key;
|
|
4717
|
+
for(let suffix = 2; draft.nodes.some((node)=>node.key === key) || draft.connections.some((edge)=>edge.key === `${agent.key}/${key}`); suffix++)key = `${input.key}_${suffix}`;
|
|
4718
|
+
const entity = {
|
|
4719
|
+
id: key,
|
|
4720
|
+
key,
|
|
4721
|
+
type: contracts.WorkflowNodeTypeEnum.MIDDLEWARE,
|
|
4722
|
+
title: input.title,
|
|
4723
|
+
provider: input.provider,
|
|
4724
|
+
required: true,
|
|
4725
|
+
options: {}
|
|
4726
|
+
};
|
|
4727
|
+
draft.nodes.push({
|
|
4728
|
+
type: 'workflow',
|
|
4729
|
+
key,
|
|
4730
|
+
position: {
|
|
4731
|
+
x: 620,
|
|
4732
|
+
y: 160 * (draft.nodes.length - 1)
|
|
4733
|
+
},
|
|
4734
|
+
entity
|
|
4735
|
+
});
|
|
4736
|
+
draft.connections.push({
|
|
4737
|
+
key: `${agent.key}/${key}`,
|
|
4738
|
+
type: 'workflow',
|
|
4739
|
+
from: agent.key,
|
|
4740
|
+
to: key,
|
|
4741
|
+
required: true
|
|
4742
|
+
});
|
|
4743
|
+
var _agent_entity_options_middlewares_order;
|
|
4744
|
+
agent.entity.options = _extends._extends({}, agent.entity.options, {
|
|
4745
|
+
parallelToolCalls: false,
|
|
4746
|
+
middlewares: _extends._extends({}, (_agent_entity_options = agent.entity.options) == null ? void 0 : _agent_entity_options.middlewares, {
|
|
4747
|
+
order: [
|
|
4748
|
+
...(_agent_entity_options_middlewares_order = (_agent_entity_options1 = agent.entity.options) == null ? void 0 : (_agent_entity_options_middlewares = _agent_entity_options1.middlewares) == null ? void 0 : _agent_entity_options_middlewares.order) != null ? _agent_entity_options_middlewares_order : [],
|
|
4749
|
+
key
|
|
4750
|
+
]
|
|
4751
|
+
})
|
|
4752
|
+
});
|
|
4753
|
+
}
|
|
4754
|
+
if (!((_agent_entity_prompt = agent.entity.prompt) == null ? void 0 : _agent_entity_prompt.includes(input.instructions))) agent.entity.prompt = [
|
|
4755
|
+
agent.entity.prompt,
|
|
4756
|
+
input.instructions
|
|
4757
|
+
].filter(Boolean).join('\n\n');
|
|
4758
|
+
}
|
|
4759
|
+
|
|
4608
4760
|
const ASSISTANT_CAPABILITY_PROVIDER = 'ASSISTANT_CAPABILITY_PROVIDER';
|
|
4609
4761
|
const AssistantCapabilityProvider = (key)=>common.applyDecorators(common.SetMetadata(ASSISTANT_CAPABILITY_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, ASSISTANT_CAPABILITY_PROVIDER));
|
|
4610
4762
|
exports.AssistantCapabilityProviderRegistry = class AssistantCapabilityProviderRegistry extends BaseStrategyRegistry {
|
|
@@ -4874,6 +5026,10 @@ function isLegacyConnectorStrategy(strategy) {
|
|
|
4874
5026
|
return 'auth' in strategy.definition && ((_strategy_definition_auth = strategy.definition.auth) == null ? void 0 : _strategy_definition_auth.type) === 'oauth2' && typeof strategy.buildAuthorizationUrl === 'function' && typeof strategy.exchangeOAuthCode === 'function';
|
|
4875
5027
|
}
|
|
4876
5028
|
|
|
5029
|
+
const ConnectorDocumentsRuntimeCapability = modelProvider.createRuntimeCapability('platform.connector.documents', {
|
|
5030
|
+
description: 'Read authorized connector documents for explicit project imports; never exposes credentials or writes remote content.'
|
|
5031
|
+
});
|
|
5032
|
+
|
|
4877
5033
|
const SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = {
|
|
4878
5034
|
min: 1,
|
|
4879
5035
|
max: 3600
|
|
@@ -4967,26 +5123,59 @@ function resolveSandboxBackend(sandbox) {
|
|
|
4967
5123
|
return isSandboxBackend(candidate) ? candidate : null;
|
|
4968
5124
|
}
|
|
4969
5125
|
|
|
5126
|
+
const editMetricsSchema = v3.z.object({
|
|
5127
|
+
occurrences: v3.z.number().int().nonnegative(),
|
|
5128
|
+
oldLines: v3.z.number().int().nonnegative(),
|
|
5129
|
+
newLines: v3.z.number().int().nonnegative(),
|
|
5130
|
+
changed: v3.z.boolean(),
|
|
5131
|
+
diff: v3.z.object({
|
|
5132
|
+
removed: v3.z.number().int().nonnegative(),
|
|
5133
|
+
added: v3.z.number().int().nonnegative()
|
|
5134
|
+
}).optional(),
|
|
5135
|
+
diffUnavailable: v3.z.enum([
|
|
5136
|
+
'comparison_budget_exceeded',
|
|
5137
|
+
'diff_unavailable'
|
|
5138
|
+
]).optional()
|
|
5139
|
+
});
|
|
5140
|
+
function editMetrics(output) {
|
|
5141
|
+
try {
|
|
5142
|
+
const result = editMetricsSchema.safeParse(JSON.parse(output));
|
|
5143
|
+
if (!result.success) return undefined;
|
|
5144
|
+
const _result_data = result.data, { diff } = _result_data, metrics = _object_without_properties_loose$2._object_without_properties_loose(_result_data, [
|
|
5145
|
+
"diff"
|
|
5146
|
+
]);
|
|
5147
|
+
return _extends._extends({}, metrics, diff ? {
|
|
5148
|
+
diff: {
|
|
5149
|
+
removed: diff.removed,
|
|
5150
|
+
added: diff.added
|
|
5151
|
+
}
|
|
5152
|
+
} : {});
|
|
5153
|
+
} catch (e) {
|
|
5154
|
+
return undefined;
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
4970
5157
|
function editCommandResult(filePath, result) {
|
|
5158
|
+
const metrics = editMetrics(result.output);
|
|
4971
5159
|
switch(result.exitCode){
|
|
4972
5160
|
case 0:
|
|
4973
|
-
return {
|
|
5161
|
+
return _extends._extends({
|
|
4974
5162
|
path: filePath,
|
|
4975
|
-
filesUpdate: null
|
|
5163
|
+
filesUpdate: null
|
|
5164
|
+
}, metrics != null ? metrics : {
|
|
4976
5165
|
occurrences: parseInt(result.output.trim(), 10) || 1
|
|
4977
|
-
};
|
|
5166
|
+
});
|
|
4978
5167
|
case 1:
|
|
4979
|
-
return {
|
|
5168
|
+
return _extends._extends({}, metrics, {
|
|
4980
5169
|
error: `String not found in file '${filePath}'`
|
|
4981
|
-
};
|
|
5170
|
+
});
|
|
4982
5171
|
case 2:
|
|
4983
|
-
return {
|
|
5172
|
+
return _extends._extends({}, metrics, {
|
|
4984
5173
|
error: `Multiple occurrences found in '${filePath}'. Use replaceAll=true to replace all.`
|
|
4985
|
-
};
|
|
5174
|
+
});
|
|
4986
5175
|
case 3:
|
|
4987
|
-
return {
|
|
5176
|
+
return _extends._extends({}, metrics, {
|
|
4988
5177
|
error: `Error: File '${filePath}' not found`
|
|
4989
|
-
};
|
|
5178
|
+
});
|
|
4990
5179
|
default:
|
|
4991
5180
|
return {
|
|
4992
5181
|
error: `Unknown error editing file '${filePath}'`
|
|
@@ -5028,6 +5217,88 @@ function editCommandResult(filePath, result) {
|
|
|
5028
5217
|
};
|
|
5029
5218
|
}
|
|
5030
5219
|
|
|
5220
|
+
// Embedded in the existing sandbox Node process; no Git, subprocess, or temporary files.
|
|
5221
|
+
const FILE_EDIT_DIFF_SCRIPT = String.raw`
|
|
5222
|
+
function inspectLineDiff(before, after) {
|
|
5223
|
+
if (before === after) return { diff: { removed: 0, added: 0 } };
|
|
5224
|
+
// Include line terminators so a missing final newline is an actual line change.
|
|
5225
|
+
const oldLines = before.match(/[^\n]*\n|[^\n]+$/g) || [];
|
|
5226
|
+
const newLines = after.match(/[^\n]*\n|[^\n]+$/g) || [];
|
|
5227
|
+
let start = 0, oldEnd = oldLines.length, newEnd = newLines.length;
|
|
5228
|
+
while (start < oldEnd && start < newEnd && oldLines[start] === newLines[start]) start++;
|
|
5229
|
+
while (oldEnd > start && newEnd > start && oldLines[oldEnd - 1] === newLines[newEnd - 1]) {
|
|
5230
|
+
oldEnd--;
|
|
5231
|
+
newEnd--;
|
|
5232
|
+
}
|
|
5233
|
+
const removed = oldEnd - start, added = newEnd - start;
|
|
5234
|
+
if (!removed || !added) return { diff: { removed, added } };
|
|
5235
|
+
|
|
5236
|
+
// Myers shortest edit distance needs only a frontier when reporting counts, not a patch.
|
|
5237
|
+
// Bound the optional quadratic search on broad rewrites; never limit the edit itself.
|
|
5238
|
+
const maxDistance = Math.min(removed + added, 2000);
|
|
5239
|
+
const offset = maxDistance + 1;
|
|
5240
|
+
const frontier = new Int32Array(2 * maxDistance + 3);
|
|
5241
|
+
let work = 0;
|
|
5242
|
+
for (let distance = 0; distance <= maxDistance; distance++) {
|
|
5243
|
+
for (let diagonal = -distance; diagonal <= distance; diagonal += 2) {
|
|
5244
|
+
if (++work > 1000000) return { diffUnavailable: 'comparison_budget_exceeded' };
|
|
5245
|
+
const index = offset + diagonal;
|
|
5246
|
+
let x = diagonal === -distance || (diagonal !== distance && frontier[index - 1] < frontier[index + 1])
|
|
5247
|
+
? frontier[index + 1]
|
|
5248
|
+
: frontier[index - 1] + 1;
|
|
5249
|
+
let y = x - diagonal;
|
|
5250
|
+
while (x < removed && y < added && oldLines[start + x] === newLines[start + y]) {
|
|
5251
|
+
if (++work > 1000000) return { diffUnavailable: 'comparison_budget_exceeded' };
|
|
5252
|
+
x++;
|
|
5253
|
+
y++;
|
|
5254
|
+
}
|
|
5255
|
+
if (x >= removed && y >= added) {
|
|
5256
|
+
return { diff: { removed: (distance + removed - added) / 2, added: (distance + added - removed) / 2 } };
|
|
5257
|
+
}
|
|
5258
|
+
frontier[index] = x;
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
return { diffUnavailable: 'comparison_budget_exceeded' };
|
|
5262
|
+
}
|
|
5263
|
+
`;
|
|
5264
|
+
|
|
5265
|
+
/** Compare actual file contents inside the sandbox; reporting must never prevent an edit. */ function buildEditCommand(filePath, oldString, newString, replaceAll) {
|
|
5266
|
+
const encoded = Buffer.from(JSON.stringify({
|
|
5267
|
+
filePath,
|
|
5268
|
+
oldString,
|
|
5269
|
+
newString,
|
|
5270
|
+
replaceAll
|
|
5271
|
+
})).toString('base64');
|
|
5272
|
+
const script = `
|
|
5273
|
+
const fs = require('node:fs');
|
|
5274
|
+
const input = JSON.parse(Buffer.from('${encoded}', 'base64').toString('utf8'));
|
|
5275
|
+
const lines = text => text.length ? text.split('\\n').length - Number(text.endsWith('\\n')) : 0;
|
|
5276
|
+
const metrics = { oldLines: lines(input.oldString), newLines: lines(input.newString) };
|
|
5277
|
+
|
|
5278
|
+
${FILE_EDIT_DIFF_SCRIPT}
|
|
5279
|
+
|
|
5280
|
+
function unchanged(exitCode) {
|
|
5281
|
+
console.log(JSON.stringify({ ...metrics, occurrences: 0, changed: false, diff: { removed: 0, added: 0 } }));
|
|
5282
|
+
process.exit(exitCode);
|
|
5283
|
+
}
|
|
5284
|
+
let before;
|
|
5285
|
+
try { before = fs.readFileSync(input.filePath, 'utf8'); } catch { unchanged(3); }
|
|
5286
|
+
const occurrences = before.split(input.oldString).length - 1;
|
|
5287
|
+
if (occurrences === 0) unchanged(1);
|
|
5288
|
+
if (occurrences > 1 && !input.replaceAll) unchanged(2);
|
|
5289
|
+
const after = before.split(input.oldString).join(input.newString);
|
|
5290
|
+
const changed = before !== after;
|
|
5291
|
+
if (changed) fs.writeFileSync(input.filePath, after, 'utf8');
|
|
5292
|
+
try {
|
|
5293
|
+
Object.assign(metrics, inspectLineDiff(before, after));
|
|
5294
|
+
} catch {
|
|
5295
|
+
metrics.diffUnavailable = 'diff_unavailable';
|
|
5296
|
+
}
|
|
5297
|
+
console.log(JSON.stringify({ ...metrics, occurrences, changed }));
|
|
5298
|
+
`;
|
|
5299
|
+
return `node -e '${script.replace(/'/g, "'\\''")}'`;
|
|
5300
|
+
}
|
|
5301
|
+
|
|
5031
5302
|
const MAX_LINE_LENGTH = 500;
|
|
5032
5303
|
const MAX_GREP_LINE_LENGTH = 2000;
|
|
5033
5304
|
const GREP_RESULT_LIMIT = 100;
|
|
@@ -5527,41 +5798,6 @@ fs.appendFileSync(filePath, content, 'utf-8');
|
|
|
5527
5798
|
console.log('OK');
|
|
5528
5799
|
"`;
|
|
5529
5800
|
}
|
|
5530
|
-
/**
|
|
5531
|
-
* Node.js command template for editing files.
|
|
5532
|
-
*/ function buildEditCommand(filePath, oldStr, newStr, replaceAll) {
|
|
5533
|
-
const pathB64 = utf8ToBase64(filePath);
|
|
5534
|
-
const oldB64 = utf8ToBase64(oldStr);
|
|
5535
|
-
const newB64 = utf8ToBase64(newStr);
|
|
5536
|
-
return `node -e "
|
|
5537
|
-
const fs = require('fs');
|
|
5538
|
-
|
|
5539
|
-
const filePath = Buffer.from('${pathB64}', 'base64').toString('utf-8');
|
|
5540
|
-
const oldStr = Buffer.from('${oldB64}', 'base64').toString('utf-8');
|
|
5541
|
-
const newStr = Buffer.from('${newB64}', 'base64').toString('utf-8');
|
|
5542
|
-
const replaceAll = ${Boolean(replaceAll)};
|
|
5543
|
-
|
|
5544
|
-
let text;
|
|
5545
|
-
try {
|
|
5546
|
-
text = fs.readFileSync(filePath, 'utf-8');
|
|
5547
|
-
} catch (e) {
|
|
5548
|
-
process.exit(3);
|
|
5549
|
-
}
|
|
5550
|
-
|
|
5551
|
-
const count = text.split(oldStr).length - 1;
|
|
5552
|
-
|
|
5553
|
-
if (count === 0) {
|
|
5554
|
-
process.exit(1);
|
|
5555
|
-
}
|
|
5556
|
-
if (count > 1 && !replaceAll) {
|
|
5557
|
-
process.exit(2);
|
|
5558
|
-
}
|
|
5559
|
-
|
|
5560
|
-
const result = text.split(oldStr).join(newStr);
|
|
5561
|
-
fs.writeFileSync(filePath, result, 'utf-8');
|
|
5562
|
-
console.log(count);
|
|
5563
|
-
"`;
|
|
5564
|
-
}
|
|
5565
5801
|
/**
|
|
5566
5802
|
* Node.js command template for grep operations.
|
|
5567
5803
|
*/ function buildGrepCommand(pattern, searchPath, globPattern) {
|
|
@@ -6021,6 +6257,8 @@ function normalizePluginJobProcessorMetadata(options) {
|
|
|
6021
6257
|
pluginName,
|
|
6022
6258
|
queueName,
|
|
6023
6259
|
jobName
|
|
6260
|
+
}, options.controlContract === undefined ? {} : {
|
|
6261
|
+
controlContract: requireManagedQueueDecoratorValue(options.controlContract, 'controlContract')
|
|
6024
6262
|
}, concurrency === undefined ? {} : {
|
|
6025
6263
|
concurrency: Math.trunc(concurrency)
|
|
6026
6264
|
});
|
|
@@ -6585,6 +6823,68 @@ exports.CollaborationDocumentProviderRegistry = __decorate([
|
|
|
6585
6823
|
])
|
|
6586
6824
|
], exports.CollaborationDocumentProviderRegistry);
|
|
6587
6825
|
|
|
6826
|
+
const ContentDocumentsRuntimeCapability = modelProvider.createRuntimeCapability('platform.content.documents', {
|
|
6827
|
+
description: 'Project file-backed editor sessions, versioned publication and Assistant review.'
|
|
6828
|
+
});
|
|
6829
|
+
|
|
6830
|
+
const ContentReferencesRuntimeCapability = modelProvider.createRuntimeCapability('platform.content.references', {
|
|
6831
|
+
description: 'Authorized durable document references; plugins provide source-specific listing and files.'
|
|
6832
|
+
});
|
|
6833
|
+
|
|
6834
|
+
/** Matching semantic type alone never grants a writer access to an incompatible native model. */ function supportsContentModel(editor, model, access) {
|
|
6835
|
+
return editor.supports.some((item)=>item.typeId === model.typeId && item.modelId === model.modelId && item.schemaVersion === model.schemaVersion && item.editProtocol.id === model.editProtocol.id && item.editProtocol.version === model.editProtocol.version && item.access.includes(access));
|
|
6836
|
+
}
|
|
6837
|
+
|
|
6838
|
+
function isTextContentEditor(provider) {
|
|
6839
|
+
return provider.descriptor.kind === 'text-document';
|
|
6840
|
+
}
|
|
6841
|
+
function isFileContentEditor(provider) {
|
|
6842
|
+
return provider.descriptor.kind === 'file';
|
|
6843
|
+
}
|
|
6844
|
+
function isResourceContentEditor(provider) {
|
|
6845
|
+
return provider.descriptor.kind === 'resource';
|
|
6846
|
+
}
|
|
6847
|
+
const EDITOR_PROVIDER = 'XPERT_CONTENT_EDITOR_PROVIDER';
|
|
6848
|
+
const ContentEditorProvider = (key)=>common.applyDecorators(common.SetMetadata(EDITOR_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, EDITOR_PROVIDER));
|
|
6849
|
+
exports.ContentEditorRegistry = class ContentEditorRegistry extends BaseStrategyRegistry {
|
|
6850
|
+
getTextModel(key, organizationId) {
|
|
6851
|
+
const provider = this.get(key, organizationId);
|
|
6852
|
+
if (!isTextContentEditor(provider)) throw new Error('Editor does not implement the text document protocol');
|
|
6853
|
+
return provider;
|
|
6854
|
+
}
|
|
6855
|
+
constructor(discovery, reflector){
|
|
6856
|
+
super(EDITOR_PROVIDER, discovery, reflector);
|
|
6857
|
+
}
|
|
6858
|
+
};
|
|
6859
|
+
exports.ContentEditorRegistry = __decorate([
|
|
6860
|
+
common.Injectable(),
|
|
6861
|
+
__metadata("design:paramtypes", [
|
|
6862
|
+
core.DiscoveryService,
|
|
6863
|
+
core.Reflector
|
|
6864
|
+
])
|
|
6865
|
+
], exports.ContentEditorRegistry);
|
|
6866
|
+
const ContentEditorsRuntimeCapability = modelProvider.createRuntimeCapability('platform.content.editors', {
|
|
6867
|
+
description: 'Discover editors, resolve authorized resources and exchange versioned file bytes without format-specific models.'
|
|
6868
|
+
});
|
|
6869
|
+
|
|
6870
|
+
const CONTENT_RESOURCE_PROVIDER = 'XPERT_CONTENT_RESOURCE_PROVIDER';
|
|
6871
|
+
const ContentResourceProvider = (key)=>common.applyDecorators(common.SetMetadata(CONTENT_RESOURCE_PROVIDER, key), common.SetMetadata(STRATEGY_META_KEY, CONTENT_RESOURCE_PROVIDER));
|
|
6872
|
+
exports.ContentResourceProviderRegistry = class ContentResourceProviderRegistry extends BaseStrategyRegistry {
|
|
6873
|
+
constructor(discovery, reflector){
|
|
6874
|
+
super(CONTENT_RESOURCE_PROVIDER, discovery, reflector);
|
|
6875
|
+
}
|
|
6876
|
+
};
|
|
6877
|
+
exports.ContentResourceProviderRegistry = __decorate([
|
|
6878
|
+
common.Injectable(),
|
|
6879
|
+
__metadata("design:paramtypes", [
|
|
6880
|
+
core.DiscoveryService,
|
|
6881
|
+
core.Reflector
|
|
6882
|
+
])
|
|
6883
|
+
], exports.ContentResourceProviderRegistry);
|
|
6884
|
+
const ContentResourcesRuntimeCapability = modelProvider.createRuntimeCapability('platform.content.resources', {
|
|
6885
|
+
description: 'Current organization identities and plugin-owned content authorization.'
|
|
6886
|
+
});
|
|
6887
|
+
|
|
6588
6888
|
const EVOLUTION_TARGET_PROVIDER = 'EVOLUTION_TARGET_PROVIDER';
|
|
6589
6889
|
const EvolutionTargetProviderStrategy = (providerKey)=>common.applyDecorators(common.SetMetadata(EVOLUTION_TARGET_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, EVOLUTION_TARGET_PROVIDER));
|
|
6590
6890
|
|
|
@@ -10444,18 +10744,104 @@ const ProjectTasksRuntimeCapability = modelProvider.createRuntimeCapability('pla
|
|
|
10444
10744
|
description: 'Read project task graphs, request background synchronization, manage schedules, and resolve exact execution conversations.'
|
|
10445
10745
|
});
|
|
10446
10746
|
|
|
10747
|
+
class UnavailablePipelineContribution {
|
|
10748
|
+
constructor(metatype, issues){
|
|
10749
|
+
this.metatype = metatype;
|
|
10750
|
+
this.issues = issues;
|
|
10751
|
+
}
|
|
10752
|
+
}
|
|
10753
|
+
function pipelineContributionIssues(error) {
|
|
10754
|
+
// Do not log schema messages or input values, which may contain plugin configuration secrets.
|
|
10755
|
+
return error.issues.slice(0, 20).map(({ path, code })=>({
|
|
10756
|
+
path,
|
|
10757
|
+
code
|
|
10758
|
+
}));
|
|
10759
|
+
}
|
|
10760
|
+
function isolatePipelineContribution(target) {
|
|
10761
|
+
function IsolatedContribution(...args) {
|
|
10762
|
+
try {
|
|
10763
|
+
return Reflect.construct(target, args, new.target);
|
|
10764
|
+
} catch (error) {
|
|
10765
|
+
if (!Reflect.getMetadata(PLUGIN_METADATA_KEY, new.target) || !(error instanceof v3.z.ZodError)) throw error;
|
|
10766
|
+
return new UnavailablePipelineContribution(new.target, pipelineContributionIssues(error));
|
|
10767
|
+
}
|
|
10768
|
+
}
|
|
10769
|
+
Object.setPrototypeOf(IsolatedContribution, target);
|
|
10770
|
+
IsolatedContribution.prototype = Object.create(target.prototype, {
|
|
10771
|
+
constructor: {
|
|
10772
|
+
value: IsolatedContribution,
|
|
10773
|
+
writable: true,
|
|
10774
|
+
configurable: true
|
|
10775
|
+
}
|
|
10776
|
+
});
|
|
10777
|
+
Object.defineProperty(IsolatedContribution, 'name', {
|
|
10778
|
+
value: target.name
|
|
10779
|
+
});
|
|
10780
|
+
// A class decorator must preserve the caller's constructor type; Reflect.construct preserves its arguments.
|
|
10781
|
+
return IsolatedContribution;
|
|
10782
|
+
}
|
|
10783
|
+
|
|
10784
|
+
var ProjectPipelineContributionRegistry_1;
|
|
10447
10785
|
const PROJECT_PIPELINE_CONTRIBUTION = 'PROJECT_PIPELINE_CONTRIBUTION';
|
|
10448
|
-
const ProjectPipelineContributor = (key)=>
|
|
10449
|
-
|
|
10786
|
+
const ProjectPipelineContributor = (key)=>(target)=>{
|
|
10787
|
+
common.applyDecorators(common.SetMetadata(PROJECT_PIPELINE_CONTRIBUTION, key), common.SetMetadata(STRATEGY_META_KEY, PROJECT_PIPELINE_CONTRIBUTION))(target);
|
|
10788
|
+
return isolatePipelineContribution(target);
|
|
10789
|
+
};
|
|
10790
|
+
exports.ProjectPipelineContributionRegistry = ProjectPipelineContributionRegistry_1 = class ProjectPipelineContributionRegistry extends BaseStrategyRegistry {
|
|
10450
10791
|
upsert(instance) {
|
|
10451
10792
|
const target = resolveStrategyMetadataTarget(instance);
|
|
10452
10793
|
const key = target ? this.reflector.get(PROJECT_PIPELINE_CONTRIBUTION, target) : undefined;
|
|
10453
10794
|
if (!key) return;
|
|
10454
|
-
const
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10795
|
+
const source = this.getSource(instance);
|
|
10796
|
+
try {
|
|
10797
|
+
if (instance instanceof UnavailablePipelineContribution) {
|
|
10798
|
+
this.rejectContribution(key, source, instance.issues);
|
|
10799
|
+
return;
|
|
10800
|
+
}
|
|
10801
|
+
const contribution = contracts.projectPipelineContributionSchema.parse(instance);
|
|
10802
|
+
if (key !== contribution.key) throw new Error('PIPELINE_CONTRIBUTION_KEY_MISMATCH');
|
|
10803
|
+
// Parsing validates public fields before preserving loader provenance.
|
|
10804
|
+
this.registerParsed(key, instance, contribution, source);
|
|
10805
|
+
this.failures.delete(this.failureIdentity(key, source));
|
|
10806
|
+
} catch (error) {
|
|
10807
|
+
if (source.kind !== 'plugin' || !(error instanceof v3.z.ZodError)) throw error;
|
|
10808
|
+
this.rejectContribution(key, source, pipelineContributionIssues(error));
|
|
10809
|
+
}
|
|
10810
|
+
}
|
|
10811
|
+
getRegistrationFailures() {
|
|
10812
|
+
return structuredClone([
|
|
10813
|
+
...this.failures.values()
|
|
10814
|
+
]);
|
|
10815
|
+
}
|
|
10816
|
+
remove(scopeKey, pluginName) {
|
|
10817
|
+
super.remove(scopeKey, pluginName);
|
|
10818
|
+
for (const [identity, failure] of this.failures){
|
|
10819
|
+
if (failure.source.scopeKey === scopeKey && failure.source.pluginName === pluginName) this.failures.delete(identity);
|
|
10820
|
+
}
|
|
10821
|
+
}
|
|
10822
|
+
failureIdentity(key, source) {
|
|
10823
|
+
return JSON.stringify([
|
|
10824
|
+
source.scopeKey,
|
|
10825
|
+
source.kind === 'plugin' ? source.pluginName : null,
|
|
10826
|
+
key
|
|
10827
|
+
]);
|
|
10828
|
+
}
|
|
10829
|
+
rejectContribution(key, source, issues) {
|
|
10830
|
+
var _this_strategies_get;
|
|
10831
|
+
if (source.kind !== 'plugin') throw new Error('PIPELINE_CONTRIBUTION_INVALID');
|
|
10832
|
+
const previous = (_this_strategies_get = this.strategies.get(source.scopeKey)) == null ? void 0 : _this_strategies_get.get(key);
|
|
10833
|
+
if (previous) {
|
|
10834
|
+
const owner = this.getSource(previous);
|
|
10835
|
+
if (owner.kind === 'plugin' && owner.pluginName === source.pluginName) this.unregister(key, source, previous);
|
|
10836
|
+
}
|
|
10837
|
+
const failure = {
|
|
10838
|
+
key,
|
|
10839
|
+
source,
|
|
10840
|
+
code: 'PIPELINE_CONTRIBUTION_INVALID',
|
|
10841
|
+
issues
|
|
10842
|
+
};
|
|
10843
|
+
this.failures.set(this.failureIdentity(key, source), failure);
|
|
10844
|
+
this.failureLogger.error(failure);
|
|
10459
10845
|
}
|
|
10460
10846
|
register(key, contribution, source) {
|
|
10461
10847
|
return this.registerParsed(key, contribution, contracts.projectPipelineContributionSchema.parse(contribution), source);
|
|
@@ -10519,9 +10905,11 @@ exports.ProjectPipelineContributionRegistry = class ProjectPipelineContributionR
|
|
|
10519
10905
|
constructor(discovery, reflector){
|
|
10520
10906
|
super(PROJECT_PIPELINE_CONTRIBUTION, discovery, reflector);
|
|
10521
10907
|
this.parsedContributions = new WeakMap();
|
|
10908
|
+
this.failures = new Map();
|
|
10909
|
+
this.failureLogger = new common.Logger(ProjectPipelineContributionRegistry_1.name);
|
|
10522
10910
|
}
|
|
10523
10911
|
};
|
|
10524
|
-
exports.ProjectPipelineContributionRegistry = __decorate([
|
|
10912
|
+
exports.ProjectPipelineContributionRegistry = ProjectPipelineContributionRegistry_1 = __decorate([
|
|
10525
10913
|
common.Injectable(),
|
|
10526
10914
|
__metadata("design:paramtypes", [
|
|
10527
10915
|
core.DiscoveryService,
|
|
@@ -10754,6 +11142,7 @@ exports.ActorTokenRuntimeCapability = modelProvider.ActorTokenRuntimeCapability;
|
|
|
10754
11142
|
exports.ActorTokenRuntimeFactoryCapability = modelProvider.ActorTokenRuntimeFactoryCapability;
|
|
10755
11143
|
exports.ArtifactDraftsRuntimeCapability = modelProvider.ArtifactDraftsRuntimeCapability;
|
|
10756
11144
|
exports.ArtifactsRuntimeCapability = modelProvider.ArtifactsRuntimeCapability;
|
|
11145
|
+
exports.AssistantMiddlewareAccessRuntimeCapability = modelProvider.AssistantMiddlewareAccessRuntimeCapability;
|
|
10757
11146
|
exports.BaseTool = modelProvider.BaseTool;
|
|
10758
11147
|
exports.BaseToolset = modelProvider.BaseToolset;
|
|
10759
11148
|
exports.BuiltinToolset = modelProvider.BuiltinToolset;
|
|
@@ -10762,6 +11151,8 @@ exports.DefaultRuntimeCapabilityRegistry = modelProvider.DefaultRuntimeCapabilit
|
|
|
10762
11151
|
exports.McpClientRuntimeCapability = modelProvider.McpClientRuntimeCapability;
|
|
10763
11152
|
exports.ModelProviderBuiltinToolset = modelProvider.ModelProviderBuiltinToolset;
|
|
10764
11153
|
exports.ProjectAccessRuntimeCapability = modelProvider.ProjectAccessRuntimeCapability;
|
|
11154
|
+
exports.ProjectFilesRuntimeCapability = modelProvider.ProjectFilesRuntimeCapability;
|
|
11155
|
+
exports.ProjectKnowledgeRuntimeCapability = modelProvider.ProjectKnowledgeRuntimeCapability;
|
|
10765
11156
|
exports.ProjectProvisioningRuntimeCapability = modelProvider.ProjectProvisioningRuntimeCapability;
|
|
10766
11157
|
exports.RUNTIME_CAPABILITY_PROVIDER = modelProvider.RUNTIME_CAPABILITY_PROVIDER;
|
|
10767
11158
|
exports.RestClientRuntimeCapability = modelProvider.RestClientRuntimeCapability;
|
|
@@ -10820,6 +11211,7 @@ exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SE
|
|
|
10820
11211
|
exports.AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING;
|
|
10821
11212
|
exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
|
|
10822
11213
|
exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
|
|
11214
|
+
exports.AGENT_PROCESS_SUPERVISOR = AGENT_PROCESS_SUPERVISOR;
|
|
10823
11215
|
exports.AGENT_RUNTIME_EVENT_MESSAGE_TYPE = AGENT_RUNTIME_EVENT_MESSAGE_TYPE;
|
|
10824
11216
|
exports.AGENT_RUNTIME_STRATEGY = AGENT_RUNTIME_STRATEGY;
|
|
10825
11217
|
exports.AIModelProviderNotFoundException = AIModelProviderNotFoundException;
|
|
@@ -10833,6 +11225,7 @@ exports.AgentExecutionRunnerCapability = AgentExecutionRunnerCapability;
|
|
|
10833
11225
|
exports.AgentExecutionRunnerFactoryCapability = AgentExecutionRunnerFactoryCapability;
|
|
10834
11226
|
exports.AgentInvocationRuntimeCapability = AgentInvocationRuntimeCapability;
|
|
10835
11227
|
exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
|
|
11228
|
+
exports.AgentRuntimeDeploymentCapability = AgentRuntimeDeploymentCapability;
|
|
10836
11229
|
exports.AgentRuntimeFactoryCapability = AgentRuntimeFactoryCapability;
|
|
10837
11230
|
exports.AgentRuntimeStrategy = AgentRuntimeStrategy;
|
|
10838
11231
|
exports.AiModelNotFoundException = AiModelNotFoundException;
|
|
@@ -10855,6 +11248,7 @@ exports.CLI_MODEL_TOKEN_REFERENCE = CLI_MODEL_TOKEN_REFERENCE;
|
|
|
10855
11248
|
exports.COLLABORATION_DOCUMENT_PROVIDER = COLLABORATION_DOCUMENT_PROVIDER;
|
|
10856
11249
|
exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
|
|
10857
11250
|
exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
|
|
11251
|
+
exports.CONTENT_RESOURCE_PROVIDER = CONTENT_RESOURCE_PROVIDER;
|
|
10858
11252
|
exports.CancelConversationCommand = CancelConversationCommand;
|
|
10859
11253
|
exports.ChatChannel = ChatChannel;
|
|
10860
11254
|
exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
|
|
@@ -10862,9 +11256,16 @@ exports.CliModelProfilesCapability = CliModelProfilesCapability;
|
|
|
10862
11256
|
exports.CollaborationDocumentProvider = CollaborationDocumentProvider;
|
|
10863
11257
|
exports.CollaborationRuntimeCapability = CollaborationRuntimeCapability;
|
|
10864
11258
|
exports.CommonParameterRules = CommonParameterRules;
|
|
11259
|
+
exports.ConnectorDocumentsRuntimeCapability = ConnectorDocumentsRuntimeCapability;
|
|
10865
11260
|
exports.ConnectorRuntimeCapability = ConnectorRuntimeCapability;
|
|
10866
11261
|
exports.ConnectorRuntimeFactoryCapability = ConnectorRuntimeFactoryCapability;
|
|
10867
11262
|
exports.ConnectorStrategyKey = ConnectorStrategyKey;
|
|
11263
|
+
exports.ContentDocumentsRuntimeCapability = ContentDocumentsRuntimeCapability;
|
|
11264
|
+
exports.ContentEditorProvider = ContentEditorProvider;
|
|
11265
|
+
exports.ContentEditorsRuntimeCapability = ContentEditorsRuntimeCapability;
|
|
11266
|
+
exports.ContentReferencesRuntimeCapability = ContentReferencesRuntimeCapability;
|
|
11267
|
+
exports.ContentResourceProvider = ContentResourceProvider;
|
|
11268
|
+
exports.ContentResourcesRuntimeCapability = ContentResourcesRuntimeCapability;
|
|
10868
11269
|
exports.CreateModelClientCommand = CreateModelClientCommand;
|
|
10869
11270
|
exports.CredentialsValidateFailedError = CredentialsValidateFailedError;
|
|
10870
11271
|
exports.DATASOURCE_STRATEGY = DATASOURCE_STRATEGY;
|
|
@@ -11036,6 +11437,7 @@ exports.XpertToolProvider = XpertToolProvider;
|
|
|
11036
11437
|
exports.agentInvocationDispatchContextSchema = agentInvocationDispatchContextSchema;
|
|
11037
11438
|
exports.agentRuntimeConsumptionStateSchema = agentRuntimeConsumptionStateSchema;
|
|
11038
11439
|
exports.agentRuntimeDeliveryStateSchema = agentRuntimeDeliveryStateSchema;
|
|
11440
|
+
exports.agentRuntimeDeploymentSpecSchema = agentRuntimeDeploymentSpecSchema;
|
|
11039
11441
|
exports.agentRuntimeEventMessageId = agentRuntimeEventMessageId;
|
|
11040
11442
|
exports.agentRuntimeEventSchema = agentRuntimeEventSchema;
|
|
11041
11443
|
exports.agentRuntimeReplyTargetSchema = agentRuntimeReplyTargetSchema;
|
|
@@ -11043,6 +11445,7 @@ exports.agentRuntimeResultClaimSchema = agentRuntimeResultClaimSchema;
|
|
|
11043
11445
|
exports.agentRuntimeResultConsumptionKey = agentRuntimeResultConsumptionKey;
|
|
11044
11446
|
exports.als = als;
|
|
11045
11447
|
exports.appendSandboxMessage = appendSandboxMessage;
|
|
11448
|
+
exports.applyAssistantMiddleware = applyAssistantMiddleware;
|
|
11046
11449
|
exports.applyModelConfiguration = applyModelConfiguration;
|
|
11047
11450
|
exports.applyModelContextSize = applyModelContextSize;
|
|
11048
11451
|
exports.artifactPresentationKey = artifactPresentationKey;
|
|
@@ -11081,12 +11484,15 @@ exports.getRequestContext = getRequestContext;
|
|
|
11081
11484
|
exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
|
|
11082
11485
|
exports.getTenantGlobalScopeKey = getTenantGlobalScopeKey;
|
|
11083
11486
|
exports.getXpertToolMethod = getXpertToolMethod;
|
|
11487
|
+
exports.hasAssistantMiddleware = hasAssistantMiddleware;
|
|
11084
11488
|
exports.isAgentInvocationTerminal = isAgentInvocationTerminal;
|
|
11085
11489
|
exports.isDevelopmentSandboxRuntimeEnvironment = isDevelopmentSandboxRuntimeEnvironment;
|
|
11490
|
+
exports.isFileContentEditor = isFileContentEditor;
|
|
11086
11491
|
exports.isModelOutputValidationError = isModelOutputValidationError;
|
|
11087
11492
|
exports.isModelUsagePricingConfig = isModelUsagePricingConfig;
|
|
11088
11493
|
exports.isPluginArtifactNamespace = isPluginArtifactNamespace;
|
|
11089
11494
|
exports.isRemoteFile = isRemoteFile;
|
|
11495
|
+
exports.isResourceContentEditor = isResourceContentEditor;
|
|
11090
11496
|
exports.isSandboxBackend = isSandboxBackend;
|
|
11091
11497
|
exports.isSandboxManagedServiceAdapter = isSandboxManagedServiceAdapter;
|
|
11092
11498
|
exports.isSandboxServiceProxyAdapter = isSandboxServiceProxyAdapter;
|
|
@@ -11094,9 +11500,11 @@ exports.isSandboxTerminalAdapter = isSandboxTerminalAdapter;
|
|
|
11094
11500
|
exports.isStrategyInstance = isStrategyInstance;
|
|
11095
11501
|
exports.isStructuredMessageType = isStructuredMessageType;
|
|
11096
11502
|
exports.isTenantGlobalScopeKey = isTenantGlobalScopeKey;
|
|
11503
|
+
exports.isTextContentEditor = isTextContentEditor;
|
|
11097
11504
|
exports.jsonEncodedSchema = jsonEncodedSchema;
|
|
11098
11505
|
exports.knowledgebaseActions = knowledgebaseActions;
|
|
11099
11506
|
exports.loadYamlFile = loadYamlFile;
|
|
11507
|
+
exports.managedAgentRuntimeSchema = managedAgentRuntimeSchema;
|
|
11100
11508
|
exports.mergeCredentials = mergeCredentials;
|
|
11101
11509
|
exports.mergeModelRequirements = mergeModelRequirements;
|
|
11102
11510
|
exports.mergeParentChildChunks = mergeParentChildChunks;
|
|
@@ -11126,6 +11534,7 @@ exports.runtimeToolProviderComponent = runtimeToolProviderComponent;
|
|
|
11126
11534
|
exports.secondsToMilliseconds = secondsToMilliseconds;
|
|
11127
11535
|
exports.setDefaultTenantId = setDefaultTenantId;
|
|
11128
11536
|
exports.sumTokenUsage = sumTokenUsage;
|
|
11537
|
+
exports.supportsContentModel = supportsContentModel;
|
|
11129
11538
|
exports.taskWaitReason = taskWaitReason;
|
|
11130
11539
|
exports.textTokenBoundaries = textTokenBoundaries;
|
|
11131
11540
|
exports.validateAnalyticsPayload = validateAnalyticsPayload;
|