openclaw-lark-multi-agent 1.5.1 → 1.7.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.
@@ -0,0 +1,148 @@
1
+ import type { GoExecutorResult } from "./go-execution.js";
2
+ /** Independent LMA supervision. MessageStore owns objective, criteria and completion. */
3
+ import { type GoRuntimeSnapshot } from "./go-runtime-gate.js";
4
+ export type GoClient = {
5
+ /** Backed by plugin enforced runtime policy, never a prompt assertion. */
6
+ verifyGoSafety?(executorKey: string): Promise<{
7
+ checkerToolsIsolated: boolean;
8
+ exactTaskAndDeliveryGate: boolean;
9
+ guardedSend: boolean;
10
+ }>;
11
+ sendGoGuarded?(p: {
12
+ sessionKey: string;
13
+ sessionId: string;
14
+ expectedLeafEntryId: string | null;
15
+ message: string;
16
+ idempotencyKey: string;
17
+ }): Promise<{
18
+ runId: string;
19
+ }>;
20
+ collectGoRun?(p: {
21
+ runId: string;
22
+ sessionKey: string;
23
+ timeoutMs: number;
24
+ sessionId?: string;
25
+ }): Promise<string>;
26
+ collectGoExecutorRun?(p: {
27
+ runId: string;
28
+ sessionKey: string;
29
+ sessionId: string;
30
+ timeoutMs: number;
31
+ }): Promise<GoExecutorResult>;
32
+ readGoExecutorRunResult?(p: {
33
+ runId: string;
34
+ sessionKey: string;
35
+ sessionId: string;
36
+ }): Promise<GoExecutorResult | null>;
37
+ readGoRunResult?(p: {
38
+ sessionKey: string;
39
+ sessionId: string;
40
+ runId: string;
41
+ }): Promise<string | null>;
42
+ reconcileGoSend?(p: {
43
+ sessionKey: string;
44
+ sessionId: string;
45
+ idempotencyKey: string;
46
+ }): Promise<{
47
+ runId: string;
48
+ } | null>;
49
+ initializeGoRuntime?(p: {
50
+ goId: number;
51
+ goal: string;
52
+ executorSessionKey: string;
53
+ executorSessionId: string;
54
+ checkerSessionKey: string;
55
+ checkerSessionId: string;
56
+ }): Promise<{
57
+ nativeGoalId?: string;
58
+ executorSessionId: string;
59
+ checkerSessionId: string;
60
+ checkerRunId: string;
61
+ executorRunIds: string[];
62
+ goalUpdatedAt?: number;
63
+ goalRevision?: number;
64
+ }>;
65
+ readGoRuntimeSnapshot?(sessionKey: string, sessionId: string): Promise<GoRuntimeSnapshot>;
66
+ getSessionInfo(key: string): Promise<any>;
67
+ getGoSessionInfo?(key: string): Promise<any>;
68
+ getSessionRuntimeStatus(key: string): Promise<any>;
69
+ createSession(params: {
70
+ key: string;
71
+ model: string;
72
+ label?: string;
73
+ }): Promise<any>;
74
+ };
75
+ export type GoControllerDeps = {
76
+ botName: string;
77
+ fallbackModel: string;
78
+ store: import("./message-store.js").MessageStore;
79
+ client: GoClient;
80
+ /** Executor session key for a chat (e.g. lma-<bot>-<chatId>). */
81
+ executorSessionKeyFor: (chatId: string) => string;
82
+ /** Feishu group/p2p notification. */
83
+ notify: (chatId: string, text: string) => Promise<unknown>;
84
+ /** Feishu reply to the command message. */
85
+ reply: (messageId: string, text: string) => Promise<unknown>;
86
+ /** Register/deliver an exact executor result through the ordinary durable outbox. */
87
+ deliverExecutorResult?: (chatId: string, result: GoExecutorResult, goId: number) => Promise<void>;
88
+ log?: (msg: string) => void;
89
+ };
90
+ type ParsedVerdict = {
91
+ action: "WAIT" | "CONTINUE" | "COMPLETE";
92
+ summary: string;
93
+ missing: string[];
94
+ message: string;
95
+ evidenceRefs: string[];
96
+ criteriaEvidence: Record<string, string[]>;
97
+ };
98
+ /** Strict single JSON object; no surrounding prose, extra fields or truncation. */
99
+ export declare function parseGoVerdict(raw: string): ParsedVerdict | {
100
+ error: string;
101
+ };
102
+ export declare class GoController {
103
+ private readonly d;
104
+ private disposed;
105
+ private readonly timers;
106
+ private readonly cancelledStarts;
107
+ private readonly starting;
108
+ private readonly inFlightCycles;
109
+ constructor(d: GoControllerDeps);
110
+ private log;
111
+ private jobKey;
112
+ footerMarker(chatId: string): string | null;
113
+ private guardedRequest;
114
+ handleGoCommand(chatId: string, messageId: string, args: string): Promise<unknown>;
115
+ private replyStatus;
116
+ private safetyUnavailable;
117
+ private start;
118
+ private startReserved;
119
+ /** Called after the bridge has cleared only the original command pending row. */
120
+ onCommandSettled(chatId: string): void;
121
+ private pauseByChat;
122
+ private reconcileSends;
123
+ private deliverExecutorAction;
124
+ private resumeByChat;
125
+ private stopByChat;
126
+ /** Pause supervision without a command reply (e.g. as a /stop side-effect). */
127
+ pauseSilently(chatId: string, reason: string): Promise<void>;
128
+ /** Any new authorized human input invalidates an outstanding verdict immediately. */
129
+ onHumanInput(chatId: string): void;
130
+ /** Executor session was reset/replaced/archived: pause supervision, never auto-migrate. */
131
+ onExecutorSessionChanged(chatId: string, reason: string): Promise<void>;
132
+ /** Record a terminal run outcome as evidence (dedup by sourceKey), then arm a debounced check. */
133
+ notifyRunOutcome(chatId: string, kind: "assistant_reply" | "run_error" | "no_reply", sourceKey: string, content: string): void;
134
+ /** Terminal/delivery evidence of a Controller-owned run stays with its own job,
135
+ * even if /go stop + a new Go happened while it was running. */
136
+ notifyExactRunOutcome(goId: number, kind: "assistant_reply" | "run_error" | "no_reply", sourceKey: string, content: string, sessionId: string, runId: string): void;
137
+ private clearTimer;
138
+ private scheduleCheck;
139
+ private executorBusy;
140
+ private runCheckCycle;
141
+ private bootstrapExecutor;
142
+ private runCheck;
143
+ private applyVerdict;
144
+ /** Re-verify active jobs after a process restart; pause on executor generation mismatch. */
145
+ recoverOnStartup(): Promise<void>;
146
+ dispose(): void;
147
+ }
148
+ export {};