@ghostpaw/affinity 0.3.0 → 0.4.1
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/README.md +168 -9
- package/dist/cli.js +606 -137
- package/dist/index.cjs +38 -14
- package/dist/index.js +38 -14
- package/dist/mcp-server.js +52 -23
- package/dist/mcp.cjs +40 -16
- package/dist/mcp.d.cts +10 -0
- package/dist/mcp.d.ts +10 -0
- package/dist/mcp.js +40 -16
- package/package.json +17 -6
package/README.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
<a href="https://affinity.ghostpaw.dev/"><img src="https://raw.githubusercontent.com/GhostPawJS/affinity/main/.github/social-preview.png" alt="GhostPaw affinity: Who have you been meaning to call?" width="100%"></a>
|
|
2
|
+
|
|
1
3
|
# @ghostpaw/affinity
|
|
2
4
|
|
|
3
|
-
[](https://www.npmjs.com/package/@ghostpaw/affinity)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@ghostpaw/affinity) [](https://github.com/GhostPawJS/affinity/actions/workflows/ci.yml) [](https://affinity.ghostpaw.dev/) [](package.json) [](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.GhostPawJS%2Faffinity/versions/latest) [](https://nodejs.org) [](LICENSE)
|
|
6
|
+
|
|
7
|
+
**Agent contacts: people, promises and yearly dates, with a radar for who is drifting.**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @ghostpaw/affinity
|
|
11
|
+
```
|
|
9
12
|
|
|
10
13
|
A standalone social CRM core for Node.js, built on SQLite.
|
|
11
14
|
|
|
@@ -88,11 +91,157 @@ npx -y @ghostpaw/affinity skill > SKILL.md
|
|
|
88
91
|
|
|
89
92
|
## Install
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
npm
|
|
94
|
+
|
|
95
|
+
The [npm package](https://www.npmjs.com/package/@ghostpaw/affinity) requires Node 24+:
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npm install -g @ghostpaw/affinity
|
|
99
|
+
npx -y @ghostpaw/affinity --help
|
|
93
100
|
```
|
|
94
101
|
|
|
95
|
-
|
|
102
|
+
Standalone binaries are available from [GitHub Releases](https://github.com/GhostPawJS/affinity/releases)
|
|
103
|
+
for linux-x64, linux-arm64, darwin-arm64, darwin-x64 and windows-x64.
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/affinity/main/install.sh | sh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```powershell
|
|
110
|
+
irm https://raw.githubusercontent.com/GhostPawJS/affinity/main/install.ps1 | iex
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
A session with the 0.4.0 linux-x64 binary against a fresh database (output piped through `jq` to keep it short):
|
|
114
|
+
|
|
115
|
+

|
|
116
|
+
|
|
117
|
+
The same session as an [animated GIF](https://raw.githubusercontent.com/GhostPawJS/affinity/main/docs/assets/cli.gif).
|
|
118
|
+
|
|
119
|
+
Other release installers:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
mise use -g github:GhostPawJS/affinity
|
|
123
|
+
ubi --project GhostPawJS/affinity --exe ghostpaw-affinity --in ~/.local/bin
|
|
124
|
+
eget GhostPawJS/affinity
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
For [aqua](https://aquaproj.github.io/docs/reference/registry-config/), define a
|
|
128
|
+
`github_release` package in `aqua.yaml`:
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
registries:
|
|
132
|
+
- name: affinity
|
|
133
|
+
type: local
|
|
134
|
+
path: affinity-registry.yaml
|
|
135
|
+
packages:
|
|
136
|
+
- name: GhostPawJS/affinity@v<VERSION>
|
|
137
|
+
registry: affinity
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`affinity-registry.yaml`:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
packages:
|
|
144
|
+
- type: github_release
|
|
145
|
+
repo_owner: GhostPawJS
|
|
146
|
+
repo_name: affinity
|
|
147
|
+
asset: ghostpaw-affinity-{{trimV .Version}}-{{.OS}}-{{.Arch}}.tar.gz
|
|
148
|
+
format: tar.gz
|
|
149
|
+
replacements: { amd64: x64 }
|
|
150
|
+
overrides:
|
|
151
|
+
- goos: windows
|
|
152
|
+
asset: ghostpaw-affinity-{{trimV .Version}}-windows-{{.Arch}}.zip
|
|
153
|
+
format: zip
|
|
154
|
+
files:
|
|
155
|
+
- name: ghostpaw-affinity
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Install scripts verify SHA256SUMS. To verify a downloaded archive's
|
|
159
|
+
[build attestation](https://cli.github.com/manual/gh_attestation_verify):
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
gh attestation verify <archive> -R GhostPawJS/affinity
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Set `GHOSTPAW_VERIFY=attestation` for attestation verification in `install.sh`.
|
|
166
|
+
Binaries are unsigned; macOS binaries carry an ad-hoc signature. For a browser
|
|
167
|
+
download on macOS, remove quarantine with
|
|
168
|
+
`xattr -d com.apple.quarantine /path/to/ghostpaw-affinity`.
|
|
169
|
+
Linux binaries require glibc 2.28+; use npx on Alpine.
|
|
170
|
+
See the [binary build workflow](.github/workflows/release-binaries.yml).
|
|
171
|
+
|
|
172
|
+
Sizes for 0.4.0 (Node 26.12.1 inside each binary):
|
|
173
|
+
|
|
174
|
+
| Target | Archive | Binary |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| linux-x64 | 41.7 MB tar.gz | 117.6 MB |
|
|
177
|
+
| linux-arm64 | 41.2 MB tar.gz | 115.3 MB |
|
|
178
|
+
| darwin-arm64 | 44.9 MB tar.gz | 146.8 MB |
|
|
179
|
+
| darwin-x64 | 46.4 MB tar.gz | 149.7 MB |
|
|
180
|
+
| windows-x64 | 38.4 MB zip | 105.7 MB |
|
|
181
|
+
|
|
182
|
+
The npm package is 2003 KB unpacked and needs Node 24+. Every release is
|
|
183
|
+
installed and run on ubuntu-24.04, macos-15 and windows-2025 by the
|
|
184
|
+
[install check](.github/workflows/install-check.yml).
|
|
185
|
+
|
|
186
|
+
The install check runs on ubuntu-24.04, macos-15 and windows-2025.
|
|
187
|
+
|
|
188
|
+
## CLI
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
ghostpaw-affinity search <query>
|
|
192
|
+
ghostpaw-affinity review <view>
|
|
193
|
+
ghostpaw-affinity show <owner_profile|contact_profile|link> [--contact JSON --link JSON]
|
|
194
|
+
ghostpaw-affinity contact create <input-json>
|
|
195
|
+
ghostpaw-affinity contact revise <contact-json> --patch JSON
|
|
196
|
+
ghostpaw-affinity contact lifecycle <contact-json> <lifecycleState>
|
|
197
|
+
ghostpaw-affinity contact merge [flags]
|
|
198
|
+
ghostpaw-affinity identity add|revise|verify|remove [flags]
|
|
199
|
+
ghostpaw-affinity relationship add|bond|state|tie|untie [flags]
|
|
200
|
+
ghostpaw-affinity commitment record|resolve [flags]
|
|
201
|
+
ghostpaw-affinity attribute set|unset|replace [flags]
|
|
202
|
+
ghostpaw-affinity date add|revise|remove [flags]
|
|
203
|
+
ghostpaw-affinity event record [flags]
|
|
204
|
+
ghostpaw-affinity duplicate dismiss|undismiss [flags]
|
|
205
|
+
ghostpaw-affinity mcp|skill|tools|describe|call|completions|version|help
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
There are 27 domain commands. `review` accepts the existing view names,
|
|
209
|
+
including `contacts.list`, `contacts.duplicates` and `dates.upcoming`.
|
|
210
|
+
`show` selects an inspection kind; contact and link locators are JSON objects.
|
|
211
|
+
Use `help contact` or `contact create --help` for schema-derived help.
|
|
212
|
+
Nested payloads use JSON or `@path` to read a file.
|
|
213
|
+
|
|
214
|
+
Global flags: `--db <path>`, `--json`, `--quiet`, `--compact`,
|
|
215
|
+
`--help`/`-h`, `--version`/`-V`/`-v`, `--no-color`.
|
|
216
|
+
`NO_COLOR` is accepted; output uses no terminal colors.
|
|
217
|
+
Noun-verb commands print the full tool result as JSON with `--json` or piped
|
|
218
|
+
stdout. Terminal output shows the summary and payload. `--quiet` suppresses
|
|
219
|
+
stdout. `--compact` removes JSON indentation.
|
|
220
|
+
Array flags repeat; kebab-case flags map to schema properties.
|
|
221
|
+
`--` ends flags. A positional `-`, or piped stdin with no input flags, reads a
|
|
222
|
+
JSON object. Explicit flags override stdin fields.
|
|
223
|
+
Database selection uses `--db`, `GHOSTPAW_AFFINITY_DB`, then
|
|
224
|
+
`~/.ghostpaw/affinity.db`. These commands work offline.
|
|
225
|
+
|
|
226
|
+
| Exit | Noun-verb result |
|
|
227
|
+
|---|---|
|
|
228
|
+
| 0 | Success, including no_op |
|
|
229
|
+
| 1 | Tool error |
|
|
230
|
+
| 2 | Usage or schema error |
|
|
231
|
+
| 3 | Clarification needed or not found |
|
|
232
|
+
| 4 | Conflict or version mismatch |
|
|
233
|
+
| 70 | Internal error |
|
|
234
|
+
|
|
235
|
+
Errors go to stderr. With `--json`, errors also print to stdout.
|
|
236
|
+
Legacy `tools [--json]`, `describe <tool>`, `call <tool> [JSON|-]` and
|
|
237
|
+
`<tool_name> --parameter value` retain their output and exit codes.
|
|
238
|
+
`completions bash|zsh|fish` prints shell scripts.
|
|
239
|
+
|
|
240
|
+
```sh
|
|
241
|
+
ghostpaw-affinity contact create '{"name":"Sam","kind":"human"}' --db /tmp/affinity-example.db --json
|
|
242
|
+
ghostpaw-affinity search Sam --db /tmp/affinity-example.db --json
|
|
243
|
+
ghostpaw-affinity review contacts.list --db /tmp/affinity-example.db --json
|
|
244
|
+
```
|
|
96
245
|
|
|
97
246
|
## Quick Start
|
|
98
247
|
|
|
@@ -135,6 +284,16 @@ const profile = read.getContactProfile(db, ada.id);
|
|
|
135
284
|
const radar = read.listRadar(db);
|
|
136
285
|
```
|
|
137
286
|
|
|
287
|
+
## Docs
|
|
288
|
+
|
|
289
|
+
The live demo runs the library in your browser against an in-memory SQLite database. Each view below opens a different part of it:
|
|
290
|
+
|
|
291
|
+
- [Dashboard](https://affinity.ghostpaw.dev/docs/): overview and session
|
|
292
|
+
- [Contacts](https://affinity.ghostpaw.dev/docs/#/contacts): people, companies, groups and pets you track
|
|
293
|
+
- [Relationships](https://affinity.ghostpaw.dev/docs/#/relationships): links, rank and bonds
|
|
294
|
+
- [Timeline](https://affinity.ghostpaw.dev/docs/#/timeline): events, commitments and date anchors
|
|
295
|
+
- [Insights](https://affinity.ghostpaw.dev/docs/#/insights): radar and analytics
|
|
296
|
+
|
|
138
297
|
## The Model
|
|
139
298
|
|
|
140
299
|
Eight concepts, strict separation of concerns:
|