@truefoundry/trueforge-ui 0.3.0-rc.2 → 0.3.0-rc.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +17 -9
  3. package/dist/{AgentCodeSnippets-637HQUXD.js → AgentCodeSnippets-N546FNNS.js} +38 -23
  4. package/dist/AgentCodeSnippets-N546FNNS.js.map +1 -0
  5. package/dist/AgentMetricChart-YWJYVYYA.js +15 -0
  6. package/dist/{AgentOverview-3FJ5EE6N.js → AgentOverview-VF74XC7I.js} +7 -7
  7. package/dist/{AgentSessionEventTimeline-VELWUYPR.js → AgentSessionEventTimeline-RFR6LQMY.js} +8 -8
  8. package/dist/{AgentSessionEventTimeline-VELWUYPR.js.map → AgentSessionEventTimeline-RFR6LQMY.js.map} +1 -1
  9. package/dist/{AgentSessionEventTimelineChart-CUKETHWM.js → AgentSessionEventTimelineChart-27CQF6FX.js} +12 -12
  10. package/dist/AgentSessionEventTimelineChart-27CQF6FX.js.map +1 -0
  11. package/dist/{AgentSessions-T7MOGOTZ.js → AgentSessions-4IVX2SGD.js} +36 -12
  12. package/dist/AgentSessions-4IVX2SGD.js.map +1 -0
  13. package/dist/{ConnectorSettings-ESZ2RSRG.js → ConnectorSettings-R5VEP7BO.js} +156 -116
  14. package/dist/ConnectorSettings-R5VEP7BO.js.map +1 -0
  15. package/dist/{DockLayout-NLFNU6F2.js → DockLayout-F44RWGEY.js} +10 -10
  16. package/dist/{DrawerLayout-PR3SMKA6.js → DrawerLayout-SQ323AVM.js} +13 -11
  17. package/dist/DrawerLayout-SQ323AVM.js.map +1 -0
  18. package/dist/{ModelSettings-LYW64IRR.js → ModelSettings-6QLS63HM.js} +10 -10
  19. package/dist/{ModelSettings-LYW64IRR.js.map → ModelSettings-6QLS63HM.js.map} +1 -1
  20. package/dist/OpenUiFenceBlock-4ROX3G4X.js +9 -0
  21. package/dist/{SandboxSettings-DF64LHYI.js → SandboxSettings-OLKDXIQS.js} +9 -9
  22. package/dist/SchedulesPage-TMOTK6DR.js +15 -0
  23. package/dist/{SettingsBuilder-LSXK2VN4.js → SettingsBuilder-GISAH2WU.js} +8 -8
  24. package/dist/{ShellRouteSync-B22IAV2W.js → ShellRouteSync-EN33DUQ7.js} +157 -22
  25. package/dist/ShellRouteSync-EN33DUQ7.js.map +1 -0
  26. package/dist/{SidebarLayout-XW6LXB7R.js → SidebarLayout-35K4AKTC.js} +74 -53
  27. package/dist/SidebarLayout-35K4AKTC.js.map +1 -0
  28. package/dist/{SkillSettings-64VXUO6J.js → SkillSettings-JSX2BTII.js} +18 -13
  29. package/dist/SkillSettings-JSX2BTII.js.map +1 -0
  30. package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js → TrueForgeUIWithRouter-6VCR7ES3.js} +9 -9
  31. package/dist/{WidgetLayout-Q5P7PYSJ.js → WidgetLayout-RKBSN2FZ.js} +10 -10
  32. package/dist/{chunk-YQO2NMJ3.js → chunk-2O5EJ6QS.js} +4096 -2825
  33. package/dist/chunk-2O5EJ6QS.js.map +1 -0
  34. package/dist/chunk-6WCIL3H2.js +517 -0
  35. package/dist/chunk-6WCIL3H2.js.map +1 -0
  36. package/dist/{chunk-SQGT43Z3.js → chunk-73FQVITT.js} +21 -4
  37. package/dist/chunk-73FQVITT.js.map +1 -0
  38. package/dist/{chunk-QC42MLAK.js → chunk-7AAO4UDQ.js} +4 -3
  39. package/dist/chunk-7AAO4UDQ.js.map +1 -0
  40. package/dist/{chunk-LGRHHFHN.js → chunk-F5QVQIBH.js} +166 -45
  41. package/dist/chunk-F5QVQIBH.js.map +1 -0
  42. package/dist/{chunk-I3AL54MA.js → chunk-GIPFF6FZ.js} +28 -24
  43. package/dist/chunk-GIPFF6FZ.js.map +1 -0
  44. package/dist/{chunk-GXYAOAK5.js → chunk-GSJAYYLR.js} +219 -162
  45. package/dist/chunk-GSJAYYLR.js.map +1 -0
  46. package/dist/{chunk-VJ7BZGAF.js → chunk-J5BPHEDT.js} +2 -2
  47. package/dist/chunk-KR7WYHVF.js +195 -0
  48. package/dist/chunk-KR7WYHVF.js.map +1 -0
  49. package/dist/{chunk-VUMGMGKZ.js → chunk-LUG7E6BL.js} +52 -8
  50. package/dist/chunk-LUG7E6BL.js.map +1 -0
  51. package/dist/chunk-LXJMINS6.js +587 -0
  52. package/dist/chunk-LXJMINS6.js.map +1 -0
  53. package/dist/{chunk-FQK2XVVE.js → chunk-PT4EENB3.js} +224 -72
  54. package/dist/chunk-PT4EENB3.js.map +1 -0
  55. package/dist/{chunk-H6WTY5PM.js → chunk-Q6TCT7ZJ.js} +17 -227
  56. package/dist/chunk-Q6TCT7ZJ.js.map +1 -0
  57. package/dist/{chunk-5I2COQNL.js → chunk-XLFOXQKZ.js} +13 -11
  58. package/dist/chunk-XLFOXQKZ.js.map +1 -0
  59. package/dist/{chunk-G2TUAD65.js → chunk-XY6LZQES.js} +235 -108
  60. package/dist/chunk-XY6LZQES.js.map +1 -0
  61. package/dist/{createTrueFoundryServer-CmZnBh_l.d.ts → createTrueFoundryServer-B_FYhSdn.d.ts} +8 -5
  62. package/dist/index.d.ts +291 -89
  63. package/dist/index.js +63 -488
  64. package/dist/index.js.map +1 -1
  65. package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +36 -13
  66. package/dist/plugins/trueforge-agent-server-adapter/index.js +69 -35
  67. package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
  68. package/dist/styles.css +1 -1
  69. package/package.json +3 -3
  70. package/dist/AgentCodeSnippets-637HQUXD.js.map +0 -1
  71. package/dist/AgentMetricChart-4FYECRIN.js +0 -15
  72. package/dist/AgentSessionEventTimelineChart-CUKETHWM.js.map +0 -1
  73. package/dist/AgentSessions-T7MOGOTZ.js.map +0 -1
  74. package/dist/ConnectorSettings-ESZ2RSRG.js.map +0 -1
  75. package/dist/DrawerLayout-PR3SMKA6.js.map +0 -1
  76. package/dist/OpenUiFenceBlock-JEPNPJ7U.js +0 -9
  77. package/dist/SchedulesPage-WQU4H25F.js +0 -15
  78. package/dist/ShellRouteSync-B22IAV2W.js.map +0 -1
  79. package/dist/SidebarLayout-XW6LXB7R.js.map +0 -1
  80. package/dist/SkillSettings-64VXUO6J.js.map +0 -1
  81. package/dist/chunk-5I2COQNL.js.map +0 -1
  82. package/dist/chunk-BWHOZFIV.js +0 -587
  83. package/dist/chunk-BWHOZFIV.js.map +0 -1
  84. package/dist/chunk-FQK2XVVE.js.map +0 -1
  85. package/dist/chunk-G2TUAD65.js.map +0 -1
  86. package/dist/chunk-GXYAOAK5.js.map +0 -1
  87. package/dist/chunk-H6WTY5PM.js.map +0 -1
  88. package/dist/chunk-I3AL54MA.js.map +0 -1
  89. package/dist/chunk-LGRHHFHN.js.map +0 -1
  90. package/dist/chunk-NHHSZB5N.js +0 -74
  91. package/dist/chunk-NHHSZB5N.js.map +0 -1
  92. package/dist/chunk-QC42MLAK.js.map +0 -1
  93. package/dist/chunk-SFZNIO6U.js +0 -18
  94. package/dist/chunk-SFZNIO6U.js.map +0 -1
  95. package/dist/chunk-SQGT43Z3.js.map +0 -1
  96. package/dist/chunk-VUMGMGKZ.js.map +0 -1
  97. package/dist/chunk-YQO2NMJ3.js.map +0 -1
  98. /package/dist/{AgentMetricChart-4FYECRIN.js.map → AgentMetricChart-YWJYVYYA.js.map} +0 -0
  99. /package/dist/{AgentOverview-3FJ5EE6N.js.map → AgentOverview-VF74XC7I.js.map} +0 -0
  100. /package/dist/{DockLayout-NLFNU6F2.js.map → DockLayout-F44RWGEY.js.map} +0 -0
  101. /package/dist/{OpenUiFenceBlock-JEPNPJ7U.js.map → OpenUiFenceBlock-4ROX3G4X.js.map} +0 -0
  102. /package/dist/{SandboxSettings-DF64LHYI.js.map → SandboxSettings-OLKDXIQS.js.map} +0 -0
  103. /package/dist/{SchedulesPage-WQU4H25F.js.map → SchedulesPage-TMOTK6DR.js.map} +0 -0
  104. /package/dist/{SettingsBuilder-LSXK2VN4.js.map → SettingsBuilder-GISAH2WU.js.map} +0 -0
  105. /package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js.map → TrueForgeUIWithRouter-6VCR7ES3.js.map} +0 -0
  106. /package/dist/{WidgetLayout-Q5P7PYSJ.js.map → WidgetLayout-RKBSN2FZ.js.map} +0 -0
  107. /package/dist/{chunk-VJ7BZGAF.js.map → chunk-J5BPHEDT.js.map} +0 -0
@@ -1,9 +1,6 @@
1
1
  import {
2
2
  createTrueFoundryServer
3
- } from "../../chunk-QC42MLAK.js";
4
- import {
5
- drainListPages
6
- } from "../../chunk-SFZNIO6U.js";
3
+ } from "../../chunk-7AAO4UDQ.js";
7
4
  import {
8
5
  readSessionIsCreateAgent
9
6
  } from "../../chunk-RDXBMTP5.js";
@@ -116,7 +113,10 @@ function toUiMcpServer(server) {
116
113
  return server;
117
114
  }
118
115
  function toUiSkill(skill) {
119
- return { name: skill.name };
116
+ return { name: skill.name, preload: skill.preload === true };
117
+ }
118
+ function toHarnessSkill(skill) {
119
+ return { name: skill.id ?? skill.name, preload: skill.preload === true };
120
120
  }
121
121
  function toHarnessAgentSpec(spec) {
122
122
  const { skills, mcpServers, ...rest } = spec;
@@ -132,7 +132,7 @@ function toHarnessAgentSpec(spec) {
132
132
  return server;
133
133
  })
134
134
  },
135
- ...skills === void 0 ? {} : { skills: skills.map(({ name }) => ({ name })) }
135
+ ...skills === void 0 ? {} : { skills: skills.map(toHarnessSkill) }
136
136
  };
137
137
  }
138
138
  function toUiAgentSpec(spec) {
@@ -237,7 +237,8 @@ function createHarnessChatServer(options = {}) {
237
237
  ...request.limit === void 0 ? {} : { limit: request.limit },
238
238
  ...request.order === void 0 ? {} : { order: request.order },
239
239
  ...request.pageToken === void 0 ? {} : { pageToken: request.pageToken },
240
- ...request.agentId === void 0 || request.agentId.length === 0 ? {} : { agentId: request.agentId }
240
+ ...request.agentId === void 0 || request.agentId.length === 0 ? {} : { agentId: request.agentId },
241
+ ...request.createdByMe === void 0 ? {} : { createdByMe: request.createdByMe }
241
242
  });
242
243
  return toListResult(page, toUiSession);
243
244
  },
@@ -326,13 +327,13 @@ function toSessionListEntry(session) {
326
327
  isMutable: session.agent.type === "inline",
327
328
  metrics: {
328
329
  totalTurns: session.metrics.totalTurns,
329
- totalCostInUsd: session.metrics.totalCostInUsd ?? 0,
330
- // TODO: fix this.
330
+ ...session.metrics.totalCostInUsd == null ? {} : { totalCostInUsd: session.metrics.totalCostInUsd },
331
331
  totalDurationMs: session.metrics.totalDurationMs
332
332
  },
333
333
  ...session.title === null ? {} : { title: session.title },
334
334
  ...session.agent.type === "reference" && session.agent.name !== null ? { agentName: session.agent.name } : {},
335
- ...session.agent.type === "inline" ? { agentSpec: toUiAgentSpec(session.agent.spec) } : {}
335
+ ...session.agent.type === "inline" ? { agentSpec: toUiAgentSpec(session.agent.spec) } : {},
336
+ ...session.source?.type === "schedule" ? { sourceType: session.source.type } : {}
336
337
  };
337
338
  }
338
339
  function createHarnessAgentSessionsServer(options = {}) {
@@ -347,7 +348,11 @@ function createHarnessAgentSessionsServer(options = {}) {
347
348
  };
348
349
  },
349
350
  async getCodeSnippets({ agentId }) {
350
- const { data } = await client.internal.agents.getCodeSnippets(agentId);
351
+ const absoluteBaseUrl = resolveTrueForgeBaseUrl(options.baseUrl ?? "/").replace(/\/$/, "");
352
+ const { data } = await client.internal.agents.getCodeSnippets(
353
+ agentId,
354
+ /^https?:\/\//i.test(absoluteBaseUrl) ? { baseUrl: absoluteBaseUrl } : void 0
355
+ );
351
356
  return data.snippets;
352
357
  },
353
358
  async listSessions(requestParams = {}) {
@@ -357,7 +362,8 @@ function createHarnessAgentSessionsServer(options = {}) {
357
362
  ...requestParams.pageToken === void 0 ? {} : { pageToken: requestParams.pageToken },
358
363
  ...requestParams.startTimestamp === void 0 ? {} : { startTimestamp: parseIsoDate(requestParams.startTimestamp) },
359
364
  ...requestParams.endTimestamp === void 0 ? {} : { endTimestamp: parseIsoDate(requestParams.endTimestamp) },
360
- ...requestParams.agentId === void 0 || requestParams.agentId.length === 0 ? {} : { agentId: requestParams.agentId }
365
+ ...requestParams.agentId === void 0 || requestParams.agentId.length === 0 ? {} : { agentId: requestParams.agentId },
366
+ ...requestParams.createdByMe === void 0 ? {} : { createdByMe: requestParams.createdByMe }
361
367
  });
362
368
  return toListResult(page, toSessionListEntry);
363
369
  },
@@ -411,10 +417,21 @@ function toUiCatalogEntry(server) {
411
417
  auth: toUiAuthPublic(server.auth)
412
418
  };
413
419
  }
420
+ function toUiToolAnnotations(value) {
421
+ if (typeof value !== "object" || value === null) return void 0;
422
+ const readOnlyHint = Reflect.get(value, "readOnlyHint");
423
+ const destructiveHint = Reflect.get(value, "destructiveHint");
424
+ const annotations = {
425
+ ...typeof readOnlyHint === "boolean" ? { readOnlyHint } : {},
426
+ ...typeof destructiveHint === "boolean" ? { destructiveHint } : {}
427
+ };
428
+ return Object.keys(annotations).length > 0 ? annotations : void 0;
429
+ }
414
430
  function toUiTool(tool) {
415
431
  const name = typeof tool.name === "string" && tool.name !== "" ? tool.name : "tool";
416
432
  const description = typeof tool.description === "string" ? tool.description : "";
417
- return { id: name, name, description };
433
+ const annotations = toUiToolAnnotations(Reflect.get(tool, "annotations"));
434
+ return annotations === void 0 ? { id: name, name, description } : { id: name, name, description, annotations };
418
435
  }
419
436
  function toUiConnector(server) {
420
437
  const auth = toUiAuthPublic(server.manifest.auth);
@@ -555,17 +572,9 @@ async function listModels(client) {
555
572
  const body = await client.models.list();
556
573
  return body.data;
557
574
  }
558
- async function listConfiguredMcpServersPage(client, req = {}) {
559
- const page = await client.mcpServers.list({
560
- ...req.limit === void 0 ? {} : { limit: req.limit },
561
- ...req.pageToken === void 0 ? {} : { pageToken: req.pageToken }
562
- });
563
- return toListResult(page, (server) => server);
564
- }
565
575
  async function listConfiguredMcpServers(client) {
566
- return drainListPages({
567
- fetchPage: (pageToken) => listConfiguredMcpServersPage(client, { pageToken })
568
- });
576
+ const body = await client.mcpServers.list();
577
+ return body.data;
569
578
  }
570
579
  async function listSkills(client) {
571
580
  const body = await client.skills.list();
@@ -632,17 +641,31 @@ function createHarnessBuilderServer(options = {}) {
632
641
  });
633
642
  },
634
643
  // Skills require a configured sandbox provider; keep the picker empty when skill capability is off.
644
+ // Catalog AvailableSkill.name is store identity (FQN in TFY). Picker `id` copies that
645
+ // attach key; `name` is displayName so the draft can show a label without losing the wire key.
646
+ // Draft mounts `{ id, name }`; toHarnessSkill admits AgentSpec.skills[].name = id ?? name.
635
647
  getSkills: async () => {
636
648
  const skills = await listSkills(client);
637
- return skills.map((skill) => ({ id: skill.name, name: skill.name, description: skill.description }));
649
+ return skills.map((skill) => {
650
+ const { display_name, repository_name, version: versionRaw } = skill.metadata ?? {};
651
+ const version = Number(versionRaw);
652
+ const hasVersion = Number.isInteger(version) && version > 0;
653
+ return {
654
+ id: skill.name,
655
+ name: display_name ?? skill.name,
656
+ description: skill.description,
657
+ ...repository_name === void 0 ? {} : { skillRepoName: repository_name },
658
+ ...hasVersion ? {
659
+ version,
660
+ loadVersions: async () => (await client.skills.listVersions({ name: skill.name })).data
661
+ } : {}
662
+ };
663
+ });
638
664
  },
639
665
  getMcp: async () => (await listConfiguredMcpServers(client)).map(toUiConnectorFromReadEntry),
640
- listMcp: async (req) => {
641
- const page = await listConfiguredMcpServersPage(client, req ?? {});
642
- return {
643
- data: page.data.map(toUiConnectorFromReadEntry),
644
- ...page.nextPageToken === void 0 ? {} : { nextPageToken: page.nextPageToken }
645
- };
666
+ getMcpConnector: async ({ connectorId }) => {
667
+ const body = await client.mcpServers.get(connectorId);
668
+ return toUiConnectorFromReadEntry(body.data);
646
669
  },
647
670
  getMcpTools: async ({ connectorId }) => {
648
671
  const body = await client.mcpServers.listTools(connectorId);
@@ -958,10 +981,12 @@ function toHarnessManifest3(req) {
958
981
  };
959
982
  }
960
983
  function toUiSkill2(skill, catalogNames) {
984
+ const manifest = skill.manifest;
985
+ const displayName = "displayName" in manifest && typeof manifest.displayName === "string" ? manifest.displayName : manifest.name;
961
986
  const base = {
962
987
  id: skill.name,
963
- name: skill.name,
964
- description: skill.manifest.description
988
+ name: displayName,
989
+ description: manifest.description
965
990
  };
966
991
  if (catalogNames.has(skill.name)) {
967
992
  return { ...base, catalogId: skill.name };
@@ -1006,6 +1031,14 @@ function createSkillCatalog(client) {
1006
1031
  };
1007
1032
  }
1008
1033
 
1034
+ // src/plugins/trueforge-agent-server-adapter/permissionsServer.ts
1035
+ function createHarnessPermissionsServer(options = {}) {
1036
+ const client = options.client ?? createTrueForgeClient(options);
1037
+ return {
1038
+ listPermissions: (request) => client.internal.listPermissions(request)
1039
+ };
1040
+ }
1041
+
1009
1042
  // src/plugins/trueforge-agent-server-adapter/schedules/scheduleServer.ts
1010
1043
  var SCHEDULES_PAGE_LIMIT = 25;
1011
1044
  async function loadAgentIndex(client) {
@@ -1128,7 +1161,7 @@ function createScheduleServer(options) {
1128
1161
 
1129
1162
  // src/plugins/trueforge-agent-server-adapter/index.ts
1130
1163
  function createTrueForgeAgentUIServer(options = {}) {
1131
- const { catalog: catalogOverride, ...clientOptions } = options;
1164
+ const { catalog: catalogOverride, permissions, ...clientOptions } = options;
1132
1165
  const client = createTrueForgeClient(clientOptions);
1133
1166
  const catalog = catalogOverride ?? {
1134
1167
  modelCatalog: createModelProviderCatalog(client),
@@ -1142,7 +1175,8 @@ function createTrueForgeAgentUIServer(options = {}) {
1142
1175
  catalog,
1143
1176
  sessions: createHarnessAgentSessionsServer({ ...clientOptions, client }),
1144
1177
  metrics: createHarnessAgentMetricsServer({ ...clientOptions, client }),
1145
- schedules: createScheduleServer({ client })
1178
+ schedules: createScheduleServer({ client }),
1179
+ permissions: permissions ?? createHarnessPermissionsServer({ client })
1146
1180
  });
1147
1181
  }
1148
1182
  export {
@@ -1152,6 +1186,7 @@ export {
1152
1186
  createHarnessAgentSessionsServer,
1153
1187
  createHarnessBuilderServer,
1154
1188
  createHarnessChatServer,
1189
+ createHarnessPermissionsServer,
1155
1190
  createModelProviderCatalog,
1156
1191
  createSandboxProviderCatalog,
1157
1192
  createScheduleServer,
@@ -1161,7 +1196,6 @@ export {
1161
1196
  filterUiSandboxProviders,
1162
1197
  getCapabilities,
1163
1198
  listConfiguredMcpServers,
1164
- listConfiguredMcpServersPage,
1165
1199
  listModels,
1166
1200
  listSkills,
1167
1201
  modelProviderLogosByName,