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,17 +1,17 @@
1
- import type { BasicLogger } from "../infra/logger";
2
- export type AgentProfile = {
3
- ownerName: string;
4
- /** Free-form markdown describing this agent: role, capabilities, data sources, etc. */
5
- bio: string;
6
- };
7
- export declare function renderProfileDescription(profile: AgentProfile): string;
8
- export declare function formatAgentCardName(ownerName: string): string;
9
- export declare class ProfileStore {
10
- private readonly filePath;
11
- private readonly logger?;
12
- constructor(filePath: string, logger?: BasicLogger | undefined);
13
- private log;
14
- load(): Promise<AgentProfile>;
15
- save(profile: AgentProfile): Promise<void>;
16
- update(patch: Partial<AgentProfile>): Promise<AgentProfile>;
17
- }
1
+ import type { BasicLogger } from "../infra/logger";
2
+ export type AgentProfile = {
3
+ ownerName: string;
4
+ /** Free-form markdown describing this agent: role, capabilities, data sources, etc. */
5
+ bio: string;
6
+ };
7
+ export declare function renderProfileDescription(profile: AgentProfile): string;
8
+ export declare function formatAgentCardName(ownerName: string): string;
9
+ export declare class ProfileStore {
10
+ private readonly filePath;
11
+ private readonly logger?;
12
+ constructor(filePath: string, logger?: BasicLogger | undefined);
13
+ private log;
14
+ load(): Promise<AgentProfile>;
15
+ save(profile: AgentProfile): Promise<void>;
16
+ update(patch: Partial<AgentProfile>): Promise<AgentProfile>;
17
+ }
@@ -1,58 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProfileStore = void 0;
4
- exports.renderProfileDescription = renderProfileDescription;
5
- exports.formatAgentCardName = formatAgentCardName;
6
- const json_store_1 = require("../infra/json-store");
7
- function emptyProfile() {
8
- return { ownerName: "", bio: "" };
9
- }
10
- function renderProfileDescription(profile) {
11
- return profile.bio?.trim() || "OpenClaw agent";
12
- }
13
- function formatAgentCardName(ownerName) {
14
- return `${ownerName} 的 OpenClaw`;
15
- }
16
- class ProfileStore {
17
- filePath;
18
- logger;
19
- constructor(filePath, logger) {
20
- this.filePath = filePath;
21
- this.logger = logger;
22
- }
23
- log(level, message) {
24
- const fn = level === "debug" ? this.logger?.debug : this.logger?.[level];
25
- fn?.(`[profile-store] ${message}`);
26
- }
27
- async load() {
28
- return await (0, json_store_1.readJsonWithFallback)(this.filePath, emptyProfile());
29
- }
30
- async save(profile) {
31
- this.log("debug", `save(ownerName=${profile.ownerName})`);
32
- try {
33
- await (0, json_store_1.writeJsonAtomically)(this.filePath, profile);
34
- }
35
- catch (err) {
36
- this.log("error", `save failed: ${err instanceof Error ? err.message : String(err)}`);
37
- throw err;
38
- }
39
- }
40
- async update(patch) {
41
- this.log("debug", `update(keys=${Object.keys(patch).join(",")})`);
42
- try {
43
- const profile = await this.load();
44
- if (patch.ownerName !== undefined)
45
- profile.ownerName = patch.ownerName;
46
- if (patch.bio !== undefined)
47
- profile.bio = patch.bio;
48
- await this.save(profile);
49
- this.log("debug", `update completed`);
50
- return profile;
51
- }
52
- catch (err) {
53
- this.log("error", `update failed: ${err instanceof Error ? err.message : String(err)}`);
54
- throw err;
55
- }
56
- }
57
- }
58
- exports.ProfileStore = ProfileStore;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProfileStore = void 0;
4
+ exports.renderProfileDescription = renderProfileDescription;
5
+ exports.formatAgentCardName = formatAgentCardName;
6
+ const json_store_1 = require("../infra/json-store");
7
+ function emptyProfile() {
8
+ return { ownerName: "", bio: "" };
9
+ }
10
+ function renderProfileDescription(profile) {
11
+ return profile.bio?.trim() || "OpenClaw agent";
12
+ }
13
+ function formatAgentCardName(ownerName) {
14
+ return `${ownerName} 的 OpenClaw`;
15
+ }
16
+ class ProfileStore {
17
+ filePath;
18
+ logger;
19
+ constructor(filePath, logger) {
20
+ this.filePath = filePath;
21
+ this.logger = logger;
22
+ }
23
+ log(level, message) {
24
+ const fn = level === "debug" ? this.logger?.debug : this.logger?.[level];
25
+ fn?.(`[profile-store] ${message}`);
26
+ }
27
+ async load() {
28
+ return await (0, json_store_1.readJsonWithFallback)(this.filePath, emptyProfile());
29
+ }
30
+ async save(profile) {
31
+ this.log("debug", `save(ownerName=${profile.ownerName})`);
32
+ try {
33
+ await (0, json_store_1.writeJsonAtomically)(this.filePath, profile);
34
+ }
35
+ catch (err) {
36
+ this.log("error", `save failed: ${err instanceof Error ? err.message : String(err)}`);
37
+ throw err;
38
+ }
39
+ }
40
+ async update(patch) {
41
+ this.log("debug", `update(keys=${Object.keys(patch).join(",")})`);
42
+ try {
43
+ const profile = await this.load();
44
+ if (patch.ownerName !== undefined)
45
+ profile.ownerName = patch.ownerName;
46
+ if (patch.bio !== undefined)
47
+ profile.bio = patch.bio;
48
+ await this.save(profile);
49
+ this.log("debug", `update completed`);
50
+ return profile;
51
+ }
52
+ catch (err) {
53
+ this.log("error", `update failed: ${err instanceof Error ? err.message : String(err)}`);
54
+ throw err;
55
+ }
56
+ }
57
+ }
58
+ exports.ProfileStore = ProfileStore;
@@ -1,29 +1,29 @@
1
- import type { BasicLogger } from "../infra/logger";
2
- export type AgentRecord = {
3
- url: string;
4
- name: string;
5
- description: string;
6
- skills: string[];
7
- apiKey?: string;
8
- addedAtMs: number;
9
- lastSeenAtMs: number;
10
- };
11
- export declare class AgentRegistry {
12
- private readonly filePath;
13
- private readonly logger?;
14
- constructor(filePath: string, logger?: BasicLogger | undefined);
15
- private log;
16
- private readStore;
17
- add(params: {
18
- url: string;
19
- name: string;
20
- description?: string;
21
- skills?: string[];
22
- apiKey?: string;
23
- }): Promise<AgentRecord>;
24
- remove(url: string): Promise<boolean>;
25
- list(): Promise<AgentRecord[]>;
26
- get(url: string): Promise<AgentRecord | null>;
27
- updateDescription(url: string, description: string): Promise<void>;
28
- updateLastSeen(url: string): Promise<void>;
29
- }
1
+ import type { BasicLogger } from "../infra/logger";
2
+ export type AgentRecord = {
3
+ url: string;
4
+ name: string;
5
+ description: string;
6
+ skills: string[];
7
+ apiKey?: string;
8
+ addedAtMs: number;
9
+ lastSeenAtMs: number;
10
+ };
11
+ export declare class AgentRegistry {
12
+ private readonly filePath;
13
+ private readonly logger?;
14
+ constructor(filePath: string, logger?: BasicLogger | undefined);
15
+ private log;
16
+ private readStore;
17
+ add(params: {
18
+ url: string;
19
+ name: string;
20
+ description?: string;
21
+ skills?: string[];
22
+ apiKey?: string;
23
+ }): Promise<AgentRecord>;
24
+ remove(url: string): Promise<boolean>;
25
+ list(): Promise<AgentRecord[]>;
26
+ get(url: string): Promise<AgentRecord | null>;
27
+ updateDescription(url: string, description: string): Promise<void>;
28
+ updateLastSeen(url: string): Promise<void>;
29
+ }
@@ -1,131 +1,131 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentRegistry = void 0;
4
- const json_store_1 = require("../infra/json-store");
5
- function emptyStore() {
6
- return { version: 1, agents: [] };
7
- }
8
- function normalizeStore(raw) {
9
- if (raw.version !== 1 || !Array.isArray(raw.agents)) {
10
- return emptyStore();
11
- }
12
- return {
13
- version: 1,
14
- agents: raw.agents.filter((a) => a &&
15
- typeof a.url === "string" &&
16
- typeof a.name === "string" &&
17
- typeof a.addedAtMs === "number"),
18
- };
19
- }
20
- class AgentRegistry {
21
- filePath;
22
- logger;
23
- constructor(filePath, logger) {
24
- this.filePath = filePath;
25
- this.logger = logger;
26
- }
27
- log(level, message) {
28
- const fn = level === "debug" ? this.logger?.debug : this.logger?.[level];
29
- fn?.(`[agent-registry] ${message}`);
30
- }
31
- async readStore() {
32
- const store = await (0, json_store_1.readJsonWithFallback)(this.filePath, emptyStore());
33
- return normalizeStore(store);
34
- }
35
- async add(params) {
36
- const normalizedUrl = params.url.replace(/\/+$/, "");
37
- this.log("debug", `add(url=${normalizedUrl}, name=${params.name})`);
38
- try {
39
- const result = await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
40
- const store = await this.readStore();
41
- const existing = store.agents.findIndex((a) => a.url === normalizedUrl);
42
- const now = Date.now();
43
- const record = {
44
- url: normalizedUrl,
45
- name: params.name,
46
- description: params.description ?? "",
47
- skills: params.skills ?? [],
48
- apiKey: params.apiKey,
49
- addedAtMs: existing >= 0 ? store.agents[existing].addedAtMs : now,
50
- lastSeenAtMs: now,
51
- };
52
- if (existing >= 0) {
53
- store.agents[existing] = record;
54
- }
55
- else {
56
- store.agents.push(record);
57
- }
58
- await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
59
- return record;
60
- });
61
- this.log("debug", `add completed, agent=${result.name}`);
62
- return result;
63
- }
64
- catch (err) {
65
- this.log("error", `add failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
66
- throw err;
67
- }
68
- }
69
- async remove(url) {
70
- const normalizedUrl = url.replace(/\/+$/, "");
71
- this.log("debug", `remove(url=${normalizedUrl})`);
72
- try {
73
- const result = await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
74
- const store = await this.readStore();
75
- const before = store.agents.length;
76
- store.agents = store.agents.filter((a) => a.url !== normalizedUrl);
77
- if (store.agents.length === before) {
78
- return false;
79
- }
80
- await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
81
- return true;
82
- });
83
- this.log("debug", `remove completed, found=${result}`);
84
- return result;
85
- }
86
- catch (err) {
87
- this.log("error", `remove failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
88
- throw err;
89
- }
90
- }
91
- async list() {
92
- const store = await this.readStore();
93
- return [...store.agents].sort((a, b) => b.lastSeenAtMs - a.lastSeenAtMs);
94
- }
95
- async get(url) {
96
- const store = await this.readStore();
97
- const normalizedUrl = url.replace(/\/+$/, "");
98
- return store.agents.find((a) => a.url === normalizedUrl) ?? null;
99
- }
100
- async updateDescription(url, description) {
101
- const normalizedUrl = url.replace(/\/+$/, "");
102
- this.log("debug", `updateDescription(url=${normalizedUrl})`);
103
- try {
104
- await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
105
- const store = await this.readStore();
106
- const agent = store.agents.find((a) => a.url === normalizedUrl);
107
- if (agent) {
108
- agent.description = description;
109
- agent.lastSeenAtMs = Date.now();
110
- await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
111
- }
112
- });
113
- }
114
- catch (err) {
115
- this.log("error", `updateDescription failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
116
- throw err;
117
- }
118
- }
119
- async updateLastSeen(url) {
120
- await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
121
- const store = await this.readStore();
122
- const normalizedUrl = url.replace(/\/+$/, "");
123
- const agent = store.agents.find((a) => a.url === normalizedUrl);
124
- if (agent) {
125
- agent.lastSeenAtMs = Date.now();
126
- await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
127
- }
128
- });
129
- }
130
- }
131
- exports.AgentRegistry = AgentRegistry;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentRegistry = void 0;
4
+ const json_store_1 = require("../infra/json-store");
5
+ function emptyStore() {
6
+ return { version: 1, agents: [] };
7
+ }
8
+ function normalizeStore(raw) {
9
+ if (raw.version !== 1 || !Array.isArray(raw.agents)) {
10
+ return emptyStore();
11
+ }
12
+ return {
13
+ version: 1,
14
+ agents: raw.agents.filter((a) => a &&
15
+ typeof a.url === "string" &&
16
+ typeof a.name === "string" &&
17
+ typeof a.addedAtMs === "number"),
18
+ };
19
+ }
20
+ class AgentRegistry {
21
+ filePath;
22
+ logger;
23
+ constructor(filePath, logger) {
24
+ this.filePath = filePath;
25
+ this.logger = logger;
26
+ }
27
+ log(level, message) {
28
+ const fn = level === "debug" ? this.logger?.debug : this.logger?.[level];
29
+ fn?.(`[agent-registry] ${message}`);
30
+ }
31
+ async readStore() {
32
+ const store = await (0, json_store_1.readJsonWithFallback)(this.filePath, emptyStore());
33
+ return normalizeStore(store);
34
+ }
35
+ async add(params) {
36
+ const normalizedUrl = params.url.replace(/\/+$/, "");
37
+ this.log("debug", `add(url=${normalizedUrl}, name=${params.name})`);
38
+ try {
39
+ const result = await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
40
+ const store = await this.readStore();
41
+ const existing = store.agents.findIndex((a) => a.url === normalizedUrl);
42
+ const now = Date.now();
43
+ const record = {
44
+ url: normalizedUrl,
45
+ name: params.name,
46
+ description: params.description ?? "",
47
+ skills: params.skills ?? [],
48
+ apiKey: params.apiKey,
49
+ addedAtMs: existing >= 0 ? store.agents[existing].addedAtMs : now,
50
+ lastSeenAtMs: now,
51
+ };
52
+ if (existing >= 0) {
53
+ store.agents[existing] = record;
54
+ }
55
+ else {
56
+ store.agents.push(record);
57
+ }
58
+ await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
59
+ return record;
60
+ });
61
+ this.log("debug", `add completed, agent=${result.name}`);
62
+ return result;
63
+ }
64
+ catch (err) {
65
+ this.log("error", `add failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
66
+ throw err;
67
+ }
68
+ }
69
+ async remove(url) {
70
+ const normalizedUrl = url.replace(/\/+$/, "");
71
+ this.log("debug", `remove(url=${normalizedUrl})`);
72
+ try {
73
+ const result = await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
74
+ const store = await this.readStore();
75
+ const before = store.agents.length;
76
+ store.agents = store.agents.filter((a) => a.url !== normalizedUrl);
77
+ if (store.agents.length === before) {
78
+ return false;
79
+ }
80
+ await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
81
+ return true;
82
+ });
83
+ this.log("debug", `remove completed, found=${result}`);
84
+ return result;
85
+ }
86
+ catch (err) {
87
+ this.log("error", `remove failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
88
+ throw err;
89
+ }
90
+ }
91
+ async list() {
92
+ const store = await this.readStore();
93
+ return [...store.agents].sort((a, b) => b.lastSeenAtMs - a.lastSeenAtMs);
94
+ }
95
+ async get(url) {
96
+ const store = await this.readStore();
97
+ const normalizedUrl = url.replace(/\/+$/, "");
98
+ return store.agents.find((a) => a.url === normalizedUrl) ?? null;
99
+ }
100
+ async updateDescription(url, description) {
101
+ const normalizedUrl = url.replace(/\/+$/, "");
102
+ this.log("debug", `updateDescription(url=${normalizedUrl})`);
103
+ try {
104
+ await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
105
+ const store = await this.readStore();
106
+ const agent = store.agents.find((a) => a.url === normalizedUrl);
107
+ if (agent) {
108
+ agent.description = description;
109
+ agent.lastSeenAtMs = Date.now();
110
+ await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
111
+ }
112
+ });
113
+ }
114
+ catch (err) {
115
+ this.log("error", `updateDescription failed for url=${normalizedUrl}: ${err instanceof Error ? err.message : String(err)}`);
116
+ throw err;
117
+ }
118
+ }
119
+ async updateLastSeen(url) {
120
+ await (0, json_store_1.withJsonLock)(this.filePath, emptyStore(), async () => {
121
+ const store = await this.readStore();
122
+ const normalizedUrl = url.replace(/\/+$/, "");
123
+ const agent = store.agents.find((a) => a.url === normalizedUrl);
124
+ if (agent) {
125
+ agent.lastSeenAtMs = Date.now();
126
+ await (0, json_store_1.writeJsonAtomically)(this.filePath, store);
127
+ }
128
+ });
129
+ }
130
+ }
131
+ exports.AgentRegistry = AgentRegistry;