@unieai/code 0.0.1 → 0.0.3
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 +16 -17
- package/README.md +40 -0
- package/bin/unieai +18 -177
- package/dist/cli.js +618578 -0
- package/package.json +38 -18
- package/postinstall.mjs +0 -102
package/package.json
CHANGED
|
@@ -1,25 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unieai/code",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "UnieAI Code — a Claude Code-compatible terminal coding agent with UnieAI Studio sign-in.",
|
|
5
|
+
"type": "module",
|
|
3
6
|
"bin": {
|
|
4
|
-
"unieai": "
|
|
7
|
+
"unieai": "bin/unieai",
|
|
8
|
+
"claude-haha": "bin/unieai"
|
|
5
9
|
},
|
|
6
|
-
"
|
|
7
|
-
"
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"bin/",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
8
18
|
},
|
|
9
|
-
"
|
|
10
|
-
"license": "MIT",
|
|
19
|
+
"license": "UNLICENSED",
|
|
11
20
|
"optionalDependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
21
|
+
"@anthropic-ai/bedrock-sdk": "^0.27.0",
|
|
22
|
+
"@anthropic-ai/foundry-sdk": "^0.4.0",
|
|
23
|
+
"@anthropic-ai/mcpb": "^0.4.0",
|
|
24
|
+
"@anthropic-ai/vertex-sdk": "^0.13.0",
|
|
25
|
+
"@aws-sdk/client-bedrock": "^3.1020.0",
|
|
26
|
+
"@aws-sdk/client-sts": "^3.1020.0",
|
|
27
|
+
"@azure/identity": "^4.13.0",
|
|
28
|
+
"@opentelemetry/exporter-logs-otlp-grpc": "^0.214.0",
|
|
29
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.214.0",
|
|
30
|
+
"@opentelemetry/exporter-logs-otlp-proto": "^0.214.0",
|
|
31
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.214.0",
|
|
32
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.214.0",
|
|
33
|
+
"@opentelemetry/exporter-metrics-otlp-proto": "^0.214.0",
|
|
34
|
+
"@opentelemetry/exporter-prometheus": "^0.214.0",
|
|
35
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.214.0",
|
|
36
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.214.0",
|
|
37
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.214.0",
|
|
38
|
+
"fflate": "^0.8.2"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://unieai.com",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/UnieAI/unieai-code.git"
|
|
24
44
|
}
|
|
25
|
-
}
|
|
45
|
+
}
|
package/postinstall.mjs
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "fs"
|
|
4
|
-
import path from "path"
|
|
5
|
-
import os from "os"
|
|
6
|
-
import { fileURLToPath } from "url"
|
|
7
|
-
import { createRequire } from "module"
|
|
8
|
-
|
|
9
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
10
|
-
const require = createRequire(import.meta.url)
|
|
11
|
-
|
|
12
|
-
function detectPlatformAndArch() {
|
|
13
|
-
// Map platform names
|
|
14
|
-
let platform
|
|
15
|
-
switch (os.platform()) {
|
|
16
|
-
case "darwin":
|
|
17
|
-
platform = "darwin"
|
|
18
|
-
break
|
|
19
|
-
case "linux":
|
|
20
|
-
platform = "linux"
|
|
21
|
-
break
|
|
22
|
-
case "win32":
|
|
23
|
-
platform = "windows"
|
|
24
|
-
break
|
|
25
|
-
default:
|
|
26
|
-
platform = os.platform()
|
|
27
|
-
break
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Map architecture names
|
|
31
|
-
let arch
|
|
32
|
-
switch (os.arch()) {
|
|
33
|
-
case "x64":
|
|
34
|
-
arch = "x64"
|
|
35
|
-
break
|
|
36
|
-
case "arm64":
|
|
37
|
-
arch = "arm64"
|
|
38
|
-
break
|
|
39
|
-
case "arm":
|
|
40
|
-
arch = "arm"
|
|
41
|
-
break
|
|
42
|
-
default:
|
|
43
|
-
arch = os.arch()
|
|
44
|
-
break
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return { platform, arch }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function findBinary() {
|
|
51
|
-
const { platform, arch } = detectPlatformAndArch()
|
|
52
|
-
const packageName = `@unieai/code-${platform}-${arch}`
|
|
53
|
-
const binaryName = platform === "windows" ? "unieai.exe" : "unieai"
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
// Use require.resolve to find the package
|
|
57
|
-
const packageJsonPath = require.resolve(`${packageName}/package.json`)
|
|
58
|
-
const packageDir = path.dirname(packageJsonPath)
|
|
59
|
-
const binaryPath = path.join(packageDir, "bin", binaryName)
|
|
60
|
-
|
|
61
|
-
if (!fs.existsSync(binaryPath)) {
|
|
62
|
-
throw new Error(`Binary not found at ${binaryPath}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return { binaryPath, binaryName }
|
|
66
|
-
} catch (error) {
|
|
67
|
-
throw new Error(`Could not find package ${packageName}: ${error.message}`, { cause: error })
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function main() {
|
|
72
|
-
try {
|
|
73
|
-
if (os.platform() === "win32") {
|
|
74
|
-
// On Windows, the .exe is already included in the package and bin field points to it
|
|
75
|
-
// No postinstall setup needed
|
|
76
|
-
console.log("Windows detected: binary setup not needed (using packaged .exe)")
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// On non-Windows platforms, just verify the binary package exists
|
|
81
|
-
// Don't replace the wrapper script - it handles binary execution
|
|
82
|
-
const { binaryPath } = findBinary()
|
|
83
|
-
const target = path.join(__dirname, "bin", ".opencode")
|
|
84
|
-
if (fs.existsSync(target)) fs.unlinkSync(target)
|
|
85
|
-
try {
|
|
86
|
-
fs.linkSync(binaryPath, target)
|
|
87
|
-
} catch {
|
|
88
|
-
fs.copyFileSync(binaryPath, target)
|
|
89
|
-
}
|
|
90
|
-
fs.chmodSync(target, 0o755)
|
|
91
|
-
} catch (error) {
|
|
92
|
-
console.error("Failed to setup unieai binary:", error.message)
|
|
93
|
-
process.exit(1)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
void main()
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error("Postinstall script error:", error.message)
|
|
101
|
-
process.exit(0)
|
|
102
|
-
}
|