mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
## Thinking Path > - Paperclip orchestrates AI agents for zero-human companies > - The plugin system is the extension boundary for optional product capabilities > - Rich plugins need more than a worker entrypoint: they need scoped database storage, local project folders, managed agents/routines, host navigation, and reusable UI components > - The LLM Wiki work exposed those missing host surfaces while keeping plugin code outside the core control plane > - This pull request expands the core plugin host, SDK, server APIs, and UI bridge so plugins can declare and use those surfaces > - The benefit is that future plugins can integrate with Paperclip through documented, validated contracts instead of bespoke server or UI imports ## What Changed - Added plugin-managed database namespaces and migration tracking, including Drizzle schema/migration files and SQL validation for namespace isolation. - Added server support for plugin local folders, managed agents, managed routines, scoped plugin APIs, and plugin operation visibility. - Expanded shared plugin manifest/types/validators and SDK host/testing/UI exports for richer plugin surfaces. - Added reusable UI pieces for file trees, managed routines, resizable sidebars, route sidebars, and plugin bridge initialization. - Updated plugin docs and example plugins to use the expanded host and SDK surface. ## Verification - `pnpm install --frozen-lockfile` - `pnpm run preflight:workspace-links && pnpm exec vitest run packages/shared/src/validators/plugin.test.ts server/src/__tests__/plugin-database.test.ts server/src/__tests__/plugin-local-folders.test.ts server/src/__tests__/plugin-managed-agents.test.ts server/src/__tests__/plugin-managed-routines.test.ts server/src/__tests__/plugin-orchestration-apis.test.ts ui/src/api/plugins.test.ts ui/src/components/FileTree.test.tsx ui/src/components/ResizableSidebarPane.test.tsx ui/src/pages/PluginPage.test.tsx ui/src/plugins/bridge.test.ts` passed: 11 files, 67 tests. - Confirmed this PR changes 89 files and does not include `pnpm-lock.yaml` or `.github/workflows/*`. ## Risks - Medium: this expands plugin host contracts across db/shared/server/ui and includes a new core migration (`0076_useful_elektra.sql`). - The plugin database namespace validator is intentionally restrictive; plugin authors may need follow-up affordances for SQL patterns that remain blocked. - Merge this before the LLM Wiki plugin PR so the plugin can resolve the new SDK and host APIs. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - OpenAI Codex, GPT-5 coding agent, tool-enabled shell/git/GitHub workflow. Context window size was not exposed by the runtime. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
112 lines
5.3 KiB
TypeScript
112 lines
5.3 KiB
TypeScript
/**
|
|
* Canonical status & priority color definitions.
|
|
*
|
|
* Every component that renders a status indicator (StatusIcon, StatusBadge,
|
|
* agent status dots, etc.) should import from here so colors stay consistent.
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Issue status colors
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/** StatusIcon circle: text + border classes */
|
|
export const issueStatusIcon: Record<string, string> = {
|
|
backlog: "text-muted-foreground border-muted-foreground",
|
|
todo: "text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",
|
|
in_progress: "text-yellow-600 border-yellow-600 dark:text-yellow-400 dark:border-yellow-400",
|
|
in_review: "text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",
|
|
done: "text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",
|
|
cancelled: "text-neutral-500 border-neutral-500",
|
|
blocked: "text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",
|
|
};
|
|
|
|
export const issueStatusIconDefault = "text-muted-foreground border-muted-foreground";
|
|
|
|
/** Text-only color for issue statuses (dropdowns, labels) */
|
|
export const issueStatusText: Record<string, string> = {
|
|
backlog: "text-muted-foreground",
|
|
todo: "text-blue-600 dark:text-blue-400",
|
|
in_progress: "text-yellow-600 dark:text-yellow-400",
|
|
in_review: "text-violet-600 dark:text-violet-400",
|
|
done: "text-green-600 dark:text-green-400",
|
|
cancelled: "text-neutral-500",
|
|
blocked: "text-red-600 dark:text-red-400",
|
|
};
|
|
|
|
export const issueStatusTextDefault = "text-muted-foreground";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Badge colors — used by StatusBadge for all entity types
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export const statusBadge: Record<string, string> = {
|
|
// Agent statuses
|
|
active: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
running: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",
|
|
scheduled_retry: "bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",
|
|
paused: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
|
|
idle: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",
|
|
archived: "bg-muted text-muted-foreground",
|
|
|
|
// Goal statuses
|
|
planned: "bg-muted text-muted-foreground",
|
|
achieved: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
completed: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
|
|
// Run statuses
|
|
failed: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
|
timed_out: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
|
|
succeeded: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
ok: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
warning: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
|
|
error: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
|
info: "bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",
|
|
terminated: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
|
pending: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",
|
|
|
|
// Approval statuses
|
|
pending_approval: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
|
|
revision_requested: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
|
|
approved: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
rejected: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
|
|
|
// Issue statuses — consistent hues with issueStatusIcon above
|
|
backlog: "bg-muted text-muted-foreground",
|
|
todo: "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",
|
|
in_progress: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",
|
|
in_review: "bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300",
|
|
blocked: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
|
done: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
|
cancelled: "bg-muted text-muted-foreground",
|
|
};
|
|
|
|
export const statusBadgeDefault = "bg-muted text-muted-foreground";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Agent status dot — solid background for small indicator dots
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export const agentStatusDot: Record<string, string> = {
|
|
running: "bg-cyan-400 animate-pulse",
|
|
active: "bg-green-400",
|
|
paused: "bg-yellow-400",
|
|
idle: "bg-yellow-400",
|
|
pending_approval: "bg-amber-400",
|
|
error: "bg-red-400",
|
|
archived: "bg-neutral-400",
|
|
};
|
|
|
|
export const agentStatusDotDefault = "bg-neutral-400";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Priority colors
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export const priorityColor: Record<string, string> = {
|
|
critical: "text-red-600 dark:text-red-400",
|
|
high: "text-orange-600 dark:text-orange-400",
|
|
medium: "text-yellow-600 dark:text-yellow-400",
|
|
low: "text-blue-600 dark:text-blue-400",
|
|
};
|
|
|
|
export const priorityColorDefault = "text-yellow-600 dark:text-yellow-400";
|