Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 feat(linear): render builtin Linear tool cards and drop the Result label (#16125)

Arvin Xub7579279ab06
diff --git a/packages/builtin-tools/src/linear/index.ts b/packages/builtin-tools/src/linear/index.ts
index fabbacacbaf..fbb63b1e4c5 100644
--- a/packages/builtin-tools/src/linear/index.ts
+++ b/packages/builtin-tools/src/linear/index.ts
@@ -1,12 +1,17 @@
import { LINEAR_TOOL_NAMES, LinearInspector } from '@lobechat/shared-tool-ui/inspectors';
-import type { BuiltinInspector } from '@lobechat/types';
+import { LinearRender } from '@lobechat/shared-tool-ui/renders';
+import type { BuiltinInspector, BuiltinRender } from '@lobechat/types';
// LobeHub built-in Linear skill: tool calls arrive with
// `identifier='linear'` and bare `apiName` like 'get_issue'. The shared
-// inspector tolerates both bare and MCP-prefixed names, so we just register
-// it under every supported tool suffix.
+// inspector / render tolerate both bare and MCP-prefixed names, so we just
+// register them under every supported tool suffix.
export const LinearIdentifier = 'linear';
export const LinearInspectors: Record<string, BuiltinInspector> = Object.fromEntries(
LINEAR_TOOL_NAMES.map((name) => [name, LinearInspector]),
);
+
+export const LinearRenders: Record<string, BuiltinRender> = Object.fromEntries(
+ LINEAR_TOOL_NAMES.map((name) => [name, LinearRender as BuiltinRender]),
+);
diff --git a/packages/builtin-tools/src/register.ts b/packages/builtin-tools/src/register.ts
index 24831130c04..47534e19523 100644
--- a/packages/builtin-tools/src/register.ts
+++ b/packages/builtin-tools/src/register.ts
@@ -152,7 +152,7 @@ import { CodexInspectors, CodexRenders } from './codex';
import { GithubIdentifier, GithubInspectors, GithubRenders } from './github';
import { registerBuiltinInspectors } from './inspectors';
import { registerBuiltinInterventions } from './interventions';
-import { LinearIdentifier, LinearInspectors } from './linear';
+import { LinearIdentifier, LinearInspectors, LinearRenders } from './linear';
import { NotebookIdentifier, NotebookRenders } from './notebook';
import { registerBuiltinPlaceholders } from './placeholders';
import { registerBuiltinPortals } from './portals';
@@ -199,6 +199,7 @@ export const registerBuiltinToolSurfaces = (): void => {
command_execution: RunCommandRender as BuiltinRender,
},
[GithubIdentifier]: GithubRenders,
+ [LinearIdentifier]: LinearRenders,
});
registerBuiltinInspectors({
diff --git a/packages/shared-tool-ui/src/Render/Linear/index.tsx b/packages/shared-tool-ui/src/Render/Linear/index.tsx
index 0dece186ae9..558758ab65a 100644
--- a/packages/shared-tool-ui/src/Render/Linear/index.tsx
+++ b/packages/shared-tool-ui/src/Render/Linear/index.tsx
@@ -247,29 +247,25 @@ const LinearRender = memo<BuiltinRenderProps<Record<string, unknown>, unknown, u
return (
<Flexbox className={styles.container} gap={12}>
{hasItems(model.resultEntities) && (
- <Section title={'Result'}>
- <Flexbox gap={8}>
- {model.resultEntities.map((entity, index) => (
- <EntityCard
- entity={entity}
- key={`${entity.id || entity.title || 'entity'}:${index}`}
- />
- ))}
- </Flexbox>
- </Section>
+ <Flexbox gap={8}>
+ {model.resultEntities.map((entity, index) => (
+ <EntityCard
+ entity={entity}
+ key={`${entity.id || entity.title || 'entity'}:${index}`}
+ />
+ ))}
+ </Flexbox>
)}
{model.resultText && (
- <Section title={'Result'}>
- <Highlighter
- wrap
- language={'text'}
- showLanguage={false}
- style={{ maxHeight: 220, overflow: 'auto', paddingInline: 8 }}
- variant={'filled'}
- >
- {model.resultText}
- </Highlighter>
- </Section>
+ <Highlighter
+ wrap
+ language={'text'}
+ showLanguage={false}
+ style={{ maxHeight: 220, overflow: 'auto', paddingInline: 8 }}
+ variant={'filled'}
+ >
+ {model.resultText}
+ </Highlighter>
)}
{model.rawResultJson && (
<details className={styles.rawDetails}>