terminal-jarvis 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.
- package/.eslintrc.json +22 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -0
- package/lib/index.js.map +1 -0
- package/package.json +28 -0
- package/src/index.ts +41 -0
- package/tsconfig.json +18 -0
package/.eslintrc.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"root": true,
|
3
|
+
"parser": "@typescript-eslint/parser",
|
4
|
+
"parserOptions": {
|
5
|
+
"ecmaVersion": 2020,
|
6
|
+
"sourceType": "module"
|
7
|
+
},
|
8
|
+
"plugins": ["@typescript-eslint"],
|
9
|
+
"extends": [
|
10
|
+
"eslint:recommended",
|
11
|
+
"@typescript-eslint/recommended"
|
12
|
+
],
|
13
|
+
"rules": {
|
14
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
15
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
16
|
+
"@typescript-eslint/no-explicit-any": "warn"
|
17
|
+
},
|
18
|
+
"env": {
|
19
|
+
"node": true,
|
20
|
+
"es6": true
|
21
|
+
}
|
22
|
+
}
|
package/lib/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/lib/index.js
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
console.log("Terminal Jarvis v0.1.0");
|
5
|
+
console.log("This is a test version - full binary support coming soon!");
|
6
|
+
console.log("");
|
7
|
+
console.log("Available commands:");
|
8
|
+
console.log(" list - List available AI coding tools");
|
9
|
+
console.log(" run - Run a specific tool");
|
10
|
+
console.log(" update - Update packages");
|
11
|
+
console.log(" templates - Manage templates");
|
12
|
+
console.log("");
|
13
|
+
console.log("Note: Please install the Rust binary version for full functionality:");
|
14
|
+
console.log(" cargo install terminal-jarvis");
|
15
|
+
process.exit(0);
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,iDAA0C;AAE1C;;;;;;;GAOG;AACH,SAAS,UAAU;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,GAAG,OAAO,CAAC,QAAkB,CAAC;IACpC,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAClD,EAAE,GAAG,SAAS,CAAC;QACf,SAAS,GAAG,MAAM,CAAC;KACpB;IAED,IAAI;QACF,+FAA+F;QAC/F,OAAO,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,IAAI,uBAAuB,SAAS,EAAE,CAAC,CAAC;KACzF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CACb,gEAAgE,EAAE,IAAI,IAAI,EAAE,CAC7E,CAAC;KACH;AACH,CAAC;AAED;;GAEG;AACH,SAAS,GAAG;IACV,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,aAAa,GAAG,IAAA,yBAAS,EAAC,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1E,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,GAAG,EAAE,CAAC"}
|
package/package.json
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"name": "terminal-jarvis",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "A thin Rust wrapper that provides a unified interface for managing and running AI coding tools",
|
5
|
+
"bin": "lib/index.js",
|
6
|
+
"scripts": {
|
7
|
+
"typecheck": "tsc --noEmit",
|
8
|
+
"lint": "eslint .",
|
9
|
+
"lint:fix": "eslint . --fix",
|
10
|
+
"build": "tsc",
|
11
|
+
"dev": "yarn build && node lib/index.js"
|
12
|
+
},
|
13
|
+
"keywords": ["cli", "ai", "tools", "wrapper", "claude", "gemini", "qwen", "opencode"],
|
14
|
+
"author": "BA-CalderonMorales",
|
15
|
+
"license": "MIT",
|
16
|
+
"repository": {
|
17
|
+
"type": "git",
|
18
|
+
"url": "git+https://github.com/BA-CalderonMorales/terminal-jarvis.git"
|
19
|
+
},
|
20
|
+
"homepage": "https://github.com/BA-CalderonMorales/terminal-jarvis#readme",
|
21
|
+
"devDependencies": {
|
22
|
+
"@types/node": "^18.11.18",
|
23
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
24
|
+
"@typescript-eslint/parser": "^5.48.0",
|
25
|
+
"eslint": "^8.31.0",
|
26
|
+
"typescript": "^4.9.4"
|
27
|
+
}
|
28
|
+
}
|
package/src/index.ts
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
import { spawnSync } from "child_process";
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Returns the executable path which is located inside `node_modules`
|
7
|
+
* The naming convention is terminal-jarvis-${os}-${arch}
|
8
|
+
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension.
|
9
|
+
* @see https://nodejs.org/api/os.html#osarch
|
10
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
11
|
+
* @example "x/xx/node_modules/terminal-jarvis-darwin-arm64"
|
12
|
+
*/
|
13
|
+
function getExePath() {
|
14
|
+
const arch = process.arch;
|
15
|
+
let os = process.platform as string;
|
16
|
+
let extension = "";
|
17
|
+
if (["win32", "cygwin"].includes(process.platform)) {
|
18
|
+
os = "windows";
|
19
|
+
extension = ".exe";
|
20
|
+
}
|
21
|
+
|
22
|
+
try {
|
23
|
+
// Since the binary will be located inside `node_modules`, we can simply call `require.resolve`
|
24
|
+
return require.resolve(`terminal-jarvis-${os}-${arch}/bin/terminal-jarvis${extension}`);
|
25
|
+
} catch (e) {
|
26
|
+
throw new Error(
|
27
|
+
`Couldn't find terminal-jarvis binary inside node_modules for ${os}-${arch}`
|
28
|
+
);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Runs terminal-jarvis with args using nodejs spawn
|
34
|
+
*/
|
35
|
+
function run() {
|
36
|
+
const args = process.argv.slice(2);
|
37
|
+
const processResult = spawnSync(getExePath(), args, { stdio: "inherit" });
|
38
|
+
process.exit(processResult.status ?? 0);
|
39
|
+
}
|
40
|
+
|
41
|
+
run();
|
package/tsconfig.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"module": "commonjs",
|
5
|
+
"lib": ["ES2020"],
|
6
|
+
"outDir": "./lib",
|
7
|
+
"rootDir": "./src",
|
8
|
+
"strict": true,
|
9
|
+
"esModuleInterop": true,
|
10
|
+
"skipLibCheck": true,
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
12
|
+
"declaration": true,
|
13
|
+
"declarationMap": true,
|
14
|
+
"sourceMap": true
|
15
|
+
},
|
16
|
+
"include": ["src/**/*"],
|
17
|
+
"exclude": ["node_modules", "lib"]
|
18
|
+
}
|