openclaw-lark-multi-agent 1.6.0 → 1.8.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.
@@ -1,21 +1,76 @@
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";
1
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>;
2
66
  getSessionInfo(key: string): Promise<any>;
67
+ getGoSessionInfo?(key: string): Promise<any>;
3
68
  getSessionRuntimeStatus(key: string): Promise<any>;
4
69
  createSession(params: {
5
70
  key: string;
6
71
  model: string;
7
72
  label?: string;
8
73
  }): Promise<any>;
9
- chatSendWithContext(params: {
10
- sessionKey: string;
11
- unsyncedMessages?: any[];
12
- currentMessage: string;
13
- currentSenderName?: string;
14
- deliver?: boolean;
15
- timeoutMs?: number;
16
- includeContext?: boolean;
17
- includeBridgeAttachmentHint?: boolean;
18
- }): Promise<string>;
19
74
  };
20
75
  export type GoControllerDeps = {
21
76
  botName: string;
@@ -28,6 +83,8 @@ export type GoControllerDeps = {
28
83
  notify: (chatId: string, text: string) => Promise<unknown>;
29
84
  /** Feishu reply to the command message. */
30
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>;
31
88
  log?: (msg: string) => void;
32
89
  };
33
90
  type ParsedVerdict = {
@@ -36,35 +93,52 @@ type ParsedVerdict = {
36
93
  missing: string[];
37
94
  message: string;
38
95
  evidenceRefs: string[];
96
+ criteriaEvidence: Record<string, string[]>;
39
97
  };
40
- /** Strict verdict extraction: first balanced JSON object, schema-validated. */
98
+ /** Strict single JSON object; no surrounding prose, extra fields or truncation. */
41
99
  export declare function parseGoVerdict(raw: string): ParsedVerdict | {
42
100
  error: string;
43
101
  };
44
102
  export declare class GoController {
45
103
  private readonly d;
104
+ private disposed;
46
105
  private readonly timers;
47
- private readonly inFlightChecks;
106
+ private readonly cancelledStarts;
107
+ private readonly starting;
108
+ private readonly inFlightCycles;
48
109
  constructor(d: GoControllerDeps);
49
110
  private log;
50
111
  private jobKey;
51
112
  footerMarker(chatId: string): string | null;
113
+ private guardedRequest;
52
114
  handleGoCommand(chatId: string, messageId: string, args: string): Promise<unknown>;
53
115
  private replyStatus;
116
+ private safetyUnavailable;
54
117
  private start;
118
+ private startReserved;
119
+ /** Called after the bridge has cleared only the original command pending row. */
120
+ onCommandSettled(chatId: string): void;
55
121
  private pauseByChat;
122
+ private reconcileSends;
123
+ private deliverExecutorAction;
56
124
  private resumeByChat;
57
125
  private stopByChat;
58
126
  /** Pause supervision without a command reply (e.g. as a /stop side-effect). */
59
127
  pauseSilently(chatId: string, reason: string): Promise<void>;
128
+ /** Any new authorized human input invalidates an outstanding verdict immediately. */
129
+ onHumanInput(chatId: string): void;
60
130
  /** Executor session was reset/replaced/archived: pause supervision, never auto-migrate. */
61
131
  onExecutorSessionChanged(chatId: string, reason: string): Promise<void>;
62
132
  /** Record a terminal run outcome as evidence (dedup by sourceKey), then arm a debounced check. */
63
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;
64
137
  private clearTimer;
65
138
  private scheduleCheck;
66
139
  private executorBusy;
67
140
  private runCheckCycle;
141
+ private bootstrapExecutor;
68
142
  private runCheck;
69
143
  private applyVerdict;
70
144
  /** Re-verify active jobs after a process restart; pause on executor generation mismatch. */