@gestaltrun/dsh-im-runtime 0.1.0 → 0.1.6
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.i18n.yaml +35 -20
- package/README.md +142 -10
- package/README.zh.md +141 -9
- package/lib/index.js +140 -2
- package/lib/inline-image-DuX6vSEI.js +20 -0
- package/lib/read-receipts.js +413 -0
- package/lib/read-state-CnUZKCuY.js +1868 -0
- package/lib/runtime-Bm6iSEpv.js +10939 -0
- package/lib/tools.js +1 -1
- package/lib/types/account-placement.d.ts +22 -0
- package/lib/types/admission-annotations.d.ts +40 -0
- package/lib/types/agent-coordinator.d.ts +47 -2
- package/lib/types/agent-media.d.ts +46 -0
- package/lib/types/agent-prompt.d.ts +8 -2
- package/lib/types/checkpoint-recovery.d.ts +32 -0
- package/lib/types/checkpoint.d.ts +127 -0
- package/lib/types/consumer-chat-links.d.ts +59 -0
- package/lib/types/delivery-schema.d.ts +126 -2
- package/lib/types/delivery-sqlite.d.ts +206 -6
- package/lib/types/delivery-types.d.ts +97 -1
- package/lib/types/delivery.d.ts +29 -6
- package/lib/types/errors.d.ts +1 -1
- package/lib/types/evaluation-accounts.d.ts +86 -0
- package/lib/types/index.d.ts +34 -2
- package/lib/types/inline-image.d.ts +7 -0
- package/lib/types/input-drain.d.ts +73 -0
- package/lib/types/knowledge-image.d.ts +64 -0
- package/lib/types/media-lifetime.d.ts +22 -0
- package/lib/types/media.d.ts +32 -0
- package/lib/types/message-preview.d.ts +4 -0
- package/lib/types/message-upload.d.ts +55 -0
- package/lib/types/nas-host-lease.d.ts +33 -0
- package/lib/types/placement-slice.d.ts +30 -0
- package/lib/types/policies.d.ts +10 -0
- package/lib/types/preset-model.d.ts +50 -0
- package/lib/types/read-context.d.ts +27 -0
- package/lib/types/read-receipts.d.ts +10 -0
- package/lib/types/read-records.d.ts +30 -0
- package/lib/types/read-state.d.ts +18 -0
- package/lib/types/read-types.d.ts +28 -0
- package/lib/types/restart-recovery.d.ts +38 -0
- package/lib/types/runtime.d.ts +318 -10
- package/lib/types/schema.d.ts +13 -2
- package/lib/types/script-clock.d.ts +14 -0
- package/lib/types/sdk.d.ts +108 -0
- package/lib/types/service-types.d.ts +161 -4
- package/lib/types/session-events.d.ts +9 -9
- package/lib/types/simulation-batch.d.ts +40 -0
- package/lib/types/simulation-controller.d.ts +16 -3
- package/lib/types/simulation-operator.d.ts +19 -0
- package/lib/types/sqlite-connection.d.ts +27 -0
- package/lib/types/time.d.ts +13 -0
- package/lib/types/transport.d.ts +44 -4
- package/lib/types/transports.d.ts +7 -0
- package/lib/types/types.d.ts +22 -5
- package/lib/types/typing.d.ts +33 -0
- package/lib/types/upload-types.d.ts +121 -0
- package/lib/types.js +2 -1
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +67 -41
- package/lib/runtime-C0-S-_CC.js +0 -6758
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ImAccountId, ImRevision, ImRouteId } from './types.ts';
|
|
3
|
+
/** Evaluation records reject credentials, SDK intent and enabled or foreign routes. */
|
|
4
|
+
export declare const imEvaluationAccountSchema: z.ZodObject<{
|
|
5
|
+
account: z.ZodObject<{
|
|
6
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImAccountId, string>>;
|
|
7
|
+
platform: z.ZodLiteral<"wangwang">;
|
|
8
|
+
displayName: z.ZodString;
|
|
9
|
+
identity: z.ZodObject<{
|
|
10
|
+
platform: z.ZodLiteral<"wangwang">;
|
|
11
|
+
merchantId: z.ZodString;
|
|
12
|
+
displayName: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
authorization: z.ZodObject<{
|
|
15
|
+
state: z.ZodLiteral<"unchecked">;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
connectionIntent: z.ZodLiteral<"disconnected">;
|
|
18
|
+
paused: z.ZodLiteral<false>;
|
|
19
|
+
revision: z.ZodPipe<z.ZodString, z.ZodTransform<ImRevision, string>>;
|
|
20
|
+
createdAt: z.ZodString;
|
|
21
|
+
updatedAt: z.ZodString;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
routeId: z.ZodPipe<z.ZodString, z.ZodTransform<ImRouteId, string>>;
|
|
24
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImRouteId, string>>;
|
|
26
|
+
platform: z.ZodLiteral<"wangwang">;
|
|
27
|
+
accountId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAccountId, string>>;
|
|
28
|
+
conversationKind: z.ZodLiteral<"direct">;
|
|
29
|
+
target: z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"all">;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@deepseek-ai/dsh-workspace/types").WorkspaceId, string>>;
|
|
33
|
+
enabled: z.ZodLiteral<false>;
|
|
34
|
+
agentPreset: z.ZodLiteral<"cs-hosting">;
|
|
35
|
+
controller: z.ZodLiteral<"cs-hosting">;
|
|
36
|
+
revision: z.ZodPipe<z.ZodString, z.ZodTransform<ImRevision, string>>;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
updatedAt: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
/** Persisted identity and fixed route id; cleanup removes only the active route. */
|
|
42
|
+
export type ImEvaluationAccountAggregate = z.infer<typeof imEvaluationAccountSchema>;
|
|
43
|
+
/** Separate version-one domain; invalid data disables evaluation without blocking formal IM. */
|
|
44
|
+
export declare const imEvaluationAccountsDomainSpec: {
|
|
45
|
+
name: string;
|
|
46
|
+
version: number;
|
|
47
|
+
tables: {
|
|
48
|
+
accounts: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<ImAccountId, {
|
|
49
|
+
account: {
|
|
50
|
+
id: ImAccountId;
|
|
51
|
+
platform: "wangwang";
|
|
52
|
+
displayName: string;
|
|
53
|
+
identity: {
|
|
54
|
+
platform: "wangwang";
|
|
55
|
+
merchantId: string;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
authorization: {
|
|
59
|
+
state: "unchecked";
|
|
60
|
+
};
|
|
61
|
+
connectionIntent: "disconnected";
|
|
62
|
+
paused: false;
|
|
63
|
+
revision: ImRevision;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
};
|
|
67
|
+
routeId: ImRouteId;
|
|
68
|
+
route?: {
|
|
69
|
+
id: ImRouteId;
|
|
70
|
+
platform: "wangwang";
|
|
71
|
+
accountId: ImAccountId;
|
|
72
|
+
conversationKind: "direct";
|
|
73
|
+
target: {
|
|
74
|
+
kind: "all";
|
|
75
|
+
};
|
|
76
|
+
workspaceId: import("@deepseek-ai/dsh-workspace/types").WorkspaceId;
|
|
77
|
+
enabled: false;
|
|
78
|
+
agentPreset: "cs-hosting";
|
|
79
|
+
controller: "cs-hosting";
|
|
80
|
+
revision: ImRevision;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
};
|
|
86
|
+
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,19 +1,51 @@
|
|
|
1
1
|
/** Product-owned IM Host runtime and transport registry. */
|
|
2
2
|
import './session-events.ts';
|
|
3
|
+
import './preset-model.ts';
|
|
3
4
|
export type * from './types.ts';
|
|
4
5
|
export type * from './transport.ts';
|
|
6
|
+
export type * from './sdk.ts';
|
|
7
|
+
export type * from './read-types.ts';
|
|
5
8
|
export type { ImRuntimeService } from './service-types.ts';
|
|
6
9
|
export { ImRuntimeError } from './errors.ts';
|
|
7
10
|
export type { ImRuntimeErrorCode } from './errors.ts';
|
|
8
11
|
export { imRuntimeDomainSpec } from './schema.ts';
|
|
9
12
|
export { encodeImProviderCursorId, encodeImScopeId } from './delivery.ts';
|
|
10
13
|
export { IM_DELIVERY_SCHEMA_VERSION, ImDeliverySqlite } from './delivery-sqlite.ts';
|
|
11
|
-
export { ImTransportError, ImTransports } from './transports.ts';
|
|
14
|
+
export { ImTransportError, ImTransportListenerError, ImTransports } from './transports.ts';
|
|
12
15
|
export type { ImTransportErrorCode } from './transports.ts';
|
|
13
16
|
export { ImRoutePolicies } from './policies.ts';
|
|
14
17
|
export type { ImPolicyCheckKind, ImPolicyCheckRequest, ImPolicyDecision, ImRoutePolicy } from './policies.ts';
|
|
15
18
|
export type { ImRouteControllerId } from './types.ts';
|
|
16
19
|
export { resolveRouteAgentPreset } from './route-resolve.ts';
|
|
17
20
|
export { ImRuntime, ImRuntime as default } from './runtime.ts';
|
|
21
|
+
export type { ImRuntime as ImRuntimeType } from './runtime.ts';
|
|
22
|
+
export { bindKnowledgeImageResolver, hasKnowledgeImageResolver, resolveKnowledgeImage, imageMime } from './knowledge-image.ts';
|
|
23
|
+
export type { KnowledgeImageFailureCode, KnowledgeImageResolution, KnowledgeImageResolver, ResolvedKnowledgeImage } from './knowledge-image.ts';
|
|
18
24
|
export type { Config as ImRuntimeConfig } from './runtime.ts';
|
|
19
|
-
export
|
|
25
|
+
export { checkpointFailureDiagnostic } from './checkpoint.ts';
|
|
26
|
+
export type { ImCheckpointFacts, ImCheckpointReportResult, ImCheckpointTransport, ImCheckpointDiagnostic } from './checkpoint.ts';
|
|
27
|
+
export type { ImHandlingPausedEvent, ImMessageReadEvent } from './session-events.ts';
|
|
28
|
+
export { NasHostLease } from './nas-host-lease.ts';
|
|
29
|
+
export type { SqliteJournalMode } from './nas-host-lease.ts';
|
|
30
|
+
export type { ImInputPause } from './input-drain.ts';
|
|
31
|
+
export type { ImUploadTarget, ImUploadMessage, ImUploadResult, ImUploadTransport, ImUploadBinding, ImUploadIdentity, ImUploadConversationEvent } from './upload-types.ts';
|
|
32
|
+
export { parseImDeliveryAccountSlice, ImPlacementSliceError } from './placement-slice.ts';
|
|
33
|
+
export type { ImDeliveryAccountSlice } from './placement-slice.ts';
|
|
34
|
+
export { ImInputPauseError } from './input-drain.ts';
|
|
35
|
+
export { parseImAccountPlacementSlice, ImPlacementStateError } from './account-placement.ts';
|
|
36
|
+
export type { ImAccountPlacementSlice } from './account-placement.ts';
|
|
37
|
+
export { ImConsumerChatLinks, ImConsumerChatLinkError } from './consumer-chat-links.ts';
|
|
38
|
+
export type { ImConsumerChatLinkQuery, ImConsumerChatLinkResolution, ImConsumerChatLinkProvider, ImConsumerChatLinkErrorCode } from './consumer-chat-links.ts';
|
|
39
|
+
export { formatImTime } from './time.ts';
|
|
40
|
+
export { formatInbound } from './agent-prompt.ts';
|
|
41
|
+
export type { ImClockSource } from './time.ts';
|
|
42
|
+
export type { ImAdmissionAnnotator, ImAdmissionAnnotationInput } from './admission-annotations.ts';
|
|
43
|
+
export { ImScriptClock } from './script-clock.ts';
|
|
44
|
+
export { ImSimulationBatch } from './simulation-batch.ts';
|
|
45
|
+
export type { ImSimulationBatchConfig, ImSimulationBatchJob, ImSimulationBatchResult } from './simulation-batch.ts';
|
|
46
|
+
export type { ImInjectSimulationOperatorRequest, ImSimulationOperatorReceipt } from './simulation-operator.ts';
|
|
47
|
+
export { ImCheckpointRecoveryError } from './checkpoint-recovery.ts';
|
|
48
|
+
export type { ImAccountCheckpointRecovery } from './checkpoint-recovery.ts';
|
|
49
|
+
export { resolveSqliteConnectionSpec, configureSqliteConnection } from './sqlite-connection.ts';
|
|
50
|
+
export type { SqliteLockingMode, SqliteConnectionConfig, SqliteConnectionSpec } from './sqlite-connection.ts';
|
|
51
|
+
export { buyerUid, senderUid } from './read-state.ts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Recognize inline IM raster images without treating their encoded bytes as message text. */
|
|
2
|
+
import type { EncodedImageAttachment } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import type { ImMessageContent } from './delivery-types.ts';
|
|
4
|
+
/** @param content - stored provider presentation, including older text-classified images. @returns an encoded raster image for attachment admission, or undefined for ordinary messages and placeholders. */
|
|
5
|
+
export declare function inlineImImage(content: ImMessageContent): EncodedImageAttachment | undefined;
|
|
6
|
+
/** @param content - stored message presentation. @returns text for text-only consumers, replacing inline raster bytes with an image label. */
|
|
7
|
+
export declare function imMessageText(content: ImMessageContent): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** Host 内存中的输入排空;暂停不写游标,不取消已准入的 turn。 */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
4
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
5
|
+
/** 一次暂停的所有者;等待到期后由调用者决定保留暂停或恢复。 */
|
|
6
|
+
export interface ImInputPause {
|
|
7
|
+
/** @param signal - 等待预算与调用者寿命。 @returns 已接收页面、准入驱动及 turn 全部结束。 */
|
|
8
|
+
drained(signal: AbortSignal): Promise<void>;
|
|
9
|
+
/** @param listener - 立即及数量变化时接收按 Session 去重的在途 turn 与回复准入预约数,不含维护 activity 或页面接收。 @returns 取消观察;缺省表示旧 Provider 不支持计数。 */
|
|
10
|
+
observeReplies?(listener: (remaining: number) => void): () => void;
|
|
11
|
+
/** 幂等地撤销本次暂停;最后一个所有者释放后重新接收。 */
|
|
12
|
+
resume(): void;
|
|
13
|
+
}
|
|
14
|
+
/** Host 升级与账号交接不能并发持有同一 Agent 的 maintenance 暂停。 */
|
|
15
|
+
export declare class ImInputPauseError extends Error {
|
|
16
|
+
/** 另一个维护所有者占用输入暂停。 */
|
|
17
|
+
readonly code = "IM_INPUT_PAUSE_CONFLICT";
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
20
|
+
/** IM 接收、Agent 准入和 Host turn 共用的排空计数。 */
|
|
21
|
+
export declare class ImInputDrain {
|
|
22
|
+
private readonly accepts;
|
|
23
|
+
/** @param accepts - 本计数器管理的 Agent;缺省覆盖整个 Host,账号交接使用已确认的 Session 归属。 */
|
|
24
|
+
constructor(accepts?: (agent: Agent) => boolean);
|
|
25
|
+
private readonly replyObservers;
|
|
26
|
+
private readonly contexts;
|
|
27
|
+
private readonly joining;
|
|
28
|
+
private readonly parked;
|
|
29
|
+
private failure;
|
|
30
|
+
private holds;
|
|
31
|
+
private busy;
|
|
32
|
+
private changed;
|
|
33
|
+
private readonly lifetime;
|
|
34
|
+
private reception;
|
|
35
|
+
private readonly turns;
|
|
36
|
+
private readonly reservations;
|
|
37
|
+
/** 当前是否禁止新的页面和准入。 */
|
|
38
|
+
get paused(): boolean;
|
|
39
|
+
/** @param ctx - Agent 生命周期及 Session 持久化服务。 @returns 在关闭 Agent 前释放并等待本作用域的 maintenance 预约。 */
|
|
40
|
+
mount(ctx: Context): () => Promise<void>;
|
|
41
|
+
/** @param sessionId - 已准入输入的 Session。 @returns 输入提交失败时释放首个 step 的预约计数。 */
|
|
42
|
+
reserve(sessionId: SessionId): () => void;
|
|
43
|
+
private reserveSession;
|
|
44
|
+
/** @returns 同步关闭新输入后的暂停所有权。 */
|
|
45
|
+
pause(): ImInputPause;
|
|
46
|
+
/** @returns 未暂停时取得工作计数,否则调用者保留待处理数据。 */
|
|
47
|
+
tryEnter(): (() => void) | undefined;
|
|
48
|
+
/** @returns 页面接收的工作计数;暂停期间等待,卸载时拒绝且不提交游标。 */
|
|
49
|
+
receive(): Promise<() => void>;
|
|
50
|
+
/**
|
|
51
|
+
* 等两个计数器都允许接收后同步取得两份工作计数,等待期间不占用任一排空计数。
|
|
52
|
+
* @param other - Host 或账号的另一个计数器;任一卸载均取消等待。
|
|
53
|
+
* @param cancellation - 提供时取消尚未接收的页面;缺省仅由页面停止或计数器卸载取消,不提交游标。
|
|
54
|
+
* @returns 两份计数的幂等释放函数。
|
|
55
|
+
*/
|
|
56
|
+
receiveWith(other: ImInputDrain, cancellation?: AbortSignal): Promise<() => void>;
|
|
57
|
+
/** 停止页面接收且不恢复已拒绝页面;保留 Agent 输入暂停与维护预约,已准入页面仍可完成。 */
|
|
58
|
+
stopReceiving(): void;
|
|
59
|
+
/** Reopen pages only while input remains paused after an authenticated placement import begins. */
|
|
60
|
+
preparePlacementReception(): void;
|
|
61
|
+
/** 停止所有等待;在 runtime 拆卸时调用。 */
|
|
62
|
+
dispose(): void;
|
|
63
|
+
/** 空闲 Agent 的 maintenance 预约发生在 Inbox claim 前,保持新输入仍在持久化队列中。 */
|
|
64
|
+
private park;
|
|
65
|
+
/** 完整等待已准入的 activity,随后先预约空闲状态,再允许排空完成。 */
|
|
66
|
+
private joinActivity;
|
|
67
|
+
private repark;
|
|
68
|
+
private recordFailure;
|
|
69
|
+
private enter;
|
|
70
|
+
private waitOpen;
|
|
71
|
+
private waitChange;
|
|
72
|
+
private publish;
|
|
73
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Why a knowledge image was not turned into an attachment. */
|
|
2
|
+
export type KnowledgeImageFailureCode = 'not-in-session' | 'shop-mismatch' | 'reference-stale' | 'source-unavailable' | 'forbidden' | 'deleted' | 'invalid-image' | 'too-large' | 'timeout';
|
|
3
|
+
/** One resolved knowledge image, already limited to an allowed bitmap. */
|
|
4
|
+
export interface ResolvedKnowledgeImage {
|
|
5
|
+
/** Image bytes. */
|
|
6
|
+
readonly bytes: Uint8Array;
|
|
7
|
+
/** MIME type derived from the bitmap header. */
|
|
8
|
+
readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp';
|
|
9
|
+
/** Display name stored with the attachment. */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Reference id and content hash recorded with the send. */
|
|
12
|
+
readonly sourceMetadata: {
|
|
13
|
+
readonly referenceId: string;
|
|
14
|
+
readonly sha256: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Result of resolving one `knowledge-image` reference in the current shop and session. */
|
|
18
|
+
export type KnowledgeImageResolution = {
|
|
19
|
+
readonly ok: true;
|
|
20
|
+
readonly value: ResolvedKnowledgeImage;
|
|
21
|
+
} | {
|
|
22
|
+
readonly ok: false;
|
|
23
|
+
readonly code: KnowledgeImageFailureCode;
|
|
24
|
+
};
|
|
25
|
+
/** Reads one reference from the calling session and the current shop. */
|
|
26
|
+
export interface KnowledgeImageResolver {
|
|
27
|
+
/**
|
|
28
|
+
* @param request - reference, session, and cancellation.
|
|
29
|
+
* @returns image bytes, or a stable failure code. Nothing is sent on failure.
|
|
30
|
+
*/
|
|
31
|
+
resolve(request: {
|
|
32
|
+
readonly referenceId: string;
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
readonly signal: AbortSignal;
|
|
35
|
+
}): Promise<KnowledgeImageResolution>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Register the knowledge plugin's resolver on one IM runtime.
|
|
39
|
+
* A proxy and the raw instance share this symbol, so a later `im_send_message` sees the same resolver.
|
|
40
|
+
* @param runtime - runtime that owns `im_send_message` for this Host.
|
|
41
|
+
* @param resolver - current-shop image reader.
|
|
42
|
+
* @returns a disposer that removes this resolver only.
|
|
43
|
+
*/
|
|
44
|
+
export declare function bindKnowledgeImageResolver(runtime: object, resolver: KnowledgeImageResolver): () => void;
|
|
45
|
+
/**
|
|
46
|
+
* @param runtime - IM runtime handling the send. May be the service instance or its context proxy.
|
|
47
|
+
* @returns whether knowledge images can be resolved on this runtime.
|
|
48
|
+
*/
|
|
49
|
+
export declare function hasKnowledgeImageResolver(runtime: object): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @param runtime - IM runtime handling the send.
|
|
52
|
+
* @param request - reference to resolve.
|
|
53
|
+
* @returns the resolver's result, or `source-unavailable` when knowledge did not register one.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveKnowledgeImage(runtime: object, request: {
|
|
56
|
+
readonly referenceId: string;
|
|
57
|
+
readonly sessionId: string;
|
|
58
|
+
readonly signal: AbortSignal;
|
|
59
|
+
}): Promise<KnowledgeImageResolution>;
|
|
60
|
+
/**
|
|
61
|
+
* @param bytes - file bytes to classify.
|
|
62
|
+
* @returns the bitmap MIME type, or undefined for HTML, SVG, and any other payload.
|
|
63
|
+
*/
|
|
64
|
+
export declare function imageMime(bytes: Uint8Array): ResolvedKnowledgeImage['mime'] | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** One owner retains accepted sends and exact consumer disposal tasks until storage can close. */
|
|
2
|
+
export declare class ImMediaLifetime {
|
|
3
|
+
private readonly cancellation;
|
|
4
|
+
private readonly pending;
|
|
5
|
+
private readonly consumers;
|
|
6
|
+
private readonly resources;
|
|
7
|
+
private closing;
|
|
8
|
+
private disposal;
|
|
9
|
+
/** @param operation - resource initialization or complete send through its final durable write and publication. @param signal - caller cancellation. @returns the admitted result; new sends are rejected once teardown starts. */
|
|
10
|
+
run<T>(operation: (signal: AbortSignal) => Promise<T>, signal: AbortSignal): Promise<T>;
|
|
11
|
+
/** @param stop - consumer cleanup that may also be invoked by its own fiber. @returns the exact idempotent disposer whose completion this owner retains. */
|
|
12
|
+
stopWith(stop: () => void | Promise<void>): () => Promise<void>;
|
|
13
|
+
/** @param domain - caller-owned domain whose facility may request fallback closure during root unload. Configuration reads remain available until admitted media completes. */
|
|
14
|
+
ownDomain(domain: {
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}): void;
|
|
17
|
+
/** @param close - acquired resource closer, invoked in reverse acquisition order after consumers finish. */
|
|
18
|
+
closeWith(close: () => void | Promise<void>): void;
|
|
19
|
+
/** Reject new sends, cancel preparation, join accepted operations and consumers, then release storage even after cleanup failures. */
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
private drain;
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ImDeliverySqlite } from './delivery-sqlite.ts';
|
|
2
|
+
import { type ImDeliveryStore } from './delivery.ts';
|
|
3
|
+
import type { ImRuntime } from './runtime.ts';
|
|
4
|
+
import type { ImMediaInput, ImMessageContent, ImOutboundView, ImSendMediaMessageRequest } from './delivery-types.ts';
|
|
5
|
+
/** @param input - bytes crossing a wire or Host tool interface. @param maxBytes - configured per-file limit. @returns stable display content without bytes, credentials or upload authorization. */
|
|
6
|
+
export declare function mediaContent(input: ImMediaInput, maxBytes: number): Extract<ImMessageContent, {
|
|
7
|
+
format: 'media';
|
|
8
|
+
}>;
|
|
9
|
+
/** One runtime owns all in-flight media work and joins it before releasing its database. */
|
|
10
|
+
export declare class ImMediaSender {
|
|
11
|
+
private readonly runtime;
|
|
12
|
+
private readonly records;
|
|
13
|
+
private readonly delivery;
|
|
14
|
+
private readonly owner;
|
|
15
|
+
private readonly work;
|
|
16
|
+
private readonly lifetime;
|
|
17
|
+
private readonly receipts;
|
|
18
|
+
private readonly providers;
|
|
19
|
+
/** @param runtime - authoritative outbox and authorization owner. @param records - private staging store. @param delivery - serialized outbox mutations and publications. */
|
|
20
|
+
constructor(runtime: ImRuntime, records: ImDeliverySqlite, delivery: ImDeliveryStore);
|
|
21
|
+
/** @param request - registered, scope-verified intent and private original bytes. @param signal - operation cancellation. @returns the settled or uncertain outbox record; repeated ids join rather than resubmit. */
|
|
22
|
+
send(request: ImSendMediaMessageRequest, signal: AbortSignal): Promise<ImOutboundView>;
|
|
23
|
+
/** @param request - scope-checked durable file intent. @returns a fresh download URL; the signed location is never stored as a permanent reference. */
|
|
24
|
+
download(request: import('./delivery-types.ts').ImGetOutboundRequest): Promise<string>;
|
|
25
|
+
/** Stop preparation and join all owned sends before releasing durable storage. */
|
|
26
|
+
dispose(): Promise<void>;
|
|
27
|
+
/** Observe registered SDK receipts after startup without initiating an upload or a send. */
|
|
28
|
+
followTransport(): void;
|
|
29
|
+
private followReceipts;
|
|
30
|
+
private consumeReceipt;
|
|
31
|
+
private dispatch;
|
|
32
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Compact customer-list text derived from stored IM content. */
|
|
2
|
+
import type { ImMessageContent } from './delivery-types.ts';
|
|
3
|
+
/** @param content - canonical message content, retained unchanged. @returns history-compatible image or unsupported labels, with embedded Base64 image data replaced inside ordinary text. */
|
|
4
|
+
export declare function imMessagePreview(content: ImMessageContent): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ImUploadObservation, ImUploadResult, ImUploadTransport } from './upload-types.ts';
|
|
2
|
+
import type { ImAccountId } from './types.ts';
|
|
3
|
+
import type { ImDeliveryScope } from './delivery-types.ts';
|
|
4
|
+
/** Retains the operation failure as cause and every failed close/unlink in errors. */
|
|
5
|
+
export declare class ImUploadQueueCleanupError extends AggregateError {
|
|
6
|
+
readonly cleanup: readonly unknown[];
|
|
7
|
+
readonly name = "ImUploadQueueCleanupError";
|
|
8
|
+
readonly operationCode: string;
|
|
9
|
+
readonly cleanupCodes: readonly string[];
|
|
10
|
+
/** @param primary - failed write, sync, close, rename, or startup removal. @param cleanup - additional failures while releasing owned resources. */
|
|
11
|
+
constructor(primary: unknown, cleanup: readonly unknown[]);
|
|
12
|
+
}
|
|
13
|
+
/** Retry-safe queue; append and acknowledgement each replace a fully synced file. */
|
|
14
|
+
export declare class ImMessageUploadQueue {
|
|
15
|
+
private readonly path;
|
|
16
|
+
private readonly send;
|
|
17
|
+
private readonly canSend;
|
|
18
|
+
private entries;
|
|
19
|
+
private rejected;
|
|
20
|
+
private readonly writer;
|
|
21
|
+
private readonly lifetime;
|
|
22
|
+
private closing;
|
|
23
|
+
private tail;
|
|
24
|
+
lastResult: ImUploadResult | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Hold an exclusive writer lease until close(); remove only this queue's UUID-named crash temporaries after acquisition. A competing writer fails before cleanup. The lock file is never unlinked.
|
|
27
|
+
* @param path - private queue file, separate from runtime SQLite.
|
|
28
|
+
* @param send - authenticated, cancellable server transport.
|
|
29
|
+
* @param canSend - current account placement admission; defaults to allowing every scope.
|
|
30
|
+
* @throws {Error} When writer ownership is unavailable or an existing queue cannot be read or parsed; callers must retain the SQLite journal and retry without replacing the file.
|
|
31
|
+
*/
|
|
32
|
+
constructor(path: string, send: ImUploadTransport, canSend?: (scope: ImDeliveryScope) => boolean);
|
|
33
|
+
/** Includes observations waiting for a provider message id. */
|
|
34
|
+
get pendingCount(): number;
|
|
35
|
+
/** Persistently rejected observations are retained and excluded from automatic submission. */
|
|
36
|
+
get rejections(): readonly {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly reason: string;
|
|
39
|
+
}[];
|
|
40
|
+
/** @param accountId - account included in a placement copy. @returns unacknowledged immutable observations; source copies remain retryable. */
|
|
41
|
+
pendingForAccount(accountId: ImAccountId): readonly ImUploadObservation[];
|
|
42
|
+
/**
|
|
43
|
+
* @param observations - immutable SQLite transfer journal entries; repeated ids are ignored.
|
|
44
|
+
* @throws {Error} On storage failure; the caller retains its journal until a later successful append.
|
|
45
|
+
*/
|
|
46
|
+
append(observations: readonly ImUploadObservation[]): void;
|
|
47
|
+
/** @param signal - owning worker lifetime. @returns completion of one serialized pass; retry outcomes retain the original rows. */
|
|
48
|
+
flush(signal: AbortSignal): Promise<void>;
|
|
49
|
+
/** @returns completion after owned requests stop and the writer lease is released; later append/flush calls are rejected. */
|
|
50
|
+
close(): Promise<void>;
|
|
51
|
+
private assertOpen;
|
|
52
|
+
private cleanInterruptedWrites;
|
|
53
|
+
private flushOnce;
|
|
54
|
+
private persist;
|
|
55
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ImAccountId } from './types.ts';
|
|
2
|
+
import { Service, type Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** SQLite 部署日志模式;NAS 使用 DELETE,本地缺省使用 WAL。 */
|
|
4
|
+
export type SqliteJournalMode = 'WAL' | 'DELETE';
|
|
5
|
+
/** 云端 Host 准入及同步写入隔离;租约失效后同一实例不得重新准入。 */
|
|
6
|
+
export declare abstract class NasHostLease extends Service {
|
|
7
|
+
/** @param ctx - Host 的 Cordis 上下文。 */
|
|
8
|
+
constructor(ctx: Context);
|
|
9
|
+
private readonly databases;
|
|
10
|
+
/** @param path - 数据库绝对路径。 @returns 关闭连接后释放占用;同一 Host 不能重复打开。 */
|
|
11
|
+
reserveDatabase(path: string): () => void;
|
|
12
|
+
/** 此云端 Host 独占的 IM 账号。 */
|
|
13
|
+
abstract readonly accountId: ImAccountId;
|
|
14
|
+
/** 等待可信旧实例退出确认,并 CAS 取得新代次或续约控制面已提交的本次交接代次;失败时拒绝。 */
|
|
15
|
+
abstract readonly ready: Promise<void>;
|
|
16
|
+
/** 当前 Host 已准入的代次,未准入时拒绝访问。 */
|
|
17
|
+
abstract get epoch(): number;
|
|
18
|
+
/** 检查本地期限;过期时先隔离写入并请求停止 Host,然后抛出错误。 */
|
|
19
|
+
abstract assertActive(): void;
|
|
20
|
+
/** @param close - 失效时同步关闭资源,不进行业务写入。 @returns 撤销关闭回调的函数。 */
|
|
21
|
+
abstract onFence(close: () => void): () => void;
|
|
22
|
+
/** @returns 当前已准入租约的商家成员与云端沙箱,供客户数据写入构造租约证明;未准入、已失效或实现不提供时为 undefined。 */
|
|
23
|
+
holderIdentity(): {
|
|
24
|
+
readonly userId: string;
|
|
25
|
+
readonly sandboxId: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}
|
|
28
|
+
declare module '@deepseek-ai/cordis' {
|
|
29
|
+
interface Context {
|
|
30
|
+
/** 云端 NAS 单写者租约;本地配置不依赖此服务。 */
|
|
31
|
+
nasHostLease: NasHostLease;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ImDeliveryAggregate, ImExecutionAggregate, ImProviderCursorAggregate } from './delivery-schema.ts';
|
|
2
|
+
import type { ImCustomerReaderId, ImHandlingControl, ImScopeId } from './delivery-types.ts';
|
|
3
|
+
import type { ImAccountId } from './types.ts';
|
|
4
|
+
/** 一个真实账号的全部投递事实;交接编排负责排空、epoch 授权和独占目标。 */
|
|
5
|
+
export interface ImDeliveryAccountSlice {
|
|
6
|
+
readonly version: 1;
|
|
7
|
+
readonly accountId: ImAccountId;
|
|
8
|
+
readonly scopes: readonly ImDeliveryAggregate[];
|
|
9
|
+
readonly executions: readonly ImExecutionAggregate[];
|
|
10
|
+
readonly cursors: readonly ImProviderCursorAggregate[];
|
|
11
|
+
readonly nativeActors: readonly string[];
|
|
12
|
+
readonly reads: readonly {
|
|
13
|
+
readonly scopeId: ImScopeId;
|
|
14
|
+
readonly readerId: ImCustomerReaderId;
|
|
15
|
+
readonly sequence: number;
|
|
16
|
+
}[];
|
|
17
|
+
readonly handling: readonly ImHandlingControl[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 校验真实会话记录、游标和任务之间的账号归属。
|
|
21
|
+
* @param value - 已限制正文大小、经过交接鉴权的网络或暂存 JSON。
|
|
22
|
+
* @returns 仅包含声明账号真实会话的切片;无效输入的错误不携带正文,调用者保持接待停止。
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseImDeliveryAccountSlice(value: unknown): ImDeliveryAccountSlice;
|
|
25
|
+
/** 切片导入失败;不携带消息、游标或凭据。 */
|
|
26
|
+
export declare class ImPlacementSliceError extends Error {
|
|
27
|
+
readonly code: 'IM_PLACEMENT_SLICE_INVALID' | 'IM_PLACEMENT_SLICE_CONFLICT';
|
|
28
|
+
/** @param code - 解析或目标数据冲突的稳定失败代码。 */
|
|
29
|
+
constructor(code: 'IM_PLACEMENT_SLICE_INVALID' | 'IM_PLACEMENT_SLICE_CONFLICT');
|
|
30
|
+
}
|
package/lib/types/policies.d.ts
CHANGED
|
@@ -25,8 +25,18 @@ export type ImPolicyDecision = {
|
|
|
25
25
|
/** Product Provider that owns one controller identity. */
|
|
26
26
|
export interface ImRoutePolicy {
|
|
27
27
|
check(request: ImPolicyCheckRequest): ImPolicyDecision | Promise<ImPolicyDecision>;
|
|
28
|
+
/** @param listener - 准入条件变化通知。 @returns 撤销本订阅。 */
|
|
29
|
+
subscribe?(listener: () => void): () => void;
|
|
28
30
|
}
|
|
29
31
|
declare module '@deepseek-ai/cordis' {
|
|
32
|
+
interface Events {
|
|
33
|
+
/**
|
|
34
|
+
* 控制器注册或准入状态变化;等待恢复的 Session 可以重新核对。
|
|
35
|
+
* @param controller - 发生变化的托管控制器。
|
|
36
|
+
* @mode emit
|
|
37
|
+
*/
|
|
38
|
+
'imRoutePolicies/changed'(controller: ImRouteControllerId): void;
|
|
39
|
+
}
|
|
30
40
|
interface Context {
|
|
31
41
|
/** IM admission and automated-send policies keyed by route controller. */
|
|
32
42
|
imRoutePolicies: ImRoutePolicies;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Optional pin that keeps one IM preset on a Host-owned model route. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** Preset id whose model must be the shop cloud route. Matches the cs-hosting preset. */
|
|
4
|
+
export declare const SHOP_CLOUD_PRESET_ID = "cs-hosting";
|
|
5
|
+
/** A pinned preset's model, or why the call must wait. No key and no message body. */
|
|
6
|
+
export type ImPresetModelDecision = {
|
|
7
|
+
readonly kind: 'ready';
|
|
8
|
+
readonly provider: string;
|
|
9
|
+
readonly model: string;
|
|
10
|
+
readonly models: readonly string[];
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'blocked';
|
|
13
|
+
readonly code: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Host gate for presets that must not use the member's own model.
|
|
17
|
+
* `warm` resolves the route before IM submits a batch. A blocked decision leaves that batch pending.
|
|
18
|
+
*/
|
|
19
|
+
export interface ImPresetModelGate {
|
|
20
|
+
/** @param presetId - agent preset about to run. */
|
|
21
|
+
pins(presetId: string): boolean;
|
|
22
|
+
/** @param signal - cancels the admission read. */
|
|
23
|
+
warm(signal?: AbortSignal): Promise<ImPresetModelDecision>;
|
|
24
|
+
/** @param listener - runs when the admission changes. @returns its disposer. */
|
|
25
|
+
subscribe(listener: () => void): () => void;
|
|
26
|
+
}
|
|
27
|
+
declare module '@deepseek-ai/cordis' {
|
|
28
|
+
interface Context {
|
|
29
|
+
/** Present when a product preset pins its model. Absent presets keep the member default. */
|
|
30
|
+
imPresetModelGate?: ImPresetModelGate;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Model options for one new or resumed IM agent. */
|
|
34
|
+
export type PresetAgentSelection = {
|
|
35
|
+
readonly kind: 'default';
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'pinned';
|
|
38
|
+
readonly provider: string;
|
|
39
|
+
readonly model: string;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'hold';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Resolve agent options for a preset.
|
|
45
|
+
* The shop-cloud preset fails when the gate is missing, and holds when the gate is blocked.
|
|
46
|
+
* @param ctx - Host context.
|
|
47
|
+
* @param presetId - recorded route preset.
|
|
48
|
+
* @param signal - cancels a pinned read.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolvePresetAgentOptions(ctx: Context, presetId: string, signal?: AbortSignal): Promise<PresetAgentSelection>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Durable buyer-read facts become context at the next accepted model step. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { type UserMessage } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import type { Session } from '@deepseek-ai/dsh-session';
|
|
5
|
+
import type { KvTable } from '@deepseek-ai/dsh-storage-domain';
|
|
6
|
+
import type { ImRealDeliveryScope, ImScopeId, ImOutboundRequestId } from './delivery-types.ts';
|
|
7
|
+
import type { ImReadAssociation, ImReadRecord } from './read-records.ts';
|
|
8
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
9
|
+
interface MessageSourceMap {
|
|
10
|
+
/** Receipt attribution preserves its JSON metadata for readers without this projection.
|
|
11
|
+
* @persistenceAttribution
|
|
12
|
+
*/
|
|
13
|
+
'im-read': {
|
|
14
|
+
readonly kind: 'im-read';
|
|
15
|
+
readonly scopeId: ImScopeId;
|
|
16
|
+
readonly requestId: ImOutboundRequestId;
|
|
17
|
+
readonly form: 'notice';
|
|
18
|
+
readonly summary: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** @param ctx - optional live Agent and persistence services. @param scope - verified outbound scope. @param row - confirmed buyer evidence. @returns after a live Session fact is durable; absent Agents receive it at their next pre-step. */
|
|
23
|
+
export declare function recordLiveRead(ctx: Context, scope: ImRealDeliveryScope, row: ImReadAssociation): Promise<void>;
|
|
24
|
+
/** @param session - recorded facts and previously admitted contexts. @param proposed - contexts already proposed for this step. @returns each previously unannounced read once; source facts reconstruct the notification after a restart. */
|
|
25
|
+
export declare function readContextMessages(session: Session, proposed?: readonly UserMessage[]): readonly UserMessage[];
|
|
26
|
+
/** @param ctx - registration owner. @param table - independent durable read evidence. @returns exact child disposer, joined before the table closes. Context reconstruction does not wake idle Agents. */
|
|
27
|
+
export declare function installReadContext(ctx: Context, table: KvTable<ImScopeId, ImReadRecord>): () => Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Single-chat read synchronization after durable, exact-identity correlation. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
/** Bounded admission for SDK messages waiting for their OpenAPI durable counterparts. */
|
|
4
|
+
export interface Config {
|
|
5
|
+
readonly pendingMessageLimit?: number;
|
|
6
|
+
}
|
|
7
|
+
/** Host services required before opening independent read storage. */
|
|
8
|
+
export declare const inject: string[];
|
|
9
|
+
/** @param ctx - durable runtime and storage owner. @param config - bounded unmatched-message admission. @returns after the read domain and optional SDK consumers are installed. */
|
|
10
|
+
export declare function apply(ctx: Context, config?: Config): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
2
|
+
import type { ImOutboundRequestId, ImRealDeliveryScope, ImScopeId } from './delivery-types.ts';
|
|
3
|
+
import type { ImBuyerReadState } from './read-state.ts';
|
|
4
|
+
/** Exact platform association and monotonically confirmed buyer state. */
|
|
5
|
+
export interface ImReadAssociation {
|
|
6
|
+
readonly requestId: ImOutboundRequestId;
|
|
7
|
+
readonly platformMessageId: string;
|
|
8
|
+
readonly sdkConversationId: string;
|
|
9
|
+
readonly buyerUid: string;
|
|
10
|
+
readonly singleton: boolean;
|
|
11
|
+
readonly queried: boolean;
|
|
12
|
+
readonly state: ImBuyerReadState;
|
|
13
|
+
readonly observedAt: string;
|
|
14
|
+
readonly sessionId?: SessionId;
|
|
15
|
+
}
|
|
16
|
+
/** One independently versioned conversation read record. */
|
|
17
|
+
export interface ImReadRecord {
|
|
18
|
+
readonly schema: 'gestaltrun.im-reads.v1';
|
|
19
|
+
readonly scope: ImRealDeliveryScope;
|
|
20
|
+
readonly reported: Readonly<Record<string, true>>;
|
|
21
|
+
readonly outbounds: Readonly<Record<string, ImReadAssociation>>;
|
|
22
|
+
}
|
|
23
|
+
/** Product-owned read records; opening older IM configuration requires no migration. */
|
|
24
|
+
export declare const imReadsDomainSpec: {
|
|
25
|
+
name: string;
|
|
26
|
+
version: number;
|
|
27
|
+
tables: {
|
|
28
|
+
scopes: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<ImScopeId, ImReadRecord>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ImDirectRecipient } from './types.ts';
|
|
2
|
+
/** Consumer-read evidence; absence or ambiguity remains unknown. */
|
|
3
|
+
export type ImBuyerReadState = 'unknown' | 'unread' | 'read';
|
|
4
|
+
/** @param buyer - verified direct recipient. @returns its SDK user id when present, otherwise the platform actor id. */
|
|
5
|
+
export declare function buyerUid(buyer: ImDirectRecipient): string;
|
|
6
|
+
/** @param sender - SDK sender string or object; absent receipt senders remain absent. @returns the supplied sender UID, or absence. */
|
|
7
|
+
export declare function senderUid(sender: string | {
|
|
8
|
+
readonly uid: string;
|
|
9
|
+
} | undefined): string | undefined;
|
|
10
|
+
/** @param uid - SDK identity. @param buyer - verified OpenAPI buyer UID. @returns whether domain-qualified or unqualified SDK identity names this buyer. */
|
|
11
|
+
export declare function sameBuyer(uid: string, buyer: string): boolean;
|
|
12
|
+
/** @param data - raw 40103 counts. @param singleton - independently verified receiver set consists solely of the target buyer. @returns conservative buyer state. */
|
|
13
|
+
export declare function buyerReadState(data: Readonly<Record<string, unknown>>, singleton: boolean): ImBuyerReadState;
|
|
14
|
+
/** @param data - ListMessageReadStatus response body. @param buyer - independently verified buyer UID. @returns matched status and whether the response establishes a singleton receiver set. */
|
|
15
|
+
export declare function buyerReadQuery(data: unknown, buyer: string): {
|
|
16
|
+
readonly state: ImBuyerReadState;
|
|
17
|
+
readonly singleton: boolean;
|
|
18
|
+
};
|