@iamoberlin/chorus 1.3.1 → 1.3.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/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.3.0"; // Async spawn: unblock gateway event loop during choir execution
41
+ const VERSION = "1.3.2"; // Fix: pass prompt via stdin not --message flag
42
42
 
43
43
  const plugin = {
44
44
  id: "chorus",
@@ -2,7 +2,7 @@
2
2
  "id": "chorus",
3
3
  "name": "CHORUS",
4
4
  "description": "CHORUS: Hierarchy Of Recursive Unified Self-improvement",
5
- "version": "1.1.3",
5
+ "version": "1.3.2",
6
6
  "author": "Oberlin",
7
7
  "homepage": "https://chorus.oberlin.ai",
8
8
  "repository": "https://github.com/iamoberlin/chorus",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamoberlin/chorus",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
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",
package/src/choirs.ts CHANGED
@@ -30,7 +30,7 @@ export const CHOIRS: Record<string, Choir> = {
30
30
  seraphim: {
31
31
  id: "seraphim",
32
32
  name: "Seraphim",
33
- emoji: "",
33
+ emoji: "🔥",
34
34
  triad: "contemplation",
35
35
  frequencyPerDay: 1, // 1×/day
36
36
  intervalMinutes: 1440, // Once per day
@@ -59,7 +59,7 @@ Pass illumination to Cherubim.`,
59
59
  cherubim: {
60
60
  id: "cherubim",
61
61
  name: "Cherubim",
62
- emoji: "",
62
+ emoji: "📚",
63
63
  triad: "contemplation",
64
64
  frequencyPerDay: 2, // 2×/day
65
65
  intervalMinutes: 720, // Every 12 hours
@@ -96,7 +96,7 @@ Pass illumination to Thrones.`,
96
96
  thrones: {
97
97
  id: "thrones",
98
98
  name: "Thrones",
99
- emoji: "",
99
+ emoji: "⚖️",
100
100
  triad: "contemplation",
101
101
  frequencyPerDay: 3, // 3×/day
102
102
  intervalMinutes: 480, // Every 8 hours
@@ -131,7 +131,7 @@ Pass illumination to Dominions.`,
131
131
  dominions: {
132
132
  id: "dominions",
133
133
  name: "Dominions",
134
- emoji: "",
134
+ emoji: "👑",
135
135
  triad: "governance",
136
136
  frequencyPerDay: 4, // 4×/day
137
137
  intervalMinutes: 360, // Every 6 hours
@@ -161,7 +161,7 @@ Pass illumination to Virtues.`,
161
161
  virtues: {
162
162
  id: "virtues",
163
163
  name: "Virtues",
164
- emoji: "",
164
+ emoji: "🔧",
165
165
  triad: "governance",
166
166
  frequencyPerDay: 6, // 6×/day — THE RSI ENGINE
167
167
  intervalMinutes: 240, // Every 4 hours
@@ -211,7 +211,7 @@ Pass illumination to Powers.`,
211
211
  powers: {
212
212
  id: "powers",
213
213
  name: "Powers",
214
- emoji: "",
214
+ emoji: "🛡️",
215
215
  triad: "governance",
216
216
  frequencyPerDay: 8, // 8×/day
217
217
  intervalMinutes: 180, // Every 3 hours
@@ -262,7 +262,7 @@ If thesis is seriously threatened or security issue found: ALERT immediately.`,
262
262
  principalities: {
263
263
  id: "principalities",
264
264
  name: "Principalities",
265
- emoji: "",
265
+ emoji: "🔭",
266
266
  triad: "action",
267
267
  frequencyPerDay: 12, // 12×/day
268
268
  intervalMinutes: 120, // Every 2 hours
@@ -304,7 +304,7 @@ Pass illumination to Archangels.`,
304
304
  archangels: {
305
305
  id: "archangels",
306
306
  name: "Archangels",
307
- emoji: "",
307
+ emoji: "📢",
308
308
  triad: "action",
309
309
  frequencyPerDay: 18, // 18×/day
310
310
  intervalMinutes: 80, // Every ~80 minutes
@@ -340,7 +340,7 @@ Output: Briefing or alert message to deliver.`,
340
340
  angels: {
341
341
  id: "angels",
342
342
  name: "Angels",
343
- emoji: "",
343
+ emoji: "💫",
344
344
  triad: "action",
345
345
  frequencyPerDay: 48, // 48×/day — continuous presence
346
346
  intervalMinutes: 30, // Every 30 minutes
@@ -11,7 +11,7 @@ import { recordExecution, type ChoirExecution } from "./metrics.js";
11
11
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
12
12
  import { join } from "path";
13
13
  import { homedir } from "os";
14
- import { spawnSync } from "child_process";
14
+ import { spawn } from "child_process";
15
15
 
16
16
  // Workspace path for research output
17
17
  const WORKSPACE_PATH = process.env.OPENCLAW_WORKSPACE || join(homedir(), ".openclaw", "workspace");
@@ -274,17 +274,28 @@ CRITICAL: If sending alerts via iMessage, use PLAIN TEXT ONLY (no markdown).
274
274
  }
275
275
 
276
276
  if (!result) {
277
- // CLI fallback - use stdin to avoid arg length limits
277
+ // CLI fallback - use stdin to avoid arg length limits (async to avoid blocking event loop)
278
278
  log.debug(`[purpose-research] Using CLI fallback for "${purpose.name}"`);
279
- result = spawnSync("openclaw", [
280
- "agent",
281
- "--session-id", `chorus:purpose:${purpose.id}`,
282
- "--json",
283
- ], {
284
- input: prompt,
285
- encoding: "utf-8",
286
- timeout: config.researchTimeoutMs,
287
- maxBuffer: 1024 * 1024, // 1MB
279
+ result = await new Promise<any>((resolve) => {
280
+ const child = spawn("openclaw", [
281
+ "agent",
282
+ "--session-id", `chorus:purpose:${purpose.id}`,
283
+ "--json",
284
+ ], { stdio: ['pipe', 'pipe', 'pipe'] });
285
+
286
+ let stdout = '';
287
+ let stderr = '';
288
+ const maxBuffer = 1024 * 1024;
289
+ child.stdout.on('data', (d: Buffer) => { if (stdout.length < maxBuffer) stdout += d.toString(); });
290
+ child.stderr.on('data', (d: Buffer) => { if (stderr.length < maxBuffer) stderr += d.toString(); });
291
+
292
+ // Write prompt to stdin
293
+ child.stdin.write(prompt);
294
+ child.stdin.end();
295
+
296
+ const timer = setTimeout(() => { child.kill('SIGTERM'); }, config.researchTimeoutMs);
297
+ child.on('close', (code) => { clearTimeout(timer); resolve({ status: code, stdout, stderr }); });
298
+ child.on('error', (err) => { clearTimeout(timer); resolve({ status: 1, stdout: '', stderr: String(err) }); });
288
299
  });
289
300
 
290
301
  if (result.status === 0 && result.stdout) {
package/src/scheduler.ts CHANGED
@@ -12,7 +12,7 @@ import { recordExecution, type ChoirExecution } from "./metrics.js";
12
12
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
13
13
  import { join } from "path";
14
14
  import { homedir } from "os";
15
- import { spawnSync } from "child_process";
15
+ import { spawn } from "child_process";
16
16
 
17
17
  interface ChoirContext {
18
18
  choirId: string;
@@ -128,20 +128,31 @@ export function createChoirScheduler(
128
128
  try {
129
129
  const prompt = buildPrompt(choir);
130
130
 
131
- // Use openclaw agent CLI (same as Vision mode)
132
- const result = spawnSync('openclaw', [
133
- 'agent',
134
- '--session-id', `chorus:${choir.id}`,
135
- '--message', prompt,
136
- '--json',
137
- ], {
138
- encoding: 'utf-8',
139
- timeout: 300000, // 5 min
140
- maxBuffer: 1024 * 1024, // 1MB
131
+ // Use openclaw agent CLI (async to avoid blocking event loop)
132
+ const result = await new Promise<{ status: number | null; stdout: string; stderr: string }>((resolve) => {
133
+ const child = spawn('openclaw', [
134
+ 'agent',
135
+ '--session-id', `chorus:${choir.id}`,
136
+ '--json',
137
+ ], { stdio: ['pipe', 'pipe', 'pipe'] });
138
+
139
+ // Pass prompt via stdin (--message flag doesn't work)
140
+ child.stdin.write(prompt);
141
+ child.stdin.end();
142
+
143
+ let stdout = '';
144
+ let stderr = '';
145
+ const maxBuffer = 1024 * 1024;
146
+ child.stdout.on('data', (d: Buffer) => { if (stdout.length < maxBuffer) stdout += d.toString(); });
147
+ child.stderr.on('data', (d: Buffer) => { if (stderr.length < maxBuffer) stderr += d.toString(); });
148
+
149
+ const timer = setTimeout(() => { child.kill('SIGTERM'); }, 300000); // 5 min
150
+ child.on('close', (code) => { clearTimeout(timer); resolve({ status: code, stdout, stderr }); });
151
+ child.on('error', (err) => { clearTimeout(timer); resolve({ status: 1, stdout: '', stderr: String(err) }); });
141
152
  });
142
153
 
143
154
  let output = "(no response)";
144
-
155
+
145
156
  if (result.status === 0 && result.stdout) {
146
157
  // Extract JSON from output (may have plugin logs before it)
147
158
  const stdout = result.stdout;