@virsanghavi/axis-server 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
# Project Context
|
|
1
|
+
# Axis — Project Context
|
|
2
2
|
|
|
3
|
+
## Overview
|
|
4
|
+
Axis is a distributed orchestration layer for parallel AI coding agents. It enables multiple agents (Cursor, Claude Code, Windsurf, Codex, Antigravity, etc.) to work on the same codebase simultaneously without collisions or context drift.
|
|
5
|
+
|
|
6
|
+
The core value proposition: **agents that coordinate like a team, not individuals who overwrite each other.**
|
|
7
|
+
|
|
8
|
+
## Architecture
|
|
9
|
+
- **Frontend**: Next.js 14 (App Router) deployed on Vercel. Tailwind CSS, Framer Motion. Auth via Supabase.
|
|
10
|
+
- **Backend**: Next.js API routes + Supabase (Postgres, RLS, RPC functions). Stripe for billing.
|
|
11
|
+
- **MCP Server**: `@virsanghavi/axis-server` — an npm package that exposes Axis tools via the Model Context Protocol. Runs locally in each agent's IDE.
|
|
12
|
+
- **State**: All shared state (locks, jobs, notepad, sessions, embeddings) lives in Supabase, scoped per project. The MCP server syncs local state with the remote API.
|
|
13
|
+
- **File structure**:
|
|
14
|
+
- `shared-context/frontend/` — the web app (dashboard, billing, docs, auth)
|
|
15
|
+
- `shared-context/packages/axis-server/` — the MCP server package
|
|
16
|
+
- `shared-context/supabase/` — schema, migrations, RPC functions
|
|
17
|
+
- `.axis/instructions/` — soul files read by all agents via MCP
|
|
18
|
+
|
|
19
|
+
## Core Features
|
|
20
|
+
1. **Job Board**: Agents post, claim, and complete tasks. Priority-based, dependency-aware. Prevents duplicate work.
|
|
21
|
+
2. **File Locking**: Atomic, per-file locks with 30-minute TTL. Agents call `propose_file_access` before editing. Prevents merge conflicts.
|
|
22
|
+
3. **Live Notepad**: Real-time shared memory. Agents log progress so others know what's happening. Cleared on `finalize_session`.
|
|
23
|
+
4. **Context Mirroring**: `get_project_soul` returns this file + conventions to ground agents in project reality.
|
|
24
|
+
5. **RAG Search**: `search_codebase` and `search_docs` for semantic search over indexed files and documentation.
|
|
25
|
+
6. **Session Management**: `finalize_session` archives the notepad, clears locks, resets for new work.
|
|
26
|
+
7. **Billing**: Stripe-based Pro tier ($25/mo) with API key management, usage tracking, and retention flow.
|
|
27
|
+
|
|
28
|
+
## Deployment
|
|
29
|
+
- Frontend: Vercel (auto-deploy from `shared-context/frontend/`)
|
|
30
|
+
- Database: Supabase (hosted Postgres)
|
|
31
|
+
- MCP Server: Published to npm, run locally via `npx @virsanghavi/axis-server`
|
|
@@ -1,2 +1,62 @@
|
|
|
1
|
-
# Coding Conventions
|
|
1
|
+
# Axis — Coding Conventions & Agent Norms
|
|
2
2
|
|
|
3
|
+
## Language Standards
|
|
4
|
+
- **TypeScript** for all frontend and API code. Strict mode. No `any` unless absolutely necessary.
|
|
5
|
+
- **SQL** for Supabase migrations. Use `IF NOT EXISTS` / `IF EXISTS` for idempotency.
|
|
6
|
+
- **HTML/CSS/JS** for standalone tools (e.g. sandbox apps). Single-file, no frameworks, no build step.
|
|
7
|
+
|
|
8
|
+
## Styling
|
|
9
|
+
- Tailwind CSS exclusively. No custom CSS files unless for animations.
|
|
10
|
+
- Dark theme: `bg-[#050505]`, `text-white`, `border-white/5`. Light panels: `bg-white/95`, `text-neutral-900`.
|
|
11
|
+
- Typography: `lowercase` class on page wrappers. `font-mono` for technical content. `tracking-tight` default.
|
|
12
|
+
- Components: Minimal, no component library. Custom components in `components/`.
|
|
13
|
+
|
|
14
|
+
## Testing
|
|
15
|
+
- Manual testing via browser and MCP tool calls.
|
|
16
|
+
- Health endpoint at `/api/health` checks Supabase and Stripe connectivity.
|
|
17
|
+
|
|
18
|
+
## Code Patterns
|
|
19
|
+
- API routes use `getSessionFromRequest` for auth, `getClientIp` + `rateLimit` for rate limiting.
|
|
20
|
+
- Supabase queries use `.ilike('email', ...)` for case-insensitive email matching.
|
|
21
|
+
- Stripe customer IDs come from DB (`profiles.stripe_customer_id`). Never hardcode customer IDs.
|
|
22
|
+
- All Stripe routes have "no such customer" self-healing: look up by email, update DB, retry.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Agent Behavioral Norms
|
|
27
|
+
|
|
28
|
+
### Plan Before Write — The Core Invariant
|
|
29
|
+
|
|
30
|
+
**No agent writes code unless it either owns a file lock OR has explicitly declined the job board for a scoped reason.**
|
|
31
|
+
|
|
32
|
+
On non-trivial tasks (2+ files, new features, refactors):
|
|
33
|
+
1. Break work into jobs → `post_job`
|
|
34
|
+
2. Claim before editing → `claim_next_job`
|
|
35
|
+
3. Lock before writing → `propose_file_access` with a **descriptive intent**
|
|
36
|
+
4. Complete when done → `complete_job` with outcome
|
|
37
|
+
|
|
38
|
+
Direct edits without a job are allowed only for:
|
|
39
|
+
- Single-line fixes, typos, config tweaks
|
|
40
|
+
- Clearly scoped changes the user asked for directly
|
|
41
|
+
|
|
42
|
+
### Force Unlock Policy
|
|
43
|
+
|
|
44
|
+
`force_unlock` is a **last resort, not a convenience tool.**
|
|
45
|
+
|
|
46
|
+
Rules:
|
|
47
|
+
1. **Never** call `force_unlock` on a file you didn't lock unless:
|
|
48
|
+
- The lock has been held for >25 minutes (close to TTL expiry), AND
|
|
49
|
+
- The locking agent is clearly not responding or has crashed
|
|
50
|
+
2. **Always** provide a specific reason (e.g. "Agent claude-code crashed 20 minutes ago, lock on auth.ts is blocking progress")
|
|
51
|
+
3. **Never** force-unlock to skip coordination. If another agent holds a lock, work on something else.
|
|
52
|
+
4. Prefer waiting for TTL expiry (30 min) over force-unlocking.
|
|
53
|
+
|
|
54
|
+
### Lock Hygiene
|
|
55
|
+
- Always provide descriptive `intent` when locking (e.g. "Refactor auth middleware to use JWT validation" — not "editing file")
|
|
56
|
+
- Release locks early by completing jobs when done
|
|
57
|
+
- Call `finalize_session` at end of session to clean up all locks
|
|
58
|
+
|
|
59
|
+
### Shared Memory
|
|
60
|
+
- Call `update_shared_context` after completing meaningful steps
|
|
61
|
+
- Log decisions, not just actions (e.g. "Chose JWT over session tokens because...")
|
|
62
|
+
- Other agents read the notepad in real-time — write for them
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -1226,8 +1226,52 @@ async function ensureFileSystem() {
|
|
|
1226
1226
|
await fs4.mkdir(axisInstructions, { recursive: true }).catch(() => {
|
|
1227
1227
|
});
|
|
1228
1228
|
const defaults = [
|
|
1229
|
-
["context.md",
|
|
1230
|
-
|
|
1229
|
+
["context.md", `# Project Context
|
|
1230
|
+
|
|
1231
|
+
## Overview
|
|
1232
|
+
This project uses Axis \u2014 an open-source coordination layer for AI agents.
|
|
1233
|
+
Axis provides shared context, atomic file locks, a job board, and real-time
|
|
1234
|
+
activity feeds so that multiple agents (Cursor, Claude, Windsurf, Codex, etc.)
|
|
1235
|
+
can work on the same codebase without conflicts.
|
|
1236
|
+
|
|
1237
|
+
## Architecture
|
|
1238
|
+
- **MCP Server**: Exposes tools (locks, jobs, context, search) via the Model Context Protocol.
|
|
1239
|
+
- **Supabase Backend**: Postgres for state (locks, jobs, profiles); Realtime for live feeds.
|
|
1240
|
+
- **Frontend**: Next.js App Router + Tailwind CSS dashboard at useaxis.dev.
|
|
1241
|
+
- **npm Packages**: @virsanghavi/axis-server (runtime), @virsanghavi/axis-init (scaffolding).
|
|
1242
|
+
|
|
1243
|
+
## Core Features
|
|
1244
|
+
1. File Locking \u2014 atomic, cross-IDE locks with 30-min TTL.
|
|
1245
|
+
2. Job Board \u2014 post / claim / complete tasks with priorities and dependencies.
|
|
1246
|
+
3. Shared Context \u2014 live notepad visible to every agent in real time.
|
|
1247
|
+
4. RAG Search \u2014 vector search over the indexed codebase.
|
|
1248
|
+
5. Soul Files \u2014 context.md, conventions.md, activity.md define project identity.
|
|
1249
|
+
`],
|
|
1250
|
+
["conventions.md", `# Coding Conventions
|
|
1251
|
+
|
|
1252
|
+
## Language & Style
|
|
1253
|
+
- TypeScript everywhere (strict mode).
|
|
1254
|
+
- Tailwind CSS for styling; no raw CSS unless unavoidable.
|
|
1255
|
+
- Functional React components; prefer server components in Next.js App Router.
|
|
1256
|
+
|
|
1257
|
+
## Agent Behavioral Norms
|
|
1258
|
+
|
|
1259
|
+
### Plan Before Write
|
|
1260
|
+
Every non-trivial task must follow: post_job -> claim_next_job -> propose_file_access -> (edit) -> complete_job.
|
|
1261
|
+
Skip only for single-line typo fixes.
|
|
1262
|
+
|
|
1263
|
+
### Force-Unlock Policy
|
|
1264
|
+
force_unlock is a LAST RESORT. Before using it:
|
|
1265
|
+
1. Verify the lock is > 25 minutes old.
|
|
1266
|
+
2. Confirm the locking agent is unresponsive.
|
|
1267
|
+
3. Provide a specific reason string.
|
|
1268
|
+
Never casually unlock files \u2014 always try propose_file_access first.
|
|
1269
|
+
|
|
1270
|
+
### Proactive Tool Usage
|
|
1271
|
+
Agents must use Axis MCP tools by default \u2014 do not wait for the user to say "use Axis".
|
|
1272
|
+
On session start, call get_project_soul or read_context to load project state.
|
|
1273
|
+
After significant progress, call update_shared_context.
|
|
1274
|
+
`],
|
|
1231
1275
|
["activity.md", "# Activity Log\n\n"]
|
|
1232
1276
|
];
|
|
1233
1277
|
for (const [file, content] of defaults) {
|