@bitfun-ai/bitfun 0.2.19-alpha.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CWing
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # BitFun CLI
2
+
3
+ The npm package installs the BitFun terminal application and selects the native
4
+ binary matching the current operating system and CPU architecture.
5
+
6
+ ```bash
7
+ npm install -g @bitfun-ai/bitfun
8
+ bitfun --help
9
+ ```
10
+
11
+ The npm package exposes only the `bitfun` command. The selected platform npm
12
+ package contains the native executable, the Bun extension-host runtime, the
13
+ Extension Host entrypoint, and product-provided plugin npm directories:
14
+
15
+ ```text
16
+ vendor/<rust-target>/bin/bitfun(.exe)
17
+ host/extension-host.js
18
+ plugins/manifest.json
19
+ plugins/<plugin-package>/...
20
+ runtime/bun(.exe)
21
+ ```
22
+
23
+ The release workflow installs `deveco-harness@0.1.2` from the official npm
24
+ registry before packaging and includes its runtime dependencies below
25
+ `plugins/deveco-harness/`. Built-in plugins are loaded automatically when the
26
+ CLI starts. User-configured OpenCode plugins continue to use their configured
27
+ npm or local file spec.
28
+
29
+ Supported npm targets are Linux x64, macOS ARM64, Windows x64, and OpenHarmony
30
+ ARM64. The OpenHarmony platform package is signed and published by the release workflow.
31
+ See the [BitFun CLI documentation](https://github.com/GCWing/BitFun/tree/main/src/apps/cli)
32
+ for usage and other installation methods.
@@ -0,0 +1,67 @@
1
+ # Third-Party Notices
2
+
3
+ BitFun redistributes selected material and links libraries from the following
4
+ third-party projects. These notices are included with BitFun's Desktop and CLI
5
+ release packages.
6
+
7
+ ## models.dev catalog data
8
+
9
+ - Project: models.dev
10
+ - Source: https://github.com/anomalyco/models.dev
11
+ - Catalog API: https://models.dev/api.json
12
+ - License: MIT
13
+ - Copyright: Copyright (c) 2025 models.dev
14
+
15
+ BitFun includes a curated, reasoning-only fallback derived from the models.dev
16
+ catalog. It is used when a newer cached catalog is unavailable. The precise
17
+ source revision, retrieval metadata, transformation, and content hashes are
18
+ recorded in `models-dev.provenance.json`, which is shipped as
19
+ `third-party/models.dev/provenance.json` in binary release packages. The
20
+ complete upstream license text is preserved in `models-dev.LICENSE.txt`, which
21
+ is shipped as `third-party/models.dev/LICENSE.txt`. Source distributions keep
22
+ the canonical copies of both files beside the bundled snapshot under
23
+ `src/crates/services/services-integrations/assets/`.
24
+
25
+ ## anydoc
26
+
27
+ - Project: anydoc
28
+ - Source: https://github.com/firecrawl/anydoc
29
+ - Version: 0.1.6
30
+ - License: MIT
31
+ - Copyright: Copyright (c) 2026 Sideguide Technologies Inc.
32
+
33
+ BitFun links anydoc to convert supported office documents, OpenDocument files,
34
+ RTF, EPUB, CSV, and PDFs into Markdown for the Agent Read tool.
35
+
36
+ MIT License
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
39
+ this software and associated documentation files (the "Software"), to deal in
40
+ the Software without restriction, including without limitation the rights to
41
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
42
+ the Software, and to permit persons to whom the Software is furnished to do so,
43
+ subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all
46
+ copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54
+ SOFTWARE.
55
+
56
+ ## OpenAI Codex Seatbelt policies
57
+
58
+ - Project: OpenAI Codex
59
+ - Source: https://github.com/openai/codex
60
+ - Revision: `7c3747941a6b664c30f1e6aa72a917fd74dc22d2`
61
+ - License: Apache-2.0
62
+ - Copyright: Copyright 2025 OpenAI
63
+
64
+ BitFun's macOS command sandbox includes modified Seatbelt base, platform-read,
65
+ and network policy assets derived from OpenAI Codex. The upstream Apache-2.0
66
+ license and NOTICE are preserved under
67
+ `src/crates/services/sandbox/third_party/openai-codex/`.
package/bin/bitfun.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { run } from "./launcher.js";
4
+
5
+ await run("bitfun");
@@ -0,0 +1,123 @@
1
+ import { spawn } from "node:child_process";
2
+ import { existsSync } from "node:fs";
3
+ import { createRequire } from "node:module";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const require = createRequire(import.meta.url);
8
+ const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
9
+ const packageManifest = require(path.join(packageRoot, "package.json"));
10
+ const packageScope = packageManifest.name.split("/")[0];
11
+
12
+ const PLATFORM_BY_RUNTIME = new Map([
13
+ ["linux:x64", {
14
+ packageName: `${packageScope}/bitfun-linux-x64`,
15
+ target: "x86_64-unknown-linux-gnu",
16
+ }],
17
+ ["darwin:arm64", {
18
+ packageName: `${packageScope}/bitfun-darwin-arm64`,
19
+ target: "aarch64-apple-darwin",
20
+ }],
21
+ ["win32:x64", {
22
+ packageName: `${packageScope}/bitfun-win32-x64`,
23
+ target: "x86_64-pc-windows-msvc",
24
+ }],
25
+ ["openharmony:arm64", {
26
+ packageName: `${packageScope}/bitfun-ohos-arm64`,
27
+ target: "aarch64-unknown-linux-ohos",
28
+ }],
29
+ ]);
30
+
31
+ export function platformPackage(platform = process.platform, arch = process.arch) {
32
+ return PLATFORM_BY_RUNTIME.get(`${platform}:${arch}`) ?? null;
33
+ }
34
+
35
+ export function findNativeExecutable(command, platform = process.platform, arch = process.arch) {
36
+ return findNativeExecutableDetails(command, platform, arch).executable;
37
+ }
38
+
39
+ function findNativeExecutableDetails(command, platform = process.platform, arch = process.arch) {
40
+ if (command !== "bitfun") {
41
+ throw new Error(`Unsupported BitFun CLI command: ${command}`);
42
+ }
43
+
44
+ const selected = platformPackage(platform, arch);
45
+ if (!selected) {
46
+ throw new Error(`Unsupported platform: ${platform} (${arch})`);
47
+ }
48
+
49
+ let platformPackageRoot;
50
+ try {
51
+ const packageJson = require.resolve(`${selected.packageName}/package.json`);
52
+ platformPackageRoot = path.dirname(packageJson);
53
+ } catch {
54
+ // This fallback supports a manually assembled package with vendor content.
55
+ platformPackageRoot = packageRoot;
56
+ }
57
+
58
+ const executableName = platform === "win32" ? "bitfun.exe" : "bitfun";
59
+ const executable = path.join(
60
+ platformPackageRoot,
61
+ "vendor",
62
+ selected.target,
63
+ "bin",
64
+ executableName,
65
+ );
66
+ if (existsSync(executable)) {
67
+ return { executable, platformPackageRoot };
68
+ }
69
+
70
+ throw new Error(
71
+ `Missing optional dependency ${selected.packageName}. ` +
72
+ `Reinstall BitFun CLI with: npm install -g ${packageManifest.name}@latest`,
73
+ );
74
+ }
75
+
76
+ export async function run(command) {
77
+ const selected = findNativeExecutableDetails(command);
78
+ const executable = selected.executable;
79
+ const runtimeName = process.platform === "win32" ? "bun.exe" : "bun";
80
+ const bundledBun = path.join(selected.platformPackageRoot, "runtime", runtimeName);
81
+ const bundledPlugins = path.join(selected.platformPackageRoot, "plugins");
82
+ const env = {
83
+ ...process.env,
84
+ BITFUN_MANAGED_BY_NPM: "1",
85
+ BITFUN_MANAGED_PACKAGE_ROOT: packageRoot,
86
+ BITFUN_MANAGED_PLATFORM_PACKAGE_ROOT: selected.platformPackageRoot,
87
+ };
88
+ if (!env.BITFUN_BUN_COMMAND && existsSync(bundledBun)) {
89
+ env.BITFUN_BUN_COMMAND = bundledBun;
90
+ }
91
+ if (!env.BITFUN_BUILTIN_PLUGIN_ROOT && existsSync(bundledPlugins)) {
92
+ env.BITFUN_BUILTIN_PLUGIN_ROOT = bundledPlugins;
93
+ }
94
+ const child = spawn(executable, process.argv.slice(2), {
95
+ stdio: "inherit",
96
+ env,
97
+ });
98
+
99
+ const forwardSignal = (signal) => {
100
+ if (!child.killed) {
101
+ try {
102
+ child.kill(signal);
103
+ } catch {
104
+ // The child may have exited between the killed check and child.kill().
105
+ }
106
+ }
107
+ };
108
+
109
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
110
+ process.on(signal, () => forwardSignal(signal));
111
+ }
112
+
113
+ const result = await new Promise((resolve, reject) => {
114
+ child.once("error", reject);
115
+ child.once("exit", (code, signal) => resolve({ code, signal }));
116
+ });
117
+
118
+ if (result.signal) {
119
+ process.kill(process.pid, result.signal);
120
+ return;
121
+ }
122
+ process.exit(result.code ?? 1);
123
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@bitfun-ai/bitfun",
3
+ "version": "0.2.19-alpha.1",
4
+ "description": "BitFun CLI - terminal AI agent",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "bitfun": "bin/bitfun.js"
9
+ },
10
+ "engines": {
11
+ "node": ">=18"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "README.md",
16
+ "LICENSE",
17
+ "THIRD_PARTY_NOTICES.md",
18
+ "third-party"
19
+ ],
20
+ "optionalDependencies": {
21
+ "@bitfun-ai/bitfun-linux-x64": "npm:@bitfun-ai/bitfun@0.2.19-alpha.1.linux-x64",
22
+ "@bitfun-ai/bitfun-darwin-arm64": "npm:@bitfun-ai/bitfun@0.2.19-alpha.1.darwin-arm64",
23
+ "@bitfun-ai/bitfun-win32-x64": "npm:@bitfun-ai/bitfun@0.2.19-alpha.1.win32-x64",
24
+ "@bitfun-ai/bitfun-ohos-arm64": "npm:@bitfun-ai/bitfun@0.2.19-alpha.1.ohos-arm64"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/GCWing/BitFun.git",
29
+ "directory": "src/apps/cli"
30
+ },
31
+ "homepage": "https://openbitfun.com/",
32
+ "bugs": "https://github.com/GCWing/BitFun/issues",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 models.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ {
2
+ "schema_version": 1,
3
+ "artifact": {
4
+ "path": "src/crates/services/services-integrations/assets/models-dev.json",
5
+ "sha256": "36d8ee5eb142b3d108d4f82b775b7232413ab8f8b7cd85c9a6c5538525cee571",
6
+ "bytes": 647504
7
+ },
8
+ "source": {
9
+ "project": "models.dev",
10
+ "api_url": "https://models.dev/api.json",
11
+ "api_sha256": "a51a929503f14aed3d646ec71a497de265bac673690224ca7ed320d110545f1b",
12
+ "api_bytes": 3504153,
13
+ "api_etag": null,
14
+ "retrieved_at": "2026-08-05T02:02:14.800Z",
15
+ "repository": "https://github.com/anomalyco/models.dev",
16
+ "repository_branch": "dev",
17
+ "repository_revision": "582eaaa208e55231d8482a20cac17f500118f9c6",
18
+ "revision_role": "Upstream dev revision observed when the API document was retrieved; api_sha256 is authoritative for the retrieved source bytes."
19
+ },
20
+ "license": {
21
+ "spdx": "MIT",
22
+ "copyright": "Copyright (c) 2025 models.dev",
23
+ "upstream_path": "LICENSE",
24
+ "source_path": "src/crates/services/services-integrations/assets/models-dev.LICENSE.txt",
25
+ "release_path": "third-party/models.dev/LICENSE.txt",
26
+ "sha256": "dc2dc41c9fea2fd3c41c21c6f484844cab367800b88ff24781f980ad3a9d160a"
27
+ },
28
+ "transformation": {
29
+ "kind": "builtin_provider_catalog_fallback",
30
+ "description": "Select every models.dev provider bound by the BitFun built-in provider overlay plus explicitly declared supplemental reasoning providers, retain the provider/model fields consumed by the provider and reasoning catalogs, normalize reasoning_options to arrays, and serialize deterministic pretty-printed JSON.",
31
+ "provider_overlay_path": "src/shared/ai-provider-catalog/providers.json",
32
+ "supplemental_reasoning_provider_ids": [
33
+ "openai"
34
+ ],
35
+ "retained_provider_fields": [
36
+ "id",
37
+ "name",
38
+ "api",
39
+ "doc",
40
+ "env"
41
+ ],
42
+ "retained_model_fields": [
43
+ "id",
44
+ "name",
45
+ "description",
46
+ "family",
47
+ "status",
48
+ "release_date",
49
+ "last_updated",
50
+ "knowledge",
51
+ "open_weights",
52
+ "attachment",
53
+ "reasoning",
54
+ "tool_call",
55
+ "structured_output",
56
+ "reasoning_options",
57
+ "modalities.input",
58
+ "modalities.output",
59
+ "limit.context",
60
+ "limit.input",
61
+ "limit.output",
62
+ "cost.input",
63
+ "cost.output",
64
+ "cost.cache_read",
65
+ "cost.cache_write"
66
+ ],
67
+ "included_provider_ids": [
68
+ "alibaba",
69
+ "anthropic",
70
+ "deepseek",
71
+ "google",
72
+ "kimi-for-coding",
73
+ "minimax",
74
+ "minimax-cn",
75
+ "minimax-cn-coding-plan",
76
+ "minimax-coding-plan",
77
+ "moonshotai",
78
+ "moonshotai-cn",
79
+ "nvidia",
80
+ "openai",
81
+ "openrouter",
82
+ "siliconflow",
83
+ "zhipuai"
84
+ ],
85
+ "included_provider_model_counts": {
86
+ "alibaba": 52,
87
+ "anthropic": 15,
88
+ "deepseek": 4,
89
+ "google": 41,
90
+ "kimi-for-coding": 4,
91
+ "minimax": 7,
92
+ "minimax-cn": 7,
93
+ "minimax-cn-coding-plan": 7,
94
+ "minimax-coding-plan": 7,
95
+ "moonshotai": 10,
96
+ "moonshotai-cn": 10,
97
+ "nvidia": 98,
98
+ "openai": 47,
99
+ "openrouter": 337,
100
+ "siliconflow": 49,
101
+ "zhipuai": 13
102
+ }
103
+ },
104
+ "maintenance": {
105
+ "update_command": "pnpm run models-dev:update",
106
+ "check_command": "pnpm run models-dev:check"
107
+ }
108
+ }