vole-agent 0.1.7 → 0.1.9

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
@@ -10,16 +10,21 @@ npm install -g vole-agent
10
10
 
11
11
  ## Setup
12
12
 
13
- Set your API key in your shell profile or a `.env` file in your project root:
13
+ Add your API key to `~/.vole/config.json` (created automatically on first run):
14
14
 
15
- ```bash
16
- # Anthropic
17
- export VOLE_API_KEY=sk-ant-...
15
+ ```json
16
+ { "apiKey": "sk-ant-..." }
17
+ ```
18
+
19
+ Or set an environment variable in your shell profile:
18
20
 
19
- # or OpenRouter
20
- export OPENROUTER_API_KEY=sk-or-...
21
+ ```bash
22
+ export ANTHROPIC_API_KEY=sk-ant-... # Anthropic
23
+ export OPENROUTER_API_KEY=sk-or-... # OpenRouter
21
24
  ```
22
25
 
26
+ Sessions are stored per-project under `<git-root>/.vole/sessions/` when inside a git repository, or `~/.vole/sessions/` otherwise.
27
+
23
28
  ## Usage
24
29
 
25
30
  ```bash
@@ -68,7 +73,19 @@ Inside `vole chat`:
68
73
 
69
74
  ## Configuration
70
75
 
71
- All configuration is via environment variables:
76
+ Configuration is loaded from (in order of precedence): environment variables → `vole.config.json` (project) → `~/.vole/config.json` (user) → defaults.
77
+
78
+ **File format** (`~/.vole/config.json` or `vole.config.json`):
79
+
80
+ ```json
81
+ {
82
+ "apiKey": "sk-ant-...",
83
+ "model": "claude-haiku-4-5",
84
+ "defaultMode": "confirm"
85
+ }
86
+ ```
87
+
88
+ **Environment variables:**
72
89
 
73
90
  | Variable | Default | Description |
74
91
  |---|---|---|
package/README.zh-CN.md CHANGED
@@ -10,16 +10,21 @@ npm install -g vole-agent
10
10
 
11
11
  ## 配置
12
12
 
13
- shell 配置文件或项目根目录的 `.env` 文件中设置 API key:
13
+ API key 写入 `~/.vole/config.json`(首次运行时自动创建):
14
14
 
15
- ```bash
16
- # Anthropic
17
- export VOLE_API_KEY=sk-ant-...
15
+ ```json
16
+ { "apiKey": "sk-ant-..." }
17
+ ```
18
+
19
+ 或在 shell 配置文件中设置环境变量:
18
20
 
19
- # 或 OpenRouter
20
- export OPENROUTER_API_KEY=sk-or-...
21
+ ```bash
22
+ export ANTHROPIC_API_KEY=sk-ant-... # Anthropic
23
+ export OPENROUTER_API_KEY=sk-or-... # OpenRouter
21
24
  ```
22
25
 
26
+ 在 git 仓库中运行时,会话存储在 `<git-root>/.vole/sessions/`;否则存储在 `~/.vole/sessions/`。
27
+
23
28
  ## 使用
24
29
 
25
30
  ```bash
@@ -66,7 +71,21 @@ vole sessions
66
71
  | `/help` | 显示所有指令 |
67
72
  | `/exit` | 退出对话 |
68
73
 
69
- ## 环境变量配置
74
+ ## 环境变量与配置文件
75
+
76
+ 配置加载优先级:环境变量 → `vole.config.json`(项目级)→ `~/.vole/config.json`(用户级)→ 默认值。
77
+
78
+ **配置文件格式**(`~/.vole/config.json` 或 `vole.config.json`):
79
+
80
+ ```json
81
+ {
82
+ "apiKey": "sk-ant-...",
83
+ "model": "claude-haiku-4-5",
84
+ "defaultMode": "confirm"
85
+ }
86
+ ```
87
+
88
+ **环境变量:**
70
89
 
71
90
  | 变量 | 默认值 | 说明 |
72
91
  |---|---|---|
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as le,d as W,h as ae}from"./chunk-ABKAA7HK.js";import{useState as T,useEffect as Se,useCallback as I,useMemo as fe,useRef as Ie}from"react";import{render as Ae,Box as c,Text as o,useInput as O,useApp as ke,useAnimation as Re,useStdout as Ee,Static as Me}from"ink";import _e from"ink-text-input";import{readFile as De,stat as Pe}from"fs/promises";import{dirname as je,join as U}from"path";import{marked as ze}from"marked";import{useRef as Ze}from"react";import{Text as Be}from"ink";import p from"chalk";import{marked as de}from"marked";var ce=!1;function ue(){ce||(ce=!0,de.use({tokenizer:{del(){}}}))}function y(e,l=0,d=!1){switch(e.type){case"heading":{let s=(e.tokens??[]).map(i=>y(i)).join("");return e.depth===1?p.bold.underline(s)+`
2
+ import{a as le,d as W,h as ae}from"./chunk-6YKK6DUZ.js";import{useState as T,useEffect as Se,useCallback as I,useMemo as fe,useRef as Ie}from"react";import{render as Ae,Box as c,Text as o,useInput as O,useApp as ke,useAnimation as Re,useStdout as Ee,Static as Me}from"ink";import _e from"ink-text-input";import{readFile as De,stat as Pe}from"fs/promises";import{dirname as je,join as U}from"path";import{marked as ze}from"marked";import{useRef as Ze}from"react";import{Text as Be}from"ink";import p from"chalk";import{marked as de}from"marked";var ce=!1;function ue(){ce||(ce=!0,de.use({tokenizer:{del(){}}}))}function y(e,l=0,d=!1){switch(e.type){case"heading":{let s=(e.tokens??[]).map(i=>y(i)).join("");return e.depth===1?p.bold.underline(s)+`
3
3
 
4
4
  `:e.depth===2?p.bold(s)+`
5
5