flight-rules 0.15.0 → 0.15.2
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/dist/commands/ralph.d.ts +4 -0
- package/dist/commands/ralph.js +22 -2
- package/package.json +1 -1
- package/payload/AGENTS.md +1 -1
package/dist/commands/ralph.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export interface TaskGroupPlan {
|
|
|
16
16
|
status: string;
|
|
17
17
|
}>;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Format a timestamp for verbose output: [HH:MM:SS]
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatTimestamp(): string;
|
|
19
23
|
/**
|
|
20
24
|
* Parse the discovery response from Claude into TaskGroupPlan objects.
|
|
21
25
|
* Returns null if the response cannot be parsed (tags not found).
|
package/dist/commands/ralph.js
CHANGED
|
@@ -80,6 +80,16 @@ function buildAreaConstraint(area) {
|
|
|
80
80
|
- If no incomplete task groups exist in Area ${area}, respond with ALL_COMPLETE
|
|
81
81
|
`;
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Format a timestamp for verbose output: [HH:MM:SS]
|
|
85
|
+
*/
|
|
86
|
+
export function formatTimestamp() {
|
|
87
|
+
const now = new Date();
|
|
88
|
+
const hours = String(now.getHours()).padStart(2, '0');
|
|
89
|
+
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
90
|
+
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
91
|
+
return `[${hours}:${minutes}:${seconds}]`;
|
|
92
|
+
}
|
|
83
93
|
/**
|
|
84
94
|
* Check if Claude CLI is available
|
|
85
95
|
*/
|
|
@@ -116,6 +126,7 @@ async function runClaudeWithPrompt(promptContent, verbose) {
|
|
|
116
126
|
let output = '';
|
|
117
127
|
let errorOutput = '';
|
|
118
128
|
let lineBuffer = ''; // Buffer for incomplete JSON lines
|
|
129
|
+
let needsTimestamp = true; // Track whether next text output needs a timestamp
|
|
119
130
|
claude.stdout?.on('data', (data) => {
|
|
120
131
|
const text = data.toString();
|
|
121
132
|
output += text;
|
|
@@ -134,16 +145,25 @@ async function runClaudeWithPrompt(promptContent, verbose) {
|
|
|
134
145
|
if (parsed.type === 'assistant' && parsed.message?.content) {
|
|
135
146
|
for (const block of parsed.message.content) {
|
|
136
147
|
if (block.type === 'text' && block.text) {
|
|
148
|
+
if (needsTimestamp) {
|
|
149
|
+
process.stdout.write(`${formatTimestamp()} `);
|
|
150
|
+
needsTimestamp = false;
|
|
151
|
+
}
|
|
137
152
|
process.stdout.write(block.text);
|
|
138
153
|
}
|
|
139
154
|
}
|
|
140
155
|
}
|
|
141
156
|
else if (parsed.type === 'content_block_delta' && parsed.delta?.text) {
|
|
157
|
+
if (needsTimestamp) {
|
|
158
|
+
process.stdout.write(`${formatTimestamp()} `);
|
|
159
|
+
needsTimestamp = false;
|
|
160
|
+
}
|
|
142
161
|
process.stdout.write(parsed.delta.text);
|
|
143
162
|
}
|
|
144
163
|
else if (parsed.type === 'content_block_stop') {
|
|
145
|
-
// Add newline after each content block ends
|
|
146
|
-
process.stdout.write('\n');
|
|
164
|
+
// Add newline + blank line after each content block ends
|
|
165
|
+
process.stdout.write('\n\n');
|
|
166
|
+
needsTimestamp = true;
|
|
147
167
|
}
|
|
148
168
|
}
|
|
149
169
|
catch {
|
package/package.json
CHANGED