dsh-caduceus 0.7.1 → 0.10.5

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 CHANGED
@@ -15,7 +15,7 @@
15
15
  - **One scope, one session** — p2p, topic, and group-per-user sessions are kept separate.
16
16
  - **Visible titles** — generated from the first prompt and shown on the turn card.
17
17
  - **One card per turn** — status and answer live in the same card, edited in place; the final answer is not a second message.
18
- - **12 commands** — `/new`, `/sessions`, `/rename`, `/resume`, `/adopt`, `/status`, `/stop`, `/doctor`, `/selfcheck`, `/persona`, `/whoami`, `/help`.
18
+ - **15 commands** — `/new`, `/sessions`, `/rename`, `/resume`, `/adopt`, `/status`, `/stop`, `/doctor`, `/selfcheck`, `/persona`, `/whoami`, `/export`, `/permission`, `/usage`, `/help`.
19
19
  - **Persona** — `SOUL.md` is synced into the `AGENTS.md` block, automatically at startup.
20
20
  - **Observability** — two-stage self-check, `/doctor`, and in-chat degradation warnings.
21
21
 
@@ -81,7 +81,7 @@ onlyBuiltDependencies:
81
81
  | `approvalCard` | `true` | Send interactive approval cards (`allow once` / `reject`) |
82
82
  | `questionCard` | `true` | Send interactive question cards; single-select ≤4 options get buttons |
83
83
  | `interactiveTimeoutMs` | `300000` | How long an approval/question card waits before it expires |
84
- | `approvalPolicy` | `ask` | Session approval policy: `ask` (card confirmation, default) or `never` |
84
+ | `approvalPolicy` | unset | Optional override: `ask` / `never`; unset leaves dsh approval policy untouched |
85
85
  | `reactions` | `true` | Emoji reactions on messages: `OnIt` while running, `DONE`/`CROSS_MARK` at turn end |
86
86
  | `reactionOnStart` | `OnIt` | Reaction added when a user message is accepted |
87
87
  | `reactionOnDone` | `DONE` | Reaction added when a turn completes |
@@ -95,6 +95,9 @@ onlyBuiltDependencies:
95
95
  | `maxSendImageBytes` | `10485760` | Outbound image limit (10 MiB) |
96
96
  | `mediaRoots` | `[]` | Allowed roots for outbound paths (empty = session cwd) |
97
97
  | `admins` | `[]` | Admin open-id allowlist; empty disables access control |
98
+ | `lang` | `zh` | Permission UI language: `zh` (default), `en`, or `auto` (settings/env, then zh) |
99
+ | `exportCacheMaxAgeHours` | `24` | Delete `/export` cache files older than this on startup |
100
+ | `metrics` | `compact` | Process-card metrics: `off`, `compact`, or `detailed` (adds context %) |
98
101
 
99
102
  ## Commands
100
103
 
@@ -111,6 +114,9 @@ onlyBuiltDependencies:
111
114
  | `/selfcheck` | Re-run both self-check stages and print every item |
112
115
  | `/persona [show\|sync]` | Show or sync the SOUL persona block |
113
116
  | `/whoami` | Show your open_id, current chat/topic, and admin/guest role |
117
+ | `/export [--json]` | Export the current session as markdown or raw JSONL and send it as a file |
118
+ | `/permission [preset]` | Permission card: current preset, usage line, and one switch button per preset; labels and copy follow the dsh locale |
119
+ | `/usage` | Token usage: this turn, previous turn, and session total |
114
120
  | `/help` | Command table |
115
121
 
116
122
  ## Troubleshooting
package/README.zh.md CHANGED
@@ -15,7 +15,7 @@
15
15
  - **一个 scope 一个会话** — 私聊、话题、普通群按发送者隔离。
16
16
  - **标题可见** — 由第一条 prompt 生成,显示在回合卡上。
17
17
  - **每回合一张卡** — 状态与答案在同一张卡里,原地编辑;终稿不再另发一条消息。
18
- - **12 条命令** — `/new`、`/sessions`、`/rename`、`/resume`、`/adopt`、`/status`、`/stop`、`/doctor`、`/selfcheck`、`/persona`、`/whoami`、`/help`。
18
+ - **15 条命令** — `/new`、`/sessions`、`/rename`、`/resume`、`/adopt`、`/status`、`/stop`、`/doctor`、`/selfcheck`、`/persona`、`/whoami`、`/export`、`/permission`、`/usage`、`/help`。
19
19
  - **人格** — `SOUL.md` 同步到 `AGENTS.md` 的标记块,启动时自动执行。
20
20
  - **可观测性** — 两阶段自检、`/doctor`、对话内的降级提示。
21
21
 
@@ -80,7 +80,7 @@ onlyBuiltDependencies:
80
80
  | `approvalCard` | `true` | 发交互审批卡(允许一次 / 拒绝) |
81
81
  | `questionCard` | `true` | 发交互选项卡;单选且 ≤4 个选项时显示按钮 |
82
82
  | `interactiveTimeoutMs` | `300000` | 审批/选项卡等待多久后过期 |
83
- | `approvalPolicy` | `ask` | 会话审批策略:`ask`(弹卡确认,默认)或 `never` |
83
+ | `approvalPolicy` | 未设置 | 可选覆盖:`ask` / `never`;不设置则完全不动 dsh 的审批策略 |
84
84
  | `reactions` | `true` | 消息表情反馈:处理中 `OnIt`,结束 `DONE`/`CROSS_MARK` |
85
85
  | `reactionOnStart` | `OnIt` | 收到用户消息时添加的表情 |
86
86
  | `reactionOnDone` | `DONE` | 回合完成时添加的表情 |
@@ -94,6 +94,9 @@ onlyBuiltDependencies:
94
94
  | `maxSendImageBytes` | `10485760` | 发送图片上限(10 MiB) |
95
95
  | `mediaRoots` | `[]` | 允许发送的目录(空=会话 cwd) |
96
96
  | `admins` | `[]` | 管理员 open_id 白名单;空=关闭访问控制 |
97
+ | `lang` | `zh` | 权限面语言:`zh`(默认)、`en`、`auto`(设置/环境,最后回退 zh) |
98
+ | `exportCacheMaxAgeHours` | `24` | 启动时清理超过该小时数的 `/export` 缓存文件 |
99
+ | `metrics` | `compact` | 卡片指标:`off` / `compact` / `detailed`(增加上下文百分比) |
97
100
 
98
101
  ## 命令
99
102
 
@@ -110,6 +113,9 @@ onlyBuiltDependencies:
110
113
  | `/selfcheck` | 立即重跑两阶段自检并输出逐项明细 |
111
114
  | `/persona [show\|sync]` | 查看或同步 SOUL 人格块 |
112
115
  | `/whoami` | 显示你的 open_id、当前会话与身份 |
116
+ | `/export [--json]` | 把当前会话导出为 markdown 或原始 JSONL 并发回文件 |
117
+ | `/permission [档位]` | 权限卡片:当前档位、用法行、每个档位一个切换按钮;文案与档位名跟随 dsh 语言 |
118
+ | `/usage` | 本回合、上回合、会话合计 token 用量 |
113
119
  | `/help` | 命令表 |
114
120
 
115
121
  ## Troubleshooting(故障排查)
package/cordis.patch.yml CHANGED
@@ -10,5 +10,7 @@
10
10
  - insert:
11
11
  - id: caduceus-gateway
12
12
  name: 'dsh-caduceus'
13
+ config:
14
+ lang: zh
13
15
  - id: caduceus-persona
14
16
  name: 'dsh-caduceus/persona'
@@ -1,5 +1,5 @@
1
1
  import { type StatusEventLike, type StatusSnapshot } from '../status.js';
2
- import type { FeishuCard, InboundMessage } from '../transport/types.js';
2
+ import type { CardAction, FeishuCard, InboundMessage } from '../transport/types.js';
3
3
  import type { BridgeOptions } from './types.js';
4
4
  /** Extract the assistant's text from one `assistant/message` payload. */
5
5
  export declare function assistantTextFromEvent(data: unknown): string;
@@ -19,6 +19,11 @@ export declare class Bridge {
19
19
  handleSessionEvent(session: {
20
20
  readonly id: string;
21
21
  }, event: StatusEventLike): Promise<void>;
22
+ /** `/permission`: Chinese overview; switches still go through dsh's command. */
23
+ /** Permission-card button callback: run the same dsh switch, then patch the card. */
24
+ handlePermissionCardAction(action: CardAction, name: string): Promise<void>;
25
+ /** Stop button callback: same cancel path as `/stop`, once per second. */
26
+ handleStopCardAction(action: CardAction): Promise<void>;
22
27
  /**
23
28
  * Send an interactive card the same way process cards go out: reply into the
24
29
  * originating topic/thread when the session still has a live scope. Falls
@@ -30,4 +35,4 @@ export declare class Bridge {
30
35
  }>;
31
36
  }
32
37
  /** Build the process card for one snapshot (exported for render tests). */
33
- export declare function progressCardForSnapshot(snapshot: StatusSnapshot, sessionTitle: string | undefined, recentEvent: string, tail: string, now: number, presetMissing?: boolean): FeishuCard;
38
+ export declare function progressCardForSnapshot(snapshot: StatusSnapshot, sessionTitle: string | undefined, recentEvent: string, tail: string, now: number, presetMissing?: boolean, extraLines?: readonly string[], stopButton?: boolean): FeishuCard;