@myagentroam/node 0.11.73 → 0.11.74
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/dist/runner/mar-agent-runner.js +33 -45
- package/package.json +4 -4
|
@@ -310,45 +310,32 @@ export class MarAgentRunner extends AbstractRunner {
|
|
|
310
310
|
try {
|
|
311
311
|
catalog = await openAgentSessionCatalog({ homeDirectory: this.homeDirectory });
|
|
312
312
|
const activeCatalog = catalog;
|
|
313
|
-
const listed = await activeCatalog.list({ limit: 200 });
|
|
314
|
-
if (context.cleanup) {
|
|
315
|
-
const sessions = [...listed.sessions];
|
|
316
|
-
let cursor = listed.nextCursor;
|
|
317
|
-
while (cursor !== undefined) {
|
|
318
|
-
const next = await activeCatalog.list({ limit: 200, cursor });
|
|
319
|
-
sessions.push(...next.sessions);
|
|
320
|
-
cursor = next.nextCursor;
|
|
321
|
-
}
|
|
322
|
-
const workspaces = workspace ? [workspace] : context.workspaces;
|
|
323
|
-
return sessions.flatMap((session) => {
|
|
324
|
-
const target = workspaces.find((candidate) => resolve(candidate.path) === resolve(session.workspace));
|
|
325
|
-
return target
|
|
326
|
-
? [
|
|
327
|
-
context.createProjection({
|
|
328
|
-
workspace: target,
|
|
329
|
-
runner: this.name,
|
|
330
|
-
externalSessionId: session.id,
|
|
331
|
-
cwd: session.workspace,
|
|
332
|
-
...(session.source?.parentSessionId === undefined
|
|
333
|
-
? {}
|
|
334
|
-
: { parentSessionId: session.source.parentSessionId }),
|
|
335
|
-
lastActivityAt: Date.parse(session.lastActivityAt)
|
|
336
|
-
})
|
|
337
|
-
]
|
|
338
|
-
: [];
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
313
|
const workspaces = workspace ? [workspace] : context.workspaces;
|
|
342
|
-
|
|
314
|
+
const sessions = (await activeCatalog.listSnapshot()).flatMap((session) => {
|
|
343
315
|
const target = workspaces.find((candidate) => resolve(candidate.path) === resolve(session.workspace));
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
316
|
+
return target ? [{ session, target }] : [];
|
|
317
|
+
});
|
|
318
|
+
if (context.cleanup) {
|
|
319
|
+
return sessions.map(({ session, target }) => context.createProjection({
|
|
320
|
+
workspace: target,
|
|
321
|
+
runner: this.name,
|
|
322
|
+
externalSessionId: session.id,
|
|
323
|
+
cwd: session.workspace,
|
|
324
|
+
...(session.source?.parentSessionId === undefined
|
|
325
|
+
? {}
|
|
326
|
+
: { parentSessionId: session.source.parentSessionId }),
|
|
327
|
+
lastActivityAt: Date.parse(session.lastActivityAt)
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
const discovered = [];
|
|
331
|
+
const batchSize = 8;
|
|
332
|
+
for (let offset = 0; offset < sessions.length; offset += batchSize) {
|
|
333
|
+
const batch = await Promise.allSettled(sessions.slice(offset, offset + batchSize).map(async ({ session, target }) => {
|
|
334
|
+
const executionConfiguration = session.modelId === undefined
|
|
335
|
+
? await activeCatalog.executionConfiguration(session.id)
|
|
336
|
+
: session;
|
|
337
|
+
const title = await marAgentSessionTitle(session, activeCatalog);
|
|
338
|
+
return {
|
|
352
339
|
...context.createProjection({
|
|
353
340
|
workspace: target,
|
|
354
341
|
runner: this.name,
|
|
@@ -366,14 +353,15 @@ export class MarAgentRunner extends AbstractRunner {
|
|
|
366
353
|
...(executionConfiguration?.reasoningEffort === undefined
|
|
367
354
|
? {}
|
|
368
355
|
: { effort: executionConfiguration.reasoningEffort })
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
356
|
+
};
|
|
357
|
+
}));
|
|
358
|
+
for (const entry of batch) {
|
|
359
|
+
if (entry.status === 'rejected')
|
|
360
|
+
throw entry.reason;
|
|
361
|
+
discovered.push(entry.value);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return discovered;
|
|
377
365
|
}
|
|
378
366
|
finally {
|
|
379
367
|
await catalog?.close().catch(() => undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.74",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"license": "Apache-2.0 AND GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"turndown-plugin-gfm": "^1.0.2",
|
|
41
41
|
"ws": "^8.21.3",
|
|
42
42
|
"zod": "4.4.3",
|
|
43
|
-
"@myagentroam/agent": "0.11.
|
|
43
|
+
"@myagentroam/agent": "0.11.74",
|
|
44
|
+
"@myagentroam/marctl": "0.11.12",
|
|
44
45
|
"@myagentroam/code-navigation": "0.11.1",
|
|
45
|
-
"@myagentroam/protocol": "0.11.
|
|
46
|
-
"@myagentroam/marctl": "0.11.12"
|
|
46
|
+
"@myagentroam/protocol": "0.11.74"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/turndown": "^5.0.6",
|