@hasna/brains 0.0.27 → 0.0.29
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/LICENSE +2 -1
- package/README.md +19 -8
- package/dist/cli/commands/cloud.d.ts.map +1 -1
- package/dist/cli/index.js +12086 -5487
- package/dist/db/index.d.ts +2 -36
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/pg-migrate.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13785 -9459
- package/dist/mcp/http.d.ts +18 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +14568 -9681
- package/dist/server/index.js +9629 -154
- package/package.json +4 -4
- package/dist/db/cloud-sync.d.ts +0 -33
- package/dist/db/cloud-sync.d.ts.map +0 -1
- package/dist/db/remote-storage.d.ts +0 -12
- package/dist/db/remote-storage.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/brains",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "Fine-tuned model tracker and trainer — wraps OpenAI + Thinker Labs, gathers training data from todos/mementos/conversations/sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"start": "bun run dist/cli/index.js",
|
|
32
32
|
"clean": "rm -rf dist",
|
|
33
33
|
"typecheck": "tsc --noEmit",
|
|
34
|
-
"test": "bun test
|
|
34
|
+
"test": "bun test",
|
|
35
35
|
"db:generate": "bunx drizzle-kit generate",
|
|
36
36
|
"db:migrate": "bunx drizzle-kit migrate",
|
|
37
37
|
"db:studio": "bunx drizzle-kit studio",
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
"author": "Andrei Hasna <andrei@hasna.com>",
|
|
65
65
|
"license": "Apache-2.0",
|
|
66
66
|
"dependencies": {
|
|
67
|
+
"@hasna/cloud": "0.1.24",
|
|
68
|
+
"@hasna/events": "^0.1.6",
|
|
67
69
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
68
70
|
"chalk": "^5.4.1",
|
|
69
71
|
"commander": "^13.1.0",
|
|
70
72
|
"drizzle-orm": "^0.40.0",
|
|
71
73
|
"ink": "^5.2.0",
|
|
72
74
|
"openai": "^4.0.0",
|
|
73
|
-
"pg": "^8.13.3",
|
|
74
75
|
"react": "^18.3.1",
|
|
75
76
|
"zod": "^3.24.2"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"@types/bun": "^1.2.4",
|
|
79
|
-
"@types/pg": "^8.11.11",
|
|
80
80
|
"@types/react": "^18.3.18",
|
|
81
81
|
"drizzle-kit": "^0.30.0",
|
|
82
82
|
"typescript": "^5.7.3"
|
package/dist/db/cloud-sync.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PgAdapterAsync } from "./remote-storage.js";
|
|
2
|
-
export declare const CLOUD_TABLES: readonly ["fine_tuned_models", "training_jobs", "training_datasets", "feedback"];
|
|
3
|
-
type CloudTable = (typeof CLOUD_TABLES)[number];
|
|
4
|
-
export interface SyncResult {
|
|
5
|
-
table: string;
|
|
6
|
-
rowsRead: number;
|
|
7
|
-
rowsWritten: number;
|
|
8
|
-
errors: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface SyncMeta {
|
|
11
|
-
table_name: string;
|
|
12
|
-
last_synced_at: string | null;
|
|
13
|
-
direction: "push" | "pull";
|
|
14
|
-
}
|
|
15
|
-
export declare function getCloudDatabaseUrl(): string | null;
|
|
16
|
-
export declare function getCloudPg(): Promise<PgAdapterAsync>;
|
|
17
|
-
export declare function runCloudMigrations(remote: PgAdapterAsync): Promise<void>;
|
|
18
|
-
export declare function cloudPush(options?: {
|
|
19
|
-
tables?: string[];
|
|
20
|
-
}): Promise<SyncResult[]>;
|
|
21
|
-
export declare function cloudPull(options?: {
|
|
22
|
-
tables?: string[];
|
|
23
|
-
}): Promise<SyncResult[]>;
|
|
24
|
-
export declare function cloudSync(options?: {
|
|
25
|
-
tables?: string[];
|
|
26
|
-
}): Promise<{
|
|
27
|
-
pull: SyncResult[];
|
|
28
|
-
push: SyncResult[];
|
|
29
|
-
}>;
|
|
30
|
-
export declare function getSyncMetaAll(): SyncMeta[];
|
|
31
|
-
export declare function resolveTables(tables?: string[]): CloudTable[];
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=cloud-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-sync.d.ts","sourceRoot":"","sources":["../../src/db/cloud-sync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,eAAO,MAAM,YAAY,kFAKf,CAAC;AAEX,KAAK,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAUhD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAKnD;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAM1D;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9E;AAED,wBAAsB,SAAS,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAgBtF;AAED,wBAAsB,SAAS,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAgBtF;AAED,wBAAsB,SAAS,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC,CAIpH;AAED,wBAAgB,cAAc,IAAI,QAAQ,EAAE,CAW3C;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAO7D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class PgAdapterAsync {
|
|
2
|
-
private readonly pool;
|
|
3
|
-
constructor(connectionString: string);
|
|
4
|
-
run(sql: string, ...params: unknown[]): Promise<{
|
|
5
|
-
changes: number;
|
|
6
|
-
}>;
|
|
7
|
-
get(sql: string, ...params: unknown[]): Promise<unknown>;
|
|
8
|
-
all(sql: string, ...params: unknown[]): Promise<unknown[]>;
|
|
9
|
-
exec(sql: string): Promise<void>;
|
|
10
|
-
close(): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=remote-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-storage.d.ts","sourceRoot":"","sources":["../../src/db/remote-storage.ts"],"names":[],"mappings":"AAmBA,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;gBAEhB,gBAAgB,EAAE,MAAM;IAI9B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKpE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK1D,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|