@wowyuarm/dsh-agent-team 0.1.4 → 0.1.6
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 +15 -1
- package/README.zh.md +20 -3
- package/package.json +7 -2
- package/packages/agent-team/README.md +6 -0
- package/packages/agent-team/README.zh.md +6 -0
- package/packages/agent-team/core-skills/member-skill-manager/SKILL.md +41 -0
- package/packages/agent-team/core-skills/member-skill-manager/references/auth-and-config.md +30 -0
- package/packages/agent-team/core-skills/member-skill-manager/references/writing-great-skills.md +17 -0
- package/packages/agent-team/lib/auto-compaction.js +39 -1
- package/packages/agent-team/lib/index.js +340 -7
- package/packages/agent-team/lib/ledger.js +219 -7
- package/packages/agent-team/lib/member-context.js +2 -2
- package/packages/agent-team/lib/member-skills.js +94 -0
- package/packages/agent-team/lib/spec.js +38 -0
- package/packages/agent-team/lib/typert.host.js +202 -27
- package/packages/agent-team/lib/typert.remote-client.d.ts +3 -1
- package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
- package/packages/agent-team/lib/typert.remote-client.js +155 -22
- package/packages/agent-team/lib/types/auto-compaction.d.ts +9 -0
- package/packages/agent-team/lib/types/auto-compaction.d.ts.map +1 -1
- package/packages/agent-team/lib/types/index.d.ts +81 -1
- package/packages/agent-team/lib/types/index.d.ts.map +1 -1
- package/packages/agent-team/lib/types/ledger.d.ts +49 -1
- package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-skills.d.ts +45 -0
- package/packages/agent-team/lib/types/member-skills.d.ts.map +1 -0
- package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types.d.ts +127 -2
- package/packages/agent-team/lib/types/types.d.ts.map +1 -1
- package/packages/agent-team/preset/team-member/agent.cordis.yml +7 -4
- package/packages/client-agent-team/README.md +1 -1
- package/packages/client-agent-team/README.zh.md +1 -1
- package/packages/client-agent-team/lib/client.js +677 -363
- package/packages/client-agent-team/lib/client.js.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +2 -4
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +48 -24
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +20 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +3 -1
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamComposer.js +73 -17
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts +4 -8
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +7 -40
- package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.js +16 -1
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMessage.js +48 -18
- package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts +3 -2
- package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts +5 -2
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +2 -4
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +82 -22
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +4 -2
- package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/index.js +15 -13
- package/packages/client-agent-team/lib/types/client/locales.d.ts +20 -16
- package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/locales.js +20 -16
- package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts +16 -0
- package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/sidebar-sections.js +102 -0
- package/packages/client-agent-team/lib/types/client/slots.d.ts +2 -1
- package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-formatters.js +9 -2
- package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts +5 -7
- package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/timeline-scroll.js +9 -22
- package/packages/tool-agent-team/lib/index.js +25 -5
- package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,18 @@
|
|
|
7
7
|
[](https://github.com/wowyuarm/dsh-agent-team/releases)
|
|
8
8
|
[](https://awesome-dsh-plugin.com/p/wowyuarm/dsh-agent-team/)
|
|
9
9
|
|
|
10
|
-
**dsh-agent-team**
|
|
10
|
+
**dsh-agent-team** gives DeepSeek Harness a persistent agent team for long-running collaboration: agents are durable identities for their sessions, keeping memory and responsibilities across them; Workspaces organize agents and sessions per project; Channels carry responsibilities; Task Threads chain session agents into one line of progress.
|
|
11
11
|
|
|
12
12
|
An opt-in plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): install it only where Team mode is needed; ordinary DSH sessions keep their normal preset roster.
|
|
13
13
|
|
|
14
14
|
## Preview
|
|
15
15
|
|
|
16
|
+
Agent Team is opt-in: after installation the ordinary DSH page stays as-is, and Team mode is one additional entry in the sidebar footer.
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
Entering Team mode shows Channels, managed Agents, and the collaboration timeline:
|
|
21
|
+
|
|
16
22
|

|
|
17
23
|
|
|
18
24
|
### Task Threads
|
|
@@ -21,6 +27,10 @@ A Task Thread keeps Claims, Agent handoffs, Human acceptance, and follow-up repl
|
|
|
21
27
|
|
|
22
28
|

|
|
23
29
|
|
|
30
|
+
### No context babysitting
|
|
31
|
+
|
|
32
|
+
Member sessions compact automatically once token usage passes the threshold, and each member gets a pre-compaction hint to persist its key conclusions first. Every member keeps its own memory and notes across sessions, so identity and knowledge survive session renewal.
|
|
33
|
+
|
|
24
34
|
## Quick start
|
|
25
35
|
|
|
26
36
|
### 1. Check DSH
|
|
@@ -117,6 +127,10 @@ npm pack --dry-run
|
|
|
117
127
|
|
|
118
128
|
Architecture and the collaboration contract are documented in [`docs/architecture.md`](docs/architecture.md) and [`docs/team-collaboration.md`](docs/team-collaboration.md).
|
|
119
129
|
|
|
130
|
+
## Acknowledgments
|
|
131
|
+
|
|
132
|
+
The collaboration shape of dsh-agent-team — named agent members, Channels, Task Threads, @mention routing, and per-member memory — originates from and borrows several design ideas from [Raft](https://raft.build/). Thank you for the work.
|
|
133
|
+
|
|
120
134
|
## License
|
|
121
135
|
|
|
122
136
|
[MIT](LICENSE)
|
package/README.zh.md
CHANGED
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/@wowyuarm/dsh-agent-team)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/wowyuarm/dsh-agent-team/releases)
|
|
5
8
|
[](https://awesome-dsh-plugin.com/p/wowyuarm/dsh-agent-team/)
|
|
6
9
|
|
|
7
|
-
**dsh-agent-team**
|
|
10
|
+
**dsh-agent-team** 给 DSH 一个可长期协作的持久 Agent 团队:Agent 是 session 的持久身份,跨会话保持记忆与职责;Workspace 按项目组织 agents 与 sessions;Channel 承载职责分派;Task Thread 把多个 session agent 串成一条推进线。
|
|
8
11
|
|
|
9
12
|
一个为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供的按需启用插件:只在需要 Team mode 的 profile 安装,普通 DSH Session 保持原有 preset roster。
|
|
10
13
|
|
|
11
14
|
## 预览
|
|
12
15
|
|
|
16
|
+
Agent Team 是按需启用的:安装后普通 DSH 页面保持原样,Team mode 只是侧栏底部多出的一个入口。
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
进入 Team mode 后是频道、受管 Agent 与协作时间线:
|
|
21
|
+
|
|
13
22
|

|
|
14
23
|
|
|
15
24
|
### Task Thread
|
|
@@ -18,6 +27,10 @@ Task Thread 把 Claim、Agent 交接、Human 验收和后续回复保留在同
|
|
|
18
27
|
|
|
19
28
|

|
|
20
29
|
|
|
30
|
+
### 无需操心上下文
|
|
31
|
+
|
|
32
|
+
成员会话在 token 用量超过阈值后自动压缩,压缩前会提示成员先沉淀关键结论。每个成员的 memory 与 notes 跨会话保留,身份与知识不随会话续期丢失。
|
|
33
|
+
|
|
21
34
|
## 快速开始
|
|
22
35
|
|
|
23
36
|
### 1. 检查 DSH
|
|
@@ -98,7 +111,7 @@ dsh web
|
|
|
98
111
|
|
|
99
112
|
## 开发
|
|
100
113
|
|
|
101
|
-
维护中的文档入口是 [`docs/README.md`](docs/README.md)。常用检查命令:
|
|
114
|
+
维护中的文档入口是 [`docs/README.zh.md`](docs/README.zh.md)。常用检查命令:
|
|
102
115
|
|
|
103
116
|
```sh
|
|
104
117
|
corepack pnpm install
|
|
@@ -112,7 +125,11 @@ npm pack --dry-run
|
|
|
112
125
|
|
|
113
126
|
`npm run test:browser` 使用相邻的 `../deepseek-harness` checkout、隔离临时 profile 和 `/usr/bin/google-chrome`(可用 `CHROME_PATH` 覆盖),不需要 provider credentials。手动检查时,`npm run preview:ui` 会加载不调用模型的 Team fixture;`DEEPSEEK_API_KEY=... npm run preview` 会启动真实 provider preview。两个 preview 命令都会在 `Ctrl+C` 后清理临时状态。
|
|
114
127
|
|
|
115
|
-
架构和协作协议见 [`docs/architecture.md`](docs/architecture.md) 与 [`docs/team-collaboration.md`](docs/team-collaboration.md)。
|
|
128
|
+
架构和协作协议见 [`docs/architecture.zh.md`](docs/architecture.zh.md) 与 [`docs/team-collaboration.zh.md`](docs/team-collaboration.zh.md)。
|
|
129
|
+
|
|
130
|
+
## 致谢
|
|
131
|
+
|
|
132
|
+
dsh-agent-team 的协作形态——具名 Agent 成员、Channel、Task Thread、@mention 路由与成员级记忆——来源于 [Raft](https://raft.build/) 并借鉴了它的若干设计。感谢他们的工作。
|
|
116
133
|
|
|
117
134
|
## 许可证
|
|
118
135
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wowyuarm/dsh-agent-team",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "A persistent agent team for long-running collaboration in DeepSeek Harness",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/wowyuarm/dsh-agent-team.git"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"cordis.patch.yml",
|
|
13
13
|
"packages/agent-team/lib/**/*",
|
|
14
14
|
"packages/agent-team/preset/**/*",
|
|
15
|
+
"packages/agent-team/core-skills/**/*",
|
|
15
16
|
"packages/tool-agent-team/lib/**/*",
|
|
16
17
|
"packages/client-agent-team/lib/**/*",
|
|
17
18
|
"README.md",
|
|
@@ -105,6 +106,10 @@
|
|
|
105
106
|
"types": "./packages/agent-team/lib/types/member-context.d.ts",
|
|
106
107
|
"default": "./packages/agent-team/lib/member-context.js"
|
|
107
108
|
},
|
|
109
|
+
"./member-skills": {
|
|
110
|
+
"types": "./packages/agent-team/lib/types/member-skills.d.ts",
|
|
111
|
+
"default": "./packages/agent-team/lib/member-skills.js"
|
|
112
|
+
},
|
|
108
113
|
"./tools": {
|
|
109
114
|
"types": "./packages/tool-agent-team/lib/types/index.d.ts",
|
|
110
115
|
"default": "./packages/tool-agent-team/lib/index.js"
|
|
@@ -18,6 +18,12 @@ Every operation record carries a positive global sequence, unique operation and
|
|
|
18
18
|
|
|
19
19
|
Member creation commits one stable Member/session/Workspace/preset/private-memory identity before unpublished Agent setup. Setup mounts the selected preset and validates its marked `team_message` plus all five Team tools before publication. Failure leaves only that Member unavailable. Suspend waits for the owned `AgentHandle` to stop; resume and Host remount restore the exact persisted session.
|
|
20
20
|
|
|
21
|
+
Members optionally carry durable capability intent (`capabilities.tools.allow`, `capabilities.skills.allow`). It flows verbatim through every lifecycle operation, replays unchanged after Host restart, and commits without known-name validation so Harness upgrades can never break old ledgers; divergence from known names surfaces at activation as derived, non-persisted `capabilityWarnings`. `tools.allow` is a deliberate interface reservation (no UI write path today) that future Runtime Revision manifest orchestration depends on. Edits follow absent-clears semantics like `model`: a caller that does not manage capabilities must echo the stored value back or its edit clears the override.
|
|
22
|
+
|
|
23
|
+
Activation applies `tools.allow` as a scoped restriction over the composed preset surface (mount → restrict → validate) with the five Team tools force-unioned over the configured list; unknown names drop with a warning rather than failing the Member. A live allow-list edit swaps the restriction at a turn boundary in the same Session — idle Members apply immediately, and an edit racing a running turn waits for it while later lifecycle operations queue behind the wait. Restriction failures isolate to that Member's activation diagnostic.
|
|
24
|
+
|
|
25
|
+
Skills are Member-private: the preset has no shared skill-filesystem row, and the Host registers one provider per Member that scans exactly the plugin's bundled read-only core skills (`packages/agent-team/core-skills/` — the `member-skill-manager` meta skill that owns all skill craft guidance) plus that Member's writable `skills/` directory under its private memory path (default roots excluded). Installing is writing into the Member's own directory — directory form `skills/<name>/SKILL.md` with optional references and scripts, or a flat `.md` — and there is deliberately no upload Remote. The persona itself only states the private-space physical facts; the meta skill's description routes skill-management work to it. `skills.allow` filters the catalog through a live selection ref swapped at the same turn boundary; the filesystem watcher feeds discovery after a self-install.
|
|
26
|
+
|
|
21
27
|
Every team-managed session records `danger-full-access`. Project cwd remains the Workspace path, while private memory lives under `$DSH_HOME/agent-team/members/<memberId>/`. An untitled Member session is named with its handle through the session-title service, so the ordinary Session list shows the Member identity; an explicit rename or any earlier title always wins. The isolated `team-member` preset also provides coding tools including model-facing web search, Workspace instruction discovery, and Team protocol guidance. The host owns the shared Web service and provider; the preset mounts only the model-facing web tool. Its lowercase `memory.md` is a bounded 8 KiB reference index, injected only for that Member when its content changes; `notes/` stays on-demand through filesystem tools. Over-budget indexes receive a maintenance warning, not silent truncation. Ordinary sessions and forks receive no Team identity or private-memory context. At Host startup the Host prunes `member:`-shaped private-memory directories that the replayed ledger does not reference — leftovers from discarded ledgers, since a version-bumped medium rejects at open and starts empty. Prune failures fail startup; entries outside the `member:` shape are left untouched.
|
|
22
28
|
|
|
23
29
|
Adding a Member to a Channel grants future read/send/claim authority but injects no historical Messages into the member session. Every top-level Message creates a Thread; new Client/tool starts explicitly choose taskless while released-client omission remains taskful, and a Human can later promote a taskless Thread by atomically adding its Task overlay and a structured `promote` Task activity. Thread Attention starts when a Thread is created, a Claim is created, a member follows, a top-level Message mentions them, or a Human confirms an invitation. Ordinary unread is derived from Attention; structured mentions create durable direct markers, while terminal Task changes retain sparse Activity markers for affected followers after Attention ends. `team_inbox` and Thread reads are Host projections, not Session inbox contents. A direct mention context includes its Message body and source; Task/Claim changes — including promotion — include concise transition facts; ordinary unread carries a body-free Thread-first route. Pending hints are coalesced, ignored hints do not loop, and resume/error recovery derives a new hint from durable unread state. For recoverable service failures, the Host wakes a Member after each of the first two consecutive `agent/error` occurrences, then leaves the third failure for the operator; only a clean turn resets that run.
|
|
@@ -18,6 +18,12 @@ Service 使用 `ctx.storageDomain`、`ctx.workspaceRegistry`、`ctx.agents`、`c
|
|
|
18
18
|
|
|
19
19
|
创建 Member 时,先提交稳定的 Member/session/Workspace/preset/private-memory 身份,再执行 unpublished Agent setup。Setup 挂载指定 preset,并在发布前检查带 marker 的 `team_message` 和全部五个 Team tools。失败只把该 Member 标为 unavailable。Suspend 等待所属 `AgentHandle` 完全停止;resume 和 Host remount 恢复同一个持久 session。
|
|
20
20
|
|
|
21
|
+
Member 可携带持久能力意图(`capabilities.tools.allow`、`capabilities.skills.allow`)。它随全部 lifecycle operation 原样流转,Host restart 后原样重放,commit 时不做已知名校验(Harness 升级不会破坏旧 ledger);与已知名的偏差在 activation 时派生为不持久化的 `capabilityWarnings`。`tools.allow` 是有意的接口预留(当前无 UI 写入路径),供后续 Runtime Revision manifest 编排依赖。编辑语义与 `model` 一致(absent 即清除):不管理 capabilities 的调用方必须回传已存储的值,否则其编辑会清掉该覆盖。
|
|
22
|
+
|
|
23
|
+
Activation 把 `tools.allow` 作为 scoped restriction 应用在已组合的 preset 面上(mount → restrict → validate),五个 Team tools 在配置之上强制并集;未知名 drop + warning,不使 Member 失败。对 live Member 的 allow-list 编辑在 turn 边界同 Session 换装 restriction——idle 立即生效,与 running turn 竞争的编辑等待其结束,后续 lifecycle 操作在该等待之后排队。restriction 失败只隔离为该 Member 的 activation diagnostic。
|
|
24
|
+
|
|
25
|
+
Skills 是 Member 私有的:preset 不带共享 skill-filesystem row,Host 为每个 Member 注册一个 provider,只扫插件内置的只读 core skills(`packages/agent-team/core-skills/`——`member-skill-manager` meta skill,全部 skill 写作/安装/credentials 引导都在它里面)加该 Member 可写的私有 `skills/` 目录(排除默认 roots)。安装就是往自己目录写——目录形态 `skills/<name>/SKILL.md` + 可选 references/scripts,或平铺 `.md`——有意不提供上传 Remote。persona 只陈述私有空间物理事实,meta skill 的 description 负责"涉及 skill 管理工作时先读我"。`skills.allow` 通过同一 turn 边界换装的 live selection ref 过滤 catalog;自装后的发现由 filesystem watcher 驱动。
|
|
26
|
+
|
|
21
27
|
每个 Team 管理的 session 都会持久写入 `danger-full-access`。项目 cwd 仍是 Workspace 路径,私有记忆位于 `$DSH_HOME/agent-team/members/<memberId>/`。没有标题的 Member session 会通过 session-title service 以 handle 命名,普通 Session 列表因此直接显示 Member 身份;显式重命名或任何既有标题始终优先。隔离的 `team-member` preset 还提供 coding 工具、面向模型的 Web 搜索、Workspace instruction discovery 和 Team protocol guidance。共享的 Web service 与 provider 仍由 Host 持有;preset 只挂载面向模型的 Web tool。小写 `memory.md` 是有界的 8 KiB 参考索引,只有该 Member 的内容变化时才注入;`notes/` 只通过 filesystem tools 按需读取。超预算索引只产生维护警告,不静默截断。普通 session 和 fork 不获得 Team 身份或私有记忆上下文。Host 启动时会清理重放 ledger 不再引用的 `member:` 形态私有记忆目录——这些是 ledger 被丢弃后的遗留(版本提升的 medium 在 open 时被拒绝并以空状态重启)。清理失败会使启动失败;非 `member:` 形态的条目保持原样。
|
|
22
28
|
|
|
23
29
|
把 Member 加入 Channel 只授予之后的 read/send/claim authority,不向 Member session 注入历史 Message。每条顶层 Message 都创建 Thread;新 Client/tool 显式选择 taskless,released Client 省略意图时仍保持 taskful;Human 可之后 promotion taskless Thread,原子附加 Task overlay 与结构化 `promote` Task activity。创建 Thread、创建 Claim、显式 follow、顶层消息 mention 到、或 Human 确认邀请会开始 Thread Attention。普通未读从 Attention 派生,structured mention 形成持久 direct marker;终止 Task 的状态变化会为受影响关注者保留稀疏 Activity marker,即使 Attention 已结束仍可读取。`team_inbox` 和 Thread read 是 Host projection,不是 Session inbox 内容。Direct mention context 包含消息正文和来源,Task/Claim 变化(含 promotion)包含简短状态事实,普通未读提供无正文的 Thread-first 路由。提示会合并,忽略提示不会形成循环,resume/runtime error recovery 会从持久未读状态重新判断是否提示。对于可恢复的服务错误,Host 会在连续 `agent/error` occurrence 的前两次后唤醒 Member;第 3 次错误则交给 operator,只有 clean turn 才会重置这段连续错误。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: member-skill-manager
|
|
3
|
+
description: Create, install, revise, or retire this Member's private skills, including how a skill manages its configuration and credentials. Read this skill before creating, installing, revising, or retiring any skill in this Member's private skills directory, or when repeated or fragile work has produced a reusable method worth preserving as a skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Member Skill Manager
|
|
7
|
+
|
|
8
|
+
A skill preserves a reusable way of working. It is not a memory, a personal preference, or a record of one event.
|
|
9
|
+
|
|
10
|
+
## Decide
|
|
11
|
+
|
|
12
|
+
Create or revise a skill when the method has been demonstrated in real work and will make later work clearer or more reliable. Keep one-off work, changing facts, and personal continuity in this Member's notes and memory index instead.
|
|
13
|
+
|
|
14
|
+
## Create Or Install
|
|
15
|
+
|
|
16
|
+
This Member's private skills live in its private skills directory — the absolute path injected into your context (the one ending in `/skills`); it is outside the Workspace cwd, so never use a cwd-relative path for it. A skill is a directory there:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
<private-skills>/my-skill/
|
|
20
|
+
SKILL.md # required: front matter + instructions
|
|
21
|
+
references/ # optional: longer material only some uses need
|
|
22
|
+
scripts/ # optional: runnable helpers the skill calls
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Install an offered skill by copying its directory there; no registration command is needed — the catalog discovers the change within its filesystem-watch window, so a later catalog query lists it. A single flat `.md` file also works, but the directory form is the norm for anything that carries references or scripts.
|
|
26
|
+
|
|
27
|
+
Use a short lowercase hyphenated name. Keep the directory name and the `name` field the same, and do not reuse a name this catalog already lists (built-ins included).
|
|
28
|
+
|
|
29
|
+
## Write
|
|
30
|
+
|
|
31
|
+
Describe the method the next Member turn needs, not general advice it already knows. Make the description name the real triggers. Keep the main instructions in `SKILL.md` short. Put substantial scripts, references, or templates beside `SKILL.md` only when they are repeatedly useful. For a substantial new or revised skill, read [Writing Great Skills](references/writing-great-skills.md).
|
|
32
|
+
|
|
33
|
+
## Review
|
|
34
|
+
|
|
35
|
+
Read the finished skill once. Check that its name, description, directory, and method agree, and that nothing already in this Member's catalog owns the same method or name.
|
|
36
|
+
|
|
37
|
+
Writing or changing a skill adds no tools, credentials, permissions, or external services. The current turn keeps its existing skill list; a later turn discovers the change.
|
|
38
|
+
|
|
39
|
+
## Configuration and credentials
|
|
40
|
+
|
|
41
|
+
A skill that needs an API key, token, or other secret keeps it in its own `auth.json` (JSON, one file per skill, inside that skill's directory) and reads it from there at run time; it never puts the secret in `SKILL.md`, scripts, messages, notes, or any other persisted text. Non-secret settings live in `config.json` beside it. Document the exact read/use convention in the skill's `SKILL.md` (file names, expected JSON shape, and how scripts consume them). See [Configuration and Credentials for Skills](references/auth-and-config.md) for the operating convention.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Configuration and Credentials for Skills
|
|
2
|
+
|
|
3
|
+
A skill may need credentials (API keys, tokens) or non-secret configuration (endpoints, limits, defaults). This is the operating convention for how a Member manages those files when installing an external skill or creating its own.
|
|
4
|
+
|
|
5
|
+
## File layout
|
|
6
|
+
|
|
7
|
+
Every skill keeps its own files inside its skill directory:
|
|
8
|
+
|
|
9
|
+
- `auth.json` — credentials. JSON object; one entry per service or purpose, e.g. `{"weread": "<api-key>"}`.
|
|
10
|
+
- `config.json` — non-secret configuration. JSON object; whatever the skill needs, e.g. `{"baseUrl": "https://...", "maxResults": 5}`.
|
|
11
|
+
|
|
12
|
+
A skill that needs neither file simply does not have them. Do not scatter credential files elsewhere or share one file across skills.
|
|
13
|
+
|
|
14
|
+
## Writing a skill's SKILL.md
|
|
15
|
+
|
|
16
|
+
The skill's `SKILL.md` must document how the skill reads these files:
|
|
17
|
+
|
|
18
|
+
- the exact file names and expected JSON shape,
|
|
19
|
+
- how scripts consume them (for example `AUTH=$(cat auth.json)` in a shell script, or `json.load(open("auth.json"))` in Python, resolved relative to the skill directory),
|
|
20
|
+
- which config keys exist and what they do.
|
|
21
|
+
|
|
22
|
+
## What never goes in plain text
|
|
23
|
+
|
|
24
|
+
Credentials do not appear in `SKILL.md`, in scripts, in messages, in notes, in the Member's memory index, or in any other persisted or shared text. Scripts read them from `auth.json` at run time; they are never echoed into output, logs, or chat. When a Human provides a credential through a DM or attachment, write it into the skill's `auth.json` and reference it only as a file.
|
|
25
|
+
|
|
26
|
+
## Creating or installing a skill
|
|
27
|
+
|
|
28
|
+
- Create or copy the skill directory into this Member's private skills directory (the absolute injected path ending in `/skills`).
|
|
29
|
+
- If the skill needs credentials or configuration, create `auth.json` / `config.json` in that directory with the layout above and document the read convention in its `SKILL.md`.
|
|
30
|
+
- When the skill is a copy of an external skill that already has its own layout, keep that layout unless it conflicts with this convention; resolve conflicts by moving credentials into `auth.json` and updating `SKILL.md` accordingly.
|
package/packages/agent-team/core-skills/member-skill-manager/references/writing-great-skills.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Writing Great Skills
|
|
2
|
+
|
|
3
|
+
A skill makes a method more predictable across future work. Keep the process stable; let judgment and output remain appropriate to the situation.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
The description is the skill's index. State what it does and the distinct situations that should cause it to be read. Do not spend it on details that belong in the body.
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
Put the steps every use needs in `SKILL.md`. Give fragile steps a concrete completion check. Keep definitions, variants, and long examples in a directly linked reference when only some uses need them.
|
|
12
|
+
|
|
13
|
+
Use the least rigid form that preserves the method: guidance for judgment, a parameterized recipe for a preferred pattern, and a precise script only for work that is fragile or must be repeatable.
|
|
14
|
+
|
|
15
|
+
## Prune
|
|
16
|
+
|
|
17
|
+
Keep each rule in one place. Remove duplicated, stale, and obvious advice. A skill should carry only the knowledge that changes how the next turn can work.
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ManualCompactionError } from '@deepseek-ai/dsh-compaction';
|
|
2
2
|
/** Strict threshold: 200K exactly does not compact. */
|
|
3
3
|
export const AUTO_COMPACTION_TOKEN_LIMIT = 200_000;
|
|
4
|
+
/**
|
|
5
|
+
* Suggested summary marker of the pre-compaction memory hint. Same shape as
|
|
6
|
+
* the inbox and recovery notices so future turns can recognize it.
|
|
7
|
+
*/
|
|
8
|
+
export const PRE_COMPACTION_NOTICE_SUMMARY = 'Compaction is imminent; consider persisting key conclusions.';
|
|
9
|
+
/** Suggested pre-compaction hint body; writing is the Agent's own call. */
|
|
10
|
+
export function preCompactionNoticeText() {
|
|
11
|
+
return 'This session is about to be compacted, which will summarize away the current conversation detail. If there are durable conclusions worth keeping — validated facts, decisions, or reusable details — consider writing them to your memory or notes now. This is only a reminder: decide yourself whether anything is worth persisting, and do nothing if not. Do not start new work because of this message.';
|
|
12
|
+
}
|
|
4
13
|
/** Claim owners of a durable Human acceptance, including early-completed ones. */
|
|
5
14
|
export function acceptedTaskCompactionMembers(operation) {
|
|
6
15
|
if (operation.kind !== 'team/task-changed' || operation.actor.kind !== 'human' || operation.data.activity.kind !== 'accept')
|
|
@@ -69,11 +78,40 @@ export class AutoCompactionCoordinator {
|
|
|
69
78
|
this.fail(memberId, agent, 'automatic compaction failed: tokenMeter is unavailable in the Member scope');
|
|
70
79
|
return;
|
|
71
80
|
}
|
|
72
|
-
|
|
81
|
+
let before = meter.measure(agent.session).totalTokens;
|
|
73
82
|
if (before <= AUTO_COMPACTION_TOKEN_LIMIT) {
|
|
74
83
|
this.complete(memberId, agent);
|
|
75
84
|
return;
|
|
76
85
|
}
|
|
86
|
+
// The session is over the threshold and about to be compacted: steer one
|
|
87
|
+
// advisory hint so the Agent can persist its own key conclusions first.
|
|
88
|
+
// The hint turn itself is ordinary agent work — its failure is contained
|
|
89
|
+
// by the agent loop and never blocks compaction; only the fresh idle
|
|
90
|
+
// boundary is awaited before the final measurement and compactNow.
|
|
91
|
+
if (this.options.steerPreCompaction !== undefined) {
|
|
92
|
+
try {
|
|
93
|
+
this.options.steerPreCompaction(agent);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
this.options.log(`pre-compaction memory hint failed: ${describe(error)} (member ${memberId}, session ${agent.id})`);
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
if (!(await waitForIdleOrAbort(agent, this.controller.signal)))
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
this.options.log(`pre-compaction hint idle wait failed: ${describe(error)} (member ${memberId}, session ${agent.id})`);
|
|
104
|
+
}
|
|
105
|
+
if (this.controller.signal.aborted)
|
|
106
|
+
return;
|
|
107
|
+
if (this.options.agentForMember(memberId) !== agent)
|
|
108
|
+
continue;
|
|
109
|
+
before = meter.measure(agent.session).totalTokens;
|
|
110
|
+
if (before <= AUTO_COMPACTION_TOKEN_LIMIT) {
|
|
111
|
+
this.complete(memberId, agent);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
77
115
|
const engine = this.options.compactionForAgent(agent);
|
|
78
116
|
if (engine === undefined) {
|
|
79
117
|
// A roster-subtree teardown (bundle-row reload, config hot-apply)
|