nexum-code 0.18.7 → 0.20.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.
- package/README.md +14 -14
- package/dist/{app-aqWxJw2S.mjs → app-CYLTD0b3.mjs} +19994 -15221
- package/dist/{dispatch-DQ6ufFQt.mjs → dispatch-DnZRjRNm.mjs} +21929 -9483
- package/dist/{dispatch-ByfuGE0h.mjs → dispatch-cUxbpzTE.mjs} +1 -1
- package/dist/{markit-XGWU21rO.mjs → esm-C0toZ4e0.mjs} +19 -2344
- package/dist/main.mjs +1 -1
- package/dist/markdown-BwvhOvCA.mjs +25943 -0
- package/dist/markit-LwaDGgYt.mjs +2334 -0
- package/dist/{src-pqi1HIGh.mjs → src-C6YAs3fd.mjs} +1 -1
- package/dist/{src-BPh-7A8j.mjs → src-C8mW2wSe.mjs} +779 -276
- package/dist/{text-input-dialog-CAaXBGxG.mjs → text-input-dialog-BbyJmVbH.mjs} +1 -1
- package/dist/{text-input-dialog-BIhpfWk_.mjs → text-input-dialog-CAxwn6Ze.mjs} +930 -74
- package/docs/architecture.md +80 -0
- package/docs/configuration.md +204 -0
- package/docs/line.md +159 -0
- package/docs/mcp.md +141 -0
- package/docs/plugins.md +198 -0
- package/docs/sessions.md +78 -0
- package/docs/skills.md +76 -0
- package/package.json +9 -8
package/docs/plugins.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Plugins — 给自己写插件
|
|
2
|
+
|
|
3
|
+
Nexum 可以给自己写插件:遇到技能和 MCP 都覆盖不了的需求时,直接产出一个代码插件。
|
|
4
|
+
|
|
5
|
+
插件能贡献四类能力:技能(提示词)、MCP server、shell hooks、以及在进程内运行的工具代码。注册后技能立即生效;MCP server 与 hooks 随激活启动,**代码只在 `activate` 时执行**。
|
|
6
|
+
|
|
7
|
+
## 快速开始
|
|
8
|
+
|
|
9
|
+
**先征得同意**:动手写之前用 `AskUserQuestion` 问一句("要不要我做一个插件来完成这个?")。审批弹窗在 auto/yolo 下不会出现,所以 yolo 里问句是唯一还会出现的同意步骤(与 `/make-skill` 的确认方式一致)。auto 模式连问句也被禁(`AutoModeAskUserQuestionDenyPermissionPolicy`),因此自产插件属于交互模式的用法,无人值守场景请显式 `install`。bot 模式下 `register_generated` 会被拒绝(bot 不会询问,决定只记入审计);ask 模式下该调用仍会弹出一次审批(它不经 ask 模式的只读拦截),随后的写入才会被拒绝。
|
|
10
|
+
|
|
11
|
+
目录约定 `<nexum home>/plugins/generated/<id>/`(`<nexum home>` 默认 `~/.nexum-code`)。放在别处的目录也能注册,但任何目录都不会被自动扫描——注册必须显式发生。
|
|
12
|
+
|
|
13
|
+
`nexum.plugin.json` 最小内容:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"name": "text-stats",
|
|
18
|
+
"version": "0.1.0",
|
|
19
|
+
"description": "Count lines and characters in a file",
|
|
20
|
+
"entryPoint": "./index.mjs"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
入口 `index.mjs` 最小内容:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { readFile } from 'node:fs/promises';
|
|
28
|
+
|
|
29
|
+
export async function activate(context) {
|
|
30
|
+
context.services.tools.registerUserTool({
|
|
31
|
+
name: 'text_stats',
|
|
32
|
+
description: 'Count lines and characters in a file',
|
|
33
|
+
parameters: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: { path: { type: 'string' } },
|
|
36
|
+
required: ['path'],
|
|
37
|
+
},
|
|
38
|
+
execute: async (args) => {
|
|
39
|
+
const text = await readFile(String(args.path), 'utf8');
|
|
40
|
+
return { output: `lines=${text.split('\n').length} chars=${text.length}` };
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
两步启用:
|
|
47
|
+
|
|
48
|
+
1. `ManagePlugin { "action": "register_generated", "source": "<插件目录的绝对路径>" }` —— 登记目录、热应用技能,**不 import 入口**。
|
|
49
|
+
2. `ManagePlugin { "action": "activate", "id": "text-stats" }` —— 单独审批后 import 入口并执行 `activate`,工具此刻才对模型可见。
|
|
50
|
+
|
|
51
|
+
## 清单字段
|
|
52
|
+
|
|
53
|
+
| 字段 | 必填 | 说明 |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `name` | 是 | 插件 id,须匹配 `^[a-z0-9][a-z0-9_-]{0,63}$` |
|
|
56
|
+
| `version` | 否 | 版本字符串,仅用于展示与检查 |
|
|
57
|
+
| `description` | 否 | 一句话说明 |
|
|
58
|
+
| `skills` | 否 | 技能目录,字符串或字符串数组;每项必须以 `./` 开头且位于插件目录内 |
|
|
59
|
+
| `mcpServers` | 否 | MCP server 配置对象,key 为 server 名;注册不会拉起进程,随 `activate` / `enable` 启动 |
|
|
60
|
+
| `hooks` | 否 | HookDef 数组(`event` / `command` / `matcher` / `timeout`),激活时注入、停用时移除 |
|
|
61
|
+
| `config` | 否 | 任意 JSON 对象,原样作为 `context.config` 交给入口模块 |
|
|
62
|
+
| `entryPoint` | 否 | 代码入口;必须 `./` 开头,且 realpath 后仍位于插件目录内。不满足时清单层丢弃该字段并留下诊断,`register_generated` 会据此报 `entry_point_rejected`,不会静默降级 |
|
|
63
|
+
|
|
64
|
+
`entryPoint` 指向的文件必须存在:`register_generated` 在登记前会 stat 该路径,缺失时返回 `entry_file_missing`,不会留下半登记记录。
|
|
65
|
+
|
|
66
|
+
## 入口模块契约
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
export async function activate(context) {}
|
|
70
|
+
|
|
71
|
+
export async function deactivate() {}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- 必须是 ESM。也接受 `export default { activate, deactivate }` 的写法(运行时统一经 `normalizeExtensionModule` 归一化)。
|
|
75
|
+
- `activate(context)` 必须导出;`deactivate()` 可选,且不接收参数——需要清理的东西在 `activate` 里捕获到模块作用域。
|
|
76
|
+
- `activate` 抛错时,本次激活完成一半的 hooks 与事件订阅会被回滚,错误写入插件记录并返回 `activation_failed`。
|
|
77
|
+
- 激活是**按会话**的:同一个插件可以在 A、B 两个会话里各跑一份(各自的 hooks、事件订阅、工具互不相干),但**同一会话内**不能重复激活;停用一个会话不影响另一个。
|
|
78
|
+
- 会话关闭时,它激活过的插件会被自动 `deactivate`,不会残留。
|
|
79
|
+
|
|
80
|
+
## context API
|
|
81
|
+
|
|
82
|
+
| 成员 | 说明 |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `pluginId` | 当前插件 id |
|
|
85
|
+
| `config` | 清单 `config` 块;未声明时为 `undefined` |
|
|
86
|
+
| `services.tools.registerUserTool(input)` | 注册进程内工具,立即对当前 agent 可见 |
|
|
87
|
+
| `services.tools.unregisterUserTool(name)` | 注销自己注册的工具 |
|
|
88
|
+
| `services.tools.unregisterToolsByOwner(id)` | 按 owner 批量注销;宿主在停用时也会自动执行 |
|
|
89
|
+
| `events.subscribe(type \| '*', handler)` | 订阅 agent 事件,返回 `unsubscribe`;`deactivate` 时宿主也会统一释放 |
|
|
90
|
+
| `services` | agent 的子系统清单;只应调用这里列出的工具相关成员 |
|
|
91
|
+
| `ui.notify(level, message)` | 向用户报一句:`info` / `warn` / `error`。作为状态区消息显示,不打断 |
|
|
92
|
+
| `ui.confirm({ title, body?, confirmLabel?, cancelLabel? })` | 问用户是/否,返回 `Promise<boolean>`;无界面宿主一律返回 `false` 并说明原因 |
|
|
93
|
+
| `ui.progress(title)` | 返回 `{ update(label), done(message?), fail(message?) }`;文本进度,`update` 限流约 5 次/秒 |
|
|
94
|
+
|
|
95
|
+
`registerUserTool` 的入参:
|
|
96
|
+
|
|
97
|
+
| 字段 | 说明 |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `name` | 工具名,全局唯一 |
|
|
100
|
+
| `description` | 给模型看的一句话说明 |
|
|
101
|
+
| `parameters` | JSON Schema 对象(`type: "object"` 及 `properties` / `required`) |
|
|
102
|
+
| `execute(args, ctx)` | 返回 `{ output, message?, isError? }` 或 Promise;`output` 是模型看到的内容,`message` 只给 UI |
|
|
103
|
+
|
|
104
|
+
运行时会给注册自动打上 `ownerPluginId`,因此停用、移除、熔断都能精确回收该插件的工具;插件自己声明的 owner 优先。`execute` 抛错会被转成工具错误,不会打断 agent loop,但会计入熔断计数。
|
|
105
|
+
|
|
106
|
+
## 界面交互(ui)
|
|
107
|
+
|
|
108
|
+
三个原语,全部**降级而不抛错**:
|
|
109
|
+
|
|
110
|
+
| 宿主 | `notify` | `confirm` | `progress` |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| TUI | 状态区一行 | 弹出选择框,选「确认」为 `true` | 状态区文本逐步更新 |
|
|
113
|
+
| `/line`、SDK、print | 事件日志 | 直接 `false` + 一条 warn | 状态区文本(若宿主有) |
|
|
114
|
+
|
|
115
|
+
`confirm` 走的是和 `AskUserQuestion` 同一条提问通道,所以不需要插件自己画界面;`notify` 复用宿主的警示事件(`code: "plugin:<level>"`),宿主可据此区分级别。**插件不能阻塞会话**:任何等待都有结果,宿主不在就按「否」处理。
|
|
116
|
+
|
|
117
|
+
## 迭代
|
|
118
|
+
|
|
119
|
+
改完入口文件后执行 `/extension reload <id>`(等价于 `deactivate` + `activate`),或者在会话里用 `ManagePlugin` 先 `deactivate` 再 `activate`。
|
|
120
|
+
|
|
121
|
+
注意区分两个动作:`ManagePlugin {action:"reload"}` 只是**重读插件表**,不会重新 import;要重新 import 改过的入口文件,用 `/extension reload <id>` 或 `ManagePlugin {action:"reload_code", id:"<id>"}`。
|
|
122
|
+
|
|
123
|
+
只调用 `activate` 不会加载新代码:模块按入口路径缓存,`deactivate` 会丢掉该缓存并让下一次 import 走新的 specifier,重新激活才读到新文件。激活失败、import 失败同样会让缓存失效,所以「改错 → 报错 → 改对 → reload」是可行的。
|
|
124
|
+
|
|
125
|
+
## 已知限制
|
|
126
|
+
|
|
127
|
+
- **重启进程后需要重新激活**:插件记录仍在插件中心(`/plugin`、`ManagePlugin list` 可见),但激活态只存在于进程内。
|
|
128
|
+
- **激活绑定当前会话的 main agent**:工具注册在那一个 agent 上。同一进程里的另一个会话可能看到 `●` 状态,但拿不到这个工具。
|
|
129
|
+
- **熔断分两种,恢复方式不同**:
|
|
130
|
+
- **工具连续失败 3 次**:持久禁用(写进插件记录),`check` 的 `circuit` 能看到计数,`ManagePlugin { "action": "reset", "id": "<id>" }` 清除并重新启用。
|
|
131
|
+
- **事件 handler 连续抛错 3 次**:只在**当前进程内**停用,不改插件记录,`check.circuit` 也不会显示;修好 handler 后重新 `activate` 即可。
|
|
132
|
+
- **`reload` 只重新 import 入口模块**:入口用 `import './lib.mjs'` 引的其它文件仍走进程缓存,多文件插件改完辅助文件不会生效(改放进入口,或重启进程)。
|
|
133
|
+
- **每次 reload 都会在进程里留下一份旧模块实例**:这是「改了立刻生效」的代价,量级等于编辑次数,不影响正确性。
|
|
134
|
+
- 没有目录扫描或自动发现:新插件必须显式 `register_generated` / `install`。
|
|
135
|
+
|
|
136
|
+
## 完整示例:text-stats
|
|
137
|
+
|
|
138
|
+
`nexum.plugin.json`:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"name": "text-stats",
|
|
143
|
+
"version": "0.1.0",
|
|
144
|
+
"description": "Count lines and characters in a file",
|
|
145
|
+
"entryPoint": "./index.mjs"
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`index.mjs`:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
import { readFile } from 'node:fs/promises';
|
|
153
|
+
|
|
154
|
+
// Kept in module scope so deactivate() can unregister without a context arg.
|
|
155
|
+
let tools;
|
|
156
|
+
|
|
157
|
+
export async function activate(context) {
|
|
158
|
+
tools = context.services.tools;
|
|
159
|
+
tools.registerUserTool({
|
|
160
|
+
name: 'text_stats',
|
|
161
|
+
description: '统计文件的行数与字符数',
|
|
162
|
+
parameters: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
properties: {
|
|
165
|
+
path: { type: 'string', description: '要统计的文件路径' },
|
|
166
|
+
},
|
|
167
|
+
required: ['path'],
|
|
168
|
+
additionalProperties: false,
|
|
169
|
+
},
|
|
170
|
+
execute: async (args) => {
|
|
171
|
+
const text = await readFile(String(args.path), 'utf8');
|
|
172
|
+
return {
|
|
173
|
+
output: `lines=${text.split('\n').length} chars=${text.length}`,
|
|
174
|
+
message: `已统计 ${String(args.path)}`,
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export async function deactivate() {
|
|
181
|
+
// The host reclaims owned tools too; this keeps the plugin self-contained.
|
|
182
|
+
tools?.unregisterUserTool('text_stats');
|
|
183
|
+
tools = undefined;
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
启用与迭代:
|
|
188
|
+
|
|
189
|
+
1. `ManagePlugin { "action": "register_generated", "source": "/Users/me/.nexum-code/plugins/generated/text-stats" }`
|
|
190
|
+
2. `ManagePlugin { "action": "activate", "id": "text-stats" }`
|
|
191
|
+
3. 改完代码后 `/extension reload text-stats`
|
|
192
|
+
|
|
193
|
+
## 安全边界
|
|
194
|
+
|
|
195
|
+
- 入口只能在插件目录内:清单层强制 `./` 相对路径,并对 realpath 结果做越界检查(见 `resolvePluginPathField`)。越界的 `entryPoint` 会被清单层拒绝,`register_generated` 报 `entry_point_rejected`,不会降级成"看起来注册成功"的纯数据插件。
|
|
196
|
+
- 注册不执行代码:`register_generated` 只解析清单、登记记录;`activate` 是唯一的执行点,且单独要求审批。
|
|
197
|
+
- 审批身份包含目录路径与插件 id:`register_generated` 的审批串带完整 source,`activate` / `deactivate` / `remove` / `enable` / `disable` / `reset` / `rollback` / `set_mcp_enabled` / `reload_code` 带插件 id(如 `ManagePlugin(activate text-stats)`)。会话级授权只能覆盖同名对象,不能挪用到另一个目录或另一个插件。
|
|
198
|
+
- 激活后代码运行在 agent 进程内,可访问 `context.services`。只激活自己写的或完全信任的插件。
|
package/docs/sessions.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Sessions
|
|
2
|
+
|
|
3
|
+
A session is a persisted conversation: one agent, one working directory, one
|
|
4
|
+
append-only record stream.
|
|
5
|
+
|
|
6
|
+
## Storage layout
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
~/.nexum-code/sessions/
|
|
10
|
+
└── <encoded-workdir>/
|
|
11
|
+
└── <session-id>/
|
|
12
|
+
├── wire.jsonl # main agent records (append-only)
|
|
13
|
+
└── agents/<agent-id>/wire.jsonl
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `wire.jsonl` is the source of truth: every message, tool call and tool result
|
|
17
|
+
in order. Corrupt lines are reported with the file path and line number
|
|
18
|
+
(`agent/records/persistence.ts`).
|
|
19
|
+
- `encoded-workdir` comes from `session/store/workdir-key.ts`, so sessions are
|
|
20
|
+
bucketed per project and a listing defaults to the current directory.
|
|
21
|
+
- An index (`session/store/session-index.ts`) caches id → metadata and is
|
|
22
|
+
validated by mtime + size, so another process's writes are picked up.
|
|
23
|
+
|
|
24
|
+
## Lifecycle
|
|
25
|
+
|
|
26
|
+
| Action | Mechanism |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Create | `Session` is created with a model alias; the first record opens the wire |
|
|
29
|
+
| Resume | `/sessions` (alias `/resume`) or `--session <id>`; the wire is replayed |
|
|
30
|
+
| Fork | `/fork` — copies the conversation into a new session id |
|
|
31
|
+
| Rename | `/title` |
|
|
32
|
+
| Close | `/exit`, or the TUI detaching from the session |
|
|
33
|
+
|
|
34
|
+
## Compaction
|
|
35
|
+
|
|
36
|
+
Three layers, all automatic (unless `loopControl.compactionMode = "off"`):
|
|
37
|
+
|
|
38
|
+
- **Micro** — keeps the most recent 20 messages (bounded to 40k tokens) and
|
|
39
|
+
truncates older ones.
|
|
40
|
+
- **Full** — at 85% of the context window, older turns are summarised and
|
|
41
|
+
replaced, preserving up to 24 recent messages (12 user, 30k tokens, at most
|
|
42
|
+
25% of the window). At 90% the turn is blocked until compaction runs — older
|
|
43
|
+
context is never silently truncated away.
|
|
44
|
+
- **`/compact`** — triggers a full compaction manually. Useful to pick a pause
|
|
45
|
+
point instead of letting the engine interrupt mid-task.
|
|
46
|
+
|
|
47
|
+
The summary is marked unverified: re-check anything it asserts before acting on
|
|
48
|
+
it. Configurable via `loopControl.compactionTriggerRatio` (0.5–0.99).
|
|
49
|
+
|
|
50
|
+
**Off mode** — `loopControl.compactionMode = "off"` for unattended and IM
|
|
51
|
+
sessions that must not stall on a compaction LLM call: micro and auto
|
|
52
|
+
compaction are disabled entirely (the context read paths never advance the
|
|
53
|
+
micro cutoff behind the caller's back, and a context-overflow error surfaces
|
|
54
|
+
instead of triggering recovery). At the 90% blocking threshold the model gets
|
|
55
|
+
a one-time wrap-up reminder per episode instead of being blocked; the
|
|
56
|
+
provider's own context limit remains the hard backstop. `/compact` still works
|
|
57
|
+
manually.
|
|
58
|
+
|
|
59
|
+
## Switching and concurrency
|
|
60
|
+
|
|
61
|
+
- One session is live at a time; its turns are serialised.
|
|
62
|
+
- Switching replays the target session's history and clears the current
|
|
63
|
+
transcript view, so the screen always matches the live session.
|
|
64
|
+
- Inputs queued in memory are not persisted. After a restart the wire replays
|
|
65
|
+
messages and tool results, not pending user input.
|
|
66
|
+
|
|
67
|
+
## Export
|
|
68
|
+
|
|
69
|
+
| Command | Output |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `/export-md` | Markdown transcript |
|
|
72
|
+
| `/export-debug-zip` | Bundle with diagnostics |
|
|
73
|
+
| `nexum export [sessionId]` | ZIP from the CLI |
|
|
74
|
+
|
|
75
|
+
## Deleting
|
|
76
|
+
|
|
77
|
+
`/sessions` → select → `d` (then `Enter` to confirm). The session currently open
|
|
78
|
+
cannot be deleted, and channel-owned (line) sessions are managed by their channel instead.
|
package/docs/skills.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Skills
|
|
2
|
+
|
|
3
|
+
A skill is a markdown package the agent loads on demand. It is prompt material,
|
|
4
|
+
not code: invoking a skill injects its body into the conversation.
|
|
5
|
+
|
|
6
|
+
## Shape
|
|
7
|
+
|
|
8
|
+
Two layouts are supported:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
my-skill/SKILL.md # directory skill (may ship supporting files)
|
|
12
|
+
my-skill.md # flat skill
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`SKILL.md` needs YAML frontmatter:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
---
|
|
19
|
+
name: my-skill
|
|
20
|
+
description: One sentence shown in the skill listing.
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
Body: the instructions the agent follows once the skill is invoked.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- Both fields are required for a directory skill (`SKILL.md`): the parser throws,
|
|
27
|
+
and the scanner downgrades that to a warning, so the skill is skipped instead
|
|
28
|
+
of half-registered.
|
|
29
|
+
- Flat `<name>.md` skills are more forgiving — `name` falls back to the file name
|
|
30
|
+
and `description` to the first body line.
|
|
31
|
+
|
|
32
|
+
## Where skills are discovered
|
|
33
|
+
|
|
34
|
+
| Root | Scope |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `~/.nexum-code/skills/` | user |
|
|
37
|
+
| `<git-root>/.nexum-code/skills/` | project (the git root, not the current directory) |
|
|
38
|
+
| `<git-root>/.agents/skills/` | project (alternate convention) |
|
|
39
|
+
| `extraSkillDirs` in `config.toml` | extra roots |
|
|
40
|
+
| `plugins/managed/<plugin>/` | installed plugin packages |
|
|
41
|
+
|
|
42
|
+
Project skills override user skills with the same name. `mergeAllAvailableSkills`
|
|
43
|
+
in `config.toml` merges every discovered skill instead of the project-scoped set.
|
|
44
|
+
|
|
45
|
+
## Invoking
|
|
46
|
+
|
|
47
|
+
- `Skill` tool — the agent calls it with `skill` and optional `args`.
|
|
48
|
+
- `/skill:<name>` — the user invokes one directly.
|
|
49
|
+
- `/skill` — pick from a list.
|
|
50
|
+
- A bare `/name` also works for built-in skills (e.g. `/dream`, `/image`).
|
|
51
|
+
|
|
52
|
+
## Built-in skills
|
|
53
|
+
|
|
54
|
+
| Skill | Purpose |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `image` | Generate or edit an image via the `ImageGenerate` tool; also `/image` |
|
|
57
|
+
| `dream` | Memory consolidation: plan → confirm → apply; also `/dream` |
|
|
58
|
+
| `make-skill` | Turn the current conversation into a reusable skill package |
|
|
59
|
+
|
|
60
|
+
## Authoring a new skill
|
|
61
|
+
|
|
62
|
+
1. Run `/make-skill` and answer the prompts, or write the `SKILL.md` yourself.
|
|
63
|
+
2. `MakeSkillPlan` drafts a package (name, description, body, supporting files, and a trigger test).
|
|
64
|
+
3. `MakeSkillApply` writes it into the plugin center, where `/plugin` manages it.
|
|
65
|
+
4. Run the plan's trigger test once it is installed: `verification.instructions` names
|
|
66
|
+
requests that should fire the skill and a near miss that should not. A skill that
|
|
67
|
+
fires on the near miss is over-broad; one that ignores its own triggers is invisible.
|
|
68
|
+
|
|
69
|
+
Skills are listed in the system prompt when the session starts, so a skill added
|
|
70
|
+
mid-session needs a new session (or `/skill` refresh) to appear.
|
|
71
|
+
|
|
72
|
+
## What a skill is not
|
|
73
|
+
|
|
74
|
+
- Not a subagent: no separate context, no separate tool set.
|
|
75
|
+
- Not a plugin: no executable entry point.
|
|
76
|
+
- Not a permission grant: invoking a skill does not widen the tool policy.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexum-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "A terminal-native AI agent for builders",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"nexum-code",
|
|
12
12
|
"tui"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://github.com/Hsssliu/nexum-code/tree/
|
|
14
|
+
"homepage": "https://github.com/Hsssliu/nexum-code/tree/jiaotou-new/apps/nexum-code#readme",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/Hsssliu/nexum-code/issues"
|
|
17
17
|
},
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
+
"docs",
|
|
30
31
|
"icon.ico"
|
|
31
32
|
],
|
|
32
33
|
"type": "module",
|
|
@@ -58,13 +59,15 @@
|
|
|
58
59
|
"bench:startup": "node scripts/startup-bench.mjs"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
|
-
"@
|
|
62
|
+
"@ast-grep/napi": "0.51.2",
|
|
63
|
+
"@huggingface/tokenizers": "^0.2.0",
|
|
64
|
+
"onnxruntime-web": "1.21.0",
|
|
65
|
+
"@earendil-works/pi-tui": "npm:@liutod-scream/pi-tui@^1.5.2",
|
|
62
66
|
"@mariozechner/clipboard": "^0.3.2",
|
|
63
67
|
"chalk": "^5.4.1",
|
|
64
68
|
"cli-highlight": "^2.1.11",
|
|
65
69
|
"commander": "^13.1.0",
|
|
66
70
|
"diff": "^9.0.0",
|
|
67
|
-
"fastembed": "^2.1.0",
|
|
68
71
|
"marked": "^15.0.7",
|
|
69
72
|
"mupdf": "^1.28.0",
|
|
70
73
|
"qrcode": "^1.5.4",
|
|
@@ -76,7 +79,8 @@
|
|
|
76
79
|
"@earendil-works/pi-codemode": "^1.1.0",
|
|
77
80
|
"@fontsource-variable/inter": "^5.3.0",
|
|
78
81
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
79
|
-
"grok-mermaid": "^0.2.3"
|
|
82
|
+
"grok-mermaid": "^0.2.3",
|
|
83
|
+
"@larksuiteoapi/node-sdk": "^1.76.0"
|
|
80
84
|
},
|
|
81
85
|
"devDependencies": {
|
|
82
86
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
@@ -100,8 +104,5 @@
|
|
|
100
104
|
},
|
|
101
105
|
"engines": {
|
|
102
106
|
"node": ">=22.19.0"
|
|
103
|
-
},
|
|
104
|
-
"optionalDependencies": {
|
|
105
|
-
"fastembed": "^2.1.0"
|
|
106
107
|
}
|
|
107
108
|
}
|