@native-engagement/sdk 0.9.0 → 0.10.0

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
@@ -1,5 +1,18 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ declare const installationModuleIds: readonly [
4
+ "android.wechat",
5
+ "android.whatsapp",
6
+ "bridge.wechat",
7
+ "bridge.mail",
8
+ "bridge.browser",
9
+ "api.youtube",
10
+ "api.tiktok",
11
+ "browser.xiaohongshu",
12
+ "browser.douyin",
13
+ "browser.tiktok"
14
+ ];
15
+ export type InstallationModuleId = typeof installationModuleIds[number];
3
16
  export type ContractRisk = "READ_ONLY" | "DOMAIN_WRITE" | "REVIEW_REQUIRED" | "EXTERNAL_ACTION" | "ADMINISTRATION";
4
17
  export type ContractKind = "SCHEMA" | "QUERY" | "COMMAND" | "SEARCH" | "ENQUIRY" | "EVENT" | "CAPABILITY";
5
18
  export type ContractAvailability = "AVAILABLE" | "PLANNED";
@@ -64,6 +77,145 @@ export interface McpToolDefinition {
64
77
  readonly annotations?: unknown;
65
78
  readonly _meta?: unknown;
66
79
  }
80
+ export type InteractionMailProvider = "ALIMAIL" | "TENCENT_EXMAIL" | "GMAIL" | "ICLOUD" | "ZOHO" | "MICROSOFT" | "CUSTOM";
81
+ export interface InteractionMailEndpoint {
82
+ host: string;
83
+ port: number;
84
+ security: "TLS" | "STARTTLS" | "NONE";
85
+ username?: string;
86
+ }
87
+ export interface InteractionMailConfiguration {
88
+ profileRef?: string;
89
+ expectedRevision?: number;
90
+ displayName?: string;
91
+ provider?: InteractionMailProvider;
92
+ mailbox?: string;
93
+ connection?: {
94
+ imap: InteractionMailEndpoint;
95
+ smtp: InteractionMailEndpoint;
96
+ };
97
+ presetRef?: string;
98
+ presetRevision?: number;
99
+ region?: "CN" | "HK";
100
+ folders?: {
101
+ inbox: string;
102
+ drafts?: string;
103
+ sent?: string;
104
+ };
105
+ }
106
+ export interface InteractionEnvironmentInstallation {
107
+ environmentRef: string;
108
+ platform: "DARWIN" | "LINUX" | "WINDOWS";
109
+ architecture: "ARM64" | "X64";
110
+ moduleIds: (InstallationModuleId | "api.weixin" | "media.shared")[];
111
+ installationRef?: string;
112
+ expectedFingerprint?: string;
113
+ deviceRef?: string;
114
+ planDigest?: string;
115
+ }
116
+ export interface InteractionAccountConnection {
117
+ connectionRef: string;
118
+ profileRef: string;
119
+ deviceRef: string;
120
+ resourceRef: string;
121
+ expectedPlacementRevision: number;
122
+ mode: "LOGIN" | "RENEW";
123
+ allowAgentVision: boolean;
124
+ maximumChallengeAttempts: number;
125
+ }
126
+ export interface InteractionDevicePlacement {
127
+ nodeRef: string;
128
+ profileRef: string;
129
+ expectedPlacementRevision: number;
130
+ resourceRef: string;
131
+ expectedNodeGeneration: number;
132
+ environmentGeneration: number;
133
+ expectedHostBindingDigest: string;
134
+ expectedModuleDigest: string;
135
+ }
136
+ export interface InteractionAccountSetup {
137
+ setupRef: string;
138
+ deviceRef: string;
139
+ moduleId: "android.wechat" | "android.whatsapp";
140
+ displayName: string;
141
+ installationRef?: string;
142
+ expectedNodeGeneration?: number;
143
+ expectedFingerprint?: string;
144
+ }
145
+ /** 公开参数表达闭合的窄意图,既不接收秘密,也不允许调用者选择任意业务合同。 */
146
+ export type InteractionOperation = {
147
+ type: "MAIL_CONFIGURATION";
148
+ payload: InteractionMailConfiguration;
149
+ } | {
150
+ type: "MESSAGE_REVIEW";
151
+ payload: {
152
+ engagementRef: string;
153
+ messageRef: string;
154
+ version: number;
155
+ contentDigest: string;
156
+ };
157
+ } | {
158
+ type: "ENVIRONMENT_INSTALLATION";
159
+ payload: InteractionEnvironmentInstallation;
160
+ } | {
161
+ type: "NODE_PAIRING";
162
+ payload: {
163
+ pairingRef: string;
164
+ expectedRevision: number;
165
+ expectedFingerprint: string;
166
+ };
167
+ } | {
168
+ type: "DEVICE_PLACEMENT";
169
+ payload: InteractionDevicePlacement;
170
+ } | {
171
+ type: "ACCOUNT_SETUP";
172
+ payload: InteractionAccountSetup;
173
+ } | {
174
+ type: "ACCOUNT_CONNECTION";
175
+ payload: InteractionAccountConnection;
176
+ } | {
177
+ type: "FEEDBACK";
178
+ payload: {
179
+ text: string;
180
+ };
181
+ };
182
+ export interface InteractionRequestInput {
183
+ idempotencyKey: string;
184
+ interactionRef: string;
185
+ title: string;
186
+ rationale: string;
187
+ operation: InteractionOperation;
188
+ reviewerPrincipalRef?: string;
189
+ expiresInSeconds?: number;
190
+ }
191
+ export interface InteractionExpectedInput {
192
+ idempotencyKey: string;
193
+ interactionRef: string;
194
+ expectedRevision: number;
195
+ expectedRequestDigest: string;
196
+ }
197
+ export interface InteractionReviseInput extends InteractionExpectedInput {
198
+ title?: string;
199
+ rationale?: string;
200
+ operation: InteractionOperation;
201
+ }
202
+ export interface InteractionAssignInput extends InteractionExpectedInput {
203
+ reviewerPrincipalRef: string;
204
+ }
205
+ export interface InteractionRespondInput extends InteractionExpectedInput {
206
+ action: "APPROVE" | "REJECT";
207
+ rationale: string;
208
+ }
209
+ export interface InteractionCancelInput extends InteractionExpectedInput {
210
+ rationale: string;
211
+ }
212
+ export interface InteractionGetInput {
213
+ interactionRef: string;
214
+ }
215
+ export interface InteractionListInput {
216
+ limit?: number;
217
+ cursor?: string;
218
+ }
67
219
  /** Public DTOs shared by the Agent SDK; runtime validation is the canonical JSON Schema. */
68
220
  export type ProspectTemporalStatus = "CURRENT" | "HISTORICAL";
69
221
  export interface ProspectObservation {
@@ -190,33 +342,23 @@ declare const BROWSER_SOCIAL_PLATFORMS: readonly [
190
342
  "DOUYIN",
191
343
  "TIKTOK"
192
344
  ];
193
- export interface AgentStackScope {
194
- readonly authorityRef: string;
195
- readonly sourcePrincipal: Readonly<{
196
- issuer: string;
197
- subject: string;
198
- }>;
199
- readonly tenantId: string;
200
- readonly workspaceId: string;
201
- readonly projectId: string;
202
- readonly businessAgentId: string;
203
- readonly businessAgentVersionId: string;
204
- /** 经签名的上游服务凭据租约 ID;正式生产端配对要求此字段以隔离轮换后的旧断言。 */
205
- readonly sourceCredentialId?: string;
345
+ /** Browser-safe shared approval representation; no host paths, locators or bytes. */
346
+ export interface MessageAttachment {
347
+ readonly assetRef: string;
348
+ readonly sourceVersion: string;
349
+ readonly digest: string;
350
+ readonly mediaType: string;
351
+ readonly byteLength: number;
352
+ readonly filename: string;
353
+ readonly presentation?: "VOICE_NOTE" | "IMAGE" | "VIDEO";
206
354
  }
207
- export interface TenantContextInput {
208
- readonly tenantId?: string | undefined;
209
- readonly principalRef?: string | undefined;
210
- readonly actorRef?: string | undefined;
211
- readonly authorizationScopes?: readonly string[] | undefined;
212
- readonly projectRef?: string | undefined;
213
- readonly workspaceRef?: string | undefined;
214
- /** Signature-verified JWT issuer, never a caller-supplied business payload. */
215
- readonly identityIssuer?: string | undefined;
216
- /** Signature-verified JWT subject, never a caller-supplied business payload. */
217
- readonly identitySubject?: string | undefined;
218
- /** 只由验证签名的 Agent Stack 适配器产生,HTTP 业务 payload 不得提供。 */
219
- readonly agentStack?: AgentStackScope | undefined;
355
+ type MessageAttachmentChoice = Pick<MessageAttachment, "assetRef" | "filename" | "presentation">;
356
+ /** 由已安装适配器协商的宿主需求;业务身份、设备检查及资源租约仍各自生效。 */
357
+ export interface NodeExecutionRequirements {
358
+ readonly protocol: 1;
359
+ readonly hostSleepMonitor: boolean;
360
+ readonly hostDisplay: boolean;
361
+ readonly hostDesktopSession: boolean;
220
362
  }
221
363
  /** The exact accessible display belongs to its outer source row, without author or parent identity. */
222
364
  export interface NativeQuotedDisplay {
@@ -248,6 +390,58 @@ export interface NativeRenderedMedia {
248
390
  readonly authorIdentity: "NOT_ATTESTED";
249
391
  readonly parentMessageIdentity: "NOT_ATTESTED";
250
392
  }
393
+ export interface AgentStackScope {
394
+ readonly authorityRef: string;
395
+ readonly sourcePrincipal: Readonly<{
396
+ issuer: string;
397
+ subject: string;
398
+ }>;
399
+ readonly tenantId: string;
400
+ readonly workspaceId: string;
401
+ readonly projectId: string;
402
+ readonly businessAgentId: string;
403
+ readonly businessAgentVersionId: string;
404
+ /** 经签名的上游服务凭据租约 ID;正式生产端配对要求此字段以隔离轮换后的旧断言。 */
405
+ readonly sourceCredentialId?: string;
406
+ }
407
+ export interface TenantContextInput {
408
+ readonly tenantId?: string | undefined;
409
+ readonly principalRef?: string | undefined;
410
+ readonly actorRef?: string | undefined;
411
+ readonly authorizationScopes?: readonly string[] | undefined;
412
+ readonly projectRef?: string | undefined;
413
+ readonly workspaceRef?: string | undefined;
414
+ /** Signature-verified JWT issuer, never a caller-supplied business payload. */
415
+ readonly identityIssuer?: string | undefined;
416
+ /** Signature-verified JWT subject, never a caller-supplied business payload. */
417
+ readonly identitySubject?: string | undefined;
418
+ /** 只由验证签名的 Agent Stack 适配器产生,HTTP 业务 payload 不得提供。 */
419
+ readonly agentStack?: AgentStackScope | undefined;
420
+ }
421
+ /** EMAIL 专属的内嵌映射;文件字节身份仍由原附件六字段清单拥有。 */
422
+ export interface EmailInlineImage {
423
+ readonly cid: string;
424
+ readonly assetRef: string;
425
+ }
426
+ export interface MailSignatureImage extends EmailInlineImage {
427
+ readonly filename: string;
428
+ }
429
+ /** 草稿中冻结的签名快照;发送和核查不再读取可变模板。 */
430
+ export interface FrozenMailSignature {
431
+ readonly signatureRef: string;
432
+ readonly version: number;
433
+ readonly digest: string;
434
+ readonly profileRef: string;
435
+ readonly text: string;
436
+ readonly html?: string;
437
+ readonly inlineImages: readonly EmailInlineImage[];
438
+ }
439
+ export interface EmailRichContent {
440
+ readonly text: string;
441
+ readonly html?: string;
442
+ readonly inlineImages?: readonly EmailInlineImage[];
443
+ readonly signature?: FrozenMailSignature;
444
+ }
251
445
  export interface CommunicationPolicyBasis {
252
446
  readonly policyRef: string;
253
447
  readonly version: number;
@@ -436,6 +630,27 @@ export interface EngagementControl {
436
630
  readonly resumedAt?: string;
437
631
  readonly sessionCorrelationRef?: string;
438
632
  }
633
+ /** 模板属于创建时的精确租户范围,媒体只保存已有 Asset 的选择,不拥有字节。 */
634
+ export interface MailSignatureTemplate {
635
+ readonly tenantId: string;
636
+ readonly projectRef?: string;
637
+ readonly workspaceRef?: string;
638
+ readonly signatureRef: string;
639
+ readonly version: number;
640
+ readonly displayName: string;
641
+ readonly enabled: boolean;
642
+ readonly text: string;
643
+ readonly html?: string;
644
+ readonly inlineImages: readonly MailSignatureImage[];
645
+ readonly digest: string;
646
+ readonly configuredAt: string;
647
+ readonly configuredBy: string;
648
+ }
649
+ export interface MailSignaturePage {
650
+ readonly items: readonly Pick<MailSignatureTemplate, "signatureRef" | "version" | "displayName" | "enabled" | "digest">[];
651
+ readonly nextOffset: number | null;
652
+ readonly total: number;
653
+ }
439
654
  export interface WechatAutonomy {
440
655
  readonly enabled: boolean;
441
656
  readonly version: number;
@@ -1193,16 +1408,6 @@ export interface CommunicationMessage {
1193
1408
  readonly message: MessageProjection;
1194
1409
  readonly source: SourceObservation;
1195
1410
  }
1196
- /** Browser-safe shared approval representation; no host paths, locators or bytes. */
1197
- export interface MessageAttachment {
1198
- readonly assetRef: string;
1199
- readonly sourceVersion: string;
1200
- readonly digest: string;
1201
- readonly mediaType: string;
1202
- readonly byteLength: number;
1203
- readonly filename: string;
1204
- readonly presentation?: "VOICE_NOTE" | "IMAGE" | "VIDEO";
1205
- }
1206
1411
  export type SourceMessagePart = {
1207
1412
  readonly partRef: string;
1208
1413
  readonly kind: "TEXT";
@@ -1330,6 +1535,51 @@ export interface SourceBasis {
1330
1535
  readonly messageRef: string;
1331
1536
  readonly headFactRef: string;
1332
1537
  }
1538
+ export interface DeliveredEmailAttachment extends MessageAttachment {
1539
+ readonly remoteAttachmentRef: string;
1540
+ }
1541
+ export type EmailMessageStatus = "DRAFT" | "APPROVED" | "REJECTED" | "QUEUED" | "CANCELLED" | "ACCEPTED" | "UNCERTAIN" | "FAILED";
1542
+ /** 原 Work 的提交依据;与内容生成来源区分,外部命令不能自行声明。 */
1543
+ export interface EmailWorkSource {
1544
+ readonly workRef: string;
1545
+ readonly kind: "REPLY" | "FOLLOW_UP" | "CONTACT";
1546
+ readonly taskOrigin?: TaskCommunicationOrigin;
1547
+ readonly communicationPolicyBasis?: CommunicationPolicyBasis;
1548
+ }
1549
+ export interface EmailMessageProjection extends EmailRichContent {
1550
+ readonly taskOrigin?: TaskCommunicationOrigin;
1551
+ readonly workSource?: EmailWorkSource;
1552
+ readonly sourceBasis?: SourceBasis;
1553
+ readonly tenantId: string;
1554
+ readonly engagementRef: string;
1555
+ readonly messageRef: string;
1556
+ readonly conversationRef?: string;
1557
+ readonly version: number;
1558
+ readonly contentDigest: string;
1559
+ readonly routeRef: string;
1560
+ readonly recipientAddress: string;
1561
+ readonly senderParticipantRef: string;
1562
+ readonly recipientParticipantRef: string;
1563
+ readonly subject: string;
1564
+ readonly text: string;
1565
+ readonly replyToMessageRef?: string;
1566
+ readonly followUpOfMessageRef?: string;
1567
+ readonly followUpPlanVersion?: number;
1568
+ readonly attachments?: readonly MessageAttachment[];
1569
+ readonly deliveredAttachments?: readonly DeliveredEmailAttachment[];
1570
+ readonly status: EmailMessageStatus;
1571
+ readonly createdAt: string;
1572
+ readonly updatedAt: string;
1573
+ readonly reviewedBy?: string;
1574
+ readonly reviewerKind?: "HUMAN";
1575
+ readonly approvalExpiresAt?: string;
1576
+ readonly profileRef?: string;
1577
+ readonly sendRequestRef?: string;
1578
+ readonly correlationRef?: string;
1579
+ readonly internetMessageId?: string;
1580
+ readonly observedAt?: string;
1581
+ readonly followUpDueAt?: string;
1582
+ }
1333
1583
  /** 原文本消息模型;旧 WechatMessage 继续作为兼容名称。 */
1334
1584
  export type TextMessageStatus = "DRAFT" | "APPROVED" | "REJECTED" | "QUEUED" | "CLIENT_VISIBLE" | "UNCERTAIN" | "FAILED" | "CANCELLED";
1335
1585
  export interface TaskCommunicationOrigin {
@@ -1378,7 +1628,133 @@ export interface TextChannelMessage {
1378
1628
  readonly hostEvidenceDigest?: string;
1379
1629
  }
1380
1630
  export type CommunicationChannel = "EMAIL" | "WECHAT" | "WHATSAPP" | "SOCIAL";
1631
+ declare const DESKTOP_ACTION_KINDS: readonly [
1632
+ "MOMENTS_PUBLISH",
1633
+ "MOMENTS_COMMENT",
1634
+ "MOMENTS_REPLY",
1635
+ "MOMENTS_LIKE",
1636
+ "MOMENTS_UNLIKE",
1637
+ "MOMENTS_DELETE",
1638
+ "MOMENTS_COMMENT_DELETE",
1639
+ "CHANNELS_PUBLISH",
1640
+ "CHANNELS_COMMENT",
1641
+ "CHANNELS_REPLY",
1642
+ "CHANNELS_LIKE",
1643
+ "CHANNELS_UNLIKE",
1644
+ "CHANNELS_COMMENT_DELETE",
1645
+ "WORKS_PUBLISH",
1646
+ "WORKS_COMMENT",
1647
+ "WORKS_REPLY",
1648
+ "WORKS_LIKE",
1649
+ "WORKS_UNLIKE",
1650
+ "WORKS_DELETE",
1651
+ "WORKS_COMMENT_DELETE",
1652
+ "CONTACT_REMARK",
1653
+ "CONTACT_DELETE",
1654
+ "GROUP_RENAME",
1655
+ "GROUP_ANNOUNCEMENT",
1656
+ "GROUP_LEAVE",
1657
+ "GROUP_MUTE",
1658
+ "GROUP_UNMUTE",
1659
+ "GROUP_PIN",
1660
+ "GROUP_UNPIN",
1661
+ "CONTACT_REQUEST",
1662
+ "CONTACT_ACCEPT",
1663
+ "GROUP_CREATE",
1664
+ "GROUP_INVITE",
1665
+ "MESSAGE_FORWARD",
1666
+ "CONTACT_SHARE",
1667
+ "MOMENTS_SHARE",
1668
+ "CHANNELS_SHARE",
1669
+ "WORKS_SHARE"
1670
+ ];
1671
+ export type DesktopActionKind = typeof DESKTOP_ACTION_KINDS[number];
1672
+ declare const DESKTOP_NATIVE_PRESENTATIONS: readonly [
1673
+ "IMAGE",
1674
+ "VIDEO",
1675
+ "VOICE_NOTE"
1676
+ ];
1677
+ export type DesktopNativePresentation = typeof DESKTOP_NATIVE_PRESENTATIONS[number];
1381
1678
  declare const EXECUTION_NODE_PROTOCOL = "ne-execution-node/1.0";
1679
+ declare const EXECUTION_NODE_MODULE = "android.whatsapp.read";
1680
+ export interface NodeResourceAdvertisement extends WechatOnboardingProtocols {
1681
+ readonly weixinOfficialReadProtocol?: 1;
1682
+ readonly executionRequirements?: NodeExecutionRequirements;
1683
+ readonly desktopTaskContextProtocol?: 1;
1684
+ readonly desktopTaskNavigationProtocol?: 1;
1685
+ readonly desktopConversationLocateProtocol?: 1;
1686
+ readonly desktopConversationResolveProtocol?: 1;
1687
+ readonly desktopConversationDiscoveryProtocol?: 1;
1688
+ readonly desktopConversationSelectProtocol?: 1;
1689
+ readonly desktopConversationBrowseProtocol?: 1;
1690
+ readonly nativeTaskNavigationProtocol?: 1;
1691
+ readonly nativeCancelledDraftProtocol?: 1;
1692
+ readonly nativeMediaSendProtocol?: 1;
1693
+ /** 固定 Facebook Profile 观察与人工恢复协议,不授予营销写入。 */
1694
+ readonly browserProfileProtocol?: 1;
1695
+ readonly browserProfileTaskProtocol?: 1;
1696
+ readonly browserProfileContentProtocol?: 1;
1697
+ readonly browserProfilePostsProtocol?: 1;
1698
+ readonly browserProfilePostDetailProtocol?: 1;
1699
+ readonly browserProfileCommentsProtocol?: 1;
1700
+ readonly browserProfileCurrentCommentsProtocol?: 1;
1701
+ readonly browserProfileSearchProtocol?: 1;
1702
+ readonly browserProfileNavigationProtocol?: 1;
1703
+ readonly facebookReplyProtocol?: 1;
1704
+ readonly browserProfileActivityProtocol?: 1;
1705
+ readonly nativeRenderedWindowBoundaryProtocol?: 1;
1706
+ readonly nativeRenderedMediaProtocol?: 1;
1707
+ localResourceDigest: string;
1708
+ environmentGeneration: number;
1709
+ hostRef: string;
1710
+ profileRef: string;
1711
+ accountRef: string;
1712
+ sessionRef: string;
1713
+ capabilityRef: string;
1714
+ hostBindingDigest: string;
1715
+ application: "weixin" | "whatsapp" | "youtube" | "tiktok" | "wechat" | "browser" | "mail" | "xiaohongshu" | "douyin";
1716
+ externalAccountRef?: string;
1717
+ bridgeBindingJson?: string;
1718
+ bridgeRuntimeKind?: "DESKTOP" | "BROWSER" | "API" | "MAIL";
1719
+ mailConfigurationDigest?: string;
1720
+ moduleId: typeof EXECUTION_NODE_MODULE | "android.whatsapp.message" | "android.wechat.read" | "android.wechat.message" | "api.weixin" | "api.youtube" | "api.tiktok" | "bridge.wechat" | "bridge.browser" | "bridge.mail" | "browser.xiaohongshu" | "browser.douyin" | "browser.tiktok";
1721
+ moduleVersion: "1.0.0";
1722
+ moduleDigest: string;
1723
+ enabled: boolean;
1724
+ supportsDisplayOff: boolean;
1725
+ supportsLocked: boolean;
1726
+ supportsNativeCapture?: boolean;
1727
+ supportsNativeCaption?: boolean;
1728
+ supportsNativeBytes?: boolean;
1729
+ supportsSourceBytes?: boolean;
1730
+ browserSocialProtocol?: 1;
1731
+ browserSocialDirectMediaKinds?: readonly ("IMAGE" | "VIDEO")[];
1732
+ browserSocialActions?: readonly ("READ" | "COMMENT" | "REPLY" | "DIRECT" | "PUBLISH" | "SCHEDULE_CANCEL" | "SCHEDULE_RESCHEDULE")[];
1733
+ xiaohongshuDirectMediaProtocol?: 1;
1734
+ xiaohongshuDirectMediaKinds?: readonly ("IMAGE" | "VIDEO" | "VOICE_NOTE")[];
1735
+ desktopFileSendProtocol?: 1;
1736
+ nativeWechatMultiSendProtocol?: 1;
1737
+ wechatPhysicalRecoveryProtocol?: 1;
1738
+ desktopMediaPresentations?: readonly DesktopNativePresentation[];
1739
+ desktopActionProtocol?: 1;
1740
+ desktopActionKinds?: readonly DesktopActionKind[];
1741
+ /** Actual protected host describe/probe negotiated personal WeChat ID verification v1. */
1742
+ supportsWechatContactIdentity?: boolean;
1743
+ wechatLocalIdentityProtocol?: 1;
1744
+ /** Independent complete PERSONAL LOCAL5+CONTACT3 protocol; never inferred from the GROUP capability. */
1745
+ wechatPersonalLocalIdentityProtocol?: 1;
1746
+ /** Actual protected host describe/probe negotiated the bounded unbound Social read protocol v1. */
1747
+ supportsWechatSocialRead?: boolean;
1748
+ /** Absent preserves the legacy current-page-only v1 advertisement. */
1749
+ wechatSocialReadProtocol?: 2;
1750
+ wechatSocialTargetRegistrationProtocol?: 1;
1751
+ wechatMomentsPublicationProtocol?: 1;
1752
+ wechatOfficialReadProtocol?: 1;
1753
+ wechatChannelsFeedReadProtocol?: 1;
1754
+ nativeVoiceObservationProtocol?: 1 | 2;
1755
+ wechatOutboundDisplayProtocol?: 1;
1756
+ wechatQuotedHistoryProtocol?: 1 | 2;
1757
+ }
1382
1758
  export interface NodeProof {
1383
1759
  protocol: typeof EXECUTION_NODE_PROTOCOL;
1384
1760
  tenantId: string;
@@ -1393,6 +1769,61 @@ export interface NodeProof {
1393
1769
  bodyDigest: string;
1394
1770
  signature: string;
1395
1771
  }
1772
+ /** 独立受保护端口资格;既有能力或环境变量不能推导这些版本。 */
1773
+ export interface WechatOnboardingProtocols {
1774
+ readonly wechatGroupBindingProtocol?: 1;
1775
+ readonly wechatGroupAuthorProtocol?: 1;
1776
+ readonly wechatSourceRebuildProtocol?: 1;
1777
+ readonly wechatTargetContinuityProtocol?: 1;
1778
+ readonly wechatSelectionNavigationProtocol?: 1;
1779
+ readonly nativeBootstrapProtocol?: 1;
1780
+ readonly wechatConversationDiscoveryProtocol?: 1;
1781
+ readonly wechatHomeLocalIdentityProtocol?: 1;
1782
+ readonly wechatBindingContinuityProtocol?: 1;
1783
+ readonly wechatSourceWindowCommitProtocol?: 1;
1784
+ }
1785
+ /** 通用交互只关联原业务操作、人类决定和应用回执,不承载模型会话或设备秘密。 */
1786
+ export type EngagementInteractionOperationType = "MAIL_CONFIGURATION" | "MESSAGE_REVIEW" | "ENVIRONMENT_INSTALLATION" | "NODE_PAIRING" | "DEVICE_PLACEMENT" | "ACCOUNT_SETUP" | "ACCOUNT_CONNECTION" | "FEEDBACK";
1787
+ export interface EngagementInteractionOperation {
1788
+ type: EngagementInteractionOperationType;
1789
+ payload: Record<string, unknown>;
1790
+ }
1791
+ export type EngagementInteractionState = "PENDING" | "DECIDED" | "APPLYING" | "APPLIED" | "REJECTED" | "CANCELLED" | "EXPIRED" | "FAILED" | "UNKNOWN";
1792
+ export interface EngagementInteractionApplication {
1793
+ state: "NOT_STARTED" | "APPLYING" | "APPLIED" | "WAITING" | "FAILED" | "UNKNOWN";
1794
+ result: Record<string, unknown> | null;
1795
+ receiptRefs: string[];
1796
+ blockers: string[];
1797
+ }
1798
+ export interface EngagementInteraction {
1799
+ protocol: "native-engagement.interaction/1";
1800
+ schemaVersion: 1;
1801
+ tenantId: string;
1802
+ interactionRef: string;
1803
+ revision: number;
1804
+ requestDigest: string;
1805
+ requesterPrincipalRef: string;
1806
+ reviewerPrincipalRef: string | null;
1807
+ projectRef: string | null;
1808
+ workspaceRef: string | null;
1809
+ kind: "CONFIGURATION" | "APPROVAL" | "INSTALLATION" | "AUTHENTICATION" | "FEEDBACK";
1810
+ title: string;
1811
+ rationale: string;
1812
+ operation: EngagementInteractionOperation;
1813
+ state: EngagementInteractionState;
1814
+ createdAt: string;
1815
+ expiresAt: string;
1816
+ reviewPath: string;
1817
+ decision: {
1818
+ decisionRef: string;
1819
+ principalRef: string;
1820
+ action: "APPROVE" | "REJECT";
1821
+ rationale: string;
1822
+ requestDigest: string;
1823
+ decidedAt: string;
1824
+ } | null;
1825
+ application: EngagementInteractionApplication;
1826
+ }
1396
1827
  export type WorkbenchSummary = ({
1397
1828
  readonly prospectRef: string;
1398
1829
  readonly ownership?: never;
@@ -1426,6 +1857,185 @@ export interface ContractExecutionRequest {
1426
1857
  readonly payload?: Readonly<Record<string, unknown>> | undefined;
1427
1858
  readonly context?: TenantContextInput | undefined;
1428
1859
  }
1860
+ /** 签名 Node 心跳观察的宿主系统,不能从安装意图推断;旧节点明确保留 UNKNOWN。 */
1861
+ export interface ExecutionDeviceSystem {
1862
+ schemaVersion: 1;
1863
+ platform: "DARWIN" | "LINUX" | "WINDOWS" | "OTHER" | "UNKNOWN";
1864
+ architecture: "ARM64" | "X64" | "OTHER" | "UNKNOWN";
1865
+ observedAt: string | null;
1866
+ currentness: "CURRENT" | "EXPIRED" | "NOT_OBSERVED";
1867
+ }
1868
+ /** Device 是原 Node 的授权投影;登记、在线、模块及账号认证分别保留真实证据。 */
1869
+ export interface ExecutionDeviceView {
1870
+ protocol: "native-engagement.device/1";
1871
+ tenantId: string;
1872
+ deviceRef: string;
1873
+ nodeRef: string;
1874
+ installationRef: string;
1875
+ fingerprint: string;
1876
+ generation: number;
1877
+ online: boolean;
1878
+ state: "PAIRED" | "REVOKED";
1879
+ lastSeenAt: string | null;
1880
+ system?: ExecutionDeviceSystem;
1881
+ resources: readonly (NodeResourceAdvertisement & {
1882
+ resourceRef: string;
1883
+ blockers: string[];
1884
+ })[];
1885
+ blockers: string[];
1886
+ }
1887
+ export interface EnvironmentRequest {
1888
+ environmentRef: string;
1889
+ platform: "DARWIN" | "LINUX" | "WINDOWS";
1890
+ architecture: "ARM64" | "X64";
1891
+ moduleIds: string[];
1892
+ installationRef?: string;
1893
+ expectedFingerprint?: string;
1894
+ deviceRef?: string;
1895
+ planDigest?: string;
1896
+ }
1897
+ export interface DeviceResourceLimits {
1898
+ cpuPercent: number;
1899
+ memoryMb: number;
1900
+ maximumProcesses: number;
1901
+ maximumRuntimeSeconds: number;
1902
+ }
1903
+ export interface ExecutionEnvironmentView extends Omit<EnvironmentRequest, "installationRef" | "deviceRef"> {
1904
+ protocol: "native-engagement.environment/1";
1905
+ tenantId: string;
1906
+ interactionRef: string;
1907
+ installationRef: string | null;
1908
+ deviceRef: string | null;
1909
+ planDigest: string;
1910
+ state: "APPROVAL_REQUIRED" | "BOOTSTRAP_REQUIRED" | "PAIRING_REQUIRED" | "READY" | "BLOCKED";
1911
+ installerUrl: string | null;
1912
+ bootstrapUrl: string | null;
1913
+ artifactDigest: string | null;
1914
+ signatureRef: string | null;
1915
+ resourceLimits: DeviceResourceLimits | null;
1916
+ prerequisites: string[];
1917
+ blockers: string[];
1918
+ online: boolean | null;
1919
+ qualification: {
1920
+ artifact: "NOT_PROVEN" | "VERIFIED";
1921
+ resourceLimits: "NOT_PROVEN" | "VERIFIED";
1922
+ };
1923
+ bootstrapRequest: {
1924
+ schemaVersion: 1;
1925
+ tenantId: string;
1926
+ serviceOrigin: string;
1927
+ environmentRef: string;
1928
+ interactionRef: string;
1929
+ planDigest: string;
1930
+ platform: EnvironmentRequest["platform"];
1931
+ architecture: EnvironmentRequest["architecture"];
1932
+ moduleIds: string[];
1933
+ artifactDigest: string;
1934
+ signatureRef: string;
1935
+ resourceLimits: DeviceResourceLimits;
1936
+ } | null;
1937
+ }
1938
+ export type VisualChallengeAnswer = {
1939
+ type: "TEXT";
1940
+ text: string;
1941
+ } | {
1942
+ type: "POINTS";
1943
+ points: {
1944
+ x: number;
1945
+ y: number;
1946
+ }[];
1947
+ };
1948
+ export interface ConnectionChallenge {
1949
+ challengeRef: string;
1950
+ kind: "VISUAL_TEXT" | "VISUAL_POINTS";
1951
+ maximumAttempts: number;
1952
+ attempts: number;
1953
+ }
1954
+ export interface ConnectionObservation {
1955
+ observationRef: string;
1956
+ deviceRef: string;
1957
+ resourceRef: string;
1958
+ connectionRef: string;
1959
+ digest: string;
1960
+ capturedAt: string;
1961
+ expiresAt: string;
1962
+ evidenceRef: string;
1963
+ kind: "QR_CODE" | "VISUAL_TEXT" | "VISUAL_POINTS" | "LOGIN" | "NONE";
1964
+ challenge?: ConnectionChallenge;
1965
+ /** 本机登录事实与具体业务账号映射分离;只有原 Human 核对这张准确画面才可完成后者。 */
1966
+ accountConfirmation?: {
1967
+ basis: "HUMAN_REVIEW_REQUIRED";
1968
+ localLogin: "AUTHENTICATED";
1969
+ identity: "OWNER_SELECTED_VIEW" | "NOT_ATTESTED";
1970
+ validUntil: string;
1971
+ };
1972
+ }
1973
+ export interface AccountConnectionView {
1974
+ protocol: "native-engagement.account-connection/1";
1975
+ tenantId: string;
1976
+ connectionRef: string;
1977
+ interactionRef: string;
1978
+ deviceRef: string;
1979
+ resourceRef: string;
1980
+ profileRef: string;
1981
+ revision: number;
1982
+ state: "APPROVAL_REQUIRED" | "QUEUED" | "RUNNING" | "AUTHENTICATED" | "HUMAN_REQUIRED" | "UNKNOWN" | "BLOCKED" | "CANCELLED";
1983
+ operationRef: string | null;
1984
+ observation: ConnectionObservation | null;
1985
+ blockers: string[];
1986
+ authentication: {
1987
+ observedAt: string;
1988
+ validUntil: string;
1989
+ accountRef: string;
1990
+ basis: "HOST_OBSERVED_ACCOUNT" | "HUMAN_CONFIRMED_LOCAL_ACCOUNT";
1991
+ remoteAuthentication: "NOT_ATTESTED";
1992
+ } | null;
1993
+ approvalExpiresAt: string;
1994
+ online: boolean | null;
1995
+ currentness: "CURRENT" | "EXPIRED" | "NOT_OBSERVED";
1996
+ }
1997
+ /** 首个账号准备与原连接分离;未有真实广告时不返回 resource、placement 或登录成功。 */
1998
+ export type AccountSetupModule = "android.wechat" | "android.whatsapp";
1999
+ export interface AccountSetupIntent {
2000
+ setupRef: string;
2001
+ deviceRef: string;
2002
+ moduleId: AccountSetupModule;
2003
+ displayName: string;
2004
+ installationRef?: string;
2005
+ expectedNodeGeneration?: number;
2006
+ expectedFingerprint?: string;
2007
+ }
2008
+ export interface AccountSetupBinding {
2009
+ tenantId: string;
2010
+ providerRef: string;
2011
+ accountRef: string;
2012
+ profileRef: string;
2013
+ hostRef: string;
2014
+ sessionRef: string;
2015
+ capabilityRef: string;
2016
+ }
2017
+ export interface AccountSetupView extends AccountSetupIntent {
2018
+ protocol: "native-engagement.account-setup/1";
2019
+ tenantId: string;
2020
+ interactionRef: string;
2021
+ requestDigest: string;
2022
+ revision: number;
2023
+ state: "APPROVAL_REQUIRED" | "AUTHORITY_REQUIRED" | "QUEUED" | "RUNNING" | "LOGIN_REQUIRED" | "RESTART_REQUIRED" | "RESOURCE_READY" | "BLOCKED" | "UNKNOWN";
2024
+ binding: AccountSetupBinding | null;
2025
+ authorityPath: "/desktop/v1/accountsetup";
2026
+ resource: {
2027
+ resourceRef: string;
2028
+ placementRevision: number;
2029
+ } | null;
2030
+ evidence: {
2031
+ evidenceRef: string;
2032
+ digest: string;
2033
+ capturedAt: string;
2034
+ expiresAt: string;
2035
+ } | null;
2036
+ blockers: string[];
2037
+ originalOperationRef: string | null;
2038
+ }
1429
2039
  /** 固定的输入错误可在 HTTP/SDK 边界映射,避免把解析细节带进业务错误。 */
1430
2040
  export declare class ContractDiscoveryInputError extends Error {
1431
2041
  constructor();
@@ -1546,6 +2156,143 @@ export declare class RemoteNativeEngagementSdk {
1546
2156
  enquiry(payload: Readonly<Record<string, unknown>>): Promise<unknown>;
1547
2157
  agentStackPreflight(payload: Readonly<Record<string, unknown>>): Promise<unknown>;
1548
2158
  }
2159
+ export type WorkClient = Pick<RemoteNativeEngagementSdk, "query" | "command">;
2160
+ export interface EngagementInteractionPage {
2161
+ tenantId: string;
2162
+ items: EngagementInteraction[];
2163
+ nextCursor: string | null;
2164
+ }
2165
+ /** 便携客户端只调用 canonical 入口;未知写入不自动重试,继续使用原幂等键和 interactionRef 查询。 */
2166
+ export declare function interactionClient(sdk: WorkClient): {
2167
+ request: (input: InteractionRequestInput) => Promise<EngagementInteraction>;
2168
+ get: (input: InteractionGetInput) => Promise<EngagementInteraction>;
2169
+ list: (input?: InteractionListInput) => Promise<EngagementInteractionPage>;
2170
+ revise: (input: InteractionReviseInput) => Promise<EngagementInteraction>;
2171
+ assign: (input: InteractionAssignInput) => Promise<EngagementInteraction>;
2172
+ respond: (input: InteractionRespondInput) => Promise<EngagementInteraction>;
2173
+ apply: (input: InteractionExpectedInput) => Promise<EngagementInteraction>;
2174
+ cancel: (input: InteractionCancelInput) => Promise<EngagementInteraction>;
2175
+ };
2176
+ export type InteractionClient = ReturnType<typeof interactionClient>;
2177
+ export interface DeviceListInput {
2178
+ limit?: number;
2179
+ }
2180
+ export interface DevicePage {
2181
+ tenantId: string;
2182
+ items: ExecutionDeviceView[];
2183
+ }
2184
+ export interface DeviceInspectInput {
2185
+ deviceRef: string;
2186
+ }
2187
+ export interface EnvironmentGetInput {
2188
+ environmentRef: string;
2189
+ }
2190
+ export interface EnvironmentEnrollmentInput {
2191
+ idempotencyKey: string;
2192
+ environmentRef: string;
2193
+ interactionRef: string;
2194
+ planDigest: string;
2195
+ installationRef: string;
2196
+ expectedFingerprint: string;
2197
+ }
2198
+ export interface EnvironmentRequestInput extends Omit<InteractionRequestInput, "operation"> {
2199
+ operation: InteractionEnvironmentInstallation;
2200
+ }
2201
+ export interface ConnectionRequestInput extends Omit<InteractionRequestInput, "operation"> {
2202
+ operation: InteractionAccountConnection;
2203
+ }
2204
+ export interface ConnectionGetInput {
2205
+ connectionRef: string;
2206
+ }
2207
+ export interface ConnectionObserveInput extends ConnectionGetInput {
2208
+ idempotencyKey: string;
2209
+ captureImage: boolean;
2210
+ }
2211
+ export interface ConnectionEvidenceInput extends ConnectionGetInput {
2212
+ observationRef: string;
2213
+ digest: string;
2214
+ }
2215
+ export interface ConnectionChallengeInput extends ConnectionEvidenceInput {
2216
+ idempotencyKey: string;
2217
+ challengeRef: string;
2218
+ answer: VisualChallengeAnswer;
2219
+ }
2220
+ /** 恢复仅允许准确 Human 许可原未知操作后的观察,不重做原答案。 */
2221
+ export interface ConnectionRecoverInput extends ConnectionGetInput {
2222
+ idempotencyKey: string;
2223
+ operationRef: string;
2224
+ confirmation: "ORIGINAL_ACCOUNT_REVIEWED";
2225
+ }
2226
+ /** 仅准确 Human 可把真实本机登录观察和其账号核对结合;不声明服务商远端认证。 */
2227
+ export interface ConnectionAccountConfirmInput extends ConnectionEvidenceInput {
2228
+ idempotencyKey: string;
2229
+ expectedRevision: number;
2230
+ confirmation: "VISIBLE_ACCOUNT_MATCHES_PROFILE";
2231
+ }
2232
+ export interface ConnectionEvidence {
2233
+ connectionRef: string;
2234
+ observationRef: string;
2235
+ digest: string;
2236
+ deviceRef: string;
2237
+ resourceRef: string;
2238
+ capturedAt: string;
2239
+ expiresAt: string;
2240
+ mimeType: "image/png";
2241
+ dataBase64: string;
2242
+ }
2243
+ /** Device 是已授权原 Node 的摘要;登记、在线和模块可执行状态分别由服务端原事实决定。 */
2244
+ export declare function deviceClient(sdk: WorkClient): {
2245
+ list: (input?: DeviceListInput) => Promise<DevicePage>;
2246
+ inspect: (input: DeviceInspectInput) => Promise<ExecutionDeviceView>;
2247
+ requestEnvironment: (input: EnvironmentRequestInput) => Promise<ExecutionEnvironmentView>;
2248
+ environment: (input: EnvironmentGetInput) => Promise<ExecutionEnvironmentView>;
2249
+ attachEnrollment: (input: EnvironmentEnrollmentInput) => Promise<ExecutionEnvironmentView>;
2250
+ };
2251
+ export declare function connectionClient(sdk: WorkClient): {
2252
+ request: (input: ConnectionRequestInput) => Promise<AccountConnectionView>;
2253
+ get: (input: ConnectionGetInput) => Promise<AccountConnectionView>;
2254
+ observe: (input: ConnectionObserveInput) => Promise<AccountConnectionView>;
2255
+ submitChallenge: (input: ConnectionChallengeInput) => Promise<AccountConnectionView>;
2256
+ recover: (input: ConnectionRecoverInput) => Promise<AccountConnectionView>;
2257
+ confirmAccount: (input: ConnectionAccountConfirmInput) => Promise<AccountConnectionView>;
2258
+ evidence: (input: ConnectionEvidenceInput) => Promise<ConnectionEvidence>;
2259
+ };
2260
+ export type DeviceClient = ReturnType<typeof deviceClient>;
2261
+ export type ConnectionClient = ReturnType<typeof connectionClient>;
2262
+ export interface AccountSetupRequestInput extends Omit<InteractionRequestInput, "operation"> {
2263
+ operation: AccountSetupIntent;
2264
+ }
2265
+ export interface AccountSetupGetInput {
2266
+ setupRef: string;
2267
+ }
2268
+ export interface AccountSetupObserveInput extends AccountSetupGetInput {
2269
+ idempotencyKey: string;
2270
+ }
2271
+ export interface AccountSetupEvidenceInput extends AccountSetupGetInput {
2272
+ evidenceRef: string;
2273
+ digest: string;
2274
+ }
2275
+ export interface AccountSetupRecoveryInput extends AccountSetupObserveInput {
2276
+ originalOperationRef: string;
2277
+ }
2278
+ export interface AccountSetupEvidence extends AccountSetupEvidenceInput {
2279
+ tenantId: string;
2280
+ capturedAt: string;
2281
+ expiresAt: string;
2282
+ mimeType: "image/png";
2283
+ dataBase64: string;
2284
+ }
2285
+ /** 便携客户端只保留原件与 canonical schema;不固定 Agent 流程,不自动重试安装或借用 Human 身份。 */
2286
+ export declare function accountSetupClient(sdk: WorkClient): {
2287
+ request: (input: AccountSetupRequestInput) => Promise<AccountSetupView>;
2288
+ get: (input: AccountSetupGetInput) => Promise<AccountSetupView>;
2289
+ observe: (input: AccountSetupObserveInput) => Promise<AccountSetupView>;
2290
+ /** 当前 Human 对原 UNKNOWN 只读核对,不能以恢复名义再安装或新建资源。 */
2291
+ recoverHuman: (input: AccountSetupRecoveryInput) => Promise<AccountSetupView>;
2292
+ /** 图像接口只适用于原当前 Human 客户端;业务 MCP Agent 仅取得非秘密引用。 */
2293
+ evidenceHuman: (input: AccountSetupEvidenceInput) => Promise<AccountSetupEvidence>;
2294
+ };
2295
+ export type AccountSetupClient = ReturnType<typeof accountSetupClient>;
1549
2296
  export declare const MCP_CATALOG_META_KEY = "native-engagement/toolCatalog";
1550
2297
  /** 结构化 MCP 端口不依赖具体客户端包,保持公开 SDK 的便携依赖边界。 */
1551
2298
  export interface McpCatalogClient {
@@ -1583,7 +2330,6 @@ export declare class NativeMcpToolCatalog {
1583
2330
  content?: readonly unknown[] | undefined;
1584
2331
  }>;
1585
2332
  }
1586
- export type WorkClient = Pick<RemoteNativeEngagementSdk, "query" | "command">;
1587
2333
  /** Authenticated API parity; the service resolves identity and enforces every contract. */
1588
2334
  export declare function prospectClient(client: WorkClient): {
1589
2335
  preview: (input: ProspectImportInput) => Promise<ProspectBatchView>;
@@ -1600,6 +2346,57 @@ export declare function prospectClient(client: WorkClient): {
1600
2346
  cursor?: string;
1601
2347
  }) => Promise<EngagementCatalogPage>;
1602
2348
  };
2349
+ export interface MailSignatureInput {
2350
+ idempotencyKey: string;
2351
+ signatureRef: string;
2352
+ expectedVersion: number;
2353
+ displayName: string;
2354
+ enabled: boolean;
2355
+ text: string;
2356
+ html?: string;
2357
+ inlineImages?: readonly MailSignatureImage[];
2358
+ }
2359
+ export interface MailDraftInput {
2360
+ idempotencyKey: string;
2361
+ engagementRef: string;
2362
+ conversationRef?: string;
2363
+ messageRef: string;
2364
+ routeRef: string;
2365
+ senderParticipantRef: string;
2366
+ recipientParticipantRef: string;
2367
+ subject: string;
2368
+ text: string;
2369
+ html?: string | null;
2370
+ inlineImages?: readonly {
2371
+ cid: string;
2372
+ assetRef: string;
2373
+ }[];
2374
+ attachments?: readonly MessageAttachmentChoice[];
2375
+ signatureProfileRef?: string | null;
2376
+ replyToMessageRef?: string;
2377
+ }
2378
+ /** SDK 仅装配正式合同,不接受调用者声明 Tenant 身份、权限或冻结签名内容。 */
2379
+ export declare function mailClient(client: WorkClient): {
2380
+ signatures: (input?: {
2381
+ offset?: number;
2382
+ limit?: number;
2383
+ }) => Promise<MailSignaturePage>;
2384
+ signature: (signatureRef: string) => Promise<MailSignatureTemplate>;
2385
+ configureSignature: (input: MailSignatureInput) => Promise<ActionReceipt>;
2386
+ bindSignature: (input: {
2387
+ idempotencyKey: string;
2388
+ profileRef: string;
2389
+ expectedRevision: number;
2390
+ signatureRef: string | null;
2391
+ }) => Promise<ActionReceipt>;
2392
+ draft: ({ profileRef, ...input }: MailDraftInput & {
2393
+ profileRef: string;
2394
+ }) => Promise<ActionReceipt>;
2395
+ revise: (input: MailDraftInput & {
2396
+ expectedVersion: number;
2397
+ }) => Promise<ActionReceipt>;
2398
+ message: (engagementRef: string, messageRef: string) => Promise<EmailMessageProjection>;
2399
+ };
1603
2400
  export interface BrowserProfileAccountOwner {
1604
2401
  readonly profileRef: string;
1605
2402
  readonly platform: BrowserSocialPlatform;
@@ -1790,4 +2587,8 @@ export declare function createNativePublicLogin(serviceOrigin?: string, fetcher?
1790
2587
  /** Open the authorization page in the operating system browser; never pass a password. */
1791
2588
  export declare function openNativeLoginPage(address: string): Promise<void>;
1792
2589
 
2590
+ export {
2591
+ MessageAttachmentChoice as EmailAttachmentChoice,
2592
+ };
2593
+
1793
2594
  export {};