@modesto_ma/dsh-channels 0.1.0 → 0.3.0
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 +89 -55
- package/docs/access-control-design.md +5 -5
- package/docs/feasibility-and-design.md +54 -26
- package/docs/feishu-onboarding.md +26 -20
- package/docs/persistence.md +4 -4
- package/docs/refactor-plan.md +6 -5
- package/docs/workspace-isolation-design.md +78 -0
- package/lib/client.js +1715 -882
- package/lib/client.js.map +1 -1
- package/lib/index.js +1556 -680
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cards/index.ts +1 -0
- package/src/cards/onboarding.ts +23 -0
- package/src/cards/primitives.ts +20 -0
- package/src/cards/streaming.ts +310 -291
- package/src/cleanup.ts +256 -119
- package/src/client/api.ts +20 -0
- package/src/client/catalog.ts +1 -1
- package/src/client/index.ts +1 -1
- package/src/client/panel/access-card.tsx +294 -0
- package/src/client/panel/access-tab.tsx +46 -0
- package/src/client/panel/advanced-tab.tsx +80 -0
- package/src/client/panel/cleanup-card.tsx +106 -0
- package/src/client/panel/connection-tab.tsx +214 -0
- package/src/client/panel/credentials-card.tsx +104 -0
- package/src/client/panel/index.tsx +862 -0
- package/src/client/panel/model-tab.tsx +23 -0
- package/src/client/panel/sessions-tab.tsx +21 -0
- package/src/client/panel/shared.tsx +488 -0
- package/src/client/panel/workspace-tab.tsx +40 -0
- package/src/client/styles.ts +24 -6
- package/src/config.ts +44 -12
- package/src/domain.ts +34 -3
- package/src/feishu/agent-context.ts +9 -5
- package/src/index.ts +32 -14
- package/src/routing/inbound.ts +88 -43
- package/src/service.ts +259 -65
- package/src/session/isolation.ts +277 -0
- package/src/session/manager.ts +63 -20
- package/src/session/repair.ts +2 -3
- package/src/session/routes.ts +2 -0
- package/src/session-commands.ts +41 -14
- package/src/settings/contract.ts +223 -47
- package/src/settings/directory-picker.ts +121 -0
- package/src/settings/routes.ts +49 -2
- package/src/settings/surface.ts +171 -25
- package/src/streamer.ts +70 -30
- package/src/workspaces.ts +50 -28
- package/src/client/panel.tsx +0 -1475
package/package.json
CHANGED
package/src/cards/index.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-time onboarding card: what the bot does, how workspaces are scoped, and
|
|
3
|
+
* the command cheat sheet. Sent on the first private message of a chat.
|
|
4
|
+
*
|
|
5
|
+
* Static content, deliberately kept apart from the streaming reply card.
|
|
6
|
+
*
|
|
7
|
+
* @module dsh-channels/cards/onboarding
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { card, markdown, note } from './primitives.ts'
|
|
11
|
+
|
|
12
|
+
/** First-contact onboarding card (private chats only, once per chat). */
|
|
13
|
+
export function buildOnboardingCard(): object {
|
|
14
|
+
return card([
|
|
15
|
+
markdown('**👋 欢迎使用飞书 DSH**'),
|
|
16
|
+
markdown('直接发消息即可开始一个会话,我会在话题里流式回复;话题内继续发消息无需再 @ 我。'),
|
|
17
|
+
markdown('**工作区**:私聊一人一个;群里每位成员各自一个,互不影响。'),
|
|
18
|
+
markdown('**常用命令**:`/help` 命令列表 · `/status` 会话状态 · `/workspace` 工作目录\n'
|
|
19
|
+
+ '`/effort` 推理强度 · `/model` 模型 · `/permissions` 权限预设\n'
|
|
20
|
+
+ '`/new` 新建会话 · `/stop` 中断当前回合 · `/history` 历史 · `/export` 导出日志'),
|
|
21
|
+
note('需要授权或补充信息时,我会发一张卡片,点按钮或直接回复即可。'),
|
|
22
|
+
])
|
|
23
|
+
}
|
package/src/cards/primitives.ts
CHANGED
|
@@ -57,6 +57,26 @@ export function textButton(options: TextButtonOptions): object {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Collapsible fold panel: collapsed by default, grey rounded border, and a
|
|
62
|
+
* built-in right-aligned chevron that flips when expanded. Used for the
|
|
63
|
+
* streaming card's reasoning window and any future "secondary detail" area.
|
|
64
|
+
*/
|
|
65
|
+
export function foldPanel(title: string, content: string, iconToken: string): object {
|
|
66
|
+
return {
|
|
67
|
+
tag: 'collapsible_panel',
|
|
68
|
+
expanded: false,
|
|
69
|
+
border: { color: 'grey', corner_radius: '8px' },
|
|
70
|
+
header: {
|
|
71
|
+
title: { tag: 'plain_text', content: title },
|
|
72
|
+
icon: { tag: 'standard_icon', token: iconToken },
|
|
73
|
+
icon_position: 'right',
|
|
74
|
+
icon_expanded_angle: 180,
|
|
75
|
+
},
|
|
76
|
+
elements: [markdown(content)],
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
60
80
|
/** A row of equal-width columns, each holding one element. */
|
|
61
81
|
export function columnSet(
|
|
62
82
|
columns: object[],
|