@iamoberlin/chorus 1.2.4 → 1.2.5

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 +20 -9
  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.5"; // Vision now correctly passes choir prompts via stdin
42
42
 
43
43
  const plugin = {
44
44
  id: "chorus",
@@ -347,22 +347,33 @@ 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
351
+ // Pass the choir prompt via stdin to avoid arg length limits
352
352
  const result = spawnSync('openclaw', [
353
- 'chorus', 'run', choirId,
353
+ 'agent',
354
+ '--session-id', `chorus:vision:${choirId}:d${day}`,
355
+ '--json',
354
356
  ], {
357
+ input: choir.prompt, // Pass the full choir prompt via stdin
355
358
  encoding: 'utf-8',
356
359
  timeout: 300000, // 5 min timeout per choir (real work takes longer)
357
360
  maxBuffer: 10 * 1024 * 1024, // 10MB buffer for full output
358
361
  });
359
362
 
360
363
  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(` ✓`);
364
+ // Parse the agent response
365
+ try {
366
+ const json = JSON.parse(result.stdout || '{}');
367
+ const text = json.result?.payloads?.[0]?.text || '';
368
+ const duration = json.result?.meta?.durationMs || 0;
369
+ contextStore.set(`${choirId}:d${day}`, text.slice(0, 2000)); // Keep 2KB of response
370
+ successfulRuns++;
371
+ console.log(` ✓ (${(duration/1000).toFixed(1)}s)`);
372
+ } catch {
373
+ contextStore.set(`${choirId}:d${day}`, result.stdout?.slice(-2000) || `[${choir.name} completed]`);
374
+ successfulRuns++;
375
+ console.log(` ✓`);
376
+ }
366
377
  } else {
367
378
  const errMsg = (result.stderr || result.error?.message || 'unknown error').slice(0, 100);
368
379
  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.5",
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",