@linxiraos/pi-messenger 1.1.0 → 1.3.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 +741 -676
- package/LICENSE +45 -0
- package/README.md +424 -424
- package/THIRD-PARTY-NOTICES.txt +22951 -0
- package/config-overlay.ts +175 -171
- package/config.ts +221 -209
- package/crew/agents/crew-plan-sync.md +66 -64
- package/crew/agents/crew-planner.md +173 -172
- package/crew/agents/crew-reviewer.md +58 -58
- package/crew/agents/crew-worker.md +130 -129
- package/crew/agents.ts +507 -434
- package/crew/handlers/coordination.ts +350 -332
- package/crew/handlers/plan.ts +988 -906
- package/crew/handlers/review.ts +354 -333
- package/crew/handlers/revise.ts +400 -376
- package/crew/handlers/status.ts +303 -295
- package/crew/handlers/sync.ts +237 -233
- package/crew/handlers/task.ts +820 -792
- package/crew/handlers/team.ts +294 -235
- package/crew/handlers/work.ts +467 -425
- package/crew/id-allocator.ts +30 -30
- package/crew/index.ts +297 -257
- package/crew/live-progress.ts +58 -58
- package/crew/lobby.ts +504 -473
- package/crew/prompt.ts +262 -252
- package/crew/registry.ts +114 -114
- package/crew/spawn.ts +135 -111
- package/crew/state-autonomous.ts +163 -164
- package/crew/state-planning.ts +264 -263
- package/crew/state.ts +20 -20
- package/crew/store.ts +646 -642
- package/crew/task-actions.ts +162 -131
- package/crew/team/store.ts +572 -479
- package/crew/team/subagent-roles.ts +105 -87
- package/crew/team/types.ts +50 -50
- package/crew/types.ts +194 -194
- package/crew/utils/artifacts.ts +57 -62
- package/crew/utils/config.ts +158 -156
- package/crew/utils/discover.ts +221 -219
- package/crew/utils/install.ts +94 -85
- package/crew/utils/migrations.ts +126 -0
- package/crew/utils/progress.ts +191 -187
- package/crew/utils/result.ts +16 -16
- package/crew/utils/risk-labels.ts +5 -7
- package/crew/utils/task-format.ts +14 -14
- package/crew/utils/team-roles.ts +44 -28
- package/crew/utils/truncate.ts +76 -79
- package/crew/utils/verdict.ts +55 -55
- package/editor-binary.ts +150 -0
- package/editor-command.ts +107 -0
- package/editor-target.ts +40 -0
- package/feed.ts +321 -268
- package/handlers.ts +1041 -1107
- package/index.ts +1314 -1206
- package/install.mjs +187 -189
- package/lib.ts +587 -467
- package/overlay-actions.ts +519 -511
- package/overlay-coordinator.ts +150 -150
- package/overlay-render.ts +770 -676
- package/overlay.ts +872 -830
- package/package.json +64 -60
- package/paths.ts +60 -0
- package/skills/pi-messenger-crew/SKILL.md +375 -347
- package/store.ts +1147 -1139
- package/teamagent-command.ts +321 -0
- package/vitest.config.ts +10 -10
package/install.mjs
CHANGED
|
@@ -1,189 +1,187 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* pi-messenger installer
|
|
5
|
-
*
|
|
6
|
-
* Copies the npm package contents to ~/.pi/agent/extensions/pi-messenger.
|
|
7
|
-
* No git dependency — the npm package IS the source.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* npx pi-messenger # Install or update extension
|
|
11
|
-
* npx pi-messenger --remove # Remove the extension
|
|
12
|
-
* npx pi-messenger --crew-install # Show crew agent info
|
|
13
|
-
* npx pi-messenger --crew-uninstall # Remove crew agents
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import * as fs from "node:fs";
|
|
17
|
-
import * as path from "node:path";
|
|
18
|
-
import * as os from "node:os";
|
|
19
|
-
import { fileURLToPath } from "node:url";
|
|
20
|
-
|
|
21
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
-
const PACKAGE_DIR = path.dirname(__filename);
|
|
23
|
-
const AGENT_DIR = path.join(os.homedir(), ".pi", "agent");
|
|
24
|
-
const EXTENSION_DIR = path.join(AGENT_DIR, "extensions", "pi-messenger");
|
|
25
|
-
const NATIVE_PACKAGE_DIR = path.join(AGENT_DIR, "npm", "node_modules", "pi-messenger");
|
|
26
|
-
const SETTINGS_PATH = path.join(AGENT_DIR, "settings.json");
|
|
27
|
-
const AGENTS_DIR = path.join(AGENT_DIR, "agents");
|
|
28
|
-
|
|
29
|
-
const CREW_AGENTS = [
|
|
30
|
-
"crew-planner.md",
|
|
31
|
-
"crew-interview-generator.md",
|
|
32
|
-
"crew-plan-sync.md",
|
|
33
|
-
"crew-worker.md",
|
|
34
|
-
"crew-reviewer.md",
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const DEPRECATED_AGENTS = [
|
|
38
|
-
"crew-repo-scout.md",
|
|
39
|
-
"crew-practice-scout.md",
|
|
40
|
-
"crew-docs-scout.md",
|
|
41
|
-
"crew-web-scout.md",
|
|
42
|
-
"crew-github-scout.md",
|
|
43
|
-
"crew-gap-analyst.md",
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(PACKAGE_DIR, "package.json"), "utf-8"));
|
|
47
|
-
const VERSION = pkg.version;
|
|
48
|
-
|
|
49
|
-
const args = process.argv.slice(2);
|
|
50
|
-
const isRemove = args.includes("--remove") || args.includes("-r");
|
|
51
|
-
const isCrewInstall = args.includes("--crew-install");
|
|
52
|
-
const isCrewUninstall = args.includes("--crew-uninstall");
|
|
53
|
-
const isHelp = args.includes("--help") || args.includes("-h");
|
|
54
|
-
|
|
55
|
-
if (isHelp) {
|
|
56
|
-
console.log(`
|
|
57
|
-
pi-messenger v${VERSION} - Multi-agent coordination for pi
|
|
58
|
-
|
|
59
|
-
Usage:
|
|
60
|
-
npx pi-messenger Install or update extension
|
|
61
|
-
npx pi-messenger --remove Remove the extension
|
|
62
|
-
npx pi-messenger --crew-install Show crew agent info
|
|
63
|
-
npx pi-messenger --crew-uninstall Remove crew agents
|
|
64
|
-
npx pi-messenger --help Show this help
|
|
65
|
-
|
|
66
|
-
Extension directory: ${EXTENSION_DIR}
|
|
67
|
-
`);
|
|
68
|
-
process.exit(0);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// ─── Crew install ────────────────────────────────────────────────────────────
|
|
72
|
-
|
|
73
|
-
if (isCrewInstall) {
|
|
74
|
-
const agentsDir = path.join(EXTENSION_DIR, "crew", "agents");
|
|
75
|
-
if (!fs.existsSync(agentsDir)) {
|
|
76
|
-
console.log("Extension not installed. Run: npx pi-messenger");
|
|
77
|
-
process.exit(1);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const agents = fs.readdirSync(agentsDir).filter(f => f.endsWith(".md"));
|
|
81
|
-
console.log(`Crew agents (${agents.length}) ship with the extension:`);
|
|
82
|
-
console.log(` ${agentsDir}`);
|
|
83
|
-
for (const agent of agents) {
|
|
84
|
-
console.log(` - ${agent}`);
|
|
85
|
-
}
|
|
86
|
-
console.log("\nTo customize, copy an agent to .pi/messenger/crew/agents/ and edit it.");
|
|
87
|
-
process.exit(0);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// ─── Crew uninstall ──────────────────────────────────────────────────────────
|
|
91
|
-
|
|
92
|
-
if (isCrewUninstall) {
|
|
93
|
-
let removed = 0;
|
|
94
|
-
|
|
95
|
-
for (const agent of [...CREW_AGENTS, ...DEPRECATED_AGENTS]) {
|
|
96
|
-
const target = path.join(AGENTS_DIR, agent);
|
|
97
|
-
if (fs.existsSync(target)) {
|
|
98
|
-
fs.unlinkSync(target);
|
|
99
|
-
removed++;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
console.log(removed > 0
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
console.log("
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
Commands: /messenger, /messenger config
|
|
189
|
-
Docs: ${EXTENSION_DIR}/README.md`);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pi-messenger installer
|
|
5
|
+
*
|
|
6
|
+
* Copies the npm package contents to ~/.pi/agent/extensions/pi-messenger.
|
|
7
|
+
* No git dependency — the npm package IS the source.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx pi-messenger # Install or update extension
|
|
11
|
+
* npx pi-messenger --remove # Remove the extension
|
|
12
|
+
* npx pi-messenger --crew-install # Show crew agent info
|
|
13
|
+
* npx pi-messenger --crew-uninstall # Remove crew agents
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import * as fs from "node:fs";
|
|
17
|
+
import * as path from "node:path";
|
|
18
|
+
import * as os from "node:os";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const PACKAGE_DIR = path.dirname(__filename);
|
|
23
|
+
const AGENT_DIR = path.join(os.homedir(), ".pi", "agent");
|
|
24
|
+
const EXTENSION_DIR = path.join(AGENT_DIR, "extensions", "pi-messenger");
|
|
25
|
+
const NATIVE_PACKAGE_DIR = path.join(AGENT_DIR, "npm", "node_modules", "pi-messenger");
|
|
26
|
+
const SETTINGS_PATH = path.join(AGENT_DIR, "settings.json");
|
|
27
|
+
const AGENTS_DIR = path.join(AGENT_DIR, "agents");
|
|
28
|
+
|
|
29
|
+
const CREW_AGENTS = [
|
|
30
|
+
"crew-planner.md",
|
|
31
|
+
"crew-interview-generator.md",
|
|
32
|
+
"crew-plan-sync.md",
|
|
33
|
+
"crew-worker.md",
|
|
34
|
+
"crew-reviewer.md",
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const DEPRECATED_AGENTS = [
|
|
38
|
+
"crew-repo-scout.md",
|
|
39
|
+
"crew-practice-scout.md",
|
|
40
|
+
"crew-docs-scout.md",
|
|
41
|
+
"crew-web-scout.md",
|
|
42
|
+
"crew-github-scout.md",
|
|
43
|
+
"crew-gap-analyst.md",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(PACKAGE_DIR, "package.json"), "utf-8"));
|
|
47
|
+
const VERSION = pkg.version;
|
|
48
|
+
|
|
49
|
+
const args = process.argv.slice(2);
|
|
50
|
+
const isRemove = args.includes("--remove") || args.includes("-r");
|
|
51
|
+
const isCrewInstall = args.includes("--crew-install");
|
|
52
|
+
const isCrewUninstall = args.includes("--crew-uninstall");
|
|
53
|
+
const isHelp = args.includes("--help") || args.includes("-h");
|
|
54
|
+
|
|
55
|
+
if (isHelp) {
|
|
56
|
+
console.log(`
|
|
57
|
+
pi-messenger v${VERSION} - Multi-agent coordination for pi
|
|
58
|
+
|
|
59
|
+
Usage:
|
|
60
|
+
npx pi-messenger Install or update extension
|
|
61
|
+
npx pi-messenger --remove Remove the extension
|
|
62
|
+
npx pi-messenger --crew-install Show crew agent info
|
|
63
|
+
npx pi-messenger --crew-uninstall Remove crew agents
|
|
64
|
+
npx pi-messenger --help Show this help
|
|
65
|
+
|
|
66
|
+
Extension directory: ${EXTENSION_DIR}
|
|
67
|
+
`);
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ─── Crew install ────────────────────────────────────────────────────────────
|
|
72
|
+
|
|
73
|
+
if (isCrewInstall) {
|
|
74
|
+
const agentsDir = path.join(EXTENSION_DIR, "crew", "agents");
|
|
75
|
+
if (!fs.existsSync(agentsDir)) {
|
|
76
|
+
console.log("Extension not installed. Run: npx pi-messenger");
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const agents = fs.readdirSync(agentsDir).filter(f => f.endsWith(".md"));
|
|
81
|
+
console.log(`Crew agents (${agents.length}) ship with the extension:`);
|
|
82
|
+
console.log(` ${agentsDir}`);
|
|
83
|
+
for (const agent of agents) {
|
|
84
|
+
console.log(` - ${agent}`);
|
|
85
|
+
}
|
|
86
|
+
console.log("\nTo customize, copy an agent to .pi/messenger/crew/agents/ and edit it.");
|
|
87
|
+
process.exit(0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ─── Crew uninstall ──────────────────────────────────────────────────────────
|
|
91
|
+
|
|
92
|
+
if (isCrewUninstall) {
|
|
93
|
+
let removed = 0;
|
|
94
|
+
|
|
95
|
+
for (const agent of [...CREW_AGENTS, ...DEPRECATED_AGENTS]) {
|
|
96
|
+
const target = path.join(AGENTS_DIR, agent);
|
|
97
|
+
if (fs.existsSync(target)) {
|
|
98
|
+
fs.unlinkSync(target);
|
|
99
|
+
removed++;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.log(removed > 0 ? `Removed ${removed} crew agent(s) from ${AGENTS_DIR}` : "Nothing to remove");
|
|
104
|
+
process.exit(0);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ─── Extension remove ────────────────────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
if (isRemove) {
|
|
110
|
+
if (fs.existsSync(EXTENSION_DIR)) {
|
|
111
|
+
fs.rmSync(EXTENSION_DIR, { recursive: true });
|
|
112
|
+
console.log("Removed pi-messenger from " + EXTENSION_DIR);
|
|
113
|
+
} else {
|
|
114
|
+
console.log("pi-messenger is not installed");
|
|
115
|
+
}
|
|
116
|
+
process.exit(0);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Already running from the extension dir (e.g. local dev)
|
|
120
|
+
if (path.resolve(PACKAGE_DIR) === path.resolve(EXTENSION_DIR)) {
|
|
121
|
+
console.log(`Already installed at ${EXTENSION_DIR} (v${VERSION})`);
|
|
122
|
+
process.exit(0);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const isUpdate = fs.existsSync(EXTENSION_DIR);
|
|
126
|
+
|
|
127
|
+
function hasNativePackageInstall() {
|
|
128
|
+
if (fs.existsSync(NATIVE_PACKAGE_DIR)) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
const settings = JSON.parse(fs.readFileSync(SETTINGS_PATH, "utf-8"));
|
|
134
|
+
const packages = Array.isArray(settings.packages) ? settings.packages : [];
|
|
135
|
+
return packages.some(pkg => pkg === "npm:pi-messenger");
|
|
136
|
+
} catch {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (hasNativePackageInstall()) {
|
|
142
|
+
console.log(`pi-messenger is already installed via pi's native package flow.
|
|
143
|
+
|
|
144
|
+
Keep the native install and remove any legacy copy instead:
|
|
145
|
+
|
|
146
|
+
npx pi-messenger --remove
|
|
147
|
+
|
|
148
|
+
Do not run the legacy npx installer alongside \`pi install npm:pi-messenger\`; loading both copies registers the \`pi_messenger\` tool twice.`);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Warn if existing install is a git clone from the old installer
|
|
153
|
+
if (isUpdate && fs.existsSync(path.join(EXTENSION_DIR, ".git"))) {
|
|
154
|
+
console.log("Existing install is a git clone. Remove it first:\n");
|
|
155
|
+
console.log(" npx pi-messenger --remove && npx pi-messenger");
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Clean slate for updates so removed files don't linger between versions
|
|
160
|
+
if (isUpdate) {
|
|
161
|
+
fs.rmSync(EXTENSION_DIR, { recursive: true });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const SKIP = new Set([".git", "node_modules", ".DS_Store"]);
|
|
165
|
+
|
|
166
|
+
function copyDir(src, dest) {
|
|
167
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
168
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
169
|
+
if (SKIP.has(entry.name)) continue;
|
|
170
|
+
const srcPath = path.join(src, entry.name);
|
|
171
|
+
const destPath = path.join(dest, entry.name);
|
|
172
|
+
if (entry.isDirectory()) {
|
|
173
|
+
copyDir(srcPath, destPath);
|
|
174
|
+
} else {
|
|
175
|
+
fs.copyFileSync(srcPath, destPath);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
copyDir(PACKAGE_DIR, EXTENSION_DIR);
|
|
181
|
+
|
|
182
|
+
const action = isUpdate ? "Updated" : "Installed";
|
|
183
|
+
console.log(`${action} pi-messenger v${VERSION} → ${EXTENSION_DIR}
|
|
184
|
+
|
|
185
|
+
Tools: pi_messenger
|
|
186
|
+
Commands: /messenger, /messenger config
|
|
187
|
+
Docs: ${EXTENSION_DIR}/README.md`);
|