Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

rm unused

Julius Marminge9e877f592bad
diff --git a/apps/web/src/composer-logic.test.ts b/apps/web/src/composer-logic.test.ts
index beb9385e4..c2b32cf14 100644
--- a/apps/web/src/composer-logic.test.ts
+++ b/apps/web/src/composer-logic.test.ts
@@ -1,11 +1,6 @@
import { describe, expect, it } from "vitest";
-import {
- buildPromptInput,
- buildUserVisiblePrompt,
- detectComposerTrigger,
- replaceTextRange,
-} from "./composer-logic";
+import { detectComposerTrigger, replaceTextRange } from "./composer-logic";
describe("detectComposerTrigger", () => {
it("detects @path trigger at cursor", () => {
@@ -54,19 +49,3 @@ describe("replaceTextRange", () => {
});
});
});
-
-describe("tagged path prompt helpers", () => {
- it("builds model input with tagged paths", () => {
- const result = buildPromptInput("Fix this", ["src/app.tsx", "src/app.tsx", "README.md"]);
- expect(result).toContain("Fix this");
- expect(result).toContain("Referenced paths:");
- expect(result).toContain("- src/app.tsx");
- expect(result).toContain("- README.md");
- expect(result).not.toContain("- src/app.tsx\n- src/app.tsx");
- });
-
- it("builds user-visible prompt from tags only", () => {
- const result = buildUserVisiblePrompt(" ", ["src/app.tsx", "README.md"]);
- expect(result).toBe("@src/app.tsx @README.md");
- });
-});
diff --git a/apps/web/src/composer-logic.ts b/apps/web/src/composer-logic.ts
index db6ae79b7..8b08459c2 100644
--- a/apps/web/src/composer-logic.ts
+++ b/apps/web/src/composer-logic.ts
@@ -24,16 +24,6 @@ function tokenStartForCursor(text: string, cursor: number): number {
return index + 1;
}
-function dedupePaths(paths: string[]): string[] {
- const unique = new Set<string>();
- for (const rawPath of paths) {
- const normalized = rawPath.trim();
- if (!normalized) continue;
- unique.add(normalized);
- }
- return [...unique];
-}
-
export function detectComposerTrigger(text: string, cursorInput: number): ComposerTrigger | null {
const cursor = clampCursor(text, cursorInput);
const lineStart = text.lastIndexOf("\n", Math.max(0, cursor - 1)) + 1;
@@ -98,31 +88,3 @@ export function replaceTextRange(
const nextText = `${text.slice(0, safeStart)}${replacement}${text.slice(safeEnd)}`;
return { text: nextText, cursor: safeStart + replacement.length };
}
-
-export function buildPromptInput(text: string, taggedPaths: string[]): string {
- const trimmedPrompt = text.trim();
- const normalizedPaths = dedupePaths(taggedPaths);
- if (normalizedPaths.length === 0) {
- return trimmedPrompt;
- }
-
- const tagBlock = `Referenced paths:\n${normalizedPaths.map((entry) => `- ${entry}`).join("\n")}`;
- if (!trimmedPrompt) {
- return tagBlock;
- }
- return `${trimmedPrompt}\n\n${tagBlock}`;
-}
-
-export function buildUserVisiblePrompt(text: string, taggedPaths: string[]): string {
- const trimmedPrompt = text.trim();
- const normalizedPaths = dedupePaths(taggedPaths);
- if (normalizedPaths.length === 0) {
- return trimmedPrompt;
- }
-
- const tagsSummary = normalizedPaths.map((entry) => `@${entry}`).join(" ");
- if (!trimmedPrompt) {
- return tagsSummary;
- }
- return `${trimmedPrompt}\n\n${tagsSummary}`;
-}