@nexical/ai 0.1.0 → 0.1.1

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,4 @@
1
+ import { AiClient, AiClientConfig } from './types.js';
2
+ export declare class AiClientFactory {
3
+ static create(config?: AiClientConfig): AiClient;
4
+ }
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './providers/GeminiCLI.js';
3
+ export * from './AiClientFactory.js';
@@ -0,0 +1,6 @@
1
+ import { AiClient, AiClientConfig, AiClientResult } from '../types.js';
2
+ export declare class GeminiCLI implements AiClient {
3
+ private commandTemplate;
4
+ constructor(config: AiClientConfig);
5
+ run(model: string, input: string): Promise<AiClientResult>;
6
+ }
@@ -0,0 +1,13 @@
1
+ export interface AiClientResult {
2
+ code: number;
3
+ shouldRetry: boolean;
4
+ output: string;
5
+ }
6
+ export interface AiClientConfig {
7
+ provider?: string;
8
+ commandTemplate?: string;
9
+ [key: string]: unknown;
10
+ }
11
+ export interface AiClient {
12
+ run(model: string, input: string): Promise<AiClientResult>;
13
+ }
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
1
  {
2
- "name": "@nexical/ai",
3
- "version": "0.1.0",
4
- "description": "General purpose AI Client interfaces and providers for the Nexical applications",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "scripts": {
8
- "build": "tsc -p tsconfig.build.json",
9
- "format": "prettier --write .",
10
- "lint": "eslint .",
11
- "lint:fix": "eslint . --fix",
12
- "prepare": "husky",
13
- "prepublishOnly": "npm run build",
14
- "test": "vitest run --passWithNoTests",
15
- "test:unit": "vitest run --passWithNoTests"
16
- },
17
- "lint-staged": {
18
- "**/*": [
19
- "prettier --write --ignore-unknown"
20
- ],
21
- "**/*.{js,jsx,ts,tsx,astro}": [
22
- "eslint --fix"
23
- ]
24
- },
25
- "dependencies": {
26
- "chalk": "^5.3.0"
27
- },
28
- "devDependencies": {
29
- "@eslint/js": "^9.39.2",
30
- "@types/node": "^22.0.0",
31
- "eslint": "^9.39.2",
32
- "eslint-config-prettier": "^10.0.1",
33
- "globals": "^15.9.0",
34
- "husky": "^9.1.5",
35
- "lint-staged": "^15.2.10",
36
- "prettier": "^3.3.3",
37
- "typescript": "^5.5.4",
38
- "typescript-eslint": "^8.3.0",
39
- "vitest": "^2.1.0"
40
- },
41
- "types": "dist/index.d.ts"
42
- }
2
+ "name": "@nexical/ai",
3
+ "version": "0.1.1",
4
+ "description": "General purpose AI Client interfaces and providers for the Nexical applications",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
9
+ "format": "prettier --write .",
10
+ "lint": "eslint .",
11
+ "lint:fix": "eslint . --fix",
12
+ "prepare": "husky",
13
+ "prepublishOnly": "npm run build",
14
+ "test": "vitest run --passWithNoTests",
15
+ "test:unit": "vitest run --passWithNoTests"
16
+ },
17
+ "lint-staged": {
18
+ "**/*": [
19
+ "prettier --write --ignore-unknown"
20
+ ],
21
+ "**/*.{js,jsx,ts,tsx,astro}": [
22
+ "eslint --fix"
23
+ ]
24
+ },
25
+ "dependencies": {
26
+ "chalk": "^5.3.0"
27
+ },
28
+ "devDependencies": {
29
+ "@eslint/js": "^9.39.2",
30
+ "@types/node": "^22.0.0",
31
+ "eslint": "^9.39.2",
32
+ "eslint-config-prettier": "^10.0.1",
33
+ "globals": "^15.9.0",
34
+ "husky": "^9.1.5",
35
+ "lint-staged": "^15.2.10",
36
+ "prettier": "^3.3.3",
37
+ "typescript": "^5.5.4",
38
+ "typescript-eslint": "^8.3.0",
39
+ "vitest": "^2.1.0"
40
+ },
41
+ "types": "dist/index.d.ts"
42
+ }
package/tsconfig.json CHANGED
@@ -1,20 +1,17 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Bundler",
6
- "lib": [
7
- "ESNext"
8
- ],
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "resolveJsonModule": true,
14
- "outDir": "dist",
15
- "rootDir": "src"
16
- },
17
- "include": [
18
- "src/**/*"
19
- ]
20
- }
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ESNext"],
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "declaration": true,
13
+ "outDir": "dist",
14
+ "rootDir": "src"
15
+ },
16
+ "include": ["src/**/*"]
17
+ }