@borgee/agents-host 0.2.26 → 0.2.28

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.
@@ -11,6 +11,7 @@ export declare function resolveAgentCursorPath(stateRootDir: string, agentId: st
11
11
  export declare function resolveSharedProtocolKickoffDecisionPath(stateRootDir: string, channelId: string, anchorMessageId: string): string;
12
12
  export declare function resolveSharedProtocolStatusPath(stateRootDir: string, channelId: string, anchorMessageId: string): string;
13
13
  export declare function resolveConnectionsStatePath(stateRootDir: string): string;
14
+ export declare function resolveAttentionStatePath(stateRootDir: string, channelId: string): string;
14
15
  export declare function resolveAuthorizationAuditPath(stateRootDir: string): string;
15
16
  export declare function resolvePreviousAuthorizationAuditPath(stateRootDir: string): string;
16
17
  export declare function resolveClaudeSessionMapPath(stateRootDir: string, agentId: string): string;
@@ -110,6 +110,9 @@ export function resolveSharedProtocolStatusPath(stateRootDir, channelId, anchorM
110
110
  export function resolveConnectionsStatePath(stateRootDir) {
111
111
  return join(stateRootDir, 'connections-state.sqlite');
112
112
  }
113
+ export function resolveAttentionStatePath(stateRootDir, channelId) {
114
+ return join(stateRootDir, 'attention-state', `${encodeSegment(channelId)}.json`);
115
+ }
113
116
  export function resolveAuthorizationAuditPath(stateRootDir) {
114
117
  return join(stateRootDir, 'authorization-audit.jsonl');
115
118
  }
package/dist/types.d.ts CHANGED
@@ -140,6 +140,83 @@ export interface CollaborationDraftSnapshot {
140
140
  finalMessageId?: string;
141
141
  }
142
142
  export type ProviderCollaborationTurnMode = 'ordinary' | 'silent-kickoff' | 'protocol-managed';
143
+ export type CollaborationOutcomeResponseState = 'responded' | 'blocked' | 'superseded' | 'failed';
144
+ export type CollaborationOutcomeDeliveryState = 'posted' | 'draft-finalized' | 'not-delivered' | 'delivery-failed';
145
+ export type CollaborationOutcomeWakeState = 'waiting' | 'suppressed-agent' | 'resumed-human';
146
+ export interface CollaborationOutcomeBlockedDetails {
147
+ question: string;
148
+ reason?: string;
149
+ }
150
+ /**
151
+ * Shared host-side projection only. This is the latest host-observed snapshot
152
+ * that adapters may surface back to providers; it is not provider-authoritative
153
+ * truth about collaboration state or recovery.
154
+ */
155
+ export interface CollaborationOutcomeSnapshot {
156
+ source: 'host-observed';
157
+ responseState: CollaborationOutcomeResponseState;
158
+ deliveryState: CollaborationOutcomeDeliveryState;
159
+ wakeState?: CollaborationOutcomeWakeState;
160
+ blockedDetails?: CollaborationOutcomeBlockedDetails;
161
+ observedAt: number;
162
+ turnExecutionId?: string;
163
+ }
164
+ export type AttentionDeliveryMode = 'default' | 'follow' | 'muted';
165
+ export type AttentionClaimState = 'unclaimed' | 'claimed';
166
+ export type AttentionClaimActivation = 'inactive' | 'active' | 'dormant';
167
+ export type AttentionWakeMode = 'current-policy' | 'follow-visible-human' | 'mute-non-mention';
168
+ export type ProviderAttentionUpdate = 'follow-channel' | 'unfollow-channel' | 'mute-channel' | 'claim-channel' | 'claim-task-thread' | 'unclaim-channel' | 'unclaim-task-thread';
169
+ export interface AttentionClaimContext {
170
+ scope: 'channel' | 'task-thread';
171
+ taskId: string;
172
+ }
173
+ /**
174
+ * Shared host-side projection only. This is the latest host-observed snapshot
175
+ * that adapters may surface back to providers; it is not server-authoritative
176
+ * truth about delivery policy, fanout, or ownership.
177
+ */
178
+ export interface AttentionSnapshot {
179
+ source: 'host-observed';
180
+ deliveryMode: AttentionDeliveryMode;
181
+ claimState: AttentionClaimState;
182
+ claimActivation: AttentionClaimActivation;
183
+ wakeMode: AttentionWakeMode;
184
+ observedAt: number;
185
+ turnExecutionId?: string;
186
+ claimContext?: AttentionClaimContext;
187
+ }
188
+ export type TaskThreadCollaborationTurnRole = 'assignment' | 'continuation';
189
+ export type TaskThreadMainResultContract = 'ordinary-final-reply-in-thread';
190
+ export type TaskThreadAuxiliaryRouteContract = 'optional-auxiliary-send-or-escalation-only';
191
+ export type TaskThreadCheckInContract = 'status-update-intent-only';
192
+ export type TaskThreadBlockedWorkContract = 'in-thread-disclosure-only';
193
+ /**
194
+ * Shared host-side projection only. This is a narrow adapter-facing summary of
195
+ * task-thread collaboration meaning; it is not runtime-authoritative truth
196
+ * about task ownership, task routes, heartbeat execution, or blocked state.
197
+ */
198
+ export interface TaskThreadCollaborationContract {
199
+ source: 'host-projected';
200
+ turnRole: TaskThreadCollaborationTurnRole;
201
+ taskThreadContextActive: true;
202
+ mainResult: TaskThreadMainResultContract;
203
+ auxiliaryRoute: TaskThreadAuxiliaryRouteContract;
204
+ checkIn: TaskThreadCheckInContract;
205
+ blockedWork: TaskThreadBlockedWorkContract;
206
+ }
207
+ export interface CollaborationCapabilityDeclaration {
208
+ collaborationOutcome?: true;
209
+ attentionSnapshot?: true;
210
+ taskThreadCollaborationContract?: true;
211
+ missedCollaborationDiagnostic?: true;
212
+ recoveryExplanation?: 'runtime-local-only';
213
+ }
214
+ export type MissedCollaborationDiagnosticStage = 'delivery' | 'wake' | 'response';
215
+ export type MissedCollaborationDiagnosticReason = 'delivery-failed' | 'not-delivered' | 'wake-suppressed-attention-policy' | 'blocked-awaiting-user';
216
+ export interface MissedCollaborationDiagnostic {
217
+ stage: MissedCollaborationDiagnosticStage;
218
+ reason: MissedCollaborationDiagnosticReason;
219
+ }
143
220
  export interface ProviderCollaborationContext {
144
221
  enabled: boolean;
145
222
  turnExecutionId?: string;
@@ -158,6 +235,11 @@ export interface ProviderInput {
158
235
  incomingEventKind?: string;
159
236
  incomingMessageType?: string;
160
237
  collaboration?: ProviderCollaborationContext;
238
+ collaborationOutcome?: CollaborationOutcomeSnapshot;
239
+ attentionSnapshot?: AttentionSnapshot;
240
+ taskThreadCollaborationContract?: TaskThreadCollaborationContract;
241
+ collaborationCapabilities?: CollaborationCapabilityDeclaration;
242
+ missedCollaborationDiagnostic?: MissedCollaborationDiagnostic;
161
243
  }
162
244
  export interface ProviderProtocolContext {
163
245
  anchorMessageId: string;
@@ -210,6 +292,11 @@ export interface PreparedPromptContext {
210
292
  gatewayAuthPath?: string;
211
293
  collaborationTurnExecutionId?: string;
212
294
  collaborationTurnMode?: ProviderCollaborationTurnMode;
295
+ collaborationOutcome?: CollaborationOutcomeSnapshot;
296
+ attentionSnapshot?: AttentionSnapshot;
297
+ taskThreadCollaborationContract?: TaskThreadCollaborationContract;
298
+ collaborationCapabilities?: CollaborationCapabilityDeclaration;
299
+ missedCollaborationDiagnostic?: MissedCollaborationDiagnostic;
213
300
  kickoff?: ProviderProtocolKickoffContext;
214
301
  protocol?: ProviderProtocolContext;
215
302
  grounding?: ProviderTurnGroundingContext;
@@ -234,16 +321,22 @@ export interface ProviderAwaitingUser {
234
321
  question: string;
235
322
  reason?: string;
236
323
  }
237
- export type ProviderTurnControl = {
324
+ export interface ProviderTurnControlBase {
325
+ attentionUpdate?: ProviderAttentionUpdate;
326
+ }
327
+ export type ProviderTurnControl = ({
238
328
  kind: 'continue-to-peer';
239
- } | {
329
+ } & ProviderTurnControlBase) | ({
240
330
  kind: 'conclude-locally';
241
- } | {
331
+ } & ProviderTurnControlBase) | {
242
332
  kind: 'start-protocol';
243
333
  rounds: number;
244
334
  } | ({
245
335
  kind: 'awaiting-user';
246
- } & ProviderAwaitingUser);
336
+ } & ProviderAwaitingUser & ProviderTurnControlBase) | ({
337
+ kind: 'attention-only';
338
+ attentionUpdate: ProviderAttentionUpdate;
339
+ } & ProviderTurnControlBase);
247
340
  export interface ProviderReply {
248
341
  text: string;
249
342
  awaitingUser?: ProviderAwaitingUser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borgee/agents-host",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"