Files
codex-app-server/cloud/console-react/src/api/paths.ts
T
host 2d644f901b feat(console): automation panel edit and richer list
- AutomationPanel rows now show title, prompt content (160-char preview with expand/collapse), repo_url, last/next run, run_once badge and cancelled time.

- Active automations get an inline edit form (name/prompt/interval/repo) that PATCHes only changed fields via the existing automation_update endpoint; backend semantics unchanged (no last_run_at reset, cancelled stays terminal).

- Rebuilt cloud/console.html with tsc + vite (build green); automation python tests 18/18 OK.
2026-10-30 15:31:21 +08:00

70 lines
4.2 KiB
TypeScript

// Every API path in the app, in one place. No section or hook builds a
// URL string by hand; they all go through this table. Paths are
// same-origin absolute paths, exactly as in the live console.
const enc = encodeURIComponent;
export const paths = {
health: "/health",
relayModels: "/relay/models",
quotaMe: "/users/me/quota",
userKeys: "/users/me/keys",
userKey: (id: string) => "/users/me/keys/" + enc(id),
githubRepos: "/github/repos",
projects: "/projects",
project: (id: string) => "/projects/" + enc(id),
projectMembers: (pid: string) => "/projects/" + enc(pid) + "/members",
projectMember: (pid: string, uid: string) => "/projects/" + enc(pid) + "/members/" + enc(uid),
projectSkills: (pid: string) => "/projects/" + enc(pid) + "/skills",
projectApps: (pid: string) => "/projects/" + enc(pid) + "/apps",
projectMcp: (pid: string) => "/projects/" + enc(pid) + "/mcp-servers",
projectMcpReload: (pid: string) => "/projects/" + enc(pid) + "/mcp-servers/reload",
projectMcpOauth: (pid: string, name: string) => "/projects/" + enc(pid) + "/mcp-servers/" + enc(name) + "/oauth-login",
projectAutomations: (pid: string) => "/projects/" + enc(pid) + "/automations",
projectAutomation: (pid: string, id: string) => "/projects/" + enc(pid) + "/automations/" + enc(id),
projectAutomationCancel: (pid: string, id: string) => "/projects/" + enc(pid) + "/automations/" + enc(id) + "/cancel",
projectTriage: (pid: string) => "/projects/" + enc(pid) + "/triage",
projectTodos: (pid: string) => "/projects/" + enc(pid) + "/todos",
projectTodo: (pid: string, id: string) => "/projects/" + enc(pid) + "/todos/" + enc(id),
workers: "/workers",
environments: (pid: string) => "/environments?project_id=" + enc(pid),
environmentsCreate: "/environments",
environmentArchive: (id: string) => "/environments/" + enc(id) + "/archive",
tasks: (pid: string) => "/tasks?project_id=" + enc(pid),
tasksPage: (pid: string, limit: number, offset: number, status?: string, executor?: string, q?: string) => {
let u = "/tasks?project_id=" + enc(pid) + "&limit=" + limit + "&offset=" + offset + "&order=desc";
if (status) u += "&status=" + enc(status);
if (executor) u += "&executor=" + enc(executor);
if (q && q.trim()) u += "&q=" + enc(q.trim());
return u;
},
tasksByParent: (pid: string, parent: string) => "/tasks?project_id=" + enc(pid) + "&parent_task_id=" + enc(parent),
tasksCreate: "/tasks",
task: (id: string) => "/tasks/" + enc(id),
taskAction: (id: string, kind: string) => "/tasks/" + enc(id) + "/" + kind,
taskFork: (id: string) => "/tasks/" + enc(id) + "/fork",
taskContinue: (id: string) => "/tasks/" + enc(id) + "/continue",
taskTrace: (id: string) => "/tasks/" + enc(id) + "/trace",
taskTraceStream: (id: string) => "/tasks/" + enc(id) + "/trace/stream",
taskAgents: (id: string) => "/tasks/" + enc(id) + "/agents",
taskReviews: (id: string) => "/tasks/" + enc(id) + "/reviews",
taskReviewFindings: (id: string, rid: string) => "/tasks/" + enc(id) + "/reviews/" + enc(rid) + "/findings",
taskApprovals: (id: string) => "/tasks/" + enc(id) + "/approvals",
taskApprovalDecision: (id: string, aid: string, verb: string) => "/tasks/" + enc(id) + "/approvals/" + enc(aid) + "/" + verb,
taskFollowups: (id: string) => "/tasks/" + enc(id) + "/followups",
taskChatHistory: (id: string) => "/tasks/" + enc(id) + "/chat-history",
taskMessages: (id: string) => "/tasks/" + enc(id) + "/messages",
taskMessagesTo: (target: string) => "/tasks/" + enc(target) + "/messages",
taskThread: (id: string) => "/tasks/" + enc(id) + "/thread",
taskThreads: (id: string) => "/tasks/" + enc(id) + "/threads",
taskThreadAction: (id: string, kind: string) => "/tasks/" + enc(id) + "/thread/" + kind,
taskCost: (id: string) => "/tasks/" + enc(id) + "/cost",
taskBrowserState: (id: string) => "/tasks/" + enc(id) + "/browser/state",
taskBrowserStream: (id: string) => "/tasks/" + enc(id) + "/browser/stream",
taskBrowserInput: (id: string) => "/tasks/" + enc(id) + "/browser/input",
taskBrowserControl: (id: string) => "/tasks/" + enc(id) + "/browser/control",
uploads: "/uploads",
adminQuotas: "/admin/quotas",
adminQuotaUser: (uid: string) => "/admin/quotas?user_id=" + enc(uid),
adminSweep: "/admin/sweep",
adminBackup: "/admin/backup",
};