multiclaws 0.3.2 → 0.3.4
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/dist/index.js
CHANGED
|
@@ -193,7 +193,7 @@ function createTools(getService) {
|
|
|
193
193
|
};
|
|
194
194
|
const multiclawsTeamMembers = {
|
|
195
195
|
name: "multiclaws_team_members",
|
|
196
|
-
description: "List all members of a team.",
|
|
196
|
+
description: "List all members of a team. If teamId is omitted, returns all teams and their members.",
|
|
197
197
|
parameters: {
|
|
198
198
|
type: "object",
|
|
199
199
|
additionalProperties: false,
|
|
@@ -73,6 +73,11 @@ export declare class MulticlawsService extends EventEmitter {
|
|
|
73
73
|
listTeamMembers(teamId?: string): Promise<{
|
|
74
74
|
team: TeamRecord;
|
|
75
75
|
members: TeamMember[];
|
|
76
|
+
} | {
|
|
77
|
+
teams: Array<{
|
|
78
|
+
team: TeamRecord;
|
|
79
|
+
members: TeamMember[];
|
|
80
|
+
}>;
|
|
76
81
|
} | null>;
|
|
77
82
|
private mountTeamRoutes;
|
|
78
83
|
private broadcastProfileToTeams;
|
|
@@ -81,9 +81,12 @@ class MulticlawsService extends node_events_1.EventEmitter {
|
|
|
81
81
|
}
|
|
82
82
|
// Load profile for AgentCard description
|
|
83
83
|
let profile = await this.profileStore.load();
|
|
84
|
+
const isIncompleteProfile = !profile.ownerName?.trim() || !profile.bio?.trim();
|
|
84
85
|
if (!profile.ownerName?.trim()) {
|
|
85
86
|
profile.ownerName = this.options.displayName ?? node_os_1.default.hostname();
|
|
86
87
|
await this.profileStore.save(profile);
|
|
88
|
+
}
|
|
89
|
+
if (isIncompleteProfile) {
|
|
87
90
|
await this.setPendingProfileReview();
|
|
88
91
|
}
|
|
89
92
|
this.profileDescription = (0, agent_profile_1.renderProfileDescription)(profile);
|
|
@@ -382,12 +385,18 @@ class MulticlawsService extends node_events_1.EventEmitter {
|
|
|
382
385
|
this.log("info", `left team ${team.teamId}`);
|
|
383
386
|
}
|
|
384
387
|
async listTeamMembers(teamId) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
388
|
+
if (teamId) {
|
|
389
|
+
const team = await this.teamStore.getTeam(teamId);
|
|
390
|
+
if (!team)
|
|
391
|
+
return null;
|
|
392
|
+
return { team, members: team.members };
|
|
393
|
+
}
|
|
394
|
+
const all = await this.teamStore.listTeams();
|
|
395
|
+
if (all.length === 0)
|
|
389
396
|
return null;
|
|
390
|
-
|
|
397
|
+
if (all.length === 1)
|
|
398
|
+
return { team: all[0], members: all[0].members };
|
|
399
|
+
return { teams: all.map((team) => ({ team, members: team.members })) };
|
|
391
400
|
}
|
|
392
401
|
/* ---------------------------------------------------------------- */
|
|
393
402
|
/* Team REST routes */
|