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
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { normalizeQuery } from "./agentMentionSearchHelpers";
|
|
import type { AgentMentionFilterId } from "./AgentMentionSearchContracts";
|
|
|
|
interface CurrentMentionQueryContext {
|
|
agentGeneratedBrowsePath: string | null;
|
|
currentUserId: string;
|
|
directoryDepth: number;
|
|
filter: AgentMentionFilterId;
|
|
query: string;
|
|
sectionKey: string;
|
|
sessionCwd: string;
|
|
workspaceId: string;
|
|
}
|
|
|
|
interface MentionQueryInput {
|
|
currentUserId?: string | null;
|
|
query: string;
|
|
sectionKey?: string | null;
|
|
sessionCwd?: string | null;
|
|
workspaceId: string;
|
|
}
|
|
|
|
export function resolveAgentMentionQueryUpdate(
|
|
input: MentionQueryInput,
|
|
current: CurrentMentionQueryContext
|
|
) {
|
|
const next = {
|
|
currentUserId: input.currentUserId?.trim() ?? "",
|
|
query: normalizeQuery(input.query),
|
|
sectionKey: input.sectionKey?.trim() ?? "",
|
|
sessionCwd: input.sessionCwd?.trim() ?? "",
|
|
workspaceId: input.workspaceId.trim()
|
|
};
|
|
return {
|
|
...next,
|
|
ignore:
|
|
!next.query &&
|
|
!current.query &&
|
|
current.filter === "file" &&
|
|
(current.directoryDepth > 0 ||
|
|
current.agentGeneratedBrowsePath !== null) &&
|
|
next.workspaceId === current.workspaceId &&
|
|
next.currentUserId === current.currentUserId &&
|
|
next.sectionKey === current.sectionKey &&
|
|
next.sessionCwd === current.sessionCwd
|
|
};
|
|
}
|