@thinkingai/ae-cli 6.0.32 → 6.0.33

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.
Files changed (128) hide show
  1. package/dist/{auth-MEJ642P4.js → auth-ENM3FE6L.js} +3 -2
  2. package/dist/{auth-7H3HAAJ3.js → auth-UPGUOKTW.js} +13 -6
  3. package/dist/{capability-QW4AVJHI.js → capability-AJC5CBRT.js} +49 -17
  4. package/dist/{capability-SCRFGODD.js → capability-TQ5KU5Q6.js} +49 -17
  5. package/dist/chunk-24BAVOX3.js +51 -0
  6. package/dist/{chunk-MDJGDI6K.js → chunk-3KI3RRXX.js} +5 -5
  7. package/dist/{chunk-PKRD2IEM.js → chunk-3P3562ZX.js} +9 -7
  8. package/dist/{chunk-R77JT7XD.js → chunk-4Q5TNP4Q.js} +4 -4
  9. package/dist/{chunk-7OLGDQQ2.js → chunk-6CHYBI64.js} +2 -2
  10. package/dist/{chunk-6LEYLOV3.js → chunk-CPVTECJ3.js} +9 -7
  11. package/dist/{chunk-KCA6BA5D.js → chunk-DB4Q3ANU.js} +5 -3
  12. package/dist/{chunk-2NDGFQHW.js → chunk-E7UXXHO3.js} +11 -3
  13. package/dist/{chunk-I4A62X3N.js → chunk-HQ2A7ITL.js} +23 -14
  14. package/dist/chunk-IMMGMU54.js +674 -0
  15. package/dist/{chunk-AJTH7LT3.js → chunk-IR4ZLVPW.js} +4 -2
  16. package/dist/{chunk-TBHBYKXZ.js → chunk-ISY6HMHM.js} +2 -2
  17. package/dist/{chunk-KGJQCYVC.js → chunk-LCXU3AAT.js} +4 -2
  18. package/dist/chunk-LYVNONC4.js +86 -0
  19. package/dist/{chunk-DYOS6YY7.js → chunk-RGXCNC4N.js} +23 -14
  20. package/dist/{chunk-YCLVYFK7.js → chunk-V6FR6WTW.js} +45 -87
  21. package/dist/chunk-VTWMIC5L.js +27 -0
  22. package/dist/{cli-token-TVQRSE46.js → cli-token-4SBMXAUK.js} +6 -3
  23. package/dist/{client-2643Z5AG.js → client-PP5FETMW.js} +4 -3
  24. package/dist/community-report-client-KK2QBANO.js +145 -0
  25. package/dist/{config-7UZWDE74.js → config-RCCGHHYA.js} +6 -3
  26. package/dist/index.js +505 -220
  27. package/dist/{metadata-BFDL6RUK.js → metadata-3M5F2AED.js} +14 -13
  28. package/dist/{metadata-FCLDBXX2.js → metadata-W2MEOI4Z.js} +14 -13
  29. package/dist/{model-T3KZJWLW.js → model-OYQLXCQY.js} +3 -2
  30. package/dist/{raw-CN542NGT.js → raw-TPB7KSZO.js} +6 -4
  31. package/dist/{sync-ERNHDPB5.js → sync-EFJKFZK2.js} +6 -3
  32. package/dist/{te-agent-FCCWUDTJ.js → te-agent-K2OWMZXT.js} +3 -2
  33. package/dist/{te-analysis-PUVF5IF4.js → te-analysis-I73ZS4NK.js} +903 -33
  34. package/dist/{te-analysis-UJDOKPAN.js → te-analysis-Q7AZCDU4.js} +903 -33
  35. package/dist/{te-common-XLAGWNIV.js → te-common-ST3QPSXJ.js} +7 -6
  36. package/dist/{te-common-VUX3VOXZ.js → te-common-WSLIKKPC.js} +7 -6
  37. package/dist/te-community-WXGB6IOX.js +1659 -0
  38. package/dist/te-community-X2AHXGCA.js +1659 -0
  39. package/dist/{te-dataops-ZNJBQ6VT.js → te-dataops-MJV54MNY.js} +10 -8
  40. package/dist/{te-dataops-F36T656A.js → te-dataops-OA7I6HBG.js} +10 -8
  41. package/dist/{te-engage-K4AEUPK5.js → te-engage-GJRVQMK3.js} +10 -9
  42. package/dist/{te-engage-QBCCME22.js → te-engage-JIXX3WBI.js} +10 -9
  43. package/dist/{te-kb-AYCODNU6.js → te-kb-CIZXRWMO.js} +49 -6
  44. package/dist/{te-meta-UUROEODR.js → te-meta-Q4L6EE3Q.js} +7 -6
  45. package/dist/{te-meta-ARDIW3YI.js → te-meta-VHCN4Q62.js} +7 -6
  46. package/dist/{te-team-OKCOX7OE.js → te-team-PDKKW7Q5.js} +7 -6
  47. package/dist/tracking/i18n/resources/cli/en.json +4 -3
  48. package/dist/tracking/i18n/resources/cli/ja.json +4 -3
  49. package/dist/tracking/i18n/resources/cli/ko.json +4 -3
  50. package/dist/tracking/i18n/resources/cli/zh.json +4 -3
  51. package/package.json +6 -2
  52. package/skills/ae-agent/SKILL.md +2 -1
  53. package/skills/ae-analysis/SKILL.md +12 -1
  54. package/skills/ae-analysis/references/adhoc_export.md +2 -0
  55. package/skills/ae-analysis/references/adhoc_run.md +2 -0
  56. package/skills/ae-analysis/references/alert_create.md +25 -0
  57. package/skills/ae-analysis/references/alert_definition_schema_get.md +24 -0
  58. package/skills/ae-analysis/references/alert_delete.md +26 -0
  59. package/skills/ae-analysis/references/alert_detail_list.md +27 -0
  60. package/skills/ae-analysis/references/alert_get.md +25 -0
  61. package/skills/ae-analysis/references/alert_job_list.md +24 -0
  62. package/skills/ae-analysis/references/alert_list.md +27 -0
  63. package/skills/ae-analysis/references/alert_notice_config_list.md +24 -0
  64. package/skills/ae-analysis/references/alert_start.md +25 -0
  65. package/skills/ae-analysis/references/alert_stop.md +25 -0
  66. package/skills/ae-analysis/references/alert_update.md +26 -0
  67. package/skills/ae-analysis/references/bi_panel_create.md +3 -3
  68. package/skills/ae-analysis/references/check_delete.md +27 -0
  69. package/skills/ae-analysis/references/check_export.md +27 -0
  70. package/skills/ae-analysis/references/check_get.md +27 -0
  71. package/skills/ae-analysis/references/check_list.md +24 -0
  72. package/skills/ae-analysis/references/check_retry.md +27 -0
  73. package/skills/ae-analysis/references/check_run.md +25 -0
  74. package/skills/ae-analysis/references/command_index.md +61 -27
  75. package/skills/ae-analysis/references/dashboard_create.md +3 -3
  76. package/skills/ae-analysis/references/dashboard_daily_report_send.md +1 -0
  77. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  78. package/skills/ae-analysis/references/dashboard_report_data_export.md +3 -3
  79. package/skills/ae-analysis/references/dashboard_report_data_run.md +3 -3
  80. package/skills/ae-analysis/references/event_blacklist_add.md +25 -0
  81. package/skills/ae-analysis/references/event_blacklist_list.md +24 -0
  82. package/skills/ae-analysis/references/event_blacklist_update.md +26 -0
  83. package/skills/ae-analysis/references/ingest_error_list.md +27 -0
  84. package/skills/ae-analysis/references/ingest_summary.md +26 -0
  85. package/skills/ae-analysis/references/live_data_export.md +27 -0
  86. package/skills/ae-analysis/references/live_data_list.md +27 -0
  87. package/skills/ae-analysis/references/plan_change_log_export.md +27 -0
  88. package/skills/ae-analysis/references/plan_change_log_list.md +24 -0
  89. package/skills/ae-analysis/references/plan_delete_items.md +30 -0
  90. package/skills/ae-analysis/references/plan_export.md +26 -0
  91. package/skills/ae-analysis/references/plan_generate.md +27 -0
  92. package/skills/ae-analysis/references/plan_get.md +24 -0
  93. package/skills/ae-analysis/references/plan_import_excel.md +26 -0
  94. package/skills/ae-analysis/references/plan_save_items.md +27 -0
  95. package/skills/ae-analysis/references/plan_sync_from_meta.md +24 -0
  96. package/skills/ae-analysis/references/project_role_delete.md +4 -3
  97. package/skills/ae-analysis/references/project_role_get.md +4 -3
  98. package/skills/ae-analysis/references/project_role_user_list.md +4 -3
  99. package/skills/ae-analysis/references/query_create_result_cluster.md +2 -1
  100. package/skills/ae-analysis/references/report_data_export.md +3 -1
  101. package/skills/ae-analysis/references/report_data_run.md +12 -2
  102. package/skills/ae-analysis/references/sdk_sample_generate.md +24 -0
  103. package/skills/ae-analysis/references/user_cluster_create.md +2 -0
  104. package/skills/ae-analysis/references/user_cluster_create_id.md +2 -0
  105. package/skills/ae-analysis/references/user_cluster_update.md +2 -0
  106. package/skills/ae-analysis/references/user_cluster_update_id.md +2 -0
  107. package/skills/ae-analysis/references/user_tag_create.md +2 -0
  108. package/skills/ae-analysis/references/user_tag_create_id.md +2 -0
  109. package/skills/ae-analysis/references/user_tag_update.md +2 -0
  110. package/skills/ae-analysis/references/user_tag_update_id.md +2 -0
  111. package/skills/ae-analysis-global/SKILL.md +2 -0
  112. package/skills/ae-capability/SKILL.md +7 -5
  113. package/skills/ae-community/SKILL.md +72 -8
  114. package/skills/ae-community/references/community-chat-analysis.md +341 -0
  115. package/skills/ae-community/references/community-data-report.md +301 -0
  116. package/skills/ae-dataops/SKILL.md +2 -1
  117. package/skills/ae-engage/SKILL.md +2 -1
  118. package/skills/ae-generate-tracking-code/SKILL.md +4 -4
  119. package/skills/ae-generate-tracking-plan/SKILL.md +132 -11
  120. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +98 -33
  121. package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +16 -14
  122. package/skills/ae-kb/SKILL.md +2 -1
  123. package/skills/ae-metadata/SKILL.md +2 -1
  124. package/skills/ae-team/SKILL.md +2 -1
  125. package/dist/chunk-NOO24N7W.js +0 -11
  126. package/dist/chunk-TNW2CI4W.js +0 -129
  127. package/dist/te-community-PEZ2VEF7.js +0 -687
  128. package/dist/te-community-TSKJ652U.js +0 -687
@@ -0,0 +1,301 @@
1
+ # Community Data Reporting
2
+
3
+ Use `ae-cli community data report` to validate, normalize, and submit community records directly to an authorized Iris ingress endpoint. This is an ingestion data-plane command, not an AE analysis-host command.
4
+
5
+ ## Contents
6
+
7
+ - [Safety and delivery contract](#safety-and-delivery-contract)
8
+ - [Endpoint and identifiers](#endpoint-and-identifiers)
9
+ - [Input modes](#input-modes)
10
+ - [Chat example](#chat-example)
11
+ - [Mixed payload example](#mixed-payload-example)
12
+ - [Common record rules](#common-record-rules)
13
+ - [Schemas](#schemas)
14
+ - [Normalization](#normalization)
15
+ - [Dry-run and output](#dry-run-and-output)
16
+ - [Errors and retry policy](#errors-and-retry-policy)
17
+ - [Privacy](#privacy)
18
+
19
+ ## Safety and delivery contract
20
+
21
+ - The command has `risk: write`. A clear user request to report the data is sufficient; do not add `--yes` or ask for a second confirmation.
22
+ - Run a redacted `--dry-run` before the first submission of a dataset.
23
+ - A successful response means only that Iris queued the request. It does not prove that every record passed asynchronous processing or reached durable storage.
24
+ - Never describe `status: "queued"` as accepted, imported, persisted, or queryable.
25
+ - The client makes at most one POST, never follows redirects, and never retries automatically.
26
+ - After a timeout, the delivery state is unknown. Check the downstream query or storage side before deciding whether a manual resubmission is safe.
27
+
28
+ ## Endpoint and identifiers
29
+
30
+ The endpoint precedence is:
31
+
32
+ 1. `--endpoint`
33
+ 2. `AE_IRIS_SYNC_ENDPOINT`
34
+
35
+ The endpoint must be a complete `http` or `https` URL whose path ends in `/sync_content`. It must not contain credentials, a query string, or a fragment. Never guess, concatenate, or derive this URL from `--host`; `--host` is unrelated to this command.
36
+
37
+ Verify all three identifiers with the user or an authoritative system:
38
+
39
+ | Flag | Iris field | Contract |
40
+ |------|------------|----------|
41
+ | `--space-id` | `game_id` | Positive signed int64 |
42
+ | `--channel-id` | `channel_id` | Positive signed int64 |
43
+ | `--source-id` | `source_id` | Positive signed int64 |
44
+
45
+ The CLI reads these flags as strings to preserve precision, then emits JSON numeric values without quotes. It fixes `source_type` to `#standard` and `version` to `5.0.0`. `--zone-id` defaults to `Asia/Shanghai` and accepts a valid IANA time-zone ID.
46
+
47
+ The reporting command does not provide a `--game-id` alias. It also does not accept `zone_offset` or top-level `timestamp`/`datetime` request overrides.
48
+
49
+ ## Input modes
50
+
51
+ Choose exactly one mode:
52
+
53
+ ```text
54
+ --data-type <type> --data <inline|path|@path|->
55
+ --payload <inline|path|@path|->
56
+ ```
57
+
58
+ `--data` accepts one record object or a non-empty record array. `--payload` accepts one segment object or a non-empty segment array. A segment has this shape:
59
+
60
+ ```json
61
+ {
62
+ "data_type": "chat",
63
+ "data": [
64
+ { "chat_uuid": "example" }
65
+ ]
66
+ }
67
+ ```
68
+
69
+ Supported `data_type` values are `post`, `video`, `reply`, `danmu`, `live_room`, `live_interaction`, `chat`, and `interaction`.
70
+
71
+ Before constructing records, run `ae-cli community data report --help`. The installed command's schema summary is the source of truth for the required fields of every supported `data_type`; use the schema sections below for field limits and normalization behavior.
72
+
73
+ For either input flag:
74
+
75
+ - Inline JSON is accepted for non-sensitive examples.
76
+ - `@path/to/file.json` is the preferred, unambiguous file form.
77
+ - A plain existing path is also accepted.
78
+ - `-` reads JSON from stdin.
79
+ - JSONL is not supported.
80
+
81
+ ## Chat example
82
+
83
+ Store records in `chat.json` so message content does not enter shell history:
84
+
85
+ ```json
86
+ [
87
+ {
88
+ "chat_uuid": "wecom-chat-0001",
89
+ "user_id": "user-001",
90
+ "user_name": "Example User",
91
+ "chat_room_type": "wecom_group",
92
+ "chat_room_id": "room-001",
93
+ "chat_room": "Example support group",
94
+ "content": "Example redacted message",
95
+ "publish_time": "2026-07-21 09:30:00",
96
+ "extras": {
97
+ "source": "wecom"
98
+ }
99
+ }
100
+ ]
101
+ ```
102
+
103
+ Run the redacted preview, then submit only if the endpoint and IDs are verified:
104
+
105
+ ```bash
106
+ ae-cli --dry-run community data report \
107
+ --endpoint https://<iris-ingress>/sync_content \
108
+ --space-id <space-id> \
109
+ --channel-id <channel-id> \
110
+ --source-id <source-id> \
111
+ --data-type chat \
112
+ --data @chat.json
113
+
114
+ ae-cli community data report \
115
+ --endpoint https://<iris-ingress>/sync_content \
116
+ --space-id <space-id> \
117
+ --channel-id <channel-id> \
118
+ --source-id <source-id> \
119
+ --data-type chat \
120
+ --data @chat.json
121
+ ```
122
+
123
+ ## Mixed payload example
124
+
125
+ Use `--payload` when one request contains multiple data types. For example, `mixed.json` can contain a post with a sidecar interaction plus a standalone interaction snapshot:
126
+
127
+ ```json
128
+ [
129
+ {
130
+ "data_type": "post",
131
+ "data": [
132
+ {
133
+ "post_uuid": "post-0001",
134
+ "user_id": "author-001",
135
+ "title": "Example post",
136
+ "content": "Example body",
137
+ "publish_time": "2026-07-21 10:00:00",
138
+ "interaction": {
139
+ "collect_time": "2026-07-21 10:05:00",
140
+ "metrics": {
141
+ "views": 100,
142
+ "likes": 8
143
+ }
144
+ }
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "data_type": "interaction",
150
+ "data": [
151
+ {
152
+ "content_uuid": "post-0001",
153
+ "content_type": 0,
154
+ "collect_time": "2026-07-21 11:00:00",
155
+ "metrics": {
156
+ "views": "125",
157
+ "comments": 3
158
+ }
159
+ }
160
+ ]
161
+ }
162
+ ]
163
+ ```
164
+
165
+ ```bash
166
+ AE_IRIS_SYNC_ENDPOINT=https://<iris-ingress>/sync_content \
167
+ ae-cli --dry-run community data report \
168
+ --space-id <space-id> --channel-id <channel-id> --source-id <source-id> \
169
+ --payload @mixed.json
170
+ ```
171
+
172
+ ## Common record rules
173
+
174
+ - Each record and segment must be a JSON object; arrays must be non-empty.
175
+ - Text fields accept only JSON strings. Numbers and booleans are not coerced to text.
176
+ - Optional `null` fields are treated as omitted.
177
+ - Unknown record fields are preserved.
178
+ - Signed int64 inputs may be JSON integer numbers or canonical decimal strings. The wire body contains lossless, unquoted JSON numbers.
179
+ - Fields constrained to non-negative int64 reject negative values, fractions, and values above `9223372036854775807`.
180
+ - Date/time strings accept only `yyyy-MM-dd HH:mm:ss`, `yyyy-MM-dd HH:mm:ss.SSS`, `yyyy-MM-dd HH:mm`, or `yyyy-MM-dd` where the field permits a date-only value.
181
+ - `extras` and `user_extra` accept an object or a JSON-encoded object string. Missing, null, or invalid values normalize to `{}`. Serialized `user_extra` must not exceed 1024 UTF-16 code units.
182
+ - `subtitle` accepts an object array or a JSON-encoded object array. Every element must be an object.
183
+ - Lengths and truncation use UTF-16 code units, matching Iris/Java string behavior.
184
+ - A field with an Iris truncation fallback is truncated and counted in normalization statistics. An overlong field without a fallback is rejected.
185
+
186
+ ## Schemas
187
+
188
+ Only the key ingestion constraints are listed below. Unknown fields remain on the record after validation.
189
+
190
+ ### `post`
191
+
192
+ Required: `post_uuid`, a string no longer than 32 UTF-16 code units.
193
+
194
+ Optional normalized fields include `user_id` (64), `user_name` (80), `title` (200), `content` (65533), `publish_time`, and `extras`. Values in parentheses are truncation limits. An optional `interaction` sidecar requires `collect_time` and a non-empty `metrics` object using the same metric rules as standalone `interaction` with `content_type=0`.
195
+
196
+ ### `video`
197
+
198
+ Required: `video_uuid`, a string no longer than 32 UTF-16 code units.
199
+
200
+ Optional normalized fields include `user_id` (64), `user_name` (80), `title` (1000), `description` (65533), `publish_time`, `subtitle`, and `extras`. An optional `interaction` sidecar uses the standalone metric rules with `content_type=1`.
201
+
202
+ ### `reply`
203
+
204
+ Required: `reply_uuid` (maximum 32), `root_id` (maximum 32), and `root_type`, which must be `post`, `video`, or `live`.
205
+
206
+ Optional normalized fields include `user_id` (64), `user_name` (80), `content` (65533), `publish_time`, `parent_id` (32), and `extras`.
207
+
208
+ ### `danmu`
209
+
210
+ Required: `danmu_uuid` (maximum 32), non-negative int64 `timestamp`, `root_id` (maximum 32), and `root_type`, which must be `post`, `video`, or `live`.
211
+
212
+ Optional normalized fields include `user_id` (64), `user_name` (80), `content` (65533), and `publish_time`.
213
+
214
+ ### `live_room`
215
+
216
+ Required: non-negative int64 `uuid`, `room_id` (maximum 32), `room_name` (maximum 80), `room_avatar` (maximum 65533), non-negative int64 `fans`, and date/time `timestamp`.
217
+
218
+ Optional room/stream fields include `room_type` (truncated to 128), `stream_cover` (65533), `stream_title` (80), `stream_status`, `stream_start_time`, `stream_end_time`, and `stream_notice` (maximum 255, rejected if longer). Missing or `2` `stream_status` becomes `0`; only normalized values `0` and `1` are allowed.
219
+
220
+ The optional metrics `online`, `heat`, `noble_count`, `guardian_count`, `diamond_fan_count`, and `dfans_count` are non-negative int64 values. At most one of the three guardian aliases may be present. If stream details or metrics are present, `stream_start_time` is required and must include a time component; a date-only value is rejected. The derived `stream_id` must not exceed 64 UTF-16 code units, and every derived metric ID (`uuid * 5 + metric_type`) must remain within signed int64 range.
221
+
222
+ ### `live_interaction`
223
+
224
+ Required: non-negative int64 `uuid`, `activity_type`, `activity_content`, `room_id`, `stream_start_time`, and date/time `timestamp`.
225
+
226
+ `activity_type` must be `danmu`, `gift`, `superchat`, or `premium`. `activity_content` is truncated to 1024. `room_id` is at most 32. `stream_start_time` must include a time component. Optional normalized fields include `user_id` (80), `user_name` (80), and `user_extra`.
227
+
228
+ ### `chat`
229
+
230
+ The six required string fields are:
231
+
232
+ | Field | Limit |
233
+ |-------|-------|
234
+ | `chat_uuid` | 36 UTF-16 code units; overlong values are truncated |
235
+ | `user_id` | 80 |
236
+ | `chat_room_type` | 16; no enum restriction |
237
+ | `chat_room_id` | 80 |
238
+ | `content` | 65533 |
239
+ | `publish_time` | One supported date/time format |
240
+
241
+ Optional normalized fields are `user_name`, `chat_room`, `chat_server`, and `chat_server_id` (each 80), plus `extras`.
242
+
243
+ `chat_uuid` is a required JSON string. If it exceeds 36 UTF-16 code units, the client keeps the first 36 units and reports the change under `chat.chat_uuid` in the normalization statistics; it does not reject the record for length. Supply source identifiers that already fit the limit to avoid truncation changing record identity or collapsing distinct identifiers to the same normalized value.
244
+
245
+ ### `interaction`
246
+
247
+ Required: `content_uuid` (maximum 32), integer `content_type` from 0 through 7, `collect_time`, and a non-empty `metrics` object.
248
+
249
+ Every metric value must be a non-negative int64. A single invalid metric rejects the whole record; it is never silently dropped. Metric names must match `content_type`:
250
+
251
+ | `content_type` | Meaning | Allowed metric names |
252
+ |----------------|---------|----------------------|
253
+ | `0`, `1` | post, video | `views`, `likes`, `comments`, `shares`, `favorites`, `coins`, `danmaku`, `dislikes` |
254
+ | `2`-`6` | live, chat, comment, reply, danmu | `favorites`, `coins`, `danmaku`, `dislikes` |
255
+ | `7` | user | `followers`, `total_views`, `total_likes` |
256
+
257
+ ## Normalization
258
+
259
+ The CLI normalizes the input before dry-run or submission:
260
+
261
+ - A single record becomes a one-element `data` array; a single segment becomes a one-element `payload` array.
262
+ - Fixed request metadata is `source_type: "#standard"` and `version: "5.0.0"`.
263
+ - Integer strings become lossless JSON numeric literals.
264
+ - Optional `null` properties are removed.
265
+ - Fields with Iris truncation fallbacks are truncated by UTF-16 code units.
266
+ - Invalid or missing `extras`/`user_extra` becomes `{}`; encoded objects and `subtitle` arrays become native JSON structures.
267
+ - Missing or legacy `stream_status: 2` becomes `0`.
268
+
269
+ The summary counts truncated, defaulted, and integer-converted fields without exposing their original values.
270
+
271
+ ## Dry-run and output
272
+
273
+ `--dry-run` performs local parsing, schema validation, and normalization, but sends no network request. Its redacted output contains endpoint, data types, segment/record counts, encoded byte count, and normalization statistics. It never prints the business payload.
274
+
275
+ A successful live submission has these semantics:
276
+
277
+ ```json
278
+ {
279
+ "status": "queued",
280
+ "persistence_verified": false,
281
+ "next_step": "After asynchronous processing, verify the submitted record identifiers through an authorized downstream query or storage path before treating this submission as persisted."
282
+ }
283
+ ```
284
+
285
+ The complete output also reports submission counts and normalization statistics. Treat them as submitted-to-queue counts, not per-record acceptance counts. Iris does not currently return a query URL or trace ID in this response, so the CLI does not invent one; use the submitted identifiers with an authorized downstream query or storage path.
286
+
287
+ ## Errors and retry policy
288
+
289
+ - Input, schema, file, identifier, and endpoint failures use a `validation` error envelope. Locations identify segment, record, and field but do not echo the invalid business value.
290
+ - Iris HTTP 400 errors expose the safe `return_message` when available.
291
+ - HTTP 5xx responses, non-JSON responses, missing `return_code`, non-zero `return_code`, redirects, and buffer-full responses use a standard API error envelope. Server stack traces are not echoed.
292
+ - The request timeout is 30 seconds. A timeout does not establish whether Iris queued the request.
293
+ - Never automate a retry. For timeout or ambiguous transport failure, check downstream state first and ask the user before any deliberate resubmission.
294
+
295
+ ## Privacy
296
+
297
+ - Prefer `@file` or stdin for chat text, usernames, identifiers, and other sensitive content. Inline JSON can remain in shell history or process listings.
298
+ - The reporting client sends only `Content-Type: application/json` and `Accept: application/json`. It does not send AE access tokens, CLI tokens, or custom authorization headers.
299
+ - Request and response bodies are excluded from CLI HTTP logs. Logs contain only endpoint, status, and byte counts.
300
+ - Dry-run output is redacted by default. Do not paste raw records into reports or error explanations.
301
+ - An endpoint URL must not contain embedded credentials, query parameters, or fragments.
@@ -39,8 +39,9 @@ Global parameters:
39
39
  | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli dataops_ide +<command> --host <url>`. |
40
40
 
41
41
  Output and errors:
42
- - Successful commands return machine-readable JSON by default.
42
+ - Successful commands return machine-readable JSON by default. Envelope may include optional `_notice.host_compat`.
43
43
  - Failed commands return `{ "ok": false, "error": { "type": "...", "message": "...", "hint": "..." } }` and exit non-zero.
44
+ - **CRITICAL — Host compat (do this first):** After each `ae-cli` run, check stderr and `_notice.host_compat`. If either is present, open the user reply with a short ⚠️ version warning and **quote the `npm i -g` / `npx skills add` (or update-cluster) lines verbatim**, then present the business result. Soft tip; `ok: true` can still carry the notice.
44
45
 
45
46
  Safety constraints:
46
47
  - Read commands can execute directly after required IDs and references are verified.
@@ -21,8 +21,9 @@ Global parameters:
21
21
  | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli engage +<command> --host <url>`. |
22
22
 
23
23
  Output and errors:
24
- - Successful commands return machine-readable JSON by default.
24
+ - Successful commands return machine-readable JSON by default. Envelope may include optional `_notice.host_compat`.
25
25
  - Failed commands return `{ "ok": false, "error": { "type": "...", "message": "...", "hint": "..." } }` and exit non-zero.
26
+ - **CRITICAL — Host compat (do this first):** After each `ae-cli` run, check stderr and `_notice.host_compat`. If either is present, open the user reply with a short ⚠️ version warning and **quote the `npm i -g` / `npx skills add` (or update-cluster) lines verbatim**, then present the business result. Soft tip; `ok: true` can still carry the notice.
26
27
 
27
28
  Safety constraints:
28
29
  - Read commands can execute directly after required IDs and references are verified.
@@ -118,15 +118,15 @@ First, check if both `.ae-cli/draft.json` and `.ae-cli/draft.xlsx` exist:
118
118
  - Reference: tracking plan document (Feishu: https://www.feishu.cn/docx/Jt0VdhNB6oSJ4TxISs1cq2Ebnmg)
119
119
 
120
120
  2. **If you already have a tracking plan**
121
- - Provide the xlsx file path and use `ae-cli tracking code import-xlsx` to import
121
+ - Provide the xlsx file path and use `ae-cli tracking code import-template --template` to import
122
122
  - Or place the xlsx file at `.ae-cli/draft.xlsx` and re-run
123
123
 
124
- **If xlsx file exists** (provided via `ae-cli tracking code import-xlsx` or placed at `.ae-cli/draft.xlsx`):
124
+ **If xlsx file exists** (provided via `ae-cli tracking code import-template --template` or placed at `.ae-cli/draft.xlsx`):
125
125
 
126
126
  **Step 1: Parse the xlsx file**
127
127
 
128
128
  ```bash
129
- ae-cli tracking code import-xlsx --xlsx <xlsx-path> --out .ae-cli/draft.json
129
+ ae-cli tracking code import-template --template <xlsx-path> --out .ae-cli/draft.json
130
130
  ```
131
131
 
132
132
  This command:
@@ -155,7 +155,7 @@ This command:
155
155
  - `服务端` / `server` → server-only collection, parsed as `platform: "server"`
156
156
  - `客户端,服务端` / `client,server` / `服务端,客户端` / `server,client` → both platforms, parsed as `platform: "both"`
157
157
 
158
- **Internal representation**: xlsx "Platform" column values are parsed by `ae-cli tracking code import-xlsx` into internal `platform` field values:
158
+ **Internal representation**: xlsx "Platform" column values are parsed by `ae-cli tracking code import-template --template` into internal `platform` field values:
159
159
  - `client` → client-side collection
160
160
  - `server` → server-side collection
161
161
  - `both` → both platforms
@@ -33,8 +33,9 @@ description: "Interactive generation of an AE tracking plan and upload. Trigger
33
33
  | 用户属性 | User Property | Property on the user profile (persistent state) |
34
34
  | 预置属性 | Preset Property | System property prefixed with `#` (`#device_id`, `#time`, etc.) |
35
35
  | 自动采集事件 | Auto-track Event | SDK auto-collected events (`ta_app_start`, `ta_page_show`, etc.) |
36
- | 系统事件 | System Event | Auto-track event tag category |
37
- | 业务事件 | Business Event | Custom business event tag category |
36
+ | 系统事件 | System Event | event_tag value reserved for SDK auto-track events (`ta_*`). One of two non-module tags (together with 基础事件). |
37
+ | 基础事件 | Basic | event_tag value for account-level lifecycle/progression events (register, login, level_up, create_role, etc.). Not tied to any functional module. |
38
+ | 功能模块 | Functional Module | event_tag value for feature-specific business events; identifies which module the event belongs to (e.g. Battle, Shop, Ads, Payment, Basic) |
38
39
  | SDK 集成模式 | SDK Integration Mode | `client_only` / `server_only` / `both` / `none` |
39
40
  | 客户端平台 | Client Platform | Android, iOS, Web, Unity, Mini-program, etc. |
40
41
  | 服务端语言 | Server Language | Java, Python, Go, Node.js, PHP, etc. |
@@ -54,7 +55,7 @@ description: "Interactive generation of an AE tracking plan and upload. Trigger
54
55
  | xlsx 格式契约 | xlsx Format Contract | Column rules for AE-compatible Excel generation |
55
56
  | draft.json | draft.json | Internal intermediate representation (JSON) of the tracking plan |
56
57
  | display_name | Display Name | Human-readable name in the user's language |
57
- | event_tag | Event Tag | Category label for grouping events |
58
+ | event_tag | Event Tag | Functional module the event belongs to (e.g. Battle, Shop, Ads, Payment). Auto-track events use "System Event". |
58
59
  | snake_case | snake_case | Canonical naming format: `lowercase_with_underscores` |
59
60
 
60
61
  ## When to Trigger
@@ -88,7 +89,7 @@ Phase 0 → 1 → 2 → 3 → 4, do not skip steps.
88
89
  > All subsequent CLI commands must be prefixed with `AE_LANG=<user_lang>` to ensure CLI output and generated xlsx headers match the user's language.
89
90
  > When uploading the xlsx, pass `--lang <user_lang>` as well; it must match `draft.meta.lang` / the generated xlsx language.
90
91
 
91
- Collect the following **4 items** sequentially, **do NOT ask all at once**:
92
+ Collect the following **5 items** sequentially, **do NOT ask all at once**:
92
93
 
93
94
  ### Item 1 — Application Scenario
94
95
 
@@ -111,8 +112,9 @@ Choose your source material (up to 2):
111
112
  2 - Detailed description (conversational) — Describe app business flow, core features, user behaviors, monetization model, etc.
112
113
  3 - Codebase (local project path; hidden in sandbox) — Analyze source code to extract events and properties
113
114
  4 - Pre-built template (built-in industry and game genre templates) — Select a built-in template
115
+ 5 - Modify existing tracking plan (local AE format xlsx file) — Import an existing tracking plan xlsx as baseline for modification; can be combined with Product doc / Description / Codebase, but NOT with Pre-built template
114
116
 
115
- Reply with number(s), e.g. 1 or 1,4. Select up to 2.
117
+ Reply with number(s), e.g. 1,5 or 4. Select up to 2.
116
118
  ```
117
119
 
118
120
  If in a sandbox environment, ask exactly:
@@ -123,8 +125,9 @@ Choose your source material (up to 2):
123
125
  1 - Product document (sandbox workspace path, uploaded attachment, URL, image file, or folder) — Extract events and properties from product docs; supports md/pdf/docx/URL/images (png/jpg/jpeg/webp). You can attach/upload relevant files here.
124
126
  2 - Detailed description (conversational) — Describe app business flow, core features, user behaviors, monetization model, etc.
125
127
  3 - Pre-built template (built-in industry and game genre templates) — Select a built-in template
128
+ 4 - Modify existing tracking plan (sandbox workspace path) — Import an existing tracking plan xlsx as baseline for modification; can be combined with Product doc / Description, but NOT with Pre-built template
126
129
 
127
- Reply with number(s), e.g. 1 or 1,3. Select up to 2.
130
+ Reply with number(s), e.g. 1,4 or 3. Select up to 2.
128
131
  ```
129
132
 
130
133
  Do not rewrite this source material list as unnumbered bullets, cards, or prose. The user must be able to reply with the visible numbers.
@@ -147,9 +150,11 @@ Based on user selection, determine source material type and record to `meta.sour
147
150
  | Description only | `chat` | Construct events in Draft phase based on description |
148
151
  | Codebase only | `codebase` | Scan source code, extract events/properties from business logic |
149
152
  | Template only | `template` | Provide built-in template selection |
150
- | Any two-item combo | Join two types with `_` | First as baseline, second as supplement (priority: template codebase prd → chat) |
153
+ | Existing plan only | `existing_plan` | Import xlsx as baseline (see "Modify Existing Tracking Plan Flow" below) |
154
+ | Any two-item combo | Join two types with `_` | First as baseline, second as supplement (priority: existing_plan → template → codebase → prd → chat) |
155
+ | Existing plan + Pre-built template | **NOT allowed** | Both provide event baselines; semantic conflict |
151
156
 
152
- **Follow-up questions** (ask in selection order):
157
+ **Follow-up questions** (ask in follow-up order defined in Multi-Source Combination Rules below):
153
158
  - Product doc → if not in a sandbox environment, ask exactly:
154
159
  ```text
155
160
  What is the product document path?
@@ -176,6 +181,49 @@ Based on user selection, determine source material type and record to `meta.sour
176
181
  - Detailed description → If too vague, follow up on core features, user behaviors, business flows, monetization
177
182
  - Codebase → ask **"What is the project directory path?"**, then scan source to extract business logic
178
183
  - Pre-built template → display matching templates for user confirmation
184
+ - Modify existing tracking plan → ask **"Please provide the xlsx file path of your existing tracking plan"**, then follow the flow below
185
+
186
+ **Modify Existing Tracking Plan Flow** (when user selects this option):
187
+
188
+ 1. **Import**: Ask user for the file path, then immediately import:
189
+ ```bash
190
+ AE_LANG=<user_lang> ae-cli tracking code import-template --template <path> --out .ae-cli/draft.json
191
+ ```
192
+ 2. **Check result**:
193
+ - If CLI errors (file not found / parse failure) → report error, ask user to fix the file and retry
194
+ - If `draft.json` has `events` array empty → 🛑 **Severe: No AE-format sheets found** (missing `#` prefix sheets like `#事件数据`). Tell user the file does not appear to be an AE tracking plan xlsx. User must fix the original file and re-import.
195
+ 3. **Content validation** (when events are non-empty):
196
+ ```bash
197
+ AE_LANG=<user_lang> ae-cli tracking plan validate --in .ae-cli/draft.json --fix
198
+ ```
199
+ 4. **Handle validation results by severity**:
200
+ - If validate passes with **no issues at all** → skip to Step 5.
201
+
202
+ | Severity | Examples | Handling | User Action |
203
+ |---|---|---|---|
204
+ | 🔧 **Minor** (auto-fixable) | `display_name` duplicate, `array_row` sub-property inconsistency, event name duplicate | `--fix` auto-fixes, writes to `draft.json`. Inform user of what was fixed. | None (informed) |
205
+ | ⚠️ **Medium** (needs confirmation) | snake_case violation, property name duplicate, invalid property type, nested property parent is not a composite type | List each issue with current value → suggested fix. User confirms item by item before writing to `draft.json`. | Confirm each fix |
206
+ | 🛑 **Severe** | File cannot be parsed, or events array is empty after import | Reject. Tell user the specific issue. User fixes **original file** and re-imports. | Fix original file |
207
+
208
+ **Medium issue confirmation format**:
209
+ ```
210
+ ⚠️ The following content needs to be fixed:
211
+
212
+ | # | Issue | Location | Current | Suggested |
213
+ |---|-------|----------|---------|------------|
214
+ | 1 | snake_case | event_name | UserLogin | user_login |
215
+ | 2 | snake_case | prop_name | vipLevel | vip_level |
216
+ | 3 | invalid type | property "level" | integer | number |
217
+
218
+ Apply all suggested fixes? ok / specify per item / skip
219
+ ```
220
+ - `ok` → apply all suggested fixes to `draft.json`
221
+ - `specify per item` → confirm each item one by one
222
+ - `skip` → keep current values, handle in Refine phase later
223
+
224
+ ⚠️ **Never modify the user's original xlsx file.** All changes go into `draft.json`.
225
+
226
+ 5. **Re-validate** after fixes → loop until clean, then continue to the next follow-up question (if combined with another source material), or Item 3 (if existing_plan is the only source).
179
227
 
180
228
  **Codebase analysis flow** (when source_type includes `codebase`):
181
229
 
@@ -196,9 +244,11 @@ After source material is confirmed, **must** process business dimension info bas
196
244
  | source_type | Handling |
197
245
  |---|---|
198
246
  | `template` | Directly display template's inherited business dimensions; skip detailed inference |
247
+ | `existing_plan` | Infer business dimensions from existing plan content (analyze event modules, payment events, currency properties); follow up on missing items; event injection preview |
199
248
  | `prd` / `codebase` / `chat` | Infer business dimensions → follow up on missing items → event injection preview |
249
+ | Combo (e.g. `template_prd`) | See detailed rules below — baseline source's method is primary, supplementary source contributes additional context |
200
250
 
201
- **If source_type = template**:
251
+ **If source_type is template or starts with template_** (covers `template`, `template_prd`, `template_codebase`, `template_chat`):
202
252
 
203
253
  Display template's preset business dimensions:
204
254
 
@@ -215,6 +265,27 @@ Confirm using these business dimensions? ok / modify
215
265
 
216
266
  - User `ok` → proceed to next step
217
267
  - User says "modify" → switch to prd/chat flow for user to supplement
268
+ - For combos (e.g. `template_prd`): after confirming template dimensions, also note any supplementary insights from `prd`/`chat` as context for Phase 1.2.
269
+
270
+ **If source_type includes existing_plan**:
271
+
272
+ Infer business dimensions from the imported plan content:
273
+
274
+ 1. **Analyze existing events**: Examine `event_tag` values to identify functional modules (e.g. events tagged "Battle" → 战斗 module). Examine event names for payment/ad-related patterns to infer revenue model.
275
+ 2. **Inference display**: Format inference results as a summary:
276
+ ```
277
+ Business Dimension (inferred from existing plan: <filename>)
278
+
279
+ Revenue Model: <inferred from payment/ad events>
280
+ Core Loop: <inferred from event flow>
281
+ Functional Entries: <inferred from event_tag values>
282
+ Currency System: <inferred from currency-related properties>
283
+
284
+ Confirm these business dimensions? ok / modify
285
+ ```
286
+ 3. **Follow up missing**: Only ask about items that could not be inferred
287
+ 4. **Event injection preview**: Show suggested injected event modules (only add events not already in the plan); user `ok` to proceed
288
+ - For combos (e.g. `existing_plan_prd`): after confirming dimensions from the plan, also note any supplementary insights from `prd`/`chat` as context for Phase 1.2.
218
289
 
219
290
  **If source_type is prd / codebase / chat**:
220
291
 
@@ -224,7 +295,7 @@ Confirm using these business dimensions? ok / modify
224
295
 
225
296
  Platform validation: Use `business-dimension-mapping.md` Chapter 5 decision rules to check if injected events' platform assignments are reasonable.
226
297
 
227
- **Template matching** (prd / codebase / chat scenarios, optional):
298
+ **Template matching** (prd / codebase / chat scenarios, optional; **NOT applicable to existing_plan or template scenarios**):
228
299
 
229
300
  After business dimension confirmation, auto-detect matching templates based on app type:
230
301
  ```bash
@@ -233,6 +304,51 @@ AE_LANG=<user_lang> ae-cli tracking plan list-templates --json
233
304
 
234
305
  Show matching templates to user for confirmation. Confirmed templates serve as baseline and participate in Phase 1 event merging.
235
306
 
307
+ ### Multi-Source Combination Rules (when user selects 2 source materials)
308
+
309
+ **Follow-up Order** (Phase 0 questioning sequence):
310
+
311
+ Do **not** follow user's selection order. Instead, use this order:
312
+
313
+ ```
314
+ existing_plan(blocking validation, always first)→ codebase/prd(user's selection order)→ chat → template
315
+ ```
316
+
317
+ Rationale:
318
+ - `existing_plan` must go first — import + validate may require the user to fix their file; processing it early avoids wasted context
319
+ - `codebase` / `prd` — directly reflect actual business requirements, prioritized over generic descriptions and templates
320
+ - `chat` — conversational description, supplements business context
321
+ - `template` — generic industry template, least specific to the user's business
322
+
323
+ Source material processing happens primarily in Phase 1.2 (Merge Source Materials). The one exception is `existing_plan`: it is imported and validated in Phase 0 because user-provided files may need fixing before proceeding. All other sources are processed in Phase 1.2 per their standard flow.
324
+
325
+ Merge priority (Phase 1.2): `existing_plan → template → codebase → prd → chat → autotrack`
326
+ Earlier sources take precedence — same-name events keep the earlier version, later sources only add new events or merge `prop_names` without overwriting.
327
+
328
+ **Business Dimension Inference (combined scenarios)**:
329
+
330
+ Use the baseline source's inference method as primary. Supplementary sources (especially prd/chat) may contribute additional information — present a merged view for user confirmation.
331
+
332
+ **Valid Combinations**:
333
+
334
+ > The "Baseline" column identifies which source has higher merge priority (see Phase 1.2 merge order), which may differ from the user's selection order. Follow-up questioning uses the fixed order in "Multi-Source Combination Rules" above, not the user's selection order.
335
+
336
+ | Baseline | Supplementary | Phase 0 for supplementary |
337
+ |---|---|---|
338
+ | existing_plan | codebase | Collect path + quick tech stack detection |
339
+ | existing_plan | prd | Collect path |
340
+ | existing_plan | chat | Collect description; participates in dimension inference |
341
+ | template | codebase | Collect path + quick tech stack detection; template matching/import deferred to Phase 1.2 |
342
+ | template | prd | Collect path; template matching/import deferred to Phase 1.2 |
343
+ | template | chat | Collect description |
344
+ | codebase | prd | Collect path |
345
+ | codebase | chat | Collect description |
346
+ | prd | chat | Collect description |
347
+ | codebase | template | Same as template+codebase row above (template is baseline per merge priority) |
348
+ | prd | template | Same as template+prd row above (template is baseline per merge priority) |
349
+
350
+ **Forbidden**: `existing_plan + template` (both provide event baselines; semantic conflict).
351
+
236
352
  **Record business dimension info to `meta.business_dimension`**:
237
353
  ```json
238
354
  "business_dimension": {
@@ -493,8 +609,11 @@ Draft
493
609
 
494
610
  ### 1.2 Merge Source Materials
495
611
 
496
- Priority from low to high: **template → codebase → prd → chat → autotrack**
612
+ Merge order: **existing_plan template → codebase → prd → chat → autotrack**
497
613
 
614
+ Earlier sources take precedence — same-name events keep the earlier version, later sources only add new events or merge `prop_names` without overwriting.
615
+
616
+ - **existing_plan**: Already imported and validated in Phase 0 (see "Modify Existing Tracking Plan Flow"). Events are in draft.json as the baseline; each item marked `source: "existing_plan"`. Higher-priority sources supplement with new events only; same-name events keep the existing_plan version.
498
617
  - **template**: User-selected industry template (see "Template Lookup Convention" below) as baseline; each item marked `source: "template"`
499
618
  - Templates are resolved by ae-cli from the ae-cli package root and user template directory
500
619
  - Import command: `AE_LANG=<user_lang> ae-cli tracking code import-template --template-name "<template name>" --out .ae-cli/draft.json`
@@ -657,6 +776,8 @@ AE_LANG=<user_lang> ae-cli tracking plan draft --in .ae-cli/draft.json --out .ae
657
776
 
658
777
  **Note**: Display names can be the same across different property pools (e.g. `vip_level` can be both an event property and a user property).
659
778
 
779
+ > **Relationship to Phase 0 existing_plan validation**: The underlying rule engine is the same, but Phase 0 uses **interactive 3-tier** (Minor/Medium/Severe) because the user is present to confirm each fix. Phase 1.6 uses **batch 2-tier** (auto-fixable / manual-fix-needed) because it runs as part of the automated draft generation. Rules that are "Medium (needs confirmation)" in Phase 0 appear as "❌ Manual fix needed" here — the same rule, just without the interactive prompt.
780
+
660
781
  ### 1.7 Show Summary
661
782
 
662
783
  Display to user via markdown table: event count / event property pool size / super property count / user property count; show deliverable paths.