flight-rules 0.13.0 → 0.13.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.
@@ -103,9 +103,16 @@ async function isClaudeCliAvailable() {
103
103
  */
104
104
  async function runClaudeWithPrompt(promptContent, verbose) {
105
105
  return new Promise((resolve, reject) => {
106
- const claude = spawn('claude', ['--dangerously-skip-permissions', '-p'], {
106
+ // Use --output-format stream-json for real-time streaming output
107
+ // Note: Claude CLI requires --verbose when using stream-json with -p
108
+ const claude = spawn('claude', [
109
+ '--dangerously-skip-permissions',
110
+ '-p',
111
+ '--verbose',
112
+ '--output-format',
113
+ 'stream-json',
114
+ ], {
107
115
  stdio: ['pipe', 'pipe', 'pipe'],
108
- shell: true,
109
116
  });
110
117
  let output = '';
111
118
  let errorOutput = '';
@@ -113,7 +120,27 @@ async function runClaudeWithPrompt(promptContent, verbose) {
113
120
  const text = data.toString();
114
121
  output += text;
115
122
  if (verbose) {
116
- process.stdout.write(text);
123
+ // Parse stream-json format and extract text content
124
+ const lines = text.split('\n').filter((line) => line.trim());
125
+ for (const line of lines) {
126
+ try {
127
+ const parsed = JSON.parse(line);
128
+ // Handle different message types in stream-json format
129
+ if (parsed.type === 'assistant' && parsed.message?.content) {
130
+ for (const block of parsed.message.content) {
131
+ if (block.type === 'text' && block.text) {
132
+ process.stdout.write(block.text);
133
+ }
134
+ }
135
+ }
136
+ else if (parsed.type === 'content_block_delta' && parsed.delta?.text) {
137
+ process.stdout.write(parsed.delta.text);
138
+ }
139
+ }
140
+ catch {
141
+ // Not valid JSON or incomplete line, skip
142
+ }
143
+ }
117
144
  }
118
145
  });
119
146
  claude.stderr?.on('data', (data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flight-rules",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "An opinionated framework for AI-assisted software development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/payload/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Flight Rules – Agent Guidelines
2
2
 
3
- flight_rules_version: 0.13.0
3
+ flight_rules_version: 0.13.2
4
4
 
5
5
  This file defines how agents (Claude Code, Cursor, etc.) should work on software projects using the Flight Rules system.
6
6