@pingagent/sdk 0.1.11 → 0.1.13
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/bin/pingagent.js +179 -32
- package/dist/chunk-N2GCIMAW.js +3800 -0
- package/dist/index.d.ts +53 -1
- package/dist/index.js +3 -1
- package/dist/web-server.js +324 -45
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1085,6 +1085,7 @@ interface WsSubscriptionOptions {
|
|
|
1085
1085
|
getAccessToken: () => string | Promise<string>;
|
|
1086
1086
|
myDid: string;
|
|
1087
1087
|
listConversations: () => Promise<ConversationEntry[]>;
|
|
1088
|
+
listIntervalMs?: number;
|
|
1088
1089
|
onMessage: (envelope: any, conversationId: string) => void | Promise<void>;
|
|
1089
1090
|
onControl?: (control: WsControlPayload, conversationId: string) => void;
|
|
1090
1091
|
onError?: (err: Error) => void;
|
|
@@ -1137,6 +1138,7 @@ declare class WsSubscription {
|
|
|
1137
1138
|
constructor(opts: WsSubscriptionOptions);
|
|
1138
1139
|
start(): void;
|
|
1139
1140
|
stop(): void;
|
|
1141
|
+
syncNow(): Promise<void>;
|
|
1140
1142
|
/**
|
|
1141
1143
|
* Stop a single conversation's WebSocket and do not reconnect.
|
|
1142
1144
|
* Used when the conversation is revoked or the client no longer wants to subscribe.
|
|
@@ -1151,6 +1153,56 @@ declare class WsSubscription {
|
|
|
1151
1153
|
private syncConnections;
|
|
1152
1154
|
}
|
|
1153
1155
|
|
|
1156
|
+
interface UserWakeEvent {
|
|
1157
|
+
type: 'wake';
|
|
1158
|
+
reason: 'message' | 'control';
|
|
1159
|
+
conversation_id: string;
|
|
1160
|
+
seq?: number;
|
|
1161
|
+
action?: string;
|
|
1162
|
+
task_id?: string;
|
|
1163
|
+
ts_ms: number;
|
|
1164
|
+
}
|
|
1165
|
+
interface UserWakeSubscriptionOptions {
|
|
1166
|
+
serverUrl: string;
|
|
1167
|
+
getAccessToken: () => string | Promise<string>;
|
|
1168
|
+
onWake: (event: UserWakeEvent) => void | Promise<void>;
|
|
1169
|
+
onOpen?: () => void;
|
|
1170
|
+
onError?: (err: Error) => void;
|
|
1171
|
+
onDebug?: (info: {
|
|
1172
|
+
event: string;
|
|
1173
|
+
detail?: Record<string, unknown>;
|
|
1174
|
+
}) => void;
|
|
1175
|
+
heartbeat?: {
|
|
1176
|
+
enable?: boolean;
|
|
1177
|
+
idleThresholdMs?: number;
|
|
1178
|
+
pingIntervalMs?: number;
|
|
1179
|
+
pongTimeoutMs?: number;
|
|
1180
|
+
maxMissedPongs?: number;
|
|
1181
|
+
tickMs?: number;
|
|
1182
|
+
jitter?: number;
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
declare class UserWakeSubscription {
|
|
1186
|
+
private readonly opts;
|
|
1187
|
+
private ws;
|
|
1188
|
+
private reconnectTimer;
|
|
1189
|
+
private reconnectAttempt;
|
|
1190
|
+
private heartbeatTimer;
|
|
1191
|
+
private stopped;
|
|
1192
|
+
private lastRxAt;
|
|
1193
|
+
private lastPingAt;
|
|
1194
|
+
private nextPingAt;
|
|
1195
|
+
private missedPongs;
|
|
1196
|
+
private pongTimeout;
|
|
1197
|
+
constructor(opts: UserWakeSubscriptionOptions);
|
|
1198
|
+
start(): void;
|
|
1199
|
+
stop(): void;
|
|
1200
|
+
private wakeUrl;
|
|
1201
|
+
private connectAsync;
|
|
1202
|
+
private scheduleReconnect;
|
|
1203
|
+
private heartbeatTick;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1154
1206
|
declare function getActiveSessionFilePath(): string;
|
|
1155
1207
|
declare function getSessionMapFilePath(): string;
|
|
1156
1208
|
declare function getSessionBindingAlertsFilePath(): string;
|
|
@@ -1204,4 +1256,4 @@ interface OpenClawIngressRuntimeStatus {
|
|
|
1204
1256
|
declare function getIngressRuntimeStatusFilePath(): string;
|
|
1205
1257
|
declare function readIngressRuntimeStatus(filePath?: string): OpenClawIngressRuntimeStatus | null;
|
|
1206
1258
|
|
|
1207
|
-
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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
TaskThreadManager,
|
|
13
13
|
TrustPolicyAuditManager,
|
|
14
14
|
TrustRecommendationManager,
|
|
15
|
+
UserWakeSubscription,
|
|
15
16
|
WsSubscription,
|
|
16
17
|
buildSessionKey,
|
|
17
18
|
buildSessionSummaryHandoffText,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
upsertTrustPolicyRecommendation,
|
|
58
59
|
writeSessionBindingAlerts,
|
|
59
60
|
writeSessionBindings
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-N2GCIMAW.js";
|
|
61
62
|
export {
|
|
62
63
|
A2AAdapter,
|
|
63
64
|
ContactManager,
|
|
@@ -72,6 +73,7 @@ export {
|
|
|
72
73
|
TaskThreadManager,
|
|
73
74
|
TrustPolicyAuditManager,
|
|
74
75
|
TrustRecommendationManager,
|
|
76
|
+
UserWakeSubscription,
|
|
75
77
|
WsSubscription,
|
|
76
78
|
buildSessionKey,
|
|
77
79
|
buildSessionSummaryHandoffText,
|