anairyspirit 0.1.438 → 0.1.441
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/lib/core.js +8 -1
- package/lib/notice.js +115 -0
- package/package.json +1 -1
- package/sums.json +4 -4
package/lib/core.js
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
// * nothing installed yet: `anairyspirit` / `anairyspirit setup` downloads
|
|
9
9
|
// the archive for this machine from the GitHub release, checks its sha256,
|
|
10
10
|
// unpacks it and runs `./anairyspirit setup` from it — the same install as
|
|
11
|
-
// from the archive by hand;
|
|
11
|
+
// from the archive by hand; `anairyspirit mcp` answers MCP with one tool
|
|
12
|
+
// that tells the agent the user has to run `npx anairyspirit setup`
|
|
13
|
+
// (lib/notice.js) — an MCP client sees a server that explains, not one
|
|
14
|
+
// that does not start;
|
|
12
15
|
// * installed (any way — disk image, Homebrew, .deb/.rpm, archive): every
|
|
13
16
|
// command goes to the installed program, so `npx -y anairyspirit mcp`
|
|
14
17
|
// works in an MCP client's configuration;
|
|
@@ -31,6 +34,7 @@ const crypto = require('crypto');
|
|
|
31
34
|
const http = require('http');
|
|
32
35
|
const https = require('https');
|
|
33
36
|
const { spawn, spawnSync } = require('child_process');
|
|
37
|
+
const notice = require('./notice.js');
|
|
34
38
|
|
|
35
39
|
const RELEASES = 'https://github.com/Seventhwalllab/anairyspirit/releases/download';
|
|
36
40
|
const TAG = 'anairyspirit (npm)';
|
|
@@ -214,6 +218,9 @@ async function main(args, opts) {
|
|
|
214
218
|
}
|
|
215
219
|
log(`${TAG}: anairyspirit is not installed on this machine yet.`);
|
|
216
220
|
log('Install it first: npx anairyspirit setup');
|
|
221
|
+
if (args[0] === 'mcp') {
|
|
222
|
+
return notice.serve(o.stdin || process.stdin, o.stdout || process.stdout, o.sums.version);
|
|
223
|
+
}
|
|
217
224
|
return 1;
|
|
218
225
|
}
|
|
219
226
|
|
package/lib/notice.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// `npx -y anairyspirit mcp` before anairyspirit is installed. An MCP client — or
|
|
3
|
+
// a registry's checker — starts the server and waits for `initialize`; a line
|
|
4
|
+
// on stderr and exit 1 reads to it as «does not start», and the agent never
|
|
5
|
+
// learns why. So the launcher answers MCP itself, over stdio (one JSON-RPC 2.0
|
|
6
|
+
// message per line), with one tool, `setup_required`, whose result says what
|
|
7
|
+
// the user has to run.
|
|
8
|
+
//
|
|
9
|
+
// It installs nothing. `setup` asks the user to accept the licence and downloads
|
|
10
|
+
// about 1.5 GB of models: the user's to do, not the agent's.
|
|
11
|
+
|
|
12
|
+
const TOOL = 'setup_required';
|
|
13
|
+
// Newest first: an `initialize` asking for one of these gets it back; any other
|
|
14
|
+
// gets the newest.
|
|
15
|
+
const PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05'];
|
|
16
|
+
|
|
17
|
+
const INSTRUCTIONS = 'anairyspirit — an AI agent\'s own long-term memory, on this machine — is not '
|
|
18
|
+
+ 'installed here yet, so there is no memory to read or write. Tell the user; the one tool, '
|
|
19
|
+
+ `${TOOL}, gives the command they have to run.`;
|
|
20
|
+
|
|
21
|
+
const TOOL_DEF = {
|
|
22
|
+
name: TOOL,
|
|
23
|
+
title: 'anairyspirit: setup required',
|
|
24
|
+
description: 'anairyspirit (the memory) is not installed on this machine yet. Call this to get '
|
|
25
|
+
+ 'the command the user has to run to install it.',
|
|
26
|
+
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
27
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function setupText(version) {
|
|
31
|
+
return [
|
|
32
|
+
'anairyspirit is not installed on this machine yet, so there is no memory to read or write.',
|
|
33
|
+
'',
|
|
34
|
+
'Ask the user to run, in a terminal on this machine:',
|
|
35
|
+
'',
|
|
36
|
+
' npx anairyspirit setup',
|
|
37
|
+
'',
|
|
38
|
+
`It downloads release v${version} for this machine, checks it against the release's signed `
|
|
39
|
+
+ 'checksums, asks the user to accept the licence, downloads the models (about 1.5 GB) and '
|
|
40
|
+
+ 'starts the memory service. Then restart this MCP client: the same configuration '
|
|
41
|
+
+ '(npx -y anairyspirit mcp) reaches the memory.',
|
|
42
|
+
'',
|
|
43
|
+
'Only the user can do this: the install asks them to accept the licence.',
|
|
44
|
+
].join('\n');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function reply(id, result) {
|
|
48
|
+
return { jsonrpc: '2.0', id, result };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function failure(id, code, message) {
|
|
52
|
+
return { jsonrpc: '2.0', id, error: { code, message } };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** One JSON-RPC message in, its response out — null for a notification. */
|
|
56
|
+
function respond(msg, version) {
|
|
57
|
+
if (!msg || typeof msg !== 'object' || Array.isArray(msg)) {
|
|
58
|
+
return failure(null, -32600, 'Invalid Request');
|
|
59
|
+
}
|
|
60
|
+
const { id, method, params } = msg;
|
|
61
|
+
if (id === undefined || id === null) return null;
|
|
62
|
+
switch (method) {
|
|
63
|
+
case 'initialize': {
|
|
64
|
+
const asked = params && params.protocolVersion;
|
|
65
|
+
return reply(id, {
|
|
66
|
+
protocolVersion: PROTOCOL_VERSIONS.includes(asked) ? asked : PROTOCOL_VERSIONS[0],
|
|
67
|
+
capabilities: { tools: {} },
|
|
68
|
+
serverInfo: { name: 'anairyspirit', version },
|
|
69
|
+
instructions: INSTRUCTIONS,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
case 'ping':
|
|
73
|
+
return reply(id, {});
|
|
74
|
+
case 'tools/list':
|
|
75
|
+
return reply(id, { tools: [TOOL_DEF] });
|
|
76
|
+
case 'tools/call': {
|
|
77
|
+
const name = params && params.name;
|
|
78
|
+
if (name !== TOOL) return failure(id, -32602, `Unknown tool: ${name}`);
|
|
79
|
+
return reply(id, { content: [{ type: 'text', text: setupText(version) }], isError: false });
|
|
80
|
+
}
|
|
81
|
+
default:
|
|
82
|
+
return failure(id, -32601, `Method not found: ${method}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Answer MCP on `input`/`output` until `input` closes; resolves to 0. */
|
|
87
|
+
function serve(input, output, version) {
|
|
88
|
+
return new Promise((resolve) => {
|
|
89
|
+
let buf = '';
|
|
90
|
+
const send = (m) => output.write(`${JSON.stringify(m)}\n`);
|
|
91
|
+
input.setEncoding('utf8');
|
|
92
|
+
input.on('data', (chunk) => {
|
|
93
|
+
buf += chunk;
|
|
94
|
+
let nl;
|
|
95
|
+
while ((nl = buf.indexOf('\n')) >= 0) {
|
|
96
|
+
const line = buf.slice(0, nl).trim();
|
|
97
|
+
buf = buf.slice(nl + 1);
|
|
98
|
+
if (!line) continue;
|
|
99
|
+
let msg;
|
|
100
|
+
try {
|
|
101
|
+
msg = JSON.parse(line);
|
|
102
|
+
} catch {
|
|
103
|
+
send(failure(null, -32700, 'Parse error'));
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const out = respond(msg, version);
|
|
107
|
+
if (out) send(out);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
input.on('end', () => resolve(0));
|
|
111
|
+
input.on('error', () => resolve(0));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = { TOOL, PROTOCOL_VERSIONS, respond, serve, setupText };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anairyspirit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.441",
|
|
4
4
|
"mcpName": "io.github.Seventhwalllab/anairyspirit",
|
|
5
5
|
"description": "Personal AI memory graph that runs locally: long-term memory for your AI agents over MCP and REST",
|
|
6
6
|
"homepage": "https://github.com/Seventhwalllab/anairyspirit",
|
package/sums.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.441",
|
|
3
3
|
"files": {
|
|
4
|
-
"anairyspirit-0.1.
|
|
5
|
-
"anairyspirit-0.1.
|
|
6
|
-
"anairyspirit-0.1.
|
|
4
|
+
"anairyspirit-0.1.441-macos-universal.tar.gz": "faeed30c6bf4e2a57b7f0519b64acd059937ebcb45ac87f2e0ebb9ed30c54bfe",
|
|
5
|
+
"anairyspirit-0.1.441-arm64.tar.gz": "c5a4109c626ccf2c3f3a22c9eb6487dd1df31499fef1d22ead2faa3933b6fd4a",
|
|
6
|
+
"anairyspirit-0.1.441-x86_64.tar.gz": "7644b41d4ad02d45726c19515e6721652ca48196e266242640405d6167c0c7be"
|
|
7
7
|
}
|
|
8
8
|
}
|