@nanmicoder/dsh-agent-teams 0.1.7 → 0.1.9

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.
Files changed (47) hide show
  1. package/README.md +23 -0
  2. package/README_ZH.md +14 -0
  3. package/assets/agent-teams/action-celebrating-v2.png +0 -0
  4. package/assets/agent-teams/action-reporting-v2.png +0 -0
  5. package/assets/agent-teams/action-sending-v2.png +0 -0
  6. package/assets/agent-teams/action-sleeping-v2.png +0 -0
  7. package/assets/agent-teams/action-thinking-v2.png +0 -0
  8. package/assets/agent-teams/action-working-v2.png +0 -0
  9. package/assets/agent-teams/member-data-v2.png +0 -0
  10. package/assets/agent-teams/member-designer-v2.png +0 -0
  11. package/assets/agent-teams/member-docs-v2.png +0 -0
  12. package/assets/agent-teams/member-engineer-v2.png +0 -0
  13. package/assets/agent-teams/member-operator-v2.png +0 -0
  14. package/assets/agent-teams/member-qa-v2.png +0 -0
  15. package/assets/agent-teams/member-researcher-v2.png +0 -0
  16. package/assets/agent-teams/member-security-v2.png +0 -0
  17. package/assets/agent-teams/team-lead-v2.png +0 -0
  18. package/lib/client/ActivityPanel.js +11 -42
  19. package/lib/client/AgentTeamsCard.js +10 -32
  20. package/lib/client/activity-monitor.js +178 -0
  21. package/lib/client/artwork.js +15 -12
  22. package/lib/client/index.js +0 -1
  23. package/lib/client.js +205 -74
  24. package/lib/client.js.map +1 -1
  25. package/lib/command.js +127 -0
  26. package/lib/index.js +28 -7
  27. package/lib/types/client/ActivityPanel.d.ts +0 -40
  28. package/lib/types/client/AgentTeamsCard.d.ts +1 -2
  29. package/lib/types/client/activity-monitor.d.ts +106 -0
  30. package/lib/types/client/artwork.d.ts +1 -1
  31. package/lib/types/command.d.ts +71 -0
  32. package/lib/types/index.d.ts +6 -0
  33. package/package.json +6 -1
  34. package/assets/agent-teams/action-celebrating.png +0 -0
  35. package/assets/agent-teams/action-reporting.png +0 -0
  36. package/assets/agent-teams/action-sending.png +0 -0
  37. package/assets/agent-teams/action-sleeping.png +0 -0
  38. package/assets/agent-teams/action-thinking.png +0 -0
  39. package/assets/agent-teams/action-working.png +0 -0
  40. package/assets/agent-teams/data-analyst.png +0 -0
  41. package/assets/agent-teams/designer.png +0 -0
  42. package/assets/agent-teams/docs-coordinator.png +0 -0
  43. package/assets/agent-teams/engineer.png +0 -0
  44. package/assets/agent-teams/qa-engineer.png +0 -0
  45. package/assets/agent-teams/researcher.png +0 -0
  46. package/assets/agent-teams/security-reviewer.png +0 -0
  47. package/assets/agent-teams/team-lead.png +0 -0
@@ -16,46 +16,6 @@
16
16
  */
17
17
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
18
18
  import type { ObservableSnapshot, SessionListState } from '@deepseek-ai/dsh-client-runtime/client';
19
- /** One member row of a host snapshot. */
20
- export interface ActivityMember {
21
- readonly id: string;
22
- readonly name: string;
23
- readonly role: string;
24
- readonly status?: 'idle' | 'working' | 'removed';
25
- readonly activity: 'working' | 'idle' | 'unknown';
26
- readonly progress: number;
27
- readonly done: number;
28
- readonly total: number;
29
- readonly currentTask: string;
30
- readonly unread: number;
31
- }
32
- /** One task row of a host snapshot. */
33
- export interface ActivityTask {
34
- readonly id: string;
35
- readonly subject: string;
36
- readonly status: string;
37
- readonly state: 'blocked' | 'open' | 'running' | 'completed';
38
- readonly assignee: string;
39
- readonly dependencies: readonly string[];
40
- readonly depth: number;
41
- }
42
- /** One captain-inbox preview row. */
43
- export interface ActivityMessage {
44
- readonly from: string;
45
- readonly content: string;
46
- }
47
- /** One team snapshot (mirrors the host TeamActivitySnapshot). */
48
- export interface ActivityTeam {
49
- readonly workspace: string;
50
- readonly teamId: string;
51
- readonly name: string;
52
- readonly description?: string;
53
- readonly captainSessionId: string;
54
- readonly members: readonly ActivityMember[];
55
- readonly tasks: readonly ActivityTask[];
56
- readonly messageCount: number;
57
- readonly captainInbox: readonly ActivityMessage[];
58
- }
59
19
  /** The top-right activity floater. Teams follow the current session: live
60
20
  * snapshots and historic card summaries are only shown while their captain
61
21
  * session is the one currently open. */
@@ -16,9 +16,8 @@ export declare const OPEN_PANEL_EVENT = "agent-teams:open-panel";
16
16
  /** Navigation action injected from the plugin's own SessionsService access. */
17
17
  export interface AgentTeamsCardInjected {
18
18
  readonly openSession: (id: SessionId) => void;
19
- readonly currentSessionId: () => SessionId | undefined;
20
19
  }
21
20
  /** Complete keyed Chat renderer props. */
22
21
  export type AgentTeamsCardProps = PropsRuntime<'conversation.chat.node', 'agent-teams'> & PropsLocale<'agentTeams'> & AgentTeamsCardInjected;
23
22
  /** Render one durable team as a compact conversation card. */
24
- export declare function AgentTeamsCard({ node, openSession, currentSessionId }: AgentTeamsCardProps): import("react").JSX.Element;
23
+ export declare function AgentTeamsCard({ node, openSession, sessionId }: AgentTeamsCardProps): import("react").JSX.Element;
@@ -0,0 +1,106 @@
1
+ /** Shared, demand-driven state for the AgentTeams browser monitor. */
2
+ /** One member row of a host snapshot. */
3
+ export interface ActivityMember {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly role: string;
7
+ readonly status?: 'idle' | 'working' | 'removed';
8
+ readonly activity: 'working' | 'idle' | 'unknown';
9
+ readonly progress: number;
10
+ readonly done: number;
11
+ readonly total: number;
12
+ readonly currentTask: string;
13
+ readonly unread: number;
14
+ }
15
+ /** One task row of a host snapshot. */
16
+ export interface ActivityTask {
17
+ readonly id: string;
18
+ readonly subject: string;
19
+ readonly status: string;
20
+ readonly state: 'blocked' | 'open' | 'running' | 'completed';
21
+ readonly assignee: string;
22
+ readonly dependencies: readonly string[];
23
+ readonly depth: number;
24
+ }
25
+ /** One captain-inbox preview row. */
26
+ export interface ActivityMessage {
27
+ readonly from: string;
28
+ readonly content: string;
29
+ }
30
+ /** One team snapshot (mirrors the host TeamActivitySnapshot). */
31
+ export interface ActivityTeam {
32
+ readonly workspace: string;
33
+ readonly teamId: string;
34
+ readonly name: string;
35
+ readonly description?: string;
36
+ readonly captainSessionId: string;
37
+ readonly members: readonly ActivityMember[];
38
+ readonly tasks: readonly ActivityTask[];
39
+ readonly messageCount: number;
40
+ readonly captainInbox: readonly ActivityMessage[];
41
+ }
42
+ /** A successfully-created conversation card that currently needs updates. */
43
+ export interface ActivityMonitorTarget {
44
+ readonly key: string;
45
+ readonly sessionId: string;
46
+ readonly teamId: string;
47
+ }
48
+ /** Latest shared response data for both the floater and conversation cards. */
49
+ export interface ActivitySnapshots {
50
+ readonly teams: readonly ActivityTeam[];
51
+ readonly archivedTeams: readonly ActivityTeam[];
52
+ }
53
+ /** Subscribe to the active monitor-target list (React external-store shape). */
54
+ export declare function subscribeActivityMonitorTargets(listener: () => void): () => void;
55
+ /** Read the stable active-target snapshot. */
56
+ export declare function getActivityMonitorTargetsSnapshot(): readonly ActivityMonitorTarget[];
57
+ /**
58
+ * Register one successful AgentTeams card as a monitoring demand.
59
+ *
60
+ * The returned cleanup is reference-counted so multiple cards and React
61
+ * StrictMode remounts cannot stop another card's monitor.
62
+ */
63
+ export declare function monitorAgentTeam(sessionId: string, teamId: string): () => void;
64
+ /** Stop polling targets whose final archived snapshot has been captured. */
65
+ export declare function settleActivityMonitorTargets(keys: ReadonlySet<string>): void;
66
+ /** Subscribe to the shared live/archive snapshot. */
67
+ export declare function subscribeActivitySnapshots(listener: () => void): () => void;
68
+ /** Read the stable shared live/archive snapshot. */
69
+ export declare function getActivitySnapshotsSnapshot(): ActivitySnapshots;
70
+ /** Publish one or both successful state-route responses. */
71
+ export declare function updateActivitySnapshots(update: Partial<ActivitySnapshots>): void;
72
+ /** Poll cadence for the live host snapshot route. */
73
+ export declare const ACTIVITY_POLL_MS = 1000;
74
+ /** Host route serving live and archived team snapshots. */
75
+ export declare const ACTIVITY_STATE_URL = "/plugins/dsh-agent-teams/state";
76
+ interface ActivityFetchResponse {
77
+ readonly ok: boolean;
78
+ json(): Promise<unknown>;
79
+ }
80
+ /** Injectable browser primitives used by the poll controller and its tests. */
81
+ export interface ActivityPollingRuntime {
82
+ readonly fetchState?: (url: string, init: {
83
+ readonly cache: 'no-store';
84
+ readonly signal: AbortSignal;
85
+ }) => Promise<ActivityFetchResponse>;
86
+ readonly schedule?: (callback: () => void, intervalMs: number) => unknown;
87
+ readonly cancel?: (timer: unknown) => void;
88
+ readonly publishSnapshots?: (update: Partial<ActivitySnapshots>) => void;
89
+ readonly settleTargets?: (keys: ReadonlySet<string>) => void;
90
+ }
91
+ /** Handle returned by one current-session polling loop. */
92
+ export interface ActivityPollingController {
93
+ /** The immediate first pass, exposed so offline verification can await it. */
94
+ readonly firstTick: Promise<void>;
95
+ /** Idempotently stop the timer and abort the current request. */
96
+ stop(): void;
97
+ }
98
+ /**
99
+ * Start the single polling loop for the current session's requested targets.
100
+ *
101
+ * With no targets this is deliberately inert: installing the plugin must not
102
+ * touch the state route. Live state is polled at the normal cadence; archive
103
+ * state is fetched only as a one-time fallback for targets no longer live.
104
+ */
105
+ export declare function startActivityPolling(monitorTargets: readonly ActivityMonitorTarget[], runtime?: ActivityPollingRuntime): ActivityPollingController;
106
+ export {};
@@ -7,7 +7,7 @@
7
7
  /** Artwork route prefix served by the plugin host half. */
8
8
  export declare const ART_BASE = "/plugins/dsh-agent-teams/assets/";
9
9
  /** Captain artwork (always the lead whale). */
10
- export declare const LEAD_ART = "/plugins/dsh-agent-teams/assets/team-lead.png";
10
+ export declare const LEAD_ART = "/plugins/dsh-agent-teams/assets/team-lead-v2.png";
11
11
  /** Status action artwork per member activity. */
12
12
  export declare const ACTION_ART: Record<'working' | 'idle' | 'unknown', string>;
13
13
  /**
@@ -0,0 +1,71 @@
1
+ /**
2
+ * The `/agent-teams` slash command and its plain-text gesture boundary.
3
+ *
4
+ * Two deterministic activation paths, mirroring the Harness skill pipeline
5
+ * (`dsh-tool-skill` + the `ui-skill` client source):
6
+ *
7
+ * 1. **Host command** — `ctx.commands.register` publishes the closed-namespace
8
+ * `/agent-teams` command. The web GUI's slash menu (the Harness
9
+ * `ui-commands` client) lists it from the host catalog with the input
10
+ * hint; the argued line is claimed client-side and executed through
11
+ * `command.execute` WITHOUT ever reaching the model. The handler queues
12
+ * one explicit activation message as an ordinary follow-up turn
13
+ * (`agent.followup`), so the captain protocol starts deterministically —
14
+ * no "use AgentTeams" phrasing required.
15
+ * 2. **Gesture boundary** — a `agent/pre-step` listener recognizes a leading
16
+ * `/agent-teams` token in genuine user messages and injects the same
17
+ * activation message. This covers surfaces with no command adjudication
18
+ * (headless CLI, API, pasted text in plain composers) and is a no-op for
19
+ * the command path, whose line is consumed before it can become a prompt.
20
+ * Mid-sentence mentions stay ordinary prose; only `source.kind === 'user'`
21
+ * messages are scanned, so injected or external text cannot forge the
22
+ * gesture.
23
+ *
24
+ * @module dsh-agent-teams/command
25
+ */
26
+ import type { Context } from '@deepseek-ai/cordis';
27
+ import { type UserMessage } from '@deepseek-ai/dsh-llm';
28
+ /** The slash command name (without the leading slash). */
29
+ export declare const AGENT_TEAMS_COMMAND = "agent-teams";
30
+ declare module '@deepseek-ai/dsh-llm' {
31
+ interface MessageSourceMap {
32
+ /**
33
+ * A deterministic `/agent-teams` activation: the goal the user supplied,
34
+ * delivered as an ordinary follow-up turn instead of the raw slash line.
35
+ */
36
+ 'agent-teams-command': {
37
+ readonly kind: 'agent-teams-command';
38
+ /** The user-supplied goal text (absent when the gesture was bare). */
39
+ readonly goal?: string;
40
+ };
41
+ }
42
+ }
43
+ /**
44
+ * The deterministic activation text. The system-prompt usage section owns
45
+ * the full protocol; this message only switches it on for one concrete goal.
46
+ * @param goal - the user-supplied goal, or `''` for a bare invocation.
47
+ */
48
+ export declare function buildActivationDirective(goal: string): string;
49
+ /**
50
+ * The goal of the latest start-anchored `/agent-teams` gesture in genuine
51
+ * user messages, or `undefined` when no message carries one. `''` means a
52
+ * bare `/agent-teams` token with no goal.
53
+ * @param messages - the step's claimed batch (user messages only scanned).
54
+ */
55
+ export declare function invokedAgentTeamsGoal(messages: readonly UserMessage[]): string | undefined;
56
+ /**
57
+ * Register the closed-namespace `/agent-teams` host command. The handler
58
+ * runs against the receiving agent without sending the slash line to the
59
+ * model: it queues the activation message as an ordinary follow-up turn and
60
+ * wakes the driver. The registration rides the calling context's fiber, so
61
+ * a disposed scope (HMR, plugin removal) unregisters the command.
62
+ * @param ctx - host context providing the `commands` registry.
63
+ */
64
+ export declare function registerAgentTeamsCommand(ctx: Context): void;
65
+ /**
66
+ * Install the `agent/pre-step` gesture boundary: a claimed user message
67
+ * starting with `/agent-teams` gains the deterministic activation message
68
+ * appended after every other injection, closest to the model's answer.
69
+ * @param ctx - host context providing the `agent/pre-step` waterfall.
70
+ */
71
+ export declare function installAgentTeamsGestureBoundary(ctx: Context): void;
@@ -37,6 +37,12 @@ export interface Config {
37
37
  maxMembers?: number;
38
38
  /** Prompt-section order for the usage policy (default `117`, after delegation policy). */
39
39
  promptSectionOrder?: number;
40
+ /**
41
+ * Register the deterministic `/agent-teams` activation surfaces (the
42
+ * closed-namespace slash command and the plain-text gesture boundary).
43
+ * Disable to keep the natural-language trigger as the only entry point.
44
+ */
45
+ slashCommand?: boolean;
40
46
  }
41
47
  export declare const Config: z<Config>;
42
48
  export declare function apply(ctx: Context, config: Config): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanmicoder/dsh-agent-teams",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "AgentTeams for DeepSeek Harness: multi-agent team collaboration (captain, members, tasks with dependencies, messaging) driven by natural language, with a tree monitor in the web GUI",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -93,6 +93,7 @@
93
93
  "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
94
94
  "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
95
95
  "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
96
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
96
97
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
97
98
  "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
98
99
  "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6",
@@ -123,6 +124,9 @@
123
124
  "@deepseek-ai/dsh-client-ui-slots": {
124
125
  "optional": true
125
126
  },
127
+ "@deepseek-ai/dsh-commands": {
128
+ "optional": true
129
+ },
126
130
  "@deepseek-ai/dsh-llm": {
127
131
  "optional": true
128
132
  },
@@ -153,6 +157,7 @@
153
157
  "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.6",
154
158
  "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.6",
155
159
  "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
160
+ "@deepseek-ai/dsh-commands": "0.1.0-rc.6",
156
161
  "@deepseek-ai/dsh-llm": "0.1.0-rc.6",
157
162
  "@deepseek-ai/dsh-session": "0.1.0-rc.6",
158
163
  "@deepseek-ai/dsh-subagent": "0.1.0-rc.6",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file