@iamoberlin/chorus 1.3.0 → 1.3.1

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
@@ -219,14 +219,14 @@ const plugin = {
219
219
  console.error(` ✗ ${choir.name} failed:`, err);
220
220
  }
221
221
  } else {
222
- // CLI context: use openclaw agent with stdin
222
+ // CLI context: use openclaw agent with --message flag
223
223
  try {
224
224
  const result = spawnSync('openclaw', [
225
225
  'agent',
226
226
  '--session-id', `chorus:${id}`,
227
+ '--message', choir.prompt,
227
228
  '--json',
228
229
  ], {
229
- input: choir.prompt,
230
230
  encoding: 'utf-8',
231
231
  timeout: 300000, // 5 min
232
232
  maxBuffer: 1024 * 1024, // 1MB
@@ -328,9 +328,9 @@ const plugin = {
328
328
  const result = spawnSync('openclaw', [
329
329
  'agent',
330
330
  '--session-id', `chorus:vision:dry:${choirId}:d${day}`,
331
+ '--message', dryPrompt,
331
332
  '--json',
332
333
  ], {
333
- input: dryPrompt,
334
334
  encoding: 'utf-8',
335
335
  timeout: 60000,
336
336
  maxBuffer: 1024 * 1024,
@@ -364,9 +364,9 @@ const plugin = {
364
364
  const result = spawnSync('openclaw', [
365
365
  'agent',
366
366
  '--session-id', `chorus:vision:${choirId}:d${day}`,
367
+ '--message', choir.prompt,
367
368
  '--json',
368
369
  ], {
369
- input: choir.prompt,
370
370
  encoding: 'utf-8',
371
371
  timeout: 300000, // 5 min timeout per choir (real work takes longer)
372
372
  maxBuffer: 10 * 1024 * 1024, // 10MB buffer for full output
@@ -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.3.0",
5
+ "version": "1.1.3",
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.0",
3
+ "version": "1.3.1",
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 { spawn } from "child_process";
14
+ import { spawnSync } 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,28 +274,17 @@ 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 (async to avoid blocking event loop)
277
+ // CLI fallback - use stdin to avoid arg length limits
278
278
  log.debug(`[purpose-research] Using CLI fallback for "${purpose.name}"`);
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) }); });
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
299
288
  });
300
289
 
301
290
  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 { spawn } from "child_process";
15
+ import { spawnSync } from "child_process";
16
16
 
17
17
  interface ChoirContext {
18
18
  choirId: string;
@@ -128,28 +128,20 @@ export function createChoirScheduler(
128
128
  try {
129
129
  const prompt = buildPrompt(choir);
130
130
 
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
- '--message', prompt,
137
- '--json',
138
- ], { stdio: ['pipe', 'pipe', 'pipe'] });
139
-
140
- let stdout = '';
141
- let stderr = '';
142
- const maxBuffer = 1024 * 1024;
143
- child.stdout.on('data', (d: Buffer) => { if (stdout.length < maxBuffer) stdout += d.toString(); });
144
- child.stderr.on('data', (d: Buffer) => { if (stderr.length < maxBuffer) stderr += d.toString(); });
145
-
146
- const timer = setTimeout(() => { child.kill('SIGTERM'); }, 300000); // 5 min
147
- child.on('close', (code) => { clearTimeout(timer); resolve({ status: code, stdout, stderr }); });
148
- child.on('error', (err) => { clearTimeout(timer); resolve({ status: 1, stdout: '', stderr: String(err) }); });
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
149
141
  });
150
142
 
151
143
  let output = "(no response)";
152
-
144
+
153
145
  if (result.status === 0 && result.stdout) {
154
146
  // Extract JSON from output (may have plugin logs before it)
155
147
  const stdout = result.stdout;