Add Prime Intellect client, API, and MCP server
packages/prime — a hand-written typed client, because the first-party SDK is Python only. Deliberately narrow: PIG reads availability and nothing else, and the key it holds should be scoped so it could not provision even if the code tried. Rate limits are undocumented upstream, so it backs off empirically with full jitter and honours Retry-After. Unknown fields survive in `raw` rather than being dropped. apps/api — Hono, with authentication and authorization kept firmly apart. A verified JWT proves someone has an account in the identity project, which may be shared with other applications; it does NOT prove they belong here. Access requires a row in PIG's own users table, and a token without one gets 403 needs_profile rather than entry. The capacity service is the business logic: availability counts sold and held separately, so a live hold removes inventory from everyone else's availability without inflating utilisation. Expired holds are ignored at read time, so the numbers stay right even when the sweeper is behind. Matching treats interconnect as a hard filter and excludes Unknown as well as Ethernet — unverified is not the same as adequate. apps/mcp — nine tools over stdio, so a team member drives PIG from Claude Code, Codex, prime-agent, or a Buzz agent. It holds an API key and calls the same HTTP API the browser does, with no database credentials, so an agent can never reach further than the person it acts for. Results are formatted as prose rather than raw JSON. Theme preferences live in the database rather than localStorage, so a chosen accent follows someone from laptop to phone. Status colours stay independent of the accent: if "at risk" re-tinted to whatever a user picked, the signal would be gone. Note on the SDK import: its package exports use a `./*` wildcard whose types entry resolves server/mcp.js to server/mcp.js.d.ts, which does not exist. The runtime specifier must keep the .js suffix, so the types are mapped via tsconfig paths rather than by writing an import that would fail at runtime. Verified: all five packages typecheck; the MCP server constructs and registers its tools. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,20 @@ export const users = pgTable(
|
||||
*/
|
||||
isPlatformAdmin: boolean('is_platform_admin').notNull().default(false),
|
||||
|
||||
/**
|
||||
* Appearance preferences, persisted server-side rather than in
|
||||
* localStorage so a person's chosen look follows them between their
|
||||
* laptop and their phone. `system` defers to the OS.
|
||||
*/
|
||||
themeMode: text('theme_mode').notNull().default('system'),
|
||||
/**
|
||||
* Accent colour key from the shared palette in @pig/core. The whole
|
||||
* interface re-tints from this one value. Stored as a key rather than a
|
||||
* hex string so the palette can be retuned centrally — and so a user
|
||||
* cannot pick something illegible against the surface colours.
|
||||
*/
|
||||
accentColor: text('accent_color').notNull().default('pig'),
|
||||
|
||||
/** Set when the person stops using PIG. Rows are retained for audit. */
|
||||
deactivatedAt: timestamp('deactivated_at', { withTimezone: true }),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user