@11agents/cli 0.1.36 → 0.1.37

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.
@@ -36,6 +36,8 @@ Use `--range`, `--parallel`, and `--max-concurrency N` only when the approved pl
36
36
 
37
37
  Successful live publish is only confirmed after the CLI taps the publish button and verifies TikTok publish completion. After writing the publish record, the CLI force-stops TikTok and captures `after-app-close.png` in the run artifacts.
38
38
 
39
+ When the agent environment contains `ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK`, the CLI sends a DingTalk notification after status `published`; `ELEVENAGENTS_PUBLISH_DINGTALK_SECRET` is optional. TikTok notification content does not show a link.
40
+
39
41
  ## Output
40
42
 
41
43
  Return publish status, record id, account/device, screenshot path, permalink or platform post id when available, duration, error action, and the data-collection handoff:
@@ -35,6 +35,8 @@ Structured package:
35
35
 
36
36
  Successful live publish is only confirmed after the CLI taps the final publish button, waits without tapping while Xiaohongshu shows upload/progress state, closes and relaunches Xiaohongshu, then opens the "我" page, opens the note whose title matches the expected title or the first visible profile note as a verified fallback, and verifies the detail page against the expected title/body. The CLI recovers the note link by default for live publish; use `--no-copy-link-after-publish` only when link recovery is explicitly not wanted. After writing the publish record, the CLI force-stops Xiaohongshu and captures `after-app-close.png` in the run artifacts. If that evidence does not match, treat the result as `failed`; do not claim publish success from the publish button tap alone.
37
37
 
38
+ When the agent environment contains `ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK`, the CLI sends a DingTalk notification after status `published`; `ELEVENAGENTS_PUBLISH_DINGTALK_SECRET` is optional. The Xiaohongshu notification includes the recovered link when available and still sends if the link was not recovered.
39
+
38
40
  Link copy after publish or during the recovery skill:
39
41
 
40
42
  ```bash
@@ -8,7 +8,7 @@ description: Use when a mobile publish agent needs to prepare or dry-run `11agen
8
8
  ## Required Inputs
9
9
  - Approved execution plan or dry-run request.
10
10
  - Installed `@11agents/cli` and completed `11agents mobile setup`.
11
- - Optional placeholders: `ELEVENAGENTS_MOBILE_HOME`, `ELEVENAGENTS_MOBILE_DEFAULT_DEVICE`, `ELEVENAGENTS_MOBILE_DEFAULT_RANGE`, and `ELEVENAGENTS_MOBILE_DEFAULT_MAX_CONCURRENCY`.
11
+ - Optional placeholders: `ELEVENAGENTS_MOBILE_HOME`, `ELEVENAGENTS_MOBILE_DEFAULT_DEVICE`, `ELEVENAGENTS_MOBILE_DEFAULT_RANGE`, `ELEVENAGENTS_MOBILE_DEFAULT_MAX_CONCURRENCY`, `ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK`, and `ELEVENAGENTS_PUBLISH_DINGTALK_SECRET`.
12
12
  - Media files, captions/titles/body/link fields, target device or range, optional account id/account prefix, and dry-run/live mode.
13
13
 
14
14
  If mobile setup, device online status, media path, app login readiness, or approval status is missing, ask the user before running commands. Missing account CSV alone is not a blocker when the target app is already logged in on the device.
@@ -51,7 +51,8 @@ If mobile setup, device online status, media path, app login readiness, or appro
51
51
  11. Use `11agents mobile publish-tiktok`, `publish-instagram`, `publish-facebook`, `publish-reddit`, `publish-x`, and `publish-xiaohongshu`.
52
52
  12. Prefer `--json` and parse status, duration, record id, screenshot path, permalink, platform post id, and error.
53
53
  13. Pass `--task-id <task_id>` so logs land at `~/.11agents/mobile/runs/<task_id>/log`.
54
- 14. Stop on `failed`; surface screenshot and error instead of repeated retries.
54
+ 14. Do not run custom DingTalk webhook scripts after Xiaohongshu or TikTok publish. When the agent environment contains `ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK`, the CLI sends the publish-success notification automatically; `ELEVENAGENTS_PUBLISH_DINGTALK_SECRET` is optional for signed robots.
55
+ 15. Stop on `failed`; surface screenshot and error instead of repeated retries.
55
56
 
56
57
  ## Output
57
58
  Return readiness status, dry-run result or execution preparation summary, device/app health notes, optional account-registry notes, command family selected, exact safe `11agents mobile` command shape, log path, and missing env placeholders.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11agents/cli",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "11agents local runtime and telemetry CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -99,8 +99,9 @@ Runtime:
99
99
  Python/device-control code is bundled with @11agents/cli.
100
100
  Mutable runtime state lives in ~/.11agents/mobile by default.
101
101
  Every command writes logs under ~/.11agents/mobile/runs/<task_id>/log.
102
- Publish-success DingTalk notification is enabled by ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK
103
- and optional ELEVENAGENTS_PUBLISH_DINGTALK_SECRET.`)
102
+ Xiaohongshu/TikTok publish-success DingTalk notification is enabled by
103
+ ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK and optional
104
+ ELEVENAGENTS_PUBLISH_DINGTALK_SECRET.`)
104
105
  }
105
106
 
106
107
  function mobileHome(flags = {}, env = process.env) {
@@ -597,11 +598,10 @@ async function notifyMobilePublishSuccess({ command, context, parsed, env = proc
597
598
  const config = dingTalkConfig(env)
598
599
  if (!config.webhook || !Array.isArray(parsed)) return
599
600
  const platform = platformFromMobileCommand(command)
600
- if (!platform) return
601
+ if (!shouldNotifyPublishPlatform(platform)) return
601
602
  for (const row of parsed) {
602
603
  if (!isPublishedResult(row)) continue
603
604
  const link = publishResultLink(row)
604
- if (!link) continue
605
605
  const content = buildPublishNotificationContent({
606
606
  platform,
607
607
  task: context.taskTitle || context.taskId,
@@ -623,8 +623,20 @@ async function notifyMobilePublishSuccess({ command, context, parsed, env = proc
623
623
 
624
624
  function dingTalkConfig(env = process.env) {
625
625
  return {
626
- webhook: env.ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK || env.ELEVENAGENTS_DINGTALK_WEBHOOK || '',
627
- secret: env.ELEVENAGENTS_PUBLISH_DINGTALK_SECRET || env.ELEVENAGENTS_DINGTALK_SECRET || '',
626
+ webhook: env.ELEVENAGENTS_PUBLISH_DINGTALK_WEBHOOK
627
+ || env.ELEVENAGENTS_DINGTALK_WEBHOOK
628
+ || env.GTM_DINGTALK_WEBHOOK
629
+ || env.DINGTALK_WEBHOOK
630
+ || '',
631
+ secret: env.ELEVENAGENTS_PUBLISH_DINGTALK_SECRET
632
+ || env.ELEVENAGENTS_PUBLISH_DINGTALK_KEY
633
+ || env.ELEVENAGENTS_DINGTALK_SECRET
634
+ || env.ELEVENAGENTS_DINGTALK_KEY
635
+ || env.GTM_DINGTALK_SECRET
636
+ || env.GTM_DINGTALK_KEY
637
+ || env.DINGTALK_SECRET
638
+ || env.DINGTALK_KEY
639
+ || '',
628
640
  }
629
641
  }
630
642
 
@@ -644,6 +656,10 @@ function isPublishedResult(row) {
644
656
  return row && typeof row === 'object' && row.status === 'published'
645
657
  }
646
658
 
659
+ function shouldNotifyPublishPlatform(platform) {
660
+ return platform === 'xiaohongshu' || platform === 'tiktok'
661
+ }
662
+
647
663
  function publishResultLink(row) {
648
664
  return String(
649
665
  row.platform_permalink
@@ -658,7 +674,9 @@ function buildPublishNotificationContent({ platform, task, deviceId = '', link }
658
674
  const label = platformLabel(platform)
659
675
  const taskText = String(task || 'task').trim()
660
676
  const deviceText = deviceId ? `(设备 ${deviceId})` : ''
661
- return `${label} ${taskText}${deviceText}已发布,链接:${link}`
677
+ if (platform === 'tiktok') return `${label} ${taskText}${deviceText}已发布`
678
+ const linkText = String(link || '').trim() || '未回收'
679
+ return `${label} ${taskText}${deviceText}已发布,链接:${linkText}`
662
680
  }
663
681
 
664
682
  function platformLabel(platform) {
@@ -831,6 +849,7 @@ export const mobileInternals = {
831
849
  parseRawArgs,
832
850
  platformFromMobileCommand,
833
851
  publishResultLink,
852
+ shouldNotifyPublishPlatform,
834
853
  signedDingTalkUrl,
835
854
  stripWrapperFlags,
836
855
  taskIdFrom,