workspacecord 1.0.2
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 +21 -0
- package/README.md +190 -0
- package/README.zh-CN.md +190 -0
- package/dist/bot-B5HN4ZW6.js +6710 -0
- package/dist/chunk-2LBNM64L.js +84 -0
- package/dist/chunk-K3NQKI34.js +10 -0
- package/dist/chunk-NIXZJTOZ.js +175 -0
- package/dist/chunk-OKI4UVGY.js +221 -0
- package/dist/chunk-TSBM3BNT.js +1224 -0
- package/dist/chunk-WE4X3JB3.js +130 -0
- package/dist/cli.js +71 -0
- package/dist/codex-launcher-IF2IPLBP.js +132 -0
- package/dist/codex-provider-7CI5W34X.js +304 -0
- package/dist/config-cli-F2B5SYHJ.js +120 -0
- package/dist/daemon-NW4WRMQK.js +252 -0
- package/dist/project-cli-FEMPZIRQ.js +121 -0
- package/dist/project-registry-DQT5ORUU.js +32 -0
- package/dist/setup-TKOVXSME.js +262 -0
- package/dist/thread-manager-5T46QTZF.js +78 -0
- package/dist/utils-72GMT2X5.js +36 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xuhongbo and workspacecord contributors
|
|
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,190 @@
|
|
|
1
|
+
# workspacecord
|
|
2
|
+
|
|
3
|
+
[](https://github.com/xuhongbo/WorkspaceCord/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/workspacecord)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
|
|
8
|
+
> Run and manage multi-agent coding sessions from Discord, backed by local projects on your machine.
|
|
9
|
+
|
|
10
|
+
[简体中文说明](./README.zh-CN.md)
|
|
11
|
+
|
|
12
|
+
> Repository name: `workspacecord`
|
|
13
|
+
> CLI/package name: `workspacecord`
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`workspacecord` maps Discord structures to local development workflows:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Discord Server
|
|
21
|
+
└─ Category = Project
|
|
22
|
+
├─ #history (Forum) = Archived Sessions
|
|
23
|
+
└─ #claude-fix-login = Main Agent Session
|
|
24
|
+
└─ [sub:codex] benchmark = Subagent Thread
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- A `Category` represents one mounted local project.
|
|
28
|
+
- A `TextChannel` represents a main agent session.
|
|
29
|
+
- A `Thread` represents a subagent.
|
|
30
|
+
- The `#history` forum stores archived sessions.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- Explicit local project mounting with `workspacecord project init`
|
|
35
|
+
- Discord-side project binding with `/project setup`
|
|
36
|
+
- Main session channels and subagent threads
|
|
37
|
+
- Session archiving into `#history`
|
|
38
|
+
- Support for both Claude and Codex providers
|
|
39
|
+
- Global config storage without requiring a project-local `.env`
|
|
40
|
+
- Optional daemon install and background management
|
|
41
|
+
|
|
42
|
+
## Requirements
|
|
43
|
+
|
|
44
|
+
- `Node >= 22.6.0`
|
|
45
|
+
- `pnpm`
|
|
46
|
+
- A Discord application, bot token, client ID, and guild ID
|
|
47
|
+
|
|
48
|
+
## File Locations
|
|
49
|
+
|
|
50
|
+
- **Config**: `~/.config/workspacecord/config.json` - Global configuration
|
|
51
|
+
- **Data**: `~/.workspacecord/` - Projects, sessions, and logs
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm install
|
|
57
|
+
pnpm build
|
|
58
|
+
pnpm link --global
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
After linking, you can use either the full command or the short alias:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
workspacecord # Full command
|
|
65
|
+
wsc # Short alias
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### 1. Configure global credentials
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
workspacecord config setup
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or set values directly:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
workspacecord config set DISCORD_TOKEN <token>
|
|
80
|
+
workspacecord config set DISCORD_CLIENT_ID <client-id>
|
|
81
|
+
workspacecord config set DISCORD_GUILD_ID <guild-id>
|
|
82
|
+
workspacecord config set ALLOW_ALL_USERS true
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Mount a local project
|
|
86
|
+
|
|
87
|
+
Run inside your project directory:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
workspacecord project init --name my-project
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. Start the bot
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
workspacecord
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. Bind the Discord category to the mounted project
|
|
100
|
+
|
|
101
|
+
Run this in the text channel you want to use as the dedicated control channel for new sessions:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
/project setup project:my-project
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If successful, `workspacecord` creates or reuses the `#history` forum automatically and records the current channel as the control channel for `/agent spawn`.
|
|
108
|
+
|
|
109
|
+
## Commands
|
|
110
|
+
|
|
111
|
+
### Local CLI
|
|
112
|
+
|
|
113
|
+
**Config Management:**
|
|
114
|
+
```bash
|
|
115
|
+
workspacecord config setup # Interactive configuration wizard
|
|
116
|
+
workspacecord config get <key> # Read a configuration value
|
|
117
|
+
workspacecord config set <key> <value> # Write a configuration value
|
|
118
|
+
workspacecord config list # List all configuration values
|
|
119
|
+
workspacecord config path # Show the config file path
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Project Management:**
|
|
123
|
+
```bash
|
|
124
|
+
workspacecord project init [--name <name>] # Mount current directory as a project
|
|
125
|
+
workspacecord project list # List all mounted projects
|
|
126
|
+
workspacecord project info # Show current project info
|
|
127
|
+
workspacecord project rename <new-name> # Rename current project
|
|
128
|
+
workspacecord project remove # Unmount current project
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Daemon Management:**
|
|
132
|
+
```bash
|
|
133
|
+
workspacecord daemon install # Install as system daemon (auto-start on boot)
|
|
134
|
+
workspacecord daemon uninstall # Uninstall daemon (alias: remove)
|
|
135
|
+
workspacecord daemon status # Check daemon status
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Advanced:**
|
|
139
|
+
```bash
|
|
140
|
+
workspacecord codex [options] # Launch managed Codex session with remote approval
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Note:** All commands support the short alias `wsc`. For example: `wsc config list`
|
|
144
|
+
|
|
145
|
+
### Discord Slash Commands
|
|
146
|
+
|
|
147
|
+
- `/project setup` — bind the current category to a mounted project and mark the current channel as the control channel
|
|
148
|
+
- `/project info` — inspect project binding details
|
|
149
|
+
- `/agent spawn` — create a main agent session channel from the project control channel
|
|
150
|
+
- `/agent archive` — archive the current session into `#history`
|
|
151
|
+
- `/agent mode` / `/agent goal` / `/agent persona` / `/agent model`
|
|
152
|
+
- `/subagent run` — create a subagent thread under the current session
|
|
153
|
+
- `/subagent list` — list subagents for the current session
|
|
154
|
+
- `/shell run` / `/shell processes` / `/shell kill`
|
|
155
|
+
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
Run the standard verification flow:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
pnpm typecheck
|
|
162
|
+
pnpm build
|
|
163
|
+
pnpm test
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Additional scripts:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pnpm test:integration:smoke
|
|
170
|
+
pnpm test:multi-session:smoke
|
|
171
|
+
pnpm test:session-sync:smoke
|
|
172
|
+
pnpm test:monitor:e2e
|
|
173
|
+
pnpm test:acceptance:local
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
See also: [`docs/ACCEPTANCE.md`](./docs/ACCEPTANCE.md)
|
|
177
|
+
|
|
178
|
+
## Contributing
|
|
179
|
+
|
|
180
|
+
We welcome contributions! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
|
|
185
|
+
|
|
186
|
+
## Acknowledgments
|
|
187
|
+
|
|
188
|
+
This project was inspired by:
|
|
189
|
+
- [agentcord](https://github.com/radu2lupu/agentcord) - Discord integration for AI agents
|
|
190
|
+
- [clawd-on-desk](https://github.com/rullerzhou-afk/clawd-on-desk) - Claude desktop integration
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# workspacecord
|
|
2
|
+
|
|
3
|
+
[](https://github.com/xuhongbo/WorkspaceCord/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/workspacecord)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
|
|
8
|
+
> 通过 Discord 在本机项目上运行和管理多代理编程会话。
|
|
9
|
+
|
|
10
|
+
[English README](./README.md)
|
|
11
|
+
|
|
12
|
+
> 仓库名:`workspacecord`
|
|
13
|
+
> 命令行与包名:`workspacecord`
|
|
14
|
+
|
|
15
|
+
## 概览
|
|
16
|
+
|
|
17
|
+
`workspacecord` 把 Discord 结构映射到本地开发流程:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Discord Server
|
|
21
|
+
└─ Category = Project
|
|
22
|
+
├─ #history (Forum) = Archived Sessions
|
|
23
|
+
└─ #claude-fix-login = Main Agent Session
|
|
24
|
+
└─ [sub:codex] benchmark = Subagent Thread
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- `Category` 表示一个已挂载的本地项目。
|
|
28
|
+
- `TextChannel` 表示一个主代理会话。
|
|
29
|
+
- `Thread` 表示一个子代理。
|
|
30
|
+
- `#history` Forum 用于存放归档会话。
|
|
31
|
+
|
|
32
|
+
## 特性
|
|
33
|
+
|
|
34
|
+
- 使用 `workspacecord project init` 显式挂载本地项目
|
|
35
|
+
- 使用 `/project setup` 在 Discord 中绑定项目
|
|
36
|
+
- 主会话频道与子代理线程模型
|
|
37
|
+
- 会话自动归档到 `#history`
|
|
38
|
+
- 同时支持 Claude 与 Codex 提供方
|
|
39
|
+
- 使用全局配置存储,不依赖项目内 `.env`
|
|
40
|
+
- 支持守护进程安装与后台管理
|
|
41
|
+
|
|
42
|
+
## 环境要求
|
|
43
|
+
|
|
44
|
+
- `Node >= 22.6.0`
|
|
45
|
+
- `pnpm`
|
|
46
|
+
- 一个可用的 Discord 应用、机器人令牌、客户端编号与服务器编号
|
|
47
|
+
|
|
48
|
+
## 文件位置
|
|
49
|
+
|
|
50
|
+
- **配置文件**: `~/.config/workspacecord/config.json` - 全局配置
|
|
51
|
+
- **数据目录**: `~/.workspacecord/` - 项目、会话和日志
|
|
52
|
+
|
|
53
|
+
## 安装
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm install
|
|
57
|
+
pnpm build
|
|
58
|
+
pnpm link --global
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
安装后可使用全局命令或短别名:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
workspacecord # 完整命令
|
|
65
|
+
wsc # 短别名
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 快速开始
|
|
69
|
+
|
|
70
|
+
### 1. 配置全局凭据
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
workspacecord config setup
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
也可以直接写入:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
workspacecord config set DISCORD_TOKEN <token>
|
|
80
|
+
workspacecord config set DISCORD_CLIENT_ID <client-id>
|
|
81
|
+
workspacecord config set DISCORD_GUILD_ID <guild-id>
|
|
82
|
+
workspacecord config set ALLOW_ALL_USERS true
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. 挂载本地项目
|
|
86
|
+
|
|
87
|
+
在目标项目目录中执行:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
workspacecord project init --name my-project
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. 启动机器人
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
workspacecord
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. 在 Discord 中绑定项目
|
|
100
|
+
|
|
101
|
+
在目标 Category 下你希望作为“新会话控制频道”的那个文本频道执行:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
/project setup project:my-project
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
绑定成功后会自动创建或复用 `#history` Forum,并把当前频道记录为 `/agent spawn` 的专用控制频道。
|
|
108
|
+
|
|
109
|
+
## 主要命令
|
|
110
|
+
|
|
111
|
+
### 本地 CLI
|
|
112
|
+
|
|
113
|
+
**配置管理:**
|
|
114
|
+
```bash
|
|
115
|
+
workspacecord config setup # 交互式配置向导
|
|
116
|
+
workspacecord config get <key> # 读取配置值
|
|
117
|
+
workspacecord config set <key> <value> # 写入配置值
|
|
118
|
+
workspacecord config list # 列出所有配置
|
|
119
|
+
workspacecord config path # 显示配置文件路径
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**项目管理:**
|
|
123
|
+
```bash
|
|
124
|
+
workspacecord project init [--name <name>] # 将当前目录挂载为项目
|
|
125
|
+
workspacecord project list # 列出所有已挂载项目
|
|
126
|
+
workspacecord project info # 显示当前项目信息
|
|
127
|
+
workspacecord project rename <new-name> # 重命名当前项目
|
|
128
|
+
workspacecord project remove # 卸载当前项目
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**守护进程管理:**
|
|
132
|
+
```bash
|
|
133
|
+
workspacecord daemon install # 安装为系统守护进程(开机自启)
|
|
134
|
+
workspacecord daemon uninstall # 卸载守护进程(别名:remove)
|
|
135
|
+
workspacecord daemon status # 查看守护进程状态
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**高级功能:**
|
|
139
|
+
```bash
|
|
140
|
+
workspacecord codex [options] # 启动托管的 Codex 会话(支持远程审批)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**注意:** 所有命令都支持短别名 `wsc`。例如:`wsc config list`
|
|
144
|
+
|
|
145
|
+
### Discord Slash Commands
|
|
146
|
+
|
|
147
|
+
- `/project setup`:把当前 Category 绑定到已挂载项目,并把当前频道设为控制频道
|
|
148
|
+
- `/project info`:查看项目绑定信息
|
|
149
|
+
- `/agent spawn`:在项目控制频道中创建主代理会话频道
|
|
150
|
+
- `/agent archive`:把当前会话归档到 `#history`
|
|
151
|
+
- `/agent mode` / `/agent goal` / `/agent persona` / `/agent model`
|
|
152
|
+
- `/subagent run`:在当前主会话下创建子代理线程
|
|
153
|
+
- `/subagent list`:查看当前会话的子代理
|
|
154
|
+
- `/shell run` / `/shell processes` / `/shell kill`
|
|
155
|
+
|
|
156
|
+
## 开发与验证
|
|
157
|
+
|
|
158
|
+
建议先运行基础验证:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
pnpm typecheck
|
|
162
|
+
pnpm build
|
|
163
|
+
pnpm test
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
更多脚本:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pnpm test:integration:smoke
|
|
170
|
+
pnpm test:multi-session:smoke
|
|
171
|
+
pnpm test:session-sync:smoke
|
|
172
|
+
pnpm test:monitor:e2e
|
|
173
|
+
pnpm test:acceptance:local
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
另见:[`docs/ACCEPTANCE.md`](./docs/ACCEPTANCE.md)
|
|
177
|
+
|
|
178
|
+
## 贡献
|
|
179
|
+
|
|
180
|
+
欢迎贡献!请阅读 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解行为准则和提交流程。
|
|
181
|
+
|
|
182
|
+
## 许可证
|
|
183
|
+
|
|
184
|
+
本项目采用 MIT 许可证 - 详见 [LICENSE](./LICENSE) 文件。
|
|
185
|
+
|
|
186
|
+
## 致谢
|
|
187
|
+
|
|
188
|
+
本项目受以下项目启发:
|
|
189
|
+
- [agentcord](https://github.com/radu2lupu/agentcord) - AI 代理的 Discord 集成
|
|
190
|
+
- [clawd-on-desk](https://github.com/rullerzhou-afk/clawd-on-desk) - Claude 桌面集成
|