@iamoberlin/chorus 1.2.4 → 1.2.6

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.
Files changed (2) hide show
  1. package/index.ts +21 -11
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  import * as prayers from "./src/prayers/prayers.js";
39
39
  import * as prayerStore from "./src/prayers/store.js";
40
40
 
41
- const VERSION = "1.2.4"; // Vision runs REAL choirs by default, --dry-run for narration
41
+ const VERSION = "1.2.6"; // Fixed: use --message flag instead of nonexistent stdin support
42
42
 
43
43
  const plugin = {
44
44
  id: "chorus",
@@ -213,14 +213,14 @@ const plugin = {
213
213
  console.error(` ✗ ${choir.name} failed:`, err);
214
214
  }
215
215
  } else {
216
- // CLI context: use openclaw agent via stdin to avoid arg length limits
216
+ // CLI context: use openclaw agent with --message flag
217
217
  try {
218
218
  const result = spawnSync('openclaw', [
219
219
  'agent',
220
220
  '--session-id', `chorus:${id}`,
221
+ '--message', choir.prompt,
221
222
  '--json',
222
223
  ], {
223
- input: choir.prompt,
224
224
  encoding: 'utf-8',
225
225
  timeout: 300000, // 5 min
226
226
  maxBuffer: 1024 * 1024, // 1MB
@@ -347,10 +347,12 @@ const plugin = {
347
347
  process.stdout.write(` ${choir.emoji} ${choir.name}...`);
348
348
 
349
349
  try {
350
- // Run the REAL choir with full tool access
351
- // This performs actual web searches, file updates, state changes
350
+ // Run the REAL choir with full tool access via direct agent call
352
351
  const result = spawnSync('openclaw', [
353
- 'chorus', 'run', choirId,
352
+ 'agent',
353
+ '--session-id', `chorus:vision:${choirId}:d${day}`,
354
+ '--message', choir.prompt,
355
+ '--json',
354
356
  ], {
355
357
  encoding: 'utf-8',
356
358
  timeout: 300000, // 5 min timeout per choir (real work takes longer)
@@ -358,11 +360,19 @@ const plugin = {
358
360
  });
359
361
 
360
362
  if (result.status === 0) {
361
- // Capture the choir's output for summary
362
- const output = result.stdout || '';
363
- contextStore.set(`${choirId}:d${day}`, output.slice(-2000)); // Last 2KB
364
- successfulRuns++;
365
- console.log(` ✓`);
363
+ // Parse the agent response
364
+ try {
365
+ const json = JSON.parse(result.stdout || '{}');
366
+ const text = json.result?.payloads?.[0]?.text || '';
367
+ const duration = json.result?.meta?.durationMs || 0;
368
+ contextStore.set(`${choirId}:d${day}`, text.slice(0, 2000)); // Keep 2KB of response
369
+ successfulRuns++;
370
+ console.log(` ✓ (${(duration/1000).toFixed(1)}s)`);
371
+ } catch {
372
+ contextStore.set(`${choirId}:d${day}`, result.stdout?.slice(-2000) || `[${choir.name} completed]`);
373
+ successfulRuns++;
374
+ console.log(` ✓`);
375
+ }
366
376
  } else {
367
377
  const errMsg = (result.stderr || result.error?.message || 'unknown error').slice(0, 100);
368
378
  console.log(` ✗ (${errMsg})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamoberlin/chorus",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "CHORUS: Hierarchy Of Recursive Unified Self-improvement — with Prayer Requests social network",
5
5
  "author": "Oberlin <iam@oberlin.ai>",
6
6
  "license": "MIT",