@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
|
@@ -15,8 +15,6 @@ export declare const zh: {
|
|
|
15
15
|
readonly retry: "重试";
|
|
16
16
|
readonly agentName: "名称";
|
|
17
17
|
readonly agentDescription: "说明";
|
|
18
|
-
readonly initialChannels: "初始频道";
|
|
19
|
-
readonly noChannelsForAgent: "请先创建至少一个频道";
|
|
20
18
|
readonly createAgent: "创建 Agent";
|
|
21
19
|
readonly creatingAgent: "正在创建…";
|
|
22
20
|
readonly loadingAgents: "正在加载 Agents…";
|
|
@@ -40,10 +38,15 @@ export declare const zh: {
|
|
|
40
38
|
readonly restartAgent: "重启";
|
|
41
39
|
readonly restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}";
|
|
42
40
|
readonly restartFailed: "重启执行失败:{message}";
|
|
41
|
+
readonly clearContextAgent: "从全新上下文开始";
|
|
42
|
+
readonly clearContextWorkingReason: "成员正在工作中,完成后才能清空上下文";
|
|
43
|
+
readonly clearContextUnavailableReason: "成员当前不可用,恢复在线且空闲后才能清空上下文";
|
|
44
|
+
readonly clearContextTitle: "从全新上下文开始:{name}";
|
|
45
|
+
readonly clearContextNotice: "将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。";
|
|
46
|
+
readonly clearContextConfirm: "开始全新上下文";
|
|
47
|
+
readonly clearContextFailed: "清空上下文失败:{message}";
|
|
43
48
|
readonly optionalSuffix: "(可选)";
|
|
44
49
|
readonly agentDescriptionPlaceholder: "留空则暂无描述";
|
|
45
|
-
readonly channelsPickerEmpty: "选择初始频道";
|
|
46
|
-
readonly channelsPickerCount: "已选 {count} 个频道";
|
|
47
50
|
readonly membersPickerEmpty: "选择初始成员";
|
|
48
51
|
readonly membersPickerCount: "已选 {count} 个成员";
|
|
49
52
|
readonly reasoningEffort: "推理强度";
|
|
@@ -92,6 +95,7 @@ export declare const zh: {
|
|
|
92
95
|
readonly promoteToTask: "转为 Task";
|
|
93
96
|
readonly promotingTask: "正在转为 Task…";
|
|
94
97
|
readonly mentionSuggestions: "提及成员建议";
|
|
98
|
+
readonly mentionAll: "通知所有成员({count})";
|
|
95
99
|
readonly messageDraft: "消息内容";
|
|
96
100
|
readonly composerNotify: "将通知:{ids}";
|
|
97
101
|
readonly messagePlaceholder: "写一条消息…";
|
|
@@ -104,10 +108,8 @@ export declare const zh: {
|
|
|
104
108
|
readonly backToWorkspace: "返回工作区";
|
|
105
109
|
readonly loadingThread: "正在加载 Thread…";
|
|
106
110
|
readonly unreadBoundary: "以下是本次打开收到的更新";
|
|
107
|
-
readonly
|
|
108
|
-
readonly
|
|
109
|
-
readonly remainingUnread: "还有 {count} 条未读更新";
|
|
110
|
-
readonly continueReading: "继续阅读";
|
|
111
|
+
readonly newUpdatesJump: "↓ {count} 条新更新";
|
|
112
|
+
readonly autoReadIncomplete: "仍有未读更新未能自动读取";
|
|
111
113
|
readonly olderHistory: "更早历史";
|
|
112
114
|
readonly runtimeRisk: "当前运行风险";
|
|
113
115
|
readonly runtimeRiskDetail: "@{member} 当前不可用:{diagnostic}";
|
|
@@ -155,8 +157,6 @@ export declare const en: {
|
|
|
155
157
|
readonly retry: "Retry";
|
|
156
158
|
readonly agentName: "Name";
|
|
157
159
|
readonly agentDescription: "Description";
|
|
158
|
-
readonly initialChannels: "Initial Channels";
|
|
159
|
-
readonly noChannelsForAgent: "Create at least one Channel first";
|
|
160
160
|
readonly createAgent: "Create Agent";
|
|
161
161
|
readonly creatingAgent: "Creating…";
|
|
162
162
|
readonly loadingAgents: "Loading Agents…";
|
|
@@ -180,10 +180,15 @@ export declare const en: {
|
|
|
180
180
|
readonly restartAgent: "Restart";
|
|
181
181
|
readonly restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}";
|
|
182
182
|
readonly restartFailed: "Restart failed: {message}";
|
|
183
|
+
readonly clearContextAgent: "Start from new context";
|
|
184
|
+
readonly clearContextWorkingReason: "The Member is working; clear once the current turn ends";
|
|
185
|
+
readonly clearContextUnavailableReason: "The Member is unavailable; only an idle available Member can start from a new context";
|
|
186
|
+
readonly clearContextTitle: "Start from new context: {name}";
|
|
187
|
+
readonly clearContextNotice: "This ends {name}'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.";
|
|
188
|
+
readonly clearContextConfirm: "Start from new context";
|
|
189
|
+
readonly clearContextFailed: "Failed to clear context: {message}";
|
|
183
190
|
readonly optionalSuffix: " (optional)";
|
|
184
191
|
readonly agentDescriptionPlaceholder: "Leave empty if not needed";
|
|
185
|
-
readonly channelsPickerEmpty: "Choose initial channels";
|
|
186
|
-
readonly channelsPickerCount: "{count} selected";
|
|
187
192
|
readonly membersPickerEmpty: "Choose initial members";
|
|
188
193
|
readonly membersPickerCount: "{count} selected";
|
|
189
194
|
readonly reasoningEffort: "Reasoning effort";
|
|
@@ -232,6 +237,7 @@ export declare const en: {
|
|
|
232
237
|
readonly promoteToTask: "Convert to Task";
|
|
233
238
|
readonly promotingTask: "Converting to Task…";
|
|
234
239
|
readonly mentionSuggestions: "Mention suggestions";
|
|
240
|
+
readonly mentionAll: "Notify all members ({count})";
|
|
235
241
|
readonly messageDraft: "Message";
|
|
236
242
|
readonly composerNotify: "Will notify: {ids}";
|
|
237
243
|
readonly messagePlaceholder: "Write a message…";
|
|
@@ -244,10 +250,8 @@ export declare const en: {
|
|
|
244
250
|
readonly backToWorkspace: "Back to Workspace";
|
|
245
251
|
readonly loadingThread: "Loading Thread…";
|
|
246
252
|
readonly unreadBoundary: "Updates received when you opened this Thread";
|
|
247
|
-
readonly
|
|
248
|
-
readonly
|
|
249
|
-
readonly remainingUnread: "{count} unread update(s) remain";
|
|
250
|
-
readonly continueReading: "Continue reading";
|
|
253
|
+
readonly newUpdatesJump: "↓ {count} new update(s)";
|
|
254
|
+
readonly autoReadIncomplete: "Some unread updates could not be read automatically";
|
|
251
255
|
readonly olderHistory: "Older history";
|
|
252
256
|
readonly runtimeRisk: "Current runtime risk";
|
|
253
257
|
readonly runtimeRiskDetail: "@{member} is unavailable: {diagnostic}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IL,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAA"}
|
|
@@ -15,8 +15,6 @@ export const zh = {
|
|
|
15
15
|
retry: '重试',
|
|
16
16
|
agentName: '名称',
|
|
17
17
|
agentDescription: '说明',
|
|
18
|
-
initialChannels: '初始频道',
|
|
19
|
-
noChannelsForAgent: '请先创建至少一个频道',
|
|
20
18
|
createAgent: '创建 Agent',
|
|
21
19
|
creatingAgent: '正在创建…',
|
|
22
20
|
loadingAgents: '正在加载 Agents…',
|
|
@@ -40,10 +38,15 @@ export const zh = {
|
|
|
40
38
|
restartAgent: '重启',
|
|
41
39
|
restartStillUnavailable: '重启已执行,成员仍不可用:{diagnostic}',
|
|
42
40
|
restartFailed: '重启执行失败:{message}',
|
|
41
|
+
clearContextAgent: '从全新上下文开始',
|
|
42
|
+
clearContextWorkingReason: '成员正在工作中,完成后才能清空上下文',
|
|
43
|
+
clearContextUnavailableReason: '成员当前不可用,恢复在线且空闲后才能清空上下文',
|
|
44
|
+
clearContextTitle: '从全新上下文开始:{name}',
|
|
45
|
+
clearContextNotice: '将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。',
|
|
46
|
+
clearContextConfirm: '开始全新上下文',
|
|
47
|
+
clearContextFailed: '清空上下文失败:{message}',
|
|
43
48
|
optionalSuffix: '(可选)',
|
|
44
49
|
agentDescriptionPlaceholder: '留空则暂无描述',
|
|
45
|
-
channelsPickerEmpty: '选择初始频道',
|
|
46
|
-
channelsPickerCount: '已选 {count} 个频道',
|
|
47
50
|
membersPickerEmpty: '选择初始成员',
|
|
48
51
|
membersPickerCount: '已选 {count} 个成员',
|
|
49
52
|
reasoningEffort: '推理强度',
|
|
@@ -92,6 +95,7 @@ export const zh = {
|
|
|
92
95
|
promoteToTask: '转为 Task',
|
|
93
96
|
promotingTask: '正在转为 Task…',
|
|
94
97
|
mentionSuggestions: '提及成员建议',
|
|
98
|
+
mentionAll: '通知所有成员({count})',
|
|
95
99
|
messageDraft: '消息内容',
|
|
96
100
|
composerNotify: '将通知:{ids}',
|
|
97
101
|
messagePlaceholder: '写一条消息…',
|
|
@@ -104,10 +108,8 @@ export const zh = {
|
|
|
104
108
|
backToWorkspace: '返回工作区',
|
|
105
109
|
loadingThread: '正在加载 Thread…',
|
|
106
110
|
unreadBoundary: '以下是本次打开收到的更新',
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
remainingUnread: '还有 {count} 条未读更新',
|
|
110
|
-
continueReading: '继续阅读',
|
|
111
|
+
newUpdatesJump: '↓ {count} 条新更新',
|
|
112
|
+
autoReadIncomplete: '仍有未读更新未能自动读取',
|
|
111
113
|
olderHistory: '更早历史',
|
|
112
114
|
runtimeRisk: '当前运行风险',
|
|
113
115
|
runtimeRiskDetail: '@{member} 当前不可用:{diagnostic}',
|
|
@@ -155,8 +157,6 @@ export const en = {
|
|
|
155
157
|
retry: 'Retry',
|
|
156
158
|
agentName: 'Name',
|
|
157
159
|
agentDescription: 'Description',
|
|
158
|
-
initialChannels: 'Initial Channels',
|
|
159
|
-
noChannelsForAgent: 'Create at least one Channel first',
|
|
160
160
|
createAgent: 'Create Agent',
|
|
161
161
|
creatingAgent: 'Creating…',
|
|
162
162
|
loadingAgents: 'Loading Agents…',
|
|
@@ -180,10 +180,15 @@ export const en = {
|
|
|
180
180
|
restartAgent: 'Restart',
|
|
181
181
|
restartStillUnavailable: 'Restart ran, but the Member is still unavailable: {diagnostic}',
|
|
182
182
|
restartFailed: 'Restart failed: {message}',
|
|
183
|
+
clearContextAgent: 'Start from new context',
|
|
184
|
+
clearContextWorkingReason: 'The Member is working; clear once the current turn ends',
|
|
185
|
+
clearContextUnavailableReason: 'The Member is unavailable; only an idle available Member can start from a new context',
|
|
186
|
+
clearContextTitle: 'Start from new context: {name}',
|
|
187
|
+
clearContextNotice: 'This ends {name}\'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}\'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.',
|
|
188
|
+
clearContextConfirm: 'Start from new context',
|
|
189
|
+
clearContextFailed: 'Failed to clear context: {message}',
|
|
183
190
|
optionalSuffix: ' (optional)',
|
|
184
191
|
agentDescriptionPlaceholder: 'Leave empty if not needed',
|
|
185
|
-
channelsPickerEmpty: 'Choose initial channels',
|
|
186
|
-
channelsPickerCount: '{count} selected',
|
|
187
192
|
membersPickerEmpty: 'Choose initial members',
|
|
188
193
|
membersPickerCount: '{count} selected',
|
|
189
194
|
reasoningEffort: 'Reasoning effort',
|
|
@@ -232,6 +237,7 @@ export const en = {
|
|
|
232
237
|
promoteToTask: 'Convert to Task',
|
|
233
238
|
promotingTask: 'Converting to Task…',
|
|
234
239
|
mentionSuggestions: 'Mention suggestions',
|
|
240
|
+
mentionAll: 'Notify all members ({count})',
|
|
235
241
|
messageDraft: 'Message',
|
|
236
242
|
composerNotify: 'Will notify: {ids}',
|
|
237
243
|
messagePlaceholder: 'Write a message…',
|
|
@@ -244,10 +250,8 @@ export const en = {
|
|
|
244
250
|
backToWorkspace: 'Back to Workspace',
|
|
245
251
|
loadingThread: 'Loading Thread…',
|
|
246
252
|
unreadBoundary: 'Updates received when you opened this Thread',
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
remainingUnread: '{count} unread update(s) remain',
|
|
250
|
-
continueReading: 'Continue reading',
|
|
253
|
+
newUpdatesJump: '↓ {count} new update(s)',
|
|
254
|
+
autoReadIncomplete: 'Some unread updates could not be read automatically',
|
|
251
255
|
olderHistory: 'Older history',
|
|
252
256
|
runtimeRisk: 'Current runtime risk',
|
|
253
257
|
runtimeRiskDetail: '@{member} is unavailable: {diagnostic}',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WorkspaceId } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
/** Which sidebar section a collapse state belongs to. */
|
|
3
|
+
export type TeamSidebarSectionKind = 'workspaces' | 'channels' | 'agents';
|
|
4
|
+
/**
|
|
5
|
+
* Effective expanded state for one sidebar section: `false` only when this
|
|
6
|
+
* browser explicitly collapsed it. Booleans are primitives, so the snapshot
|
|
7
|
+
* is naturally identity-stable for `useSyncExternalStore`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useSidebarSectionOpen(workspaceId: WorkspaceId | undefined, kind: TeamSidebarSectionKind): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The only mutation path: record one section's expanded state for this
|
|
12
|
+
* browser. Unknown keys (missing workspace) no-op so an unloaded workspace
|
|
13
|
+
* never persists a phantom preference.
|
|
14
|
+
*/
|
|
15
|
+
export declare function setSidebarSectionOpen(workspaceId: WorkspaceId | undefined, kind: TeamSidebarSectionKind, open: boolean): void;
|
|
16
|
+
//# sourceMappingURL=sidebar-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-sections.d.ts","sourceRoot":"","sources":["../../../src/client/sidebar-sections.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,yDAAyD;AACzD,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAA;AA8DzE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,sBAAsB,GAAG,OAAO,CASjH;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAQ7H"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human presentation preference for the Team sidebar: whether each disclosure
|
|
3
|
+
* section (workspaces / channels / agents) is expanded. The state lives in
|
|
4
|
+
* this browser only — it is UI taste, never a shared Team fact, so nothing
|
|
5
|
+
* here touches the ledger. Same storage discipline as `sidebar-order.ts`: one
|
|
6
|
+
* localStorage key, defensive parsing, a read-through cache over the raw
|
|
7
|
+
* payload so writes from other tabs are picked up, and an in-memory fallback
|
|
8
|
+
* when storage is unavailable.
|
|
9
|
+
*/
|
|
10
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
11
|
+
const STORAGE_KEY = 'dsh.agent-team.sidebar-sections';
|
|
12
|
+
function sectionKey(workspaceId, kind) {
|
|
13
|
+
// The workspaces section is workspace-independent; the two panels are
|
|
14
|
+
// per-workspace because the Team shell remounts them on workspace switch.
|
|
15
|
+
return workspaceId === undefined ? (kind === 'workspaces' ? kind : undefined) : `${workspaceId}|${kind}`;
|
|
16
|
+
}
|
|
17
|
+
const MEMORY_ONLY = Symbol('sidebar-sections.memory');
|
|
18
|
+
/** Read-through parse cache over the raw persisted payload; see `sidebar-order.ts`. */
|
|
19
|
+
let cachedRaw;
|
|
20
|
+
let cachedCollapsed = new Set();
|
|
21
|
+
function storedCollapsed() {
|
|
22
|
+
let raw = null;
|
|
23
|
+
try {
|
|
24
|
+
raw = typeof localStorage === 'undefined' ? null : localStorage.getItem(STORAGE_KEY);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
raw = null;
|
|
28
|
+
}
|
|
29
|
+
if (cachedRaw !== undefined && raw !== null && raw === cachedRaw)
|
|
30
|
+
return cachedCollapsed;
|
|
31
|
+
if (raw === null) {
|
|
32
|
+
if (cachedRaw === MEMORY_ONLY)
|
|
33
|
+
return cachedCollapsed;
|
|
34
|
+
cachedRaw = raw;
|
|
35
|
+
cachedCollapsed = new Set();
|
|
36
|
+
return cachedCollapsed;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(raw);
|
|
40
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
41
|
+
throw new Error('not an object');
|
|
42
|
+
const keys = parsed.collapsed;
|
|
43
|
+
if (!Array.isArray(keys) || !keys.every(key => typeof key === 'string'))
|
|
44
|
+
throw new Error('bad shape');
|
|
45
|
+
cachedRaw = raw;
|
|
46
|
+
cachedCollapsed = new Set(keys);
|
|
47
|
+
return cachedCollapsed;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Corrupted payloads degrade to "no preference"; the next valid write
|
|
51
|
+
// replaces them.
|
|
52
|
+
return new Set();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function writeCollapsed(collapsed) {
|
|
56
|
+
cachedCollapsed = collapsed;
|
|
57
|
+
try {
|
|
58
|
+
if (typeof localStorage === 'undefined')
|
|
59
|
+
throw new Error('no localStorage');
|
|
60
|
+
const raw = JSON.stringify({ collapsed: [...collapsed] });
|
|
61
|
+
localStorage.setItem(STORAGE_KEY, raw);
|
|
62
|
+
cachedRaw = raw;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Private mode and quota failures do not block folding; the session keeps
|
|
67
|
+
// serving the in-memory state above.
|
|
68
|
+
cachedRaw = MEMORY_ONLY;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const listeners = new Set();
|
|
72
|
+
/**
|
|
73
|
+
* Effective expanded state for one sidebar section: `false` only when this
|
|
74
|
+
* browser explicitly collapsed it. Booleans are primitives, so the snapshot
|
|
75
|
+
* is naturally identity-stable for `useSyncExternalStore`.
|
|
76
|
+
*/
|
|
77
|
+
export function useSidebarSectionOpen(workspaceId, kind) {
|
|
78
|
+
const key = sectionKey(workspaceId, kind);
|
|
79
|
+
const subscribe = useCallback((listener) => {
|
|
80
|
+
listeners.add(listener);
|
|
81
|
+
return () => { listeners.delete(listener); };
|
|
82
|
+
}, []);
|
|
83
|
+
return useSyncExternalStore(subscribe, () => key === undefined ? true : !storedCollapsed().has(key), () => key === undefined ? true : !storedCollapsed().has(key));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The only mutation path: record one section's expanded state for this
|
|
87
|
+
* browser. Unknown keys (missing workspace) no-op so an unloaded workspace
|
|
88
|
+
* never persists a phantom preference.
|
|
89
|
+
*/
|
|
90
|
+
export function setSidebarSectionOpen(workspaceId, kind, open) {
|
|
91
|
+
const key = sectionKey(workspaceId, kind);
|
|
92
|
+
if (key === undefined)
|
|
93
|
+
return;
|
|
94
|
+
const next = new Set(storedCollapsed());
|
|
95
|
+
if (open)
|
|
96
|
+
next.delete(key);
|
|
97
|
+
else
|
|
98
|
+
next.add(key);
|
|
99
|
+
writeCollapsed(next);
|
|
100
|
+
for (const listener of listeners)
|
|
101
|
+
listener();
|
|
102
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
-
import type { AgentTeamAddMemberRequest, AgentTeamChannelRef, AgentTeamClientMemberStatus, AgentTeamCreateChannelRequest, AgentTeamCreateChannelResult, AgentTeamJoinChannelRequest, AgentTeamJoinChannelResult, AgentTeamGetAttachmentRequest, AgentTeamGetAttachmentResult, AgentTeamPutAttachmentRequest, AgentTeamPutAttachmentResult, AgentTeamMemberResult, AgentTeamRecoverMemberRequest, AgentTeamRecoverMemberResult, AgentTeamMembersRequest, AgentTeamRemoveChannelMemberRequest, AgentTeamRemoveChannelMemberResult, AgentTeamReplyRequest, AgentTeamResolveTaskRefsRequest, AgentTeamResolveTaskRefsResult, AgentTeamReplyResult, AgentTeamConfirmationRequired, AgentTeamThreadHistory, AgentTeamThreadHistoryRequest, AgentTeamThreadReadRequest, AgentTeamThreadReadResult, AgentTeamPromoteThreadRequest, AgentTeamPromoteThreadResult, AgentTeamTaskRequest, AgentTeamTaskResult, AgentTeamSendMessageRequest, AgentTeamSendMessageResult, AgentTeamUpdateChannelRequest, AgentTeamUpdateChannelResult, AgentTeamUpdateMemberRequest, AgentTeamView, AgentTeamViewRequest } from '@wowyuarm/dsh-agent-team/types';
|
|
2
|
+
import type { AgentTeamAddMemberRequest, AgentTeamChannelRef, AgentTeamClientMemberStatus, AgentTeamClearMemberContextRequest, AgentTeamClearMemberContextResult, AgentTeamCreateChannelRequest, AgentTeamCreateChannelResult, AgentTeamJoinChannelRequest, AgentTeamJoinChannelResult, AgentTeamGetAttachmentRequest, AgentTeamGetAttachmentResult, AgentTeamPutAttachmentRequest, AgentTeamPutAttachmentResult, AgentTeamMemberResult, AgentTeamRecoverMemberRequest, AgentTeamRecoverMemberResult, AgentTeamMembersRequest, AgentTeamRemoveChannelMemberRequest, AgentTeamRemoveChannelMemberResult, AgentTeamReplyRequest, AgentTeamResolveTaskRefsRequest, AgentTeamResolveTaskRefsResult, AgentTeamReplyResult, AgentTeamConfirmationRequired, AgentTeamThreadHistory, AgentTeamThreadHistoryRequest, AgentTeamThreadReadRequest, AgentTeamThreadReadResult, AgentTeamPromoteThreadRequest, AgentTeamPromoteThreadResult, AgentTeamTaskRequest, AgentTeamTaskResult, AgentTeamSendMessageRequest, AgentTeamSendMessageResult, AgentTeamUpdateChannelRequest, AgentTeamUpdateChannelResult, AgentTeamUpdateMemberRequest, AgentTeamView, AgentTeamViewRequest } from '@wowyuarm/dsh-agent-team/types';
|
|
3
3
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
4
|
import type { TeamNavigationActions, TeamNavigationSnapshot } from './navigation.ts';
|
|
5
5
|
import type { TeamChangeListener, TeamChangeScope } from './team-changes.ts';
|
|
@@ -49,6 +49,7 @@ export type TeamSidebarProps = PropsRuntime<'sidebar.workspaces'> & PropsLocale<
|
|
|
49
49
|
updateChannel: (request: AgentTeamUpdateChannelRequest) => Promise<RemoteResult<AgentTeamUpdateChannelResult>>;
|
|
50
50
|
updateMember: (request: AgentTeamUpdateMemberRequest) => Promise<RemoteResult<AgentTeamMemberResult>>;
|
|
51
51
|
recoverMember: (request: AgentTeamRecoverMemberRequest) => Promise<RemoteResult<AgentTeamRecoverMemberResult>>;
|
|
52
|
+
clearMemberContext: (request: AgentTeamClearMemberContextRequest) => Promise<RemoteResult<AgentTeamClearMemberContextResult>>;
|
|
52
53
|
joinChannel: (request: AgentTeamJoinChannelRequest) => Promise<RemoteResult<AgentTeamJoinChannelResult>>;
|
|
53
54
|
removeChannelMember: (request: AgentTeamRemoveChannelMemberRequest) => Promise<RemoteResult<AgentTeamRemoveChannelMemberResult>>;
|
|
54
55
|
/** Session-independent Host model catalog (`llm.models`); needs no live Member. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/client/slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,mCAAmC,EACnC,kCAAkC,EAClC,qBAAqB,EACrB,+BAA+B,EAC/B,8BAA8B,EAC9B,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,aAAa,EACb,oBAAoB,EACrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAA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UAAU,CAAA;AAEjE,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,8GAA8G;IAC9G,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;IACtD,iFAAiF;IACjF,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,kGAAkG;IAClG,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC/C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IACrD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAC9B,GAAG,kBAAkB,CA6BrB"}
|
|
@@ -116,7 +116,11 @@ export function splitMentionNames(text, names) {
|
|
|
116
116
|
}
|
|
117
117
|
/** Canonical chip handles for one Message's structured mention refs. */
|
|
118
118
|
export function mentionNamesOf(mentions, handles) {
|
|
119
|
-
return mentions
|
|
119
|
+
return mentions
|
|
120
|
+
// The Human is Team authority, not an Agent projection, so `members()` does
|
|
121
|
+
// not include it. Keep its stable public handle available for rendering.
|
|
122
|
+
.map(memberId => memberId === 'member:human' ? 'human' : handles.get(memberId))
|
|
123
|
+
.filter((name) => name !== undefined);
|
|
120
124
|
}
|
|
121
125
|
const MARKDOWN_BLOCK_CONSTRUCT = /(^|\n)[ \t]{0,3}(?:#{1,6}[ \t]|>[ \t]|[-*+][ \t]|\d+[.)][ \t])|^[ \t]*\|.+\|/m;
|
|
122
126
|
const MARKDOWN_INLINE_CONSTRUCT = /[`*_[\]!]|~~~|```/;
|
|
@@ -218,7 +222,10 @@ export function planMessageBody(body, options) {
|
|
|
218
222
|
render,
|
|
219
223
|
...(inline === undefined ? {} : { inline }),
|
|
220
224
|
fallbackNames,
|
|
221
|
-
|
|
225
|
+
// Rich Markdown refs are painted at their authored position after the
|
|
226
|
+
// Markdown primitive has built its DOM; do not duplicate them in the
|
|
227
|
+
// trailing chip row when navigation is available.
|
|
228
|
+
fallbackRefs: richAgentBody && !options.canOpenRefs ? refs : [],
|
|
222
229
|
taskRefs: options.canOpenRefs && !richAgentBody
|
|
223
230
|
? refs.filter(ref => ref.startsWith('task:')).map(ref => ref)
|
|
224
231
|
: [],
|
|
@@ -3,16 +3,14 @@ export interface TimelineScroll {
|
|
|
3
3
|
onScroll: () => void;
|
|
4
4
|
/** Whether the reader currently sits within the follow margin of the bottom. */
|
|
5
5
|
isPinned: () => boolean;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/** Jump to the latest fact on the next content commit. */
|
|
9
|
-
jumpToLatest: () => void;
|
|
6
|
+
/** Scroll the timeline to the latest fact immediately. */
|
|
7
|
+
scrollToBottom: () => void;
|
|
10
8
|
}
|
|
11
9
|
/**
|
|
12
10
|
* Chat-timeline scroll policy shared by the Channel and Thread pages: follow
|
|
13
|
-
* new facts only while the reader stays pinned to the bottom, keep
|
|
14
|
-
* history visually stable
|
|
15
|
-
*
|
|
11
|
+
* new facts only while the reader stays pinned to the bottom, and keep
|
|
12
|
+
* prepended history visually stable. The content key must change whenever
|
|
13
|
+
* rendered facts change.
|
|
16
14
|
*/
|
|
17
15
|
export declare function useTimelineScroll(contentKey: string): TimelineScroll;
|
|
18
16
|
//# sourceMappingURL=timeline-scroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-scroll.d.ts","sourceRoot":"","sources":["../../../src/client/timeline-scroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline-scroll.d.ts","sourceRoot":"","sources":["../../../src/client/timeline-scroll.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAiCpE"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
const BOTTOM_MARGIN_PX = 48;
|
|
3
|
-
const BOUNDARY_OFFSET_PX = 12;
|
|
4
3
|
/**
|
|
5
4
|
* Chat-timeline scroll policy shared by the Channel and Thread pages: follow
|
|
6
|
-
* new facts only while the reader stays pinned to the bottom, keep
|
|
7
|
-
* history visually stable
|
|
8
|
-
*
|
|
5
|
+
* new facts only while the reader stays pinned to the bottom, and keep
|
|
6
|
+
* prepended history visually stable. The content key must change whenever
|
|
7
|
+
* rendered facts change.
|
|
9
8
|
*/
|
|
10
9
|
export function useTimelineScroll(contentKey) {
|
|
11
10
|
const ref = useRef(null);
|
|
12
11
|
const pinnedRef = useRef(true);
|
|
13
12
|
const heightRef = useRef(0);
|
|
14
|
-
const jumpRef = useRef();
|
|
15
13
|
const onScroll = useCallback(() => {
|
|
16
14
|
const element = ref.current;
|
|
17
15
|
if (element === null)
|
|
18
16
|
return;
|
|
19
17
|
pinnedRef.current = element.scrollHeight - element.scrollTop - element.clientHeight < BOTTOM_MARGIN_PX;
|
|
20
18
|
}, []);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
pinnedRef.current = false;
|
|
24
|
-
}, []);
|
|
25
|
-
const jumpToLatest = useCallback(() => {
|
|
26
|
-
jumpRef.current = 'latest';
|
|
19
|
+
const scrollToBottom = useCallback(() => {
|
|
20
|
+
const element = ref.current;
|
|
27
21
|
pinnedRef.current = true;
|
|
22
|
+
if (element !== null)
|
|
23
|
+
element.scrollTop = element.scrollHeight;
|
|
28
24
|
}, []);
|
|
29
25
|
useEffect(() => {
|
|
30
26
|
const element = ref.current;
|
|
@@ -32,16 +28,7 @@ export function useTimelineScroll(contentKey) {
|
|
|
32
28
|
return;
|
|
33
29
|
const previousHeight = heightRef.current;
|
|
34
30
|
heightRef.current = element.scrollHeight;
|
|
35
|
-
|
|
36
|
-
jumpRef.current = undefined;
|
|
37
|
-
if (jump === 'boundary') {
|
|
38
|
-
const marker = element.querySelector('[data-thread-boundary]');
|
|
39
|
-
if (marker !== null) {
|
|
40
|
-
element.scrollTop += marker.getBoundingClientRect().top - element.getBoundingClientRect().top - BOUNDARY_OFFSET_PX;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (jump === 'latest' || pinnedRef.current) {
|
|
31
|
+
if (pinnedRef.current) {
|
|
45
32
|
element.scrollTop = element.scrollHeight;
|
|
46
33
|
return;
|
|
47
34
|
}
|
|
@@ -50,5 +37,5 @@ export function useTimelineScroll(contentKey) {
|
|
|
50
37
|
element.scrollTop += element.scrollHeight - previousHeight;
|
|
51
38
|
}
|
|
52
39
|
}, [contentKey]);
|
|
53
|
-
return { ref, onScroll, isPinned: () => pinnedRef.current,
|
|
40
|
+
return { ref, onScroll, isPinned: () => pinnedRef.current, scrollToBottom };
|
|
54
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { markAgentTeamPreset } from '@wowyuarm/dsh-agent-team/host';
|
|
1
|
+
import { AgentTeamDmDeliveryError, markAgentTeamPreset } from '@wowyuarm/dsh-agent-team/host';
|
|
2
2
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
3
3
|
export const name = 'wowyuarm-agent-team-tools';
|
|
4
4
|
export const inject = ['tools'];
|
|
@@ -136,12 +136,13 @@ function threadResult(kind, snapshot, attention, facts, extra = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
const teamMessage = markAgentTeamPreset(defineTool({
|
|
138
138
|
name: 'team_message',
|
|
139
|
-
description: 'Start a top-level Thread
|
|
139
|
+
description: 'Start a top-level Thread, reply to an existing Thread, or send a direct message (DM). start defaults to a taskless Thread; pass asTask true to create a Task in the same send. Read the Thread first; replies require its current revision (an internal concurrency token carried by baseRevision, never quoted in bodies). A top-level start may mention related Agents directly; in replies, only a Human can invite an unfollowed Agent. Pass Member refs in mentions and spell their handles inside the body; only mentioned Members render as mention chips. dm sends a private direct message to one enabled Agent Member in your Workspace: use it for quick clarifications and status syncs — never for task work, decisions, or anything that needs team visibility or traceability (use a Thread); if a DM exchange with the same Member exceeds about 3 exchanges, move it to a Thread, because every DM costs the recipient a full agent turn.',
|
|
140
140
|
parameters: {
|
|
141
|
-
action: { type: 'string', required: true, enum: ['start', 'reply'] },
|
|
141
|
+
action: { type: 'string', required: true, enum: ['start', 'reply', 'dm'] },
|
|
142
142
|
channelRef: { type: 'string', description: "Full branded Channel ref exactly as returned by Team tools, including the 'channel:' prefix." },
|
|
143
143
|
threadRef: { type: 'string', description: "Full branded Thread ref exactly as returned by Team tools, including the 'thread:' prefix." },
|
|
144
144
|
taskRef: { type: 'string', description: "Optional Task ref alias for reply on a Taskful Thread. Prefer threadRef." },
|
|
145
|
+
memberRef: { type: 'string', description: "Full branded Member ref exactly as returned by Team tools, including the 'member:' prefix. Required for dm; the Member must be an enabled Agent in your Workspace (the Human cannot be DMed)." },
|
|
145
146
|
asTask: { type: 'boolean', description: 'When true, start creates a Task with the Thread. Default false creates a taskless Thread.' },
|
|
146
147
|
body: { type: 'string', required: true, description: "Markdown body. Cite Team refs exactly as returned, as bare text with one colon (e.g. task:0f0a…) — never a double colon, never inside backticks or quotes. Spell each mentioned Member's handle in the prose so the mention renders inline." }, baseRevision: { type: 'number', description: "Positive integer; use the current Thread revision as shown by the latest team_inbox or team_thread result for this Thread. The revision is an internal concurrency token, not a citable fact." },
|
|
147
148
|
mentions: { type: 'array', items: { type: 'string' }, description: 'Member refs to mention. Mentioned Agents receive the Message directly; write their handles in the body (any casing, optional @) so the mention renders inline.' },
|
|
@@ -151,9 +152,11 @@ const teamMessage = markAgentTeamPreset(defineTool({
|
|
|
151
152
|
schema: { type: 'object', additionalProperties: false, properties: {
|
|
152
153
|
kind: { type: 'string', required: true }, taskRef: { type: 'string' }, threadRef: { type: 'string' }, revision: { type: 'number' },
|
|
153
154
|
expectedRevision: { type: 'number' }, messageRef: { type: 'string' }, memberIds: { type: 'array', items: { type: 'string' } }, unreadCount: { type: 'number' }, directCount: { type: 'number' },
|
|
155
|
+
recipientMemberId: { type: 'string' }, recipientHandle: { type: 'string' }, delivered: { type: 'boolean' }, deliveryNote: { type: 'string' },
|
|
154
156
|
} },
|
|
155
|
-
render: (_args, value) => [{ type: 'text', text: value.kind === '
|
|
156
|
-
:
|
|
157
|
+
render: (_args, value) => [{ type: 'text', text: value.kind === 'dm-sent' ? `DM ${value.delivered === false ? 'recorded but not delivered' : 'delivered'} to @${value.recipientHandle} (${value.recipientMemberId})${value.deliveryNote === undefined ? '' : `: ${value.deliveryNote}`}`
|
|
158
|
+
: value.kind === 'committed' ? `Message ${value.messageRef} committed at revision ${value.revision}.`
|
|
159
|
+
: `${value.kind}: ${value.memberIds?.join(', ') ?? `${value.threadRef ?? ''}${value.taskRef === undefined ? '' : ` · Task ${value.taskRef}`} revision ${value.revision ?? ''}`}` }],
|
|
157
160
|
},
|
|
158
161
|
async execute(args, exec) {
|
|
159
162
|
const agent = exec.agent;
|
|
@@ -172,6 +175,23 @@ const teamMessage = markAgentTeamPreset(defineTool({
|
|
|
172
175
|
channelRef: args.channelRef, body: args.body, asTask: args.asTask === true, ...(mentions === undefined ? {} : { recipients: mentions }), ...paths });
|
|
173
176
|
return messageOutcome(result);
|
|
174
177
|
}
|
|
178
|
+
if (args.action === 'dm') {
|
|
179
|
+
if (args.memberRef === undefined || args.channelRef !== undefined || args.threadRef !== undefined || args.taskRef !== undefined
|
|
180
|
+
|| args.baseRevision !== undefined || args.asTask !== undefined || mentions !== undefined || attachmentPaths !== undefined) {
|
|
181
|
+
throw new Error('dm requires memberRef and body only; it does not accept channelRef, threadRef, taskRef, baseRevision, asTask, mentions, or attachments');
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
const result = await host.dmForAgent(agent, { requestId: requestId(agent.id, exec.callId), workspaceId: current.workspaceId,
|
|
185
|
+
recipientMemberId: args.memberRef, body: args.body });
|
|
186
|
+
return { kind: 'dm-sent', recipientMemberId: result.recipient.memberId, recipientHandle: result.recipient.handle, delivered: true };
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
if (error instanceof AgentTeamDmDeliveryError) {
|
|
190
|
+
return { kind: 'dm-sent', recipientMemberId: error.recipientMemberId, recipientHandle: error.recipientHandle, delivered: false, deliveryNote: error.message };
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
175
195
|
const baseRevision = args.baseRevision;
|
|
176
196
|
if ((args.threadRef === undefined && args.taskRef === undefined) || args.channelRef !== undefined || args.asTask !== undefined || typeof baseRevision !== 'number' || !Number.isSafeInteger(baseRevision) || baseRevision < 1) {
|
|
177
197
|
throw new Error("reply requires threadRef and a positive baseRevision, and does not accept channelRef; use the current Thread 'revision' returned by team_inbox or team_thread");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAWlD,eAAO,MAAM,IAAI,8BAA8B,CAAA;AAC/C,eAAO,MAAM,MAAM,UAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAWlD,eAAO,MAAM,IAAI,8BAA8B,CAAA;AAC/C,eAAO,MAAM,MAAM,UAAY,CAAA;AAwT/B,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAMxC"}
|