diff --git a/.env.example b/.env.example index 76d0139..94f7e0b 100644 --- a/.env.example +++ b/.env.example @@ -32,3 +32,7 @@ AGENT_MODEL_BASE_URL=https://ai.example.com/v1 AGENT_MODEL_API_KEY=replace-with-provider-api-key AGENT_MODEL_CONTEXT_WINDOW=262000 AGENT_MODEL_MAX_TOKENS=131072 + +# Self-hosted git (Gitea) — canonical repository host and API token +GITEA_URL=https://git.openputer.com +GITEA_TOKEN=replace-with-a-gitea-personal-access-token diff --git a/bun.lock b/bun.lock index 1240940..cff17a7 100644 --- a/bun.lock +++ b/bun.lock @@ -246,6 +246,7 @@ "name": "@code/primitives", "version": "0.0.0", "dependencies": { + "@agentos-software/codex-cli": "0.3.4", "@agentos-software/git": "0.3.3", "@rivet-dev/agentos": "catalog:", "effect": "catalog:", diff --git a/packages/agents/package.json b/packages/agents/package.json index 11ba540..8b3b7fb 100644 --- a/packages/agents/package.json +++ b/packages/agents/package.json @@ -9,7 +9,8 @@ "dev": "bun --env-file=../../.env flue dev", "dev:tailscale": "bun --env-file=../../.env flue dev", "run": "bun --env-file=../../.env flue run", - "run:zopu": "bun --env-file=../../.env flue run zopu" + "run:zopu": "bun --env-file=../../.env flue run zopu", + "run:zopu-dev": "bun --env-file=../../.env flue run zopu-dev" }, "dependencies": { "@agentos-software/opencode": "0.2.7", diff --git a/packages/agents/src/agents/zopu-dev.ts b/packages/agents/src/agents/zopu-dev.ts new file mode 100644 index 0000000..1a75731 --- /dev/null +++ b/packages/agents/src/agents/zopu-dev.ts @@ -0,0 +1,51 @@ +import { parseAgentEnv } from "@code/env/agent"; +import { defineAgent } from "@flue/runtime"; +import { local } from "@flue/runtime/node"; + +import { createGitRemoteTools, makeGitRemoteConfig } from "../tools/git-remote"; +import { createWorkflowTools } from "../tools/workflow"; + +const INSTRUCTIONS = `You are Zopu Dev, the development agent for the canonical zopu-code repository (self-hosted Gitea: puter/zopu-code). + +## Your job + +You talk with the user and turn agreed-upon work into tracked issues, then kick off autonomous implementation. You operate on exactly one repository. + +## Loop + +1. Understand the request. Ask one focused clarifying question only when genuinely ambiguous. Do not create work from casual chat. + +2. Check for duplicates. Call list_issues to see what already exists. + +3. Create the issue. Call create_issue with a clear title and a body that captures the acceptance criteria. Report the issue number and URL back to the user. + +4. Start work only on explicit confirmation. When the user says to start (e.g. "go", "start", "work on it"), call start_workflow with the issue number. This spins up a Codex agent in an isolated worktree that implements, verifies, commits, and opens a pull request. + +5. Report outcomes plainly: "Created issue #N: