@linxiraos/pi-messenger 1.1.1 → 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/feed.ts
CHANGED
|
@@ -1,268 +1,321 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pi Messenger - Activity Feed
|
|
3
|
-
*
|
|
4
|
-
* Append-only JSONL feed stored at <cwd>/.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as fs from "node:fs";
|
|
8
|
-
import * as path from "node:path";
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Pi Messenger - Activity Feed
|
|
3
|
+
*
|
|
4
|
+
* Append-only JSONL feed stored at <cwd>/.zeta/messenger/feed.jsonl
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fs from "node:fs";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
import { getProjectMessengerDir } from "./paths.ts";
|
|
10
|
+
import { ensureProjectStateMigrated } from "./crew/utils/migrations.ts";
|
|
11
|
+
|
|
12
|
+
export type FeedEventType =
|
|
13
|
+
| "join"
|
|
14
|
+
| "leave"
|
|
15
|
+
| "reserve"
|
|
16
|
+
| "release"
|
|
17
|
+
| "message"
|
|
18
|
+
| "commit"
|
|
19
|
+
| "test"
|
|
20
|
+
| "edit"
|
|
21
|
+
| "task.start"
|
|
22
|
+
| "task.done"
|
|
23
|
+
| "task.review"
|
|
24
|
+
| "task.block"
|
|
25
|
+
| "task.unblock"
|
|
26
|
+
| "task.reset"
|
|
27
|
+
| "task.delete"
|
|
28
|
+
| "task.split"
|
|
29
|
+
| "task.revise"
|
|
30
|
+
| "task.revise-tree"
|
|
31
|
+
| "task.approve"
|
|
32
|
+
| "task.reject"
|
|
33
|
+
| "plan.start"
|
|
34
|
+
| "plan.pass.start"
|
|
35
|
+
| "plan.pass.done"
|
|
36
|
+
| "plan.review.start"
|
|
37
|
+
| "plan.review.done"
|
|
38
|
+
| "plan.done"
|
|
39
|
+
| "plan.cancel"
|
|
40
|
+
| "plan.failed"
|
|
41
|
+
| "stuck";
|
|
42
|
+
|
|
43
|
+
export interface FeedEvent {
|
|
44
|
+
ts: string;
|
|
45
|
+
agent: string;
|
|
46
|
+
type: FeedEventType;
|
|
47
|
+
target?: string;
|
|
48
|
+
preview?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function feedPath(cwd: string): string {
|
|
52
|
+
ensureProjectStateMigrated(cwd);
|
|
53
|
+
return path.join(getProjectMessengerDir(cwd), "feed.jsonl");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function sanitizeInlineText(value?: string): string | undefined {
|
|
57
|
+
if (!value) return undefined;
|
|
58
|
+
const normalized = value
|
|
59
|
+
.replaceAll("\r", " ")
|
|
60
|
+
.replaceAll("\n", " ")
|
|
61
|
+
.replaceAll("\t", " ")
|
|
62
|
+
.replace(/\s+/g, " ")
|
|
63
|
+
.trim();
|
|
64
|
+
return normalized.length > 0 ? normalized : undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function sanitizeAgentName(value: string): string {
|
|
68
|
+
return sanitizeInlineText(value) ?? "unknown";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function sanitizeFeedEvent(event: FeedEvent): FeedEvent {
|
|
72
|
+
return {
|
|
73
|
+
ts: event.ts,
|
|
74
|
+
type: event.type,
|
|
75
|
+
agent: sanitizeAgentName(event.agent),
|
|
76
|
+
target: sanitizeInlineText(event.target),
|
|
77
|
+
preview: sanitizeInlineText(event.preview),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function appendFeedEvent(cwd: string, event: FeedEvent): void {
|
|
82
|
+
const p = feedPath(cwd);
|
|
83
|
+
try {
|
|
84
|
+
const feedDir = path.dirname(p);
|
|
85
|
+
if (!fs.existsSync(feedDir)) {
|
|
86
|
+
fs.mkdirSync(feedDir, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
const sanitized = sanitizeFeedEvent(event);
|
|
89
|
+
fs.appendFileSync(p, JSON.stringify(sanitized) + "\n");
|
|
90
|
+
} catch {
|
|
91
|
+
// Best effort
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function readFeedEvents(cwd: string, limit: number = 20): FeedEvent[] {
|
|
96
|
+
const p = feedPath(cwd);
|
|
97
|
+
const maxEvents = Math.trunc(limit);
|
|
98
|
+
if (!Number.isFinite(maxEvents) || maxEvents <= 0) return [];
|
|
99
|
+
if (!fs.existsSync(p)) return [];
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const fd = fs.openSync(p, "r");
|
|
103
|
+
try {
|
|
104
|
+
// Read backward in chunks, carrying the partial first line of each chunk
|
|
105
|
+
// as raw bytes so lines (and multibyte sequences) are only decoded once complete.
|
|
106
|
+
const events: FeedEvent[] = [];
|
|
107
|
+
let position = fs.fstatSync(fd).size;
|
|
108
|
+
let carry = Buffer.alloc(0);
|
|
109
|
+
const chunkSize = 64 * 1024;
|
|
110
|
+
|
|
111
|
+
while (position > 0 && events.length < maxEvents) {
|
|
112
|
+
const start = Math.max(0, position - chunkSize);
|
|
113
|
+
const chunk = Buffer.allocUnsafe(position - start);
|
|
114
|
+
const bytesRead = fs.readSync(fd, chunk, 0, chunk.length, start);
|
|
115
|
+
const current = bytesRead === chunk.length ? chunk : chunk.subarray(0, bytesRead);
|
|
116
|
+
const combined = carry.length > 0 ? Buffer.concat([current, carry]) : current;
|
|
117
|
+
const firstNewline = combined.indexOf(0x0a);
|
|
118
|
+
let complete: Buffer;
|
|
119
|
+
|
|
120
|
+
if (start === 0) {
|
|
121
|
+
complete = combined;
|
|
122
|
+
carry = Buffer.alloc(0);
|
|
123
|
+
} else if (firstNewline === -1) {
|
|
124
|
+
carry = combined;
|
|
125
|
+
position = start;
|
|
126
|
+
continue;
|
|
127
|
+
} else {
|
|
128
|
+
carry = combined.subarray(0, firstNewline);
|
|
129
|
+
complete = combined.subarray(firstNewline + 1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const lines = complete.toString("utf-8").split("\n");
|
|
133
|
+
for (let i = lines.length - 1; i >= 0 && events.length < maxEvents; i--) {
|
|
134
|
+
if (!lines[i]) continue;
|
|
135
|
+
try {
|
|
136
|
+
events.push(sanitizeFeedEvent(JSON.parse(lines[i]) as FeedEvent));
|
|
137
|
+
} catch {
|
|
138
|
+
// Skip malformed lines and continue scanning backward.
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
position = start;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return events.reverse();
|
|
145
|
+
} finally {
|
|
146
|
+
fs.closeSync(fd);
|
|
147
|
+
}
|
|
148
|
+
} catch {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function pruneFeed(cwd: string, maxEvents: number): void {
|
|
154
|
+
const p = feedPath(cwd);
|
|
155
|
+
if (!fs.existsSync(p)) return;
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
const content = fs.readFileSync(p, "utf-8").trim();
|
|
159
|
+
if (!content) return;
|
|
160
|
+
const lines = content.split("\n");
|
|
161
|
+
if (lines.length <= maxEvents) return;
|
|
162
|
+
const pruned = lines.slice(-maxEvents);
|
|
163
|
+
fs.writeFileSync(p, pruned.join("\n") + "\n");
|
|
164
|
+
} catch {
|
|
165
|
+
// Best effort
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const CREW_EVENT_TYPES = new Set<FeedEventType>([
|
|
170
|
+
"task.start",
|
|
171
|
+
"task.done",
|
|
172
|
+
"task.review",
|
|
173
|
+
"task.block",
|
|
174
|
+
"task.unblock",
|
|
175
|
+
"task.reset",
|
|
176
|
+
"task.delete",
|
|
177
|
+
"task.split",
|
|
178
|
+
"task.revise",
|
|
179
|
+
"task.revise-tree",
|
|
180
|
+
"task.approve",
|
|
181
|
+
"task.reject",
|
|
182
|
+
"plan.start",
|
|
183
|
+
"plan.pass.start",
|
|
184
|
+
"plan.pass.done",
|
|
185
|
+
"plan.review.start",
|
|
186
|
+
"plan.review.done",
|
|
187
|
+
"plan.done",
|
|
188
|
+
"plan.cancel",
|
|
189
|
+
"plan.failed",
|
|
190
|
+
]);
|
|
191
|
+
|
|
192
|
+
export function formatFeedLine(event: FeedEvent): string {
|
|
193
|
+
const sanitized = sanitizeFeedEvent(event);
|
|
194
|
+
const time = new Date(sanitized.ts).toLocaleTimeString("en-US", {
|
|
195
|
+
hour: "2-digit",
|
|
196
|
+
minute: "2-digit",
|
|
197
|
+
hour12: false,
|
|
198
|
+
});
|
|
199
|
+
const isCrew = CREW_EVENT_TYPES.has(sanitized.type);
|
|
200
|
+
const prefix = isCrew ? "[Crew] " : "";
|
|
201
|
+
let line = `${time} ${prefix}${sanitized.agent}`;
|
|
202
|
+
|
|
203
|
+
const rawPreview = sanitized.preview;
|
|
204
|
+
const preview = rawPreview ? (rawPreview.length > 90 ? rawPreview.slice(0, 87) + "..." : rawPreview) : "";
|
|
205
|
+
const withPreview = (base: string) => (preview ? `${base} — ${preview}` : base);
|
|
206
|
+
const target = sanitized.target ?? "";
|
|
207
|
+
|
|
208
|
+
switch (sanitized.type) {
|
|
209
|
+
case "join":
|
|
210
|
+
line += " joined";
|
|
211
|
+
break;
|
|
212
|
+
case "leave":
|
|
213
|
+
line = withPreview(line + " left");
|
|
214
|
+
break;
|
|
215
|
+
case "reserve":
|
|
216
|
+
line += ` reserved ${target}`;
|
|
217
|
+
break;
|
|
218
|
+
case "release":
|
|
219
|
+
line += ` released ${target}`;
|
|
220
|
+
break;
|
|
221
|
+
case "message":
|
|
222
|
+
if (target) {
|
|
223
|
+
line += ` → ${target}`;
|
|
224
|
+
if (preview) line += `: ${preview}`;
|
|
225
|
+
} else {
|
|
226
|
+
line += " ✦";
|
|
227
|
+
if (preview) line += ` ${preview}`;
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case "commit":
|
|
231
|
+
line += preview ? ` committed "${preview}"` : " committed";
|
|
232
|
+
break;
|
|
233
|
+
case "test":
|
|
234
|
+
line += preview ? ` ran tests (${preview})` : " ran tests";
|
|
235
|
+
break;
|
|
236
|
+
case "edit":
|
|
237
|
+
line += ` editing ${target}`;
|
|
238
|
+
break;
|
|
239
|
+
case "task.start":
|
|
240
|
+
line += withPreview(` started ${target}`);
|
|
241
|
+
break;
|
|
242
|
+
case "task.done":
|
|
243
|
+
line += withPreview(` completed ${target}`);
|
|
244
|
+
break;
|
|
245
|
+
case "task.review":
|
|
246
|
+
line += withPreview(` reviewed ${target}`);
|
|
247
|
+
break;
|
|
248
|
+
case "task.block":
|
|
249
|
+
line += withPreview(` blocked ${target}`);
|
|
250
|
+
break;
|
|
251
|
+
case "task.unblock":
|
|
252
|
+
line += withPreview(` unblocked ${target}`);
|
|
253
|
+
break;
|
|
254
|
+
case "task.reset":
|
|
255
|
+
line += withPreview(` reset ${target}`);
|
|
256
|
+
break;
|
|
257
|
+
case "task.delete":
|
|
258
|
+
line += withPreview(` deleted ${target}`);
|
|
259
|
+
break;
|
|
260
|
+
case "task.split":
|
|
261
|
+
line += withPreview(` split ${target}`);
|
|
262
|
+
break;
|
|
263
|
+
case "task.revise":
|
|
264
|
+
line += withPreview(` revised ${target}`);
|
|
265
|
+
break;
|
|
266
|
+
case "task.revise-tree":
|
|
267
|
+
line += withPreview(` revised ${target} + dependents`);
|
|
268
|
+
break;
|
|
269
|
+
case "task.approve":
|
|
270
|
+
line += withPreview(` approved ${target}`);
|
|
271
|
+
break;
|
|
272
|
+
case "task.reject":
|
|
273
|
+
line += withPreview(` rejected ${target}`);
|
|
274
|
+
break;
|
|
275
|
+
case "plan.start":
|
|
276
|
+
line += withPreview(" planning started");
|
|
277
|
+
break;
|
|
278
|
+
case "plan.pass.start":
|
|
279
|
+
line += withPreview(" planning pass started");
|
|
280
|
+
break;
|
|
281
|
+
case "plan.pass.done":
|
|
282
|
+
line += withPreview(" planning pass finished");
|
|
283
|
+
break;
|
|
284
|
+
case "plan.review.start":
|
|
285
|
+
line += withPreview(" planning review started");
|
|
286
|
+
break;
|
|
287
|
+
case "plan.review.done":
|
|
288
|
+
line += withPreview(" planning review finished");
|
|
289
|
+
break;
|
|
290
|
+
case "plan.done":
|
|
291
|
+
line += withPreview(" planning completed");
|
|
292
|
+
break;
|
|
293
|
+
case "plan.cancel":
|
|
294
|
+
line += " planning cancelled";
|
|
295
|
+
break;
|
|
296
|
+
case "plan.failed":
|
|
297
|
+
line += withPreview(" planning failed");
|
|
298
|
+
break;
|
|
299
|
+
case "stuck":
|
|
300
|
+
line += " appears stuck";
|
|
301
|
+
break;
|
|
302
|
+
default:
|
|
303
|
+
line += ` ${sanitized.type}`;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
return line;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export function isCrewEvent(type: FeedEventType): boolean {
|
|
310
|
+
return CREW_EVENT_TYPES.has(type);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function logFeedEvent(cwd: string, agent: string, type: FeedEventType, target?: string, preview?: string): void {
|
|
314
|
+
appendFeedEvent(cwd, {
|
|
315
|
+
ts: new Date().toISOString(),
|
|
316
|
+
agent,
|
|
317
|
+
type,
|
|
318
|
+
target,
|
|
319
|
+
preview,
|
|
320
|
+
});
|
|
321
|
+
}
|