chatroom-cli 1.0.54 → 1.0.64
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/README.md +35 -27
- package/dist/index.js +12728 -339
- package/package.json +11 -10
- package/dist/api.d.ts +0 -11
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -12
- package/dist/api.js.map +0 -1
- package/dist/commands/auth-login.d.ts +0 -10
- package/dist/commands/auth-login.d.ts.map +0 -1
- package/dist/commands/auth-login.js +0 -179
- package/dist/commands/auth-login.js.map +0 -1
- package/dist/commands/auth-logout.d.ts +0 -6
- package/dist/commands/auth-logout.d.ts.map +0 -1
- package/dist/commands/auth-logout.js +0 -21
- package/dist/commands/auth-logout.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -6
- package/dist/commands/auth-status.d.ts.map +0 -1
- package/dist/commands/auth-status.js +0 -50
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/backlog.d.ts +0 -36
- package/dist/commands/backlog.d.ts.map +0 -1
- package/dist/commands/backlog.js +0 -310
- package/dist/commands/backlog.js.map +0 -1
- package/dist/commands/feature.d.ts +0 -14
- package/dist/commands/feature.d.ts.map +0 -1
- package/dist/commands/feature.js +0 -172
- package/dist/commands/feature.js.map +0 -1
- package/dist/commands/guidelines.d.ts +0 -17
- package/dist/commands/guidelines.d.ts.map +0 -1
- package/dist/commands/guidelines.js +0 -71
- package/dist/commands/guidelines.js.map +0 -1
- package/dist/commands/handoff.d.ts +0 -20
- package/dist/commands/handoff.d.ts.map +0 -1
- package/dist/commands/handoff.js +0 -83
- package/dist/commands/handoff.js.map +0 -1
- package/dist/commands/init.d.ts +0 -9
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -23
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/messages.d.ts +0 -24
- package/dist/commands/messages.d.ts.map +0 -1
- package/dist/commands/messages.js +0 -149
- package/dist/commands/messages.js.map +0 -1
- package/dist/commands/opencode-install.d.ts +0 -29
- package/dist/commands/opencode-install.d.ts.map +0 -1
- package/dist/commands/opencode-install.js +0 -416
- package/dist/commands/opencode-install.js.map +0 -1
- package/dist/commands/task-started.d.ts +0 -13
- package/dist/commands/task-started.d.ts.map +0 -1
- package/dist/commands/task-started.js +0 -107
- package/dist/commands/task-started.js.map +0 -1
- package/dist/commands/update.d.ts +0 -6
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -78
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/wait-for-task.d.ts +0 -18
- package/dist/commands/wait-for-task.d.ts.map +0 -1
- package/dist/commands/wait-for-task.js +0 -306
- package/dist/commands/wait-for-task.js.map +0 -1
- package/dist/config/defaults.d.ts +0 -12
- package/dist/config/defaults.d.ts.map +0 -1
- package/dist/config/defaults.js +0 -70
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/loader.d.ts +0 -52
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js +0 -202
- package/dist/config/loader.js.map +0 -1
- package/dist/config/schema.d.ts +0 -52
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -99
- package/dist/config/schema.js.map +0 -1
- package/dist/config.d.ts +0 -20
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -20
- package/dist/config.js.map +0 -1
- package/dist/convex-api/api.d.ts +0 -137
- package/dist/convex-api/api.js +0 -23
- package/dist/convex-api/index.d.ts +0 -102
- package/dist/convex-api/index.d.ts.map +0 -1
- package/dist/convex-api/index.js +0 -11
- package/dist/convex-api/index.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infrastructure/auth/middleware.d.ts +0 -20
- package/dist/infrastructure/auth/middleware.d.ts.map +0 -1
- package/dist/infrastructure/auth/middleware.js +0 -96
- package/dist/infrastructure/auth/middleware.js.map +0 -1
- package/dist/infrastructure/auth/storage.d.ts +0 -58
- package/dist/infrastructure/auth/storage.d.ts.map +0 -1
- package/dist/infrastructure/auth/storage.js +0 -242
- package/dist/infrastructure/auth/storage.js.map +0 -1
- package/dist/infrastructure/convex/client.d.ts +0 -16
- package/dist/infrastructure/convex/client.d.ts.map +0 -1
- package/dist/infrastructure/convex/client.js +0 -40
- package/dist/infrastructure/convex/client.js.map +0 -1
- package/dist/infrastructure/history/storage.d.ts +0 -21
- package/dist/infrastructure/history/storage.d.ts.map +0 -1
- package/dist/infrastructure/history/storage.js +0 -56
- package/dist/infrastructure/history/storage.js.map +0 -1
- package/dist/utils/file-content.d.ts +0 -29
- package/dist/utils/file-content.d.ts.map +0 -1
- package/dist/utils/file-content.js +0 -51
- package/dist/utils/file-content.js.map +0 -1
- package/dist/version.d.ts +0 -14
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -43
- package/dist/version.js.map +0 -1
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wait for tasks in a chatroom
|
|
3
|
-
*/
|
|
4
|
-
import { api } from '../api.js';
|
|
5
|
-
import { WAIT_POLL_INTERVAL_MS, MAX_SILENT_ERRORS, DEFAULT_WAIT_TIMEOUT_MS, DEFAULT_ACTIVE_TIMEOUT_MS, } from '../config.js';
|
|
6
|
-
import { getSessionId, getOtherSessionUrls } from '../infrastructure/auth/storage.js';
|
|
7
|
-
import { getConvexUrl, getConvexClient } from '../infrastructure/convex/client.js';
|
|
8
|
-
/**
|
|
9
|
-
* Parse a duration string (e.g., "1m", "5m", "30s") into milliseconds.
|
|
10
|
-
* Returns null if the format is invalid.
|
|
11
|
-
*/
|
|
12
|
-
export function parseDuration(duration) {
|
|
13
|
-
const match = duration
|
|
14
|
-
.trim()
|
|
15
|
-
.match(/^(\d+(?:\.\d+)?)\s*(s|sec|second|seconds|m|min|minute|minutes|h|hr|hour|hours)?$/i);
|
|
16
|
-
if (!match)
|
|
17
|
-
return null;
|
|
18
|
-
const value = parseFloat(match[1]);
|
|
19
|
-
const unit = (match[2] || 's').toLowerCase();
|
|
20
|
-
switch (unit) {
|
|
21
|
-
case 's':
|
|
22
|
-
case 'sec':
|
|
23
|
-
case 'second':
|
|
24
|
-
case 'seconds':
|
|
25
|
-
return value * 1000;
|
|
26
|
-
case 'm':
|
|
27
|
-
case 'min':
|
|
28
|
-
case 'minute':
|
|
29
|
-
case 'minutes':
|
|
30
|
-
return value * 60 * 1000;
|
|
31
|
-
case 'h':
|
|
32
|
-
case 'hr':
|
|
33
|
-
case 'hour':
|
|
34
|
-
case 'hours':
|
|
35
|
-
return value * 60 * 60 * 1000;
|
|
36
|
-
default:
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Format milliseconds into a human-readable duration string.
|
|
42
|
-
*/
|
|
43
|
-
function formatDuration(ms) {
|
|
44
|
-
if (ms >= 60 * 60 * 1000) {
|
|
45
|
-
const hours = Math.round((ms / (60 * 60 * 1000)) * 10) / 10;
|
|
46
|
-
return `${hours}h`;
|
|
47
|
-
}
|
|
48
|
-
if (ms >= 60 * 1000) {
|
|
49
|
-
const minutes = Math.round((ms / (60 * 1000)) * 10) / 10;
|
|
50
|
-
return `${minutes}m`;
|
|
51
|
-
}
|
|
52
|
-
const seconds = Math.round((ms / 1000) * 10) / 10;
|
|
53
|
-
return `${seconds}s`;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Print the wait-for-task reminder - short but forceful.
|
|
57
|
-
*/
|
|
58
|
-
function printWaitReminder(chatroomId, role, session = 1) {
|
|
59
|
-
console.log(`${'─'.repeat(50)}`);
|
|
60
|
-
console.log(`⚠️ ALWAYS run \`wait-for-task\` after handoff. If it times out, run it again immediately.`);
|
|
61
|
-
console.log(` chatroom wait-for-task ${chatroomId} --role=${role} --session=${session}`);
|
|
62
|
-
console.log(`${'─'.repeat(50)}`);
|
|
63
|
-
}
|
|
64
|
-
export async function waitForTask(chatroomId, options) {
|
|
65
|
-
const client = await getConvexClient();
|
|
66
|
-
const { role, timeout, duration, silent } = options;
|
|
67
|
-
// Get session ID for authentication
|
|
68
|
-
const sessionId = getSessionId();
|
|
69
|
-
if (!sessionId) {
|
|
70
|
-
const otherUrls = getOtherSessionUrls();
|
|
71
|
-
const currentUrl = getConvexUrl();
|
|
72
|
-
console.error(`❌ Not authenticated for: ${currentUrl}`);
|
|
73
|
-
if (otherUrls.length > 0) {
|
|
74
|
-
console.error(`\n💡 You have sessions for other environments:`);
|
|
75
|
-
for (const url of otherUrls) {
|
|
76
|
-
console.error(` • ${url}`);
|
|
77
|
-
}
|
|
78
|
-
console.error(`\n To use a different environment, set CHATROOM_CONVEX_URL:`);
|
|
79
|
-
console.error(` CHATROOM_CONVEX_URL=${otherUrls[0]} chatroom wait-for-task ...`);
|
|
80
|
-
console.error(`\n Or to authenticate for the current environment:`);
|
|
81
|
-
}
|
|
82
|
-
console.error(` chatroom auth login`);
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
// Validate chatroom ID format before query
|
|
86
|
-
if (!chatroomId ||
|
|
87
|
-
typeof chatroomId !== 'string' ||
|
|
88
|
-
chatroomId.length < 20 ||
|
|
89
|
-
chatroomId.length > 40) {
|
|
90
|
-
console.error(`❌ Invalid chatroom ID format: ID must be 20-40 characters (got ${chatroomId?.length || 0})`);
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
if (!/^[a-zA-Z0-9_]+$/.test(chatroomId)) {
|
|
94
|
-
console.error(`❌ Invalid chatroom ID format: ID must contain only alphanumeric characters and underscores`);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
// Validate chatroom exists and user has access
|
|
98
|
-
const chatroom = (await client.query(api.chatrooms.get, {
|
|
99
|
-
sessionId,
|
|
100
|
-
chatroomId: chatroomId,
|
|
101
|
-
}));
|
|
102
|
-
if (!chatroom) {
|
|
103
|
-
console.error(`❌ Chatroom ${chatroomId} not found or access denied`);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
// Calculate readyUntil timestamp for this session
|
|
107
|
-
// If no timeout specified, use configured default (10 minutes)
|
|
108
|
-
const effectiveTimeout = timeout || DEFAULT_WAIT_TIMEOUT_MS;
|
|
109
|
-
const readyUntil = Date.now() + effectiveTimeout;
|
|
110
|
-
// Join the chatroom with readyUntil timestamp
|
|
111
|
-
await client.mutation(api.participants.join, {
|
|
112
|
-
sessionId,
|
|
113
|
-
chatroomId: chatroomId,
|
|
114
|
-
role,
|
|
115
|
-
readyUntil,
|
|
116
|
-
});
|
|
117
|
-
if (!silent) {
|
|
118
|
-
console.log(`✅ Joined chatroom as "${role}"`);
|
|
119
|
-
}
|
|
120
|
-
// Session tracking for finite but long task framing
|
|
121
|
-
const currentSession = options.session || 1;
|
|
122
|
-
// Warn if session not provided (helps agents track session progress)
|
|
123
|
-
if (!options.session) {
|
|
124
|
-
console.warn('⚠️ Warning: --session not provided (defaulting to 1). Use the command shown in CLI output after session completes for accurate tracking.');
|
|
125
|
-
}
|
|
126
|
-
// On first session, fetch and display the full initialization prompt from backend
|
|
127
|
-
if (currentSession === 1) {
|
|
128
|
-
try {
|
|
129
|
-
const initPromptResult = (await client.query(api.messages.getInitPrompt, {
|
|
130
|
-
sessionId,
|
|
131
|
-
chatroomId: chatroomId,
|
|
132
|
-
role,
|
|
133
|
-
}));
|
|
134
|
-
if (initPromptResult?.prompt) {
|
|
135
|
-
console.log('');
|
|
136
|
-
console.log('═'.repeat(50));
|
|
137
|
-
console.log('📋 AGENT INITIALIZATION PROMPT');
|
|
138
|
-
console.log('═'.repeat(50));
|
|
139
|
-
console.log('');
|
|
140
|
-
console.log(initPromptResult.prompt);
|
|
141
|
-
console.log('');
|
|
142
|
-
console.log('═'.repeat(50));
|
|
143
|
-
console.log('');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
// Fallback - init prompt not critical, continue without it
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const durationDisplay = formatDuration(effectiveTimeout);
|
|
151
|
-
console.log(`⏳ Waiting for tasks (duration: ${durationDisplay})...`);
|
|
152
|
-
console.log('');
|
|
153
|
-
printWaitReminder(chatroomId, role, currentSession);
|
|
154
|
-
console.log('');
|
|
155
|
-
// Track errors for better debugging with exponential backoff
|
|
156
|
-
let consecutiveErrors = 0;
|
|
157
|
-
let currentPollInterval = WAIT_POLL_INTERVAL_MS;
|
|
158
|
-
let pollTimeout;
|
|
159
|
-
// Set up timeout - now always has a default value
|
|
160
|
-
const TOTAL_SESSIONS = 1000000;
|
|
161
|
-
const nextSession = currentSession + 1;
|
|
162
|
-
const sessionsRemaining = TOTAL_SESSIONS - currentSession;
|
|
163
|
-
const timeoutHandle = setTimeout(() => {
|
|
164
|
-
if (pollTimeout)
|
|
165
|
-
clearTimeout(pollTimeout);
|
|
166
|
-
const durationDisplay = duration || formatDuration(effectiveTimeout);
|
|
167
|
-
const nextCommand = `chatroom wait-for-task ${chatroomId} --role=${role}${duration ? ` --duration="${duration}"` : ''} --session=${nextSession}`;
|
|
168
|
-
console.log(`\n${'─'.repeat(50)}`);
|
|
169
|
-
console.log(`⏱️ COMPLETED WAIT SESSION #${currentSession} (${durationDisplay}) - ${sessionsRemaining.toLocaleString()} sessions remaining`);
|
|
170
|
-
console.log(`${'─'.repeat(50)}`);
|
|
171
|
-
console.log(`\n ✅ Wait session completed successfully. No tasks received this session.`);
|
|
172
|
-
console.log(`\n⚠️ Continue to the next session by running:\n`);
|
|
173
|
-
console.log(` ${nextCommand}`);
|
|
174
|
-
console.log(`\n${'─'.repeat(50)}`);
|
|
175
|
-
process.exit(0); // Exit with 0 since this is expected behavior
|
|
176
|
-
}, effectiveTimeout);
|
|
177
|
-
// Polling function with exponential backoff
|
|
178
|
-
const poll = async () => {
|
|
179
|
-
try {
|
|
180
|
-
// Poll for pending tasks instead of messages
|
|
181
|
-
const pendingTasks = (await client.query(api.tasks.getPendingTasksForRole, {
|
|
182
|
-
sessionId,
|
|
183
|
-
chatroomId: chatroomId,
|
|
184
|
-
role,
|
|
185
|
-
}));
|
|
186
|
-
// Get the oldest pending task (first in array)
|
|
187
|
-
const taskWithMessage = pendingTasks.length > 0 ? pendingTasks[0] : null;
|
|
188
|
-
if (taskWithMessage) {
|
|
189
|
-
const { task, message } = taskWithMessage;
|
|
190
|
-
// Start the task (transition to in_progress)
|
|
191
|
-
// This is atomic and handles race conditions - only one agent can start a task
|
|
192
|
-
try {
|
|
193
|
-
await client.mutation(api.tasks.startTask, {
|
|
194
|
-
sessionId,
|
|
195
|
-
chatroomId: chatroomId,
|
|
196
|
-
role,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
catch (_startError) {
|
|
200
|
-
// Task was already started by another agent
|
|
201
|
-
console.log(`🔄 Task already started by another agent, continuing to wait...`);
|
|
202
|
-
pollTimeout = setTimeout(poll, currentPollInterval);
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
// Also claim the message if it exists (for compatibility)
|
|
206
|
-
if (message) {
|
|
207
|
-
await client.mutation(api.messages.claimMessage, {
|
|
208
|
-
sessionId,
|
|
209
|
-
messageId: message._id,
|
|
210
|
-
role,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
// SUCCESS: This agent has exclusive claim on the task
|
|
214
|
-
if (pollTimeout)
|
|
215
|
-
clearTimeout(pollTimeout);
|
|
216
|
-
clearTimeout(timeoutHandle);
|
|
217
|
-
// Update participant status to active with activeUntil timeout
|
|
218
|
-
// This gives the agent ~1 hour to complete the task before being considered crashed
|
|
219
|
-
const activeUntil = Date.now() + DEFAULT_ACTIVE_TIMEOUT_MS;
|
|
220
|
-
await client.mutation(api.participants.updateStatus, {
|
|
221
|
-
sessionId,
|
|
222
|
-
chatroomId: chatroomId,
|
|
223
|
-
role,
|
|
224
|
-
status: 'active',
|
|
225
|
-
expiresAt: activeUntil,
|
|
226
|
-
});
|
|
227
|
-
// Handle interrupt (if message is interrupt type)
|
|
228
|
-
if (message && message.type === 'interrupt') {
|
|
229
|
-
console.log(`\n${'═'.repeat(50)}`);
|
|
230
|
-
console.log(`⚠️ INTERRUPT RECEIVED`);
|
|
231
|
-
console.log(`${'═'.repeat(50)}`);
|
|
232
|
-
console.log(`Message: ${message.content}`);
|
|
233
|
-
console.log(`\nAll agents have been reset to idle state.`);
|
|
234
|
-
console.log(`Rejoin the chatroom to continue participating.`);
|
|
235
|
-
process.exit(0);
|
|
236
|
-
}
|
|
237
|
-
// Get the complete task delivery prompt from backend
|
|
238
|
-
const taskDeliveryPrompt = await client.query(api.messages.getTaskDeliveryPrompt, {
|
|
239
|
-
sessionId,
|
|
240
|
-
chatroomId: chatroomId,
|
|
241
|
-
role,
|
|
242
|
-
taskId: task._id,
|
|
243
|
-
messageId: message?._id,
|
|
244
|
-
});
|
|
245
|
-
// Print human-readable sections
|
|
246
|
-
console.log(`\n${taskDeliveryPrompt.humanReadable}`);
|
|
247
|
-
// Print JSON output
|
|
248
|
-
console.log(`\n${'─'.repeat(50)}`);
|
|
249
|
-
console.log(`📊 MESSAGE DATA (JSON)`);
|
|
250
|
-
console.log(`${'─'.repeat(50)}`);
|
|
251
|
-
console.log(JSON.stringify(taskDeliveryPrompt.json, null, 2));
|
|
252
|
-
process.exit(0);
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
// No pending tasks yet, schedule next poll
|
|
256
|
-
pollTimeout = setTimeout(poll, currentPollInterval);
|
|
257
|
-
}
|
|
258
|
-
// Reset error counter and poll interval on success
|
|
259
|
-
consecutiveErrors = 0;
|
|
260
|
-
currentPollInterval = WAIT_POLL_INTERVAL_MS;
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
consecutiveErrors++;
|
|
264
|
-
const err = error;
|
|
265
|
-
// Implement exponential backoff with max limit
|
|
266
|
-
const maxInterval = 30000; // Max 30 seconds
|
|
267
|
-
currentPollInterval = Math.min(WAIT_POLL_INTERVAL_MS * Math.pow(2, Math.min(consecutiveErrors - 1, 10)), maxInterval);
|
|
268
|
-
if (consecutiveErrors === MAX_SILENT_ERRORS) {
|
|
269
|
-
console.warn(`⚠️ Connection issues, retrying with backoff... (${err.message})`);
|
|
270
|
-
console.warn(` Next retry in ${currentPollInterval / 1000}s`);
|
|
271
|
-
}
|
|
272
|
-
else if (consecutiveErrors > MAX_SILENT_ERRORS && consecutiveErrors % 10 === 0) {
|
|
273
|
-
console.warn(`⚠️ Still experiencing issues after ${consecutiveErrors} attempts`);
|
|
274
|
-
console.warn(` Retry interval: ${currentPollInterval / 1000}s`);
|
|
275
|
-
}
|
|
276
|
-
// Schedule next poll with backoff
|
|
277
|
-
pollTimeout = setTimeout(poll, currentPollInterval);
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
// Start polling
|
|
281
|
-
poll();
|
|
282
|
-
// Handle interrupt signals - These are UNEXPECTED terminations that require immediate restart
|
|
283
|
-
const handleSignal = (signal) => {
|
|
284
|
-
if (pollTimeout)
|
|
285
|
-
clearTimeout(pollTimeout);
|
|
286
|
-
clearTimeout(timeoutHandle);
|
|
287
|
-
console.log(`\n${'═'.repeat(50)}`);
|
|
288
|
-
console.log(`🚨 UNEXPECTED TERMINATION: ${signal} received`);
|
|
289
|
-
console.log(`${'═'.repeat(50)}`);
|
|
290
|
-
console.log(`\n❌ The wait-for-task process was killed unexpectedly.`);
|
|
291
|
-
console.log(` This was NOT a normal timeout - the process was terminated by an external signal.`);
|
|
292
|
-
console.log(`\n⚠️ IMPORTANT: You may miss messages while not waiting!`);
|
|
293
|
-
console.log(` Other agents or users may send tasks to you that will be missed.`);
|
|
294
|
-
console.log(`\n🔄 IMMEDIATELY restart the wait process:`);
|
|
295
|
-
console.log(`\n chatroom wait-for-task ${chatroomId} --role=${role} --session=${currentSession}`);
|
|
296
|
-
console.log(`\n${'═'.repeat(50)}`);
|
|
297
|
-
process.exit(0);
|
|
298
|
-
};
|
|
299
|
-
// SIGINT: Ctrl+C or interrupt signal
|
|
300
|
-
process.on('SIGINT', () => handleSignal('SIGINT'));
|
|
301
|
-
// SIGTERM: Graceful termination (e.g., container shutdown, AI agent timeout)
|
|
302
|
-
process.on('SIGTERM', () => handleSignal('SIGTERM'));
|
|
303
|
-
// SIGHUP: Hang up signal (terminal closed)
|
|
304
|
-
process.on('SIGHUP', () => handleSignal('SIGHUP'));
|
|
305
|
-
}
|
|
306
|
-
//# sourceMappingURL=wait-for-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-task.js","sourceRoot":"","sources":["../../src/commands/wait-for-task.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAgD,MAAM,WAAW,CAAC;AAC9E,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAUnF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,MAAM,KAAK,GAAG,QAAQ;SACnB,IAAI,EAAE;SACN,KAAK,CAAC,mFAAmF,CAAC,CAAC;IAC9F,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAE7C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,GAAG,CAAC;QACT,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,KAAK,GAAG,IAAI,CAAC;QACtB,KAAK,GAAG,CAAC;QACT,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;Y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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,qCAAqC;IACrC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEnD,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAErD,2CAA2C;IAC3C,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ChatroomConfig } from './schema';
|
|
2
|
-
/**
|
|
3
|
-
* Default configuration used when no .chatroom/chatroom.jsonc is found
|
|
4
|
-
* or as the template for `chatroom init`
|
|
5
|
-
*/
|
|
6
|
-
export declare const DEFAULT_CONFIG: ChatroomConfig;
|
|
7
|
-
/**
|
|
8
|
-
* Default configuration as JSONC string (with comments)
|
|
9
|
-
* Used when generating .chatroom/chatroom.jsonc via `chatroom init`
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_CONFIG_JSONC = "{\n // Chatroom CLI Configuration\n // This file defines agent teams and prompt customization.\n \n // The default team to use when --team flag is not specified\n \"defaultTeam\": \"pair\",\n \n // Team definitions\n // Each team specifies the roles that must be present before messages can be sent\n // entryPoint: The role that receives all user messages (defaults to first role)\n \"teams\": {\n // Pair: A minimal team for simple tasks\n \"pair\": {\n \"name\": \"Pair\",\n \"description\": \"A builder and reviewer working together\",\n \"roles\": [\"builder\", \"reviewer\"],\n \"entryPoint\": \"builder\"\n },\n \n // Squad: A full team for complex tasks\n \"squad\": {\n \"name\": \"Squad\",\n \"description\": \"Full team with manager, architects, builders, and reviewers\",\n \"roles\": [\"manager\", \"architect\", \"builder\", \"frontend-designer\", \"reviewer\", \"tester\"],\n \"entryPoint\": \"manager\"\n }\n }\n \n // Prompt customization (optional)\n // Uncomment to customize agent prompts\n // \"prompts\": {\n // // Path to custom init prompt template (replaces default)\n // // \"initPrompt\": \"prompts/init.md\",\n // \n // // System reminders shown to agents\n // \"systemReminders\": {\n // // Set to false to disable system reminders\n // \"enabled\": true\n // // Custom reminder file path\n // // \"waitReminder\": \"prompts/wait-reminder.md\"\n // }\n // }\n}\n";
|
|
12
|
-
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,cAgB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,u+CA2ChC,CAAC"}
|
package/dist/config/defaults.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default configuration used when no .chatroom/chatroom.jsonc is found
|
|
3
|
-
* or as the template for `chatroom init`
|
|
4
|
-
*/
|
|
5
|
-
export const DEFAULT_CONFIG = {
|
|
6
|
-
defaultTeam: 'pair',
|
|
7
|
-
teams: {
|
|
8
|
-
pair: {
|
|
9
|
-
name: 'Pair',
|
|
10
|
-
description: 'A builder and reviewer working together',
|
|
11
|
-
roles: ['builder', 'reviewer'],
|
|
12
|
-
entryPoint: 'builder',
|
|
13
|
-
},
|
|
14
|
-
squad: {
|
|
15
|
-
name: 'Squad',
|
|
16
|
-
description: 'Full team with manager, architects, builders, and reviewers',
|
|
17
|
-
roles: ['manager', 'architect', 'builder', 'frontend-designer', 'reviewer', 'tester'],
|
|
18
|
-
entryPoint: 'manager',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Default configuration as JSONC string (with comments)
|
|
24
|
-
* Used when generating .chatroom/chatroom.jsonc via `chatroom init`
|
|
25
|
-
*/
|
|
26
|
-
export const DEFAULT_CONFIG_JSONC = `{
|
|
27
|
-
// Chatroom CLI Configuration
|
|
28
|
-
// This file defines agent teams and prompt customization.
|
|
29
|
-
|
|
30
|
-
// The default team to use when --team flag is not specified
|
|
31
|
-
"defaultTeam": "pair",
|
|
32
|
-
|
|
33
|
-
// Team definitions
|
|
34
|
-
// Each team specifies the roles that must be present before messages can be sent
|
|
35
|
-
// entryPoint: The role that receives all user messages (defaults to first role)
|
|
36
|
-
"teams": {
|
|
37
|
-
// Pair: A minimal team for simple tasks
|
|
38
|
-
"pair": {
|
|
39
|
-
"name": "Pair",
|
|
40
|
-
"description": "A builder and reviewer working together",
|
|
41
|
-
"roles": ["builder", "reviewer"],
|
|
42
|
-
"entryPoint": "builder"
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
// Squad: A full team for complex tasks
|
|
46
|
-
"squad": {
|
|
47
|
-
"name": "Squad",
|
|
48
|
-
"description": "Full team with manager, architects, builders, and reviewers",
|
|
49
|
-
"roles": ["manager", "architect", "builder", "frontend-designer", "reviewer", "tester"],
|
|
50
|
-
"entryPoint": "manager"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Prompt customization (optional)
|
|
55
|
-
// Uncomment to customize agent prompts
|
|
56
|
-
// "prompts": {
|
|
57
|
-
// // Path to custom init prompt template (replaces default)
|
|
58
|
-
// // "initPrompt": "prompts/init.md",
|
|
59
|
-
//
|
|
60
|
-
// // System reminders shown to agents
|
|
61
|
-
// "systemReminders": {
|
|
62
|
-
// // Set to false to disable system reminders
|
|
63
|
-
// "enabled": true
|
|
64
|
-
// // Custom reminder file path
|
|
65
|
-
// // "waitReminder": "prompts/wait-reminder.md"
|
|
66
|
-
// }
|
|
67
|
-
// }
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,yCAAyC;YACtD,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;YAC9B,UAAU,EAAE,SAAS;SACtB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,6DAA6D;YAC1E,KAAK,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,QAAQ,CAAC;YACrF,UAAU,EAAE,SAAS;SACtB;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CnC,CAAC"}
|
package/dist/config/loader.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { ChatroomConfig, TeamDefinition } from './schema';
|
|
2
|
-
/**
|
|
3
|
-
* Get the global config path in user's home directory
|
|
4
|
-
*/
|
|
5
|
-
export declare function getGlobalConfigPath(): string;
|
|
6
|
-
/**
|
|
7
|
-
* Get the global config directory in user's home directory
|
|
8
|
-
*/
|
|
9
|
-
export declare function getGlobalConfigDir(): string;
|
|
10
|
-
/**
|
|
11
|
-
* Find the config file by walking up the directory tree to home directory
|
|
12
|
-
* Then falls back to the global config in ~/.chatroom/chatroom.jsonc
|
|
13
|
-
*/
|
|
14
|
-
export declare function findConfigPath(startDir?: string): string | null;
|
|
15
|
-
/**
|
|
16
|
-
* Create a global config file with default configuration
|
|
17
|
-
*/
|
|
18
|
-
export declare function createGlobalConfig(): string;
|
|
19
|
-
/**
|
|
20
|
-
* Load and parse the configuration file
|
|
21
|
-
* Returns null if file doesn't exist, throws on parse/validation errors
|
|
22
|
-
*/
|
|
23
|
-
export declare function loadConfigFromPath(configPath: string): ChatroomConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Load configuration from the nearest .chatroom/chatroom.jsonc or return defaults
|
|
26
|
-
*/
|
|
27
|
-
export declare function loadConfig(startDir?: string): {
|
|
28
|
-
config: ChatroomConfig;
|
|
29
|
-
configPath: string | null;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Get a specific team from the configuration
|
|
33
|
-
*/
|
|
34
|
-
export declare function getTeam(config: ChatroomConfig, teamId: string): TeamDefinition | null;
|
|
35
|
-
/**
|
|
36
|
-
* Get the default team from the configuration
|
|
37
|
-
*/
|
|
38
|
-
export declare function getDefaultTeam(config: ChatroomConfig): TeamDefinition;
|
|
39
|
-
/**
|
|
40
|
-
* List all available team IDs
|
|
41
|
-
*/
|
|
42
|
-
export declare function getTeamIds(config: ChatroomConfig): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Load a prompt override file from a path (relative to config file or absolute)
|
|
45
|
-
* Returns null if the file doesn't exist
|
|
46
|
-
*/
|
|
47
|
-
export declare function loadPromptOverride(promptPath: string, configPath: string | null): string | null;
|
|
48
|
-
/**
|
|
49
|
-
* Check if system reminders are enabled in the configuration
|
|
50
|
-
*/
|
|
51
|
-
export declare function areSystemRemindersEnabled(config: ChatroomConfig): boolean;
|
|
52
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AA4ED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CA+B9E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAY3C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAoBrE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,GAAE,MAAsB,GAAG;IAC5D,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CASA;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAErF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAMrE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAE3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAU/F;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEzE"}
|