@wowyuarm/dsh-agent-team 0.1.6 → 0.1.7
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 +11 -5
- package/README.zh.md +11 -5
- package/package.json +44 -42
- package/packages/agent-team/README.md +2 -0
- package/packages/agent-team/README.zh.md +2 -0
- package/packages/agent-team/lib/index.js +82 -204
- package/packages/agent-team/lib/ledger.js +301 -13
- package/packages/agent-team/lib/member-context.js +5 -1
- package/packages/agent-team/lib/member-runtime.js +229 -0
- package/packages/agent-team/lib/preset-roster.js +1 -0
- package/packages/agent-team/lib/spec.js +30 -1
- package/packages/agent-team/lib/typert.host.js +253 -74
- package/packages/agent-team/lib/typert.remote-client.d.ts +5 -1
- package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
- package/packages/agent-team/lib/typert.remote-client.js +172 -43
- package/packages/agent-team/lib/types/entities.js +1 -0
- package/packages/agent-team/lib/types/index.d.ts +20 -44
- package/packages/agent-team/lib/types/index.d.ts.map +1 -1
- package/packages/agent-team/lib/types/ledger.d.ts +34 -1
- package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-runtime.d.ts +108 -0
- package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -0
- package/packages/agent-team/lib/types/operations.js +1 -0
- package/packages/agent-team/lib/types/preset-roster.d.ts.map +1 -1
- package/packages/agent-team/lib/types/requests-results.js +1 -0
- package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/entities.d.ts +339 -0
- package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -0
- package/packages/agent-team/lib/types/types/operations.d.ts +303 -0
- package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -0
- package/packages/agent-team/lib/types/types/requests-results.d.ts +527 -0
- package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -0
- package/packages/agent-team/lib/types/types.d.ts +10 -1070
- package/packages/agent-team/lib/types/types.d.ts.map +1 -1
- package/packages/agent-team/preset/team-member/agent.cordis.yml +4 -2
- package/packages/client-agent-team/README.md +3 -1
- package/packages/client-agent-team/README.zh.md +3 -1
- package/packages/client-agent-team/lib/client.js +444 -298
- package/packages/client-agent-team/lib/client.js.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +3 -2
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +30 -7
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +2 -2
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts +2 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +31 -5
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamComposer.js +2 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts +12 -0
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamMemberDock.js +13 -0
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMessage.js +10 -3
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
- 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 +2 -2
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceRow.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceRow.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/index.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/index.js +25 -28
- package/packages/client-agent-team/lib/types/client/locales.d.ts +28 -0
- package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/locales.js +28 -0
- package/packages/client-agent-team/lib/types/client/member-session-input.d.ts +1 -3
- package/packages/client-agent-team/lib/types/client/member-session-input.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/member-session-input.js +18 -6
- package/packages/client-agent-team/lib/types/client/navigation.d.ts +2 -1
- package/packages/client-agent-team/lib/types/client/navigation.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/sidebar-order.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/sidebar-order.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/slots.d.ts +3 -1
- package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-membership.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/team-membership.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.d.ts +0 -17
- package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.js +0 -135
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import type { ReasoningEffortId } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
3
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace';
|
|
5
|
+
/** Stable identifier of one Agent Team operation. */
|
|
6
|
+
export type AgentTeamOperationId = Branded<'AgentTeamOperationId'>;
|
|
7
|
+
/** Caller-supplied idempotency identifier for one business operation. */
|
|
8
|
+
export type AgentTeamRequestId = Branded<'AgentTeamRequestId'>;
|
|
9
|
+
/** Stable identifier of one uploaded composer attachment (cache, not archive). */
|
|
10
|
+
export type AgentTeamAttachmentId = Branded<'AgentTeamAttachmentId'>;
|
|
11
|
+
/** Stable identifier of one Team member. */
|
|
12
|
+
export type AgentTeamMemberId = Branded<'AgentTeamMemberId'>;
|
|
13
|
+
/** Stable identifier of one Workspace-scoped Channel. */
|
|
14
|
+
export type AgentTeamChannelRef = Branded<'AgentTeamChannelRef'>;
|
|
15
|
+
/** Stable identifier of one immutable Message. */
|
|
16
|
+
export type AgentTeamMessageRef = Branded<'AgentTeamMessageRef'>;
|
|
17
|
+
/** Stable identifier of one Task. */
|
|
18
|
+
export type AgentTeamTaskRef = Branded<'AgentTeamTaskRef'>;
|
|
19
|
+
/** Stable identifier of one Thread. */
|
|
20
|
+
export type AgentTeamThreadRef = Branded<'AgentTeamThreadRef'>;
|
|
21
|
+
/** Stable identifier of one Claim. */
|
|
22
|
+
export type AgentTeamClaimRef = Branded<'AgentTeamClaimRef'>;
|
|
23
|
+
/** Stable identifier of one public Thread Activity. */
|
|
24
|
+
export type AgentTeamActivityRef = Branded<'AgentTeamActivityRef'>;
|
|
25
|
+
/** Process-local one-use authorization for one Human invitation. */
|
|
26
|
+
export type AgentTeamConfirmationToken = Branded<'AgentTeamConfirmationToken'>;
|
|
27
|
+
/** Snapshot of the Human authority authorized for an operation. */
|
|
28
|
+
export interface AgentTeamHumanActor {
|
|
29
|
+
readonly kind: 'human';
|
|
30
|
+
readonly memberId: AgentTeamMemberId;
|
|
31
|
+
readonly handle: string;
|
|
32
|
+
}
|
|
33
|
+
/** Snapshot of the exact Agent Member authorized by its live Agent binding. */
|
|
34
|
+
export interface AgentTeamMemberActor {
|
|
35
|
+
readonly kind: 'member';
|
|
36
|
+
readonly memberId: AgentTeamMemberId;
|
|
37
|
+
readonly handle: string;
|
|
38
|
+
}
|
|
39
|
+
export type AgentTeamActor = AgentTeamHumanActor | AgentTeamMemberActor;
|
|
40
|
+
/** Provider route plus provider-owned model id one Member can be pinned to. */
|
|
41
|
+
export interface AgentTeamModelSelection {
|
|
42
|
+
readonly provider: string;
|
|
43
|
+
readonly model: string;
|
|
44
|
+
/** Adapter-owned reasoning effort, or the model's provider/default behavior when absent. */
|
|
45
|
+
readonly reasoningEffort?: ReasoningEffortId;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Durable capability intent of one Member, carried verbatim on the Member
|
|
49
|
+
* entity through every lifecycle operation. Pure intent: names are not
|
|
50
|
+
* validated against any known-tool list at commit time, so a Harness upgrade
|
|
51
|
+
* that renames or removes tools can never make an old ledger unreplayable.
|
|
52
|
+
* Divergence surfaces at activation as runtime-derived warnings, never as
|
|
53
|
+
* persisted facts (stale persisted warnings would lie after Host restart or
|
|
54
|
+
* Harness upgrades).
|
|
55
|
+
*/
|
|
56
|
+
export interface AgentTeamMemberCapabilities {
|
|
57
|
+
/**
|
|
58
|
+
* Deliberate interface reservation, no UI writes it today: Runtime Revision
|
|
59
|
+
* manifests depend on this seam — do not remove during cleanup.
|
|
60
|
+
* Absent = the Member sees all standard tools; present = the activation
|
|
61
|
+
* allow-list (unknown names drop with a warning; the Host always unions
|
|
62
|
+
* the five Team tools over it).
|
|
63
|
+
*/
|
|
64
|
+
readonly tools?: {
|
|
65
|
+
readonly allow?: readonly string[];
|
|
66
|
+
} | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Absent = auto-load every skill in the Member's private skills directory;
|
|
69
|
+
* present = only the listed skill names.
|
|
70
|
+
*/
|
|
71
|
+
readonly skills?: {
|
|
72
|
+
readonly allow?: readonly string[];
|
|
73
|
+
} | undefined;
|
|
74
|
+
}
|
|
75
|
+
/** Durable identity and lifecycle intent of one team-managed Agent. */
|
|
76
|
+
export interface AgentTeamAgentMember {
|
|
77
|
+
readonly memberId: AgentTeamMemberId;
|
|
78
|
+
readonly sessionId: SessionId;
|
|
79
|
+
readonly workspaceId: WorkspaceId;
|
|
80
|
+
readonly handle: string;
|
|
81
|
+
readonly description: string;
|
|
82
|
+
readonly presetId: string;
|
|
83
|
+
/** Absent inherits the Host default model selection at every activation. */
|
|
84
|
+
readonly model?: AgentTeamModelSelection | undefined;
|
|
85
|
+
/** Durable capability intent; see AgentTeamMemberCapabilities. */
|
|
86
|
+
readonly capabilities?: AgentTeamMemberCapabilities | undefined;
|
|
87
|
+
/** Host-internal namespace; never exposed through Client projections. */
|
|
88
|
+
readonly privateMemoryPath: string;
|
|
89
|
+
/**
|
|
90
|
+
* Durable lifecycle state. `enabled`/`suspended` are the reversible working
|
|
91
|
+
* pair; `archived` hides the Member from every surface while keeping its
|
|
92
|
+
* Session log and private memory recoverable (no restore entry point yet,
|
|
93
|
+
* mirroring archived dsh sessions); `inactive` is irreversible removal with
|
|
94
|
+
* data cleanup.
|
|
95
|
+
*/
|
|
96
|
+
readonly state: 'enabled' | 'suspended' | 'inactive' | 'archived';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Runtime-derived capability divergence between a Member's persisted intent
|
|
100
|
+
* and the names known at activation time (for example after a Harness
|
|
101
|
+
* upgrade renamed or removed a tool). Derived state only — never persisted;
|
|
102
|
+
* recomputed at every activation so warnings never go stale.
|
|
103
|
+
*/
|
|
104
|
+
export interface AgentTeamCapabilityWarning {
|
|
105
|
+
/** The persisted allow-list entry that resolved to no known capability. */
|
|
106
|
+
readonly name: string;
|
|
107
|
+
/** Digest of the names that were known when the entry was dropped. */
|
|
108
|
+
readonly knownNames: readonly string[];
|
|
109
|
+
}
|
|
110
|
+
/** Host projection combining durable intent with process-local availability. */
|
|
111
|
+
export interface AgentTeamAgentMemberStatus {
|
|
112
|
+
readonly member: AgentTeamAgentMember;
|
|
113
|
+
readonly availability: 'active' | 'suspended' | 'inactive' | 'archived' | 'unavailable';
|
|
114
|
+
readonly presence: 'available' | 'working' | 'error' | 'unavailable';
|
|
115
|
+
readonly diagnostic?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Runtime-derived, activation-scoped capability warnings (see
|
|
118
|
+
* AgentTeamCapabilityWarning); empty while capabilities resolve cleanly.
|
|
119
|
+
*/
|
|
120
|
+
readonly capabilityWarnings?: readonly AgentTeamCapabilityWarning[] | undefined;
|
|
121
|
+
}
|
|
122
|
+
/** Browser-safe Member identity with Host-only paths removed. */
|
|
123
|
+
export type AgentTeamClientMember = Omit<AgentTeamAgentMember, 'privateMemoryPath'>;
|
|
124
|
+
/** Browser-safe lifecycle projection. */
|
|
125
|
+
export interface AgentTeamClientMemberStatus extends Omit<AgentTeamAgentMemberStatus, 'member'> {
|
|
126
|
+
readonly member: AgentTeamClientMember;
|
|
127
|
+
}
|
|
128
|
+
/** Workspace-scoped request used by the Client Remote projection. */
|
|
129
|
+
export interface AgentTeamMembersRequest {
|
|
130
|
+
readonly workspaceId: WorkspaceId;
|
|
131
|
+
}
|
|
132
|
+
/** Look up navigation facts for branded Task refs found in message bodies. */
|
|
133
|
+
export interface AgentTeamResolveTaskRefsRequest {
|
|
134
|
+
readonly workspaceId: WorkspaceId;
|
|
135
|
+
readonly taskRefs: readonly AgentTeamTaskRef[];
|
|
136
|
+
}
|
|
137
|
+
/** One resolved Task; refs that do not exist in the workspace are omitted. */
|
|
138
|
+
export interface AgentTeamResolvedTaskRef {
|
|
139
|
+
readonly taskRef: AgentTeamTaskRef;
|
|
140
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
141
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
142
|
+
readonly taskNumber: number;
|
|
143
|
+
}
|
|
144
|
+
export interface AgentTeamResolveTaskRefsResult {
|
|
145
|
+
readonly resolved: readonly AgentTeamResolvedTaskRef[];
|
|
146
|
+
}
|
|
147
|
+
export interface AgentTeamOperationBase {
|
|
148
|
+
readonly sequence: number;
|
|
149
|
+
readonly operationId: AgentTeamOperationId;
|
|
150
|
+
readonly requestId: AgentTeamRequestId;
|
|
151
|
+
readonly occurredAt: string;
|
|
152
|
+
readonly actor: AgentTeamActor;
|
|
153
|
+
readonly previousOperationId: AgentTeamOperationId | null;
|
|
154
|
+
}
|
|
155
|
+
/** One Workspace-scoped collaboration Channel. */
|
|
156
|
+
export interface AgentTeamChannel {
|
|
157
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
158
|
+
readonly workspaceId: WorkspaceId;
|
|
159
|
+
readonly name: string;
|
|
160
|
+
readonly description: string;
|
|
161
|
+
readonly createdAtSequence: number;
|
|
162
|
+
/**
|
|
163
|
+
* Durable lifecycle state. `archived` hides the Channel and its Threads from
|
|
164
|
+
* every surface while keeping all facts recoverable (no restore entry point
|
|
165
|
+
* yet, mirroring archived dsh sessions). Ledgers written before Channel
|
|
166
|
+
* archival existed omit the field; the record schema normalizes it to
|
|
167
|
+
* `active` at load time.
|
|
168
|
+
*/
|
|
169
|
+
readonly state: 'active' | 'archived';
|
|
170
|
+
}
|
|
171
|
+
/** One durable Channel membership fact derived from the operation ledger. */
|
|
172
|
+
export interface AgentTeamChannelMembership {
|
|
173
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
174
|
+
readonly memberId: AgentTeamMemberId;
|
|
175
|
+
}
|
|
176
|
+
/** One immutable top-level or reply Message. */
|
|
177
|
+
export interface AgentTeamMessageAttachment {
|
|
178
|
+
readonly attachmentId: AgentTeamAttachmentId;
|
|
179
|
+
readonly name: string;
|
|
180
|
+
readonly byteSize: number;
|
|
181
|
+
readonly mediaType: string;
|
|
182
|
+
}
|
|
183
|
+
export interface AgentTeamMessage {
|
|
184
|
+
readonly messageRef: AgentTeamMessageRef;
|
|
185
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
186
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
187
|
+
/** Absent on Messages committed while the Thread had no Task; promotion does not rewrite prior Messages. */
|
|
188
|
+
readonly taskRef?: AgentTeamTaskRef;
|
|
189
|
+
readonly sender: AgentTeamMemberId;
|
|
190
|
+
readonly body: string;
|
|
191
|
+
readonly attachments?: readonly AgentTeamMessageAttachment[] | undefined;
|
|
192
|
+
readonly topLevel: boolean;
|
|
193
|
+
readonly sequence: number;
|
|
194
|
+
/** Wall-clock instant of the wrapping ledger operation; pre-occurredAt ledgers normalize on replay. */
|
|
195
|
+
readonly occurredAt: string;
|
|
196
|
+
}
|
|
197
|
+
/** Task overlay created by an atomic start or Human promotion. */
|
|
198
|
+
export interface AgentTeamTask {
|
|
199
|
+
readonly taskRef: AgentTeamTaskRef;
|
|
200
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
201
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
202
|
+
readonly status: 'todo' | 'in_progress' | 'in_review' | 'done' | 'closed';
|
|
203
|
+
readonly resolution: 'open' | 'accepted' | 'closed';
|
|
204
|
+
}
|
|
205
|
+
/** Current projection of one collaboration Thread. */
|
|
206
|
+
export interface AgentTeamThread {
|
|
207
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
208
|
+
/** Present after atomic Task creation or Human promotion; absent on taskless Threads. */
|
|
209
|
+
readonly taskRef?: AgentTeamTaskRef;
|
|
210
|
+
/** Last public Message, Claim, or Task-resolution sequence. */
|
|
211
|
+
readonly revision: number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A Member's current attention period for one Thread.
|
|
215
|
+
*
|
|
216
|
+
* Its absence means the Member is not following. Read state is compact: all
|
|
217
|
+
* follower-visible facts from `startSequence` through `readThroughSequence`
|
|
218
|
+
* are acknowledged, except for sparse direct markers retained separately.
|
|
219
|
+
*/
|
|
220
|
+
export interface AgentTeamThreadAttention {
|
|
221
|
+
readonly memberId: AgentTeamMemberId;
|
|
222
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
223
|
+
readonly startSequence: number;
|
|
224
|
+
readonly readThroughSequence: number;
|
|
225
|
+
}
|
|
226
|
+
/** Identity of one Member × Thread attention period. */
|
|
227
|
+
export interface AgentTeamThreadAttentionKey {
|
|
228
|
+
readonly memberId: AgentTeamMemberId;
|
|
229
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
230
|
+
}
|
|
231
|
+
/** Sparse direct-priority marker for one structured Message mention. */
|
|
232
|
+
export interface AgentTeamDirectMarker {
|
|
233
|
+
readonly memberId: AgentTeamMemberId;
|
|
234
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
235
|
+
readonly messageRef: AgentTeamMessageRef;
|
|
236
|
+
readonly sequence: number;
|
|
237
|
+
}
|
|
238
|
+
/** Sparse marker retaining a relevant Task or Claim Activity after Attention ends. */
|
|
239
|
+
export interface AgentTeamActivityMarker {
|
|
240
|
+
readonly memberId: AgentTeamMemberId;
|
|
241
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
242
|
+
readonly activityRef: AgentTeamActivityRef;
|
|
243
|
+
readonly sequence: number;
|
|
244
|
+
}
|
|
245
|
+
/** Durable changes to private Member inbox state carried by one operation. */
|
|
246
|
+
export interface AgentTeamInboxDelta {
|
|
247
|
+
readonly attention: {
|
|
248
|
+
/** New or replacement current Attention records. */
|
|
249
|
+
readonly set: readonly AgentTeamThreadAttention[];
|
|
250
|
+
/** Attention periods ended by this operation. */
|
|
251
|
+
readonly removed: readonly AgentTeamThreadAttentionKey[];
|
|
252
|
+
};
|
|
253
|
+
readonly directMarkers: {
|
|
254
|
+
readonly added: readonly AgentTeamDirectMarker[];
|
|
255
|
+
readonly removed: readonly AgentTeamDirectMarker[];
|
|
256
|
+
};
|
|
257
|
+
readonly activityMarkers: {
|
|
258
|
+
readonly added: readonly AgentTeamActivityMarker[];
|
|
259
|
+
readonly removed: readonly AgentTeamActivityMarker[];
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/** One Direction Claim retained as Task progress history. */
|
|
263
|
+
export interface AgentTeamClaim {
|
|
264
|
+
readonly claimRef: AgentTeamClaimRef;
|
|
265
|
+
readonly taskRef: AgentTeamTaskRef;
|
|
266
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
267
|
+
readonly owner: AgentTeamMemberId;
|
|
268
|
+
readonly direction: string;
|
|
269
|
+
readonly normalizedDirection: string;
|
|
270
|
+
readonly state: 'active' | 'done' | 'released';
|
|
271
|
+
}
|
|
272
|
+
interface AgentTeamActivityBase {
|
|
273
|
+
readonly activityRef: AgentTeamActivityRef;
|
|
274
|
+
readonly taskRef: AgentTeamTaskRef;
|
|
275
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
276
|
+
readonly actor: AgentTeamMemberId;
|
|
277
|
+
readonly sequence: number;
|
|
278
|
+
}
|
|
279
|
+
export interface AgentTeamClaimActivity extends AgentTeamActivityBase {
|
|
280
|
+
readonly kind: 'claim' | 'done' | 'release';
|
|
281
|
+
readonly claimRef: AgentTeamClaimRef;
|
|
282
|
+
}
|
|
283
|
+
export interface AgentTeamTaskActivity extends AgentTeamActivityBase {
|
|
284
|
+
readonly kind: 'promote' | 'accept' | 'close' | 'reopen';
|
|
285
|
+
/** Claims atomically released by close; absent for other Task transitions. */
|
|
286
|
+
readonly releasedClaimRefs?: readonly AgentTeamClaimRef[] | undefined;
|
|
287
|
+
/** Active claims the Human acceptance completed alongside the Task; absent for plain accepts. */
|
|
288
|
+
readonly completedClaimRefs?: readonly AgentTeamClaimRef[] | undefined;
|
|
289
|
+
}
|
|
290
|
+
/** One automatic, public release summary caused by a membership lifecycle action. */
|
|
291
|
+
export interface AgentTeamClaimsReleasedActivity extends AgentTeamActivityBase {
|
|
292
|
+
readonly kind: 'claims_released';
|
|
293
|
+
readonly claimRefs: readonly AgentTeamClaimRef[];
|
|
294
|
+
}
|
|
295
|
+
/** One ordered public Thread Activity. */
|
|
296
|
+
export type AgentTeamActivity = AgentTeamClaimActivity | AgentTeamTaskActivity | AgentTeamClaimsReleasedActivity;
|
|
297
|
+
/** One public, revisioned fact in a Thread timeline. */
|
|
298
|
+
export type AgentTeamThreadFact = {
|
|
299
|
+
readonly kind: 'message';
|
|
300
|
+
readonly sequence: number;
|
|
301
|
+
readonly message: AgentTeamMessage;
|
|
302
|
+
/** Structured Member refs from the originating send operation; empty when the Message mentions nobody. */
|
|
303
|
+
readonly mentions: readonly AgentTeamMemberId[];
|
|
304
|
+
} | {
|
|
305
|
+
readonly kind: 'activity';
|
|
306
|
+
readonly sequence: number;
|
|
307
|
+
readonly activity: AgentTeamActivity;
|
|
308
|
+
};
|
|
309
|
+
/** One fact returned by a durable Thread read. */
|
|
310
|
+
export interface AgentTeamThreadReadFact {
|
|
311
|
+
readonly fact: AgentTeamThreadFact;
|
|
312
|
+
/** This fact was part of the unread batch advanced by this read. */
|
|
313
|
+
readonly unread: boolean;
|
|
314
|
+
/** This fact carries one of the recipient's structured direct mentions. */
|
|
315
|
+
readonly direct: boolean;
|
|
316
|
+
}
|
|
317
|
+
/** Stored form of a Message inside durable operations; pre-occurredAt ledgers omit it and normalize on load. */
|
|
318
|
+
export type AgentTeamStoredMessage = Omit<AgentTeamMessage, 'occurredAt'> & {
|
|
319
|
+
readonly occurredAt?: string | undefined;
|
|
320
|
+
};
|
|
321
|
+
/** Stored form of one Thread timeline fact; mirrors AgentTeamThreadFact with stored messages. */
|
|
322
|
+
export type AgentTeamStoredThreadFact = {
|
|
323
|
+
readonly kind: 'message';
|
|
324
|
+
readonly sequence: number;
|
|
325
|
+
readonly message: AgentTeamStoredMessage;
|
|
326
|
+
readonly mentions: readonly AgentTeamMemberId[];
|
|
327
|
+
} | {
|
|
328
|
+
readonly kind: 'activity';
|
|
329
|
+
readonly sequence: number;
|
|
330
|
+
readonly activity: AgentTeamActivity;
|
|
331
|
+
};
|
|
332
|
+
/** Stored form of one durable Thread read fact. */
|
|
333
|
+
export interface AgentTeamStoredThreadReadFact {
|
|
334
|
+
readonly fact: AgentTeamStoredThreadFact;
|
|
335
|
+
readonly unread: boolean;
|
|
336
|
+
readonly direct: boolean;
|
|
337
|
+
}
|
|
338
|
+
export {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AAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAExH,iGAAiG;AACjG,MAAM,MAAM,yBAAyB,GACjC;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAChG,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAA;AAElG,mDAAmD;AACnD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CACzB"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import type { SessionId } from "@deepseek-ai/dsh-session";
|
|
2
|
+
import type { WorkspaceId } from "@deepseek-ai/dsh-workspace";
|
|
3
|
+
import type { AgentTeamAgentMember, AgentTeamChannel, AgentTeamChannelRef, AgentTeamOperationBase, AgentTeamClaim, AgentTeamClaimActivity, AgentTeamClaimsReleasedActivity, AgentTeamInboxDelta, AgentTeamMemberId, AgentTeamMessage, AgentTeamStoredMessage, AgentTeamStoredThreadReadFact, AgentTeamTask, AgentTeamTaskActivity, AgentTeamThread, AgentTeamThreadAttention } from "./entities.ts";
|
|
4
|
+
/** The first durable operation in every Agent Team ledger. */
|
|
5
|
+
export interface AgentTeamInitializedOperation extends AgentTeamOperationBase {
|
|
6
|
+
readonly previousOperationId: null;
|
|
7
|
+
readonly kind: 'team/initialized';
|
|
8
|
+
readonly data: {
|
|
9
|
+
readonly humanMemberId: AgentTeamMemberId;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** Durable creation of one Channel with its atomic initial memberships. */
|
|
13
|
+
export interface AgentTeamChannelCreatedOperation extends AgentTeamOperationBase {
|
|
14
|
+
readonly kind: 'team/channel-created';
|
|
15
|
+
readonly data: {
|
|
16
|
+
readonly workspaceId: WorkspaceId;
|
|
17
|
+
readonly channel: AgentTeamChannel;
|
|
18
|
+
readonly memberIds: readonly AgentTeamMemberId[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Durable Agent Member creation with optional initial Channel memberships. */
|
|
22
|
+
export interface AgentTeamMemberAddedOperation extends AgentTeamOperationBase {
|
|
23
|
+
readonly kind: 'team/member-added';
|
|
24
|
+
readonly data: {
|
|
25
|
+
readonly member: AgentTeamAgentMember;
|
|
26
|
+
readonly channelRefs: readonly AgentTeamChannelRef[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Durable suspension of one existing Agent Member. */
|
|
30
|
+
export interface AgentTeamMemberSuspendedOperation extends AgentTeamOperationBase {
|
|
31
|
+
readonly kind: 'team/member-suspended';
|
|
32
|
+
readonly data: {
|
|
33
|
+
readonly member: AgentTeamAgentMember;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Durable re-enablement of one suspended Agent Member. */
|
|
37
|
+
export interface AgentTeamMemberResumedOperation extends AgentTeamOperationBase {
|
|
38
|
+
readonly kind: 'team/member-resumed';
|
|
39
|
+
readonly data: {
|
|
40
|
+
readonly member: AgentTeamAgentMember;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Durable archival of one Agent Member: the Member leaves every surface while
|
|
45
|
+
* its Session log and private memory stay recoverable. Like removal, the
|
|
46
|
+
* operation records the full cleanup snapshot — released Claims, public
|
|
47
|
+
* release Activities, and the Member's Inbox delta — so replay recomputes the
|
|
48
|
+
* same projection without runtime state.
|
|
49
|
+
*/
|
|
50
|
+
export interface AgentTeamMemberArchivedOperation extends AgentTeamOperationBase {
|
|
51
|
+
readonly kind: 'team/member-archived';
|
|
52
|
+
readonly data: {
|
|
53
|
+
readonly member: AgentTeamAgentMember;
|
|
54
|
+
/** Claims released because this Member became hidden. */
|
|
55
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
56
|
+
/** Public release summaries for the affected Threads. */
|
|
57
|
+
readonly activities: readonly AgentTeamClaimsReleasedActivity[];
|
|
58
|
+
readonly tasks: readonly AgentTeamTask[];
|
|
59
|
+
readonly threads: readonly AgentTeamThread[];
|
|
60
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Audit record of one in-place Member session restart. The restart changes no
|
|
65
|
+
* projection state — the Member keeps identity, transcript, and memory — so
|
|
66
|
+
* apply() treats this operation as a marker only.
|
|
67
|
+
*/
|
|
68
|
+
export interface AgentTeamMemberSessionRestartedOperation extends AgentTeamOperationBase {
|
|
69
|
+
readonly kind: 'team/member-session-restarted';
|
|
70
|
+
readonly data: {
|
|
71
|
+
readonly member: AgentTeamAgentMember;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Legacy audit record of one in-place Member context clear (superseded by
|
|
76
|
+
* `team/member-session-renewed`). The Host discarded the Member's persisted
|
|
77
|
+
* Session log and recreated the live Session under the same sessionId.
|
|
78
|
+
* Projection state is unchanged, so apply() treats this operation as a marker
|
|
79
|
+
* only. Never written again; the schema and replay validation stay so
|
|
80
|
+
* ledgers recorded before the renewal redesign keep replaying.
|
|
81
|
+
*/
|
|
82
|
+
export interface AgentTeamMemberContextClearedOperation extends AgentTeamOperationBase {
|
|
83
|
+
readonly kind: 'team/member-context-cleared';
|
|
84
|
+
readonly data: {
|
|
85
|
+
readonly member: AgentTeamAgentMember;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Durable transition of one Member onto a fresh Session: the Member keeps its
|
|
90
|
+
* identity, memory, and binding while its sessionId moves to a newly created
|
|
91
|
+
* Session whose first turn starts from an empty context. The previous Session
|
|
92
|
+
* log stays on disk (archived from every grouping surface), and the new
|
|
93
|
+
* Session header records the previous id as fork lineage.
|
|
94
|
+
*/
|
|
95
|
+
export interface AgentTeamMemberSessionRenewedOperation extends AgentTeamOperationBase {
|
|
96
|
+
readonly kind: 'team/member-session-renewed';
|
|
97
|
+
readonly data: {
|
|
98
|
+
readonly member: AgentTeamAgentMember;
|
|
99
|
+
/** The Session the Member ran on before this renewal. */
|
|
100
|
+
readonly previousSessionId: SessionId;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** Durable Human rename of one Channel's display facts; identity refs never change. */
|
|
104
|
+
export interface AgentTeamChannelUpdatedOperation extends AgentTeamOperationBase {
|
|
105
|
+
readonly kind: 'team/channel-updated';
|
|
106
|
+
readonly data: {
|
|
107
|
+
readonly workspaceId: WorkspaceId;
|
|
108
|
+
readonly channel: AgentTeamChannel;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Durable Human edit of one Member's mutable facts (handle, description, model). */
|
|
112
|
+
export interface AgentTeamMemberUpdatedOperation extends AgentTeamOperationBase {
|
|
113
|
+
readonly kind: 'team/member-updated';
|
|
114
|
+
readonly data: {
|
|
115
|
+
readonly member: AgentTeamAgentMember;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Durable addition of one Agent Member to one Channel. */
|
|
119
|
+
export interface AgentTeamChannelMemberAddedOperation extends AgentTeamOperationBase {
|
|
120
|
+
readonly kind: 'team/channel-member-added';
|
|
121
|
+
readonly data: {
|
|
122
|
+
readonly workspaceId: WorkspaceId;
|
|
123
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
124
|
+
readonly memberId: AgentTeamMemberId;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Durable removal of one Agent Member from one Channel and Channel-scoped cleanup. */
|
|
128
|
+
export interface AgentTeamChannelMemberRemovedOperation extends AgentTeamOperationBase {
|
|
129
|
+
readonly kind: 'team/channel-member-removed';
|
|
130
|
+
readonly data: {
|
|
131
|
+
readonly workspaceId: WorkspaceId;
|
|
132
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
133
|
+
readonly memberId: AgentTeamMemberId;
|
|
134
|
+
/** Claims released because this Member lost Channel authority. */
|
|
135
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
136
|
+
/** Public release summaries for the affected Threads. */
|
|
137
|
+
readonly activities: readonly AgentTeamClaimsReleasedActivity[];
|
|
138
|
+
readonly tasks: readonly AgentTeamTask[];
|
|
139
|
+
readonly threads: readonly AgentTeamThread[];
|
|
140
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Durable archival of one Channel: the Channel and its Threads leave every
|
|
145
|
+
* surface while all facts stay recoverable. Every active Claim on the
|
|
146
|
+
* Channel's Threads releases (any owner), and every affected Member's
|
|
147
|
+
* Attention and markers for those Threads clear — a hidden Channel must not
|
|
148
|
+
* leave Tasks stuck in progress or phantom unread counts.
|
|
149
|
+
*/
|
|
150
|
+
export interface AgentTeamChannelArchivedOperation extends AgentTeamOperationBase {
|
|
151
|
+
readonly kind: 'team/channel-archived';
|
|
152
|
+
readonly data: {
|
|
153
|
+
readonly workspaceId: WorkspaceId;
|
|
154
|
+
/** The Channel with its state moved to `archived`. */
|
|
155
|
+
readonly channel: AgentTeamChannel;
|
|
156
|
+
/** Claims released across every Member with an active Claim here. */
|
|
157
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
158
|
+
/** Public release summaries for the affected Threads. */
|
|
159
|
+
readonly activities: readonly AgentTeamClaimsReleasedActivity[];
|
|
160
|
+
readonly tasks: readonly AgentTeamTask[];
|
|
161
|
+
readonly threads: readonly AgentTeamThread[];
|
|
162
|
+
/** Attention and marker cleanup for every affected Member. */
|
|
163
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** Durable top-level Message, Thread, optional Task, and initial inbox facts. */
|
|
167
|
+
export interface AgentTeamMessageSentOperation extends AgentTeamOperationBase {
|
|
168
|
+
readonly kind: 'team/message-sent';
|
|
169
|
+
readonly data: {
|
|
170
|
+
readonly workspaceId: WorkspaceId;
|
|
171
|
+
readonly mentions: readonly AgentTeamMemberId[];
|
|
172
|
+
readonly message: AgentTeamMessage;
|
|
173
|
+
readonly task?: AgentTeamTask;
|
|
174
|
+
readonly thread: AgentTeamThread;
|
|
175
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Durable existing-Thread reply and any invitation/direct-mention facts. */
|
|
179
|
+
export interface AgentTeamThreadRepliedOperation extends AgentTeamOperationBase {
|
|
180
|
+
readonly kind: 'team/thread-replied';
|
|
181
|
+
readonly data: {
|
|
182
|
+
readonly workspaceId: WorkspaceId;
|
|
183
|
+
readonly baseRevision: number;
|
|
184
|
+
readonly mentions: readonly AgentTeamMemberId[];
|
|
185
|
+
readonly message: AgentTeamMessage;
|
|
186
|
+
readonly task?: AgentTeamTask;
|
|
187
|
+
readonly thread: AgentTeamThread;
|
|
188
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/** Durable Human promotion of a taskless Thread into a real Task, announced by a structured Task activity. */
|
|
192
|
+
export interface AgentTeamThreadPromotedOperation extends AgentTeamOperationBase {
|
|
193
|
+
readonly kind: 'team/thread-promoted';
|
|
194
|
+
readonly data: {
|
|
195
|
+
readonly workspaceId: WorkspaceId;
|
|
196
|
+
readonly baseRevision: number;
|
|
197
|
+
readonly activity: AgentTeamTaskActivity;
|
|
198
|
+
readonly task: AgentTeamTask;
|
|
199
|
+
readonly thread: AgentTeamThread;
|
|
200
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export interface AgentTeamClaimOperationData {
|
|
204
|
+
readonly workspaceId: WorkspaceId;
|
|
205
|
+
readonly baseRevision: number;
|
|
206
|
+
readonly activity: AgentTeamClaimActivity;
|
|
207
|
+
readonly claim: AgentTeamClaim;
|
|
208
|
+
readonly task: AgentTeamTask;
|
|
209
|
+
readonly thread: AgentTeamThread;
|
|
210
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
211
|
+
}
|
|
212
|
+
export interface AgentTeamClaimCreatedOperation extends AgentTeamOperationBase {
|
|
213
|
+
readonly kind: 'team/claim-created';
|
|
214
|
+
readonly data: AgentTeamClaimOperationData;
|
|
215
|
+
}
|
|
216
|
+
export interface AgentTeamClaimDoneOperation extends AgentTeamOperationBase {
|
|
217
|
+
readonly kind: 'team/claim-done';
|
|
218
|
+
readonly data: AgentTeamClaimOperationData;
|
|
219
|
+
}
|
|
220
|
+
export interface AgentTeamClaimReleasedOperation extends AgentTeamOperationBase {
|
|
221
|
+
readonly kind: 'team/claim-released';
|
|
222
|
+
readonly data: AgentTeamClaimOperationData;
|
|
223
|
+
}
|
|
224
|
+
export type AgentTeamClaimChangedOperation = AgentTeamClaimCreatedOperation | AgentTeamClaimDoneOperation | AgentTeamClaimReleasedOperation;
|
|
225
|
+
/** Durable Human Task-resolution change. */
|
|
226
|
+
export interface AgentTeamTaskChangedOperation extends AgentTeamOperationBase {
|
|
227
|
+
readonly kind: 'team/task-changed';
|
|
228
|
+
readonly data: {
|
|
229
|
+
readonly workspaceId: WorkspaceId;
|
|
230
|
+
readonly baseRevision: number;
|
|
231
|
+
readonly activity: AgentTeamTaskActivity;
|
|
232
|
+
readonly task: AgentTeamTask;
|
|
233
|
+
readonly thread: AgentTeamThread;
|
|
234
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
235
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** Durable personal Attention follow or unfollow; it does not revise the Thread. */
|
|
239
|
+
export interface AgentTeamThreadAttentionChangedOperation extends AgentTeamOperationBase {
|
|
240
|
+
readonly kind: 'team/thread-attention-changed';
|
|
241
|
+
readonly data: {
|
|
242
|
+
readonly workspaceId: WorkspaceId;
|
|
243
|
+
readonly action: 'follow' | 'unfollow';
|
|
244
|
+
readonly memberId: AgentTeamMemberId;
|
|
245
|
+
readonly task?: AgentTeamTask;
|
|
246
|
+
readonly thread: AgentTeamThread;
|
|
247
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/** Durable one-batch read and direct-marker consumption. It does not revise the Thread. */
|
|
251
|
+
export interface AgentTeamThreadReadOperation extends AgentTeamOperationBase {
|
|
252
|
+
readonly kind: 'team/thread-read';
|
|
253
|
+
readonly data: {
|
|
254
|
+
readonly workspaceId: WorkspaceId;
|
|
255
|
+
readonly memberId: AgentTeamMemberId;
|
|
256
|
+
/** Current public state captured for a stable idempotent read response. */
|
|
257
|
+
readonly task?: AgentTeamTask;
|
|
258
|
+
readonly thread: AgentTeamThread;
|
|
259
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
260
|
+
readonly anchor: AgentTeamStoredMessage;
|
|
261
|
+
/** Structured Member refs of the anchor Message, from its originating send operation. */
|
|
262
|
+
readonly anchorMentions: readonly AgentTeamMemberId[];
|
|
263
|
+
readonly facts: readonly AgentTeamStoredThreadReadFact[];
|
|
264
|
+
readonly readThroughSequence: number;
|
|
265
|
+
/** Number of unread facts left after this bounded read. */
|
|
266
|
+
readonly remainingUnreadCount: number;
|
|
267
|
+
/** The reader's post-read Attention snapshot, when the reader follows. */
|
|
268
|
+
readonly attention?: AgentTeamThreadAttention | undefined;
|
|
269
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/** Durable irreversible Member removal and global inbox cleanup. */
|
|
273
|
+
export interface AgentTeamMemberRemovedOperation extends AgentTeamOperationBase {
|
|
274
|
+
readonly kind: 'team/member-removed';
|
|
275
|
+
readonly data: {
|
|
276
|
+
readonly member: AgentTeamAgentMember;
|
|
277
|
+
/** Claims released because this Member became inactive. */
|
|
278
|
+
readonly claims: readonly AgentTeamClaim[];
|
|
279
|
+
/** Public release summaries for the affected Threads. */
|
|
280
|
+
readonly activities: readonly AgentTeamClaimsReleasedActivity[];
|
|
281
|
+
readonly tasks: readonly AgentTeamTask[];
|
|
282
|
+
readonly threads: readonly AgentTeamThread[];
|
|
283
|
+
readonly inbox: AgentTeamInboxDelta;
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Durable audit record of one Member-to-Member direct message. A DM is pure
|
|
288
|
+
* delivery: it creates no Channel/Thread/revision, no Inbox attention, and no
|
|
289
|
+
* markers. The ledger records it for audit, idempotent retries, and post-
|
|
290
|
+
* compaction traceability; the wake itself is a transient runtime effect.
|
|
291
|
+
*/
|
|
292
|
+
export interface AgentTeamDmSentOperation extends AgentTeamOperationBase {
|
|
293
|
+
readonly kind: 'team/dm-sent';
|
|
294
|
+
readonly data: {
|
|
295
|
+
readonly workspaceId: WorkspaceId;
|
|
296
|
+
readonly senderMemberId: AgentTeamMemberId;
|
|
297
|
+
readonly recipientMemberId: AgentTeamMemberId;
|
|
298
|
+
readonly body: string;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/** Closed union of durable Agent Team operations. */
|
|
302
|
+
export type AgentTeamOperation = AgentTeamInitializedOperation | AgentTeamChannelCreatedOperation | AgentTeamMemberAddedOperation | AgentTeamMemberSuspendedOperation | AgentTeamMemberResumedOperation | AgentTeamMemberArchivedOperation | AgentTeamMemberSessionRestartedOperation | AgentTeamMemberContextClearedOperation | AgentTeamMemberSessionRenewedOperation | AgentTeamChannelUpdatedOperation | AgentTeamMemberUpdatedOperation | AgentTeamChannelMemberAddedOperation | AgentTeamChannelMemberRemovedOperation | AgentTeamChannelArchivedOperation | AgentTeamMessageSentOperation | AgentTeamThreadRepliedOperation | AgentTeamThreadPromotedOperation | AgentTeamClaimCreatedOperation | AgentTeamClaimDoneOperation | AgentTeamClaimReleasedOperation | AgentTeamTaskChangedOperation | AgentTeamThreadAttentionChangedOperation | AgentTeamThreadReadOperation | AgentTeamMemberRemovedOperation | AgentTeamDmSentOperation;
|
|
303
|
+
//# sourceMappingURL=operations.d.ts.map
|