synomem 0.1.0 → 0.2.0

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.
Files changed (73) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +37 -1
  3. package/README.md +28 -15
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +311 -70
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client.d.ts +96 -17
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +333 -76
  10. package/dist/client.js.map +1 -1
  11. package/dist/config.d.ts +2 -2
  12. package/dist/config.js +8 -8
  13. package/dist/import.d.ts +207 -13
  14. package/dist/import.d.ts.map +1 -1
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +2 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/mcp/index.d.ts.map +1 -1
  20. package/dist/mcp/index.js +156 -31
  21. package/dist/mcp/index.js.map +1 -1
  22. package/dist/mcp-server.js +54 -8
  23. package/dist/mcp-server.js.map +1 -1
  24. package/dist/ports/repository.d.ts +18 -1
  25. package/dist/ports/repository.d.ts.map +1 -1
  26. package/dist/projections.d.ts +18 -1
  27. package/dist/projections.d.ts.map +1 -1
  28. package/dist/projections.js +137 -44
  29. package/dist/projections.js.map +1 -1
  30. package/dist/remote.d.ts +57 -9
  31. package/dist/remote.d.ts.map +1 -1
  32. package/dist/remote.js +43 -2
  33. package/dist/remote.js.map +1 -1
  34. package/dist/schemas.d.ts +302 -21
  35. package/dist/schemas.d.ts.map +1 -1
  36. package/dist/schemas.js +142 -26
  37. package/dist/schemas.js.map +1 -1
  38. package/dist/service.d.ts +57 -10
  39. package/dist/service.d.ts.map +1 -1
  40. package/dist/skill-install.d.ts +8 -2
  41. package/dist/skill-install.d.ts.map +1 -1
  42. package/dist/skill-install.js +6 -11
  43. package/dist/skill-install.js.map +1 -1
  44. package/dist/storage.d.ts +41 -1
  45. package/dist/storage.d.ts.map +1 -1
  46. package/dist/storage.js +254 -36
  47. package/dist/storage.js.map +1 -1
  48. package/dist/types.d.ts +213 -38
  49. package/dist/types.d.ts.map +1 -1
  50. package/docs/cli.md +53 -20
  51. package/docs/examples.md +4 -4
  52. package/docs/mcp.md +12 -4
  53. package/docs/skill.md +10 -7
  54. package/docs/storage-format.md +4 -4
  55. package/openapi/synomem-v1.yaml +24 -24
  56. package/package.json +1 -1
  57. package/skills/synomem/SKILL.md +24 -8
  58. package/skills/synomem/agents/openai.yaml +1 -1
  59. package/skills/synomem/references/examples.md +1 -1
  60. package/src/cli.ts +572 -173
  61. package/src/client.ts +391 -79
  62. package/src/config.ts +8 -8
  63. package/src/index.ts +11 -1
  64. package/src/mcp/index.ts +189 -30
  65. package/src/mcp-server.ts +58 -8
  66. package/src/ports/repository.ts +16 -0
  67. package/src/projections.ts +139 -44
  68. package/src/remote.ts +118 -8
  69. package/src/schemas.ts +147 -26
  70. package/src/service.ts +59 -7
  71. package/src/skill-install.ts +14 -17
  72. package/src/storage.ts +326 -34
  73. package/src/types.ts +228 -39
package/ARCHITECTURE.md CHANGED
@@ -44,7 +44,7 @@ reconstruct one requested aggregate. Generated Markdown is never a machine query
44
44
  ## Authorization
45
45
 
46
46
  MCP servers bind one actor at startup, and tool inputs cannot override it. Humans have local
47
- administrative authority. Agents can manage their own notes, recipient memo state, and todos they
47
+ administrative authority. Agents can manage their own notes and todos, recipient memo state, and tasks they
48
48
  created or received. System actors have no implicit agent or administrator authority. Actor
49
49
  principals are keyed by both kind and ID; matching text IDs across kinds do not share author access.
50
50
 
@@ -55,7 +55,7 @@ The filesystem owner remains the ultimate local authority.
55
55
  ## Concurrency and durability
56
56
 
57
57
  SQLite uses WAL, foreign keys, `synchronous=FULL`, a bounded busy handler, and `BEGIN IMMEDIATE`
58
- transactions. Actor-scoped idempotency protects retries. Note and todo revisions use aggregate
58
+ transactions. Actor-scoped idempotency protects retries. Note, task, and todo revisions use aggregate
59
59
  versions so stale writes fail with `REVISION_CONFLICT` rather than overwriting concurrent state.
60
60
 
61
61
  V1 supports one machine and one filesystem owner. A future hosted service must enforce the same
package/CHANGELOG.md CHANGED
@@ -5,6 +5,41 @@ All notable changes will be documented here. The format follows
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ### Changed
9
+
10
+ - The MCP server binds to an agent with `--agent-id`, reading the display name and actor kind from
11
+ the agent's profile. `synomem skill install --agent <id-or-alias>` resolves the agent before
12
+ writing anything, records a runtime binding for each runtime it installs, and generates a
13
+ registration command carrying only the canonical ID.
14
+
15
+ ## [0.2.0] - 2026-09-05
16
+
17
+ ### Added
18
+
19
+ - Private todos as a distinct domain: a todo belongs to the agent that wrote it, is visible to no
20
+ one else, and cannot be assigned. Work meant for another agent is a task.
21
+ - Optional responses when accepting a task and required responses when rejecting one, so a refusal
22
+ always tells the assigner why.
23
+ - Discovery for work that has stalled: tasks awaiting a response and tasks past their deadline.
24
+ - Case-insensitive agent aliases with `agent resolve`, which returns candidates instead of guessing
25
+ when several agents answer to one name, and `agent directory`.
26
+ - Advisory runtime bindings recording where an agent was registered to run, with `agent runtime
27
+ bind`, `list`, and `unbind`, and the matching `synomem_agent_resolve` and
28
+ `synomem_agent_directory` MCP tools.
29
+
30
+ ### Changed
31
+
32
+ - Schema version 5 adds a normalized alias column with a unique index and an
33
+ `agent_runtime_bindings` table. Existing databases migrate in place.
34
+ - Aliases are stored folded to lowercase, so one name cannot be claimed twice in two casings.
35
+
36
+ ## [0.1.1] - 2026-09-04
37
+
38
+ ### Fixed
39
+
40
+ - Allow configured `SYNOMEM_ACTOR_ID`, `SYNOMEM_ACTOR_KIND`, and `SYNOMEM_ACTOR_NAME` values to
41
+ override historical CLI default identities for remote commands while preserving local fallbacks.
42
+
8
43
  ## [0.1.0] - 2026-09-04
9
44
 
10
45
  ### Added
@@ -31,5 +66,6 @@ All notable changes will be documented here. The format follows
31
66
  - Skill installation is explicit, constrained to supported runtime directories, and dry-run by
32
67
  default.
33
68
 
34
- [Unreleased]: https://github.com/Coaden/synomem/compare/v0.1.0...HEAD
69
+ [Unreleased]: https://github.com/Coaden/synomem/compare/v0.1.1...HEAD
70
+ [0.1.1]: https://github.com/Coaden/synomem/compare/v0.1.0...v0.1.1
35
71
  [0.1.0]: https://github.com/Coaden/synomem/releases/tag/v0.1.0
package/README.md CHANGED
@@ -43,8 +43,8 @@ MCP server, compact change feeds, and readable Markdown projections. V1 runs ent
43
43
  and opens no network listener.
44
44
 
45
45
  > [!IMPORTANT]
46
- > The renamed `synomem` package has not been published yet. It is pre-1.0 software, so review the
47
- > release notes and rename guidance before upgrading persisted storage or public API consumers.
46
+ > Synomem is pre-1.0 software. Review the release notes before upgrading persisted storage or public
47
+ > API consumers.
48
48
 
49
49
  ## Quick start
50
50
 
@@ -69,11 +69,17 @@ synomem note create --as gracie \
69
69
  --title "Release invariant" \
70
70
  --body "Never publish without explicit maintainer authorization."
71
71
 
72
- synomem todo create codex \
72
+ synomem task create codex \
73
73
  --from gracie --title "Review the migration" --due-date 2026-09-15
74
74
 
75
75
  synomem inbox codex
76
- synomem todo accept <todo-id> --as codex
76
+ synomem task accept <task-id> --as codex --response "Starting after the tests."
77
+
78
+ # A todo is private to the agent that wrote it; nobody else can assign one.
79
+ synomem todo create --as codex --title "Re-read the migration notes"
80
+
81
+ synomem agent resolve Mike
82
+ synomem agent directory
77
83
  synomem list
78
84
  ```
79
85
 
@@ -87,15 +93,15 @@ terminal-capable agent. The Synomem package contains the portable
87
93
  installer for the six named local harnesses.
88
94
 
89
95
  ```text
90
- Set up Synomem for this agent and runtime. Synomem is a local-first coordination system for durable kudos, one-to-one memos, private agent notes, and consent-based assigned todos. It uses an append-only SQLite database under ~/.agents by default, an actor-bound stdio MCP server, and a portable Agent Skill. Multiple local agents may share the database, but every MCP server must be bound to its own stable identity.
96
+ Set up Synomem for this agent and runtime. Synomem is a local-first coordination system for durable kudos, one-to-one memos, private agent notes, consent-based assigned tasks, and private todos. It uses an append-only SQLite database under ~/.agents by default, an actor-bound stdio MCP server, and a portable Agent Skill. Multiple local agents may share the database, but every MCP server must be bound to its own stable identity.
91
97
 
92
98
  Work autonomously through the safe, reversible steps below. Do not expose secrets, overwrite unrelated configuration, invent an identity, use --force without my explicit approval, or modify another agent's integration.
93
99
 
94
100
  1. Verify Node.js 22.13+ and npm are available. Install or update the public package with `npm install --global synomem` if needed, then report `synomem --version`.
95
101
  2. Preserve an existing `SYNOMEM_HOME`; otherwise use the default ~/.agents. Run `synomem init`, then `synomem doctor`. Never point tests or experiments at another Synomem home.
96
102
  3. Run `synomem agent list`. Determine this agent's existing stable ID from the current harness or Synomem configuration and reuse it. If no identity is clearly established, ask me for the agent ID and display name before running `synomem agent create <id> --name <name>`. Never silently merge or rename identities.
97
- 4. Detect the current harness from actual local evidence and its installed CLI help. Use runtime `claude` for Claude Code, `codex` for Codex, `hermes` for Hermes, `openclaw` for OpenClaw, `cursor` for Cursor, or `grok` for local Grok Build (`grokbot` is accepted as an alias). Check `synomem skill install --help`, then preview with `synomem skill install --runtime <runtime> --actor-id <agent-id> --actor-name <display-name>`. Review the exact destination and apply the same command with `--yes`; it must report `current`. If the installed release does not yet list this runtime, locate the packaged source under the global npm root at `synomem/skills/synomem` and follow the verified destination and conflict rules in https://github.com/Coaden/synomem/blob/main/docs/skill.md instead. Do not guess a path, overwrite an existing skill, or create a fake harness home to make an unavailable runtime appear installed.
98
- 5. Inspect any actor-bound MCP registration command printed by the installer. Check the harness's existing MCP list/config first, then run the command only if `synomem` is absent or incorrect. Do not create duplicates. Cursor has no noninteractive MCP-add command: carefully merge a `synomem` stdio entry into its documented user `~/.cursor/mcp.json`, using command `synomem-mcp` and arguments `--actor-id <agent-id> --actor-kind agent --actor-name <display-name>`; preserve every existing entry.
103
+ 4. Detect the current harness from actual local evidence and its installed CLI help. Use runtime `claude` for Claude Code, `codex` for Codex, `hermes` for Hermes, `openclaw` for OpenClaw, `cursor` for Cursor, or `grok` for local Grok Build (`grokbot` is accepted as an alias). Check `synomem skill install --help`, then preview with `synomem skill install --runtime <runtime> --agent <agent-id>`. Review the exact destination and apply the same command with `--yes`; it must report `current`. If the installed release does not yet list this runtime, locate the packaged source under the global npm root at `synomem/skills/synomem` and follow the verified destination and conflict rules in https://github.com/Coaden/synomem/blob/main/docs/skill.md instead. Do not guess a path, overwrite an existing skill, or create a fake harness home to make an unavailable runtime appear installed.
104
+ 5. Inspect any actor-bound MCP registration command printed by the installer. Check the harness's existing MCP list/config first, then run the command only if `synomem` is absent or incorrect. Do not create duplicates. Cursor has no noninteractive MCP-add command: carefully merge a `synomem` stdio entry into its documented user `~/.cursor/mcp.json`, using command `synomem-mcp` and the single argument `--agent-id <agent-id>` (the display name and kind come from the agent's profile, so nothing in a shared config file asserts an identity); preserve every existing entry.
99
105
  6. Verify the harness can discover the installed skill and MCP server using its own list/status commands, then run `synomem doctor`. Start a new agent session if that harness does not live-reload a newly created skills directory.
100
106
  7. If this is hosted Grok Bot rather than local Grok Build, do not claim it shares the desktop's local SQLite database. Install the package and skill only inside a persistent terminal environment where `npm`, local stdio MCP, and ~/.grok are actually available. Otherwise provide the skill URL https://github.com/Coaden/synomem/blob/main/skills/synomem/SKILL.md and explain the unsupported boundary; do not expose the local database through a tunnel.
101
107
  8. Report the package version, stable actor ID, storage home, installed skill path, MCP registration and verification status, whether a new session is needed, and every file or configuration changed. Do not print record contents or environment values beyond the non-secret actor identity and home path.
@@ -130,13 +136,20 @@ await client.notes.revise({
130
136
  body: 'Never publish or create a release without explicit maintainer authorization.',
131
137
  });
132
138
 
133
- await client.todos.create({
139
+ // A task is assigned to someone else and needs their consent.
140
+ await client.tasks.create({
134
141
  assigneeAgentId: 'codex',
135
142
  title: 'Review the migration',
136
143
  due: { kind: 'date', date: '2026-09-15' },
137
144
  });
138
145
 
139
- const page = await client.items.list({ kinds: ['memo', 'todo'], limit: 10 });
146
+ // A todo is the agent's own reminder, visible to no one else.
147
+ await client.todos.create({
148
+ title: 'Re-read the migration notes',
149
+ due: { kind: 'date', date: '2026-09-14' },
150
+ });
151
+
152
+ const page = await client.items.list({ kinds: ['memo', 'task'], limit: 10 });
140
153
  const changes = await client.items.changes({ after: page.watermark });
141
154
 
142
155
  await client.close();
@@ -147,7 +160,7 @@ The library performs no filesystem work at import time and never terminates its
147
160
  ## Context-safe reads
148
161
 
149
162
  `client.items.list()` and MCP `synomem_list` return 10 compact summaries by default and at most 50.
150
- Summaries omit message bodies, kudos reasons and evidence, note bodies, todo descriptions, source,
163
+ Summaries omit message bodies, kudos reasons and evidence, note bodies, task and todo details, source,
151
164
  and metadata. Fetch one authorized detail record with `items.get(id)` or `synomem_get`.
152
165
 
153
166
  Incremental reads return at most 20 changes by default and 100 at most. List and change responses
@@ -176,9 +189,9 @@ bounded reads. See [the MCP guide](docs/mcp.md).
176
189
  The package includes [`skills/synomem`](skills/synomem). Installation is explicit and dry-run first:
177
190
 
178
191
  ```bash
179
- synomem skill install --runtime codex --actor-id codex --actor-name "Codex"
180
- synomem skill install --runtime codex --actor-id codex --actor-name "Codex" --yes
181
- synomem skill install --runtime hermes --actor-id mycroft --actor-name "Mycroft" --yes
192
+ synomem skill install --runtime codex --agent codex
193
+ synomem skill install --runtime codex --agent codex --yes
194
+ synomem skill install --runtime hermes --agent mycroft --yes
182
195
  synomem skill status
183
196
  ```
184
197
 
@@ -197,8 +210,8 @@ are `claude`, `codex`, `hermes`, `openclaw`, `cursor`, and `grok`; `grokbot` ali
197
210
  ├── profile.json
198
211
  ├── WINS.md
199
212
  ├── MEMORY.md
200
- ├── TODOS.md
201
- ├── inbox/{kudos,memos,todos}/
213
+ ├── TASKS.md
214
+ ├── inbox/{kudos,memos,tasks}/
202
215
  └── NOTES.md
203
216
  ```
204
217
 
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,OAAO,EAA0B,MAAM,WAAW,CAAC;AAE5D,OAAO,EAA0C,KA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