@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/config-overlay.ts
CHANGED
|
@@ -1,171 +1,175 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pi Messenger - Config Overlay Component
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Component, Focusable, TUI } from "@
|
|
6
|
-
import { matchesKey, truncateToWidth, visibleWidth } from "@
|
|
7
|
-
import type { Theme } from "@
|
|
8
|
-
import { getAutoRegisterPaths, saveAutoRegisterPaths, matchesAutoRegisterPath } from "./config.ts";
|
|
9
|
-
|
|
10
|
-
export class MessengerConfigOverlay implements Component, Focusable {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Pi Messenger - Config Overlay Component
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { Component, Focusable, TUI } from "@linxiraos/pi-tui";
|
|
6
|
+
import { matchesKey, truncateToWidth, visibleWidth } from "@linxiraos/pi-tui";
|
|
7
|
+
import type { Theme } from "@linxiraos/zeta";
|
|
8
|
+
import { getAutoRegisterPaths, saveAutoRegisterPaths, matchesAutoRegisterPath } from "./config.ts";
|
|
9
|
+
|
|
10
|
+
export class MessengerConfigOverlay implements Component, Focusable {
|
|
11
|
+
readonly width = 60;
|
|
12
|
+
focused = false;
|
|
13
|
+
|
|
14
|
+
private paths: string[];
|
|
15
|
+
private selectedIndex = 0;
|
|
16
|
+
private dirty = false;
|
|
17
|
+
private statusMessage = "";
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
private tui: TUI,
|
|
21
|
+
private theme: Theme,
|
|
22
|
+
private done: () => void,
|
|
23
|
+
private cwd: string,
|
|
24
|
+
) {
|
|
25
|
+
this.paths = getAutoRegisterPaths();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
handleInput(data: string): void {
|
|
29
|
+
if (matchesKey(data, "escape") || matchesKey(data, "q")) {
|
|
30
|
+
if (this.dirty) {
|
|
31
|
+
saveAutoRegisterPaths(this.paths);
|
|
32
|
+
}
|
|
33
|
+
this.done();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (matchesKey(data, "a")) {
|
|
38
|
+
this.addCurrentPath();
|
|
39
|
+
this.tui.requestRender();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (matchesKey(data, "d") || matchesKey(data, "backspace")) {
|
|
44
|
+
this.deleteSelected();
|
|
45
|
+
this.tui.requestRender();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (matchesKey(data, "up")) {
|
|
50
|
+
if (this.paths.length > 0) {
|
|
51
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
52
|
+
this.tui.requestRender();
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (matchesKey(data, "down")) {
|
|
58
|
+
if (this.paths.length > 0) {
|
|
59
|
+
this.selectedIndex = Math.min(this.paths.length - 1, this.selectedIndex + 1);
|
|
60
|
+
this.tui.requestRender();
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private addCurrentPath(): void {
|
|
67
|
+
if (this.paths.includes(this.cwd)) {
|
|
68
|
+
this.statusMessage = "Already in list";
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.paths.push(this.cwd);
|
|
72
|
+
this.selectedIndex = this.paths.length - 1;
|
|
73
|
+
this.dirty = true;
|
|
74
|
+
this.statusMessage = "Added current folder";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private deleteSelected(): void {
|
|
78
|
+
if (this.paths.length === 0) return;
|
|
79
|
+
|
|
80
|
+
const removed = this.paths[this.selectedIndex];
|
|
81
|
+
this.paths.splice(this.selectedIndex, 1);
|
|
82
|
+
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.paths.length - 1));
|
|
83
|
+
this.dirty = true;
|
|
84
|
+
this.statusMessage = `Removed: ${removed.split("/").pop()}`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
render(_width: number): string[] {
|
|
88
|
+
const w = this.width;
|
|
89
|
+
const innerW = w - 2;
|
|
90
|
+
const lines: string[] = [];
|
|
91
|
+
const isCurrentInList = matchesAutoRegisterPath(this.cwd, this.paths);
|
|
92
|
+
|
|
93
|
+
const border = (s: string) => this.theme.fg("dim", s);
|
|
94
|
+
const pad = (s: string, len: number) => s + " ".repeat(Math.max(0, len - visibleWidth(s)));
|
|
95
|
+
const row = (content: string) => border("│") + pad(" " + content, innerW) + border("│");
|
|
96
|
+
const emptyRow = () => border("│") + " ".repeat(innerW) + border("│");
|
|
97
|
+
|
|
98
|
+
// Top border with title
|
|
99
|
+
const titleText = " Messenger Config ";
|
|
100
|
+
const borderLen = innerW - titleText.length;
|
|
101
|
+
const leftBorder = Math.floor(borderLen / 2);
|
|
102
|
+
const rightBorder = borderLen - leftBorder;
|
|
103
|
+
lines.push(
|
|
104
|
+
border("╭" + "─".repeat(leftBorder)) +
|
|
105
|
+
this.theme.fg("accent", titleText) +
|
|
106
|
+
border("─".repeat(rightBorder) + "╮"),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
lines.push(emptyRow());
|
|
110
|
+
|
|
111
|
+
// Current folder status
|
|
112
|
+
const cwdDisplay = truncateToWidth(this.cwd, Math.max(10, innerW - 20));
|
|
113
|
+
lines.push(row(`Current folder: ${cwdDisplay}`));
|
|
114
|
+
const statusColor = isCurrentInList ? "accent" : "dim";
|
|
115
|
+
lines.push(row(`Auto-register: ${this.theme.fg(statusColor, isCurrentInList ? "YES" : "NO")}`));
|
|
116
|
+
|
|
117
|
+
lines.push(emptyRow());
|
|
118
|
+
|
|
119
|
+
// Divider
|
|
120
|
+
lines.push(border("├" + "─".repeat(innerW) + "┤"));
|
|
121
|
+
|
|
122
|
+
lines.push(emptyRow());
|
|
123
|
+
lines.push(row(this.theme.fg("dim", "Auto-register paths:")));
|
|
124
|
+
lines.push(emptyRow());
|
|
125
|
+
|
|
126
|
+
if (this.paths.length === 0) {
|
|
127
|
+
lines.push(row(this.theme.fg("dim", " (none configured)")));
|
|
128
|
+
} else {
|
|
129
|
+
for (let i = 0; i < this.paths.length; i++) {
|
|
130
|
+
const path = this.paths[i];
|
|
131
|
+
const isSelected = i === this.selectedIndex;
|
|
132
|
+
const isCurrent = path === this.cwd;
|
|
133
|
+
|
|
134
|
+
const marker = isSelected ? this.theme.fg("accent", "▸") : " ";
|
|
135
|
+
const suffix = isCurrent ? this.theme.fg("dim", " (current)") : "";
|
|
136
|
+
const pathDisplay = truncateToWidth(path, Math.max(10, innerW - 15));
|
|
137
|
+
|
|
138
|
+
if (isSelected) {
|
|
139
|
+
lines.push(row(`${marker} ${this.theme.fg("accent", pathDisplay)}${suffix}`));
|
|
140
|
+
} else {
|
|
141
|
+
lines.push(row(`${marker} ${pathDisplay}${suffix}`));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
lines.push(emptyRow());
|
|
147
|
+
|
|
148
|
+
// Divider
|
|
149
|
+
lines.push(border("├" + "─".repeat(innerW) + "┤"));
|
|
150
|
+
|
|
151
|
+
lines.push(emptyRow());
|
|
152
|
+
|
|
153
|
+
// Status message
|
|
154
|
+
if (this.statusMessage) {
|
|
155
|
+
lines.push(row(this.theme.fg("accent", this.statusMessage)));
|
|
156
|
+
} else {
|
|
157
|
+
lines.push(emptyRow());
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Help
|
|
161
|
+
const help = "a add d delete ↑↓ navigate Esc save & close";
|
|
162
|
+
lines.push(row(this.theme.fg("dim", help)));
|
|
163
|
+
|
|
164
|
+
// Bottom border
|
|
165
|
+
lines.push(border("╰" + "─".repeat(innerW) + "╯"));
|
|
166
|
+
|
|
167
|
+
return lines;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
invalidate(): void {
|
|
171
|
+
this.statusMessage = "";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
dispose(): void {}
|
|
175
|
+
}
|