@truefoundry/assistant-ui-runtime 0.1.10-rc.1 → 0.1.12

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/{chunk-BRPTG6VA.js → chunk-2NLIAJJX.js} +100 -12
  3. package/dist/chunk-2NLIAJJX.js.map +1 -0
  4. package/dist/index.d.ts +13 -2
  5. package/dist/index.js +70 -66
  6. package/dist/index.js.map +1 -1
  7. package/dist/plugins/truefoundry-agent-server-adapter/index.d.ts +3 -3
  8. package/dist/plugins/truefoundry-agent-server-adapter/index.js +1 -1
  9. package/dist/server/index.d.ts +2 -2
  10. package/dist/{types-CgZUnILu.d.ts → types-CSRQSnHu.d.ts} +148 -80
  11. package/package.json +3 -3
  12. package/src/convertTurnMessages.test.ts +123 -0
  13. package/src/convertTurnMessages.ts +8 -2
  14. package/src/draft/truefoundryDraftThreadListAdapter.test.ts +58 -4
  15. package/src/draft/truefoundryDraftThreadListAdapter.ts +18 -22
  16. package/src/index.ts +27 -0
  17. package/src/plugins/truefoundry-agent-server-adapter/chatServer.ts +1 -1
  18. package/src/plugins/truefoundry-agent-server-adapter/cp.test.ts +169 -6
  19. package/src/plugins/truefoundry-agent-server-adapter/cp.ts +126 -1
  20. package/src/plugins/truefoundry-agent-server-adapter/createTrueFoundryAgentUIServer.ts +7 -0
  21. package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.test.ts +34 -0
  22. package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.ts +12 -5
  23. package/src/plugins/truefoundry-agent-server-adapter/types.ts +2 -2
  24. package/src/server/index.ts +15 -0
  25. package/src/server/types.ts +448 -381
  26. package/src/sessionThreadMetadata.ts +42 -0
  27. package/src/truefoundryOwnedSessionsThreadListAdapter.test.ts +17 -0
  28. package/src/truefoundryOwnedSessionsThreadListAdapter.ts +13 -25
  29. package/src/truefoundryThreadListAdapter.test.ts +17 -9
  30. package/src/truefoundryThreadListAdapter.ts +9 -14
  31. package/src/types.ts +5 -0
  32. package/src/useTrueFoundryAgentRuntime.ts +4 -1
  33. package/dist/chunk-BRPTG6VA.js.map +0 -1
@@ -29,6 +29,24 @@ describe("normalizeMcpMount", () => {
29
29
  name: "deepwiki-mcp",
30
30
  });
31
31
  });
32
+
33
+ it("forwards enableTools / preload / config from catalog rows", () => {
34
+ expect(
35
+ normalizeMcpMount({
36
+ id: "gmail",
37
+ name: "gmail",
38
+ enableTools: ["@read-only"],
39
+ preload: true,
40
+ config: { locale: "en" },
41
+ }),
42
+ ).toEqual({
43
+ type: "truefoundry-mcp-registry",
44
+ name: "gmail",
45
+ enableTools: ["@read-only"],
46
+ preload: true,
47
+ config: { locale: "en" },
48
+ });
49
+ });
32
50
  });
33
51
 
34
52
  describe("normalizeSkillMount", () => {
@@ -57,6 +75,22 @@ describe("normalizeSkillMount", () => {
57
75
  fqn: "agent-skill:truefoundry/skills/web:1",
58
76
  });
59
77
  });
78
+
79
+ it("forwards preload / config from catalog rows, including preload false", () => {
80
+ expect(
81
+ normalizeSkillMount({
82
+ id: "agent-skill:truefoundry/skills/web:1",
83
+ name: "web",
84
+ preload: false,
85
+ config: { timeoutMs: 1000 },
86
+ }),
87
+ ).toEqual({
88
+ type: "truefoundry-skills-registry",
89
+ fqn: "agent-skill:truefoundry/skills/web:1",
90
+ preload: false,
91
+ config: { timeoutMs: 1000 },
92
+ });
93
+ });
60
94
  });
61
95
 
62
96
  describe("normalizeAgentSpecForGateway", () => {
@@ -20,7 +20,7 @@ export function normalizeMcpMount(
20
20
  throw new Error("mcpServers entry must be an object");
21
21
  }
22
22
  if (raw.type === "truefoundry-mcp-registry" || raw.type === "inline") {
23
- return raw as TruefoundryGatewayApi.McpServer;
23
+ return raw as unknown as TruefoundryGatewayApi.McpServer;
24
24
  }
25
25
  const name =
26
26
  (typeof raw.name === "string" && raw.name !== "" ? raw.name : null) ??
@@ -33,7 +33,13 @@ export function normalizeMcpMount(
33
33
  "mcpServers entry needs name, mcpName, or id to mount as registry MCP",
34
34
  );
35
35
  }
36
- return { type: "truefoundry-mcp-registry", name };
36
+ return {
37
+ type: "truefoundry-mcp-registry",
38
+ name,
39
+ ...(Array.isArray(raw.enableTools) ? { enableTools: raw.enableTools } : {}),
40
+ ...(typeof raw.preload === "boolean" ? { preload: raw.preload } : {}),
41
+ ...(raw.config != null ? { config: raw.config } : {}),
42
+ } as unknown as TruefoundryGatewayApi.McpServer;
37
43
  }
38
44
 
39
45
  export function normalizeSkillMount(
@@ -43,7 +49,7 @@ export function normalizeSkillMount(
43
49
  throw new Error("skills entry must be an object");
44
50
  }
45
51
  if (raw.type === "truefoundry-skills-registry" || raw.type === "git") {
46
- return raw as TruefoundryGatewayApi.SkillMount;
52
+ return raw as unknown as TruefoundryGatewayApi.SkillMount;
47
53
  }
48
54
  const fqn =
49
55
  (typeof raw.fqn === "string" && raw.fqn !== "" ? raw.fqn : null) ??
@@ -56,8 +62,9 @@ export function normalizeSkillMount(
56
62
  return {
57
63
  type: "truefoundry-skills-registry",
58
64
  fqn,
59
- ...(raw.preload === true ? { preload: true } : {}),
60
- };
65
+ ...(typeof raw.preload === "boolean" ? { preload: raw.preload } : {}),
66
+ ...(raw.config != null ? { config: raw.config } : {}),
67
+ } as unknown as TruefoundryGatewayApi.SkillMount;
61
68
  }
62
69
 
63
70
  /** Rewrite UI `{id,name}` mounts so create/update draft session can serialize. */
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * TrueFoundry-specific type extensions over the runtime's generic bases.
3
3
  *
4
- * The runtime defines minimal bases (SkillMount = {id,name}, McpServerMount =
5
- * {id,name}, AgentSpec.config = unknown, etc.) that hosts extend via generics.
4
+ * The runtime defines opaque mount bases (`SkillMount` / `McpServerMount` =
5
+ * `object`) that hosts intersect with gateway shapes via generics.
6
6
  *
7
7
  * This file builds the concrete TrueFoundry types by:
8
8
  * - Importing the runtime's AgentSpec as the base to extend.
@@ -4,11 +4,17 @@ export type {
4
4
  ConnectorSelectorEntry,
5
5
  AgentSelectorEntry,
6
6
  SearchAgentSelectorParams,
7
+ ModelSelection,
8
+ AgentSkill,
9
+ ConnectorState,
10
+ AgentLibraryEntry,
11
+ SearchAgentsParams,
7
12
  SkillMount,
8
13
  McpServerMount,
9
14
  ModelParams,
10
15
  Model,
11
16
  AgentSpec,
17
+ SaveAgentRequest,
12
18
  Session,
13
19
  CreateSessionRequest,
14
20
  UpdateSessionRequest,
@@ -30,6 +36,7 @@ export type {
30
36
  TurnState,
31
37
  Turn,
32
38
  AgentChatServer,
39
+ AgentBuilderCapabilitiesResponse,
33
40
  AgentBuilderServer,
34
41
  ProviderType,
35
42
  ModelEntry,
@@ -54,6 +61,8 @@ export type {
54
61
  ConnectorCatalogEntry,
55
62
  CreateConnectorRequest,
56
63
  UpdateConnectorRequest,
64
+ AuthenticateConnectorRequest,
65
+ ConnectorAuthenticationResult,
57
66
  ConnectorCatalogServer,
58
67
  SkillBase,
59
68
  RegistrySkill,
@@ -71,9 +80,15 @@ export type {
71
80
  SandboxBase,
72
81
  CreateSandboxRequest,
73
82
  UpdateSandboxRequest,
83
+ SandboxProviderConfig,
84
+ SandboxProviderCatalogEntry,
85
+ SandboxProviderBase,
86
+ CreateSandboxProviderRequest,
87
+ UpdateSandboxProviderRequest,
74
88
  SandboxCatalogServer,
75
89
  CatalogServer,
76
90
  AgentUIServerPort,
91
+ AgentUIServer,
77
92
  } from "./types.js";
78
93
 
79
94
  export type {