MCPcopy Create free account
hub / github.com/agent-tower/core / adaptProject

Function adaptProject

packages/web/src/components/task/adapters.ts:118–129  ·  view source on GitHub ↗
(project: SharedProject)

Source from the content-addressed store, hash-verified

116 let hash = 0
117 for (let i = 0; i < str.length; i++) {
118 hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0
119 }
120 return Math.abs(hash) % max
121}
122
123function getPreferredWorkspace(
124 workspaces?: SharedWorkspace[],
125 workspace?: SharedWorkspace,
126): SharedWorkspace | undefined {
127 return workspace ?? workspaces?.find(w => w.status === 'ACTIVE') ?? workspaces?.[0]
128}
129
130function getWorkspaceBranchLabel(workspace?: SharedWorkspace): string {
131 if (!workspace) return '—'
132 return workspace.workspaceKind === WorkspaceKind.MAIN_DIRECTORY ? 'Project directory' : workspace.branchName

Callers

nothing calls this directly

Calls 1

hashStringToIndexFunction · 0.85

Tested by

no test coverage detected