@gestaltrun/dsh-im-runtime 0.1.0 → 0.1.5
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
package/lib/tools.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as registerSimulationTools, i as registerImAgentTools } from "./runtime-Bm6iSEpv.js";
|
|
2
2
|
export { registerImAgentTools, registerSimulationTools };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WorkspaceId } from '@deepseek-ai/dsh-workspace';
|
|
2
|
+
import { type ImAccountAggregate } from './schema.ts';
|
|
3
|
+
import { type ImDeliveryAccountSlice } from './placement-slice.ts';
|
|
4
|
+
/** 当前账号在客服内置 Workspace 的传输事实;credentialKey 只引用本端 Credentials。 */
|
|
5
|
+
export interface ImAccountPlacementSlice {
|
|
6
|
+
readonly version: 1;
|
|
7
|
+
readonly workspaceId: WorkspaceId;
|
|
8
|
+
readonly account: ImAccountAggregate;
|
|
9
|
+
readonly delivery: ImDeliveryAccountSlice;
|
|
10
|
+
}
|
|
11
|
+
/** 交接状态或来源归属不满足时拒绝,调用者保留停止状态。 */
|
|
12
|
+
export declare class ImPlacementStateError extends Error {
|
|
13
|
+
readonly code: 'IM_PLACEMENT_ALREADY_STOPPED' | 'IM_PLACEMENT_SCOPE_INVALID' | 'IM_PLACEMENT_NOT_PAUSED' | 'IM_PLACEMENT_STOP_UNKNOWN' | 'IM_PLACEMENT_STANDBY_REQUIRED';
|
|
14
|
+
/** @param code - 不携带账号正文或底层响应的稳定代码。 */
|
|
15
|
+
constructor(code: 'IM_PLACEMENT_ALREADY_STOPPED' | 'IM_PLACEMENT_SCOPE_INVALID' | 'IM_PLACEMENT_NOT_PAUSED' | 'IM_PLACEMENT_STOP_UNKNOWN' | 'IM_PLACEMENT_STANDBY_REQUIRED');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 校验账号、凭据命名空间和路由的共同归属。
|
|
19
|
+
* @param value - 已通过控制面授权并限制大小的交接 JSON。
|
|
20
|
+
* @returns 真实旺旺账号的切片;当前路由和任务只属于声明的内置 Workspace,所有任务代次保持不变。
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseImAccountPlacementSlice(value: unknown): ImAccountPlacementSlice;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Host-owned admission annotations; registration lifetime is separate from durable batch identity. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { ImAdmissionAnnotation, ImAdmissionAnnotationId, ImAdmissionAnnotatorId, ImAdmissionId, ImDeliveryScope, ImInboundMessageView, ImScopeId } from './delivery-types.ts';
|
|
4
|
+
/** Frozen messages and route identity offered to an annotation provider. */
|
|
5
|
+
export interface ImAdmissionAnnotationInput {
|
|
6
|
+
readonly admissionId: ImAdmissionId;
|
|
7
|
+
readonly scopeId: ImScopeId;
|
|
8
|
+
readonly scope: ImDeliveryScope;
|
|
9
|
+
readonly controller?: string | undefined;
|
|
10
|
+
readonly messages: readonly ImInboundMessageView[];
|
|
11
|
+
}
|
|
12
|
+
/** One product's optional analysis before a batch reaches an Agent. */
|
|
13
|
+
export interface ImAdmissionAnnotator {
|
|
14
|
+
readonly id: ImAdmissionAnnotatorId;
|
|
15
|
+
readonly version: string;
|
|
16
|
+
readonly deadlineMs: number;
|
|
17
|
+
/** Defaults to true; false runs analysis for its owner without adding text or audit metadata to Agent input. */
|
|
18
|
+
readonly inject?: boolean;
|
|
19
|
+
/** @param input - Frozen batch. @returns Whether this provider owns the requested analysis. */
|
|
20
|
+
accepts(input: ImAdmissionAnnotationInput): boolean;
|
|
21
|
+
/** @param input - Frozen batch and stable annotation identity. @param signal - Admission, deadline and registration cancellation. @returns Analysis text; providers must settle after cancellation and never publish late results. */
|
|
22
|
+
annotate(input: ImAdmissionAnnotationInput & {
|
|
23
|
+
readonly annotationId: ImAdmissionAnnotationId;
|
|
24
|
+
}, signal: AbortSignal): Promise<string>;
|
|
25
|
+
}
|
|
26
|
+
/** Instance-local registry used by the ordinary and busy-Agent admission paths. */
|
|
27
|
+
export declare class ImAdmissionAnnotations {
|
|
28
|
+
private readonly ctx;
|
|
29
|
+
private readonly providers;
|
|
30
|
+
private closed;
|
|
31
|
+
/** @param ctx - Runtime owner of registrations. */
|
|
32
|
+
constructor(ctx: Context);
|
|
33
|
+
/** @param provider - Product-owned analysis. @returns Idempotent disposer that cancels and joins outstanding provider work. */
|
|
34
|
+
register(provider: ImAdmissionAnnotator): () => Promise<void>;
|
|
35
|
+
/** Cancel providers before joining their work; no registration or new analysis is accepted afterwards. */
|
|
36
|
+
dispose(): Promise<void>;
|
|
37
|
+
/** @param input - Frozen admission. @param signal - Coordinator lifetime. @returns Ordered analysis results for durable attribution; provider failures never prevent reception. */
|
|
38
|
+
annotate(input: ImAdmissionAnnotationInput, signal: AbortSignal): Promise<readonly ImAdmissionAnnotation[]>;
|
|
39
|
+
private run;
|
|
40
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { ImExecutionAggregate } from './delivery-schema.ts';
|
|
2
4
|
import type { ImDeliveryScope } from './delivery-types.ts';
|
|
3
5
|
import type { ImRuntime } from './runtime.ts';
|
|
4
6
|
/** Runtime-owned coordinator; one serialized driver and one timer exist per complete scope. */
|
|
5
7
|
export declare class ImAgentCoordinator {
|
|
6
8
|
private readonly ctx;
|
|
7
9
|
private readonly runtime;
|
|
10
|
+
private readonly startup;
|
|
11
|
+
private readonly restartTasks;
|
|
12
|
+
private readonly ownershipWaits;
|
|
13
|
+
private readonly failedRestarts;
|
|
8
14
|
private readonly tails;
|
|
9
15
|
private readonly timers;
|
|
10
16
|
private readonly handles;
|
|
@@ -14,21 +20,36 @@ export declare class ImAgentCoordinator {
|
|
|
14
20
|
private readonly shutdown;
|
|
15
21
|
private readonly bundleLeases;
|
|
16
22
|
private readonly bundleLeaseDisposers;
|
|
23
|
+
private readonly modelHolds;
|
|
24
|
+
private stopModelWatch;
|
|
17
25
|
private disposed;
|
|
18
26
|
private disposeCreated;
|
|
19
27
|
private disposeDisposed;
|
|
20
28
|
/** @param ctx - injected Agent, Workspace, preset, tools, Session, and persistence scope. @param runtime - IM authority. */
|
|
21
29
|
constructor(ctx: Context, runtime: ImRuntime);
|
|
22
30
|
/** Recover existing pending conversations and pending Session evidence. */
|
|
23
|
-
start(scopes: readonly ImDeliveryScope[]): void
|
|
31
|
+
start(scopes: readonly ImDeliveryScope[]): Promise<void>;
|
|
32
|
+
/** 重开准入或产品状态变化后重试尚未提交的重启跟进。 */
|
|
33
|
+
notifyRestarts(): void;
|
|
24
34
|
/** Queue one post-commit scope observation without inheriting an Agent initiator. */
|
|
25
35
|
notify(scope: ImDeliveryScope): void;
|
|
26
36
|
/** Close one simulation driver, cancel its Agent, and await only its derived work. */
|
|
27
37
|
stopScope(scope: ImDeliveryScope): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Release drained account Agents before replacing their persisted Sessions.
|
|
40
|
+
* @param scopes - Current scopes of the account whose reception is stopped.
|
|
41
|
+
* @returns Owned Agent handles and their persistence locks have been released; other accounts remain active.
|
|
42
|
+
*/
|
|
43
|
+
releasePlacement(scopes: readonly ImDeliveryScope[]): Promise<void>;
|
|
28
44
|
/** Stop timers, drain admission drivers, and dispose every Agent this coordinator owns. */
|
|
29
45
|
dispose(): Promise<void>;
|
|
30
46
|
/** Evaluate current durable input and submit one eligible batch. */
|
|
31
47
|
private drive;
|
|
48
|
+
private driveAdmitted;
|
|
49
|
+
private reportRestartFailure;
|
|
50
|
+
private restartRoute;
|
|
51
|
+
/** 准入策略仍控制恢复;模型暂不可用时保留日志证据,等待配置通知。 */
|
|
52
|
+
private recoverRestart;
|
|
32
53
|
/** Continue one frozen admission after checking its Session log for an earlier append. */
|
|
33
54
|
private submitAdmission;
|
|
34
55
|
/** Pending pause and epoch changes revoke a batch, including during asynchronous policy or Agent setup. */
|
|
@@ -70,11 +91,35 @@ export declare class ImAgentCoordinator {
|
|
|
70
91
|
private scheduleInterval;
|
|
71
92
|
/** Store the exact batch and reasons before Agent lifecycle work starts. */
|
|
72
93
|
private freezeAdmission;
|
|
94
|
+
/** Keep a blocked shop-cloud batch pending and retry it when the admission changes. */
|
|
95
|
+
private holdForShopModel;
|
|
96
|
+
/**
|
|
97
|
+
* Resume an existing placement task; a missing or foreign Session never creates a replacement.
|
|
98
|
+
* @param task - Current account task selected while reception is paused.
|
|
99
|
+
* @param prepare - Preparation of the same idle Agent.
|
|
100
|
+
* @param signal - Activation and Host lifetime.
|
|
101
|
+
*/
|
|
102
|
+
preparePersistedPlacement(task: ImExecutionAggregate, prepare: (agent: Agent) => Promise<void>, signal: AbortSignal): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* 在启动暂停期间恢复已导入的当前任务,由调用者准备同一 Agent 的首轮输入。
|
|
105
|
+
* @param task - 当前账号会话的最后一个任务代次。
|
|
106
|
+
* @param prepare - 仅给已恢复且仍空闲的 Agent 添加已记录准备输入。
|
|
107
|
+
* @param signal - 交接激活和 Host 寿命。
|
|
108
|
+
*/
|
|
109
|
+
preparePlacement(task: ImExecutionAggregate, prepare: (agent: Agent) => Promise<void>, signal: AbortSignal): Promise<void>;
|
|
73
110
|
/** Reuse a live Agent or resume/create its frozen Session and scoped preset. */
|
|
74
111
|
private agentFor;
|
|
75
112
|
/** GUI resume uses preset-only setup; attach the frozen conversation tools then. */
|
|
76
113
|
private attachTools;
|
|
77
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Build one identified Session message whose source reconstructs the whole batch.
|
|
116
|
+
* Text returns before the caller yields. An image batch returns a promise that stores attachment bytes first.
|
|
117
|
+
* @param agent - Session whose attachment storage receives image bytes.
|
|
118
|
+
* @param task - admitted execution.
|
|
119
|
+
* @param admission - frozen batch identity.
|
|
120
|
+
* @param messages - ordered stored rows.
|
|
121
|
+
* @returns the Session message, or a promise for it when image bytes must be stored.
|
|
122
|
+
*/
|
|
78
123
|
private admissionMessage;
|
|
79
124
|
/** Await the exact Session append and its persistence barrier before returning. */
|
|
80
125
|
private submit;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { FileAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import type { ToolExecution } from '@deepseek-ai/dsh-tools';
|
|
4
|
+
import type { ImRuntime } from './runtime.ts';
|
|
5
|
+
import type { ImDeliveryScope, ImOutboundRequestId, ImOutboundRouteBinding } from './delivery-types.ts';
|
|
6
|
+
interface Delivery {
|
|
7
|
+
readonly requestId: string;
|
|
8
|
+
readonly status: string;
|
|
9
|
+
readonly kind: 'image' | 'file' | 'text';
|
|
10
|
+
readonly errorCode?: string;
|
|
11
|
+
readonly file?: FileAttachmentRef;
|
|
12
|
+
}
|
|
13
|
+
interface Unsubmitted {
|
|
14
|
+
readonly kind: 'image' | 'file' | 'text';
|
|
15
|
+
readonly path?: string;
|
|
16
|
+
readonly referenceId?: string;
|
|
17
|
+
}
|
|
18
|
+
/** One attachment, either a Session path or knowledge-image bytes already read by the Host. */
|
|
19
|
+
export interface AgentMediaFile {
|
|
20
|
+
/** `image` or `file` for a path; knowledge images are `image`. */
|
|
21
|
+
readonly kind: 'image' | 'file';
|
|
22
|
+
/** Session-world path. Absent for a knowledge image. */
|
|
23
|
+
readonly path?: string;
|
|
24
|
+
/** Knowledge-image reference, when this part was not read from a path. */
|
|
25
|
+
readonly referenceId?: string;
|
|
26
|
+
/** Display name for prepared bytes. */
|
|
27
|
+
readonly name?: string;
|
|
28
|
+
/** MIME type for prepared bytes. */
|
|
29
|
+
readonly mime?: string;
|
|
30
|
+
/** Exact image bytes. Mutually exclusive with `path`. */
|
|
31
|
+
readonly bytes?: Uint8Array;
|
|
32
|
+
}
|
|
33
|
+
interface BatchResult {
|
|
34
|
+
requestId: string;
|
|
35
|
+
status: string;
|
|
36
|
+
errorCode?: string;
|
|
37
|
+
message?: string;
|
|
38
|
+
deliveries: Delivery[];
|
|
39
|
+
unsubmitted?: Unsubmitted[];
|
|
40
|
+
}
|
|
41
|
+
/** @param ctx - Agent context providing its filesystem and durable attachments. @param runtime - outbox and authorization owner. @param scope - admitted conversation. @param routeBinding - frozen automatic authority. @param files - ordered paths visible in the Session execution world or prepared knowledge images. Path-image MIME comes from file headers; only missing filename suffixes are added. @param text - optional text sent last. @param execution - cancellation and Agent directory owner. @param sendText - existing text-channel operation. @returns ordered terminal results; unsupported path-image headers yield IM_MEDIA_INVALID before new submissions. Processing stops after the first non-success; no automatic resubmission. Exceptions after partial submission retain delivery evidence and identify unsubmitted items; a thrown submission is reconciled with its outbox record before reporting. */
|
|
42
|
+
export declare function sendAgentMedia(ctx: Context, runtime: ImRuntime, scope: ImDeliveryScope, routeBinding: ImOutboundRouteBinding, files: readonly AgentMediaFile[], text: string, execution: ToolExecution, sendText: (requestId: ImOutboundRequestId) => Promise<{
|
|
43
|
+
requestId: string;
|
|
44
|
+
status: string;
|
|
45
|
+
}>): Promise<BatchResult>;
|
|
46
|
+
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/** Model-facing IM takeover labels and the scoped system-prompt section. */
|
|
2
|
+
import type { ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
2
3
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
4
|
import type { ImDeliveryScope, ImInboundMessageView } from './delivery-types.ts';
|
|
4
5
|
import type { ImRuntime } from './runtime.ts';
|
|
6
|
+
/** @param ctx - attachment owner for the admitted Session. @param messages - ordered stored IM rows. @param text - labeled text with inline image bytes removed. @returns logged text and durable image blocks; invalid images reject admission through the attachment provider. */
|
|
7
|
+
export declare function admitImContent(ctx: Context, messages: readonly ImInboundMessageView[], text: string): Promise<ContentBlock[]>;
|
|
5
8
|
/**
|
|
6
9
|
* Render one inbound row for Agent admission or history.
|
|
7
10
|
* @param message - stored inbound with classified sender evidence.
|
|
8
|
-
* @
|
|
11
|
+
* @param timeZone - IANA shop time zone; defaults to Asia/Shanghai.
|
|
12
|
+
* @returns one receipt-time-prefixed labeled line; counterpart is platform-neutral. The role marker is `[role] body`, never `[role]: body`.
|
|
9
13
|
*/
|
|
10
|
-
export declare function formatInbound(message: ImInboundMessageView): string;
|
|
14
|
+
export declare function formatInbound(message: ImInboundMessageView, timeZone?: string): string;
|
|
11
15
|
/**
|
|
12
16
|
* Register the takeover standing rules on one Agent context.
|
|
13
17
|
* @param ctx - unpublished Agent context that owns the section.
|
|
@@ -16,3 +20,5 @@ export declare function formatInbound(message: ImInboundMessageView): string;
|
|
|
16
20
|
* @returns disposer for the section.
|
|
17
21
|
*/
|
|
18
22
|
export declare function registerImTakeoverPrompt(ctx: Context, runtime: ImRuntime, scope: ImDeliveryScope): () => void;
|
|
23
|
+
/** 服务重启后的普通跟进输入;先核对副作用,再继续并回复顾客。 */
|
|
24
|
+
export declare const IM_RESTART_PROMPT = "\u670D\u52A1\u521A\u521A\u91CD\u542F\uFF0C\u4E0A\u4E00\u8F6E\u5DE5\u4F5C\u88AB\u4E2D\u65AD\u3002\u8BF7\u68C0\u67E5\u5C1A\u672A\u5B8C\u6210\u7684\u5DE5\u5177\u8C03\u7528\u3001\u6301\u4E45\u5B50\u4F1A\u8BDD\uFF08subagent\uFF09\u548C\u540E\u53F0\u4EFB\u52A1\uFF0C\u9700\u8981\u65F6\u7EE7\u7EED\u5904\u7406\uFF0C\u5E76\u901A\u8FC7 im_send_message \u56DE\u590D\u987E\u5BA2\u3002\u5DF2\u8BB0\u5F55\u5F00\u59CB\u4F46\u6CA1\u6709\u7ED3\u679C\u7684\u5DE5\u5177\u8C03\u7528\uFF0C\u5176\u5916\u90E8\u7ED3\u679C\u672A\u77E5\uFF1A\u8BF7\u5148\u6838\u5BF9\u5B9E\u9645\u72B6\u6001\uFF0C\u53EA\u91CD\u8BD5\u53EA\u8BFB\u6216\u5E42\u7B49\u64CD\u4F5C\uFF0C\u4E0D\u8981\u76F2\u76EE\u91CD\u590D\u6709\u526F\u4F5C\u7528\u7684\u64CD\u4F5C\u3002\u6301\u4E45\u5B50\u4F1A\u8BDD\u53EF\u4EE5\u7EE7\u7EED\uFF1B\u8FDB\u7A0B\u5185\u540E\u53F0\u4EFB\u52A1\u53EF\u80FD\u5DF2\u4E22\u5931\uFF0C\u8BF7\u68C0\u67E5\u540E\u51B3\u5B9A\u5982\u4F55\u6062\u590D\u3002";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Cursor-only recovery from a cloud Host whose live Session is unavailable. */
|
|
2
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
3
|
+
import type { ImCheckpointCursor } from './checkpoint.ts';
|
|
4
|
+
/** Facts already parsed and authorized by the placement owner; no message bodies are available. */
|
|
5
|
+
export interface ImAccountCheckpointRecovery {
|
|
6
|
+
readonly checkpoint: {
|
|
7
|
+
readonly epoch: number;
|
|
8
|
+
readonly streamCursors: readonly ImCheckpointCursor[];
|
|
9
|
+
readonly pendingCount: number;
|
|
10
|
+
readonly unknownSendCount: number;
|
|
11
|
+
readonly session: {
|
|
12
|
+
readonly eventCount: number;
|
|
13
|
+
readonly digest: string;
|
|
14
|
+
} | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The placement owner verified this completed outbound handoff is the last local writer, its target
|
|
18
|
+
* is the checkpoint's cloud holder, and local automatic reception remained fenced continuously.
|
|
19
|
+
* Opaque local cursors must also match the checkpoint; this fence alone does not authorize rewind.
|
|
20
|
+
*/
|
|
21
|
+
readonly sourceFence: {
|
|
22
|
+
readonly handoffId: Branded<'PlacementHandoffId'>;
|
|
23
|
+
readonly sourceEpoch: number;
|
|
24
|
+
readonly committedEpoch: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Recovery cannot reconstruct missing pending input or determine unknown cloud sends. */
|
|
28
|
+
export declare class ImCheckpointRecoveryError extends Error {
|
|
29
|
+
readonly code: 'IM_CHECKPOINT_BODIES_UNAVAILABLE' | 'IM_CHECKPOINT_STREAM_MISSING' | 'IM_CHECKPOINT_CURSOR_CONFLICT';
|
|
30
|
+
/** @param code - Safe reason that prevents cursor-only activation. */
|
|
31
|
+
constructor(code: 'IM_CHECKPOINT_BODIES_UNAVAILABLE' | 'IM_CHECKPOINT_STREAM_MISSING' | 'IM_CHECKPOINT_CURSOR_CONFLICT');
|
|
32
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** Throttled hosting checkpoint facts. The report has no message body and no credential. */
|
|
2
|
+
import type { ImAccountId } from './types.ts';
|
|
3
|
+
import type { ImAccountListener } from './types.ts';
|
|
4
|
+
/** Safe machine failure details; error messages, stacks and server payloads are excluded. */
|
|
5
|
+
export interface ImCheckpointDiagnostic {
|
|
6
|
+
readonly code?: string;
|
|
7
|
+
readonly status?: number;
|
|
8
|
+
readonly reason?: 'network' | 'timeout' | 'max-bytes';
|
|
9
|
+
readonly cause?: ImCheckpointDiagnostic;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Project thrown failures or server refusals without copying free text.
|
|
13
|
+
* @param error - failure from fact construction, transport, or the server.
|
|
14
|
+
* @param seen - visited causes, capped at eight objects.
|
|
15
|
+
* @returns bounded machine codes, HTTP statuses and enumerated transport reasons only.
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkpointFailureDiagnostic(error: unknown, seen?: Set<object>): ImCheckpointDiagnostic;
|
|
18
|
+
/** One opaque provider cursor. `streamId` and `cursor` contain no message text. */
|
|
19
|
+
export interface ImCheckpointCursor {
|
|
20
|
+
readonly streamId: string;
|
|
21
|
+
readonly cursor: string;
|
|
22
|
+
}
|
|
23
|
+
/** Latest durable hosting facts for one account. `session` stays null until an account-level event digest exists. */
|
|
24
|
+
export interface ImCheckpointFacts {
|
|
25
|
+
readonly streamCursors: readonly ImCheckpointCursor[];
|
|
26
|
+
readonly session: null;
|
|
27
|
+
readonly pendingCount: number;
|
|
28
|
+
readonly unknownSendCount: number;
|
|
29
|
+
readonly status: 'running' | 'draining' | 'stopped' | 'unavailable';
|
|
30
|
+
}
|
|
31
|
+
/** Safe report outcome. Retry categories omit server payloads; `epoch-rejected` stops this generation until `resume`. */
|
|
32
|
+
export type ImCheckpointReportResult = {
|
|
33
|
+
readonly kind: 'accepted';
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'epoch-rejected';
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'retry';
|
|
38
|
+
readonly reason: 'NETWORK' | 'TIMEOUT' | 'SERVER_REJECTED' | 'INVALID_RESPONSE' | 'SESSION_EXPIRED' | 'HOST_VERSION_UNAVAILABLE';
|
|
39
|
+
readonly diagnostic?: ImCheckpointDiagnostic;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'skip';
|
|
42
|
+
};
|
|
43
|
+
/** Sends one account's facts. The implementation owns the lease epoch and the server revision. */
|
|
44
|
+
export interface ImCheckpointTransport {
|
|
45
|
+
/**
|
|
46
|
+
* Report the latest facts for one account.
|
|
47
|
+
* @param accountId - Wangwang account that owns the cursors.
|
|
48
|
+
* @param facts - runtime status and cursors after local persistence.
|
|
49
|
+
* @param signal - cancelled when the runtime stops.
|
|
50
|
+
* @returns acceptance, safe retry category, epoch refusal, or no report for an unheld account.
|
|
51
|
+
*/
|
|
52
|
+
report(accountId: ImAccountId, facts: ImCheckpointFacts, signal: AbortSignal): Promise<ImCheckpointReportResult>;
|
|
53
|
+
}
|
|
54
|
+
/** Why a local snapshot cannot become a checkpoint body. */
|
|
55
|
+
export type ImCheckpointFactsResult = {
|
|
56
|
+
readonly kind: 'ready';
|
|
57
|
+
readonly facts: ImCheckpointFacts;
|
|
58
|
+
} | {
|
|
59
|
+
readonly kind: 'invalid';
|
|
60
|
+
readonly reason: 'too-many-streams' | 'cursor-not-opaque' | 'count-out-of-range';
|
|
61
|
+
};
|
|
62
|
+
/** Product reception facts; listening for history does not imply automatic reception. */
|
|
63
|
+
export interface ImCheckpointActivity {
|
|
64
|
+
readonly intent: boolean;
|
|
65
|
+
readonly admitted: boolean;
|
|
66
|
+
readonly modelReady: boolean;
|
|
67
|
+
readonly inFlight: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Choose automatic reception status independently of history synchronization.
|
|
71
|
+
* @param listener - provider inbox listener state.
|
|
72
|
+
* @param paused - operator account pause.
|
|
73
|
+
* @param activity - current product intent, admission, model availability, and active processing.
|
|
74
|
+
* @returns status of automatic reception, rather than inbox connectivity.
|
|
75
|
+
*/
|
|
76
|
+
export declare function checkpointStatus(listener: ImAccountListener | undefined, paused: boolean, activity: ImCheckpointActivity): ImCheckpointFacts['status'];
|
|
77
|
+
/**
|
|
78
|
+
* Build checkpoint facts from cursors and counts. Message text passed beside those fields is ignored.
|
|
79
|
+
* @param input - durable cursors and counts for one account. Extra text is not copied.
|
|
80
|
+
*/
|
|
81
|
+
export declare function checkpointFacts(input: {
|
|
82
|
+
readonly cursors: readonly ImCheckpointCursor[];
|
|
83
|
+
readonly pendingCount: number;
|
|
84
|
+
readonly unknownSendCount: number;
|
|
85
|
+
readonly status: ImCheckpointFacts['status'];
|
|
86
|
+
}): ImCheckpointFactsResult;
|
|
87
|
+
interface Timer {
|
|
88
|
+
clear(): void;
|
|
89
|
+
}
|
|
90
|
+
/** Coalesces cursor advances into one report per account per interval. */
|
|
91
|
+
export declare class ImCheckpointReporter {
|
|
92
|
+
private readonly intervalMs;
|
|
93
|
+
private readonly facts;
|
|
94
|
+
private readonly transport;
|
|
95
|
+
private readonly warn;
|
|
96
|
+
private readonly schedule;
|
|
97
|
+
private readonly dirty;
|
|
98
|
+
private readonly halted;
|
|
99
|
+
private readonly generations;
|
|
100
|
+
private readonly abort;
|
|
101
|
+
private timer;
|
|
102
|
+
private flushing;
|
|
103
|
+
private disposed;
|
|
104
|
+
private readonly failures;
|
|
105
|
+
/**
|
|
106
|
+
* @param intervalMs - minimum time between reports while facts stay dirty.
|
|
107
|
+
* @param facts - reads the latest durable facts. It must not include message text.
|
|
108
|
+
* @param transport - server report. It owns epoch and revision.
|
|
109
|
+
* @param warn - JSON diagnostic and a separate fixed summary for logger fallbacks; duplicates are suppressed per account until category change or recovery.
|
|
110
|
+
* @param schedule - timer factory. Tests pass a manual timer.
|
|
111
|
+
*/
|
|
112
|
+
constructor(intervalMs: number, facts: (accountId: ImAccountId, signal: AbortSignal) => ImCheckpointFactsResult | Promise<ImCheckpointFactsResult>, transport: ImCheckpointTransport, warn: (message: string, summary: string) => void, schedule?: (ms: number, run: () => void) => Timer);
|
|
113
|
+
/** Record a durable cursor or automatic reception state change. Halted accounts stay local. */
|
|
114
|
+
note(accountId: ImAccountId): void;
|
|
115
|
+
/**
|
|
116
|
+
* Allow reports again after the held lease epoch changes.
|
|
117
|
+
* The next send uses that new epoch. It does not reuse the rejected epoch.
|
|
118
|
+
*/
|
|
119
|
+
resume(accountId: ImAccountId): void;
|
|
120
|
+
/** Stop timers and the in-flight report. Local sqlite rows stay. */
|
|
121
|
+
dispose(): void;
|
|
122
|
+
private arm;
|
|
123
|
+
private diagnose;
|
|
124
|
+
private recovered;
|
|
125
|
+
private flush;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Host-owned consumer conversation links, resolved from the current IM account directory. */
|
|
2
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { ImAccountId, ImAccountView, ImPlatform } from './types.ts';
|
|
4
|
+
/** Account and platform selected by the Host; callers cannot supply platform nicknames. */
|
|
5
|
+
export interface ImConsumerChatLinkQuery {
|
|
6
|
+
readonly accountId: ImAccountId;
|
|
7
|
+
readonly platform: ImPlatform;
|
|
8
|
+
}
|
|
9
|
+
/** Safe link facts; absence of an identity is distinct from absence of a provider. */
|
|
10
|
+
export type ImConsumerChatLinkResolution = {
|
|
11
|
+
readonly status: 'ready';
|
|
12
|
+
readonly accountId: ImAccountId;
|
|
13
|
+
readonly platform: ImPlatform;
|
|
14
|
+
readonly url: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly status: 'unavailable';
|
|
17
|
+
readonly reason: 'unsupported' | 'identity-unavailable';
|
|
18
|
+
};
|
|
19
|
+
/** One platform's Host implementation; the signal ends caller or registration ownership. */
|
|
20
|
+
export interface ImConsumerChatLinkProvider {
|
|
21
|
+
readonly platform: ImPlatform;
|
|
22
|
+
/** @param request - account obtained from the current directory. @param signal - cancellation of this read. @returns a link or unavailable identity; failures reject. */
|
|
23
|
+
resolve(request: {
|
|
24
|
+
readonly account: ImAccountView;
|
|
25
|
+
}, signal: AbortSignal): Promise<ImConsumerChatLinkResolution>;
|
|
26
|
+
}
|
|
27
|
+
/** Stable failures for link lookup and platform identity reads. */
|
|
28
|
+
export type ImConsumerChatLinkErrorCode = 'IM_CONSUMER_CHAT_LINK_ACCOUNT_NOT_FOUND' | 'IM_CONSUMER_CHAT_LINK_PLATFORM_MISMATCH' | 'IM_CONSUMER_CHAT_LINK_PROVIDER_CONFLICT' | 'IM_CONSUMER_CHAT_LINK_IDENTITY_MISMATCH' | 'IM_CONSUMER_CHAT_LINK_REQUEST_FAILED';
|
|
29
|
+
/** Structured failure; callers report localized copy without exposing the diagnostic cause. */
|
|
30
|
+
export declare class ImConsumerChatLinkError extends Error {
|
|
31
|
+
readonly code: ImConsumerChatLinkErrorCode;
|
|
32
|
+
/** @param code - stable failure. @param cause - private underlying error, when available. */
|
|
33
|
+
constructor(code: ImConsumerChatLinkErrorCode, cause?: unknown);
|
|
34
|
+
}
|
|
35
|
+
declare module '@deepseek-ai/cordis' {
|
|
36
|
+
interface Context {
|
|
37
|
+
imConsumerChatLinks: ImConsumerChatLinks;
|
|
38
|
+
}
|
|
39
|
+
interface Events {
|
|
40
|
+
/**
|
|
41
|
+
* A link provider registered or was revoked; previously resolved links must be discarded.
|
|
42
|
+
* @param platform - changed platform.
|
|
43
|
+
* @mode emit
|
|
44
|
+
*/
|
|
45
|
+
'imConsumerChatLinks/changed'(platform: ImPlatform): void;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Registry with one provider per platform and cancellable reads scoped to each registration. */
|
|
49
|
+
export declare class ImConsumerChatLinks extends Service {
|
|
50
|
+
private readonly accounts;
|
|
51
|
+
private readonly providers;
|
|
52
|
+
/** @param ctx - owning Host. @param accounts - current authoritative account directory, without credentials. */
|
|
53
|
+
constructor(ctx: Context, accounts: () => readonly ImAccountView[]);
|
|
54
|
+
/** @param provider - platform implementation. @returns an idempotent disposer that cancels its outstanding reads before notifying consumers. */
|
|
55
|
+
register(provider: ImConsumerChatLinkProvider): () => void;
|
|
56
|
+
/** @param query - current account and its platform. @param signal - caller cancellation. @returns a provider result, or unsupported without a provider; unknown accounts, platform mismatch and read failures reject. */
|
|
57
|
+
resolve(query: ImConsumerChatLinkQuery, signal: AbortSignal): Promise<ImConsumerChatLinkResolution>;
|
|
58
|
+
private publish;
|
|
59
|
+
}
|
|
@@ -1,20 +1,98 @@
|
|
|
1
|
-
import { type ZodType } from 'zod';
|
|
2
|
-
import type { ImAdmissionId, ImAgentTaskView, ImInboundOperationResult, ImDeliveryScope, ImInboundMessageInput, ImInboundMessageView, ImMessageId, ImOutboundView, ImScopeId, ImProviderCursorCommitResult, ImProviderCursorId, ImProviderCursorOwner, ImTriggerReason } from './delivery-types.ts';
|
|
1
|
+
import { z, type ZodType } from 'zod';
|
|
2
|
+
import type { ImAdmissionId, ImAdmissionAnnotation, ImAdmissionAnnotationId, ImAdmissionAnnotatorId, ImAgentTaskView, ImInboundOperationResult, ImDeliveryScope, ImInboundMessageInput, ImInboundMessageView, ImMessageId, ImOutboundView, ImScopeId, ImProviderCursorCommitResult, ImProviderCursorId, ImProviderCursorOwner, ImTriggerReason } from './delivery-types.ts';
|
|
3
|
+
import type { ImUploadTarget, ImUploadObservation } from './upload-types.ts';
|
|
4
|
+
/** Captured platform identities; legacy observations omit the whole value. */
|
|
5
|
+
export declare const imUploadIdentitySchema: z.ZodObject<{
|
|
6
|
+
senderAccountId: z.ZodNullable<z.ZodString>;
|
|
7
|
+
senderDisplayName: z.ZodNullable<z.ZodString>;
|
|
8
|
+
senderDomain: z.ZodNullable<z.ZodString>;
|
|
9
|
+
assignedAccountId: z.ZodNullable<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
3
11
|
export declare const imDeliveryScopeSchema: ZodType<ImDeliveryScope>;
|
|
4
12
|
/** Parser for provider and JSONL inbound records. */
|
|
5
13
|
export declare const imInboundMessageInputSchema: ZodType<ImInboundMessageInput>;
|
|
14
|
+
/** Server V2 control-result fields shared by the journal and queue parsers. */
|
|
15
|
+
export declare const imUploadConversationEventSchema: z.ZodObject<{
|
|
16
|
+
eventId: z.ZodString;
|
|
17
|
+
conversationKey: z.ZodString;
|
|
18
|
+
accountId: z.ZodString;
|
|
19
|
+
kind: z.ZodEnum<{
|
|
20
|
+
ai_to_human: "ai_to_human";
|
|
21
|
+
hosting_disabled: "hosting_disabled";
|
|
22
|
+
hosting_resumed: "hosting_resumed";
|
|
23
|
+
}>;
|
|
24
|
+
occurredAt: z.ZodISODateTime;
|
|
25
|
+
controlRevision: z.ZodString;
|
|
26
|
+
relatedMessageIds: z.ZodArray<z.ZodString>;
|
|
27
|
+
sourceOperationId: z.ZodString;
|
|
28
|
+
sourceKind: z.ZodLiteral<"dsh-control-result">;
|
|
29
|
+
payloadHash: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare const imUploadObservationSchema: z.ZodObject<{
|
|
32
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./upload-types.ts").ImUploadObservationId, string>>;
|
|
33
|
+
target: z.ZodObject<{
|
|
34
|
+
serverOrigin: z.ZodURL;
|
|
35
|
+
tenantId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@deepseek-ai/dsh-brand").Branded<"MerchantTenantId">, string>>;
|
|
36
|
+
shopAccountId: z.ZodString;
|
|
37
|
+
traffic: z.ZodEnum<{
|
|
38
|
+
formal: "formal";
|
|
39
|
+
test: "test";
|
|
40
|
+
simulation: "simulation";
|
|
41
|
+
}>;
|
|
42
|
+
testRunId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
scope: z.ZodType<ImDeliveryScope, unknown, z.core.$ZodTypeInternals<ImDeliveryScope, unknown>>;
|
|
45
|
+
observedAt: z.ZodISODateTime;
|
|
46
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
senderAccountId: z.ZodNullable<z.ZodString>;
|
|
48
|
+
senderDisplayName: z.ZodNullable<z.ZodString>;
|
|
49
|
+
senderDomain: z.ZodNullable<z.ZodString>;
|
|
50
|
+
assignedAccountId: z.ZodNullable<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
message: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"inbound">;
|
|
54
|
+
value: z.ZodType<ImInboundMessageView, unknown, z.core.$ZodTypeInternals<ImInboundMessageView, unknown>>;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
kind: z.ZodLiteral<"outbound">;
|
|
57
|
+
value: z.ZodType<ImOutboundView, unknown, z.core.$ZodTypeInternals<ImOutboundView, unknown>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"conversation-event">;
|
|
60
|
+
value: z.ZodObject<{
|
|
61
|
+
eventId: z.ZodString;
|
|
62
|
+
conversationKey: z.ZodString;
|
|
63
|
+
accountId: z.ZodString;
|
|
64
|
+
kind: z.ZodEnum<{
|
|
65
|
+
ai_to_human: "ai_to_human";
|
|
66
|
+
hosting_disabled: "hosting_disabled";
|
|
67
|
+
hosting_resumed: "hosting_resumed";
|
|
68
|
+
}>;
|
|
69
|
+
occurredAt: z.ZodISODateTime;
|
|
70
|
+
controlRevision: z.ZodString;
|
|
71
|
+
relatedMessageIds: z.ZodArray<z.ZodString>;
|
|
72
|
+
sourceOperationId: z.ZodString;
|
|
73
|
+
sourceKind: z.ZodLiteral<"dsh-control-result">;
|
|
74
|
+
payloadHash: z.ZodString;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
}, z.core.$strip>], "kind">;
|
|
77
|
+
}, z.core.$strip>;
|
|
6
78
|
interface StoredDeliveryOperation {
|
|
7
79
|
readonly fingerprint: string;
|
|
8
80
|
readonly result: ImInboundOperationResult;
|
|
9
81
|
}
|
|
10
82
|
/** One durable record per complete conversation scope. */
|
|
11
83
|
export interface ImDeliveryAggregate {
|
|
84
|
+
readonly uploadIdentities?: Readonly<Record<string, import('./upload-types.ts').ImUploadIdentity>>;
|
|
12
85
|
readonly scope: ImDeliveryScope;
|
|
13
86
|
readonly scopeId: ImScopeId;
|
|
87
|
+
readonly uploadTargets?: Readonly<Record<string, ImUploadTarget>>;
|
|
88
|
+
readonly uploadPending?: readonly ImUploadObservation[];
|
|
89
|
+
readonly uploadObservedAt?: string;
|
|
14
90
|
readonly nextMessageSequenceNumber: number;
|
|
15
91
|
readonly nextOutboundSequenceNumber: number;
|
|
16
92
|
readonly cursor: import('./delivery-types.ts').ImConversationCursor;
|
|
17
93
|
readonly presentation?: import('./delivery-types.ts').ImConversationPresentation;
|
|
94
|
+
/** Latest platform-provided direct peer identity. Older records omit it. */
|
|
95
|
+
readonly directRecipient?: import('./types.ts').ImDirectRecipient;
|
|
18
96
|
readonly messages: Readonly<Record<string, ImInboundMessageView>>;
|
|
19
97
|
readonly messageIdsByExternalId: Readonly<Record<string, ImMessageId>>;
|
|
20
98
|
readonly operations: Readonly<Record<string, StoredDeliveryOperation>>;
|
|
@@ -36,6 +114,8 @@ export interface ImProviderCursorAggregate {
|
|
|
36
114
|
export declare const imProviderCursorAggregateSchema: ZodType<ImProviderCursorAggregate>;
|
|
37
115
|
/** Batch frozen before Agent creation or steering begins. */
|
|
38
116
|
export interface ImPendingAdmission {
|
|
117
|
+
/** Analysis frozen for append/recovery; absence means it has not been attempted. */
|
|
118
|
+
readonly annotations?: readonly ImAdmissionAnnotation[];
|
|
39
119
|
/** Customer pause generation frozen before asynchronous admission work. */
|
|
40
120
|
readonly handlingEpoch?: number;
|
|
41
121
|
readonly admissionId: ImAdmissionId;
|
|
@@ -47,6 +127,50 @@ export interface ImPendingAdmission {
|
|
|
47
127
|
export interface ImExecutionAggregate extends ImAgentTaskView {
|
|
48
128
|
readonly pendingAdmission?: ImPendingAdmission;
|
|
49
129
|
}
|
|
130
|
+
/** Frozen analysis parse path, shared by JSON records and compatibility fixtures. */
|
|
131
|
+
export declare const imAdmissionAnnotationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotationId, string>>;
|
|
133
|
+
annotatorId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotatorId, string>>;
|
|
134
|
+
version: z.ZodString;
|
|
135
|
+
status: z.ZodLiteral<"success">;
|
|
136
|
+
text: z.ZodString;
|
|
137
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotationId, string>>;
|
|
139
|
+
annotatorId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotatorId, string>>;
|
|
140
|
+
version: z.ZodString;
|
|
141
|
+
status: z.ZodEnum<{
|
|
142
|
+
timeout: "timeout";
|
|
143
|
+
failed: "failed";
|
|
144
|
+
}>;
|
|
145
|
+
}, z.core.$strip>], "status">;
|
|
146
|
+
/** Parser for the frozen batch retained until its exact Session append commits. */
|
|
147
|
+
export declare const imPendingAdmissionSchema: z.ZodObject<{
|
|
148
|
+
annotations: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
149
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotationId, string>>;
|
|
150
|
+
annotatorId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotatorId, string>>;
|
|
151
|
+
version: z.ZodString;
|
|
152
|
+
status: z.ZodLiteral<"success">;
|
|
153
|
+
text: z.ZodString;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotationId, string>>;
|
|
156
|
+
annotatorId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionAnnotatorId, string>>;
|
|
157
|
+
version: z.ZodString;
|
|
158
|
+
status: z.ZodEnum<{
|
|
159
|
+
timeout: "timeout";
|
|
160
|
+
failed: "failed";
|
|
161
|
+
}>;
|
|
162
|
+
}, z.core.$strip>], "status">>>;
|
|
163
|
+
handlingEpoch: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
admissionId: z.ZodPipe<z.ZodString, z.ZodTransform<ImAdmissionId, string>>;
|
|
165
|
+
messageIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ImMessageId, string>>>;
|
|
166
|
+
triggerReasons: z.ZodArray<z.ZodEnum<{
|
|
167
|
+
direct: "direct";
|
|
168
|
+
mention: "mention";
|
|
169
|
+
"every-n": "every-n";
|
|
170
|
+
"fixed-interval": "fixed-interval";
|
|
171
|
+
}>>;
|
|
172
|
+
createdAt: z.ZodISODateTime;
|
|
173
|
+
}, z.core.$strip>;
|
|
50
174
|
/** Parser for one route-bound Agent task generation. */
|
|
51
175
|
export declare const imExecutionAggregateSchema: ZodType<ImExecutionAggregate>;
|
|
52
176
|
export {};
|