flowmind 1.5.7 → 1.5.8

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.5.8] - 2026-07-02
4
+
5
+ ### Fixed
6
+ - Log audit no longer asks for a time range when the user already specified a relative date like "today"
7
+ - Aliyun SLS log query timestamps are normalized to integer seconds before the MCP call, matching the backend parameter contract
8
+
3
9
  ## [1.5.7] - 2026-07-02
4
10
 
5
11
  ### Added
@@ -68,12 +68,47 @@ class AliyunSlsAdapter extends LogServiceAdapter {
68
68
  project: project || this.config.config?.defaultProject,
69
69
  logstore: logstore || this.config.config?.defaultLogstore,
70
70
  query: query || '',
71
- from,
72
- to,
71
+ from: normalizeTimestamp(from),
72
+ to: normalizeTimestamp(to),
73
73
  line,
74
74
  reverse: true
75
75
  };
76
76
  }
77
77
  }
78
78
 
79
+ function normalizeTimestamp(value) {
80
+ if (value === null || value === undefined || value === '') {
81
+ return undefined;
82
+ }
83
+
84
+ if (typeof value === 'number' && Number.isFinite(value)) {
85
+ return normalizeEpochLikeNumber(value);
86
+ }
87
+
88
+ const numeric = Number(value);
89
+ if (Number.isFinite(numeric) && String(value).trim() !== '') {
90
+ return normalizeEpochLikeNumber(numeric);
91
+ }
92
+
93
+ const parsed = Date.parse(value);
94
+ if (Number.isFinite(parsed)) {
95
+ return Math.trunc(parsed / 1000);
96
+ }
97
+
98
+ return undefined;
99
+ }
100
+
101
+ function normalizeEpochLikeNumber(value) {
102
+ const integer = Math.trunc(value);
103
+ if (!Number.isFinite(integer)) {
104
+ return undefined;
105
+ }
106
+
107
+ if (Math.abs(integer) >= 1e11) {
108
+ return Math.trunc(integer / 1000);
109
+ }
110
+
111
+ return integer;
112
+ }
113
+
79
114
  module.exports = AliyunSlsAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowmind",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Memory and workflow automation for MCP, Codex, and Claude Code. Reuse repeatable developer operations through skills and explicit feedback.",
5
5
  "main": "core/index.js",
6
6
  "bin": {
@@ -182,10 +182,41 @@ function buildNoRecordsMessage(params) {
182
182
  }
183
183
 
184
184
  if (params.keyword) {
185
- return `未找到符合關鍵字:${params.keyword} 的日誌。請補充服務或時間範圍。`;
185
+ const suggestions = [];
186
+ if (!params.service) {
187
+ suggestions.push('服務');
188
+ }
189
+ if (!params.timeRange) {
190
+ suggestions.push('時間範圍');
191
+ }
192
+ suggestions.push('放寬關鍵字');
193
+
194
+ const suggestionText = suggestions.length > 0
195
+ ? `請嘗試${joinChineseList(suggestions)}。`
196
+ : '請嘗試放寬關鍵字。';
197
+
198
+ return `未找到符合關鍵字:${params.keyword} 的日誌。${suggestionText}`;
186
199
  }
187
200
 
188
- return '未找到符合條件的日誌。請補充關鍵字、服務或時間範圍。';
201
+ const suggestions = [];
202
+ if (!params.service) suggestions.push('服務');
203
+ if (!params.keyword) suggestions.push('關鍵字');
204
+ if (!params.timeRange) suggestions.push('時間範圍');
205
+
206
+ return suggestions.length > 0
207
+ ? `未找到符合條件的日誌。請補充${joinChineseList(suggestions)}。`
208
+ : '未找到符合條件的日誌。';
209
+ }
210
+
211
+ function joinChineseList(items) {
212
+ const list = (items || []).filter(Boolean);
213
+ if (list.length <= 1) {
214
+ return list[0] || '';
215
+ }
216
+ if (list.length === 2) {
217
+ return `${list[0]}或${list[1]}`;
218
+ }
219
+ return `${list.slice(0, -1).join('、')}或${list[list.length - 1]}`;
189
220
  }
190
221
 
191
222
  function summarizeRawExecution(execution, data) {