@dotsetlabs/dotclaw 1.5.0 → 1.5.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "dotclaw-agent-runner",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "dotclaw-agent-runner",
9
- "version": "1.5.0",
9
+ "version": "1.5.2",
10
10
  "dependencies": {
11
11
  "@openrouter/sdk": "^0.3.0",
12
12
  "cron-parser": "^5.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotclaw-agent-runner",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "type": "module",
5
5
  "description": "Container-side agent runner for DotClaw",
6
6
  "main": "dist/index.js",
@@ -72,6 +72,8 @@ function isContainerInput(value: unknown): value is ContainerInput {
72
72
  async function loop(): Promise<void> {
73
73
  ensureDirs();
74
74
  log('Daemon started');
75
+ const heartbeatIntervalMs = Math.max(1000, Math.min(POLL_MS, 10_000));
76
+ const heartbeatTimer = setInterval(writeHeartbeat, heartbeatIntervalMs);
75
77
  while (true) {
76
78
  // Write heartbeat at the start of each loop iteration
77
79
  writeHeartbeat();
@@ -83,6 +85,8 @@ async function loop(): Promise<void> {
83
85
  }
84
86
  await new Promise(resolve => setTimeout(resolve, POLL_MS));
85
87
  }
88
+ // Unreachable, but keep for clarity if loop ever exits
89
+ clearInterval(heartbeatTimer);
86
90
  }
87
91
 
88
92
  loop().catch(err => {
@@ -113,12 +113,20 @@ function extractTextFallbackFromResponse(response: unknown): string {
113
113
  }
114
114
 
115
115
  if (Array.isArray(record.output)) {
116
- const messageItem = record.output.find(item => !!item && typeof item === 'object' && (item as { type?: unknown }).type === 'message');
117
- if (messageItem && typeof messageItem === 'object') {
118
- const content = (messageItem as { content?: unknown }).content;
119
- const text = coerceTextFromContent(content);
120
- if (text.trim()) return text;
116
+ const outputTexts: string[] = [];
117
+ for (const item of record.output) {
118
+ if (!item || typeof item !== 'object') continue;
119
+ const typed = item as { type?: unknown; content?: unknown; text?: unknown };
120
+ const type = typeof typed.type === 'string' ? typed.type : '';
121
+ if (type === 'message') {
122
+ const text = coerceTextFromContent(typed.content);
123
+ if (text.trim()) outputTexts.push(text);
124
+ } else if (type === 'output_text' && typeof typed.text === 'string' && typed.text.trim()) {
125
+ outputTexts.push(typed.text);
126
+ }
121
127
  }
128
+ const joined = outputTexts.join('');
129
+ if (joined.trim()) return joined;
122
130
  }
123
131
 
124
132
  if (Array.isArray(record.choices) && record.choices.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotsetlabs/dotclaw",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Personal OpenRouter-based assistant. Lightweight, secure, customizable.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",