@truefoundry/trueforge 0.2.0-rc.6 → 0.2.0-rc.8

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 CHANGED
@@ -8107,7 +8107,8 @@ var ImportAgentItemSchema = z3.object({
8107
8107
  description: AgentDescriptionSchema.optional(),
8108
8108
  manifest: AgentSpecSchema5,
8109
8109
  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.")
8110
+ created_by_subject: CreatedBySubjectSchema3.describe("Original creator to persist on the agent."),
8111
+ truefoundry_managed_agent_id: z3.string()
8111
8112
  }).strict().openapi("ImportAgentItem");
8112
8113
  var ImportAgentsRequestSchema = z3.object({
8113
8114
  agents: z3.array(ImportAgentItemSchema).describe("Agents to create; each carries tenant_id and created_by_subject.")
@@ -8729,6 +8730,7 @@ var TrueFoundryServiceFoundryServerClient = class {
8729
8730
  }
8730
8731
  /** PUT `/internal/tfg/agents` — create/reuse remote agent + sync model/MCP grants. */
8731
8732
  async putRemoteAgent(input) {
8733
+ const hasTrueFoundryManagedAgentId = input.trueFoundryManagedAgentId !== void 0;
8732
8734
  const payload = await this.#requestJson({
8733
8735
  url: this.#url(TFG_AGENTS_PATH),
8734
8736
  accessToken: input.accessToken,
@@ -8738,7 +8740,8 @@ var TrueFoundryServiceFoundryServerClient = class {
8738
8740
  name: input.name,
8739
8741
  description: input.description,
8740
8742
  model: input.model,
8741
- mcp_servers: input.mcp_servers
8743
+ mcp_servers: input.mcp_servers,
8744
+ ...hasTrueFoundryManagedAgentId ? { trueFoundryManagedAgentId: input.trueFoundryManagedAgentId } : {}
8742
8745
  }
8743
8746
  });
8744
8747
  const parsed = PutRemoteAgentResponseSchema.safeParse(payload);
@@ -9125,7 +9128,10 @@ function createAgentImportRouter(deps) {
9125
9128
  description: agent.description ?? agent.name,
9126
9129
  manifest: agent.manifest,
9127
9130
  external_id: null,
9128
- created_by_subject: agent.created_by_subject
9131
+ created_by_subject: agent.created_by_subject,
9132
+ custom: {
9133
+ trueFoundryManagedAgentId: agent.truefoundry_managed_agent_id
9134
+ }
9129
9135
  });
9130
9136
  results.push({
9131
9137
  name: created.name,
@@ -17758,13 +17764,15 @@ function asError(value) {
17758
17764
  function toPutRemoteAgentPayload({
17759
17765
  name,
17760
17766
  description,
17761
- manifest
17767
+ manifest,
17768
+ trueFoundryManagedAgentId
17762
17769
  }) {
17763
17770
  return {
17764
17771
  name,
17765
17772
  description: (description || name).slice(0, AGENT_DESCRIPTION_MAX_LENGTH),
17766
17773
  model: manifest.model.name,
17767
- mcp_servers: (manifest.mcp_servers ?? []).map((server) => server.name)
17774
+ mcp_servers: (manifest.mcp_servers ?? []).map((server) => server.name),
17775
+ ...trueFoundryManagedAgentId ? { trueFoundryManagedAgentId } : {}
17768
17776
  };
17769
17777
  }
17770
17778
  var TrueFoundryAgentStore = class {
@@ -17806,12 +17814,14 @@ var TrueFoundryAgentStore = class {
17806
17814
  const created = await this.#inner.createAgent({ ...input, external_id: null }, transaction);
17807
17815
  let externalId;
17808
17816
  try {
17817
+ const trueFoundryManagedAgentId = input.custom?.["trueFoundryManagedAgentId"];
17809
17818
  ({ externalId } = await this.#client.putRemoteAgent({
17810
17819
  accessToken: await this.#resolveAccessToken(),
17811
17820
  ...toPutRemoteAgentPayload({
17812
17821
  name: input.name,
17813
17822
  description: input.description,
17814
- manifest: input.manifest
17823
+ manifest: input.manifest,
17824
+ ...trueFoundryManagedAgentId ? { trueFoundryManagedAgentId } : {}
17815
17825
  })
17816
17826
  }));
17817
17827
  const updated = await this.#inner.updateAgent(