diff options
| -rw-r--r-- | .agent/design.md | 31 | ||||
| -rw-r--r-- | internal/storage/seed.go | 7 |
2 files changed, 38 insertions, 0 deletions
diff --git a/.agent/design.md b/.agent/design.md index 27c7601..0b61180 100644 --- a/.agent/design.md +++ b/.agent/design.md @@ -377,6 +377,37 @@ parent_task_id: "<task-uuid>" # set by parent agent when creating subtasks Batch files wrap multiple tasks under a `tasks:` key and are accepted by `claudomator run`. +### Project Registry + +Projects are registered in **`internal/storage/seed.go`** — `SeedProjects()` — which is called on every server startup (`internal/cli/serve.go:125`). It upserts a hardcoded list of `task.Project` entries into the `projects` SQLite table. + +**To register a new project**, add an entry to the slice in `seed.go`: + +```go +{ + ID: "my-project", + Name: "my-project", + LocalPath: "/workspace/my-project", + RemoteURL: localBareRemote("/workspace/my-project"), + Type: "web", // "web" | "android" + DeployScript: "/workspace/my-project/scripts/deploy", // optional +}, +``` + +**`localBareRemote(dir)`** (`seed.go:47`) resolves the URL of the `local` git remote for the given directory, falling back to the directory path itself. By convention, bare repos live at `/site/git.terst.org/repos/<name>.git` and each working copy has a `local` remote pointing there. + +**Setting up a new project's bare repo:** +```sh +git init --bare /site/git.terst.org/repos/<name>.git +cd /workspace/<name> +git remote add local /site/git.terst.org/repos/<name>.git +git push local main +``` + +The `task.Project` struct is defined in `internal/task/project.go`. Projects are exposed via `GET /api/projects` and `POST /api/projects`. + +--- + ### Storage Schema Two tables auto-migrated on `storage.Open()`: diff --git a/internal/storage/seed.go b/internal/storage/seed.go index 884292d..c2df84f 100644 --- a/internal/storage/seed.go +++ b/internal/storage/seed.go @@ -33,6 +33,13 @@ func (s *DB) SeedProjects() error { Type: "web", DeployScript: "/workspace/doot/scripts/deploy", }, + { + ID: "modal-shell", + Name: "modal-shell", + LocalPath: "/workspace/modal-shell", + RemoteURL: localBareRemote("/workspace/modal-shell"), + Type: "web", + }, } for _, p := range projects { if err := s.UpsertProject(p); err != nil { |
