chore: remove dead code (59 unused files + ~125 unused exports) (#1835)
* chore: remove dead/unreferenced files across ui, vscode Remove 59 unused source files (components, hooks, lib utils, stores, barrels, and orphaned vscode github modules) that are not imported by any entry-reachable code. Also drop a stale test mock for the removed execCommands module. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * refactor: remove unused exported symbols (types, functions, consts, hooks) Remove exported symbols whose identifier is referenced nowhere in the repository (verified via repo-wide search), across ui types/contracts, lib utilities, sync layer, stores, and components. Also drop the few imports/private helpers orphaned by these removals. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * refactor: remove more unused exports (desktop, shortcuts, worktree, vscode) Continue removing repo-wide unreferenced exported functions, consts and types across lib/desktop, shortcuts, worktreeSessionCreator, sync, and vscode gitService, with cascading orphaned helpers/imports cleaned up. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * chore: add dead-code cleanup tooling * refactor: checkpoint dead-code cleanup * refactor: remove dead-code suppressions --------- Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Serhii Dziupin
Bohdan Triapitsyn
parent
4a37b9a005
commit
00821700de
@@ -1,12 +1,12 @@
|
||||
import type { Agent } from "@opencode-ai/sdk/v2";
|
||||
|
||||
export interface AgentMentionSource {
|
||||
interface AgentMentionSource {
|
||||
value: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
export interface ParsedAgentMention {
|
||||
interface ParsedAgentMention {
|
||||
name: string;
|
||||
source?: AgentMentionSource;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
export const EXECUTION_FORK_META_TEXT =
|
||||
"This message comes from an AI assistant in another session. The user wants you to respond according to its content: " +
|
||||
"if it is an implementation plan, your task is to implement that plan; " +
|
||||
"if it is a conclusion or summary, your task is to verify it, explain whether you agree or disagree, and correct it if needed. " +
|
||||
"Always clearly state what you understand your task to be, and wait for the user's approval of your conclusions before taking any further actions.";
|
||||
|
||||
export const MULTIRUN_EXECUTION_FORK_PROMPT_META_TEXT =
|
||||
"This message bellow comes from an AI agent in another session. I want you to act according to its content: " +
|
||||
"if it is an implementation plan, your task is to implement that plan; " +
|
||||
@@ -12,9 +6,6 @@ export const MULTIRUN_EXECUTION_FORK_PROMPT_META_TEXT =
|
||||
"Proceed with actions right away based on your understanding of the task. " +
|
||||
"Here is the content of the message: ";
|
||||
|
||||
export const isExecutionForkMetaText = (text: string | null | undefined): boolean =>
|
||||
typeof text === 'string' && text.trim() === EXECUTION_FORK_META_TEXT.trim();
|
||||
|
||||
// Default, user-editable instructions prefilled in the "Start new session from
|
||||
// this answer" dialog. Mirrors the previous fixed fork instruction so existing
|
||||
// behavior is preserved unless the user edits it.
|
||||
@@ -26,7 +17,7 @@ export const EXECUTION_FORK_DEFAULT_INSTRUCTIONS =
|
||||
|
||||
// Fixed connective that opens the forked assistant content. Not editable by the
|
||||
// user — it sits between the user's instructions and the assistant message.
|
||||
export const EXECUTION_FORK_CONTENT_PREFACE =
|
||||
const EXECUTION_FORK_CONTENT_PREFACE =
|
||||
"This message below comes from an AI agent in another session. Here is the content of the message:";
|
||||
|
||||
// Builds the final message sent to the new session:
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { InlineCommentDraft } from '@/stores/useInlineCommentDraftStore';
|
||||
* Format a single inline comment draft into the standard message format
|
||||
* used by diff, plan, and file viewers
|
||||
*/
|
||||
export function formatInlineCommentDraft(draft: InlineCommentDraft): string {
|
||||
function formatInlineCommentDraft(draft: InlineCommentDraft): string {
|
||||
const { fileLabel, startLine, endLine, side, language, code, text } = draft;
|
||||
|
||||
// Diff format includes side (original/modified)
|
||||
@@ -28,7 +28,7 @@ export function formatInlineCommentDraft(draft: InlineCommentDraft): string {
|
||||
* Format multiple inline comment drafts into a single string
|
||||
* with each comment separated by a blank line
|
||||
*/
|
||||
export function formatInlineCommentDrafts(drafts: InlineCommentDraft[]): string {
|
||||
function formatInlineCommentDrafts(drafts: InlineCommentDraft[]): string {
|
||||
if (drafts.length === 0) return '';
|
||||
|
||||
if (drafts.every((draft) => draft.source === 'preview-annotation')) {
|
||||
@@ -55,16 +55,3 @@ export function appendInlineComments(text: string, drafts: InlineCommentDraft[])
|
||||
return `${text}\n\n${formattedComments}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a message text contains inline comments (for validation purposes)
|
||||
*/
|
||||
export function hasInlineComments(text: string): boolean {
|
||||
return text.includes('Comment on `') && text.includes('```');
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the file label from a draft for display purposes
|
||||
*/
|
||||
export function getDraftDisplayLabel(draft: InlineCommentDraft): string {
|
||||
return `${draft.fileLabel}:${draft.startLine}-${draft.endLine}`;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const SKILL_LINK_PREFIX = '#openchamber-skill:';
|
||||
export const AGENT_LINK_PREFIX = '#openchamber-agent:';
|
||||
const SKILL_LINK_PREFIX = '#openchamber-skill:';
|
||||
const AGENT_LINK_PREFIX = '#openchamber-agent:';
|
||||
|
||||
export const buildAgentMentionUrl = (name: string): string => {
|
||||
const encoded = encodeURIComponent(name);
|
||||
|
||||
Reference in New Issue
Block a user