@deepseek-ai/dsh-experimental-agent-team 0.1.5-alpha.2

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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +220 -0
  4. package/README.zh.md +220 -0
  5. package/lib/index.js +1894 -0
  6. package/lib/invariant.js +361 -0
  7. package/lib/typert.host.d.ts +3 -0
  8. package/lib/typert.host.js +867 -0
  9. package/lib/typert.remote-client.d.ts +32 -0
  10. package/lib/typert.remote-client.js +210 -0
  11. package/lib/types/activity.d.ts +23 -0
  12. package/lib/types/activity.js +85 -0
  13. package/lib/types/client.d.ts +3 -0
  14. package/lib/types/client.js +3 -0
  15. package/lib/types/error.d.ts +13 -0
  16. package/lib/types/error.js +23 -0
  17. package/lib/types/index.d.ts +137 -0
  18. package/lib/types/index.js +313 -0
  19. package/lib/types/invariant.d.ts +9 -0
  20. package/lib/types/invariant.js +26 -0
  21. package/lib/types/journal.d.ts +39 -0
  22. package/lib/types/journal.js +63 -0
  23. package/lib/types/lifecycle.d.ts +33 -0
  24. package/lib/types/lifecycle.js +85 -0
  25. package/lib/types/mailbox.d.ts +78 -0
  26. package/lib/types/mailbox.js +292 -0
  27. package/lib/types/persisted.d.ts +20 -0
  28. package/lib/types/persisted.js +20 -0
  29. package/lib/types/projection.d.ts +48 -0
  30. package/lib/types/projection.js +260 -0
  31. package/lib/types/roster.d.ts +113 -0
  32. package/lib/types/roster.js +446 -0
  33. package/lib/types/session-message.d.ts +11 -0
  34. package/lib/types/session-message.js +23 -0
  35. package/lib/types/task-board.d.ts +62 -0
  36. package/lib/types/task-board.js +275 -0
  37. package/lib/types/task-graph.d.ts +21 -0
  38. package/lib/types/task-graph.js +62 -0
  39. package/lib/types/types.d.ts +206 -0
  40. package/lib/types/types.js +26 -0
  41. package/lib/types/validation.d.ts +16 -0
  42. package/lib/types/validation.js +33 -0
  43. package/package.json +88 -0
@@ -0,0 +1,32 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteContribution,
5
+ } from '@deepseek-ai/dsh-typert-protocol'
6
+ import type { CreateTeamTaskRequest, TeamTaskMutationResult, TeamView, UpdateTeamTaskRequest } from '@deepseek-ai/dsh-experimental-agent-team/client'
7
+ import type { SessionId } from '@deepseek-ai/dsh-session/types'
8
+
9
+ declare module '@deepseek-ai/dsh-typert-protocol' {
10
+ interface TypertRemoteNamespace$6167656e745465616d73 {
11
+ createTask: (agentId: SessionId, request: CreateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
12
+ updateTask: (agentId: SessionId, request: UpdateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
13
+ view: (agentId: SessionId) => Promise<RemoteResult<TeamView>>
14
+ }
15
+ interface TypertRemoteMap {
16
+ 'agentTeams/createTask': (agentId: SessionId, request: CreateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
17
+ 'agentTeams/updateTask': (agentId: SessionId, request: UpdateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
18
+ 'agentTeams/view': (agentId: SessionId) => Promise<RemoteResult<TeamView>>
19
+ }
20
+ interface TypertRemoteNamespaceMap {
21
+ 'agentTeams': TypertRemoteNamespace$6167656e745465616d73
22
+ }
23
+ interface TypertRemoteScopeMap {
24
+ 'agent:agentTeams/createTask': (request: CreateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
25
+ 'agent:agentTeams/updateTask': (request: UpdateTeamTaskRequest) => Promise<RemoteResult<TeamTaskMutationResult>>
26
+ 'agent:agentTeams/view': () => Promise<RemoteResult<TeamView>>
27
+ }
28
+ }
29
+
30
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
31
+ export default TYPERT_REMOTE
32
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,210 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_0$schema = z.intersection(z.string(), z.unknown())
5
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_1$schema = z.object({
6
+ 'subject': z.string().readonly(),
7
+ 'description': z.string().readonly(),
8
+ 'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly().optional(),
9
+ 'writeScopes': z.array(z.string()).readonly().optional(),
10
+ })
11
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_result$schema = z.union([z.object({
12
+ 'ok': z.literal(true).readonly(),
13
+ 'value': z.object({
14
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
15
+ 'revision': z.number().readonly(),
16
+ 'subject': z.string().readonly(),
17
+ 'description': z.string().readonly(),
18
+ 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
19
+ 'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
20
+ 'writeScopes': z.array(z.string()).readonly(),
21
+ 'ownerName': z.string().readonly().optional(),
22
+ 'ready': z.boolean().readonly(),
23
+ 'writeScopeWarnings': z.array(z.string()).readonly(),
24
+ }).readonly(),
25
+ }), z.object({
26
+ 'ok': z.literal(false).readonly(),
27
+ 'error': z.object({
28
+ 'code': z.union([z.literal("team-task-conflict"), z.literal("team-rejected")]).readonly(),
29
+ 'message': z.string().readonly(),
30
+ }).readonly(),
31
+ })])
32
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_0$schema = z.intersection(z.string(), z.unknown())
33
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_1$schema = z.object({
34
+ 'taskId': z.intersection(z.string(), z.unknown()).readonly(),
35
+ 'expectedRevision': z.number().readonly(),
36
+ 'action': z.union([z.literal("complete"), z.literal("edit"), z.literal("claim"), z.literal("release"), z.literal("set_dependencies"), z.literal("reopen"), z.literal("reassign"), z.literal("delete")]).readonly(),
37
+ 'subject': z.string().readonly().optional(),
38
+ 'description': z.string().readonly().optional(),
39
+ 'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly().optional(),
40
+ 'writeScopes': z.array(z.string()).readonly().optional(),
41
+ 'owner': z.string().readonly().optional(),
42
+ })
43
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_result$schema = z.union([z.object({
44
+ 'ok': z.literal(true).readonly(),
45
+ 'value': z.object({
46
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
47
+ 'revision': z.number().readonly(),
48
+ 'subject': z.string().readonly(),
49
+ 'description': z.string().readonly(),
50
+ 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
51
+ 'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
52
+ 'writeScopes': z.array(z.string()).readonly(),
53
+ 'ownerName': z.string().readonly().optional(),
54
+ 'ready': z.boolean().readonly(),
55
+ 'writeScopeWarnings': z.array(z.string()).readonly(),
56
+ }).readonly(),
57
+ }), z.object({
58
+ 'ok': z.literal(false).readonly(),
59
+ 'error': z.object({
60
+ 'code': z.union([z.literal("team-task-conflict"), z.literal("team-rejected")]).readonly(),
61
+ 'message': z.string().readonly(),
62
+ }).readonly(),
63
+ })])
64
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_parameter_0$schema = z.intersection(z.string(), z.unknown())
65
+ const _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_result$schema = z.object({
66
+ 'members': z.array(z.object({
67
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
68
+ 'name': z.string().readonly(),
69
+ 'role': z.union([z.literal("lead"), z.literal("teammate")]).readonly(),
70
+ 'status': z.union([z.literal("running"), z.literal("failed"), z.literal("idle"), z.literal("inactive"), z.literal("provisioning")]).readonly(),
71
+ 'description': z.string().readonly().optional(),
72
+ 'provider': z.string().readonly().optional(),
73
+ 'context': z.union([z.literal("fresh"), z.literal("fork")]).readonly().optional(),
74
+ 'model': z.string().readonly().optional(),
75
+ 'diagnostics': z.array(z.string()).readonly(),
76
+ })).readonly(),
77
+ 'tasks': z.array(z.object({
78
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
79
+ 'revision': z.number().readonly(),
80
+ 'subject': z.string().readonly(),
81
+ 'description': z.string().readonly(),
82
+ 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
83
+ 'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
84
+ 'writeScopes': z.array(z.string()).readonly(),
85
+ 'ownerName': z.string().readonly().optional(),
86
+ 'ready': z.boolean().readonly(),
87
+ 'writeScopeWarnings': z.array(z.string()).readonly(),
88
+ })).readonly(),
89
+ })
90
+
91
+ export const TYPERT_REMOTE = {
92
+ package: '@deepseek-ai/dsh-experimental-agent-team',
93
+ descriptors: [
94
+ {
95
+ id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/createTask',
96
+ service: 'agentTeams',
97
+ namespace: 'agentTeams',
98
+ method: 'createTask',
99
+ implementation: 'remoteCreateTask',
100
+ invocation: { kind: 'direct' },
101
+ scope: {
102
+ context: 'agent',
103
+ wire: 'agentId',
104
+ },
105
+ parameters: [
106
+ {
107
+ name: 'agent',
108
+ wire: 'agentId',
109
+ source: 'lookup',
110
+ lookup: 'agent',
111
+ codec: {
112
+ mode: 'strict',
113
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
114
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_0$schema,
115
+ },
116
+ },
117
+ {
118
+ name: 'request',
119
+ wire: 'request',
120
+ source: 'json',
121
+ codec: {
122
+ mode: 'strict',
123
+ typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#CreateTeamTaskRequest',
124
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_1$schema,
125
+ },
126
+ },
127
+ ],
128
+ result: {
129
+ mode: 'strict',
130
+ typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamTaskMutationResult',
131
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_result$schema,
132
+ },
133
+ sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":257,"column":3},
134
+ },
135
+ {
136
+ id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/updateTask',
137
+ service: 'agentTeams',
138
+ namespace: 'agentTeams',
139
+ method: 'updateTask',
140
+ implementation: 'remoteUpdateTask',
141
+ invocation: { kind: 'direct' },
142
+ scope: {
143
+ context: 'agent',
144
+ wire: 'agentId',
145
+ },
146
+ parameters: [
147
+ {
148
+ name: 'agent',
149
+ wire: 'agentId',
150
+ source: 'lookup',
151
+ lookup: 'agent',
152
+ codec: {
153
+ mode: 'strict',
154
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
155
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_0$schema,
156
+ },
157
+ },
158
+ {
159
+ name: 'request',
160
+ wire: 'request',
161
+ source: 'json',
162
+ codec: {
163
+ mode: 'strict',
164
+ typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#UpdateTeamTaskRequest',
165
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_1$schema,
166
+ },
167
+ },
168
+ ],
169
+ result: {
170
+ mode: 'strict',
171
+ typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamTaskMutationResult',
172
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_result$schema,
173
+ },
174
+ sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":268,"column":3},
175
+ },
176
+ {
177
+ id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/view',
178
+ service: 'agentTeams',
179
+ namespace: 'agentTeams',
180
+ method: 'view',
181
+ implementation: 'remoteView',
182
+ invocation: { kind: 'direct' },
183
+ scope: {
184
+ context: 'agent',
185
+ wire: 'agentId',
186
+ },
187
+ parameters: [
188
+ {
189
+ name: 'agent',
190
+ wire: 'agentId',
191
+ source: 'lookup',
192
+ lookup: 'agent',
193
+ codec: {
194
+ mode: 'strict',
195
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
196
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_parameter_0$schema,
197
+ },
198
+ },
199
+ ],
200
+ result: {
201
+ mode: 'strict',
202
+ typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamView',
203
+ schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_result$schema,
204
+ },
205
+ sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":243,"column":3},
206
+ },
207
+ ],
208
+ }
209
+
210
+ export default TYPERT_REMOTE
@@ -0,0 +1,23 @@
1
+ /** One-shot Team change waiters independent of durable state projection. */
2
+ import type { TeamId, TeamWaitResult } from './types.ts';
3
+ /** Owns current Team change waiters and releases each at most once. */
4
+ export declare class TeamActivity {
5
+ private readonly waiters;
6
+ private closed;
7
+ /**
8
+ * Wait for one later Team-domain or member-status change.
9
+ * @param id - Team whose next edge wakes the caller.
10
+ * @param timeoutMs - bounded wait duration from ten seconds through one hour.
11
+ * @param signal - caller cancellation for this wait only.
12
+ * @returns whether the wait ended by timeout.
13
+ */
14
+ wait(id: TeamId, timeoutMs: number, signal: AbortSignal): Promise<TeamWaitResult>;
15
+ /**
16
+ * Wake and remove every current waiter for one Team.
17
+ * @param id - Team whose current waiters observe the change.
18
+ */
19
+ notify(id: TeamId): void;
20
+ /** Close admission and wake every current waiter during runtime disposal. */
21
+ close(): void;
22
+ }
23
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +1,85 @@
1
+ /** One-shot Team change waiters independent of durable state projection. */
2
+ import { errorMessage, TeamError } from "./error.js";
3
+ /** Owns current Team change waiters and releases each at most once. */
4
+ export class TeamActivity {
5
+ waiters = new Map();
6
+ closed = false;
7
+ /**
8
+ * Wait for one later Team-domain or member-status change.
9
+ * @param id - Team whose next edge wakes the caller.
10
+ * @param timeoutMs - bounded wait duration from ten seconds through one hour.
11
+ * @param signal - caller cancellation for this wait only.
12
+ * @returns whether the wait ended by timeout.
13
+ */
14
+ async wait(id, timeoutMs, signal) {
15
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 10_000 || timeoutMs > 3_600_000) {
16
+ throw new TeamError('timeoutMs must be an integer from 10000 through 3600000', 'TEAM_INVALID_TIMEOUT');
17
+ }
18
+ signal.throwIfAborted();
19
+ if (this.closed)
20
+ return { timedOut: false };
21
+ const changed = await new Promise((resolve, reject) => {
22
+ let waiters = this.waiters.get(id);
23
+ if (waiters === undefined) {
24
+ waiters = new Set();
25
+ this.waiters.set(id, waiters);
26
+ }
27
+ let settled = false;
28
+ const finish = (settle) => {
29
+ /* v8 ignore next -- timeout, abort, and notification may race after one winner removes the others. */
30
+ if (settled)
31
+ return;
32
+ settled = true;
33
+ clearTimeout(timer);
34
+ signal.removeEventListener('abort', onAbort);
35
+ waiters.delete(waiter);
36
+ if (waiters.size === 0)
37
+ this.waiters.delete(id);
38
+ settle();
39
+ };
40
+ const onAbort = () => {
41
+ finish(() => {
42
+ const reason = signal.reason;
43
+ reject(reason instanceof Error
44
+ ? reason
45
+ : new TeamError(`wait_agent aborted: ${errorMessage(reason)}`, 'TEAM_WAIT_ABORTED'));
46
+ });
47
+ };
48
+ const waiter = {
49
+ resolve: () => {
50
+ finish(() => { resolve(true); });
51
+ },
52
+ };
53
+ waiters.add(waiter);
54
+ const timer = setTimeout(() => { finish(() => { resolve(false); }); }, timeoutMs);
55
+ signal.addEventListener('abort', onAbort, { once: true });
56
+ // AbortSignal does not replay an abort that wins between the pre-check and listener registration.
57
+ /* v8 ignore next -- requires an abort in the synchronous gap between the pre-check and listener registration. */
58
+ if (signal.aborted)
59
+ onAbort();
60
+ });
61
+ return { timedOut: !changed };
62
+ }
63
+ /**
64
+ * Wake and remove every current waiter for one Team.
65
+ * @param id - Team whose current waiters observe the change.
66
+ */
67
+ notify(id) {
68
+ const waiters = this.waiters.get(id);
69
+ if (waiters === undefined)
70
+ return;
71
+ this.waiters.delete(id);
72
+ for (const waiter of waiters)
73
+ waiter.resolve();
74
+ }
75
+ /** Close admission and wake every current waiter during runtime disposal. */
76
+ close() {
77
+ this.closed = true;
78
+ for (const waiters of this.waiters.values()) {
79
+ for (const waiter of waiters)
80
+ waiter.resolve();
81
+ }
82
+ this.waiters.clear();
83
+ }
84
+ }
85
+ //# sourceMappingURL=activity.js.map
@@ -0,0 +1,3 @@
1
+ /** Client-safe Agent Teams request, result, and view vocabulary. */
2
+ export type { CreateTeamTaskRequest, TeamMemberView, TeamTaskAction, TeamTaskId, TeamTaskMutationResult, TeamTaskStatus, TeamTaskView, TeamView, UpdateTeamTaskRequest, } from './types.ts';
3
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Client-safe Agent Teams request, result, and view vocabulary. */
2
+ export {};
3
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,13 @@
1
+ /** Typed Agent Teams failures. */
2
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
3
+ /** Stable failure raised by the Team domain. */
4
+ export declare class TeamError extends HarnessError {
5
+ constructor(message: string, code: string, options?: ErrorOptions);
6
+ }
7
+ /**
8
+ * Render an arbitrary thrown value without replacing the original rejection.
9
+ * @param error - caught value used in a diagnostic or durable failure record.
10
+ * @returns one bounded single-line description.
11
+ */
12
+ export declare function errorMessage(error: unknown): string;
13
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,23 @@
1
+ /** Typed Agent Teams failures. */
2
+ import { inspect } from 'node:util';
3
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
4
+ /** Stable failure raised by the Team domain. */
5
+ export class TeamError extends HarnessError {
6
+ constructor(message, code, options) {
7
+ super(message, code, options);
8
+ this.name = 'TeamError';
9
+ }
10
+ }
11
+ /**
12
+ * Render an arbitrary thrown value without replacing the original rejection.
13
+ * @param error - caught value used in a diagnostic or durable failure record.
14
+ * @returns one bounded single-line description.
15
+ */
16
+ export function errorMessage(error) {
17
+ if (error instanceof Error)
18
+ return error.message;
19
+ if (typeof error === 'string')
20
+ return error;
21
+ return inspect(error, { breakLength: Infinity, compact: true, depth: 4 });
22
+ }
23
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1,137 @@
1
+ /** Agent Teams service façade over roster, mailbox, task, and runtime lifecycle owners. */
2
+ import { Context } from '@deepseek-ai/cordis';
3
+ import z from '@deepseek-ai/schemastery';
4
+ import type { Agent } from '@deepseek-ai/dsh-agent';
5
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
6
+ import type { TeamMembership } from './roster.ts';
7
+ import { TeamTaskId } from './types.ts';
8
+ import type { Config, CreateTeamTaskRequest, SendTeamMessageRequest, SendTeamMessageResult, SpawnTeammateRequest, SpawnTeammateResult, TeamMemberView, TeamTaskMutationResult, TeamTaskView, TeamView, TeamWaitResult, UpdateTeamTaskRequest } from './types.ts';
9
+ export type * from './types.ts';
10
+ export type { TeamMembership } from './roster.ts';
11
+ export { TeamId, TeamMessageId, TeamTaskId } from './types.ts';
12
+ export { TeamError } from './error.ts';
13
+ declare module '@deepseek-ai/cordis' {
14
+ interface Context {
15
+ agentTeams: TeamService;
16
+ }
17
+ }
18
+ /** Agent Teams service backed by the exact live Lead Session log. */
19
+ export declare class TeamService extends TypertRemoteService {
20
+ static inject: string[];
21
+ static Config: z<Config>;
22
+ /** Validated deployment limits used by every Team operation. */
23
+ private readonly config;
24
+ private readonly activity;
25
+ private readonly lifecycle;
26
+ private readonly journal;
27
+ private readonly roster;
28
+ private readonly mailbox;
29
+ private readonly tasks;
30
+ constructor(ctx: Context, config?: Config);
31
+ /**
32
+ * Resolve one exact live Agent's Team role.
33
+ * @param agent - exact live Agent used as the authority credential.
34
+ * @returns its root, Team identity, role, and model-facing name.
35
+ */
36
+ membership(agent: Agent): TeamMembership;
37
+ /**
38
+ * List the runtime-enriched roster visible to one Team member.
39
+ * @param agent - exact live Team member.
40
+ * @returns Lead and teammate rows in creation order.
41
+ */
42
+ listMembers(agent: Agent): TeamMemberView[];
43
+ /**
44
+ * Create one named, continuable direct child of the Team Lead.
45
+ * @param caller - exact live Lead Agent.
46
+ * @param request - immutable name, description, prompt, context mode, provider, and cancellation.
47
+ * @returns the active roster row.
48
+ */
49
+ spawnTeammate(caller: Agent, request: SpawnTeammateRequest): Promise<SpawnTeammateResult>;
50
+ /**
51
+ * Queue one durable peer message, then attempt immediate delivery.
52
+ * @param caller - exact live sending Team member.
53
+ * @param request - target name, content, and pre-queue cancellation.
54
+ * @returns durable message identity and immediate-delivery observation.
55
+ */
56
+ sendMessage(caller: Agent, request: SendTeamMessageRequest): Promise<SendTeamMessageResult>;
57
+ /**
58
+ * Create one unowned pending task in the Team Lead log.
59
+ * @param caller - exact live Team member creating the task.
60
+ * @param request - task text, blockers, and advisory write scopes.
61
+ * @returns the revision-one task view.
62
+ */
63
+ createTask(caller: Agent, request: CreateTeamTaskRequest): Promise<TeamTaskView>;
64
+ /**
65
+ * Return one task, including a deleted tombstone.
66
+ * @param caller - exact live Team member reading the task.
67
+ * @param id - Team-local task identity.
68
+ * @returns the latest task value and derived readiness diagnostics.
69
+ */
70
+ getTask(caller: Agent, id: TeamTaskId): TeamTaskView;
71
+ /**
72
+ * List current non-deleted tasks in numeric creation order.
73
+ * @param caller - exact live Team member reading the board.
74
+ * @returns detached current task views.
75
+ */
76
+ listTasks(caller: Agent): TeamTaskView[];
77
+ /**
78
+ * Compare-and-set one authorized task transition.
79
+ * @param caller - exact live Team member authorizing the mutation.
80
+ * @param request - task identity, expected revision, action, and action fields.
81
+ * @returns the committed next task revision.
82
+ */
83
+ updateTask(caller: Agent, request: UpdateTeamTaskRequest): Promise<TeamTaskView>;
84
+ /**
85
+ * Wait for the next Team-domain or member-status change.
86
+ * @param caller - exact live Team member waiting for activity.
87
+ * @param timeoutMs - bounded wait duration from ten seconds through one hour.
88
+ * @param signal - caller cancellation for the wait only.
89
+ * @returns one observed change or a timeout result.
90
+ */
91
+ waitForChange(caller: Agent, timeoutMs: number, signal: AbortSignal): Promise<TeamWaitResult>;
92
+ /**
93
+ * Interrupt one live teammate turn without clearing its pending inbox.
94
+ * @param caller - exact live Lead Agent.
95
+ * @param targetName - durable teammate name.
96
+ * @returns the target status sampled before cancellation.
97
+ */
98
+ interrupt(caller: Agent, targetName: string): {
99
+ previousStatus: 'running' | 'idle' | 'inactive';
100
+ };
101
+ /**
102
+ * Resolve a caller without throwing, used by scoped-tool installation and observers.
103
+ * @param agent - candidate exact live Agent.
104
+ * @returns Team membership, or undefined for non-Team subagents and stale identities.
105
+ */
106
+ tryMembership(agent: Agent): TeamMembership | undefined;
107
+ /**
108
+ * Read the current roster and non-deleted task board through the generated Remote API.
109
+ * @param agent - exact live Team member used as the authority credential.
110
+ * @returns detached current roster and task views.
111
+ */
112
+ remoteView(agent: Agent): TeamView;
113
+ /**
114
+ * Create one shared task through the generated Remote API.
115
+ * @param agent - exact live Team member creating the task.
116
+ * @param request - task text, blockers, and advisory write scopes.
117
+ * @returns the revision-one task or a typed Team rejection.
118
+ */
119
+ remoteCreateTask(agent: Agent, request: CreateTeamTaskRequest): Promise<TeamTaskMutationResult>;
120
+ /**
121
+ * Apply one task mutation and preserve Team rejections as business results.
122
+ * @param agent - exact live Team member authorizing the mutation.
123
+ * @param request - task identity, expected revision, action, and action fields.
124
+ * @returns the committed task or a typed Team rejection.
125
+ */
126
+ remoteUpdateTask(agent: Agent, request: UpdateTeamTaskRequest): Promise<TeamTaskMutationResult>;
127
+ /** Preserve Team task rejections while allowing unexpected failures to reject the Remote call. */
128
+ private taskMutationResult;
129
+ /** Queue one contained recovery pass after publication has unwound. */
130
+ private scheduleRecovery;
131
+ /** Reconcile roster provisioning before retrying that member's pending mailbox. */
132
+ private recoverFor;
133
+ /** Stop Team-owned live branches and release every waiter before service disposal completes. */
134
+ private disposeRuntime;
135
+ }
136
+ export default TeamService;
137
+ //# sourceMappingURL=index.d.ts.map