@cydm/pie 0.1.1 → 1.0.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.
Files changed (37) hide show
  1. package/README.md +117 -88
  2. package/package.json +4 -3
  3. package/dist/builtin/extensions/ask-user/index.js +0 -2924
  4. package/dist/builtin/extensions/changelog/index.js +0 -200
  5. package/dist/builtin/extensions/compact/index.js +0 -52
  6. package/dist/builtin/extensions/deploy/index.js +0 -11
  7. package/dist/builtin/extensions/files/index.js +0 -10
  8. package/dist/builtin/extensions/init/index.js +0 -144
  9. package/dist/builtin/extensions/plan-mode/index.js +0 -209
  10. package/dist/builtin/extensions/questionnaire/index.js +0 -2753
  11. package/dist/builtin/extensions/subagent/index.js +0 -7350
  12. package/dist/builtin/extensions/todo/index.js +0 -162
  13. package/dist/builtin/skills/browser-tools/CHANGELOG.md +0 -47
  14. package/dist/builtin/skills/browser-tools/browser-cookies.js +0 -35
  15. package/dist/builtin/skills/browser-tools/browser-screenshot.js +0 -34
  16. package/dist/builtin/skills/browser-tools/browser-start.js +0 -86
  17. package/dist/builtin/skills/skill-creator/LICENSE.txt +0 -202
  18. package/dist/builtin/skills/skill-creator/SKILL.md +0 -485
  19. package/dist/builtin/skills/skill-creator/agents/analyzer.md +0 -274
  20. package/dist/builtin/skills/skill-creator/agents/comparator.md +0 -202
  21. package/dist/builtin/skills/skill-creator/agents/grader.md +0 -223
  22. package/dist/builtin/skills/skill-creator/assets/eval_review.html +0 -146
  23. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  24. package/dist/builtin/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  25. package/dist/builtin/skills/skill-creator/references/schemas.md +0 -430
  26. package/dist/builtin/skills/skill-creator/scripts/__init__.py +0 -0
  27. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  28. package/dist/builtin/skills/skill-creator/scripts/generate_report.py +0 -326
  29. package/dist/builtin/skills/skill-creator/scripts/improve_description.py +0 -247
  30. package/dist/builtin/skills/skill-creator/scripts/package_skill.py +0 -136
  31. package/dist/builtin/skills/skill-creator/scripts/quick_validate.py +0 -103
  32. package/dist/builtin/skills/skill-creator/scripts/run_eval.py +0 -310
  33. package/dist/builtin/skills/skill-creator/scripts/run_loop.py +0 -328
  34. package/dist/builtin/skills/skill-creator/scripts/utils.py +0 -47
  35. package/dist/cli.js +0 -74440
  36. package/dist/theme/dark.json +0 -85
  37. package/dist/theme/light.json +0 -84
package/README.md CHANGED
@@ -1,150 +1,179 @@
1
1
  # @cydm/pie
2
2
 
3
- Pie AI Agent CLI - 命令行交互界面
3
+ `@cydm/pie` is a minimal, powerful, embeddable agent suite for game developers.
4
4
 
5
- ## 安装
5
+ It gives you a terminal-first agent experience out of the box, while staying modular enough to embed into other runtimes and products. Pie is designed for teams that want a small surface area, strong defaults, persistent sessions, tool use, and a clean path from CLI usage to deeper integration.
6
+
7
+ Pie is heavily inspired by `pi`, while evolving in its own direction around modularity, embeddability, and a compact developer-facing workflow.
8
+
9
+ Pie is developed by [cydream](https://cydream.tech).
10
+
11
+ ## Why Pie
12
+
13
+ - Minimal interface, low ceremony
14
+ - Powerful coding-agent workflow in the terminal
15
+ - Embeddable architecture built on reusable `@pie/*` packages
16
+ - Persistent sessions, slash commands, and skill loading
17
+ - Works well as both a daily CLI and a building block for custom agent products
18
+
19
+ ## Install
6
20
 
7
21
  ```bash
8
22
  npm install -g @cydm/pie
9
23
  ```
10
24
 
11
- ## 使用
12
-
13
- ### 环境变量
25
+ ## Quick Start
14
26
 
15
- 设置 API Key:
27
+ Set an API key for the provider you want to use:
16
28
 
17
29
  ```bash
18
- export KIMI_API_KEY="your-api-key"
30
+ export KIMI_API_KEY="your-kimi-api-key"
31
+ # or
32
+ export BIGMODEL_API_KEY="your-bigmodel-api-key"
19
33
  ```
20
34
 
21
- 或创建配置文件 `~/.pie/config.json`:
35
+ You can also configure defaults in:
22
36
 
23
- ```json
24
- {
25
- "provider": "kimi-cn",
26
- "modelId": "kimi-k2.5",
27
- "apiKey": "your-api-key"
28
- }
37
+ - `~/.pie/settings.json`
38
+ - `~/.pie/models.json`
39
+ - `~/.pie/config.json` for legacy-compatible defaults
40
+
41
+ Start Pie in interactive mode:
42
+
43
+ ```bash
44
+ pie
29
45
  ```
30
46
 
31
- ### 命令
47
+ Or pass an initial prompt:
32
48
 
33
- #### Print 模式(默认)
49
+ ```bash
50
+ pie chat "Summarize this repository"
51
+ ```
34
52
 
35
- 直接输入 prompt,获取结果后退出:
53
+ Use Pie in one-shot mode:
36
54
 
37
55
  ```bash
38
- pie "请列出当前目录的文件"
39
- pie chat "帮我写一个快速排序的 Python 代码"
56
+ pie "List the files in the current directory"
57
+ pie chat "Write a quick Python script for merge sort"
40
58
  ```
41
59
 
42
- #### Interactive 模式
60
+ ## Core Ideas
43
61
 
44
- 启动交互式 TUI 界面:
62
+ Pie is not just a chat CLI. It is a compact agent suite with a terminal UI on top of a reusable runtime.
63
+
64
+ - The CLI is intentionally small and fast to learn
65
+ - The agent can work with files, shell commands, sessions, and skills
66
+ - The architecture is modular, so the same foundation can be embedded into other apps and environments
67
+
68
+ If you want an agent that feels lightweight but still has serious capability, that is the design target for Pie.
69
+
70
+ ## Interactive Experience
71
+
72
+ Run:
45
73
 
46
74
  ```bash
47
75
  pie
48
- #
76
+ # or
49
77
  pie chat
50
78
  ```
51
79
 
52
- 快捷键:
53
- - `Enter` - 提交消息
54
- - `Shift+Enter` / `Ctrl+Enter` - 换行(需 CSI u 支持的终端)
55
- - `\` + `Enter` - 换行(兼容所有终端)
56
- - `Ctrl+C` - 退出
80
+ Main key bindings:
57
81
 
58
- #### 帮助
82
+ - `Enter` submit message
83
+ - `Shift+Enter` insert a new line
84
+ - `\` + `Enter` insert a new line in terminals without modified-enter support
85
+ - `Ctrl+C` exit
86
+ - `Ctrl+D` exit
87
+ - `Ctrl+O` expand or collapse tool output
88
+ - `/` open the slash command menu
59
89
 
60
- ```bash
61
- pie help
62
- pie --help
90
+ Direct shell mode:
91
+
92
+ ```text
93
+ !!git status
94
+ !!npm test
63
95
  ```
64
96
 
65
- ## 功能特性
97
+ Commands prefixed with `!!` run directly in the shell without going through the agent.
66
98
 
67
- - **Print 模式**:快速单次查询,适合脚本调用
68
- - **Interactive TUI**:完整的终端交互界面
69
- - 实时流式响应显示
70
- - 多行编辑器(Shift+Enter 换行)
71
- - 工具执行状态透明展示
72
- - Thinking 过程显示
73
- - 主题系统(dark/light)
74
- - **工具支持**:read、write、edit、ls、grep、find、bash
75
- - **Session 管理**:自动保存对话历史
99
+ ## Slash Commands
76
100
 
77
- ### Session 管理
101
+ Pie uses a hierarchical slash-command menu. The current built-in commands include:
78
102
 
79
- Session 文件保存在 `~/.pie/sessions/` 目录。
103
+ | Command | Description |
104
+ | --- | --- |
105
+ | `/sessions/compact` | Summarize history and create a compact checkpoint |
106
+ | `/sessions/new` | Start a new session |
107
+ | `/sessions/resume` | Resume a different session |
108
+ | `/sessions/tree` | Navigate the session tree |
109
+ | `/sessions/info` | Show session information |
110
+ | `/sessions/fork` | Fork from an earlier message |
111
+ | `/settings` | Open the settings menu |
112
+ | `/settings/model` | Choose a model |
113
+ | `/settings/theme` | Change the theme |
114
+ | `/settings/thinking` | Set reasoning depth |
115
+ | `/settings/yolo` | Toggle less restricted filesystem mode |
116
+ | `/settings/hotkeys` | Show keyboard shortcuts |
117
+ | `/settings/quit` | Exit Pie |
118
+ | `/skills/list` | List available skills |
119
+ | `/skills/use` | Use a skill |
120
+ | `/skills/reload` | Reload skills from disk |
121
+ | `/tools/subagent` | Spawn a subagent for a task |
122
+ | `/debugs/cache-test` | Test context caching |
123
+ | `/debugs/context` | Dump raw context for debugging |
124
+ | `/debugs/package` | Dump raw request and response payloads |
80
125
 
81
- #### Slash 命令
126
+ Pie can also load extension-provided commands at runtime.
82
127
 
83
- Interactive 模式下输入 `/` 显示命令菜单:
128
+ ## Sessions
84
129
 
85
- | 命令 | 说明 |
86
- |------|------|
87
- | `/new` | 创建新 Session(保存当前并开启新的对话) |
88
- | `/resume` | 恢复之前的 Session(显示交互式选择器) |
89
- | `/session` | 显示当前 Session 信息 |
90
- | `/fork` | 从当前 Session 分叉创建新 Session |
91
- | `/tree` | 显示 Session 树状结构 |
92
- | `/settings` | 设置菜单(主题、思考级别) |
93
- | `/hotkeys` | 显示键盘快捷键 |
94
- | `/quit` | 退出 |
130
+ Pie keeps persistent sessions so you can come back to earlier work.
95
131
 
96
- #### 使用示例
132
+ - Sessions are stored in `~/.pie/sessions/`
133
+ - You can switch sessions from the command menu
134
+ - You can fork a session to branch off a previous line of work
135
+ - You can compact long sessions to keep context focused
97
136
 
98
- ```bash
99
- # 启动交互模式
100
- pie chat
137
+ This makes Pie useful for ongoing coding tasks, not just one-off prompts.
101
138
 
102
- # 聊几句...
103
- > 你好,我叫 Bob
104
- > 我喜欢用 TypeScript
139
+ ## Skills And Extensibility
105
140
 
106
- # 创建新 Session(之前的对话会被保存)
107
- /new
141
+ Pie supports Markdown-based skills and built-in extensions.
108
142
 
109
- # 在新 Session 中聊天
110
- > 你好
143
+ - Built-in skills ship with the CLI
144
+ - User skills can live under `~/.pie/skills`
145
+ - Project-local skills can live under `.pie/skills`
146
+ - Extensions can register additional commands and workflows
111
147
 
112
- # 恢复之前的 Session
113
- /resume
114
- # 使用 ↑↓ 选择,Enter 确认
148
+ That is part of what makes Pie embeddable: the CLI is only one interface on top of a broader agent toolkit.
115
149
 
116
- # AI 会记得之前的对话内容
117
- > 我叫什么名字?
118
- # AI: 你叫 Bob,之前告诉过我你喜欢 TypeScript
119
- ```
150
+ ## Output Modes
120
151
 
121
- #### 快捷键
152
+ For non-interactive usage, Pie supports structured output options:
153
+
154
+ ```bash
155
+ pie "summarize this file" --raw-output
156
+ pie "summarize this file" --json-output
157
+ pie "continue previous task" --session-id my-session
158
+ ```
122
159
 
123
- | 快捷键 | 说明 |
124
- |--------|------|
125
- | `Enter` | 发送消息 |
126
- | `Shift+Enter` | 换行(需 CSI u 支持) |
127
- | `Ctrl+C` (按一次) | 清空编辑器 |
128
- | `Ctrl+C` (快速按两次) | 退出 |
129
- | `ESC` | 取消 / 返回上一级 |
130
- | `/` | 显示命令菜单 |
160
+ ## Terminal Notes
131
161
 
132
- ## 终端要求
162
+ For the best multiline editing experience, use a terminal with good modified-key support, such as:
133
163
 
134
- 对于完整的按键支持(Shift/Ctrl+Enter),推荐使用:
135
164
  - [Kitty](https://sw.kovidgoyal.net/kitty/)
136
- - [iTerm2](https://iterm2.com/)(启用 "Report modifier keys using CSI u")
165
+ - [iTerm2](https://iterm2.com/)
137
166
  - [Ghostty](https://ghostty.org/)
138
167
 
139
- ## 开发
168
+ ## Development
140
169
 
141
170
  ```bash
142
171
  cd products/cli
143
172
  npm install
144
173
  npm run build
145
- npm test
174
+ npm run test:offline
146
175
  ```
147
176
 
148
- ## 许可证
177
+ ## License
149
178
 
150
179
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "0.1.1",
3
+ "version": "1.0.1",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,8 +12,9 @@
12
12
  "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
13
13
  "start": "node dist/cli.js",
14
14
  "test": "npm run test:offline",
15
- "test:offline": "node --test --import tsx test/hierarchical-command-system.test.ts test/message-queue-unit.test.ts test/mention-file-select.terminal.test.ts test/tool-partial-display.terminal.test.ts test/viewport-position-final.test.ts",
16
- "test:integration": "node --test --import tsx test/cli.test.ts test/file-upload-test.terminal.test.ts test/human-simulation.test.ts test/interactive-integration.test.ts test/pie-cli.terminal.test.ts test/txt-upload-test.terminal.test.ts",
15
+ "test:offline": "node --test --import tsx test/core-services.test.ts test/cli.test.ts test/attachment-resolver.test.ts test/kimi-attachment-extension.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/hierarchical-command-system.test.ts test/message-queue-unit.test.ts test/mention-file-select.terminal.test.ts test/tool-partial-display.terminal.test.ts test/viewport-position-final.test.ts",
16
+ "test:kimi-smoke": "node scripts/kimi-attachment-smoke.mjs",
17
+ "test:integration": "node --test --import tsx test/cli.test.ts test/compact-e2e.test.ts test/file-upload-test.terminal.test.ts test/human-simulation.test.ts test/interactive-integration.test.ts test/pie-cli.terminal.test.ts test/txt-upload-test.terminal.test.ts",
17
18
  "test:fixes": "tsx test-fixes.ts",
18
19
  "pack:check": "npm pack --dry-run"
19
20
  },