@11agents/cli 0.1.32 → 0.1.34

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.
@@ -326,6 +326,16 @@ class XiaohongshuAdbPublisher:
326
326
  expected_title=title,
327
327
  expected_caption=composed_caption,
328
328
  )
329
+ if link_result.status != "retrieved" or not link_result.platform_permalink:
330
+ link_shot = (
331
+ Path(link_result.screenshot_path)
332
+ if link_result.screenshot_path
333
+ else run_dir / "link" / "failed-copy-link.png"
334
+ )
335
+ raise XiaohongshuAutomationError(
336
+ f"Xiaohongshu post-publish link recovery failed: {link_result.error or link_result.status}",
337
+ link_shot,
338
+ )
329
339
 
330
340
  ended_epoch = int(time.time())
331
341
  if status == "published":
@@ -381,6 +391,10 @@ class XiaohongshuAdbPublisher:
381
391
  remote_media_path=remote,
382
392
  screenshot_path=str(human_shot),
383
393
  error=str(exc),
394
+ platform_permalink=link_result.platform_permalink if link_result else "",
395
+ link_status=link_result.status if link_result else "",
396
+ link_error=link_result.error if link_result else "",
397
+ link_screenshot_path=link_result.screenshot_path if link_result else "",
384
398
  verification_status="failed",
385
399
  verification_error=str(exc),
386
400
  profile_screenshot_path=str(run_dir / "profile.png") if (run_dir / "profile.png").exists() else "",
@@ -401,6 +415,10 @@ class XiaohongshuAdbPublisher:
401
415
  remote_media_path=remote,
402
416
  screenshot_path=str(failure_shot),
403
417
  error=str(exc),
418
+ platform_permalink=link_result.platform_permalink if link_result else "",
419
+ link_status=link_result.status if link_result else "",
420
+ link_error=link_result.error if link_result else "",
421
+ link_screenshot_path=link_result.screenshot_path if link_result else "",
404
422
  )
405
423
 
406
424
  def copy_current_note_link(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11agents/cli",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "11agents local runtime and telemetry CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -83,6 +83,7 @@ function runtimeDeps(overrides = {}) {
83
83
  sleep: overrides.sleep || sleep,
84
84
  syncKnowledge: overrides.syncKnowledge || syncKnowledge,
85
85
  mcpKnowledgeSync: overrides.mcpKnowledgeSync || mcpKnowledgeSync,
86
+ cpuCount: overrides.cpuCount ?? os.cpus().length,
86
87
  }
87
88
  }
88
89
 
@@ -1540,9 +1541,10 @@ async function claimAndRunRuntimeTasks(registration, flags, deps, handlerModule,
1540
1541
  const config = configFromFlags(flags)
1541
1542
  const machineKey = registration?.machine?.machine_key || machineOverride(flags) || ''
1542
1543
 
1543
- // Each registered runtime must get at least one slot so no runtime is starved.
1544
- // maxConcurrent controls the ceiling but never drops below runtimes.length.
1545
- const effectiveConcurrent = Math.max(maxConcurrent, runtimes.length)
1544
+ // Each runtime gets (vCPUs - 1) slots so the host stays responsive.
1545
+ // maxConcurrent is honoured when it exceeds the CPU-derived default.
1546
+ const perRuntime = Math.max(1, (deps.cpuCount ?? os.cpus().length) - 1)
1547
+ const effectiveConcurrent = Math.max(maxConcurrent, runtimes.length * perRuntime)
1546
1548
  const slots = Array.from({ length: effectiveConcurrent }, (_, i) => runtimes[i % runtimes.length])
1547
1549
  const results = await Promise.allSettled(
1548
1550
  slots.map(runtime => runOneRuntimeTaskSlot(runtime, config, machineKey, registration, flags, deps, handlerModule, retryState, heartbeatIntervalMs))
@@ -1565,7 +1567,11 @@ export async function startRuntimeDaemon(flags = {}, deps = {}) {
1565
1567
  const scanIntervalMs = Number(flag(flags, 'scan-interval', '60')) * 1000
1566
1568
  const taskIntervalMs = Number(flag(flags, 'task-interval', flag(flags, 'heartbeat-interval', '15'))) * 1000
1567
1569
  const projectRefreshIntervalMs = Number(flag(flags, 'project-refresh-interval', '1800')) * 1000
1568
- const maxConcurrent = Math.max(1, Number(flag(flags, 'concurrency', '1')) || 1)
1570
+ const cpuCount = resolvedDeps.cpuCount ?? os.cpus().length
1571
+ const cpuDefault = Math.max(1, cpuCount - 1)
1572
+ const envMax = Number(process.env.DAEMON_MAX_CONCURRENCY)
1573
+ const envConcurrency = Number.isInteger(envMax) && envMax > 0 && envMax <= cpuCount - 1 ? envMax : null
1574
+ const maxConcurrent = envConcurrency ?? Math.max(1, Number(flag(flags, 'concurrency', String(cpuDefault))) || cpuDefault)
1569
1575
  const once = Boolean(flags.once)
1570
1576
  const handlerPath = flag(flags, 'handler')
1571
1577