@standardagents/builder 0.35.5 → 0.36.3
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/dist/built-in-routes.js +3243 -2114
- package/dist/built-in-routes.js.map +1 -1
- package/dist/client/{ApiKeysView-1dDvAxVS.js → ApiKeysView-CxelZw61.js} +1 -1
- package/dist/client/{CenteredContentView-DpneLOEW.js → CenteredContentView-CeQNRQH8.js} +1 -1
- package/dist/client/CompositionView-YO0nHsYV.js +32 -0
- package/dist/client/{ConfirmDialog.vue_vue_type_script_setup_true_lang-DiI1fhCg.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-_Y_F2vcO.js} +1 -1
- package/dist/client/{CopyButton.vue_vue_type_script_setup_true_lang-C_mtx_IO.js → CopyButton.vue_vue_type_script_setup_true_lang-CtC06f6H.js} +1 -1
- package/dist/client/{DataTable.vue_vue_type_script_setup_true_lang-xHY6L65e.js → DataTable.vue_vue_type_script_setup_true_lang-CqaWkS63.js} +1 -1
- package/dist/client/{JsonViewer-DZk1hmoU.js → JsonViewer-71rdOpyq.js} +1 -1
- package/dist/client/{LoginView-Jpd6CNht.js → LoginView-CkDpPh8U.js} +1 -1
- package/dist/client/{MarketplaceView-CxyxQ3eT.js → MarketplaceView-UYrMBLon.js} +1 -1
- package/dist/client/{Modal.vue_vue_type_script_setup_true_lang-Be5qsOZI.js → Modal.vue_vue_type_script_setup_true_lang-B1HPGo8o.js} +1 -1
- package/dist/client/{ModelModal.vue_vue_type_script_setup_true_lang-eYizTKcZ.js → ModelModal.vue_vue_type_script_setup_true_lang-DejoTM9W.js} +1 -1
- package/dist/client/{ModelsView-BU1zF5Zw.js → ModelsView-DKYzp2fJ.js} +1 -1
- package/dist/client/{PromptEditView-BhvxR_WM.js → PromptEditView-BlYHZ0ao.js} +1 -1
- package/dist/client/{PromptModal-D6H1VYyD.js → PromptModal-B1neRzSc.js} +1 -1
- package/dist/client/{PromptsView-DgdRXffo.js → PromptsView-C0Ez74j0.js} +1 -1
- package/dist/client/{ProvidersView-QcOzG7y7.js → ProvidersView-CFc4K0IC.js} +1 -1
- package/dist/client/{ThreadInspectorPane.vue_vue_type_script_setup_true_lang-roXBQlRw.js → ThreadInspectorPane.vue_vue_type_script_setup_true_lang-CXbSQo2-.js} +1 -1
- package/dist/client/{ThreadsView-DmsDuS1X.js → ThreadsView-B1hFXL-4.js} +1 -1
- package/dist/client/{ToolsView-Bcr6QafS.js → ToolsView-B3KqeOZD.js} +1 -1
- package/dist/client/{UsersView-Du7GQtro.js → UsersView-CF1tomjI.js} +1 -1
- package/dist/client/{VariablesView-DIdSMYXb.js → VariablesView-CP0TDspK.js} +1 -1
- package/dist/client/{index-7UIZEBvt.js → index-BTs3PMFs.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{index-BIVhZqwM.d.ts → index-DUIfQjBW.d.ts} +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +162 -11
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +7 -0
- package/dist/plugin.js.map +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +155 -11
- package/dist/runtime.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/package.json +25 -25
- package/LICENSE.txt +0 -48
- package/dist/client/CompositionView-DvzI90K5.js +0 -32
package/dist/client/index.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
27
27
|
<link rel="icon" type="image/svg+xml" href="/agents/assets/img/favicon-9uH1rb2F.svg">
|
|
28
28
|
<title>AgentBuilder Admin</title>
|
|
29
|
-
<script type="module" crossorigin src="/agents/index-
|
|
29
|
+
<script type="module" crossorigin src="/agents/index-BTs3PMFs.js"></script>
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/agents/formkit-0eyyCEP_.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/agents/vendor-TPZjEwCU.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/agents/syntax-D-ZcovVx.js">
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelDefinition, AgentDefinition } from './runtime.js';
|
|
2
2
|
export { AgentBuilderEnv, AuthContext, AuthUser, BroadcastOptions, CodeExecutionBridge, DurableAgentBuilder, DurableThread, DurableUserHub, FlowStateSdk, FlowStateWithSdk, HubClientInfo, ImageContextConfig, InjectMessageOptions, LLMProviderInterface, NamespaceResolutionError, PromptContent, PromptDefinition, PromptIncludePart, PromptPart, PromptToolConfig, Provider, ProviderContentPart, ProviderFilePart, ProviderImagePart, ProviderRegistry, ProviderTextPart, SessionToolBinding, SessionToolConfig, SideConfig, SubagentToolConfig, SubpromptConfig, ThreadRegistryEntry, ThreadWatchdog, ThreadWatchdogState, ToolConfig, UpdateThreadParams, User, WatchdogCheckin, WatchdogProbeResult, authenticate, buildImageDescription, cat, createNamespaceContext, emitThreadEvent, enhanceFlowState, exists, find, forceTurn, generateImageDescription, getFileStats, getMessages, getMessagesToSummarize, getShortName, getThumbnail, getUnsummarizedImageAttachments, getVisibleAgentNames, getVisibleModelNames, getVisiblePromptNames, getVisibleToolNames, grep, hasImageAttachments, head, injectMessage, isQualifiedName, linkFile, mkdir, move, optimizeImageContext, parseQualifiedName, qualifyName, queueTool, readFile, readdir, reloadHistory, rename, replaceImagesWithDescriptions, requireAdmin, requireAuth, resolveAgent, resolveHook, resolveModel, resolvePrompt, resolveTool, rmdir, stat, tail, unlink, updateThread, writeFile, writeImage } from './runtime.js';
|
|
3
3
|
export { AgentPluginOptions, agentbuilder, builder } from './plugin.js';
|
|
4
|
-
export { A as Agent, x as AttachmentRef, f as BuilderThreadEndpointHandler, C as CLIENT_STREAM_CHUNK_BYTES, o as ClientDuplex, p as ClientForwarding, m as ClientStreamRequest, n as ClientStreamResponse, k as ClientToolRequest, l as ClientToolResponse, B as Controller, a as ControllerContext, E as Env, w as FileRecord, y as FileStats, u as FlowResult, F as FlowState, G as GrepResult, D as ImageContentPart, I as ImageMetadata, L as LLMResponse, M as Message, J as MessageContent, H as MultimodalContent, R as RequestContext, S as StorageBackend, v as TelemetryEvent, z as TextContentPart, b as ThreadEndpointContext, e as ThreadEnv, q as ThreadInstance, r as ThreadMetadata, T as ToolCall, t as ToolResult, g as callClient, h as callClientStream, c as createThreadEndpointHandler, j as decodeStreamChunk, d as defineController, i as encodeStreamChunk, s as supportsClientForwarding } from './index-
|
|
4
|
+
export { A as Agent, x as AttachmentRef, f as BuilderThreadEndpointHandler, C as CLIENT_STREAM_CHUNK_BYTES, o as ClientDuplex, p as ClientForwarding, m as ClientStreamRequest, n as ClientStreamResponse, k as ClientToolRequest, l as ClientToolResponse, B as Controller, a as ControllerContext, E as Env, w as FileRecord, y as FileStats, u as FlowResult, F as FlowState, G as GrepResult, D as ImageContentPart, I as ImageMetadata, L as LLMResponse, M as Message, J as MessageContent, H as MultimodalContent, R as RequestContext, S as StorageBackend, v as TelemetryEvent, z as TextContentPart, b as ThreadEndpointContext, e as ThreadEnv, q as ThreadInstance, r as ThreadMetadata, T as ToolCall, t as ToolResult, g as callClient, h as callClientStream, c as createThreadEndpointHandler, j as decodeStreamChunk, d as defineController, i as encodeStreamChunk, s as supportsClientForwarding } from './index-DUIfQjBW.js';
|
|
5
5
|
export { AgentType, DefinitionLoader, GlobalNamespaceContext, HookSignatures, ImageContent, ModelCapabilities, ModelProvider, NamespaceContext, PackageSignature, PackedExports, PackedMeta, PackedMetadata, PackedNamespaceContext, PromptInput, PromptTextPart, ProviderAssistantMessage, ProviderConfigSlot, ProviderConfigSlots, ProviderConfigValueSource, ProviderDefinition, ProviderError, ProviderErrorCode, ProviderFactory, ProviderFactoryConfig, ProviderFinishReason, ProviderGeneratedImage, ProviderMessage, ProviderMessageContent, ProviderMethodOverrides, ModelCapabilities as ProviderModelCapabilities, ProviderOverride, ProviderOverrideContext, ProviderReasoningDetail, ProviderRequest, ProviderResponse, ProviderStreamChunk, ProviderSyncOverride, ProviderSystemMessage, ProviderTool, ProviderToolCallPart, ProviderToolMessage, ProviderToolResultContent, ProviderUsage, ProviderUserMessage, ReasoningConfig, StructuredPrompt, TextContent, Tool, ToolArgs, ToolArgsNode, ToolArgsRawShape, ToolContent, belongsToPackage, defineAgent, defineHook, defineModel, definePrompt, defineProvider, defineTool, isPacked, isVisibleInNamespace, mapReasoningLevel, providerConst, providerEnv, providerValue } from '@standardagents/spec';
|
|
6
6
|
export { C as ConstituentItem, D as DiscoveredPackage, N as NamespacedRegistry, P as PackingAnalysis, a as PackingOptions, b as PackingResult, c as UnpackOptions, d as UnpackResult } from './types-Bpe7IANZ.js';
|
|
7
7
|
export { D as DiscoveryConfig, P as PackageDiscoveryService, d as discoverPackages } from './discovery-DiMJWisl.js';
|
package/dist/index.js
CHANGED
|
@@ -940,12 +940,23 @@ function resolvePlatformRouting(providerName, env) {
|
|
|
940
940
|
baseUrl: `${origin}/v1/proxy/${encodeURIComponent(provider)}${basePath}`
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
|
+
function platformProviderFactoryConfig(providerName, routing) {
|
|
944
|
+
const config = {
|
|
945
|
+
apiKey: routing.apiKey,
|
|
946
|
+
baseUrl: routing.baseUrl
|
|
947
|
+
};
|
|
948
|
+
if (providerName.toLowerCase() === "deepinfra") {
|
|
949
|
+
config.modelsUrl = `${routing.origin}/v1/proxy/deepinfra/models`;
|
|
950
|
+
}
|
|
951
|
+
return config;
|
|
952
|
+
}
|
|
943
953
|
var DEFAULT_PLATFORM_PROXY_ORIGIN, PROVIDER_BASE_PATHS;
|
|
944
954
|
var init_platform_routing = __esm({
|
|
945
955
|
"src/agents/providers/platform-routing.ts"() {
|
|
946
956
|
DEFAULT_PLATFORM_PROXY_ORIGIN = "https://api.standardagents.ai";
|
|
947
957
|
PROVIDER_BASE_PATHS = {
|
|
948
|
-
cloudflare: "/ai/v1"
|
|
958
|
+
cloudflare: "/ai/v1",
|
|
959
|
+
deepinfra: "/openai"
|
|
949
960
|
};
|
|
950
961
|
}
|
|
951
962
|
});
|
|
@@ -1238,10 +1249,7 @@ var init_ProviderRegistry = __esm({
|
|
|
1238
1249
|
}
|
|
1239
1250
|
const routing = resolvePlatformRouting(providerName, env);
|
|
1240
1251
|
if (routing) {
|
|
1241
|
-
const config =
|
|
1242
|
-
apiKey: routing.apiKey,
|
|
1243
|
-
baseUrl: routing.baseUrl
|
|
1244
|
-
};
|
|
1252
|
+
const config = platformProviderFactoryConfig(providerName, routing);
|
|
1245
1253
|
registerPlatformProxyOrigin(routing.origin);
|
|
1246
1254
|
const fingerprint = this.getProviderFingerprint(`platform:${providerName}`, modelDef, config);
|
|
1247
1255
|
const cached = this.providerCache.get(modelName);
|
|
@@ -1277,6 +1285,7 @@ var init_ProviderRegistry = __esm({
|
|
|
1277
1285
|
google: "GOOGLE_API_KEY",
|
|
1278
1286
|
groq: "GROQ_API_KEY",
|
|
1279
1287
|
novita: "NOVITA_API_KEY",
|
|
1288
|
+
deepinfra: "DEEPINFRA_API_KEY",
|
|
1280
1289
|
openai: "OPENAI_API_KEY",
|
|
1281
1290
|
openrouter: "OPENROUTER_API_KEY",
|
|
1282
1291
|
anthropic: "ANTHROPIC_API_KEY",
|
|
@@ -1714,7 +1723,9 @@ function buildRequestBody(context, modelDef) {
|
|
|
1714
1723
|
messages: requestMessages,
|
|
1715
1724
|
tools,
|
|
1716
1725
|
toolChoice,
|
|
1717
|
-
|
|
1726
|
+
// null (prompt didn't set it) normalizes to undefined so providers omit
|
|
1727
|
+
// the wire param entirely and their default applies (2026-08-04).
|
|
1728
|
+
parallelToolCalls: supportsToolCalls ? context.parallel_tool_calls ?? void 0 : void 0,
|
|
1718
1729
|
reasoning: context.reasoning ? {
|
|
1719
1730
|
level: reasoningEffortToLevel(context.reasoning.effort),
|
|
1720
1731
|
maxTokens: context.reasoning.max_tokens,
|
|
@@ -1970,7 +1981,8 @@ var init_LLMRequest = __esm({
|
|
|
1970
1981
|
}
|
|
1971
1982
|
console.error(`Error calling ${actualModelId} (attempt ${attempts}):`, error2);
|
|
1972
1983
|
await this.logError(state, error2, "api_error", actualModelId, startTime, logId);
|
|
1973
|
-
|
|
1984
|
+
const isStallTimeout = error2?.code === "timeout";
|
|
1985
|
+
if (attempts < MAX_RETRIES_PER_MODEL && !isStallTimeout) {
|
|
1974
1986
|
const base = BACKOFF_BASE * Math.pow(2, attempts - 1);
|
|
1975
1987
|
const retryAfterMs = typeof error2?.retryAfter === "number" ? error2.retryAfter * 1e3 : 0;
|
|
1976
1988
|
const backoffMs = Math.max(base, retryAfterMs);
|
|
@@ -3878,7 +3890,7 @@ __export(ToolExecutor_exports, {
|
|
|
3878
3890
|
function getPackageId(state) {
|
|
3879
3891
|
return state.namespaceContext.type === "packed" ? state.namespaceContext.packageId : void 0;
|
|
3880
3892
|
}
|
|
3881
|
-
var SUBAGENT_CREATE_TOOL, SUBAGENT_MESSAGE_TOOL, LEGACY_SEND_TO_AGENT_TOOL, INTERNAL_SCOPED_ENV_ARGUMENT, INTERNAL_SCOPED_ENV_CONTEXT_KEY, ToolExecutor;
|
|
3893
|
+
var SUBAGENT_CREATE_TOOL, SUBAGENT_MESSAGE_TOOL, SUBAGENTS_LIST_TOOL, LEGACY_SEND_TO_AGENT_TOOL, INTERNAL_SCOPED_ENV_ARGUMENT, INTERNAL_SCOPED_ENV_CONTEXT_KEY, ToolExecutor;
|
|
3882
3894
|
var init_ToolExecutor = __esm({
|
|
3883
3895
|
"src/agents/ToolExecutor.ts"() {
|
|
3884
3896
|
init_types();
|
|
@@ -3886,6 +3898,7 @@ var init_ToolExecutor = __esm({
|
|
|
3886
3898
|
init_sessionTools();
|
|
3887
3899
|
SUBAGENT_CREATE_TOOL = "subagent_create";
|
|
3888
3900
|
SUBAGENT_MESSAGE_TOOL = "subagent_message";
|
|
3901
|
+
SUBAGENTS_LIST_TOOL = "subagents";
|
|
3889
3902
|
LEGACY_SEND_TO_AGENT_TOOL = "send_to_agent";
|
|
3890
3903
|
INTERNAL_SCOPED_ENV_ARGUMENT = "__scoped_env";
|
|
3891
3904
|
INTERNAL_SCOPED_ENV_CONTEXT_KEY = "__immediate_scoped_env_by_call_id";
|
|
@@ -4044,6 +4057,33 @@ var init_ToolExecutor = __esm({
|
|
|
4044
4057
|
* Execute a single tool call
|
|
4045
4058
|
*/
|
|
4046
4059
|
static async executeToolCall(call, state, toolMessageId) {
|
|
4060
|
+
try {
|
|
4061
|
+
const n = call.function?.name;
|
|
4062
|
+
if (n && n.includes("_") && n !== "mcp") {
|
|
4063
|
+
const cat2 = await state.thread.instance.getValue("mcp_catalog");
|
|
4064
|
+
for (const srv of cat2?.servers ?? []) {
|
|
4065
|
+
const sname = srv.name ?? srv.serverInfo?.name;
|
|
4066
|
+
if (!sname || !n.startsWith(`${sname}_`)) continue;
|
|
4067
|
+
const mtool = n.slice(sname.length + 1);
|
|
4068
|
+
if (!Array.isArray(srv.tools) || !srv.tools.some((t) => t.name === mtool)) continue;
|
|
4069
|
+
call = {
|
|
4070
|
+
...call,
|
|
4071
|
+
function: {
|
|
4072
|
+
...call.function,
|
|
4073
|
+
name: "mcp",
|
|
4074
|
+
arguments: JSON.stringify({
|
|
4075
|
+
action: "call",
|
|
4076
|
+
server: sname,
|
|
4077
|
+
tool: mtool,
|
|
4078
|
+
arguments_json: call.function.arguments || "{}"
|
|
4079
|
+
})
|
|
4080
|
+
}
|
|
4081
|
+
};
|
|
4082
|
+
break;
|
|
4083
|
+
}
|
|
4084
|
+
}
|
|
4085
|
+
} catch {
|
|
4086
|
+
}
|
|
4047
4087
|
const toolType = await this.identifyToolType(call, state);
|
|
4048
4088
|
switch (toolType) {
|
|
4049
4089
|
case "native":
|
|
@@ -4093,7 +4133,7 @@ var init_ToolExecutor = __esm({
|
|
|
4093
4133
|
*/
|
|
4094
4134
|
static async identifyToolType(call, state) {
|
|
4095
4135
|
const toolName = call.function.name;
|
|
4096
|
-
if (toolName === SUBAGENT_CREATE_TOOL || toolName === SUBAGENT_MESSAGE_TOOL || toolName === LEGACY_SEND_TO_AGENT_TOOL) {
|
|
4136
|
+
if (toolName === SUBAGENT_CREATE_TOOL || toolName === SUBAGENT_MESSAGE_TOOL || toolName === SUBAGENTS_LIST_TOOL || toolName === LEGACY_SEND_TO_AGENT_TOOL) {
|
|
4097
4137
|
return "agent";
|
|
4098
4138
|
}
|
|
4099
4139
|
if (state.allowedTools) {
|
|
@@ -4626,6 +4666,22 @@ ${errorLines.join("\n")}`);
|
|
|
4626
4666
|
if (builtinSubagentAction === "message") {
|
|
4627
4667
|
return await this.executeSubagentMessageTool(call, state);
|
|
4628
4668
|
}
|
|
4669
|
+
if (call.function.name === SUBAGENTS_LIST_TOOL) {
|
|
4670
|
+
const { FlowEngine: FlowEngine2 } = await Promise.resolve().then(() => (init_FlowEngine(), FlowEngine_exports));
|
|
4671
|
+
const registry = await FlowEngine2.listModelVisibleSubagents(state);
|
|
4672
|
+
if (registry.length === 0) {
|
|
4673
|
+
return { status: "success", result: "No active subagent instances." };
|
|
4674
|
+
}
|
|
4675
|
+
const lines = registry.map(
|
|
4676
|
+
(entry) => `- ${entry.reference}: ${entry.name} \u2014 ${entry.status ?? "unknown"}${entry.description ? ` (${entry.description})` : ""}`
|
|
4677
|
+
);
|
|
4678
|
+
return {
|
|
4679
|
+
status: "success",
|
|
4680
|
+
result: `Active subagent instances:
|
|
4681
|
+
${lines.join("\n")}
|
|
4682
|
+
Message one with subagent_message(referenceId, message).`
|
|
4683
|
+
};
|
|
4684
|
+
}
|
|
4629
4685
|
const createArgs = builtinSubagentAction === "create" ? this.parseSubagentCreateArgs(call.function.arguments) : null;
|
|
4630
4686
|
if (createArgs?.error) {
|
|
4631
4687
|
return { status: "error", error: createArgs.error };
|
|
@@ -6948,7 +7004,10 @@ This usually points to something I can't fix from here \u2014 for example the wo
|
|
|
6948
7004
|
model: def.model,
|
|
6949
7005
|
include_chat: def.includeChat ?? false,
|
|
6950
7006
|
include_past_tools: def.includePastTools ?? false,
|
|
6951
|
-
|
|
7007
|
+
// Unset stays unset (2026-08-04): defaulting to `false` forbade the
|
|
7008
|
+
// parallel batching agentic-tuned models are trained on; absent lets
|
|
7009
|
+
// the provider default apply, while an explicit prompt value is honored.
|
|
7010
|
+
parallel_tool_calls: def.parallelToolCalls ?? null,
|
|
6952
7011
|
tool_choice: def.toolChoice ?? "auto",
|
|
6953
7012
|
reasoning_effort: def.reasoning?.effort ?? null,
|
|
6954
7013
|
reasoning_max_tokens: def.reasoning?.maxTokens ?? null,
|
|
@@ -8230,6 +8289,13 @@ This usually points to something I can't fix from here \u2014 for example the wo
|
|
|
8230
8289
|
if (hidden.size === 0) return registry;
|
|
8231
8290
|
return registry.filter((entry) => !hidden.has(entry.name));
|
|
8232
8291
|
}
|
|
8292
|
+
/** Public snapshot for the `subagents` built-in tool (ToolExecutor). */
|
|
8293
|
+
static async listModelVisibleSubagents(state) {
|
|
8294
|
+
return _FlowEngine.filterModelVisibleSubagents(
|
|
8295
|
+
await this.getSubagentRegistry(state),
|
|
8296
|
+
state.prompt?._tools
|
|
8297
|
+
);
|
|
8298
|
+
}
|
|
8233
8299
|
static async getSubagentRegistry(state) {
|
|
8234
8300
|
if (typeof state.thread.instance.getChildrenRegistry === "function") {
|
|
8235
8301
|
try {
|
|
@@ -8499,7 +8565,8 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
|
|
|
8499
8565
|
await this.getSubagentRegistry(state),
|
|
8500
8566
|
state.prompt?._tools
|
|
8501
8567
|
);
|
|
8502
|
-
|
|
8568
|
+
const suppressRegistryMessage = Array.isArray(state.prompt?.hooks) ? state.prompt.hooks.includes("append_static_session_env") : false;
|
|
8569
|
+
if (subagentRegistry.length > 0 && !suppressRegistryMessage) {
|
|
8503
8570
|
const fallbackNameMap = await this.resolveRegistryThreadNameMap(state, subagentRegistry);
|
|
8504
8571
|
const lines = subagentRegistry.map((entry) => {
|
|
8505
8572
|
const threadName = this.getRegistryThreadName(entry) ?? fallbackNameMap.get(entry.reference) ?? null;
|
|
@@ -8858,6 +8925,16 @@ ${lines.join("\n\n")}`
|
|
|
8858
8925
|
}
|
|
8859
8926
|
if (resumablePromptSubagents.length > 0 && !tools.some((tool) => tool.function.name === "subagent_create")) {
|
|
8860
8927
|
tools.push(this.buildSubagentCreateTool(resumablePromptSubagents));
|
|
8928
|
+
if (!tools.some((tool) => tool.function.name === "subagents")) {
|
|
8929
|
+
tools.push({
|
|
8930
|
+
type: "function",
|
|
8931
|
+
function: {
|
|
8932
|
+
name: "subagents",
|
|
8933
|
+
description: "List your active subagent instances: reference id, name, status, and working-status text. Use when you need to check on children you created; completions also arrive as messages.",
|
|
8934
|
+
parameters: { type: "object", properties: {} }
|
|
8935
|
+
}
|
|
8936
|
+
});
|
|
8937
|
+
}
|
|
8861
8938
|
}
|
|
8862
8939
|
const hasActiveResumable = childrenRegistry.some(
|
|
8863
8940
|
(entry) => entry.status !== "terminated"
|
|
@@ -8892,6 +8969,73 @@ ${lines.join("\n\n")}`
|
|
|
8892
8969
|
}
|
|
8893
8970
|
});
|
|
8894
8971
|
}
|
|
8972
|
+
try {
|
|
8973
|
+
const cat2 = await state.thread.instance.getValue("mcp_catalog");
|
|
8974
|
+
const servers = cat2?.servers ?? [];
|
|
8975
|
+
const have = new Set(tools.map((t) => t.function?.name));
|
|
8976
|
+
const sanitizeProperty = (p) => {
|
|
8977
|
+
const prop = p ?? {};
|
|
8978
|
+
const t = prop.type;
|
|
8979
|
+
if (t === "string" || t === "number" || t === "integer" || t === "boolean") {
|
|
8980
|
+
const out = { type: t };
|
|
8981
|
+
if (typeof prop.description === "string") out.description = prop.description;
|
|
8982
|
+
if (Array.isArray(prop.enum)) out.enum = prop.enum;
|
|
8983
|
+
return out;
|
|
8984
|
+
}
|
|
8985
|
+
if (t === "array") {
|
|
8986
|
+
return {
|
|
8987
|
+
type: "array",
|
|
8988
|
+
items: sanitizeProperty(prop.items),
|
|
8989
|
+
...typeof prop.description === "string" ? { description: prop.description } : {}
|
|
8990
|
+
};
|
|
8991
|
+
}
|
|
8992
|
+
if (t === "object") {
|
|
8993
|
+
const props = prop.properties ?? {};
|
|
8994
|
+
const out = {};
|
|
8995
|
+
for (const [k, v] of Object.entries(props)) out[k] = sanitizeProperty(v);
|
|
8996
|
+
return {
|
|
8997
|
+
type: "object",
|
|
8998
|
+
properties: out,
|
|
8999
|
+
...Array.isArray(prop.required) ? { required: prop.required.filter((r) => typeof r === "string" && r in out) } : {},
|
|
9000
|
+
...typeof prop.description === "string" ? { description: prop.description } : {}
|
|
9001
|
+
};
|
|
9002
|
+
}
|
|
9003
|
+
return {
|
|
9004
|
+
type: "string",
|
|
9005
|
+
...typeof prop.description === "string" ? { description: prop.description } : {}
|
|
9006
|
+
};
|
|
9007
|
+
};
|
|
9008
|
+
const sanitizeSchema = (schema) => {
|
|
9009
|
+
const s = schema ?? { type: "object", properties: {} };
|
|
9010
|
+
if (s.type !== void 0 && s.type !== "object") return null;
|
|
9011
|
+
const sanitized = sanitizeProperty({ ...s, type: "object" });
|
|
9012
|
+
return sanitized;
|
|
9013
|
+
};
|
|
9014
|
+
for (const srv of servers) {
|
|
9015
|
+
const sname = srv.name ?? srv.serverInfo?.name;
|
|
9016
|
+
if (!sname || srv.error || !Array.isArray(srv.tools)) continue;
|
|
9017
|
+
for (const mt of srv.tools) {
|
|
9018
|
+
const pname = `${sname}_${mt.name}`;
|
|
9019
|
+
if (have.has(pname)) continue;
|
|
9020
|
+
const parameters = sanitizeSchema(mt.inputSchema);
|
|
9021
|
+
if (!parameters) {
|
|
9022
|
+
console.log(`[FlowEngine] mcp projection: skipped ${pname} (non-object schema)`);
|
|
9023
|
+
continue;
|
|
9024
|
+
}
|
|
9025
|
+
tools.push({
|
|
9026
|
+
type: "function",
|
|
9027
|
+
function: {
|
|
9028
|
+
name: pname,
|
|
9029
|
+
description: mt.description || `${mt.name} via the ${sname} MCP server`,
|
|
9030
|
+
parameters
|
|
9031
|
+
}
|
|
9032
|
+
});
|
|
9033
|
+
have.add(pname);
|
|
9034
|
+
}
|
|
9035
|
+
}
|
|
9036
|
+
console.log(`[FlowEngine] mcp projection: ${tools.length} tools after catalog merge`);
|
|
9037
|
+
} catch {
|
|
9038
|
+
}
|
|
8895
9039
|
console.log(`[FlowEngine] getToolsForPrompt result: ${tools.length} tools loaded for prompt ${promptData.name}`);
|
|
8896
9040
|
return tools;
|
|
8897
9041
|
} catch (error) {
|
|
@@ -15314,6 +15458,12 @@ var FIRST_PARTY_PROVIDERS = [
|
|
|
15314
15458
|
label: "Cerebras",
|
|
15315
15459
|
envKeys: ["CEREBRAS_API_KEY"]
|
|
15316
15460
|
},
|
|
15461
|
+
{
|
|
15462
|
+
name: "deepinfra",
|
|
15463
|
+
package: "@standardagents/deepinfra",
|
|
15464
|
+
label: "DeepInfra",
|
|
15465
|
+
envKeys: ["DEEPINFRA_API_KEY"]
|
|
15466
|
+
},
|
|
15317
15467
|
{
|
|
15318
15468
|
name: "google",
|
|
15319
15469
|
package: "@standardagents/google",
|
|
@@ -22419,6 +22569,7 @@ var firstPartyProviderPackages = [
|
|
|
22419
22569
|
"@standardagents/anthropic",
|
|
22420
22570
|
"@standardagents/cloudflare",
|
|
22421
22571
|
"@standardagents/cerebras",
|
|
22572
|
+
"@standardagents/deepinfra",
|
|
22422
22573
|
"@standardagents/google",
|
|
22423
22574
|
"@standardagents/groq",
|
|
22424
22575
|
"@standardagents/novita",
|