openfin-ai 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.
Files changed (2) hide show
  1. package/bin/openfin +59 -0
  2. package/package.json +58 -0
package/bin/openfin ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ const childProcess = require("child_process")
4
+ const fs = require("fs")
5
+ const path = require("path")
6
+ const os = require("os")
7
+
8
+ function run(target) {
9
+ const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
+ stdio: "inherit",
11
+ })
12
+ if (result.error) {
13
+ console.error(result.error.message)
14
+ process.exit(1)
15
+ }
16
+ process.exit(typeof result.status === "number" ? result.status : 0)
17
+ }
18
+
19
+ // Allow overriding the binary path (useful for development)
20
+ const envPath = process.env.OPENFIN_BIN_PATH
21
+ if (envPath) run(envPath)
22
+
23
+ const scriptPath = fs.realpathSync(__filename)
24
+ const scriptDir = path.dirname(scriptPath)
25
+
26
+ // Check for a cached binary next to this script (set by install script)
27
+ const cached = path.join(scriptDir, ".openfin")
28
+ if (fs.existsSync(cached)) run(cached)
29
+
30
+ const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" }
31
+ const archMap = { x64: "x64", arm64: "arm64" }
32
+
33
+ const platform = platformMap[os.platform()] || os.platform()
34
+ const arch = archMap[os.arch()] || os.arch()
35
+ const binary = platform === "windows" ? "openfin.exe" : "openfin"
36
+ const pkgName = `openfin-${platform}-${arch}`
37
+
38
+ function findBinary(startDir) {
39
+ let current = startDir
40
+ for (;;) {
41
+ const candidate = path.join(current, "node_modules", pkgName, "bin", binary)
42
+ if (fs.existsSync(candidate)) return candidate
43
+ const parent = path.dirname(current)
44
+ if (parent === current) return undefined
45
+ current = parent
46
+ }
47
+ }
48
+
49
+ const resolved = findBinary(scriptDir)
50
+ if (!resolved) {
51
+ console.error(
52
+ `openfin: could not find a native binary for ${platform}-${arch}.\n` +
53
+ `Try reinstalling: npm install -g openfin-ai\n` +
54
+ `Or download a binary from: https://github.com/eigencore/openfin/releases`,
55
+ )
56
+ process.exit(1)
57
+ }
58
+
59
+ run(resolved)
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "openfin-ai",
4
+ "version": "0.1.0",
5
+ "description": "AI-powered personal financial assistant",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/eigencore/openfin"
11
+ },
12
+ "homepage": "https://github.com/eigencore/openfin",
13
+ "bin": {
14
+ "openfin": "./bin/openfin"
15
+ },
16
+ "files": [
17
+ "bin"
18
+ ],
19
+ "scripts": {
20
+ "dev": "bun run src/index.ts",
21
+ "chat": "bun run src/cli/index.ts",
22
+ "tui": "bun run src/tui/index.ts",
23
+ "telegram": "bun run src/telegram/index.ts",
24
+ "build": "bun run script/build.ts",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "optionalDependencies": {
28
+ "openfin-darwin-arm64": "0.1.0",
29
+ "openfin-darwin-x64": "0.1.0",
30
+ "openfin-linux-arm64": "0.1.0",
31
+ "openfin-linux-x64": "0.1.0",
32
+ "openfin-windows-x64": "0.1.0"
33
+ },
34
+ "dependencies": {
35
+ "@ai-sdk/anthropic": "catalog:",
36
+ "@ai-sdk/google": "catalog:",
37
+ "@ai-sdk/groq": "catalog:",
38
+ "@ai-sdk/mistral": "catalog:",
39
+ "@ai-sdk/openai": "catalog:",
40
+ "@ai-sdk/xai": "catalog:",
41
+ "@clack/prompts": "catalog:",
42
+ "@openrouter/ai-sdk-provider": "catalog:",
43
+ "@opentui/core": "catalog:",
44
+ "@opentui/solid": "catalog:",
45
+ "ai": "catalog:",
46
+ "drizzle-orm": "catalog:",
47
+ "grammy": "^1.41.1",
48
+ "hono": "catalog:",
49
+ "solid-js": "catalog:",
50
+ "zod": "catalog:"
51
+ },
52
+ "devDependencies": {
53
+ "@tsconfig/bun": "catalog:",
54
+ "@types/bun": "catalog:",
55
+ "drizzle-kit": "catalog:",
56
+ "typescript": "catalog:"
57
+ }
58
+ }