heady-sdk 3.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.
- package/README.md +40 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @heady/sdk
|
|
2
|
+
|
|
3
|
+
> TypeScript client SDK for the Heady™ AI Platform — MCP tool calls, vector memory, and health checks.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @heady/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { HeadyClient } from '@heady/sdk';
|
|
15
|
+
|
|
16
|
+
const client = new HeadyClient('your-api-key');
|
|
17
|
+
|
|
18
|
+
// Store a memory
|
|
19
|
+
await client.storeMemory('user-1', 0.5, 1.2, -0.3, [0.1, 0.2, 0.3], { topic: 'ai' });
|
|
20
|
+
|
|
21
|
+
// Query memories
|
|
22
|
+
const results = await client.queryMemory('user-1', [0.1, 0.2, 0.3], 10);
|
|
23
|
+
|
|
24
|
+
// Health check
|
|
25
|
+
const health = await client.healthCheck();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
| Method | Description |
|
|
31
|
+
|--------|-------------|
|
|
32
|
+
| `callTool(name, args)` | Call any MCP tool by name |
|
|
33
|
+
| `storeMemory(...)` | Store a 3D vector memory |
|
|
34
|
+
| `queryMemory(...)` | Query by embedding similarity |
|
|
35
|
+
| `getMemoryStats(userId)` | Get user memory statistics |
|
|
36
|
+
| `healthCheck()` | Server health probe |
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Proprietary — © 2026 HeadySystems Inc.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class HeadyClient {
|
|
2
|
+
private apiKey;
|
|
3
|
+
private baseUrl;
|
|
4
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
5
|
+
callTool(name: string, args: any): Promise<any>;
|
|
6
|
+
storeMemory(userId: string, x: number, y: number, z: number, embedding: number[], metadata: any): Promise<any>;
|
|
7
|
+
queryMemory(userId: string, embedding: number[], limit?: number): Promise<any>;
|
|
8
|
+
getMemoryStats(userId: string): Promise<any>;
|
|
9
|
+
healthCheck(): Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;IAAU,OAAO,CAAC,OAAO;gBAA/B,MAAM,EAAE,MAAM,EAAU,OAAO,SAA6B;IAE1E,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAwB/C,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG;IAI/F,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,KAAK,SAAK;IAI3D,cAAc,CAAC,MAAM,EAAE,MAAM;IAI7B,WAAW;CAGlB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HeadyClient = void 0;
|
|
4
|
+
const core_1 = require("@heady/core");
|
|
5
|
+
class HeadyClient {
|
|
6
|
+
apiKey;
|
|
7
|
+
baseUrl;
|
|
8
|
+
constructor(apiKey, baseUrl = 'https://mcp.headymcp.com') {
|
|
9
|
+
this.apiKey = apiKey;
|
|
10
|
+
this.baseUrl = baseUrl;
|
|
11
|
+
}
|
|
12
|
+
async callTool(name, args) {
|
|
13
|
+
const response = await fetch(this.baseUrl, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
'Authorization': `Bearer ${this.apiKey}`
|
|
18
|
+
},
|
|
19
|
+
body: JSON.stringify({
|
|
20
|
+
jsonrpc: '2.0',
|
|
21
|
+
id: Date.now(),
|
|
22
|
+
method: 'tools/call',
|
|
23
|
+
params: { name, arguments: args }
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
const data = await response.json();
|
|
27
|
+
if (data.error) {
|
|
28
|
+
throw new core_1.HeadyError(data.error.message, 'MCP_ERROR');
|
|
29
|
+
}
|
|
30
|
+
return data.result;
|
|
31
|
+
}
|
|
32
|
+
async storeMemory(userId, x, y, z, embedding, metadata) {
|
|
33
|
+
return this.callTool('memory.store', { userId, x, y, z, embedding, metadata });
|
|
34
|
+
}
|
|
35
|
+
async queryMemory(userId, embedding, limit = 10) {
|
|
36
|
+
return this.callTool('memory.query', { userId, embedding, limit });
|
|
37
|
+
}
|
|
38
|
+
async getMemoryStats(userId) {
|
|
39
|
+
return this.callTool('memory.stats', { userId });
|
|
40
|
+
}
|
|
41
|
+
async healthCheck() {
|
|
42
|
+
return this.callTool('server.health', {});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.HeadyClient = HeadyClient;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAEzC,MAAa,WAAW;IACF;IAAwB;IAA5C,YAAoB,MAAc,EAAU,UAAU,0BAA0B;QAA5D,WAAM,GA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CAAC,MAAc;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AA1CD,kCA0CC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "heady-sdk",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"description": "TypeScript client SDK for the Heady AI Platform — MCP tool calls, vector memory operations, and health checks.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"clean": "rm -rf dist",
|
|
20
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"heady-core": "^3.2.0"
|
|
24
|
+
},
|
|
25
|
+
"license": "UNLICENSED",
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "HeadySystems Inc.",
|
|
28
|
+
"email": "eric@headyconnection.org",
|
|
29
|
+
"url": "https://headyme.com"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/HeadyMe/heady-production.git",
|
|
34
|
+
"directory": "packages/sdk"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://headysystems.com",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/HeadyMe/heady-production/issues"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"heady",
|
|
42
|
+
"ai",
|
|
43
|
+
"sdk",
|
|
44
|
+
"mcp",
|
|
45
|
+
"client",
|
|
46
|
+
"multi-agent"
|
|
47
|
+
],
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|