agent-workspace-desktop 0.1.0__tar.gz
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.
- agent_workspace_desktop-0.1.0/LICENSE +21 -0
- agent_workspace_desktop-0.1.0/MANIFEST.in +7 -0
- agent_workspace_desktop-0.1.0/PKG-INFO +146 -0
- agent_workspace_desktop-0.1.0/README.md +119 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/PKG-INFO +146 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/SOURCES.txt +37 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/dependency_links.txt +1 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/entry_points.txt +2 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/requires.txt +4 -0
- agent_workspace_desktop-0.1.0/agent_workspace_desktop.egg-info/top_level.txt +1 -0
- agent_workspace_desktop-0.1.0/agentworkspace/__init__.py +8 -0
- agent_workspace_desktop-0.1.0/agentworkspace/assets/icon.ico +0 -0
- agent_workspace_desktop-0.1.0/agentworkspace/assets/make_icon.py +215 -0
- agent_workspace_desktop-0.1.0/agentworkspace/assistant.py +34 -0
- agent_workspace_desktop-0.1.0/agentworkspace/devtools.py +124 -0
- agent_workspace_desktop-0.1.0/agentworkspace/kernel.py +781 -0
- agent_workspace_desktop-0.1.0/agentworkspace/link.py +535 -0
- agent_workspace_desktop-0.1.0/agentworkspace/main.py +270 -0
- agent_workspace_desktop-0.1.0/agentworkspace/native.py +148 -0
- agent_workspace_desktop-0.1.0/agentworkspace/qa.py +568 -0
- agent_workspace_desktop-0.1.0/agentworkspace/sdk.py +133 -0
- agent_workspace_desktop-0.1.0/agentworkspace/selftest.py +577 -0
- agent_workspace_desktop-0.1.0/agentworkspace/server.py +290 -0
- agent_workspace_desktop-0.1.0/agentworkspace/settings.py +113 -0
- agent_workspace_desktop-0.1.0/agentworkspace/shell.py +115 -0
- agent_workspace_desktop-0.1.0/agentworkspace/toolbox.py +473 -0
- agent_workspace_desktop-0.1.0/agentworkspace/uiprobe.py +357 -0
- agent_workspace_desktop-0.1.0/agentworkspace/web/index.html +715 -0
- agent_workspace_desktop-0.1.0/agentworkspace/winicon.py +300 -0
- agent_workspace_desktop-0.1.0/docs/agent-per-program.md +73 -0
- agent_workspace_desktop-0.1.0/docs/code-review.md +213 -0
- agent_workspace_desktop-0.1.0/docs/desktop-workspace-plan.md +201 -0
- agent_workspace_desktop-0.1.0/docs/dev-mode.md +136 -0
- agent_workspace_desktop-0.1.0/docs/plugin-mechanism.md +281 -0
- agent_workspace_desktop-0.1.0/docs/settings-and-icon.md +122 -0
- agent_workspace_desktop-0.1.0/docs/shell-and-native.md +171 -0
- agent_workspace_desktop-0.1.0/docs/vision.md +243 -0
- agent_workspace_desktop-0.1.0/pyproject.toml +49 -0
- agent_workspace_desktop-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agent Workspace 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.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-workspace-desktop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 桌面 Agent 工作区内核:一个目录约定、一条 dispatch、一条事件流、一份能力面
|
|
5
|
+
Author: Agent Workspace contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/YY-Yifei/agent-workspace
|
|
8
|
+
Project-URL: Source, https://github.com/YY-Yifei/agent-workspace
|
|
9
|
+
Project-URL: Issues, https://github.com/YY-Yifei/agent-workspace/issues
|
|
10
|
+
Keywords: agent,aaas,desktop,pywebview,workspace,plugins
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Win32 (MS Windows)
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: aaas>=0.3.0
|
|
24
|
+
Provides-Extra: gui
|
|
25
|
+
Requires-Dist: pywebview>=5.0; extra == "gui"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# Agent Workspace
|
|
29
|
+
|
|
30
|
+
桌面上的 **Agent 工作区**:用户攒程序(番茄钟、心情日记、记账…),每个程序都有自己的助手;
|
|
31
|
+
智能全在远端 `aaas-service`,本进程只做四件事 —— **落盘、执行被点名的那一个、广播、传话**。
|
|
32
|
+
|
|
33
|
+
> **内核不含一克智能。** 它不选工具、不决定下一步、不重试、不兜底。
|
|
34
|
+
> 判据:本仓库里出现的每个分支,都只回答「参数/状态是否合法」,不回答「接下来做什么」。
|
|
35
|
+
|
|
36
|
+
## 谱系
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
道 = Agent(aaas-service,唯一的智能,不在本进程)
|
|
40
|
+
一 = 内核(本仓库 agentworkspace/:一个目录约定、一条 dispatch、一条事件流、一份能力面)
|
|
41
|
+
二 = 双入口(人走本地 HTTP,agent 走 invokeFunction,落到同一个 dispatch)
|
|
42
|
+
三 = 程序三要素(backend.py 能力 / ui 页面 / data 状态)
|
|
43
|
+
万物 = 工作区(用户攒出来的程序)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
七个模块,各管一件事:
|
|
47
|
+
|
|
48
|
+
| 文件 | 它是谁 |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `kernel.py` | **一**:目录约定 / 唯一 `dispatch()` / 事件总线 / 能力面(按 pid 隔离) |
|
|
51
|
+
| `link.py` | **道**:aaas 接线(connect / declare / send / 转发被点名的那一个),每个程序一条会话 |
|
|
52
|
+
| `server.py` | **二之一**:人的门(本地 HTTP + SSE) |
|
|
53
|
+
| `shell.py` | 窗口壳:pywebview(`--browser` 是它的退化形态) |
|
|
54
|
+
| `native.py` | 原生程序宿主:不是第二条执行路径,是「人的门」的第三种壳 |
|
|
55
|
+
| `main.py` | 入口:装配,没有第四样东西 |
|
|
56
|
+
| `web/index.html` | 工作区视图 + 对话 + 能力面板(单文件,无构建步骤) |
|
|
57
|
+
|
|
58
|
+
配套:`settings.py`(唯一一项设置:aaas-service 地址)、`devtools.py`(开发者模式那双手)、
|
|
59
|
+
`assistant.py`(内核唯一内置的程序:小助理)、`toolbox.py`(小助理的手)、
|
|
60
|
+
`selftest.py` / `qa.py` / `uiprobe.py`(三层的自检:逻辑 / 真窗口 / 真浏览器)。
|
|
61
|
+
|
|
62
|
+
## 装
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install agent-workspace-desktop # 内核 + aaas 客户端
|
|
66
|
+
pip install "agent-workspace-desktop[gui]" # 再带上桌面窗口(pywebview)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
需要 Python 3.10+,以及一个能连上的 `aaas-service`(地址在设置里改,默认 `ws://localhost:8888`)。
|
|
70
|
+
|
|
71
|
+
## 跑
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
agent-workspace # 桌面窗口
|
|
75
|
+
agent-workspace --browser # 换成浏览器(pywebview 起不来时的形态)
|
|
76
|
+
agent-workspace --cli # 命令行:跟小助理说一句
|
|
77
|
+
agent-workspace --cli -m "做个番茄钟" # 同上
|
|
78
|
+
agent-workspace --cli --as pomodoro -m "开始 25 分钟" # 跟某个程序自己的助手说
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`--cli` 是验收形态:`connect → declare → sendInput → invokeFunction → 本地执行 →
|
|
82
|
+
functionResult → 模型续写 → turn.completed`。这条不通,界面做得再漂亮也是空壳。
|
|
83
|
+
|
|
84
|
+
## 工作区长什么样
|
|
85
|
+
|
|
86
|
+
工作区(默认 `./workspace`,可用 `--workspace` 换)是**运行时**,不在本仓库里:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
workspace/
|
|
90
|
+
plugins/<pid>/ 程序:plugin.json + backend.py + ui/index.html + data/store.json
|
|
91
|
+
logs/events.jsonl 谁做了什么、谁点的(事件流)
|
|
92
|
+
prompts/ 每个程序的指令
|
|
93
|
+
config.json 设置(只有一项:aaas-service 地址)
|
|
94
|
+
dev.json 开发者模式开关(**只属于人**:程序写它一律被拒)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
内核**没有任何内置的领域能力**:番茄钟、日记、记账都是工作区里长出来的程序,
|
|
98
|
+
所以它们**不在这个仓库里** —— 这里只有内核。
|
|
99
|
+
|
|
100
|
+
## 契约(写程序的人关心这几条)
|
|
101
|
+
|
|
102
|
+
1. 公开函数 = 能力;`_` 前缀 = 私有;wire name = `<pid>_<fn>`
|
|
103
|
+
2. 约束只写一处:`Annotated[int, {"minimum": 1}]` → schema / 表单 / 校验同源
|
|
104
|
+
3. 双面返回:dict 含 `"text"` → 文本给模型,其余进 `data` 给界面
|
|
105
|
+
4. 状态走 `ctx.get/set` → `data/store.json`(代码目录与数据目录分离)
|
|
106
|
+
5. 事件总线:`call.ok` / `call.error` / `call.rejected` / `state.changed`
|
|
107
|
+
|
|
108
|
+
隔离只写一处:`Runtime.capabilities_of(pid)`。别的程序在结构上就**拿不到** `plugin_write`。
|
|
109
|
+
|
|
110
|
+
## 开发者模式
|
|
111
|
+
|
|
112
|
+
一个开关(设置面板里拨),打开后当前程序多拿到一把**只够改自己**的手:
|
|
113
|
+
|
|
114
|
+
| 有 | 没有 |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `dev_tree` / `dev_read` / `dev_search` | `plugin_list`(「有哪些程序」本身就是权限地图) |
|
|
117
|
+
| `dev_write`(普通文件) | `plugin_call`(能绕开别人的隔离) |
|
|
118
|
+
| `dev_plugin_write`(**没有 pid 参数**) | `plugin_delete` / `shell` |
|
|
119
|
+
|
|
120
|
+
想改别人,在**签名**上就无从下手;`dev.json` 由人掌握,程序写它一律被拒。
|
|
121
|
+
细节见 [`docs/dev-mode.md`](docs/dev-mode.md)。
|
|
122
|
+
|
|
123
|
+
## 自检
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python -m agentworkspace.selftest # 逻辑层(内存里跑完整链路)
|
|
127
|
+
python -m agentworkspace.qa all # 真窗口
|
|
128
|
+
python -m agentworkspace.uiprobe # 真浏览器(拖动 / 折叠 / 设置 / 图标)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
三层缺一不可:`selftest` 只能断言「文件里有这行字」,CSS 优先级、事件绑定、
|
|
132
|
+
重绘时机任何一处错了都拦不住 —— 那要靠后两层。
|
|
133
|
+
|
|
134
|
+
## 文档
|
|
135
|
+
|
|
136
|
+
- [`docs/vision.md`](docs/vision.md) —— 道 / 一 / 二 / 三 / 万物
|
|
137
|
+
- [`docs/desktop-workspace-plan.md`](docs/desktop-workspace-plan.md) —— 方案与三层分界
|
|
138
|
+
- [`docs/plugin-mechanism.md`](docs/plugin-mechanism.md) —— 程序三要素与契约五条
|
|
139
|
+
- [`docs/agent-per-program.md`](docs/agent-per-program.md) —— 每个程序一个智能体
|
|
140
|
+
- [`docs/dev-mode.md`](docs/dev-mode.md) —— 开发者模式的边界
|
|
141
|
+
- [`docs/settings-and-icon.md`](docs/settings-and-icon.md) —— 设置与窗口图标
|
|
142
|
+
- [`docs/shell-and-native.md`](docs/shell-and-native.md) —— 窗口壳与原生程序
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Agent Workspace
|
|
2
|
+
|
|
3
|
+
桌面上的 **Agent 工作区**:用户攒程序(番茄钟、心情日记、记账…),每个程序都有自己的助手;
|
|
4
|
+
智能全在远端 `aaas-service`,本进程只做四件事 —— **落盘、执行被点名的那一个、广播、传话**。
|
|
5
|
+
|
|
6
|
+
> **内核不含一克智能。** 它不选工具、不决定下一步、不重试、不兜底。
|
|
7
|
+
> 判据:本仓库里出现的每个分支,都只回答「参数/状态是否合法」,不回答「接下来做什么」。
|
|
8
|
+
|
|
9
|
+
## 谱系
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
道 = Agent(aaas-service,唯一的智能,不在本进程)
|
|
13
|
+
一 = 内核(本仓库 agentworkspace/:一个目录约定、一条 dispatch、一条事件流、一份能力面)
|
|
14
|
+
二 = 双入口(人走本地 HTTP,agent 走 invokeFunction,落到同一个 dispatch)
|
|
15
|
+
三 = 程序三要素(backend.py 能力 / ui 页面 / data 状态)
|
|
16
|
+
万物 = 工作区(用户攒出来的程序)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
七个模块,各管一件事:
|
|
20
|
+
|
|
21
|
+
| 文件 | 它是谁 |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `kernel.py` | **一**:目录约定 / 唯一 `dispatch()` / 事件总线 / 能力面(按 pid 隔离) |
|
|
24
|
+
| `link.py` | **道**:aaas 接线(connect / declare / send / 转发被点名的那一个),每个程序一条会话 |
|
|
25
|
+
| `server.py` | **二之一**:人的门(本地 HTTP + SSE) |
|
|
26
|
+
| `shell.py` | 窗口壳:pywebview(`--browser` 是它的退化形态) |
|
|
27
|
+
| `native.py` | 原生程序宿主:不是第二条执行路径,是「人的门」的第三种壳 |
|
|
28
|
+
| `main.py` | 入口:装配,没有第四样东西 |
|
|
29
|
+
| `web/index.html` | 工作区视图 + 对话 + 能力面板(单文件,无构建步骤) |
|
|
30
|
+
|
|
31
|
+
配套:`settings.py`(唯一一项设置:aaas-service 地址)、`devtools.py`(开发者模式那双手)、
|
|
32
|
+
`assistant.py`(内核唯一内置的程序:小助理)、`toolbox.py`(小助理的手)、
|
|
33
|
+
`selftest.py` / `qa.py` / `uiprobe.py`(三层的自检:逻辑 / 真窗口 / 真浏览器)。
|
|
34
|
+
|
|
35
|
+
## 装
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install agent-workspace-desktop # 内核 + aaas 客户端
|
|
39
|
+
pip install "agent-workspace-desktop[gui]" # 再带上桌面窗口(pywebview)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
需要 Python 3.10+,以及一个能连上的 `aaas-service`(地址在设置里改,默认 `ws://localhost:8888`)。
|
|
43
|
+
|
|
44
|
+
## 跑
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
agent-workspace # 桌面窗口
|
|
48
|
+
agent-workspace --browser # 换成浏览器(pywebview 起不来时的形态)
|
|
49
|
+
agent-workspace --cli # 命令行:跟小助理说一句
|
|
50
|
+
agent-workspace --cli -m "做个番茄钟" # 同上
|
|
51
|
+
agent-workspace --cli --as pomodoro -m "开始 25 分钟" # 跟某个程序自己的助手说
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`--cli` 是验收形态:`connect → declare → sendInput → invokeFunction → 本地执行 →
|
|
55
|
+
functionResult → 模型续写 → turn.completed`。这条不通,界面做得再漂亮也是空壳。
|
|
56
|
+
|
|
57
|
+
## 工作区长什么样
|
|
58
|
+
|
|
59
|
+
工作区(默认 `./workspace`,可用 `--workspace` 换)是**运行时**,不在本仓库里:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
workspace/
|
|
63
|
+
plugins/<pid>/ 程序:plugin.json + backend.py + ui/index.html + data/store.json
|
|
64
|
+
logs/events.jsonl 谁做了什么、谁点的(事件流)
|
|
65
|
+
prompts/ 每个程序的指令
|
|
66
|
+
config.json 设置(只有一项:aaas-service 地址)
|
|
67
|
+
dev.json 开发者模式开关(**只属于人**:程序写它一律被拒)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
内核**没有任何内置的领域能力**:番茄钟、日记、记账都是工作区里长出来的程序,
|
|
71
|
+
所以它们**不在这个仓库里** —— 这里只有内核。
|
|
72
|
+
|
|
73
|
+
## 契约(写程序的人关心这几条)
|
|
74
|
+
|
|
75
|
+
1. 公开函数 = 能力;`_` 前缀 = 私有;wire name = `<pid>_<fn>`
|
|
76
|
+
2. 约束只写一处:`Annotated[int, {"minimum": 1}]` → schema / 表单 / 校验同源
|
|
77
|
+
3. 双面返回:dict 含 `"text"` → 文本给模型,其余进 `data` 给界面
|
|
78
|
+
4. 状态走 `ctx.get/set` → `data/store.json`(代码目录与数据目录分离)
|
|
79
|
+
5. 事件总线:`call.ok` / `call.error` / `call.rejected` / `state.changed`
|
|
80
|
+
|
|
81
|
+
隔离只写一处:`Runtime.capabilities_of(pid)`。别的程序在结构上就**拿不到** `plugin_write`。
|
|
82
|
+
|
|
83
|
+
## 开发者模式
|
|
84
|
+
|
|
85
|
+
一个开关(设置面板里拨),打开后当前程序多拿到一把**只够改自己**的手:
|
|
86
|
+
|
|
87
|
+
| 有 | 没有 |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `dev_tree` / `dev_read` / `dev_search` | `plugin_list`(「有哪些程序」本身就是权限地图) |
|
|
90
|
+
| `dev_write`(普通文件) | `plugin_call`(能绕开别人的隔离) |
|
|
91
|
+
| `dev_plugin_write`(**没有 pid 参数**) | `plugin_delete` / `shell` |
|
|
92
|
+
|
|
93
|
+
想改别人,在**签名**上就无从下手;`dev.json` 由人掌握,程序写它一律被拒。
|
|
94
|
+
细节见 [`docs/dev-mode.md`](docs/dev-mode.md)。
|
|
95
|
+
|
|
96
|
+
## 自检
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
python -m agentworkspace.selftest # 逻辑层(内存里跑完整链路)
|
|
100
|
+
python -m agentworkspace.qa all # 真窗口
|
|
101
|
+
python -m agentworkspace.uiprobe # 真浏览器(拖动 / 折叠 / 设置 / 图标)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
三层缺一不可:`selftest` 只能断言「文件里有这行字」,CSS 优先级、事件绑定、
|
|
105
|
+
重绘时机任何一处错了都拦不住 —— 那要靠后两层。
|
|
106
|
+
|
|
107
|
+
## 文档
|
|
108
|
+
|
|
109
|
+
- [`docs/vision.md`](docs/vision.md) —— 道 / 一 / 二 / 三 / 万物
|
|
110
|
+
- [`docs/desktop-workspace-plan.md`](docs/desktop-workspace-plan.md) —— 方案与三层分界
|
|
111
|
+
- [`docs/plugin-mechanism.md`](docs/plugin-mechanism.md) —— 程序三要素与契约五条
|
|
112
|
+
- [`docs/agent-per-program.md`](docs/agent-per-program.md) —— 每个程序一个智能体
|
|
113
|
+
- [`docs/dev-mode.md`](docs/dev-mode.md) —— 开发者模式的边界
|
|
114
|
+
- [`docs/settings-and-icon.md`](docs/settings-and-icon.md) —— 设置与窗口图标
|
|
115
|
+
- [`docs/shell-and-native.md`](docs/shell-and-native.md) —— 窗口壳与原生程序
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-workspace-desktop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 桌面 Agent 工作区内核:一个目录约定、一条 dispatch、一条事件流、一份能力面
|
|
5
|
+
Author: Agent Workspace contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/YY-Yifei/agent-workspace
|
|
8
|
+
Project-URL: Source, https://github.com/YY-Yifei/agent-workspace
|
|
9
|
+
Project-URL: Issues, https://github.com/YY-Yifei/agent-workspace/issues
|
|
10
|
+
Keywords: agent,aaas,desktop,pywebview,workspace,plugins
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Win32 (MS Windows)
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: aaas>=0.3.0
|
|
24
|
+
Provides-Extra: gui
|
|
25
|
+
Requires-Dist: pywebview>=5.0; extra == "gui"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# Agent Workspace
|
|
29
|
+
|
|
30
|
+
桌面上的 **Agent 工作区**:用户攒程序(番茄钟、心情日记、记账…),每个程序都有自己的助手;
|
|
31
|
+
智能全在远端 `aaas-service`,本进程只做四件事 —— **落盘、执行被点名的那一个、广播、传话**。
|
|
32
|
+
|
|
33
|
+
> **内核不含一克智能。** 它不选工具、不决定下一步、不重试、不兜底。
|
|
34
|
+
> 判据:本仓库里出现的每个分支,都只回答「参数/状态是否合法」,不回答「接下来做什么」。
|
|
35
|
+
|
|
36
|
+
## 谱系
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
道 = Agent(aaas-service,唯一的智能,不在本进程)
|
|
40
|
+
一 = 内核(本仓库 agentworkspace/:一个目录约定、一条 dispatch、一条事件流、一份能力面)
|
|
41
|
+
二 = 双入口(人走本地 HTTP,agent 走 invokeFunction,落到同一个 dispatch)
|
|
42
|
+
三 = 程序三要素(backend.py 能力 / ui 页面 / data 状态)
|
|
43
|
+
万物 = 工作区(用户攒出来的程序)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
七个模块,各管一件事:
|
|
47
|
+
|
|
48
|
+
| 文件 | 它是谁 |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `kernel.py` | **一**:目录约定 / 唯一 `dispatch()` / 事件总线 / 能力面(按 pid 隔离) |
|
|
51
|
+
| `link.py` | **道**:aaas 接线(connect / declare / send / 转发被点名的那一个),每个程序一条会话 |
|
|
52
|
+
| `server.py` | **二之一**:人的门(本地 HTTP + SSE) |
|
|
53
|
+
| `shell.py` | 窗口壳:pywebview(`--browser` 是它的退化形态) |
|
|
54
|
+
| `native.py` | 原生程序宿主:不是第二条执行路径,是「人的门」的第三种壳 |
|
|
55
|
+
| `main.py` | 入口:装配,没有第四样东西 |
|
|
56
|
+
| `web/index.html` | 工作区视图 + 对话 + 能力面板(单文件,无构建步骤) |
|
|
57
|
+
|
|
58
|
+
配套:`settings.py`(唯一一项设置:aaas-service 地址)、`devtools.py`(开发者模式那双手)、
|
|
59
|
+
`assistant.py`(内核唯一内置的程序:小助理)、`toolbox.py`(小助理的手)、
|
|
60
|
+
`selftest.py` / `qa.py` / `uiprobe.py`(三层的自检:逻辑 / 真窗口 / 真浏览器)。
|
|
61
|
+
|
|
62
|
+
## 装
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install agent-workspace-desktop # 内核 + aaas 客户端
|
|
66
|
+
pip install "agent-workspace-desktop[gui]" # 再带上桌面窗口(pywebview)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
需要 Python 3.10+,以及一个能连上的 `aaas-service`(地址在设置里改,默认 `ws://localhost:8888`)。
|
|
70
|
+
|
|
71
|
+
## 跑
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
agent-workspace # 桌面窗口
|
|
75
|
+
agent-workspace --browser # 换成浏览器(pywebview 起不来时的形态)
|
|
76
|
+
agent-workspace --cli # 命令行:跟小助理说一句
|
|
77
|
+
agent-workspace --cli -m "做个番茄钟" # 同上
|
|
78
|
+
agent-workspace --cli --as pomodoro -m "开始 25 分钟" # 跟某个程序自己的助手说
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`--cli` 是验收形态:`connect → declare → sendInput → invokeFunction → 本地执行 →
|
|
82
|
+
functionResult → 模型续写 → turn.completed`。这条不通,界面做得再漂亮也是空壳。
|
|
83
|
+
|
|
84
|
+
## 工作区长什么样
|
|
85
|
+
|
|
86
|
+
工作区(默认 `./workspace`,可用 `--workspace` 换)是**运行时**,不在本仓库里:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
workspace/
|
|
90
|
+
plugins/<pid>/ 程序:plugin.json + backend.py + ui/index.html + data/store.json
|
|
91
|
+
logs/events.jsonl 谁做了什么、谁点的(事件流)
|
|
92
|
+
prompts/ 每个程序的指令
|
|
93
|
+
config.json 设置(只有一项:aaas-service 地址)
|
|
94
|
+
dev.json 开发者模式开关(**只属于人**:程序写它一律被拒)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
内核**没有任何内置的领域能力**:番茄钟、日记、记账都是工作区里长出来的程序,
|
|
98
|
+
所以它们**不在这个仓库里** —— 这里只有内核。
|
|
99
|
+
|
|
100
|
+
## 契约(写程序的人关心这几条)
|
|
101
|
+
|
|
102
|
+
1. 公开函数 = 能力;`_` 前缀 = 私有;wire name = `<pid>_<fn>`
|
|
103
|
+
2. 约束只写一处:`Annotated[int, {"minimum": 1}]` → schema / 表单 / 校验同源
|
|
104
|
+
3. 双面返回:dict 含 `"text"` → 文本给模型,其余进 `data` 给界面
|
|
105
|
+
4. 状态走 `ctx.get/set` → `data/store.json`(代码目录与数据目录分离)
|
|
106
|
+
5. 事件总线:`call.ok` / `call.error` / `call.rejected` / `state.changed`
|
|
107
|
+
|
|
108
|
+
隔离只写一处:`Runtime.capabilities_of(pid)`。别的程序在结构上就**拿不到** `plugin_write`。
|
|
109
|
+
|
|
110
|
+
## 开发者模式
|
|
111
|
+
|
|
112
|
+
一个开关(设置面板里拨),打开后当前程序多拿到一把**只够改自己**的手:
|
|
113
|
+
|
|
114
|
+
| 有 | 没有 |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `dev_tree` / `dev_read` / `dev_search` | `plugin_list`(「有哪些程序」本身就是权限地图) |
|
|
117
|
+
| `dev_write`(普通文件) | `plugin_call`(能绕开别人的隔离) |
|
|
118
|
+
| `dev_plugin_write`(**没有 pid 参数**) | `plugin_delete` / `shell` |
|
|
119
|
+
|
|
120
|
+
想改别人,在**签名**上就无从下手;`dev.json` 由人掌握,程序写它一律被拒。
|
|
121
|
+
细节见 [`docs/dev-mode.md`](docs/dev-mode.md)。
|
|
122
|
+
|
|
123
|
+
## 自检
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python -m agentworkspace.selftest # 逻辑层(内存里跑完整链路)
|
|
127
|
+
python -m agentworkspace.qa all # 真窗口
|
|
128
|
+
python -m agentworkspace.uiprobe # 真浏览器(拖动 / 折叠 / 设置 / 图标)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
三层缺一不可:`selftest` 只能断言「文件里有这行字」,CSS 优先级、事件绑定、
|
|
132
|
+
重绘时机任何一处错了都拦不住 —— 那要靠后两层。
|
|
133
|
+
|
|
134
|
+
## 文档
|
|
135
|
+
|
|
136
|
+
- [`docs/vision.md`](docs/vision.md) —— 道 / 一 / 二 / 三 / 万物
|
|
137
|
+
- [`docs/desktop-workspace-plan.md`](docs/desktop-workspace-plan.md) —— 方案与三层分界
|
|
138
|
+
- [`docs/plugin-mechanism.md`](docs/plugin-mechanism.md) —— 程序三要素与契约五条
|
|
139
|
+
- [`docs/agent-per-program.md`](docs/agent-per-program.md) —— 每个程序一个智能体
|
|
140
|
+
- [`docs/dev-mode.md`](docs/dev-mode.md) —— 开发者模式的边界
|
|
141
|
+
- [`docs/settings-and-icon.md`](docs/settings-and-icon.md) —— 设置与窗口图标
|
|
142
|
+
- [`docs/shell-and-native.md`](docs/shell-and-native.md) —— 窗口壳与原生程序
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
agent_workspace_desktop.egg-info/PKG-INFO
|
|
6
|
+
agent_workspace_desktop.egg-info/SOURCES.txt
|
|
7
|
+
agent_workspace_desktop.egg-info/dependency_links.txt
|
|
8
|
+
agent_workspace_desktop.egg-info/entry_points.txt
|
|
9
|
+
agent_workspace_desktop.egg-info/requires.txt
|
|
10
|
+
agent_workspace_desktop.egg-info/top_level.txt
|
|
11
|
+
agentworkspace/__init__.py
|
|
12
|
+
agentworkspace/assistant.py
|
|
13
|
+
agentworkspace/devtools.py
|
|
14
|
+
agentworkspace/kernel.py
|
|
15
|
+
agentworkspace/link.py
|
|
16
|
+
agentworkspace/main.py
|
|
17
|
+
agentworkspace/native.py
|
|
18
|
+
agentworkspace/qa.py
|
|
19
|
+
agentworkspace/sdk.py
|
|
20
|
+
agentworkspace/selftest.py
|
|
21
|
+
agentworkspace/server.py
|
|
22
|
+
agentworkspace/settings.py
|
|
23
|
+
agentworkspace/shell.py
|
|
24
|
+
agentworkspace/toolbox.py
|
|
25
|
+
agentworkspace/uiprobe.py
|
|
26
|
+
agentworkspace/winicon.py
|
|
27
|
+
agentworkspace/assets/icon.ico
|
|
28
|
+
agentworkspace/assets/make_icon.py
|
|
29
|
+
agentworkspace/web/index.html
|
|
30
|
+
docs/agent-per-program.md
|
|
31
|
+
docs/code-review.md
|
|
32
|
+
docs/desktop-workspace-plan.md
|
|
33
|
+
docs/dev-mode.md
|
|
34
|
+
docs/plugin-mechanism.md
|
|
35
|
+
docs/settings-and-icon.md
|
|
36
|
+
docs/shell-and-native.md
|
|
37
|
+
docs/vision.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
agentworkspace
|
|
Binary file
|