mio-agent-runtime 0.10.0 → 0.11.0
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/package.json
CHANGED
|
@@ -190,6 +190,11 @@ class CreativityEngine {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
async generate(sourceLabels, strategy) {
|
|
193
|
+
// A missing sources array used to reach .map() and surface as
|
|
194
|
+
// "Cannot read properties of undefined", which tells the caller nothing.
|
|
195
|
+
if (!Array.isArray(sourceLabels)) {
|
|
196
|
+
throw new Error('creativity.generate requires sources: an array of { name, content } entries')
|
|
197
|
+
}
|
|
193
198
|
const sources = sourceLabels.map(s => ({
|
|
194
199
|
name: s.name || 'unnamed',
|
|
195
200
|
content: s.content || '',
|
package/server/observer-store.js
CHANGED
|
@@ -180,7 +180,11 @@ function createObserverStore(options = {}) {
|
|
|
180
180
|
// `collected: 0` no matter how much the collectors actually returned.
|
|
181
181
|
async function collect(args = {}) {
|
|
182
182
|
if (!ObserverService) throw new Error('@akemi-mio/observer not installed')
|
|
183
|
-
|
|
183
|
+
// ObserverService takes the base dir as a bare string -- passing an options
|
|
184
|
+
// object made path.resolve() throw before any collector ran, so collect()
|
|
185
|
+
// was dead on arrival for every caller. (collectorConfig was never read by
|
|
186
|
+
// the package; it was invented here.)
|
|
187
|
+
const service = new ObserverService(baseDirOf(args))
|
|
184
188
|
const sources = args.sources || ['bilibili', 'hackernews', 'github', 'douyin', 'rss']
|
|
185
189
|
const allObs = []
|
|
186
190
|
for (const src of sources) {
|
|
@@ -206,7 +210,7 @@ function createObserverStore(options = {}) {
|
|
|
206
210
|
|
|
207
211
|
async function ferment(args = {}) {
|
|
208
212
|
if (!ObserverService) throw new Error('@akemi-mio/observer not installed')
|
|
209
|
-
const service = new ObserverService(
|
|
213
|
+
const service = new ObserverService(baseDirOf(args))
|
|
210
214
|
const session = args.session || 'afternoon'
|
|
211
215
|
try {
|
|
212
216
|
const fermentation = service.getFermentation()
|