meow-agent 0.1.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.
@@ -0,0 +1,26 @@
1
+ import tseslint from '@typescript-eslint/eslint-plugin';
2
+ import tsparser from '@typescript-eslint/parser';
3
+
4
+ export default [
5
+ {
6
+ files: ['src/**/*.{ts,tsx}'],
7
+ languageOptions: {
8
+ parser: tsparser,
9
+ parserOptions: {
10
+ ecmaVersion: 2022,
11
+ sourceType: 'module',
12
+ },
13
+ },
14
+ plugins: {
15
+ '@typescript-eslint': tseslint,
16
+ },
17
+ rules: {
18
+ '@typescript-eslint/no-unused-vars': 'warn',
19
+ '@typescript-eslint/no-explicit-any': 'warn',
20
+ 'no-console': 'warn',
21
+ },
22
+ },
23
+ {
24
+ ignores: ['node_modules/', 'dist/', '*.js'],
25
+ },
26
+ ];
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "meow-agent",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Lightweight AI coding agent in your terminal",
6
+ "main": "src/index.ts",
7
+ "bin": {
8
+ "meow": "./src/index.ts"
9
+ },
10
+ "scripts": {
11
+ "start": "tsx src/index.ts",
12
+ "dev": "tsx src/index.ts",
13
+ "tui": "tsx src/index.ts --tui",
14
+ "lint": "eslint src/",
15
+ "typecheck": "tsc --noEmit",
16
+ "check": "npm run typecheck && npm run lint",
17
+ "test": "vitest run",
18
+ "prepare": "husky install",
19
+ "build": "tsup src/index.ts --out-dir dist --format esm --external bun",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "dependencies": {
23
+ "@clack/prompts": "1.2.0",
24
+ "@modelcontextprotocol/sdk": "1.29.0",
25
+ "@types/blessed": "^0.1.27",
26
+ "@types/fluent-ffmpeg": "2.1.28",
27
+ "better-sqlite3": "^12.9.0",
28
+ "blessed": "^0.1.81",
29
+ "blessed-contrib": "^4.11.0",
30
+ "diff-match-patch": "^1.0.5",
31
+ "fluent-ffmpeg": "2.1.3",
32
+ "globby": "16.2.0",
33
+ "js-yaml": "4.1.1",
34
+ "mathjs": "^15.2.0",
35
+ "picocolors": "1.1.1",
36
+ "quantum-circuit": "^0.9.247",
37
+ "sqlite-vec": "^0.1.9"
38
+ },
39
+ "devDependencies": {
40
+ "@types/better-sqlite3": "7.6.13",
41
+ "@types/bun": "latest",
42
+ "@types/diff-match-patch": "^1.0.36",
43
+ "@types/js-yaml": "4.0.9",
44
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
45
+ "@typescript-eslint/parser": "^7.0.0",
46
+ "eslint": "^8.57.0",
47
+ "husky": "^9.0.0",
48
+ "tsup": "^8.5.1",
49
+ "tsx": "^4.21.0",
50
+ "typescript": "^5.0.0",
51
+ "vitest": "^4.1.5"
52
+ }
53
+ }
package/src/index.ts ADDED
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ // MEOW - Lightweight AI Coding Agent
3
+
4
+ import { config } from "./config/env";
5
+ import { Agent } from "./agent/agent";
6
+ import { createRepl } from "./cli/repl";
7
+ import { MeowKernel } from "./kernel/kernel";
8
+ import { DatabasePort } from "./extensions/database/manifest";
9
+
10
+ /**
11
+ * Detects whether we're running under Bun or Node.
12
+ * Bun has a global `Bun` object; Node does not.
13
+ */
14
+ function isBun(): boolean {
15
+ return typeof (globalThis as any).Bun !== "undefined";
16
+ }
17
+
18
+ async function main() {
19
+ let db: DatabasePort;
20
+
21
+ if (isBun()) {
22
+ // Bun: load database as an out-of-process extension via Node
23
+ const { DatabaseExtension } = await import("./extensions/database/extension");
24
+ db = new DatabaseExtension({
25
+ dbPath: "meow.db",
26
+ embeddingDimension: config.embeddingDimension,
27
+ });
28
+ console.log("āœ“ Database: Bun + Node subprocess mode");
29
+ } else {
30
+ // Node/tsx: use MeowDatabase directly
31
+ const { MeowDatabase } = await import("./kernel/database");
32
+ db = new MeowDatabase();
33
+ console.log("āœ“ Database: Node.js direct mode");
34
+ }
35
+
36
+ const kernel = new MeowKernel(db);
37
+ kernel.start();
38
+
39
+ const agent = new Agent({
40
+ model: config.model,
41
+ baseUrl: config.baseUrl,
42
+ apiKey: config.apiKey,
43
+ db,
44
+ kernel
45
+ });
46
+
47
+ // Support for -p (plan/non-interactive) mode — MEOW's primary headless interface
48
+ // Output goes to stdout, no TTY required. This is what Hermes calls.
49
+ const planMode = process.argv.includes("-p") || process.argv.includes("--plan");
50
+ if (planMode) {
51
+ const command = process.argv.filter(arg => !arg.startsWith("--") && arg !== "-p" && arg !== "--plan").slice(2).join(" ");
52
+ if (!command) {
53
+ console.error("Usage: meow -p \"<task description>\"");
54
+ process.exit(1);
55
+ }
56
+ console.log(`šŸ¤– [MEOW] Plan mode: ${command}`);
57
+ const response = await agent.chat(command, false, undefined, (status) => {
58
+ process.stdout.write(`\r${status}`);
59
+ });
60
+ console.log("\n" + response);
61
+ console.log("\nāœ… Command completed.");
62
+ await kernel.shutdown();
63
+ process.exit(0);
64
+ return;
65
+ }
66
+
67
+ // Support for --tui flag
68
+ if (process.argv.includes("--tui")) {
69
+ const { MeowTUI } = await import("./cli/tui");
70
+ const tui = new MeowTUI(agent);
71
+ tui.start();
72
+ return;
73
+ }
74
+
75
+ // Support for non-interactive command mode (legacy, kept for compatibility)
76
+ const command = process.argv.filter(arg => !arg.startsWith("--")).slice(2).join(" ");
77
+ if (command) {
78
+ console.log(`šŸ¤– [MEOW] Executing command: ${command}`);
79
+ const response = await agent.chat(command, false, undefined, (status) => {
80
+ process.stdout.write(`\r${status}`);
81
+ });
82
+ console.log("\n" + response);
83
+ console.log("\nāœ… Command completed.");
84
+ await kernel.shutdown();
85
+ process.exit(0);
86
+ }
87
+
88
+ const repl = createRepl(agent);
89
+ await repl.start();
90
+ }
91
+
92
+ main().catch(console.error);