memorix 1.0.7 → 1.0.8
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.
- package/CHANGELOG.md +36 -9
- package/README.md +469 -409
- package/README.zh-CN.md +468 -415
- package/TEAM.md +106 -0
- package/dist/cli/index.js +31325 -26915
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/static/app.js +49 -49
- package/dist/dashboard/static/index.html +2 -2
- package/dist/index.js +1061 -234
- package/dist/index.js.map +1 -1
- package/dist/sdk.d.ts +677 -0
- package/dist/sdk.js +18962 -0
- package/dist/sdk.js.map +1 -0
- package/dist/types.d.ts +10 -10
- package/dist/types.js +10 -10
- package/dist/types.js.map +1 -1
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +684 -0
- package/docs/AI_CONTEXT.md +18 -0
- package/docs/API_REFERENCE.md +687 -0
- package/docs/ARCHITECTURE.md +488 -0
- package/docs/CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md +470 -0
- package/docs/CONFIGURATION.md +265 -0
- package/docs/DESIGN_DECISIONS.md +358 -0
- package/docs/DEVELOPMENT.md +317 -0
- package/docs/DOCKER.md +138 -0
- package/docs/GIT_MEMORY.md +221 -0
- package/docs/KNOWN_ISSUES_AND_ROADMAP.md +149 -0
- package/docs/MEMORY_FORMATION_PIPELINE.md +224 -0
- package/docs/MODULES.md +383 -0
- package/docs/PERFORMANCE.md +64 -0
- package/docs/README.md +79 -0
- package/docs/SETUP.md +521 -0
- package/docs/hooks-architecture.md +108 -0
- package/package.json +24 -23
package/TEAM.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Memorix Team Protocol
|
|
2
|
+
|
|
3
|
+
Rules for project-scoped autonomous-agent coordination via Memorix team tools. The Team page is an **Agent Team status surface** — it shows explicitly joined autonomous agents, open tasks, locks, messages, handoffs, and what needs attention. It is NOT an organization backend, staffing admin tool, or automatic chat room between separate IDE windows.
|
|
4
|
+
|
|
5
|
+
Only agents that are intentionally participating in team/task/message/lock workflows need this protocol. Memory-only sessions should stay lightweight and do not need a team identity.
|
|
6
|
+
|
|
7
|
+
For real autonomous multi-agent development, prefer `memorix orchestrate`: it launches and supervises CLI agent workers through Memorix tasks, context, verification, and fix loops. The team tools support that workflow; they should not be interpreted as proof that unrelated IDE conversation windows can autonomously contact each other.
|
|
8
|
+
|
|
9
|
+
There are 4 team tools, each with an `action` parameter:
|
|
10
|
+
|
|
11
|
+
- `team_manage` — action: join / leave / status
|
|
12
|
+
- `team_file_lock` — action: lock / unlock / status
|
|
13
|
+
- `team_task` — action: create / claim / complete / list
|
|
14
|
+
- `team_message` — action: send / broadcast / inbox
|
|
15
|
+
|
|
16
|
+
## RULE 1: Start Lightweight, Join Team Explicitly
|
|
17
|
+
|
|
18
|
+
At the **beginning of every memory session**, before project-scoped memory work:
|
|
19
|
+
|
|
20
|
+
1. Call `memorix_session_start` to bind the project, open the session, and restore context.
|
|
21
|
+
2. By default, `memorix_session_start` is **lightweight**: it does **not** create a team identity.
|
|
22
|
+
3. If you actually want to participate in autonomous agent tasks, messages, or locks, explicitly join in one of two ways:
|
|
23
|
+
- call `memorix_session_start` with `joinTeam: true`
|
|
24
|
+
- or call `team_manage` with `action: "join"`
|
|
25
|
+
4. Store the returned **agent ID** only after an explicit join — you will need it for subsequent team operations.
|
|
26
|
+
5. Call `memorix_poll` with your agent ID to see current autonomous agents, check available tasks, and read unread messages.
|
|
27
|
+
6. If you need a custom role or capabilities, use explicit `team_manage(join)` so the role overrides the default mapping cleanly.
|
|
28
|
+
|
|
29
|
+
## RULE 2: Lock Before Edit
|
|
30
|
+
|
|
31
|
+
Before modifying any file that another agent might also be working on:
|
|
32
|
+
|
|
33
|
+
1. Call `team_file_lock` with `action: "status"` and the file path to check if it is already locked.
|
|
34
|
+
2. If unlocked, call `team_file_lock` with `action: "lock"`, the file path, and your agent ID.
|
|
35
|
+
3. If locked by another agent, **do not edit that file**. Either:
|
|
36
|
+
- Work on a different file.
|
|
37
|
+
- Send a `request` message to the lock owner asking them to release it.
|
|
38
|
+
- Wait and re-check later.
|
|
39
|
+
4. When you are done editing, call `team_file_lock` with `action: "unlock"` to release the lock.
|
|
40
|
+
|
|
41
|
+
**Never edit a file locked by another agent.** Lock violations cause merge conflicts and data loss.
|
|
42
|
+
|
|
43
|
+
Locks auto-expire after 10 minutes. If you hold a lock for extended work, re-lock periodically to refresh the TTL.
|
|
44
|
+
|
|
45
|
+
## RULE 3: Use Tasks for Work Coordination
|
|
46
|
+
|
|
47
|
+
When the user assigns work that involves multiple agents or multiple steps:
|
|
48
|
+
|
|
49
|
+
1. Call `team_task` with `action: "create"` to break the work into discrete tasks with clear descriptions.
|
|
50
|
+
2. Use `deps` to declare dependencies between tasks (a task cannot be claimed until its dependencies are completed).
|
|
51
|
+
3. Call `team_task` with `action: "claim"` to assign a task to yourself before starting work on it.
|
|
52
|
+
4. Call `team_task` with `action: "complete"` and a `result` summary when the task is done.
|
|
53
|
+
5. Call `team_task` with `action: "list"` to see overall progress and find available work.
|
|
54
|
+
|
|
55
|
+
Rules:
|
|
56
|
+
- Only claim tasks whose dependencies are all completed.
|
|
57
|
+
- Only one agent may claim a given task.
|
|
58
|
+
- If you cannot complete a claimed task, leave the team so the task returns to pending and another agent can pick it up.
|
|
59
|
+
|
|
60
|
+
## RULE 4: Communication Protocol
|
|
61
|
+
|
|
62
|
+
Use `team_message` with `action: "send"` for direct messages and `action: "broadcast"` for announcements. Message types and their intended use:
|
|
63
|
+
|
|
64
|
+
| Type | Use |
|
|
65
|
+
|------|-----|
|
|
66
|
+
| `request` | Ask another agent to do something, release a lock, or provide information. |
|
|
67
|
+
| `response` | Reply to a prior request. |
|
|
68
|
+
| `info` | Share context: discoveries, status updates, warnings about tricky code. |
|
|
69
|
+
| `announcement` | Broadcast to all agents: major state changes, deployment events, breaking changes. |
|
|
70
|
+
| `contract` | Propose or agree on a division of work. Both agents should acknowledge. |
|
|
71
|
+
| `error` | Report a blocking issue that requires another agent's attention. |
|
|
72
|
+
|
|
73
|
+
Rules:
|
|
74
|
+
- `action: "send"` requires the full UUID of the target agent. Get it from `team_manage` with `action: "status"`.
|
|
75
|
+
- Check your inbox (`action: "inbox"`) at least once before starting new work and once before ending a session.
|
|
76
|
+
- Keep message content under 10KB. Be concise and actionable.
|
|
77
|
+
|
|
78
|
+
## RULE 5: Leave on Session End
|
|
79
|
+
|
|
80
|
+
When the session is ending:
|
|
81
|
+
|
|
82
|
+
1. Call `team_file_lock` with `action: "unlock"` for every file you have locked, or they will remain locked until TTL expiry (10 min).
|
|
83
|
+
2. If you have in-progress tasks you cannot finish, leave them — leaving releases your tasks back to pending.
|
|
84
|
+
3. Call `team_manage` with `action: "leave"` and your agent ID. This marks you inactive, releases all your locks, and clears your inbox.
|
|
85
|
+
|
|
86
|
+
## RULE 6: Conflict Prevention
|
|
87
|
+
|
|
88
|
+
- **Check before acting.** Always check team status and file lock status before starting work to understand the current state.
|
|
89
|
+
- **Communicate before diverging.** If you plan to refactor shared code, broadcast an `announcement` first so other agents can save their work.
|
|
90
|
+
- **Respect lock ownership.** The lock holder has exclusive write access. No exceptions.
|
|
91
|
+
- **Prefer small, scoped changes.** Large cross-cutting changes increase conflict risk. Coordinate via tasks and messages if a change touches files other agents are working on.
|
|
92
|
+
- **Do not duplicate work.** Check the task list before creating new tasks. If a similar task exists, claim it instead of creating a duplicate.
|
|
93
|
+
|
|
94
|
+
## Summary of Required Calls
|
|
95
|
+
|
|
96
|
+
| When | Tool Call |
|
|
97
|
+
|------|-----------|
|
|
98
|
+
| Session start | `memorix_session_start` (lightweight) |
|
|
99
|
+
| Join Agent Team | `memorix_session_start(joinTeam=true)` or `team_manage(join)` |
|
|
100
|
+
| After joining | `memorix_poll` (check status + inbox) |
|
|
101
|
+
| Before editing a shared file | `team_file_lock(status)`, `team_file_lock(lock)` |
|
|
102
|
+
| After editing | `team_file_lock(unlock)` |
|
|
103
|
+
| Starting a unit of work | `team_task(claim)` or `team_task(create)` + `team_task(claim)` |
|
|
104
|
+
| Finishing a unit of work | `team_task(complete)` |
|
|
105
|
+
| Need to coordinate | `team_message(send)` or `team_message(broadcast)` |
|
|
106
|
+
| Session end | `team_file_lock(unlock)` (all), `team_manage(leave)` |
|