@vincentbanana/banana-gui 0.0.0-stage → 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/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # @vincentbanana/banana-gui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Banana 的图形界面:本地起一个服务,用浏览器打开。黑白主题、只用自绘 SVG 图标、无 emoji、无第三方 UI 依赖。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install -g @vincentbanana/banana-gui
9
+ banana-gui
10
+ ```
11
+
12
+ 首次启动会进配置向导(选 provider、贴 API key、选权限、测连接),配置与 CLI 共用 `~/.banana/config.json`。
13
+
14
+ ## 用法
15
+
16
+ ```bash
17
+ banana-gui # 随机端口,自动开浏览器
18
+ banana-gui --port 8080 # 指定端口
19
+ banana-gui --cwd D:/project # 指定工作区
20
+ banana-gui --provider deepseek --model deepseek-chat
21
+ ```
22
+
23
+ ## 特性
24
+
25
+ - 左侧会话列表:新建 / 切换 / 删除,切换即续上下文
26
+ - 流式回复、工具调用实时状态(自绘图标:文件、终端、搜索、编辑…)
27
+ - 危险操作弹出确认框,附变更预览(写文件前给 diff)
28
+ - 一键撤销上一轮文件改动
29
+ - 粘贴或拖拽图片,随消息一起发送
30
+ - 模型、权限、工作区、系统提示词在设置面板里改,改完立刻生效
31
+ - 深浅色跟随系统,纯黑白,无渐变无彩色
32
+
33
+ ## 安全
34
+
35
+ 服务只监听 `127.0.0.1`,所有接口都需要 URL 里的 token;无 token 访问一律 404。URL 等同于登录凭证,不要分享。
36
+
37
+ ## 依赖
38
+
39
+ 运行时依赖只有 `@vincentbanana/bananacli`(agent 内核),界面资源全部在本包里,零第三方前端依赖。
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ // Banana GUI 启动器:复用 CLI 包的 agent 内核,用本包自带的界面资源。
3
+ // 安装:npm install -g @vincentbanana/banana-gui
4
+ // 启动:banana-gui(首次会进配置向导)
5
+ import { fileURLToPath } from 'node:url';
6
+ import { dirname, join } from 'node:path';
7
+ import { spawn } from 'node:child_process';
8
+
9
+ const here = dirname(fileURLToPath(import.meta.url));
10
+ const args = process.argv.slice(2);
11
+ const passthrough = ['--port', '--cwd', '--provider', '--model', '--base-url', '--api-key', '--setup'];
12
+
13
+ const cliArgs = ['--ui', '--no-open'];
14
+ let forwarding = false;
15
+ for (const arg of args) {
16
+ if (arg === '--help' || arg === '-h' || arg === '--version' || arg === '-v') {
17
+ console.log('banana-gui — Banana 的图形界面');
18
+ console.log('');
19
+ console.log('用法: banana-gui [选项]');
20
+ console.log(' --port <端口> 指定端口(默认随机)');
21
+ console.log(' --cwd <目录> 指定工作区');
22
+ console.log(' --provider <名> 指定 provider');
23
+ console.log(' --model <名> 指定模型');
24
+ console.log(' --open 启动后打开浏览器(默认已开启)');
25
+ console.log(' --help 显示帮助');
26
+ process.exit(0);
27
+ }
28
+ if (arg === '--open') {
29
+ forwarding = false;
30
+ continue;
31
+ }
32
+ forwarding = passthrough.includes(arg) || forwarding;
33
+ cliArgs.push(arg);
34
+ }
35
+
36
+ const entry = join(here, '..', 'node_modules', '@vincentbanana', 'bananacli', 'dist', 'index.js');
37
+ const child = spawn(process.execPath, [entry, ...cliArgs], { stdio: 'inherit' });
38
+ child.on('exit', (code) => process.exit(code ?? 0));
39
+ for (const signal of ['SIGINT', 'SIGTERM']) {
40
+ process.on(signal, () => child.kill(signal));
41
+ }
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@vincentbanana/banana-gui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Banana 的图形界面:本地服务 + 浏览器。黑白主题,自绘图标,无第三方 UI 依赖",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=20.0.0"
8
+ },
9
+ "bin": {
10
+ "banana-gui": "bin/banana-gui.mjs"
11
+ },
12
+ "files": [
13
+ "bin",
14
+ "ui",
15
+ "README.md"
16
+ ],
17
+ "scripts": {
18
+ "sync": "node ../scripts/sync-gui.mjs",
19
+ "test": "node test/gui-package.test.mjs"
20
+ },
21
+ "dependencies": {
22
+ "@vincentbanana/bananacli": "^0.2.0"
23
+ },
24
+ "keywords": [
25
+ "ai",
26
+ "agent",
27
+ "gui",
28
+ "web-ui",
29
+ "llm",
30
+ "terminal"
31
+ ],
32
+ "license": "MIT",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
6
36
  }