@truefoundry/trueforge 0.2.0-rc.6 → 0.2.0-rc.7
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 +17 -6
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -8100,6 +8100,7 @@ var GetAgentCodeSnippetsRequestQuerySchema = z2.object({
|
|
|
8100
8100
|
// src/schemas/agentImport.ts
|
|
8101
8101
|
init_common();
|
|
8102
8102
|
var RESERVED_AGENT_NAMES2 = /* @__PURE__ */ new Set(["tfg", "trueforge"]);
|
|
8103
|
+
var ImportAgentCollaboratorSchema = z3.object({}).loose().openapi("ImportAgentCollaborator");
|
|
8103
8104
|
var ImportAgentItemSchema = z3.object({
|
|
8104
8105
|
name: NameSchema.refine((name) => !RESERVED_AGENT_NAMES2.has(name), {
|
|
8105
8106
|
message: "Agent name is reserved, cannot be used"
|
|
@@ -8107,7 +8108,8 @@ var ImportAgentItemSchema = z3.object({
|
|
|
8107
8108
|
description: AgentDescriptionSchema.optional(),
|
|
8108
8109
|
manifest: AgentSpecSchema5,
|
|
8109
8110
|
tenant_id: z3.string().min(1).describe("Tenant to create the agent under."),
|
|
8110
|
-
created_by_subject: CreatedBySubjectSchema3.describe("Original creator to persist on the agent.")
|
|
8111
|
+
created_by_subject: CreatedBySubjectSchema3.describe("Original creator to persist on the agent."),
|
|
8112
|
+
collaborators: z3.array(ImportAgentCollaboratorSchema).optional()
|
|
8111
8113
|
}).strict().openapi("ImportAgentItem");
|
|
8112
8114
|
var ImportAgentsRequestSchema = z3.object({
|
|
8113
8115
|
agents: z3.array(ImportAgentItemSchema).describe("Agents to create; each carries tenant_id and created_by_subject.")
|
|
@@ -8729,6 +8731,7 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
8729
8731
|
}
|
|
8730
8732
|
/** PUT `/internal/tfg/agents` — create/reuse remote agent + sync model/MCP grants. */
|
|
8731
8733
|
async putRemoteAgent(input) {
|
|
8734
|
+
const hasCollaborators = input.collaborators && input.collaborators.length > 0;
|
|
8732
8735
|
const payload = await this.#requestJson({
|
|
8733
8736
|
url: this.#url(TFG_AGENTS_PATH),
|
|
8734
8737
|
accessToken: input.accessToken,
|
|
@@ -8738,7 +8741,8 @@ var TrueFoundryServiceFoundryServerClient = class {
|
|
|
8738
8741
|
name: input.name,
|
|
8739
8742
|
description: input.description,
|
|
8740
8743
|
model: input.model,
|
|
8741
|
-
mcp_servers: input.mcp_servers
|
|
8744
|
+
mcp_servers: input.mcp_servers,
|
|
8745
|
+
...hasCollaborators ? { collaborators: input.collaborators } : {}
|
|
8742
8746
|
}
|
|
8743
8747
|
});
|
|
8744
8748
|
const parsed = PutRemoteAgentResponseSchema.safeParse(payload);
|
|
@@ -9125,7 +9129,10 @@ function createAgentImportRouter(deps) {
|
|
|
9125
9129
|
description: agent.description ?? agent.name,
|
|
9126
9130
|
manifest: agent.manifest,
|
|
9127
9131
|
external_id: null,
|
|
9128
|
-
created_by_subject: agent.created_by_subject
|
|
9132
|
+
created_by_subject: agent.created_by_subject,
|
|
9133
|
+
custom: {
|
|
9134
|
+
...agent.collaborators ? { collaborators: agent.collaborators } : {}
|
|
9135
|
+
}
|
|
9129
9136
|
});
|
|
9130
9137
|
results.push({
|
|
9131
9138
|
name: created.name,
|
|
@@ -17758,13 +17765,15 @@ function asError(value) {
|
|
|
17758
17765
|
function toPutRemoteAgentPayload({
|
|
17759
17766
|
name,
|
|
17760
17767
|
description,
|
|
17761
|
-
manifest
|
|
17768
|
+
manifest,
|
|
17769
|
+
collaborators
|
|
17762
17770
|
}) {
|
|
17763
17771
|
return {
|
|
17764
17772
|
name,
|
|
17765
17773
|
description: (description || name).slice(0, AGENT_DESCRIPTION_MAX_LENGTH),
|
|
17766
17774
|
model: manifest.model.name,
|
|
17767
|
-
mcp_servers: (manifest.mcp_servers ?? []).map((server) => server.name)
|
|
17775
|
+
mcp_servers: (manifest.mcp_servers ?? []).map((server) => server.name),
|
|
17776
|
+
...collaborators ? { collaborators } : {}
|
|
17768
17777
|
};
|
|
17769
17778
|
}
|
|
17770
17779
|
var TrueFoundryAgentStore = class {
|
|
@@ -17806,12 +17815,14 @@ var TrueFoundryAgentStore = class {
|
|
|
17806
17815
|
const created = await this.#inner.createAgent({ ...input, external_id: null }, transaction);
|
|
17807
17816
|
let externalId;
|
|
17808
17817
|
try {
|
|
17818
|
+
const collaborators = input.custom?.["collaborators"];
|
|
17809
17819
|
({ externalId } = await this.#client.putRemoteAgent({
|
|
17810
17820
|
accessToken: await this.#resolveAccessToken(),
|
|
17811
17821
|
...toPutRemoteAgentPayload({
|
|
17812
17822
|
name: input.name,
|
|
17813
17823
|
description: input.description,
|
|
17814
|
-
manifest: input.manifest
|
|
17824
|
+
manifest: input.manifest,
|
|
17825
|
+
...collaborators ? { collaborators } : {}
|
|
17815
17826
|
})
|
|
17816
17827
|
}));
|
|
17817
17828
|
const updated = await this.#inner.updateAgent(
|