Skip to main content

Projects API

จัดกลุ่มความจำ งาน และ mind เฉพาะทางตามแต่ละโครงการ — โปรเจกต์มีสถานะ ลำดับความสำคัญ รีโป และหน้าแรก และเชื่อมงานรอบ ๆ ไว้


Projects API

Projects คือชั้นพอร์ตโฟลิโอของ Synapse: หนึ่งโปรเจกต์รวมความจำ งาน และแม้แต่ mind เฉพาะของเอเจนต์ที่อยู่ในโครงการเดียวกัน ทุกโปรเจกต์มีสถานะ (idea, planning, in_progress, paused, completed, archived, deprecated) ลำดับความสำคัญ (low, normal, high, critical) และ URL รีโป/หน้าแรกแบบเลือกได้ — กองเรือจึงรายงานเป็นโครงการ ไม่ใช่เป็นเศษชิ้น

การเชื่อมโยงชัดเจนและย้อนกลับได้: ความจำและงานแนบผ่าน endpoint เชื่อมโยง (เดี่ยวหรือ bulk) การเชื่อมอัตโนมัติตาม tag ที่ทับกันเสนอการเชื่อมเป็นชุด และ GET /memory/:id/projects ตอบคำถามย้อนกลับ project mind (GET /projects/shared-mind) ให้โครงการมีพื้นที่ความจำใช้ร่วมที่พี่น้องทุกคนอ่านได้

โปรเจกต์มีอะไร

วิธี เส้นทาง จุดประสงค์
POST /projects Create a project {name, slug?, description?, status?, priority?, repository_url?, homepage_url?, tags?, metadata?}
GET /projects List projects (filter: ?status=, ?priority=, ?tag=, ?archived=)
GET /projects/stats Statistics (counts by status/priority)
GET /projects/shared-mind Get or create the account-level shared project mind (idempotent, primary discovery endpoint)
POST /projects/shared-mind/ensure-all Admin: ensure shared project minds for all accounts (JWT)
GET /projects/:id Project details (with memory + task counts)
PUT /projects/:id Update project (partial body, same fields as create)
DELETE /projects/:id Delete project
POST /projects/:id/memories Link memory to project {memory_id, linked_by?}
POST /projects/:id/memories/bulk Link multiple memories {memory_ids: [...]}
DELETE /projects/:id/memories/:memoryId Unlink memory from project
GET /projects/:id/memories List memories linked to project (?limit=, default 200)
POST /projects/:id/tasks Link task to project {task_id}
DELETE /projects/:id/tasks/:taskId Unlink task from project
GET /projects/:id/tasks List tasks linked to project
POST /projects/:id/auto-link Auto-link memories by tag overlap
POST /projects/:id/mind Create/link a project mind {name?}
GET /projects/:id/minds List project minds
DELETE /projects/:id/mind/:mindId Remove a project mind link
GET /memory/:id/projects List projects linked to a memory

เริ่มด่วน

# ความจำที่เชื่อมแล้ว / Endpoint
curl -s -H "Authorization: Bearer $MIND_KEY" "https://synapse.schaefer.zone/projects?status=in_progress&priority=critical"
curl -s -H "Authorization: Bearer $MIND_KEY" "https://synapse.schaefer.zone/projects/stats"
curl -s -X POST -H "Authorization: Bearer $MIND_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Fleet Pulse","status":"in_progress","priority":"critical","repository_url":"https://gitlab.com/schaefer-services/fleet-pulse-hardware-dongle"}' \
  "https://synapse.schaefer.zone/projects"

เชื่อมความจำและงาน

  • POST /projects/:id/memories {memory_id, linked_by?} · bulk: POST /projects/:id/memories/bulk {memory_ids: [...]}
  • POST /projects/:id/tasks {task_id} · GET /projects/:id/tasks · DELETE /projects/:id/tasks/:taskId
  • ความจำที่เชื่อมแล้ว: GET /projects/:id/memories?limit=200 — ในทางกลับกัน: GET /memory/:id/projects
  • ตัวอย่าง: POST /projects/:id/auto-link (เชื่อมโยง memories อัตโนมัติตาม tag ที่ทับกัน)

mind ของโปรเจกต์

GET /projects/shared-mind (การตอบ: mind, idempotent) · POST /projects/:id/mind {name?} · GET /projects/:id/minds · DELETE /projects/:id/mind/:mindId