openclawdreams 3.0.8 → 3.0.9

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.0.9](https://github.com/RogueCtrl/OpenClawDreams/compare/v3.0.8...v3.0.9) (2026-03-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * include install scripts in npm package ([56ba1a7](https://github.com/RogueCtrl/OpenClawDreams/commit/56ba1a7eb995b85c3c110cf9725f1f46b7e1f97d))
11
+ * include install scripts in npm package ([24dcd3d](https://github.com/RogueCtrl/OpenClawDreams/commit/24dcd3d8f8851baa4d5f00ec03cdd8ad8a5212db))
12
+
5
13
  ### [3.0.8](https://github.com/RogueCtrl/OpenClawDreams/compare/v3.0.7...v3.0.8) (2026-03-22)
6
14
 
7
15
 
@@ -2,7 +2,7 @@
2
2
  "id": "openclawdreams",
3
3
  "name": "openclawdreams",
4
4
  "displayName": "ElectricSheep",
5
- "version": "3.0.8",
5
+ "version": "3.0.9",
6
6
  "description": "A reflection engine that synthesizes agent-operator interactions into dreams, enriched by community and web context",
7
7
  "entry": "dist/src/index.js",
8
8
  "skills": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclawdreams",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "description": "A reflection engine that synthesizes agent-operator interactions into dreams",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,6 +38,7 @@
38
38
  "files": [
39
39
  "dist/src",
40
40
  "dist/bin",
41
+ "scripts",
41
42
  "README.md",
42
43
  "CHANGELOG.md",
43
44
  "LICENSE",
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Skip notice in CI or when explicitly suppressed
4
+ if (process.env.CI || process.env.OPENCLAWDREAMS_SKIP_NOTICE) {
5
+ process.exit(0);
6
+ }
7
+
8
+ const YELLOW = '\x1b[33m';
9
+ const CYAN = '\x1b[36m';
10
+ const DIM = '\x1b[2m';
11
+ const RESET = '\x1b[0m';
12
+ const BOLD = '\x1b[1m';
13
+
14
+ console.log(`
15
+ ${YELLOW}╔══════════════════════════════════════════════════════════════╗
16
+ ║ openclawdreams — important notice ║
17
+ ╚══════════════════════════════════════════════════════════════╝${RESET}
18
+
19
+ ${BOLD}openclawdreams runs autonomously in the background.${RESET}
20
+ Once enabled, it schedules reflection and dream cycles
21
+ automatically — no manual intervention required.
22
+
23
+ All LLM calls are routed through your existing ${CYAN}OpenClaw
24
+ gateway${RESET} using your configured provider. ${BOLD}These calls may
25
+ incur real costs.${RESET} You are responsible for any charges.
26
+
27
+ ${BOLD}To disable autonomous scheduling and use CLI only:${RESET}
28
+
29
+ Set ${CYAN}schedulerEnabled: false${RESET} in your OpenClaw plugin config.
30
+ CLI commands will still work:
31
+
32
+ ${DIM}openclaw openclawdreams reflect${RESET}
33
+ ${DIM}openclaw openclawdreams dream${RESET}
34
+
35
+ Full docs: ${CYAN}https://github.com/RogueCtrl/OpenClawDreams${RESET}
36
+
37
+ Set ${BOLD}OPENCLAWDREAMS_SKIP_NOTICE=1${RESET} to suppress this message.
38
+ `);
@@ -0,0 +1,187 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Skip in CI or when explicitly suppressed
4
+ if (process.env.CI || process.env.OPENCLAWDREAMS_SKIP_NOTICE) {
5
+ process.exit(0);
6
+ }
7
+
8
+ import { createInterface } from 'readline';
9
+ import { readFileSync, writeFileSync, copyFileSync, existsSync } from 'fs';
10
+ import { homedir } from 'os';
11
+ import { join } from 'path';
12
+
13
+ const YELLOW = '\x1b[33m';
14
+ const CYAN = '\x1b[36m';
15
+ const DIM = '\x1b[2m';
16
+ const GREEN = '\x1b[32m';
17
+ const RED = '\x1b[31m';
18
+ const RESET = '\x1b[0m';
19
+ const BOLD = '\x1b[1m';
20
+
21
+ const notice = `
22
+ ${YELLOW}╔══════════════════════════════════════════════════════════════╗
23
+ ║ openclawdreams — important notice ║
24
+ ╚══════════════════════════════════════════════════════════════╝${RESET}
25
+
26
+ ${BOLD}openclawdreams runs autonomously in the background.${RESET}
27
+ Once enabled, it schedules reflection and dream cycles
28
+ automatically — no manual intervention required.
29
+
30
+ All LLM calls are routed through your existing ${CYAN}OpenClaw
31
+ gateway${RESET} using your configured provider. ${BOLD}These calls may
32
+ incur real costs.${RESET} You are responsible for any charges.
33
+
34
+ Full docs: ${CYAN}https://github.com/RogueCtrl/OpenClawDreams${RESET}
35
+ `;
36
+
37
+ // If stdin is not a TTY (piped install, non-interactive shell), print notice and continue
38
+ if (!process.stdin.isTTY) {
39
+ console.log(notice);
40
+ console.log(` ${DIM}(Non-interactive install — proceeding automatically.)${RESET}\n`);
41
+ process.exit(0);
42
+ }
43
+
44
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
45
+ const ask = (question) => new Promise((resolve) => rl.question(question, resolve));
46
+ const yesNo = (answer, defaultYes = false) => {
47
+ const v = answer.trim().toLowerCase();
48
+ if (!v) return defaultYes;
49
+ return ['yes', 'y', '1'].includes(v);
50
+ };
51
+
52
+ console.log(notice);
53
+
54
+ // ── Step 1: Confirm install ──────────────────────────────────────────────────
55
+ const proceed = await ask(` Proceed with installation? ${BOLD}[yes/no]${RESET} `);
56
+ if (!yesNo(proceed)) {
57
+ rl.close();
58
+ console.log(`\n ${RED}✗ Installation aborted.${RESET}\n`);
59
+ process.exit(1);
60
+ }
61
+
62
+ // ── Step 2: Scheduler mode ───────────────────────────────────────────────────
63
+ console.log(`
64
+ ${BOLD}Run mode${RESET}
65
+
66
+ ${CYAN}autonomous${RESET} Reflection and dream cycles run on a background
67
+ schedule automatically (default)
68
+ ${CYAN}cli${RESET} No background scheduling — trigger cycles manually
69
+ `);
70
+ const modeAnswer = await ask(` Choose mode ${BOLD}[autonomous/cli]${RESET} (default: autonomous) `);
71
+ const cliMode = ['cli', '2'].includes(modeAnswer.trim().toLowerCase());
72
+
73
+ // ── Step 3: Moltbook ─────────────────────────────────────────────────────────
74
+ console.log(`
75
+ ${BOLD}Moltbook integration${RESET} ${DIM}(optional)${RESET}
76
+
77
+ Moltbook is a social network for AI agents. When enabled,
78
+ openclawdreams can post dream reflections there automatically.
79
+ `);
80
+ const moltbookAnswer = await ask(` Enable Moltbook integration? ${BOLD}[yes/no]${RESET} (default: no) `);
81
+ const moltbookEnabled = yesNo(moltbookAnswer, false);
82
+
83
+ // ── Step 4: Approval gate (only if Moltbook enabled) ────────────────────────
84
+ let requireApproval = true;
85
+ if (moltbookEnabled) {
86
+ console.log(`
87
+ ${BOLD}Post approval${RESET}
88
+
89
+ ${CYAN}yes${RESET} You manually run ${DIM}openclaw openclawdreams post${RESET} to publish (default)
90
+ ${CYAN}no${RESET} Dreams are posted to Moltbook automatically after each cycle
91
+ `);
92
+ const approvalAnswer = await ask(` Require your approval before posting? ${BOLD}[yes/no]${RESET} (default: yes) `);
93
+ requireApproval = yesNo(approvalAnswer, true);
94
+ }
95
+
96
+ // ── Step 5: Daily token budget ───────────────────────────────────────────────
97
+ console.log(`
98
+ ${BOLD}Daily token budget${RESET}
99
+
100
+ openclawdreams tracks daily token usage and halts further LLM calls
101
+ when the budget is exhausted. ${CYAN}800000${RESET} is the default.
102
+ Set ${CYAN}0${RESET} to disable the budget entirely ${DIM}(recommended for flat-rate / OAuth plans)${RESET}.
103
+ `);
104
+ const budgetAnswer = await ask(` Daily token budget ${BOLD}[number]${RESET} (default: 800000, 0 to disable) `);
105
+ const parsedBudget = Number.parseInt(budgetAnswer.trim() || '800000', 10);
106
+ const maxDailyTokens = Number.isFinite(parsedBudget) && parsedBudget >= 0 ? parsedBudget : 800000;
107
+
108
+ // ── Build config object ──────────────────────────────────────────────────────
109
+ const pluginConfig = {
110
+ ...(cliMode ? { schedulerEnabled: false } : {}),
111
+ ...(moltbookEnabled ? { moltbookEnabled: true } : {}),
112
+ ...(moltbookEnabled && !requireApproval ? { requireApprovalBeforePost: false } : {}),
113
+ maxDailyTokens,
114
+ };
115
+
116
+ // ── Build snippet strings (used for both auto-write and manual fallback) ─────
117
+ const hasConfig = Object.keys(pluginConfig).length > 0;
118
+ const configLines = Object.entries(pluginConfig)
119
+ .map(([k, v]) => ` "${k}": ${JSON.stringify(v)}`)
120
+ .join(',\n');
121
+
122
+ // ── Step 6: Auto-write to OpenClaw config ────────────────────────────────────
123
+ const configPath = join(homedir(), '.openclaw', 'openclaw.json');
124
+ const configExists = existsSync(configPath);
125
+ let wrote = false;
126
+
127
+ if (configExists) {
128
+ console.log(`\n ${GREEN}✓ OpenClaw config found${RESET} ${DIM}(${configPath})${RESET}\n`);
129
+ const writeAnswer = await ask(` Write these settings to your OpenClaw config automatically? ${BOLD}[yes/no]${RESET} (default: yes) `);
130
+
131
+ if (yesNo(writeAnswer, true)) {
132
+ try {
133
+ const backupPath = `${configPath}.bak`;
134
+ copyFileSync(configPath, backupPath);
135
+
136
+ const cfg = JSON.parse(readFileSync(configPath, 'utf8'));
137
+ cfg.plugins = cfg.plugins ?? {};
138
+ cfg.plugins.entries = cfg.plugins.entries ?? {};
139
+ cfg.plugins.entries.openclawdreams = cfg.plugins.entries.openclawdreams ?? {};
140
+ cfg.plugins.entries.openclawdreams.enabled = true;
141
+
142
+ if (hasConfig) {
143
+ cfg.plugins.entries.openclawdreams.config = {
144
+ ...(cfg.plugins.entries.openclawdreams.config ?? {}),
145
+ ...pluginConfig,
146
+ };
147
+ }
148
+
149
+ writeFileSync(configPath, JSON.stringify(cfg, null, 2) + '\n');
150
+ wrote = true;
151
+ console.log(`\n ${GREEN}✓ Config updated.${RESET} Backup saved to ${DIM}${backupPath}${RESET}`);
152
+ } catch (err) {
153
+ console.log(`\n ${RED}✗ Could not write config: ${err.message}${RESET}`);
154
+ }
155
+ }
156
+ } else {
157
+ console.log(`\n ${DIM}(OpenClaw config not found — you'll need to add this manually.)${RESET}`);
158
+ }
159
+
160
+ rl.close();
161
+
162
+ // ── Print snippet as fallback or confirmation ────────────────────────────────
163
+ if (!wrote) {
164
+ console.log(`
165
+ ${BOLD}Add this to your OpenClaw plugin config:${RESET}
166
+
167
+ ${DIM}{
168
+ "plugins": {
169
+ "entries": {
170
+ "openclawdreams": {
171
+ "enabled": true${hasConfig ? `,\n "config": {\n${configLines}\n }` : ''}
172
+ }
173
+ }
174
+ }
175
+ }${RESET}`);
176
+ }
177
+
178
+ console.log(`
179
+ ${cliMode ? ` Trigger cycles manually:
180
+ ${DIM}openclaw openclawdreams reflect
181
+ openclaw openclawdreams dream${RESET}
182
+ ` : ''}${moltbookEnabled && requireApproval ? ` Post dreams to Moltbook manually:
183
+ ${DIM}openclaw openclawdreams post${RESET}
184
+ ` : ''} Full docs: ${CYAN}https://github.com/RogueCtrl/OpenClawDreams${RESET}
185
+ `);
186
+
187
+ process.exit(0);