MCPcopy
hub / github.com/21st-dev/1code / getRegisteredChat

Function getRegisteredChat

src/main/lib/git/security/path-validation.ts:98–116  ·  view source on GitHub ↗
(
	worktreePath: string,
)

Source from the content-addressed store, hash-verified

96 * @throws PathValidationError if chat is not registered
97 */
98export function getRegisteredChat(
99 worktreePath: string,
100): typeof chats.$inferSelect {
101 const db = getDatabase();
102 const chat = db
103 .select()
104 .from(chats)
105 .where(eq(chats.worktreePath, worktreePath))
106 .get();
107
108 if (!chat) {
109 throw new PathValidationError(
110 "Chat not registered in database",
111 "UNREGISTERED_WORKTREE",
112 );
113 }
114
115 return chat;
116}
117
118/**
119 * Options for path validation.

Callers 1

createBranchesRouterFunction · 0.90

Calls 2

getDatabaseFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected