Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { resolveAgentWorkspaceFileVisualKind } from "../../shared/workspaceFileVisualKind.ts";
|
|
|
|
export type AgentMentionFileVisualKind =
|
|
| "back"
|
|
| "document"
|
|
| "code"
|
|
| "markdown"
|
|
| "image"
|
|
| "video"
|
|
| "folder";
|
|
|
|
export function resolveAgentMentionFileVisualKind(input: {
|
|
entryKind?: string | null;
|
|
href?: string | null;
|
|
mentionNavigation?: string | null;
|
|
name?: string | null;
|
|
path?: string | null;
|
|
}): AgentMentionFileVisualKind {
|
|
if (
|
|
input.mentionNavigation === "agent-generated-folder-back" ||
|
|
input.mentionNavigation === "workspace-folder-back"
|
|
) {
|
|
return "back";
|
|
}
|
|
if (input.entryKind === "directory") {
|
|
return "folder";
|
|
}
|
|
const pathOrName =
|
|
input.path?.trim() || input.name?.trim() || input.href?.trim() || "";
|
|
const kind = resolveAgentWorkspaceFileVisualKind(pathOrName, {
|
|
refType: "file"
|
|
});
|
|
return kind === "binary" ? "document" : kind;
|
|
}
|
|
|
|
export function resolveAgentMentionFileThumbnailUrl(input: {
|
|
entryKind?: string | null;
|
|
href?: string | null;
|
|
name?: string | null;
|
|
path?: string | null;
|
|
thumbnailUrl?: string | null;
|
|
}): string | undefined {
|
|
if (resolveAgentMentionFileVisualKind(input) !== "image") {
|
|
return undefined;
|
|
}
|
|
const thumbnailUrl = input.thumbnailUrl?.trim() ?? "";
|
|
return thumbnailUrl || undefined;
|
|
}
|