@ai-zen/air 0.3.1 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +27 -29
  2. package/README.zh.md +27 -29
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -69,14 +69,14 @@ $ gred "hello" file.txt
69
69
  ├── config.json # { "apiKey": "sk-xxx" }
70
70
  ├── context.json # [ { role, content }, ... ] Current conversation
71
71
  ├── snapshots/ # Auto snapshots before migration or /save
72
- └── temp/ # Long-term memory written by AI (*.md)
72
+ └── memory/ # Long-term memory written by AI (*.md)
73
73
  ```
74
74
 
75
75
  ### Core Philosophy
76
76
 
77
77
  - **Model**: DeepSeek-V4-Flash (hardcoded, only one)
78
78
  - **Tool**: Just one `shell` tool — the AI executes commands, reads and writes files through it
79
- - **Memory**: The AI decides what to remember, writes to `temp/*.md` via shell, reads on next startup. No extra persistence mechanism
79
+ - **Memory**: The AI decides what to remember, writes to `memory/*.md` via shell, reads on next startup. No extra persistence mechanism
80
80
  - **Context**: Auto-migrates when JSON serialization exceeds 500K chars, takes a snapshot before migration
81
81
  - **Rules**: Consult the user before making changes. Dangerous operations require explicit written confirmation. The user takes responsibility for their own instructions
82
82
 
@@ -84,36 +84,34 @@ $ gred "hello" file.txt
84
84
 
85
85
  ```
86
86
  src/
87
- ├── cli.ts # CLI entry, commander
88
- ├── config.ts # Config, context, snapshot read/write
89
- ├── delta-renderer.ts # Stream renderer
90
- ├── hook.ts # Fallback terminal hook (install/uninstall)
91
- ├── migration.ts # Context counting & migration
92
- ├── tools.ts # Tool definitions — shell
93
- ├── agent-factory.ts # Agent factory — build model & agent
94
- ├── chat/
95
- ├── shared.ts # ChatCtx type & SYSTEM_PROMPT
96
- ├── runtime.ts # runChat() & chatLoop() — core runtime
97
- ├── message.ts # handleMessage() send & migrate
98
- │ ├── print.ts # sendAndPrint() — stream output
99
- └── commands/
100
- ├── index.ts # dispatchCommand()command router
101
- ├── back.ts # /backrecall & resend
102
- ├── editor.ts # /editor — multi-line input
103
- ├── exit.ts # /exitquit
104
- ├── help.ts # /help
105
- ├── load.ts # /loadload snapshot
106
- │ ├── new.ts # /new — new session
107
- │ └── save.ts # /save — save snapshot
87
+ ├── cli.ts # CLI entry, commander
88
+ ├── config.ts # Config, context, snapshot read/write
89
+ ├── delta-renderer.ts # Stream renderer
90
+ ├── hook.ts # Fallback terminal hook (install/uninstall)
91
+ ├── migration.ts # Context counting & migration
92
+ ├── tools.ts # Tool definitions — shell
93
+ ├── agent-factory.ts # Agent factory — build model & agent
94
+ ├── agent-runtime.ts # Core runtime — send, chat loop
95
+ ├── agent-types.ts # Type definitions (ChatCtx, etc.)
96
+ ├── agent-constants.ts # System prompt & constants
97
+ ├── agent-commands/ # Interactive command handlers
98
+ │ ├── index.ts # dispatchCommand() — command router
99
+ ├── back.ts # /back — recall & resend
100
+ ├── editor.ts # /editormulti-line input
101
+ ├── exit.ts # /exitquit
102
+ ├── help.ts # /help
103
+ ├── load.ts # /loadload snapshot
104
+ ├── new.ts # /new — new session
105
+ └── save.ts # /savesave snapshot
108
106
  └── __tests__/
109
- ├── chat.test.ts # Chat session tests
110
- ├── config.test.ts # Config/context/snapshot tests
111
- ├── main.test.ts # contextSize/shouldMigrate tests
112
- ├── e2e.test.ts # End-to-end tests
113
- └── tools.test.ts # Shell tool structure tests
107
+ ├── chat.test.ts # Chat session tests
108
+ ├── config.test.ts # Config/context/snapshot tests
109
+ ├── main.test.ts # contextSize/shouldMigrate tests
110
+ ├── e2e.test.ts # End-to-end tests
111
+ └── tools.test.ts # Shell tool structure tests
114
112
  ```
115
113
 
116
- ~49 KB, 881 lines.
114
+ ~76 KB, 879 lines (excluding tests).
117
115
 
118
116
  ## Tests
119
117
 
package/README.zh.md CHANGED
@@ -69,14 +69,14 @@ $ gred "hello" file.txt
69
69
  ├── config.json # { "apiKey": "sk-xxx" }
70
70
  ├── context.json # [ { role, content }, ... ] 当前对话
71
71
  ├── snapshots/ # /save 或迁移前自动快照
72
- └── temp/ # AI 自己写入的长期记忆 (*.md)
72
+ └── memory/ # AI 自己写入的长期记忆 (*.md)
73
73
  ```
74
74
 
75
75
  ### 核心理念
76
76
 
77
77
  - **模型**: DeepSeek-V4-Flash(写死,只有一个)
78
78
  - **工具**: 只有一个 `shell`,AI 用它执行命令、读写文件
79
- - **记忆**: AI 自己决定记什么,用 shell 写入 `temp/*.md`,下次启动时读取。air 不做额外的持久化机制
79
+ - **记忆**: AI 自己决定记什么,用 shell 写入 `memory/*.md`,下次启动时读取。air 不做额外的持久化机制
80
80
  - **上下文**: JSON 序列化后超过 50 万字符自动迁移,迁移前拍快照
81
81
  - **行为准则**: 先商量再动手,危险操作必须获得用户书面确认。追责原则——每一步基于用户指令,用户承担责任
82
82
 
@@ -84,36 +84,34 @@ $ gred "hello" file.txt
84
84
 
85
85
  ```
86
86
  src/
87
- ├── cli.ts # CLI 入口,commander
88
- ├── config.ts # 配置、上下文、快照读写
89
- ├── delta-renderer.ts # 流式渲染器
90
- ├── hook.ts # 兜底终端钩子(install/uninstall)
91
- ├── migration.ts # 上下文计数与迁移
92
- ├── tools.ts # 工具定义——shell
93
- ├── agent-factory.ts # Agent 工厂——构建模型与 Agent
94
- ├── chat/
95
- ├── shared.ts # ChatCtx 类型 & SYSTEM_PROMPT
96
- ├── runtime.ts # runChat() & chatLoop() — 核心运行时
97
- ├── message.ts # handleMessage() — 发送与迁移
98
- │ ├── print.ts # sendAndPrint() — 流式输出
99
- └── commands/
100
- ├── index.ts # dispatchCommand()命令分发入口
101
- ├── back.ts # /back撤回消息
102
- ├── editor.ts # /editor — 多行编辑器输入
103
- ├── exit.ts # /exit退出
104
- ├── help.ts # /help
105
- ├── load.ts # /load加载快照
106
- │ ├── new.ts # /new — 新会话
107
- │ └── save.ts # /save — 保存快照
87
+ ├── cli.ts # CLI 入口,commander
88
+ ├── config.ts # 配置、上下文、快照读写
89
+ ├── delta-renderer.ts # 流式渲染器
90
+ ├── hook.ts # 兜底终端钩子(install/uninstall)
91
+ ├── migration.ts # 上下文计数与迁移
92
+ ├── tools.ts # 工具定义——shell
93
+ ├── agent-factory.ts # Agent 工厂——构建模型与 Agent
94
+ ├── agent-runtime.ts # 核心运行时——send、chat loop
95
+ ├── agent-types.ts # 类型定义(ChatCtx 等)
96
+ ├── agent-constants.ts # 系统提示词与常量
97
+ ├── agent-commands/ # 交互命令处理
98
+ │ ├── index.ts # dispatchCommand() — 命令分发入口
99
+ ├── back.ts # /back — 撤回消息
100
+ ├── editor.ts # /editor多行编辑器输入
101
+ ├── exit.ts # /exit退出
102
+ ├── help.ts # /help
103
+ ├── load.ts # /load加载快照
104
+ ├── new.ts # /new — 新会话
105
+ └── save.ts # /save保存快照
108
106
  └── __tests__/
109
- ├── chat.test.ts # 聊天测试
110
- ├── config.test.ts # 配置/上下文/快照测试
111
- ├── main.test.ts # contextSize/shouldMigrate 测试
112
- ├── e2e.test.ts # 端到端测试
113
- └── tools.test.ts # shell 工具结构测试
107
+ ├── chat.test.ts # 聊天测试
108
+ ├── config.test.ts # 配置/上下文/快照测试
109
+ ├── main.test.ts # contextSize/shouldMigrate 测试
110
+ ├── e2e.test.ts # 端到端测试
111
+ └── tools.test.ts # shell 工具结构测试
114
112
  ```
115
113
 
116
- 49 KB,881 行。
114
+ 116 KB,1381 行。
117
115
 
118
116
  ## 测试
119
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-zen/air",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Minimalist AI CLI assistant — one shell tool, filesystem memory, auto context migration",
5
5
  "type": "module",
6
6
  "main": "./dist/agent-runtime.js",