multiclaws 0.4.41 → 0.4.43

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.
Files changed (39) hide show
  1. package/README.md +2 -0
  2. package/dist/gateway/handlers.d.ts +4 -4
  3. package/dist/gateway/handlers.js +239 -239
  4. package/dist/index.d.ts +8 -8
  5. package/dist/index.js +710 -710
  6. package/dist/infra/frp.d.ts +55 -55
  7. package/dist/infra/frp.js +398 -398
  8. package/dist/infra/gateway-client.d.ts +27 -27
  9. package/dist/infra/gateway-client.js +136 -136
  10. package/dist/infra/json-store.d.ts +4 -4
  11. package/dist/infra/json-store.js +57 -57
  12. package/dist/infra/logger.d.ts +14 -14
  13. package/dist/infra/logger.js +25 -25
  14. package/dist/infra/rate-limiter.d.ts +19 -19
  15. package/dist/infra/rate-limiter.js +69 -69
  16. package/dist/infra/tailscale.d.ts +19 -19
  17. package/dist/infra/tailscale.js +120 -120
  18. package/dist/infra/telemetry.d.ts +3 -3
  19. package/dist/infra/telemetry.js +17 -17
  20. package/dist/infra/version.d.ts +1 -1
  21. package/dist/infra/version.js +19 -19
  22. package/dist/service/a2a-adapter.d.ts +80 -80
  23. package/dist/service/a2a-adapter.js +505 -505
  24. package/dist/service/agent-profile.d.ts +17 -17
  25. package/dist/service/agent-profile.js +58 -58
  26. package/dist/service/agent-registry.d.ts +29 -29
  27. package/dist/service/agent-registry.js +131 -131
  28. package/dist/service/multiclaws-service.d.ts +150 -150
  29. package/dist/service/multiclaws-service.js +1137 -1137
  30. package/dist/service/session-store.d.ts +46 -46
  31. package/dist/service/session-store.js +143 -143
  32. package/dist/task/tracker.d.ts +46 -46
  33. package/dist/task/tracker.js +191 -191
  34. package/dist/team/team-store.d.ts +42 -42
  35. package/dist/team/team-store.js +195 -195
  36. package/dist/types/openclaw.d.ts +109 -109
  37. package/dist/types/openclaw.js +2 -2
  38. package/package.json +1 -1
  39. package/skills/meeting-scheduler/SKILL.md +112 -105
@@ -1,80 +1,80 @@
1
- import type { AgentExecutor, ExecutionEventBus, RequestContext } from "@a2a-js/sdk/server";
2
- import { type GatewayConfig } from "../infra/gateway-client";
3
- import type { TaskTracker } from "../task/tracker";
4
- import type { NotificationTarget } from "./multiclaws-service";
5
- export type A2AAdapterOptions = {
6
- gatewayConfig: GatewayConfig | null;
7
- taskTracker: TaskTracker;
8
- cwd?: string;
9
- getNotificationTargets?: () => ReadonlyMap<string, NotificationTarget>;
10
- /** Called when a session is discovered via fallback; allows service to cache it for future use. */
11
- registerDiscoveredTarget?: (sessionKey: string) => void;
12
- logger: {
13
- info: (msg: string) => void;
14
- warn: (msg: string) => void;
15
- error: (msg: string) => void;
16
- };
17
- };
18
- /**
19
- * Bridges the A2A protocol to OpenClaw's session injection mechanism.
20
- *
21
- * When a remote agent sends a task via A2A `message/send`,
22
- * this executor:
23
- * 1. Classifies the task risk (safe vs risky)
24
- * 2. For risky tasks: pushes approval request to the user's active session and waits
25
- * For safe tasks: proceeds immediately
26
- * 3. Finds the target session (where user last sent a message, or main session)
27
- * 4. Injects the task into that session via sessions_send — no isolated sub-session created
28
- * 5. Waits for the session AI to call back via `multiclaws_a2a_callback`
29
- * 6. Returns the final result as a Message
30
- */
31
- export declare class OpenClawAgentExecutor implements AgentExecutor {
32
- private gatewayConfig;
33
- private readonly taskTracker;
34
- private readonly getNotificationTargets;
35
- private readonly registerDiscoveredTarget;
36
- private readonly logger;
37
- private readonly cwd;
38
- private readonly pendingCallbacks;
39
- private readonly pendingApprovals;
40
- constructor(options: A2AAdapterOptions);
41
- execute(context: RequestContext, eventBus: ExecutionEventBus): Promise<void>;
42
- /**
43
- * Called by the `multiclaws_a2a_callback` tool when a sub-agent reports its result.
44
- * Returns true if a pending callback was found and resolved.
45
- */
46
- resolveCallback(taskId: string, result: string): boolean;
47
- /**
48
- * Called when the local human owner approves or rejects a pending risky task.
49
- * Returns true if a pending approval was found.
50
- */
51
- resolveApproval(taskId: string, approved: boolean): boolean;
52
- cancelTask(taskId: string, eventBus: ExecutionEventBus): Promise<void>;
53
- updateGatewayConfig(config: GatewayConfig): void;
54
- /**
55
- * Create a pending callback that resolves when the sub-agent reports back,
56
- * or rejects on timeout.
57
- */
58
- private createCallback;
59
- /**
60
- * Create a pending approval that resolves when the human owner responds,
61
- * or rejects on timeout or cancellation.
62
- */
63
- private createApprovalCallback;
64
- /**
65
- * Find the best target session for task injection:
66
- * 1. Prefer the session where the user most recently sent a message (role === "user")
67
- * 2. Fall back to the first non-internal active session (typically the main webchat session)
68
- * Never returns internal sessions (delegate-*, a2a-*).
69
- */
70
- private findTargetSession;
71
- /**
72
- * Discover the most recently active non-internal session via sessions_list.
73
- * Used as fallback when no notification targets have been registered yet
74
- * (e.g. right after a gateway restart before the user sends their first message).
75
- */
76
- private discoverActiveSession;
77
- /** Send a notification to all known targets. Individual failures are silently ignored. */
78
- private notifyUser;
79
- private publishMessage;
80
- }
1
+ import type { AgentExecutor, ExecutionEventBus, RequestContext } from "@a2a-js/sdk/server";
2
+ import { type GatewayConfig } from "../infra/gateway-client";
3
+ import type { TaskTracker } from "../task/tracker";
4
+ import type { NotificationTarget } from "./multiclaws-service";
5
+ export type A2AAdapterOptions = {
6
+ gatewayConfig: GatewayConfig | null;
7
+ taskTracker: TaskTracker;
8
+ cwd?: string;
9
+ getNotificationTargets?: () => ReadonlyMap<string, NotificationTarget>;
10
+ /** Called when a session is discovered via fallback; allows service to cache it for future use. */
11
+ registerDiscoveredTarget?: (sessionKey: string) => void;
12
+ logger: {
13
+ info: (msg: string) => void;
14
+ warn: (msg: string) => void;
15
+ error: (msg: string) => void;
16
+ };
17
+ };
18
+ /**
19
+ * Bridges the A2A protocol to OpenClaw's session injection mechanism.
20
+ *
21
+ * When a remote agent sends a task via A2A `message/send`,
22
+ * this executor:
23
+ * 1. Classifies the task risk (safe vs risky)
24
+ * 2. For risky tasks: pushes approval request to the user's active session and waits
25
+ * For safe tasks: proceeds immediately
26
+ * 3. Finds the target session (where user last sent a message, or main session)
27
+ * 4. Injects the task into that session via sessions_send — no isolated sub-session created
28
+ * 5. Waits for the session AI to call back via `multiclaws_a2a_callback`
29
+ * 6. Returns the final result as a Message
30
+ */
31
+ export declare class OpenClawAgentExecutor implements AgentExecutor {
32
+ private gatewayConfig;
33
+ private readonly taskTracker;
34
+ private readonly getNotificationTargets;
35
+ private readonly registerDiscoveredTarget;
36
+ private readonly logger;
37
+ private readonly cwd;
38
+ private readonly pendingCallbacks;
39
+ private readonly pendingApprovals;
40
+ constructor(options: A2AAdapterOptions);
41
+ execute(context: RequestContext, eventBus: ExecutionEventBus): Promise<void>;
42
+ /**
43
+ * Called by the `multiclaws_a2a_callback` tool when a sub-agent reports its result.
44
+ * Returns true if a pending callback was found and resolved.
45
+ */
46
+ resolveCallback(taskId: string, result: string): boolean;
47
+ /**
48
+ * Called when the local human owner approves or rejects a pending risky task.
49
+ * Returns true if a pending approval was found.
50
+ */
51
+ resolveApproval(taskId: string, approved: boolean): boolean;
52
+ cancelTask(taskId: string, eventBus: ExecutionEventBus): Promise<void>;
53
+ updateGatewayConfig(config: GatewayConfig): void;
54
+ /**
55
+ * Create a pending callback that resolves when the sub-agent reports back,
56
+ * or rejects on timeout.
57
+ */
58
+ private createCallback;
59
+ /**
60
+ * Create a pending approval that resolves when the human owner responds,
61
+ * or rejects on timeout or cancellation.
62
+ */
63
+ private createApprovalCallback;
64
+ /**
65
+ * Find the best target session for task injection:
66
+ * 1. Prefer the session where the user most recently sent a message (role === "user")
67
+ * 2. Fall back to the first non-internal active session (typically the main webchat session)
68
+ * Never returns internal sessions (delegate-*, a2a-*).
69
+ */
70
+ private findTargetSession;
71
+ /**
72
+ * Discover the most recently active non-internal session via sessions_list.
73
+ * Used as fallback when no notification targets have been registered yet
74
+ * (e.g. right after a gateway restart before the user sends their first message).
75
+ */
76
+ private discoverActiveSession;
77
+ /** Send a notification to all known targets. Individual failures are silently ignored. */
78
+ private notifyUser;
79
+ private publishMessage;
80
+ }