Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

seamus/macro-1614-tool-call-follow-ups (#3718)

Seamus2894e2f17e81
diff --git a/js/app/packages/core/component/AI/component/tool/ListEntities.tsx b/js/app/packages/core/component/AI/component/tool/ListEntities.tsx
index a6d40d2386..02941ae92a 100644
--- a/js/app/packages/core/component/AI/component/tool/ListEntities.tsx
+++ b/js/app/packages/core/component/AI/component/tool/ListEntities.tsx
@@ -167,9 +167,9 @@ const handler = createToolRenderer({
) : undefined
}
>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <div class="flex min-w-0 flex-1 items-center gap-2">
- <span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
+ <span class="min-w-0 truncate">
Filter for{' '}
<span class="text-ink">
{ctx.tool.data.includeTypes
diff --git a/js/app/packages/core/component/AI/component/tool/ListTeamMembers.tsx b/js/app/packages/core/component/AI/component/tool/ListTeamMembers.tsx
index ce50b1243d..9cdcaba384 100644
--- a/js/app/packages/core/component/AI/component/tool/ListTeamMembers.tsx
+++ b/js/app/packages/core/component/AI/component/tool/ListTeamMembers.tsx
@@ -99,11 +99,11 @@ const listTeamMembersHandler = createToolRenderer({
) : undefined
}
>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <span>Read team members</span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">Read team members</span>
<Show when={statusText()}>
{(text) => (
- <span class="shrink-0 text-xs text-ink-extra-muted">
+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">
{text()}
</span>
)}
diff --git a/js/app/packages/core/component/AI/component/tool/McpToolCall.tsx b/js/app/packages/core/component/AI/component/tool/McpToolCall.tsx
index 68e9adaff7..990035dfce 100644
--- a/js/app/packages/core/component/AI/component/tool/McpToolCall.tsx
+++ b/js/app/packages/core/component/AI/component/tool/McpToolCall.tsx
@@ -19,10 +19,10 @@ export function McpToolCall(props: {
renderContext={props.renderContext.renderContext}
type="call"
>
- <div class="flex min-w-0 flex-1 items-center gap-2">
- <span class="text-ink-muted">{props.service}</span>
+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
+ <span class="shrink-0 text-ink-muted">{props.service}</span>
<span class="text-ink-extra-muted">/</span>
- <span>{props.display_name ?? props.name}</span>
+ <span class="min-w-0 truncate">{props.display_name ?? props.name}</span>
</div>
</BaseTool>
);
diff --git a/js/app/packages/core/component/AI/component/tool/Notifications.tsx b/js/app/packages/core/component/AI/component/tool/Notifications.tsx
index 57671fa1e3..f935b5aa21 100644
--- a/js/app/packages/core/component/AI/component/tool/Notifications.tsx
+++ b/js/app/packages/core/component/AI/component/tool/Notifications.tsx
@@ -70,11 +70,11 @@ const listNotificationsHandler = createToolRenderer({
type="call"
>
<div class="flex min-w-0 flex-1 flex-col gap-1">
- <div class="flex min-w-0 items-center justify-between gap-3">
- <span>Read notifications</span>
+ <div class="flex min-w-0 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">Read notifications</span>
<Show when={statusText()}>
{(text) => (
- <span class="shrink-0 text-xs text-ink-extra-muted">
+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">
{text()}
</span>
)}
diff --git a/js/app/packages/core/component/AI/component/tool/ReadChannel.tsx b/js/app/packages/core/component/AI/component/tool/ReadChannel.tsx
index be5bdac095..cd7d99d1bc 100644
--- a/js/app/packages/core/component/AI/component/tool/ReadChannel.tsx
+++ b/js/app/packages/core/component/AI/component/tool/ReadChannel.tsx
@@ -116,17 +116,19 @@ export const readChannelMessagesHandler = createToolRenderer({
renderContext={ctx.renderContext}
>
<div class="flex min-w-0 flex-1 flex-col gap-1">
- <div class="flex min-w-0 items-center justify-between gap-3">
- <span>
+ <div class="flex min-w-0 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">
Read messages in <span class="text-ink">{channelName()}</span>
</span>
{ctx.response && (
- <span class="shrink-0 text-xs text-ink-extra-muted">
+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">
{messageCount()} messages
</span>
)}
</div>
- <div class="text-xs text-ink-placeholder">{windowLabel()}</div>
+ <div class="truncate text-xs text-ink-placeholder">
+ {windowLabel()}
+ </div>
</div>
</BaseTool>
);
@@ -140,8 +142,8 @@ export const readChannelMessageContextHandler = createToolRenderer({
return (
<BaseTool type="call" icon={EyeIcon} renderContext={ctx.renderContext}>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">
Read <span class="text-ink">{channelName()}</span> message context
</span>
</div>
@@ -158,12 +160,12 @@ export const readChannelThreadHandler = createToolRenderer({
return (
<BaseTool type="call" icon={EyeIcon} renderContext={ctx.renderContext}>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">
Read <span class="text-ink">{channelName()}</span> thread
</span>
{ctx.response && (
- <span class="shrink-0 text-xs text-ink-extra-muted">
+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">
{replyCount()} replies
</span>
)}
diff --git a/js/app/packages/core/component/AI/component/tool/Search.tsx b/js/app/packages/core/component/AI/component/tool/Search.tsx
index c864c94be6..aa0c6134c6 100644
--- a/js/app/packages/core/component/AI/component/tool/Search.tsx
+++ b/js/app/packages/core/component/AI/component/tool/Search.tsx
@@ -103,7 +103,7 @@ const UnifiedSearchToolResponse = (props: {
function SearchText(props: { query: string }) {
return (
- <span>
+ <span class="min-w-0 truncate">
Search <span class="text-ink"> {props.query} </span>
</span>
);
@@ -136,8 +136,8 @@ const createHandler = (name: 'NameSearch' | 'ContentSearch') =>
) : undefined
}
>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <div class="flex min-w-0 flex-1 items-center gap-2">
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
<SearchText query={query()} />
</div>
<Tool.ResultToggle
diff --git a/js/app/packages/core/component/AI/component/tool/Subagent.tsx b/js/app/packages/core/component/AI/component/tool/Subagent.tsx
index df7120eb10..e243b33064 100644
--- a/js/app/packages/core/component/AI/component/tool/Subagent.tsx
+++ b/js/app/packages/core/component/AI/component/tool/Subagent.tsx
@@ -1,7 +1,9 @@
import { ChatMessageMarkdown } from '@core/component/AI/component/message/ChatMessageMarkdown';
import { PulsingStar } from '@entity/components/PulsingStar';
import StarIcon from '@icon/wide-star.svg';
+import type { JSX } from 'solid-js';
import { createSignal, Show } from 'solid-js';
+import { BaseTool } from './BaseTool';
import { Tool } from './Tool';
import { createToolRenderer, useToolError } from './ToolRenderer';
@@ -18,44 +20,46 @@ const handler = createToolRenderer({
if (error) return undefined;
return hasResult() ? 'Done' : 'No result';
};
+ const Icon = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => (
+ <Show
+ when={!isLoading()}
+ fallback={
+ <PulsingStar
+ kind="streamIndicator"
+ animate
+ class={typeof props.class === 'string' ? props.class : undefined}
+ />
+ }
+ >
+ <StarIcon {...props} />
+ </Show>
+ );
return (
- <div
- class="relative overflow-hidden rounded-lg border border-edge-muted bg-surface text-xs leading-5 text-ink-extra-muted"
- classList={{ 'opacity-50': !!error }}
- >
- <div class="flex min-h-9 w-full items-center gap-2 px-3 py-2">
- <div class="size-5 shrink-0 flex items-center justify-center">
- <Show
- when={!isLoading()}
- fallback={<PulsingStar kind="streamIndicator" animate />}
- >
- <StarIcon class="size-4 text-ink-extra-muted" />
- </Show>
- </div>
- <div class="min-w-0 flex-1">
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <div class="flex min-w-0 flex-1 items-center gap-2">
- <span class="truncate">{ctx.tool.data.task}</span>
- </div>
- <Tool.ResultToggle
- expanded={isExpanded()}
- onToggle={() => setIsExpanded((expanded) => !expanded)}
- showToggle={hasResult()}
- status={statusText()}
- />
+ <BaseTool
+ icon={Icon}
+ renderContext={ctx.renderContext}
+ type="call"
+ response={
+ hasResult() && isExpanded() ? (
+ <div class="max-h-120 overflow-y-auto text-xs">
+ <ChatMessageMarkdown text={result()!} generating={() => false} />
</div>
+ ) : undefined
+ }
+ >
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
+ <span class="min-w-0 truncate">{ctx.tool.data.task}</span>
</div>
- <Show when={error}>
- <span class="shrink-0 text-ink">Failed</span>
- </Show>
+ <Tool.ResultToggle
+ expanded={isExpanded()}
+ onToggle={() => setIsExpanded((expanded) => !expanded)}
+ showToggle={hasResult()}
+ status={statusText()}
+ />
</div>
- <Show when={hasResult() && isExpanded()}>
- <div class="max-h-120 overflow-y-auto border-t border-edge-muted px-3 py-2 text-xs">
- <ChatMessageMarkdown text={result()!} generating={() => false} />
- </div>
- </Show>
- </div>
+ </BaseTool>
);
},
});
diff --git a/js/app/packages/core/component/AI/component/tool/TextEditorCodeExecution.tsx b/js/app/packages/core/component/AI/component/tool/TextEditorCodeExecution.tsx
index 6326aee11a..cf355bc8f2 100644
--- a/js/app/packages/core/component/AI/component/tool/TextEditorCodeExecution.tsx
+++ b/js/app/packages/core/component/AI/component/tool/TextEditorCodeExecution.tsx
@@ -206,8 +206,8 @@ const handler = createToolRenderer({
},
render: (ctx) => (
<BaseTool icon={Terminal} renderContext={ctx.renderContext} type="call">
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <span>Uploaded code</span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">Uploaded code</span>
<Show when={ctx.response}>
{(response) => (
<div class="shrink-0">
diff --git a/js/app/packages/core/component/AI/component/tool/Tool.tsx b/js/app/packages/core/component/AI/component/tool/Tool.tsx
index ee5f80753b..ea0cb849ed 100644
--- a/js/app/packages/core/component/AI/component/tool/Tool.tsx
+++ b/js/app/packages/core/component/AI/component/tool/Tool.tsx
@@ -75,9 +75,9 @@ function Row(props: ToolRowProps) {
class="size-4 shrink-0 text-ink-extra-muted"
classList={{ 'mt-0.5': alignStart() }}
/>
- <div class="min-w-0 flex-1">{props.children}</div>
+ <div class="min-w-0 flex-1 overflow-hidden">{props.children}</div>
<Show when={props.trailing}>
- <div class="shrink-0">{props.trailing}</div>
+ <div class="shrink-0 whitespace-nowrap">{props.trailing}</div>
</Show>
</div>
);
@@ -95,7 +95,7 @@ function ResultToggle(props: ToolResultToggleProps) {
when={canToggle()}
fallback={
<Show when={props.status}>
- <span class="shrink-0 text-xs text-ink-extra-muted">
+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">
{props.status}
</span>
</Show>
@@ -106,7 +106,7 @@ function ResultToggle(props: ToolResultToggleProps) {
variant="ghost"
size="sm"
noTouchResize
- class="-mr-1 shrink-0 px-1 text-ink-extra-muted hover:text-ink-muted"
+ class="shrink-0 whitespace-nowrap px-1 text-ink-extra-muted hover:text-ink-muted"
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
diff --git a/js/app/packages/core/component/AI/component/tool/WebSearch.tsx b/js/app/packages/core/component/AI/component/tool/WebSearch.tsx
index 54c96a8a4f..efe4a84113 100644
--- a/js/app/packages/core/component/AI/component/tool/WebSearch.tsx
+++ b/js/app/packages/core/component/AI/component/tool/WebSearch.tsx
@@ -44,9 +44,9 @@ const handler = createToolRenderer({
) : undefined
}
>
- <div class="flex min-w-0 flex-1 items-center justify-between gap-3">
- <div class="flex min-w-0 flex-1 items-center gap-2">
- <span>
+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">
+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
+ <span class="min-w-0 truncate">
Searched for <span class="text-ink">{ctx.tool.data.input}</span>
</span>
</div>