@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 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
- [![npm](https://img.shields.io/npm/v/@ghostpaw/affinity)](https://www.npmjs.com/package/@ghostpaw/affinity)
4
- [![node](https://img.shields.io/node/v/@ghostpaw/affinity)](https://nodejs.org)
5
- [![license](https://img.shields.io/npm/l/@ghostpaw/affinity)](LICENSE)
6
- [![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
8
- [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.GhostPawJS%2Faffinity-06d6a0)](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.GhostPawJS%2Faffinity/versions/latest)
5
+ [![npm](https://img.shields.io/npm/v/@ghostpaw/affinity?style=flat-square&labelColor=0a1119&color=62e6f2&label=npm)](https://www.npmjs.com/package/@ghostpaw/affinity) [![CI](https://img.shields.io/github/actions/workflow/status/GhostPawJS/affinity/ci.yml?branch=main&style=flat-square&labelColor=0a1119&label=CI)](https://github.com/GhostPawJS/affinity/actions/workflows/ci.yml) [![site](https://img.shields.io/badge/site-affinity.ghostpaw.dev-62e6f2?style=flat-square&labelColor=0a1119)](https://affinity.ghostpaw.dev/) [![runtime deps](https://img.shields.io/badge/runtime_deps-0-7af0b4?style=flat-square&labelColor=0a1119)](package.json) [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.GhostPawJS%2Faffinity-b39dff?style=flat-square&labelColor=0a1119)](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.GhostPawJS%2Faffinity/versions/latest) [![node](https://img.shields.io/badge/node-%E2%89%A524-93a5b9?style=flat-square&labelColor=0a1119)](https://nodejs.org) [![license](https://img.shields.io/npm/l/@ghostpaw/affinity?style=flat-square&labelColor=0a1119&color=93a5b9)](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
- ```bash
92
- npm install @ghostpaw/affinity
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
- Requires **Node.js 24+** (uses the built-in `node:sqlite` module).
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
+ ![ghostpaw-affinity 0.4.0: version, contact create, identity add, event and commitment record, search, review commitments.open and show contact_profile](https://raw.githubusercontent.com/GhostPawJS/affinity/main/docs/assets/cli.png)
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: