@truefoundry/trueforge 0.182.0-rc.3 → 0.182.0-rc.4
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/main.js +258 -139
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -17235,7 +17235,8 @@ function createTurnResolver(deps) {
|
|
|
17235
17235
|
signal,
|
|
17236
17236
|
userRef,
|
|
17237
17237
|
session,
|
|
17238
|
-
turnMetadata
|
|
17238
|
+
turnMetadata,
|
|
17239
|
+
capabilitiesStore
|
|
17239
17240
|
} = deps;
|
|
17240
17241
|
const tenant_id = session.tenant_id;
|
|
17241
17242
|
const sessionId = session.session_id;
|
|
@@ -17330,7 +17331,8 @@ function createTurnResolver(deps) {
|
|
|
17330
17331
|
return record.manifest;
|
|
17331
17332
|
},
|
|
17332
17333
|
webSearchProvider,
|
|
17333
|
-
logger: logger2
|
|
17334
|
+
logger: logger2,
|
|
17335
|
+
rootCapabilities: () => capabilitiesStore.resolveCapabilities()
|
|
17334
17336
|
});
|
|
17335
17337
|
}
|
|
17336
17338
|
var titleSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -17454,7 +17456,8 @@ async function beginTurnExecution(params) {
|
|
|
17454
17456
|
turnId,
|
|
17455
17457
|
...sessionAgent.type === "reference" ? { agent: { id: sessionAgent.id, name: sessionAgent.name } } : {},
|
|
17456
17458
|
...requestHeaders === void 0 ? {} : { requestHeaders }
|
|
17457
|
-
}
|
|
17459
|
+
},
|
|
17460
|
+
capabilitiesStore: deps.capabilitiesStore
|
|
17458
17461
|
});
|
|
17459
17462
|
const title = session.record.last_turn_details ? void 0 : deriveSessionTitle(input);
|
|
17460
17463
|
const turn = await session.createTurn({
|
|
@@ -17769,6 +17772,8 @@ function createTurnsRouter(deps) {
|
|
|
17769
17772
|
...referencedAgent !== void 0 ? { runAsAgent: referencedAgent } : {}
|
|
17770
17773
|
}),
|
|
17771
17774
|
skillStore: deps.resolveTurnSkillsStore({ c, allowInlineResources }),
|
|
17775
|
+
// Parsed here, before a turn id is minted.
|
|
17776
|
+
capabilitiesStore: deps.resolveCapabilitiesStore({ c }),
|
|
17772
17777
|
agentStore: deps.resolveAgentStore(c),
|
|
17773
17778
|
sandboxProviderStore: deps.resolveSandboxProviderStore(c),
|
|
17774
17779
|
sandboxEnvironmentStore: deps.sandboxEnvironmentStore,
|
|
@@ -17975,6 +17980,7 @@ async function startScheduleRunOnRequest(params) {
|
|
|
17975
17980
|
sandboxEnvironmentStore: deps.sandboxEnvironmentStore,
|
|
17976
17981
|
webSearchProviderStore: deps.resolveWebSearchProviderStore(c),
|
|
17977
17982
|
skillStore: deps.resolveTurnSkillsStore({}),
|
|
17983
|
+
capabilitiesStore: deps.resolveCapabilitiesStore({}),
|
|
17978
17984
|
logger: deps.logger
|
|
17979
17985
|
}
|
|
17980
17986
|
});
|
|
@@ -20444,7 +20450,8 @@ function createServerApp(deps) {
|
|
|
20444
20450
|
sandboxEnvironmentStore: deps.sandboxEnvironmentStore,
|
|
20445
20451
|
resolveWebSearchProviderStore: deps.resolveWebSearchProviderStore,
|
|
20446
20452
|
activeTurns: deps.activeTurns,
|
|
20447
|
-
resolveTurnSkillsStore: deps.resolveTurnSkillsStore
|
|
20453
|
+
resolveTurnSkillsStore: deps.resolveTurnSkillsStore,
|
|
20454
|
+
resolveCapabilitiesStore: deps.resolveCapabilitiesStore
|
|
20448
20455
|
};
|
|
20449
20456
|
const httpMetrics = deps.httpMetrics;
|
|
20450
20457
|
app.use("*", createRequestLogContextMiddleware());
|
|
@@ -20703,6 +20710,7 @@ function createServerApp(deps) {
|
|
|
20703
20710
|
resolveModelProviderStore: deps.resolveModelProviderStore,
|
|
20704
20711
|
resolveMcpServerStore: deps.resolveMcpServerStore,
|
|
20705
20712
|
resolveTurnSkillsStore: deps.resolveTurnSkillsStore,
|
|
20713
|
+
resolveCapabilitiesStore: deps.resolveCapabilitiesStore,
|
|
20706
20714
|
resolveAgentStore: deps.resolveAgentStore,
|
|
20707
20715
|
eventSubscriptions: deps.eventSubscriptions,
|
|
20708
20716
|
resolveSandboxProviderStore: deps.resolveSandboxProviderStore,
|
|
@@ -22616,21 +22624,127 @@ function unsupportedInlineSkillWrite() {
|
|
|
22616
22624
|
);
|
|
22617
22625
|
}
|
|
22618
22626
|
|
|
22619
|
-
// src/truefoundry/
|
|
22627
|
+
// src/truefoundry/inlineTools.ts
|
|
22628
|
+
import { ToolSchema as McpToolSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
22629
|
+
import {
|
|
22630
|
+
ClientSideTool,
|
|
22631
|
+
toolResultResponse
|
|
22632
|
+
} from "@truefoundry/trueforge-core/core";
|
|
22620
22633
|
import { HTTPException as HTTPException25 } from "hono/http-exception";
|
|
22621
22634
|
import { z as z44 } from "zod";
|
|
22635
|
+
var X_TFG_TOOLS = "x-tfg-tools";
|
|
22636
|
+
var MAX_TFG_TOOLS = 16;
|
|
22637
|
+
var MAX_TFG_TOOLS_HEADER_LENGTH = 16e3;
|
|
22638
|
+
var InlineToolsHeaderSchema = z44.array(McpToolSchema);
|
|
22639
|
+
function assertTfgToolsHeaderAllowed(input) {
|
|
22640
|
+
if (!input.isTrueFoundryMode) {
|
|
22641
|
+
throw new HTTPException25(400, { message: `${X_TFG_TOOLS} requires TrueFoundry mode` });
|
|
22642
|
+
}
|
|
22643
|
+
}
|
|
22644
|
+
function parseTfgTools(raw) {
|
|
22645
|
+
if (raw.length > MAX_TFG_TOOLS_HEADER_LENGTH) {
|
|
22646
|
+
throw new HTTPException25(400, { message: `${X_TFG_TOOLS} is too large` });
|
|
22647
|
+
}
|
|
22648
|
+
let decoded;
|
|
22649
|
+
try {
|
|
22650
|
+
decoded = JSON.parse(raw);
|
|
22651
|
+
} catch (error) {
|
|
22652
|
+
throw new HTTPException25(400, { message: `${X_TFG_TOOLS} must be a JSON array`, cause: error });
|
|
22653
|
+
}
|
|
22654
|
+
if (!Array.isArray(decoded)) {
|
|
22655
|
+
throw new HTTPException25(400, { message: `${X_TFG_TOOLS} must be a JSON array of tool definitions` });
|
|
22656
|
+
}
|
|
22657
|
+
if (decoded.length > MAX_TFG_TOOLS) {
|
|
22658
|
+
throw new HTTPException25(400, { message: `${X_TFG_TOOLS} lists more than ${String(MAX_TFG_TOOLS)} tools` });
|
|
22659
|
+
}
|
|
22660
|
+
const parsed = InlineToolsHeaderSchema.safeParse(decoded);
|
|
22661
|
+
if (!parsed.success) {
|
|
22662
|
+
throw new HTTPException25(400, {
|
|
22663
|
+
message: tfgToolsSchemaErrorMessage(parsed.error),
|
|
22664
|
+
cause: parsed.error
|
|
22665
|
+
});
|
|
22666
|
+
}
|
|
22667
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22668
|
+
for (const [index, tool] of parsed.data.entries()) {
|
|
22669
|
+
if (seen.has(tool.name)) {
|
|
22670
|
+
throw new HTTPException25(400, {
|
|
22671
|
+
message: `${X_TFG_TOOLS}[${String(index)}] name "${tool.name}" is listed more than once`
|
|
22672
|
+
});
|
|
22673
|
+
}
|
|
22674
|
+
seen.add(tool.name);
|
|
22675
|
+
}
|
|
22676
|
+
return parsed.data;
|
|
22677
|
+
}
|
|
22678
|
+
function capabilitiesStoreFromHeader(input) {
|
|
22679
|
+
if (input.header === void 0) {
|
|
22680
|
+
return { resolveCapabilities: () => [] };
|
|
22681
|
+
}
|
|
22682
|
+
assertTfgToolsHeaderAllowed({ isTrueFoundryMode: input.isTrueFoundryMode });
|
|
22683
|
+
const tools = parseTfgTools(input.header);
|
|
22684
|
+
return {
|
|
22685
|
+
resolveCapabilities: () => tools.length === 0 ? [] : [tfgToolsCapability(tools)]
|
|
22686
|
+
};
|
|
22687
|
+
}
|
|
22688
|
+
function tfgToolsCapability(tools) {
|
|
22689
|
+
return {
|
|
22690
|
+
systemToolSets: [new InlineClientSideTools(tools)]
|
|
22691
|
+
};
|
|
22692
|
+
}
|
|
22693
|
+
function tfgToolsSchemaErrorMessage(error) {
|
|
22694
|
+
const issue = error.issues[0];
|
|
22695
|
+
if (issue === void 0) {
|
|
22696
|
+
return `${X_TFG_TOOLS} must be an array of MCP tool definitions`;
|
|
22697
|
+
}
|
|
22698
|
+
return `${X_TFG_TOOLS}${tfgToolsIssuePath(issue.path)} ${issue.message}`;
|
|
22699
|
+
}
|
|
22700
|
+
function tfgToolsIssuePath(path7) {
|
|
22701
|
+
let rendered = "";
|
|
22702
|
+
for (const part of path7) {
|
|
22703
|
+
if (typeof part === "number") {
|
|
22704
|
+
rendered += `[${String(part)}]`;
|
|
22705
|
+
} else {
|
|
22706
|
+
rendered += `.${String(part)}`;
|
|
22707
|
+
}
|
|
22708
|
+
}
|
|
22709
|
+
return rendered;
|
|
22710
|
+
}
|
|
22711
|
+
var InlineClientSideTools = class extends ClientSideTool {
|
|
22712
|
+
name = X_TFG_TOOLS;
|
|
22713
|
+
displayName = "TfgTools";
|
|
22714
|
+
tracingEnabled = false;
|
|
22715
|
+
#tools;
|
|
22716
|
+
constructor(tools) {
|
|
22717
|
+
super();
|
|
22718
|
+
this.#tools = tools.map((tool) => ({
|
|
22719
|
+
...tool,
|
|
22720
|
+
execute: () => Promise.resolve(
|
|
22721
|
+
toolResultResponse({
|
|
22722
|
+
text: "This tool requires client-side execution and cannot be run server-side.",
|
|
22723
|
+
isError: true
|
|
22724
|
+
})
|
|
22725
|
+
)
|
|
22726
|
+
}));
|
|
22727
|
+
}
|
|
22728
|
+
getTools() {
|
|
22729
|
+
return this.#tools;
|
|
22730
|
+
}
|
|
22731
|
+
};
|
|
22732
|
+
|
|
22733
|
+
// src/truefoundry/perServerMcpHeaders.ts
|
|
22734
|
+
import { HTTPException as HTTPException26 } from "hono/http-exception";
|
|
22735
|
+
import { z as z45 } from "zod";
|
|
22622
22736
|
var X_TFG_MCP_HEADERS = "x-tfg-mcp-headers";
|
|
22623
|
-
var PerServerMcpHeadersSchema =
|
|
22737
|
+
var PerServerMcpHeadersSchema = z45.record(z45.string().min(1), z45.record(z45.string().min(1), z45.string()));
|
|
22624
22738
|
function parsePerServerMcpHeaders(raw) {
|
|
22625
22739
|
let decoded;
|
|
22626
22740
|
try {
|
|
22627
22741
|
decoded = JSON.parse(raw);
|
|
22628
22742
|
} catch (error) {
|
|
22629
|
-
throw new
|
|
22743
|
+
throw new HTTPException26(400, { message: `${X_TFG_MCP_HEADERS} must be a JSON object`, cause: error });
|
|
22630
22744
|
}
|
|
22631
22745
|
const parsed = PerServerMcpHeadersSchema.safeParse(decoded);
|
|
22632
22746
|
if (!parsed.success) {
|
|
22633
|
-
throw new
|
|
22747
|
+
throw new HTTPException26(400, {
|
|
22634
22748
|
message: `${X_TFG_MCP_HEADERS} must map each MCP server name to a header map`
|
|
22635
22749
|
});
|
|
22636
22750
|
}
|
|
@@ -22650,10 +22764,10 @@ import {
|
|
|
22650
22764
|
getOperationMetrics as getOperationMetrics4,
|
|
22651
22765
|
httpStatusClass
|
|
22652
22766
|
} from "@truefoundry/trueforge-core/core";
|
|
22653
|
-
import { HTTPException as
|
|
22767
|
+
import { HTTPException as HTTPException27 } from "hono/http-exception";
|
|
22654
22768
|
import { LRUCache } from "lru-cache";
|
|
22655
22769
|
import { fetch as undiciFetch3 } from "undici";
|
|
22656
|
-
import { z as
|
|
22770
|
+
import { z as z48 } from "zod";
|
|
22657
22771
|
|
|
22658
22772
|
// src/truefoundry/internalTls.ts
|
|
22659
22773
|
function normalizeInternalTlsUrl(input) {
|
|
@@ -22667,20 +22781,20 @@ function createInternalTlsDispatcher(options) {
|
|
|
22667
22781
|
}
|
|
22668
22782
|
|
|
22669
22783
|
// src/truefoundry/mapSfyAgentSkills.ts
|
|
22670
|
-
import { z as
|
|
22671
|
-
var SfyRegistryManifestSchema =
|
|
22784
|
+
import { z as z46 } from "zod";
|
|
22785
|
+
var SfyRegistryManifestSchema = z46.object({
|
|
22672
22786
|
// Display label only — not TF ResourceName / DNS-label rules.
|
|
22673
|
-
name:
|
|
22674
|
-
version:
|
|
22787
|
+
name: z46.string().min(1),
|
|
22788
|
+
version: z46.number().int().positive(),
|
|
22675
22789
|
// SFY field is `ml_repo`; TrueForge wire is `repository_name`.
|
|
22676
|
-
ml_repo:
|
|
22677
|
-
source:
|
|
22678
|
-
description:
|
|
22790
|
+
ml_repo: z46.string().min(1),
|
|
22791
|
+
source: z46.object({
|
|
22792
|
+
description: z46.string().min(1).optional()
|
|
22679
22793
|
}).optional()
|
|
22680
22794
|
});
|
|
22681
|
-
var SfyRegistrySkillSchema =
|
|
22682
|
-
latest_version:
|
|
22683
|
-
fqn:
|
|
22795
|
+
var SfyRegistrySkillSchema = z46.object({
|
|
22796
|
+
latest_version: z46.object({
|
|
22797
|
+
fqn: z46.string().min(1),
|
|
22684
22798
|
manifest: SfyRegistryManifestSchema
|
|
22685
22799
|
})
|
|
22686
22800
|
}).transform(({ latest_version }) => ({
|
|
@@ -22691,20 +22805,20 @@ var SfyRegistrySkillSchema = z45.object({
|
|
|
22691
22805
|
repository_name: latest_version.manifest.ml_repo,
|
|
22692
22806
|
version: latest_version.manifest.version
|
|
22693
22807
|
}));
|
|
22694
|
-
var SfyRegistrySkillVersionSchema =
|
|
22695
|
-
agent_skill_id:
|
|
22696
|
-
fqn:
|
|
22808
|
+
var SfyRegistrySkillVersionSchema = z46.object({
|
|
22809
|
+
agent_skill_id: z46.string().min(1),
|
|
22810
|
+
fqn: z46.string().min(1),
|
|
22697
22811
|
manifest: SfyRegistryManifestSchema
|
|
22698
22812
|
});
|
|
22699
|
-
var ResolvedAgentSkillVersionSchema =
|
|
22700
|
-
fqn:
|
|
22701
|
-
name:
|
|
22702
|
-
description:
|
|
22703
|
-
skill_md_content:
|
|
22704
|
-
presigned_url:
|
|
22813
|
+
var ResolvedAgentSkillVersionSchema = z46.object({
|
|
22814
|
+
fqn: z46.string().min(1),
|
|
22815
|
+
name: z46.string().min(1),
|
|
22816
|
+
description: z46.string().min(1),
|
|
22817
|
+
skill_md_content: z46.string().nullable().optional(),
|
|
22818
|
+
presigned_url: z46.string().min(1).optional()
|
|
22705
22819
|
});
|
|
22706
|
-
var ResolveAgentSkillVersionsResponseSchema =
|
|
22707
|
-
skills:
|
|
22820
|
+
var ResolveAgentSkillVersionsResponseSchema = z46.object({
|
|
22821
|
+
skills: z46.array(ResolvedAgentSkillVersionSchema)
|
|
22708
22822
|
});
|
|
22709
22823
|
function mapSfyRegistrySkills(rows) {
|
|
22710
22824
|
return rows.map((row) => SfyRegistrySkillSchema.parse(row));
|
|
@@ -22728,48 +22842,48 @@ function mapResolvedAgentSkillVersions(payload) {
|
|
|
22728
22842
|
}
|
|
22729
22843
|
|
|
22730
22844
|
// src/truefoundry/mapSfyMcpServers.ts
|
|
22731
|
-
import { z as
|
|
22845
|
+
import { z as z47 } from "zod";
|
|
22732
22846
|
var MCP_PROXY_BASE_URL_TEMPLATE = "{{mcpProxyBaseURL}}";
|
|
22733
|
-
var IsoInstantSchema =
|
|
22847
|
+
var IsoInstantSchema = z47.union([z47.string().min(1), z47.date()]).transform((value, ctx) => {
|
|
22734
22848
|
if (value instanceof Date) {
|
|
22735
22849
|
if (!Number.isFinite(value.getTime())) {
|
|
22736
22850
|
ctx.addIssue({ code: "custom", message: "Invalid Date" });
|
|
22737
|
-
return
|
|
22851
|
+
return z47.NEVER;
|
|
22738
22852
|
}
|
|
22739
22853
|
return value.toISOString();
|
|
22740
22854
|
}
|
|
22741
22855
|
const ms = Date.parse(value);
|
|
22742
22856
|
if (!Number.isFinite(ms)) {
|
|
22743
22857
|
ctx.addIssue({ code: "custom", message: "Invalid ISO timestamp" });
|
|
22744
|
-
return
|
|
22858
|
+
return z47.NEVER;
|
|
22745
22859
|
}
|
|
22746
22860
|
return new Date(ms).toISOString();
|
|
22747
22861
|
});
|
|
22748
|
-
var SfyMcpServerRowSchema =
|
|
22749
|
-
id:
|
|
22750
|
-
name:
|
|
22751
|
-
proxyUrl:
|
|
22862
|
+
var SfyMcpServerRowSchema = z47.object({
|
|
22863
|
+
id: z47.string().min(1),
|
|
22864
|
+
name: z47.string().min(1),
|
|
22865
|
+
proxyUrl: z47.string().min(1),
|
|
22752
22866
|
createdAt: IsoInstantSchema,
|
|
22753
22867
|
updatedAt: IsoInstantSchema,
|
|
22754
|
-
manifest:
|
|
22755
|
-
description:
|
|
22756
|
-
auth_data:
|
|
22757
|
-
type:
|
|
22868
|
+
manifest: z47.object({
|
|
22869
|
+
description: z47.string().min(1).optional(),
|
|
22870
|
+
auth_data: z47.object({
|
|
22871
|
+
type: z47.string().min(1).optional()
|
|
22758
22872
|
}).optional()
|
|
22759
22873
|
}).optional()
|
|
22760
22874
|
});
|
|
22761
|
-
var SfyMcpAuthStatusAuthenticatedSchema =
|
|
22762
|
-
var SfyMcpAuthStatusNotRequiredSchema =
|
|
22763
|
-
var SfyMcpAuthStatusRequiredSchema =
|
|
22875
|
+
var SfyMcpAuthStatusAuthenticatedSchema = z47.object({ status: z47.literal("authenticated") });
|
|
22876
|
+
var SfyMcpAuthStatusNotRequiredSchema = z47.object({ status: z47.literal("authentication_not_required") });
|
|
22877
|
+
var SfyMcpAuthStatusRequiredSchema = z47.object({ status: z47.literal("authentication_required") });
|
|
22764
22878
|
var SfyMcpAuthorizeRequiredSchema = SfyMcpAuthStatusRequiredSchema.extend({
|
|
22765
|
-
authorization_endpoint:
|
|
22879
|
+
authorization_endpoint: z47.url()
|
|
22766
22880
|
});
|
|
22767
|
-
var SfyMcpAuthStatusSchema =
|
|
22881
|
+
var SfyMcpAuthStatusSchema = z47.discriminatedUnion("status", [
|
|
22768
22882
|
SfyMcpAuthStatusAuthenticatedSchema,
|
|
22769
22883
|
SfyMcpAuthStatusRequiredSchema,
|
|
22770
22884
|
SfyMcpAuthStatusNotRequiredSchema
|
|
22771
22885
|
]);
|
|
22772
|
-
var SfyMcpAuthorizeResultSchema =
|
|
22886
|
+
var SfyMcpAuthorizeResultSchema = z47.discriminatedUnion("status", [
|
|
22773
22887
|
SfyMcpAuthStatusAuthenticatedSchema,
|
|
22774
22888
|
SfyMcpAuthorizeRequiredSchema,
|
|
22775
22889
|
SfyMcpAuthStatusNotRequiredSchema
|
|
@@ -22843,32 +22957,32 @@ var VEND_TOKEN_PATH = "internal/vend-token";
|
|
|
22843
22957
|
var SUBJECTS_PEEK_PATH = "v1/subjects/peek";
|
|
22844
22958
|
var AGENT_SKILLS_PAGE_SIZE = 100;
|
|
22845
22959
|
var AGENT_SKILL_RESOLVE_CHUNK_SIZE = 50;
|
|
22846
|
-
var SessionSubjectSchema =
|
|
22847
|
-
subjectId:
|
|
22848
|
-
subjectType:
|
|
22849
|
-
subjectDisplayName:
|
|
22850
|
-
subjectSlug:
|
|
22960
|
+
var SessionSubjectSchema = z48.object({
|
|
22961
|
+
subjectId: z48.string().min(1),
|
|
22962
|
+
subjectType: z48.string().min(1),
|
|
22963
|
+
subjectDisplayName: z48.string().nullable().optional(),
|
|
22964
|
+
subjectSlug: z48.string().nullable().optional()
|
|
22851
22965
|
});
|
|
22852
|
-
var GetSessionUserSchema =
|
|
22853
|
-
tenantName:
|
|
22854
|
-
roles:
|
|
22966
|
+
var GetSessionUserSchema = z48.object({
|
|
22967
|
+
tenantName: z48.string().min(1),
|
|
22968
|
+
roles: z48.array(z48.string()),
|
|
22855
22969
|
subject: SessionSubjectSchema
|
|
22856
22970
|
});
|
|
22857
|
-
var GetSessionUnauthenticatedSchema =
|
|
22858
|
-
user:
|
|
22971
|
+
var GetSessionUnauthenticatedSchema = z48.object({
|
|
22972
|
+
user: z48.null()
|
|
22859
22973
|
});
|
|
22860
|
-
var GetSessionAuthenticatedSchema =
|
|
22974
|
+
var GetSessionAuthenticatedSchema = z48.object({
|
|
22861
22975
|
user: GetSessionUserSchema
|
|
22862
22976
|
});
|
|
22863
|
-
var GetSessionWireSchema =
|
|
22864
|
-
var TenantControlPlaneUrlSchema =
|
|
22865
|
-
controlPlaneURL:
|
|
22977
|
+
var GetSessionWireSchema = z48.union([GetSessionUnauthenticatedSchema, GetSessionAuthenticatedSchema]);
|
|
22978
|
+
var TenantControlPlaneUrlSchema = z48.object({
|
|
22979
|
+
controlPlaneURL: z48.url()
|
|
22866
22980
|
});
|
|
22867
|
-
var ListResponseSchema =
|
|
22868
|
-
|
|
22869
|
-
|
|
22870
|
-
data:
|
|
22871
|
-
pagination:
|
|
22981
|
+
var ListResponseSchema = z48.union([
|
|
22982
|
+
z48.array(z48.unknown()),
|
|
22983
|
+
z48.object({
|
|
22984
|
+
data: z48.array(z48.unknown()).catch([]),
|
|
22985
|
+
pagination: z48.object({ total: z48.number().optional() }).optional()
|
|
22872
22986
|
})
|
|
22873
22987
|
]);
|
|
22874
22988
|
var SERVICE_FOUNDRY_OPERATIONS = {
|
|
@@ -22891,34 +23005,34 @@ var SERVICE_FOUNDRY_OPERATIONS = {
|
|
|
22891
23005
|
vendToken: "vend_token",
|
|
22892
23006
|
peekUsers: "users"
|
|
22893
23007
|
};
|
|
22894
|
-
var ServiceFoundryErrorSchema =
|
|
22895
|
-
message:
|
|
23008
|
+
var ServiceFoundryErrorSchema = z48.object({
|
|
23009
|
+
message: z48.union([z48.string(), z48.array(z48.string())]).optional()
|
|
22896
23010
|
});
|
|
22897
|
-
var PutRemoteAgentResponseSchema =
|
|
22898
|
-
agentId:
|
|
23011
|
+
var PutRemoteAgentResponseSchema = z48.object({
|
|
23012
|
+
agentId: z48.string().min(1)
|
|
22899
23013
|
});
|
|
22900
|
-
var AgentPermissionSchema =
|
|
22901
|
-
var AgentPermissionsSchema =
|
|
22902
|
-
|
|
22903
|
-
|
|
23014
|
+
var AgentPermissionSchema = z48.enum(["READ_AGENT", "USE_AGENT", "MANAGE_AGENT", "DELETE_AGENT"]);
|
|
23015
|
+
var AgentPermissionsSchema = z48.record(
|
|
23016
|
+
z48.string(),
|
|
23017
|
+
z48.array(z48.string()).transform(
|
|
22904
23018
|
(permissions) => permissions.flatMap((permission) => {
|
|
22905
23019
|
const parsed = AgentPermissionSchema.safeParse(permission);
|
|
22906
23020
|
return parsed.success ? [parsed.data] : [];
|
|
22907
23021
|
})
|
|
22908
23022
|
)
|
|
22909
23023
|
);
|
|
22910
|
-
var VendTokenResponseSchema =
|
|
22911
|
-
subjectToken:
|
|
22912
|
-
actorToken:
|
|
23024
|
+
var VendTokenResponseSchema = z48.object({
|
|
23025
|
+
subjectToken: z48.string().min(1),
|
|
23026
|
+
actorToken: z48.string().min(1)
|
|
22913
23027
|
});
|
|
22914
|
-
var PeekUserSchema =
|
|
22915
|
-
id:
|
|
22916
|
-
name:
|
|
22917
|
-
email:
|
|
23028
|
+
var PeekUserSchema = z48.object({
|
|
23029
|
+
id: z48.string().min(1),
|
|
23030
|
+
name: z48.string().nullish(),
|
|
23031
|
+
email: z48.string().min(1)
|
|
22918
23032
|
});
|
|
22919
|
-
var PeekUsersResponseSchema =
|
|
22920
|
-
users:
|
|
22921
|
-
totalUsers:
|
|
23033
|
+
var PeekUsersResponseSchema = z48.object({
|
|
23034
|
+
users: z48.array(PeekUserSchema),
|
|
23035
|
+
totalUsers: z48.number().int().nonnegative()
|
|
22922
23036
|
});
|
|
22923
23037
|
async function readServiceFoundryErrorMessage(response) {
|
|
22924
23038
|
const body = await response.json().catch(() => void 0);
|
|
@@ -23044,7 +23158,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23044
23158
|
...extractErrorLogFields8(parsed.error),
|
|
23045
23159
|
reportable_error: { error: parsed.error }
|
|
23046
23160
|
});
|
|
23047
|
-
throw new
|
|
23161
|
+
throw new HTTPException27(424, {
|
|
23048
23162
|
message: "TrueFoundry ServiceFoundry put remote agent returned an unexpected response",
|
|
23049
23163
|
cause: parsed.error
|
|
23050
23164
|
});
|
|
@@ -23120,7 +23234,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23120
23234
|
this.#logger.error("TrueFoundry ServiceFoundry resolve agent-skill-versions returned an unexpected response", {
|
|
23121
23235
|
...extractErrorLogFields8(error)
|
|
23122
23236
|
});
|
|
23123
|
-
throw new
|
|
23237
|
+
throw new HTTPException27(500, {
|
|
23124
23238
|
message: "TrueFoundry ServiceFoundry resolve agent-skill-versions returned an unexpected response",
|
|
23125
23239
|
cause: error
|
|
23126
23240
|
});
|
|
@@ -23174,7 +23288,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23174
23288
|
...extractErrorLogFields8(error),
|
|
23175
23289
|
reportable_error: { error, extra: { mcp_server_id: input.mcpServerId } }
|
|
23176
23290
|
});
|
|
23177
|
-
throw new
|
|
23291
|
+
throw new HTTPException27(424, {
|
|
23178
23292
|
message: "TrueFoundry ServiceFoundry MCP authorize returned an unexpected response",
|
|
23179
23293
|
cause: error
|
|
23180
23294
|
});
|
|
@@ -23199,7 +23313,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23199
23313
|
...extractErrorLogFields8(error),
|
|
23200
23314
|
reportable_error: { error, extra: { mcp_server_id: input.mcpServerId } }
|
|
23201
23315
|
});
|
|
23202
|
-
throw new
|
|
23316
|
+
throw new HTTPException27(424, {
|
|
23203
23317
|
message: "TrueFoundry ServiceFoundry MCP auth status returned an unexpected response",
|
|
23204
23318
|
cause: error
|
|
23205
23319
|
});
|
|
@@ -23233,23 +23347,23 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23233
23347
|
method: "GET"
|
|
23234
23348
|
});
|
|
23235
23349
|
} catch (error) {
|
|
23236
|
-
if (error instanceof
|
|
23350
|
+
if (error instanceof HTTPException27 && (error.status === 401 || error.status === 403)) {
|
|
23237
23351
|
throw error;
|
|
23238
23352
|
}
|
|
23239
|
-
throw new
|
|
23353
|
+
throw new HTTPException27(500, {
|
|
23240
23354
|
message: "TrueFoundry ServiceFoundry session request failed",
|
|
23241
23355
|
cause: error
|
|
23242
23356
|
});
|
|
23243
23357
|
}
|
|
23244
23358
|
const parsed = GetSessionWireSchema.safeParse(payload);
|
|
23245
23359
|
if (!parsed.success) {
|
|
23246
|
-
throw new
|
|
23360
|
+
throw new HTTPException27(500, {
|
|
23247
23361
|
message: "TrueFoundry ServiceFoundry session response was malformed",
|
|
23248
23362
|
cause: parsed.error
|
|
23249
23363
|
});
|
|
23250
23364
|
}
|
|
23251
23365
|
if (parsed.data.user === null) {
|
|
23252
|
-
throw new
|
|
23366
|
+
throw new HTTPException27(401, { message: "Authentication required" });
|
|
23253
23367
|
}
|
|
23254
23368
|
return parsed.data;
|
|
23255
23369
|
}
|
|
@@ -23272,14 +23386,14 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23272
23386
|
});
|
|
23273
23387
|
} catch (error) {
|
|
23274
23388
|
const causeString = error instanceof Error ? error.message : String(error);
|
|
23275
|
-
throw new
|
|
23389
|
+
throw new HTTPException27(500, {
|
|
23276
23390
|
message: `TrueFoundry ServiceFoundry session request failed: ${causeString}`,
|
|
23277
23391
|
cause: error
|
|
23278
23392
|
});
|
|
23279
23393
|
}
|
|
23280
23394
|
const parsed = TenantControlPlaneUrlSchema.safeParse(payload);
|
|
23281
23395
|
if (!parsed.success) {
|
|
23282
|
-
throw new
|
|
23396
|
+
throw new HTTPException27(500, {
|
|
23283
23397
|
message: "TrueFoundry ServiceFoundry session response was malformed",
|
|
23284
23398
|
cause: parsed.error
|
|
23285
23399
|
});
|
|
@@ -23305,7 +23419,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23305
23419
|
...extractErrorLogFields8(parsed.error),
|
|
23306
23420
|
reportable_error: { error: parsed.error }
|
|
23307
23421
|
});
|
|
23308
|
-
throw new
|
|
23422
|
+
throw new HTTPException27(424, {
|
|
23309
23423
|
message: "TrueFoundry ServiceFoundry agent permissions response was malformed",
|
|
23310
23424
|
cause: parsed.error
|
|
23311
23425
|
});
|
|
@@ -23323,13 +23437,13 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23323
23437
|
accessToken: input.accessToken,
|
|
23324
23438
|
method: "GET"
|
|
23325
23439
|
});
|
|
23326
|
-
const parsed =
|
|
23440
|
+
const parsed = z48.array(z48.string()).safeParse(payload);
|
|
23327
23441
|
if (!parsed.success) {
|
|
23328
23442
|
this.#logger.error("TrueFoundry ServiceFoundry tenant permissions response was malformed", {
|
|
23329
23443
|
...extractErrorLogFields8(parsed.error),
|
|
23330
23444
|
reportable_error: { error: parsed.error }
|
|
23331
23445
|
});
|
|
23332
|
-
throw new
|
|
23446
|
+
throw new HTTPException27(424, {
|
|
23333
23447
|
message: "TrueFoundry ServiceFoundry tenant permissions response was malformed",
|
|
23334
23448
|
cause: parsed.error
|
|
23335
23449
|
});
|
|
@@ -23361,7 +23475,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23361
23475
|
this.#logger.error("TrueFoundry ServiceFoundry subjects response was malformed", {
|
|
23362
23476
|
...extractErrorLogFields8(parsed.error)
|
|
23363
23477
|
});
|
|
23364
|
-
throw new
|
|
23478
|
+
throw new HTTPException27(424, {
|
|
23365
23479
|
message: "TrueFoundry ServiceFoundry subjects response was malformed",
|
|
23366
23480
|
cause: parsed.error
|
|
23367
23481
|
});
|
|
@@ -23393,7 +23507,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23393
23507
|
...extractErrorLogFields8(parsed.error),
|
|
23394
23508
|
reportable_error: { error: parsed.error }
|
|
23395
23509
|
});
|
|
23396
|
-
throw new
|
|
23510
|
+
throw new HTTPException27(424, {
|
|
23397
23511
|
message: "TrueFoundry ServiceFoundry vend-token response was malformed",
|
|
23398
23512
|
cause: parsed.error
|
|
23399
23513
|
});
|
|
@@ -23407,7 +23521,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23407
23521
|
...extractErrorLogFields8(parsed.error),
|
|
23408
23522
|
reportable_error: { error: parsed.error }
|
|
23409
23523
|
});
|
|
23410
|
-
throw new
|
|
23524
|
+
throw new HTTPException27(424, {
|
|
23411
23525
|
message: "TrueFoundry ServiceFoundry server returned an unexpected list response",
|
|
23412
23526
|
cause: parsed.error
|
|
23413
23527
|
});
|
|
@@ -23464,7 +23578,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23464
23578
|
timedOut,
|
|
23465
23579
|
...extractErrorLogFields8(error)
|
|
23466
23580
|
});
|
|
23467
|
-
throw new
|
|
23581
|
+
throw new HTTPException27(500, {
|
|
23468
23582
|
message: timedOut ? `TrueFoundry ServiceFoundry server request timed out after ${String(timeoutMs / 1e3)}s` : "TrueFoundry ServiceFoundry server request failed",
|
|
23469
23583
|
cause: error
|
|
23470
23584
|
});
|
|
@@ -23478,7 +23592,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23478
23592
|
if (response.status === 401 || response.status === 403) {
|
|
23479
23593
|
record("error", response.status);
|
|
23480
23594
|
const detail = await readServiceFoundryErrorMessage(response);
|
|
23481
|
-
throw new
|
|
23595
|
+
throw new HTTPException27(response.status, {
|
|
23482
23596
|
message: `TrueFoundry ServiceFoundry server rejected the request: ${detail ?? `HTTP ${String(response.status)}`}`
|
|
23483
23597
|
});
|
|
23484
23598
|
}
|
|
@@ -23489,7 +23603,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23489
23603
|
if (!response.ok) {
|
|
23490
23604
|
record("error", response.status);
|
|
23491
23605
|
const detail = await readServiceFoundryErrorMessage(response);
|
|
23492
|
-
throw new
|
|
23606
|
+
throw new HTTPException27(424, {
|
|
23493
23607
|
message: `TrueFoundry ServiceFoundry server request failed: ${detail ?? `HTTP ${String(response.status)}`}`
|
|
23494
23608
|
});
|
|
23495
23609
|
}
|
|
@@ -23513,7 +23627,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
23513
23627
|
...extractErrorLogFields8(error),
|
|
23514
23628
|
reportable_error: { error }
|
|
23515
23629
|
});
|
|
23516
|
-
throw new
|
|
23630
|
+
throw new HTTPException27(424, {
|
|
23517
23631
|
message: "TrueFoundry ServiceFoundry server returned non-JSON",
|
|
23518
23632
|
cause: error
|
|
23519
23633
|
});
|
|
@@ -23725,7 +23839,7 @@ var TrueFoundryAgentStore = class {
|
|
|
23725
23839
|
};
|
|
23726
23840
|
|
|
23727
23841
|
// src/truefoundry/TrueFoundryAuthorizer.ts
|
|
23728
|
-
import { HTTPException as
|
|
23842
|
+
import { HTTPException as HTTPException28 } from "hono/http-exception";
|
|
23729
23843
|
var permissionByAction = {
|
|
23730
23844
|
read: "READ_AGENT",
|
|
23731
23845
|
use: "USE_AGENT",
|
|
@@ -23746,7 +23860,7 @@ function toResourcePermissions(permissions) {
|
|
|
23746
23860
|
}
|
|
23747
23861
|
function requireUserCredential(context) {
|
|
23748
23862
|
if (context.user_credential === null) {
|
|
23749
|
-
throw new
|
|
23863
|
+
throw new HTTPException28(401, { message: "Authentication token required for agent authorization" });
|
|
23750
23864
|
}
|
|
23751
23865
|
return context.user_credential;
|
|
23752
23866
|
}
|
|
@@ -23822,32 +23936,32 @@ var TrueFoundryAuthorizer = class {
|
|
|
23822
23936
|
|
|
23823
23937
|
// src/truefoundry/TrueFoundryMcpServerStore.ts
|
|
23824
23938
|
import { McpConnectionError as McpConnectionError6 } from "@truefoundry/trueforge-core/core";
|
|
23825
|
-
import { HTTPException as
|
|
23939
|
+
import { HTTPException as HTTPException30 } from "hono/http-exception";
|
|
23826
23940
|
init_config();
|
|
23827
23941
|
init_mcpServerStore();
|
|
23828
23942
|
|
|
23829
23943
|
// src/truefoundry/mapEnabledModels.ts
|
|
23830
23944
|
init_config();
|
|
23831
23945
|
import { SUPPORTED_REASONING_EFFORTS as SUPPORTED_REASONING_EFFORTS3 } from "@truefoundry/trueforge-core/core";
|
|
23832
|
-
import { HTTPException as
|
|
23833
|
-
import { z as
|
|
23834
|
-
var ModelParamSchema =
|
|
23835
|
-
key:
|
|
23836
|
-
supportedValues:
|
|
23946
|
+
import { HTTPException as HTTPException29 } from "hono/http-exception";
|
|
23947
|
+
import { z as z49 } from "zod";
|
|
23948
|
+
var ModelParamSchema = z49.object({
|
|
23949
|
+
key: z49.string(),
|
|
23950
|
+
supportedValues: z49.array(z49.string()).optional()
|
|
23837
23951
|
});
|
|
23838
|
-
var MetadataSchema =
|
|
23839
|
-
limits:
|
|
23840
|
-
context_window:
|
|
23841
|
-
max_input_tokens:
|
|
23842
|
-
max_output_tokens:
|
|
23843
|
-
max_tokens:
|
|
23952
|
+
var MetadataSchema = z49.object({
|
|
23953
|
+
limits: z49.object({
|
|
23954
|
+
context_window: z49.number().optional(),
|
|
23955
|
+
max_input_tokens: z49.number().optional(),
|
|
23956
|
+
max_output_tokens: z49.number().optional(),
|
|
23957
|
+
max_tokens: z49.number().optional()
|
|
23844
23958
|
}).optional(),
|
|
23845
|
-
params:
|
|
23959
|
+
params: z49.array(ModelParamSchema).optional()
|
|
23846
23960
|
});
|
|
23847
|
-
var IntegrationSchema =
|
|
23848
|
-
name:
|
|
23849
|
-
manifest:
|
|
23850
|
-
providerAccount:
|
|
23961
|
+
var IntegrationSchema = z49.object({
|
|
23962
|
+
name: z49.string().min(1),
|
|
23963
|
+
manifest: z49.object({ model_types: z49.array(z49.string()).optional() }),
|
|
23964
|
+
providerAccount: z49.object({ name: z49.string().min(1) }),
|
|
23851
23965
|
metadata: MetadataSchema.optional()
|
|
23852
23966
|
});
|
|
23853
23967
|
function toReasoningEfforts(params) {
|
|
@@ -23905,11 +24019,11 @@ function filterEnvModels(input) {
|
|
|
23905
24019
|
const allowed = new Set(allowedAccounts);
|
|
23906
24020
|
return input.models.filter((model) => allowed.has(model.accountName));
|
|
23907
24021
|
}
|
|
23908
|
-
var InstallationSchema =
|
|
23909
|
-
isDefault:
|
|
23910
|
-
manifest:
|
|
24022
|
+
var InstallationSchema = z49.object({
|
|
24023
|
+
isDefault: z49.boolean().optional(),
|
|
24024
|
+
manifest: z49.object({ url: z49.string().min(1) })
|
|
23911
24025
|
});
|
|
23912
|
-
var InstallationsEnvelopeSchema =
|
|
24026
|
+
var InstallationsEnvelopeSchema = z49.union([z49.array(z49.unknown()), z49.object({ data: z49.array(z49.unknown()) })]);
|
|
23913
24027
|
function resolveDefaultGatewayUrl(payload) {
|
|
23914
24028
|
const envelope = InstallationsEnvelopeSchema.parse(payload);
|
|
23915
24029
|
const rows = Array.isArray(envelope) ? envelope : envelope.data;
|
|
@@ -23919,7 +24033,7 @@ function resolveDefaultGatewayUrl(payload) {
|
|
|
23919
24033
|
return installation.manifest.url;
|
|
23920
24034
|
}
|
|
23921
24035
|
}
|
|
23922
|
-
throw new
|
|
24036
|
+
throw new HTTPException29(502, { message: "No default TrueFoundry AI gateway installation is configured" });
|
|
23923
24037
|
}
|
|
23924
24038
|
|
|
23925
24039
|
// src/truefoundry/TrueFoundryMcpServerStore.ts
|
|
@@ -23973,7 +24087,7 @@ var TrueFoundryMcpServerStore = class {
|
|
|
23973
24087
|
if (status.status === "auth_required") {
|
|
23974
24088
|
const authUrl = status.authorization_url;
|
|
23975
24089
|
if (authUrl === void 0 || authUrl.length === 0) {
|
|
23976
|
-
throw new
|
|
24090
|
+
throw new HTTPException30(422, {
|
|
23977
24091
|
message: `MCP server "${record.name}" requires authentication but returned no authorization URL`
|
|
23978
24092
|
});
|
|
23979
24093
|
}
|
|
@@ -24527,7 +24641,7 @@ var TrueFoundrySandboxProviderStore = class {
|
|
|
24527
24641
|
};
|
|
24528
24642
|
|
|
24529
24643
|
// src/truefoundry/TrueFoundrySkillStore.ts
|
|
24530
|
-
import { HTTPException as
|
|
24644
|
+
import { HTTPException as HTTPException31 } from "hono/http-exception";
|
|
24531
24645
|
function toRegistryRecord(tenant_id, skill) {
|
|
24532
24646
|
const now2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
24533
24647
|
const manifest = {
|
|
@@ -24568,18 +24682,18 @@ var TrueFoundryAdminSkillStore = class {
|
|
|
24568
24682
|
return skills.map((skill) => {
|
|
24569
24683
|
const row = byFqn.get(skill.name);
|
|
24570
24684
|
if (row === void 0) {
|
|
24571
|
-
throw new
|
|
24685
|
+
throw new HTTPException31(422, {
|
|
24572
24686
|
message: `Unknown skill "${skill.name}" \u2014 not configured`
|
|
24573
24687
|
});
|
|
24574
24688
|
}
|
|
24575
24689
|
if (row.presigned_url === void 0) {
|
|
24576
|
-
throw new
|
|
24690
|
+
throw new HTTPException31(422, {
|
|
24577
24691
|
message: `Skill "${skill.name}" did not return a presigned URL`
|
|
24578
24692
|
});
|
|
24579
24693
|
}
|
|
24580
24694
|
const skillMdContent = skill.preload ? row.skill_md_content ?? null : null;
|
|
24581
24695
|
if (skill.preload && (skillMdContent === null || skillMdContent.length === 0)) {
|
|
24582
|
-
throw new
|
|
24696
|
+
throw new HTTPException31(422, {
|
|
24583
24697
|
message: `Skill "${skill.name}" did not return SKILL.md for preload`
|
|
24584
24698
|
});
|
|
24585
24699
|
}
|
|
@@ -24606,7 +24720,7 @@ var TrueFoundrySkillStore = class extends TrueFoundryAdminSkillStore {
|
|
|
24606
24720
|
async listSkills(input, transaction) {
|
|
24607
24721
|
void transaction;
|
|
24608
24722
|
if (input.names !== void 0) {
|
|
24609
|
-
throw new
|
|
24723
|
+
throw new HTTPException31(422, {
|
|
24610
24724
|
message: "TrueFoundry skill list does not support name filters"
|
|
24611
24725
|
});
|
|
24612
24726
|
}
|
|
@@ -24654,7 +24768,7 @@ var TrueFoundrySkillStore = class extends TrueFoundryAdminSkillStore {
|
|
|
24654
24768
|
const seenFqns = /* @__PURE__ */ new Set();
|
|
24655
24769
|
for (const skill of skills) {
|
|
24656
24770
|
if (seenFqns.has(skill.name)) {
|
|
24657
|
-
throw new
|
|
24771
|
+
throw new HTTPException31(422, {
|
|
24658
24772
|
message: `Duplicate skill FQN "${skill.name}"`
|
|
24659
24773
|
});
|
|
24660
24774
|
}
|
|
@@ -24668,7 +24782,7 @@ var TrueFoundrySkillStore = class extends TrueFoundryAdminSkillStore {
|
|
|
24668
24782
|
const byFqn = new Map(resolved.map((row) => [row.fqn, row]));
|
|
24669
24783
|
for (const skill of skills) {
|
|
24670
24784
|
if (!byFqn.has(skill.name)) {
|
|
24671
|
-
throw new
|
|
24785
|
+
throw new HTTPException31(422, {
|
|
24672
24786
|
message: `Unknown skill "${skill.name}" \u2014 not configured`
|
|
24673
24787
|
});
|
|
24674
24788
|
}
|
|
@@ -24676,7 +24790,7 @@ var TrueFoundrySkillStore = class extends TrueFoundryAdminSkillStore {
|
|
|
24676
24790
|
const seenNames = /* @__PURE__ */ new Set();
|
|
24677
24791
|
for (const row of resolved) {
|
|
24678
24792
|
if (seenNames.has(row.name)) {
|
|
24679
|
-
throw new
|
|
24793
|
+
throw new HTTPException31(422, {
|
|
24680
24794
|
message: `Agent skills must have unique names; duplicate skill name(s): ${row.name}`
|
|
24681
24795
|
});
|
|
24682
24796
|
}
|
|
@@ -25284,6 +25398,10 @@ async function createServerRuntime(persistence, logger2) {
|
|
|
25284
25398
|
rawInlineSkillsHeader === void 0 ? {} : { inlineSkills: parseInlineSkills(rawInlineSkillsHeader) }
|
|
25285
25399
|
);
|
|
25286
25400
|
};
|
|
25401
|
+
const resolveCapabilitiesStore = (input) => capabilitiesStoreFromHeader({
|
|
25402
|
+
header: input.c?.req.header(X_TFG_TOOLS),
|
|
25403
|
+
isTrueFoundryMode
|
|
25404
|
+
});
|
|
25287
25405
|
const app = createServerApp({
|
|
25288
25406
|
modelCatalog: ModelCatalog.load(),
|
|
25289
25407
|
mcpCatalog: McpCatalog.load(),
|
|
@@ -25297,6 +25415,7 @@ async function createServerRuntime(persistence, logger2) {
|
|
|
25297
25415
|
resolveWebSearchProviderStore,
|
|
25298
25416
|
resolveSkillStore,
|
|
25299
25417
|
resolveTurnSkillsStore: resolveTurnSkillsStoreForRequest,
|
|
25418
|
+
resolveCapabilitiesStore,
|
|
25300
25419
|
withTransaction,
|
|
25301
25420
|
tokenStore,
|
|
25302
25421
|
scheduleStore,
|