@pingagent/sdk 0.1.13 → 0.1.14

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/dist/index.d.ts CHANGED
@@ -265,6 +265,107 @@ declare class TaskHandoffManager {
265
265
  listBySession(sessionKey: string, limit?: number): TaskHandoff[];
266
266
  }
267
267
 
268
+ type CollaborationProjectionOutboxStatus = 'pending' | 'sent' | 'failed';
269
+ type CollaborationProjectionKind = 'approval_resolution' | 'decision_prompt' | 'runtime_update' | 'collaboration_update';
270
+ interface CollaborationProjectionOutboxEntry {
271
+ id: number;
272
+ created_at: number;
273
+ session_key?: string;
274
+ conversation_id?: string;
275
+ target_human_session?: string;
276
+ projection_kind: CollaborationProjectionKind;
277
+ summary: string;
278
+ body: Record<string, unknown>;
279
+ status: CollaborationProjectionOutboxStatus;
280
+ attempt_count: number;
281
+ last_error?: string;
282
+ delivered_at?: number;
283
+ source_event_id?: number;
284
+ }
285
+ interface CollaborationProjectionOutboxInput {
286
+ created_at?: number;
287
+ session_key?: string;
288
+ conversation_id?: string;
289
+ target_human_session?: string;
290
+ projection_kind: CollaborationProjectionKind;
291
+ summary: string;
292
+ body: Record<string, unknown>;
293
+ source_event_id?: number;
294
+ }
295
+ declare class CollaborationProjectionOutboxManager {
296
+ private store;
297
+ constructor(store: LocalStore);
298
+ enqueue(input: CollaborationProjectionOutboxInput): CollaborationProjectionOutboxEntry;
299
+ get(id: number): CollaborationProjectionOutboxEntry | null;
300
+ listRecent(limit?: number): CollaborationProjectionOutboxEntry[];
301
+ listPending(limit?: number): CollaborationProjectionOutboxEntry[];
302
+ listDispatchable(limit?: number): CollaborationProjectionOutboxEntry[];
303
+ listBySession(sessionKey: string, limit?: number): CollaborationProjectionOutboxEntry[];
304
+ listByStatus(status: CollaborationProjectionOutboxStatus, limit?: number): CollaborationProjectionOutboxEntry[];
305
+ markSent(id: number, deliveredAt?: number): CollaborationProjectionOutboxEntry | null;
306
+ markFailed(id: number, error: string): CollaborationProjectionOutboxEntry | null;
307
+ }
308
+
309
+ type CollaborationEventType = 'external_message_received' | 'agent_progress' | 'agent_conclusion' | 'handoff_started' | 'handoff_completed' | 'risk_detected' | 'decision_required' | 'task_completed' | 'runtime_degraded' | 'runtime_repaired';
310
+ type CollaborationEventSeverity = 'info' | 'notice' | 'warning' | 'critical';
311
+ type CollaborationApprovalStatus = 'not_required' | 'pending' | 'approved' | 'rejected';
312
+ interface CollaborationEvent {
313
+ id: number;
314
+ ts_ms: number;
315
+ event_type: CollaborationEventType;
316
+ severity: CollaborationEventSeverity;
317
+ session_key?: string;
318
+ conversation_id?: string;
319
+ target_human_session?: string;
320
+ summary: string;
321
+ approval_required: boolean;
322
+ approval_status: CollaborationApprovalStatus;
323
+ detail?: Record<string, unknown>;
324
+ }
325
+ interface CollaborationEventInput {
326
+ ts_ms?: number;
327
+ event_type: CollaborationEventType;
328
+ severity?: CollaborationEventSeverity;
329
+ session_key?: string;
330
+ conversation_id?: string;
331
+ target_human_session?: string;
332
+ summary: string;
333
+ approval_required?: boolean;
334
+ approval_status?: CollaborationApprovalStatus;
335
+ detail?: Record<string, unknown>;
336
+ }
337
+ interface CollaborationEventSummary {
338
+ total_events: number;
339
+ latest_ts_ms?: number;
340
+ by_type: Record<string, number>;
341
+ by_severity: Record<string, number>;
342
+ pending_approvals: number;
343
+ }
344
+ interface ResolveCollaborationApprovalInput {
345
+ resolved_by?: string;
346
+ note?: string;
347
+ ts_ms?: number;
348
+ }
349
+ interface ResolveCollaborationApprovalResult {
350
+ updated: CollaborationEvent;
351
+ resolution_event: CollaborationEvent;
352
+ projection_outbox: CollaborationProjectionOutboxEntry | null;
353
+ }
354
+ declare class CollaborationEventManager {
355
+ private store;
356
+ constructor(store: LocalStore);
357
+ record(input: CollaborationEventInput): CollaborationEvent;
358
+ listRecent(limit?: number): CollaborationEvent[];
359
+ listBySession(sessionKey: string, limit?: number): CollaborationEvent[];
360
+ listByConversation(conversationId: string, limit?: number): CollaborationEvent[];
361
+ listByTargetHumanSession(targetHumanSession: string, limit?: number): CollaborationEvent[];
362
+ get(id: number): CollaborationEvent | null;
363
+ listPending(limit?: number): CollaborationEvent[];
364
+ listPendingBySession(sessionKey: string, limit?: number): CollaborationEvent[];
365
+ resolveApproval(id: number, approvalStatus: Extract<CollaborationApprovalStatus, 'approved' | 'rejected'>, input?: ResolveCollaborationApprovalInput): ResolveCollaborationApprovalResult | null;
366
+ summarize(limit?: number): CollaborationEventSummary;
367
+ }
368
+
268
369
  type CapabilityContactMode = 'dm' | 'task' | 'either';
269
370
  interface CapabilityCardItem {
270
371
  id: string;
@@ -545,6 +646,7 @@ declare class PingAgentClient {
545
646
  private sessionSummaryManager?;
546
647
  private taskThreadManager?;
547
648
  private taskHandoffManager?;
649
+ private collaborationEventManager?;
548
650
  private agentCardCache;
549
651
  constructor(opts: ClientOptions);
550
652
  getContactManager(): ContactManager | undefined;
@@ -553,6 +655,7 @@ declare class PingAgentClient {
553
655
  getSessionSummaryManager(): SessionSummaryManager | undefined;
554
656
  getTaskThreadManager(): TaskThreadManager | undefined;
555
657
  getTaskHandoffManager(): TaskHandoffManager | undefined;
658
+ getCollaborationEventManager(): CollaborationEventManager | undefined;
556
659
  /** Update the in-memory access token (e.g. after proactive refresh from disk). */
557
660
  setAccessToken(token: string): void;
558
661
  register(developerToken?: string): Promise<ApiResponse>;
@@ -832,6 +935,7 @@ declare class HttpTransport {
832
935
  type ContactPolicyAction = 'approve' | 'manual' | 'reject';
833
936
  type TaskPolicyAction = 'bridge' | 'execute' | 'deny';
834
937
  type RuntimeMode = 'bridge' | 'executor';
938
+ type CollaborationProjectionPreset = 'quiet' | 'balanced' | 'strict';
835
939
  interface TrustPolicyRule<A extends string> {
836
940
  match: string;
837
941
  action: A;
@@ -848,6 +952,9 @@ interface TrustPolicyDoc {
848
952
  default_action: TaskPolicyAction;
849
953
  rules: Array<TrustPolicyRule<TaskPolicyAction>>;
850
954
  };
955
+ collaboration_projection: {
956
+ preset: CollaborationProjectionPreset;
957
+ };
851
958
  }
852
959
  interface TrustPolicyContext {
853
960
  sender_did?: string;
@@ -1256,4 +1363,4 @@ interface OpenClawIngressRuntimeStatus {
1256
1363
  declare function getIngressRuntimeStatusFilePath(): string;
1257
1364
  declare function readIngressRuntimeStatus(filePath?: string): OpenClawIngressRuntimeStatus | null;
1258
1365
 
1259
- export { A2AAdapter, type A2AAdapterOptions, type A2ATaskResult, type AgentEncryptionCard, type AgentProfile, type CapabilityCard, type CapabilityCardItem, type CapabilityContactMode, type ClientOptions, type Contact, type ContactCardShare, ContactManager, type ContactPolicyAction, type ContactPolicyDecision, type ConversationEntry, type ConversationListResponse, type DirectoryBrowseResponse, type DirectorySelfResponse, type EncryptedPayloadWrapper, type EncryptionIdentityFields, type EncryptionPrivateKeyJwk, type EncryptionPublicKeyJwk, type FeedByDidResponse, type FeedPost, type FeedPublicResponse, type FetchResponse, HistoryManager, HttpTransport, LocalStore, type OpenClawIngressRuntimeStatus, PingAgentClient, type PublicAgentProfile, type PublicLinkState, type RecommendationSummary, type ReplyTarget, type RuntimeMode, SESSION_SUMMARY_FIELDS, type SendResponse, type SessionBindingAlert, type SessionBindingEntry, SessionManager, type SessionMessageInput, type SessionState, type SessionSummary, type SessionSummaryFieldKey, SessionSummaryManager, type SessionSummaryUpsert, type StoredMessage, type StoredTrustRecommendation, type SubscriptionResponse, type SubscriptionUsage, type SyncTrustRecommendationsInput, type TaskHandoff, TaskHandoffManager, type TaskHandoffPayload, type TaskHandoffUpsert, type TaskPolicyAction, type TaskPolicyDecision, type TaskResult, type TaskShareEntry, type TaskThread, TaskThreadManager, type TaskThreadStatus, type TaskThreadUpsert, type TransportOptions, type TrustPolicyAuditEvent, type TrustPolicyAuditEventType, type TrustPolicyAuditInput, TrustPolicyAuditManager, type TrustPolicyAuditSummary, type TrustPolicyContext, type TrustPolicyDoc, type TrustPolicyLearningSummary, type TrustPolicyRecommendation, TrustRecommendationManager, type TrustRecommendationStatus, type TrustState, type UpdateProfileInput, type UserWakeEvent, UserWakeSubscription, type UserWakeSubscriptionOptions, WsSubscription, type WsSubscriptionOptions, buildSessionKey, buildSessionSummaryHandoffText, buildTrustPolicyRecommendations, capabilityCardToLegacyCapabilities, clearSessionBindingAlert, decideContactPolicy, decideTaskPolicy, decryptPayloadForIdentity, defaultTrustPolicyDoc, encryptPayloadForRecipients, ensureIdentityEncryptionKeys, ensureTokenValid, formatCapabilityCardSummary, generateIdentity, getActiveSessionFilePath, getIdentityPath, getIngressRuntimeStatusFilePath, getProfile, getRootDir, getSessionBindingAlertsFilePath, getSessionMapFilePath, getStorePath, getTrustRecommendationActionLabel, identityExists, isEncryptedPayload, loadIdentity, matchesTrustPolicyRule, normalizeCapabilityCard, normalizeTrustPolicyDoc, previewFromPayload, readCurrentActiveSessionKey, readIngressRuntimeStatus, readSessionBindingAlerts, readSessionBindings, removeSessionBinding, saveIdentity, setSessionBinding, shouldEncryptConversationPayload, summarizeTrustPolicyAudit, updateStoredToken, upsertSessionBindingAlert, upsertTrustPolicyRecommendation, writeSessionBindingAlerts, writeSessionBindings };
1366
+ export { A2AAdapter, type A2AAdapterOptions, type A2ATaskResult, type AgentEncryptionCard, type AgentProfile, type CapabilityCard, type CapabilityCardItem, type CapabilityContactMode, type ClientOptions, type CollaborationApprovalStatus, type CollaborationEvent, type CollaborationEventInput, CollaborationEventManager, type CollaborationEventSeverity, type CollaborationEventSummary, type CollaborationEventType, type CollaborationProjectionKind, type CollaborationProjectionOutboxEntry, type CollaborationProjectionOutboxInput, CollaborationProjectionOutboxManager, type CollaborationProjectionOutboxStatus, type CollaborationProjectionPreset, type Contact, type ContactCardShare, ContactManager, type ContactPolicyAction, type ContactPolicyDecision, type ConversationEntry, type ConversationListResponse, type DirectoryBrowseResponse, type DirectorySelfResponse, type EncryptedPayloadWrapper, type EncryptionIdentityFields, type EncryptionPrivateKeyJwk, type EncryptionPublicKeyJwk, type FeedByDidResponse, type FeedPost, type FeedPublicResponse, type FetchResponse, HistoryManager, HttpTransport, LocalStore, type OpenClawIngressRuntimeStatus, PingAgentClient, type PublicAgentProfile, type PublicLinkState, type RecommendationSummary, type ReplyTarget, type ResolveCollaborationApprovalInput, type ResolveCollaborationApprovalResult, type RuntimeMode, SESSION_SUMMARY_FIELDS, type SendResponse, type SessionBindingAlert, type SessionBindingEntry, SessionManager, type SessionMessageInput, type SessionState, type SessionSummary, type SessionSummaryFieldKey, SessionSummaryManager, type SessionSummaryUpsert, type StoredMessage, type StoredTrustRecommendation, type SubscriptionResponse, type SubscriptionUsage, type SyncTrustRecommendationsInput, type TaskHandoff, TaskHandoffManager, type TaskHandoffPayload, type TaskHandoffUpsert, type TaskPolicyAction, type TaskPolicyDecision, type TaskResult, type TaskShareEntry, type TaskThread, TaskThreadManager, type TaskThreadStatus, type TaskThreadUpsert, type TransportOptions, type TrustPolicyAuditEvent, type TrustPolicyAuditEventType, type TrustPolicyAuditInput, TrustPolicyAuditManager, type TrustPolicyAuditSummary, type TrustPolicyContext, type TrustPolicyDoc, type TrustPolicyLearningSummary, type TrustPolicyRecommendation, TrustRecommendationManager, type TrustRecommendationStatus, type TrustState, type UpdateProfileInput, type UserWakeEvent, UserWakeSubscription, type UserWakeSubscriptionOptions, WsSubscription, type WsSubscriptionOptions, buildSessionKey, buildSessionSummaryHandoffText, buildTrustPolicyRecommendations, capabilityCardToLegacyCapabilities, clearSessionBindingAlert, decideContactPolicy, decideTaskPolicy, decryptPayloadForIdentity, defaultTrustPolicyDoc, encryptPayloadForRecipients, ensureIdentityEncryptionKeys, ensureTokenValid, formatCapabilityCardSummary, generateIdentity, getActiveSessionFilePath, getIdentityPath, getIngressRuntimeStatusFilePath, getProfile, getRootDir, getSessionBindingAlertsFilePath, getSessionMapFilePath, getStorePath, getTrustRecommendationActionLabel, identityExists, isEncryptedPayload, loadIdentity, matchesTrustPolicyRule, normalizeCapabilityCard, normalizeTrustPolicyDoc, previewFromPayload, readCurrentActiveSessionKey, readIngressRuntimeStatus, readSessionBindingAlerts, readSessionBindings, removeSessionBinding, saveIdentity, setSessionBinding, shouldEncryptConversationPayload, summarizeTrustPolicyAudit, updateStoredToken, upsertSessionBindingAlert, upsertTrustPolicyRecommendation, writeSessionBindingAlerts, writeSessionBindings };
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  A2AAdapter,
3
+ CollaborationEventManager,
4
+ CollaborationProjectionOutboxManager,
3
5
  ContactManager,
4
6
  HistoryManager,
5
7
  HttpTransport,
@@ -58,9 +60,11 @@ import {
58
60
  upsertTrustPolicyRecommendation,
59
61
  writeSessionBindingAlerts,
60
62
  writeSessionBindings
61
- } from "./chunk-N2GCIMAW.js";
63
+ } from "./chunk-MFKDD5X3.js";
62
64
  export {
63
65
  A2AAdapter,
66
+ CollaborationEventManager,
67
+ CollaborationProjectionOutboxManager,
64
68
  ContactManager,
65
69
  HistoryManager,
66
70
  HttpTransport,