feat: Lifecycle hooks (#219)
* flatten lifecycle hooks into RepoSettings string fields replace the separate LifecycleHook model with setupScript and postCheckoutScript string fields directly on RepoSettings. move the UI into the Agent settings section alongside environment variables and custom instructions. delete the standalone lifecycle-hooks API route, component, and schema since the existing settings PATCH endpoint handles the new fields automatically. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: pass env to lifecycle hook spawn so scripts can use package managers Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Colin McDonnell <colinmcd94@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
pullfrog[bot]
parent
3a7145db1a
commit
1d59fd3d21
+12
-1
@@ -11,6 +11,8 @@ export interface Mode {
|
||||
export interface RepoSettings {
|
||||
defaultAgent: AgentName | null;
|
||||
modes: Mode[];
|
||||
setupScript: string | null;
|
||||
postCheckoutScript: string | null;
|
||||
repoInstructions: string;
|
||||
web: ToolPermission;
|
||||
search: ToolPermission;
|
||||
@@ -26,6 +28,8 @@ export interface RunContext {
|
||||
const defaultSettings: RepoSettings = {
|
||||
defaultAgent: null,
|
||||
modes: [],
|
||||
setupScript: null,
|
||||
postCheckoutScript: null,
|
||||
repoInstructions: "",
|
||||
web: "enabled",
|
||||
search: "enabled",
|
||||
@@ -81,7 +85,14 @@ export async function fetchRunContext(params: {
|
||||
}
|
||||
|
||||
return {
|
||||
settings: data.settings ?? defaultSettings,
|
||||
settings: {
|
||||
...defaultSettings,
|
||||
...data.settings,
|
||||
// ensure arrays are never undefined (API may omit new fields for existing repos)
|
||||
modes: data.settings?.modes ?? [],
|
||||
setupScript: data.settings?.setupScript ?? null,
|
||||
postCheckoutScript: data.settings?.postCheckoutScript ?? null,
|
||||
},
|
||||
apiToken: data.apiToken,
|
||||
};
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user