@linxiraos/pi-messenger 1.4.13 → 1.5.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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/teamagent-command.ts +17 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.5.0] - 2026-11-09
|
|
4
|
+
|
|
5
|
+
- Released as part of Zeta 1.5.0. `pi-messenger` remains the bundled official plugin (Crew/Mesh); its `/teamagent` command is the plugin's crew layer, not Zeta Team, and does not read the Team database.
|
|
6
|
+
|
|
3
7
|
## [1.4.13] - 2026-11-08
|
|
4
8
|
|
|
5
9
|
- Released as part of Zeta 1.4.13.
|
package/package.json
CHANGED
package/teamagent-command.ts
CHANGED
|
@@ -125,11 +125,7 @@ export function addTeamAgent(
|
|
|
125
125
|
}
|
|
126
126
|
// Non-editing crew roles are read-only by contract; without an allowlist the
|
|
127
127
|
// spawned agent would inherit every tool. An explicit role.tools wins.
|
|
128
|
-
const tools = role.tools?.length
|
|
129
|
-
? role.tools
|
|
130
|
-
: isNonEditingTeamRole(name)
|
|
131
|
-
? [...NON_EDITING_ROLE_TOOLS]
|
|
132
|
-
: undefined;
|
|
128
|
+
const tools = role.tools?.length ? role.tools : isNonEditingTeamRole(name) ? [...NON_EDITING_ROLE_TOOLS] : undefined;
|
|
133
129
|
fs.mkdirSync(dir, { recursive: true });
|
|
134
130
|
fs.writeFileSync(filePath, renderAgentMarkdown({ ...role, name, tools }), "utf8");
|
|
135
131
|
return { ok: true, message: `Registered ${name} (${scope} scope)`, filePath };
|
|
@@ -162,6 +158,9 @@ export function listTeamAgents(scope: "project" | "user", cwd: string): string[]
|
|
|
162
158
|
.sort();
|
|
163
159
|
}
|
|
164
160
|
|
|
161
|
+
const CREW_SETUP_HINT = 'pi_messenger({ action: "team.setup", name: "<name>" })';
|
|
162
|
+
const CREW_CHARTER_HINT = 'pi_messenger({ action: "team.charter.create", name: "<name>", message: "<text>" })';
|
|
163
|
+
|
|
165
164
|
function twoCol(rows: Array<[string, string]>, gap = 2): string {
|
|
166
165
|
if (rows.length === 0) return "(none)";
|
|
167
166
|
const width = Math.max(...rows.map(([left]) => left.length));
|
|
@@ -172,9 +171,9 @@ function profiles(cwd: string): string {
|
|
|
172
171
|
const active = teamStore.getActiveTeam(cwd);
|
|
173
172
|
const saved = teamStore.listProfiles();
|
|
174
173
|
const lines = [
|
|
175
|
-
`Active
|
|
174
|
+
`Active crew: ${active ? `${active.name} (profile: ${active.profile ?? "default"})` : `(none — run ${CREW_SETUP_HINT})`}`,
|
|
176
175
|
"",
|
|
177
|
-
"
|
|
176
|
+
"Crew profiles:",
|
|
178
177
|
twoCol(saved.map(profile => [profile.name, profile.description ?? ""] as [string, string])),
|
|
179
178
|
];
|
|
180
179
|
return lines.join("\n");
|
|
@@ -190,14 +189,14 @@ function roles(cwd: string): string {
|
|
|
190
189
|
|
|
191
190
|
function status(cwd: string): string {
|
|
192
191
|
const team = teamStore.getActiveTeam(cwd);
|
|
193
|
-
if (!team) return
|
|
192
|
+
if (!team) return `No active crew in this project. Activate one with ${CREW_SETUP_HINT}.`;
|
|
194
193
|
const profile = teamStore.loadActiveProfile(cwd);
|
|
195
194
|
const counts = teamStore.memoryCounts(cwd);
|
|
196
195
|
const memory = Object.entries(counts)
|
|
197
196
|
.map(([type, count]) => `${type}=${count}`)
|
|
198
197
|
.join(" ");
|
|
199
198
|
return [
|
|
200
|
-
`
|
|
199
|
+
`Crew: ${team.name}`,
|
|
201
200
|
`Profile: ${team.profile ?? "default"}`,
|
|
202
201
|
`Description: ${profile?.description ?? "(none)"}`,
|
|
203
202
|
`Memory: ${memory || "(empty)"}`,
|
|
@@ -207,20 +206,20 @@ function status(cwd: string): string {
|
|
|
207
206
|
|
|
208
207
|
function charter(cwd: string): string {
|
|
209
208
|
const text = teamStore.readCharter(cwd);
|
|
210
|
-
return text ??
|
|
209
|
+
return text ?? `No charter yet. Create one with ${CREW_CHARTER_HINT}.`;
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
const SUBCOMMANDS: Record<string, { description: string; run: (cwd: string, rest: string) => string }> = {
|
|
214
|
-
"profile.list": { description: "List
|
|
213
|
+
"profile.list": { description: "List crew profiles and the active crew", run: profiles },
|
|
215
214
|
roles: { description: "List resolvable roles (built-in + profile overrides)", run: roles },
|
|
216
|
-
status: { description: "Show active
|
|
217
|
-
"charter.show": { description: "Print the active
|
|
215
|
+
status: { description: "Show active crew, memory counts and charter state", run: status },
|
|
216
|
+
"charter.show": { description: "Print the active crew charter", run: charter },
|
|
218
217
|
};
|
|
219
218
|
|
|
220
219
|
/** Registered slash command: /teamagent <add|list|remove> … */
|
|
221
220
|
export function registerTeamAgentCommand(pi: ExtensionAPI): void {
|
|
222
221
|
pi.registerCommand("teamagent", {
|
|
223
|
-
description: "Register crew roles as spawnable subagents
|
|
222
|
+
description: "Register pi-messenger crew roles as spawnable subagents",
|
|
224
223
|
getArgumentCompletions: prefix => {
|
|
225
224
|
const token = prefix.trim().toLowerCase();
|
|
226
225
|
const verbs = ["roles", "status", "profile.list", "charter.show", "agents", "add", "remove"].filter(v =>
|
|
@@ -239,14 +238,14 @@ export function registerTeamAgentCommand(pi: ExtensionAPI): void {
|
|
|
239
238
|
[
|
|
240
239
|
"Usage:",
|
|
241
240
|
" /teamagent roles list crew roles",
|
|
242
|
-
" /teamagent status active
|
|
243
|
-
" /teamagent profile.list
|
|
241
|
+
" /teamagent status active crew, memory, charter",
|
|
242
|
+
" /teamagent profile.list crew profiles",
|
|
244
243
|
" /teamagent charter.show print the charter",
|
|
245
244
|
" /teamagent agents list registered subagents",
|
|
246
245
|
" /teamagent add <role> [--project|--user] register a crew role as a spawnable subagent",
|
|
247
246
|
" /teamagent remove <name> [--project|--user]",
|
|
248
247
|
"",
|
|
249
|
-
|
|
248
|
+
'Scope defaults to the project (<cwd>/.zeta/agents, requires "trustProjectAgents": true',
|
|
250
249
|
" in <cwd>/.zeta/pi-messenger.json); --project names that default explicitly and",
|
|
251
250
|
" --user writes ~/.zeta/agent/agents. --user and --project cannot be combined.",
|
|
252
251
|
].join("\n"),
|
|
@@ -349,9 +348,7 @@ export function registerTeamAgentCommand(pi: ExtensionAPI): void {
|
|
|
349
348
|
return;
|
|
350
349
|
}
|
|
351
350
|
|
|
352
|
-
reply(
|
|
353
|
-
`Unknown subcommand "${verb}". Use roles, status, profile.list, charter.show, agents, add or remove.`,
|
|
354
|
-
);
|
|
351
|
+
reply(`Unknown subcommand "${verb}". Use roles, status, profile.list, charter.show, agents, add or remove.`);
|
|
355
352
|
},
|
|
356
353
|
});
|
|
357
354
|
}
|