@thinkingai/ae-cli 6.1.13 → 6.1.14

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 (32) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/{metadata-VVQ3AQT5.js → metadata-5MIMNIMT.js} +12 -9
  3. package/dist/{metadata-UORZTW3T.js → metadata-LERKDJN6.js} +12 -9
  4. package/dist/{te-analysis-LLOCCBJ4.js → te-analysis-FCHRTNIY.js} +48 -48
  5. package/dist/{te-analysis-KOKHJJPE.js → te-analysis-QG7UKGDA.js} +48 -48
  6. package/dist/{te-engage-BRLSRVQT.js → te-engage-D6EG3NOR.js} +389 -4
  7. package/dist/{te-engage-HE4OPZIT.js → te-engage-ZSMIJLUW.js} +389 -4
  8. package/package.json +1 -1
  9. package/skills/ae-analysis/references/ai_models.md +4 -1
  10. package/skills/ae-analysis/references/alert_list.md +2 -3
  11. package/skills/ae-analysis/references/analysis_gateway_assets.md +5 -5
  12. package/skills/ae-analysis/references/bi_panel_list.md +2 -2
  13. package/skills/ae-analysis/references/command_index.md +14 -14
  14. package/skills/ae-analysis/references/dashboard_list.md +2 -2
  15. package/skills/ae-analysis/references/favorite_add.md +2 -2
  16. package/skills/ae-analysis/references/favorite_remove.md +2 -2
  17. package/skills/ae-analysis/references/metric_create.md +7 -8
  18. package/skills/ae-analysis/references/project_space_list.md +2 -2
  19. package/skills/ae-analysis/references/public_link_list.md +2 -2
  20. package/skills/ae-analysis/references/report_list.md +3 -3
  21. package/skills/ae-analysis/references/report_list_export.md +2 -2
  22. package/skills/ae-analysis/references/sql_table_list.md +3 -2
  23. package/skills/ae-analysis/references/user_cluster_update.md +4 -2
  24. package/skills/ae-analysis/references/user_tag_update.md +4 -2
  25. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +3 -3
  26. package/skills/ae-engage/SKILL.md +10 -2
  27. package/skills/ae-engage/references/flow-metric-user.md +2 -1
  28. package/skills/ae-engage/references/flow-node-metric-user.md +2 -1
  29. package/skills/ae-engage/references/flow-node-user.md +2 -1
  30. package/skills/ae-engage/references/task-indicator-user.md +104 -0
  31. package/skills/ae-engage/references/task-user-detail-export.md +31 -0
  32. package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
@@ -3918,6 +3918,319 @@ var groupUpdate = createEngageTaskCapabilityCommand({
3918
3918
  })
3919
3919
  });
3920
3920
 
3921
+ // src/commands/te-engage/engage-task/indicator-user/shared.ts
3922
+ var ISO_DATE3 = /^\d{4}-\d{2}-\d{2}$/;
3923
+ var DECIMAL_TIME_ZONE = /^[+-]?\d{1,2}(?:\.\d+)?$/;
3924
+ var taskIndicatorUserIndicators = [
3925
+ "original_trigger",
3926
+ "plan",
3927
+ "actual_trigger",
3928
+ "trigger_success",
3929
+ "view",
3930
+ "click",
3931
+ "main",
3932
+ "secondary",
3933
+ "metric",
3934
+ "click_activate",
3935
+ "main_activate",
3936
+ "secondary_activate"
3937
+ ];
3938
+ var indicatorSet = new Set(taskIndicatorUserIndicators);
3939
+ var groupBySet = /* @__PURE__ */ new Set(["batch", "date", "trigger", "experiment"]);
3940
+ var retentionTypeSet = /* @__PURE__ */ new Set(["retention", "lost"]);
3941
+ var sourceSet = /* @__PURE__ */ new Set(["task", "experiment", "metric"]);
3942
+ var pushLanguageCodeSet = /* @__PURE__ */ new Set([
3943
+ "all",
3944
+ "default",
3945
+ "ar",
3946
+ "az",
3947
+ "bs",
3948
+ "ca",
3949
+ "zh-Hans",
3950
+ "zh-Hant",
3951
+ "hr",
3952
+ "cs",
3953
+ "da",
3954
+ "nl",
3955
+ "en",
3956
+ "et",
3957
+ "fi",
3958
+ "fr",
3959
+ "ka",
3960
+ "bg",
3961
+ "de",
3962
+ "el",
3963
+ "hi",
3964
+ "he",
3965
+ "hu",
3966
+ "id",
3967
+ "it",
3968
+ "ja",
3969
+ "ko",
3970
+ "lv",
3971
+ "lt",
3972
+ "ms",
3973
+ "nb",
3974
+ "fa",
3975
+ "pl",
3976
+ "pt",
3977
+ "pa",
3978
+ "ro",
3979
+ "ru",
3980
+ "sr",
3981
+ "sk",
3982
+ "es",
3983
+ "sv",
3984
+ "th",
3985
+ "tr",
3986
+ "uk",
3987
+ "vi"
3988
+ ]);
3989
+ var lostUnsupportedIndicatorSet = /* @__PURE__ */ new Set([
3990
+ "original_trigger",
3991
+ "metric",
3992
+ "click_activate",
3993
+ "main_activate",
3994
+ "secondary_activate"
3995
+ ]);
3996
+ var taskIndicatorUserFlags = [
3997
+ { name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
3998
+ { name: "task-id", type: "string", required: true, desc: "Engagement task ID." },
3999
+ {
4000
+ name: "indicator",
4001
+ type: "string",
4002
+ required: true,
4003
+ desc: `Indicator segment. Values: ${taskIndicatorUserIndicators.join(", ")}.`
4004
+ },
4005
+ { name: "start-time", type: "string", required: true, desc: "Segment start date in yyyy-MM-dd format." },
4006
+ { name: "end-time", type: "string", required: true, desc: "Segment end date in yyyy-MM-dd format." },
4007
+ {
4008
+ name: "group-by",
4009
+ type: "string",
4010
+ required: false,
4011
+ desc: "Grouping context: batch, date, trigger, or experiment. Activate indicators require and default to experiment; others default to date."
4012
+ },
4013
+ { name: "is-summary", type: "boolean", required: false, desc: "Whether to query a summary segment. Defaults to true." },
4014
+ {
4015
+ name: "retention-type",
4016
+ type: "string",
4017
+ required: false,
4018
+ desc: "Segment mode: retention or lost. Defaults to retention."
4019
+ },
4020
+ {
4021
+ name: "source",
4022
+ type: "string",
4023
+ required: false,
4024
+ desc: "Report source: task, experiment, or metric. Defaults to metric for metric indicators, experiment for activate indicators or experiment grouping, and task otherwise."
4025
+ },
4026
+ { name: "secondary-index", type: "number", required: false, desc: "Secondary indicator index from 1 to 10." },
4027
+ { name: "metric-id", type: "string", required: false, desc: "Metric setting ID; required when --indicator=metric." },
4028
+ { name: "task-instance-id", type: "string", required: false, desc: "Optional non-triggered task instance ID." },
4029
+ { name: "exp-group-id", type: "string", required: false, desc: "Optional experiment group ID." },
4030
+ { name: "push-language-code", type: "string", required: false, desc: "Push language filter, such as all, default, en, zh-Hans, or zh-Hant." },
4031
+ { name: "user-time-zone", type: "string", required: false, desc: "User timezone filter: all or a decimal offset available on the task." },
4032
+ { name: "show-time-zone", type: "string", required: false, desc: "Display timezone offset from -12 to 14. Omitted or 99 uses the backend default." }
4033
+ ];
4034
+ var taskIndicatorUserRequestFlag = {
4035
+ name: "request-id",
4036
+ type: "string",
4037
+ required: false,
4038
+ desc: "Query correlation ID. Generated when omitted."
4039
+ };
4040
+ var taskIndicatorUserLimitFlag = {
4041
+ name: "limit",
4042
+ type: "number",
4043
+ required: false,
4044
+ desc: "Maximum number of rows returned inline. Defaults to backend policy."
4045
+ };
4046
+ var taskIndicatorUserTimeoutFlag = {
4047
+ name: "timeout-seconds",
4048
+ type: "number",
4049
+ required: false,
4050
+ desc: "Query or export timeout in seconds. Defaults to backend policy."
4051
+ };
4052
+ var taskIndicatorUserFormatFlag = {
4053
+ name: "artifact-format",
4054
+ type: "string",
4055
+ required: false,
4056
+ desc: "Export artifact format: csv or jsonl. Defaults to jsonl."
4057
+ };
4058
+ function validateTaskIndicatorUserInput(ctx) {
4059
+ const indicator = ctx.str("indicator");
4060
+ if (!indicatorSet.has(indicator)) {
4061
+ fail2(`--indicator must be one of: ${taskIndicatorUserIndicators.join(", ")}`);
4062
+ }
4063
+ validateDate3(ctx.str("start-time"), "--start-time");
4064
+ validateDate3(ctx.str("end-time"), "--end-time");
4065
+ if (ctx.str("start-time") > ctx.str("end-time")) {
4066
+ fail2("--start-time must be earlier than or equal to --end-time");
4067
+ }
4068
+ validateOptionalSet(ctx.str("group-by"), "--group-by", groupBySet);
4069
+ validateOptionalSet(ctx.str("retention-type"), "--retention-type", retentionTypeSet);
4070
+ validateOptionalSet(ctx.str("source"), "--source", sourceSet);
4071
+ validateOptionalSet(ctx.str("push-language-code"), "--push-language-code", pushLanguageCodeSet);
4072
+ validateShowTimeZone(ctx.str("show-time-zone"));
4073
+ validateUserTimeZone(ctx.str("user-time-zone"));
4074
+ const secondary = indicator === "secondary" || indicator === "secondary_activate";
4075
+ const secondaryIndex = ctx.optionalNum("secondary-index");
4076
+ if (secondary && (secondaryIndex === void 0 || !Number.isInteger(secondaryIndex) || secondaryIndex < 1 || secondaryIndex > 10)) {
4077
+ fail2("--secondary-index must be an integer from 1 to 10 for secondary indicators");
4078
+ }
4079
+ if (!secondary && secondaryIndex !== void 0) {
4080
+ fail2("--secondary-index is only accepted for secondary indicators");
4081
+ }
4082
+ if (indicator === "metric" && !ctx.str("metric-id")) {
4083
+ fail2("--metric-id is required when --indicator=metric");
4084
+ }
4085
+ if (indicator !== "metric" && ctx.str("metric-id")) {
4086
+ fail2("--metric-id is only accepted when --indicator=metric");
4087
+ }
4088
+ const source = ctx.str("source");
4089
+ const metric = indicator === "metric";
4090
+ if (metric && source && source !== "metric") {
4091
+ fail2("--source must be metric when --indicator=metric");
4092
+ }
4093
+ if (!metric && source === "metric") {
4094
+ fail2("--source=metric requires --indicator=metric");
4095
+ }
4096
+ const activate = indicator === "click_activate" || indicator === "main_activate" || indicator === "secondary_activate";
4097
+ const groupBy = ctx.str("group-by");
4098
+ if (activate && source && source !== "experiment") {
4099
+ fail2("--source must be experiment for activate indicators");
4100
+ }
4101
+ if (activate && groupBy && groupBy !== "experiment") {
4102
+ fail2("--group-by must be experiment for activate indicators");
4103
+ }
4104
+ if (ctx.str("retention-type") === "lost" && lostUnsupportedIndicatorSet.has(indicator)) {
4105
+ fail2(`--retention-type=lost is not supported for --indicator=${indicator}`);
4106
+ }
4107
+ const isSummary = readOptionalBoolean(ctx, "is-summary");
4108
+ const effectiveGroupBy = groupBy || (activate ? "experiment" : "date");
4109
+ if (indicator === "plan" && ctx.str("exp-group-id")) {
4110
+ fail2("--exp-group-id is not supported when --indicator=plan");
4111
+ }
4112
+ if (indicator === "plan" && effectiveGroupBy === "experiment" && isSummary === false) {
4113
+ fail2("--is-summary=false is not supported for plan indicators grouped by experiment");
4114
+ }
4115
+ if (effectiveGroupBy === "experiment" && !metric && source && source !== "experiment") {
4116
+ fail2("--source must be experiment when --group-by=experiment");
4117
+ }
4118
+ if (effectiveGroupBy === "batch" && isSummary === false && !ctx.str("task-instance-id")) {
4119
+ fail2("--task-instance-id is required for a non-summary batch segment");
4120
+ }
4121
+ if (effectiveGroupBy === "experiment" && isSummary === false && !ctx.str("exp-group-id")) {
4122
+ fail2("--exp-group-id is required for a non-summary experiment segment");
4123
+ }
4124
+ }
4125
+ function buildTaskIndicatorUserInput(ctx) {
4126
+ return {
4127
+ project_id: ctx.num("project-id"),
4128
+ task_id: ctx.str("task-id"),
4129
+ indicator: ctx.str("indicator"),
4130
+ start_time: ctx.str("start-time"),
4131
+ end_time: ctx.str("end-time"),
4132
+ group_by: ctx.str("group-by") || void 0,
4133
+ is_summary: readOptionalBoolean(ctx, "is-summary"),
4134
+ retention_type: ctx.str("retention-type") || void 0,
4135
+ source: ctx.str("source") || void 0,
4136
+ secondary_index: ctx.optionalNum("secondary-index"),
4137
+ metric_id: ctx.str("metric-id") || void 0,
4138
+ task_instance_id: ctx.str("task-instance-id") || void 0,
4139
+ exp_group_id: ctx.str("exp-group-id") || void 0,
4140
+ push_language_code: ctx.str("push-language-code") || void 0,
4141
+ user_time_zone: ctx.str("user-time-zone") || void 0,
4142
+ show_time_zone: ctx.str("show-time-zone") || void 0,
4143
+ request_id: ctx.str("request-id") || void 0,
4144
+ limit: ctx.optionalNum("limit"),
4145
+ format: ctx.str("artifact-format") || void 0,
4146
+ timeout_seconds: ctx.optionalNum("timeout-seconds")
4147
+ };
4148
+ }
4149
+ function validateDate3(value, flag) {
4150
+ if (!ISO_DATE3.test(value)) {
4151
+ fail2(`${flag} must be in yyyy-MM-dd format`);
4152
+ }
4153
+ }
4154
+ function validateOptionalSet(value, flag, allowed) {
4155
+ if (value && !allowed.has(value)) {
4156
+ fail2(`${flag} must be one of: ${[...allowed].join(", ")}`);
4157
+ }
4158
+ }
4159
+ function validateShowTimeZone(value) {
4160
+ if (!value) {
4161
+ return;
4162
+ }
4163
+ if (!DECIMAL_TIME_ZONE.test(value)) {
4164
+ fail2("--show-time-zone must use decimal hour-offset format like 8.0 or -5.0");
4165
+ }
4166
+ const offset = Number(value);
4167
+ if ((offset < -12 || offset > 14) && offset !== 99) {
4168
+ fail2("--show-time-zone must be between -12 and 14, or 99");
4169
+ }
4170
+ }
4171
+ function validateUserTimeZone(value) {
4172
+ if (!value || value === "all") {
4173
+ return;
4174
+ }
4175
+ if (!DECIMAL_TIME_ZONE.test(value)) {
4176
+ fail2("--user-time-zone must be all or a decimal hour offset like 8.0 or -5.0");
4177
+ }
4178
+ const offset = Number(value);
4179
+ if (offset < -12 || offset > 14) {
4180
+ fail2("--user-time-zone must be between -12 and 14, or all");
4181
+ }
4182
+ }
4183
+ function fail2(message) {
4184
+ printError("validation", message);
4185
+ process.exit(1);
4186
+ }
4187
+
4188
+ // src/commands/te-engage/engage-task/indicator-user/export.ts
4189
+ var taskIndicatorUserExport = createEngageTaskCapabilityCommand({
4190
+ resource: "indicator-user",
4191
+ command: "export",
4192
+ capabilityId: "engage-task.indicator-user.export",
4193
+ description: "Export users behind an engagement-task indicator segment.",
4194
+ flags: [
4195
+ ...taskIndicatorUserFlags,
4196
+ taskIndicatorUserRequestFlag,
4197
+ taskIndicatorUserFormatFlag,
4198
+ taskIndicatorUserTimeoutFlag
4199
+ ],
4200
+ risk: "read",
4201
+ validate: validateTaskIndicatorUserInput,
4202
+ buildInput: buildTaskIndicatorUserInput
4203
+ });
4204
+
4205
+ // src/commands/te-engage/engage-task/indicator-user/run.ts
4206
+ var taskIndicatorUserRun = createEngageTaskCapabilityCommand({
4207
+ resource: "indicator-user",
4208
+ command: "run",
4209
+ capabilityId: "engage-task.indicator-user.run",
4210
+ description: "Query users behind an engagement-task indicator segment inline.",
4211
+ flags: [
4212
+ ...taskIndicatorUserFlags,
4213
+ taskIndicatorUserRequestFlag,
4214
+ taskIndicatorUserLimitFlag,
4215
+ taskIndicatorUserTimeoutFlag
4216
+ ],
4217
+ risk: "read",
4218
+ validate: validateTaskIndicatorUserInput,
4219
+ buildInput: buildTaskIndicatorUserInput
4220
+ });
4221
+
4222
+ // src/commands/te-engage/engage-task/indicator-user/sql.ts
4223
+ var taskIndicatorUserSql = createEngageTaskCapabilityCommand({
4224
+ resource: "indicator-user",
4225
+ command: "sql",
4226
+ capabilityId: "engage-task.indicator-user.sql",
4227
+ description: "Build validated user-detail SQL for an engagement-task indicator segment.",
4228
+ flags: taskIndicatorUserFlags,
4229
+ risk: "read",
4230
+ validate: validateTaskIndicatorUserInput,
4231
+ buildInput: buildTaskIndicatorUserInput
4232
+ });
4233
+
3921
4234
  // src/commands/te-engage/engage-task/metric/list.ts
3922
4235
  var metricList = createEngageTaskCapabilityCommand({
3923
4236
  resource: "metric",
@@ -3974,7 +4287,7 @@ var operationLogQuery2 = createEngageTaskCapabilityCommand({
3974
4287
  });
3975
4288
 
3976
4289
  // src/commands/te-engage/engage-task/push-record/query.ts
3977
- var ISO_DATE3 = /^\d{4}-\d{2}-\d{2}$/;
4290
+ var ISO_DATE4 = /^\d{4}-\d{2}-\d{2}$/;
3978
4291
  var pushRecordQuery = createEngageTaskCapabilityCommand({
3979
4292
  resource: "push-record",
3980
4293
  command: "query",
@@ -4002,11 +4315,11 @@ var pushRecordQuery = createEngageTaskCapabilityCommand({
4002
4315
  validate: (ctx) => {
4003
4316
  const startDate = ctx.str("start-date");
4004
4317
  const endDate = ctx.str("end-date");
4005
- if (startDate && !ISO_DATE3.test(startDate)) {
4318
+ if (startDate && !ISO_DATE4.test(startDate)) {
4006
4319
  printError("validation", "--start-date must be in yyyy-MM-dd format");
4007
4320
  process.exit(1);
4008
4321
  }
4009
- if (endDate && !ISO_DATE3.test(endDate)) {
4322
+ if (endDate && !ISO_DATE4.test(endDate)) {
4010
4323
  printError("validation", "--end-date must be in yyyy-MM-dd format");
4011
4324
  process.exit(1);
4012
4325
  }
@@ -4317,6 +4630,74 @@ var taskStats = createEngageTaskCapabilityCommand({
4317
4630
  buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredJsonObject(ctx, "req") })
4318
4631
  });
4319
4632
 
4633
+ // src/commands/te-engage/engage-task/user-detail/export.ts
4634
+ var taskUserDetailStatuses = [
4635
+ "frequency_control",
4636
+ "fatigue_control",
4637
+ "fail",
4638
+ "success",
4639
+ "sample",
4640
+ "exp_skip_push",
4641
+ "deduplicate",
4642
+ "push_plan",
4643
+ "push_actual"
4644
+ ];
4645
+ var statusSet = new Set(taskUserDetailStatuses);
4646
+ var taskUserDetailExport = createEngageTaskCapabilityCommand({
4647
+ resource: "user-detail",
4648
+ command: "export",
4649
+ capabilityId: "engage-task.user-detail.export",
4650
+ description: "Export user details for one non-triggered task instance and user status.",
4651
+ flags: [
4652
+ { name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
4653
+ { name: "task-id", type: "string", required: true, desc: "Engagement task ID." },
4654
+ { name: "task-instance-id", type: "string", required: true, desc: "Non-triggered task instance ID." },
4655
+ {
4656
+ name: "task-exec-detail-id",
4657
+ type: "string",
4658
+ required: false,
4659
+ desc: "Optional execution detail ID used to narrow the task instance export."
4660
+ },
4661
+ {
4662
+ name: "user-status",
4663
+ type: "string",
4664
+ required: false,
4665
+ desc: `English user status. Defaults to fail. Values: ${taskUserDetailStatuses.join(", ")}.`
4666
+ },
4667
+ { name: "request-id", type: "string", required: false, desc: "Export correlation ID. Generated when omitted." },
4668
+ {
4669
+ name: "artifact-format",
4670
+ type: "string",
4671
+ required: false,
4672
+ desc: "Export artifact format: csv or jsonl. Defaults to jsonl."
4673
+ },
4674
+ {
4675
+ name: "timeout-seconds",
4676
+ type: "number",
4677
+ required: false,
4678
+ desc: "Export timeout in seconds. Defaults to backend policy and cannot exceed 21600."
4679
+ }
4680
+ ],
4681
+ risk: "read",
4682
+ validate: (ctx) => {
4683
+ const status = ctx.str("user-status") || "fail";
4684
+ if (!statusSet.has(status)) {
4685
+ printError("validation", `--user-status must be one of: ${taskUserDetailStatuses.join(", ")}`);
4686
+ process.exit(1);
4687
+ }
4688
+ },
4689
+ buildInput: (ctx) => ({
4690
+ project_id: ctx.num("project-id"),
4691
+ task_id: ctx.str("task-id"),
4692
+ task_instance_id: ctx.str("task-instance-id"),
4693
+ task_exec_detail_id: ctx.str("task-exec-detail-id") || void 0,
4694
+ user_status: ctx.str("user-status") || "fail",
4695
+ request_id: ctx.str("request-id") || void 0,
4696
+ format: ctx.str("artifact-format") || void 0,
4697
+ timeout_seconds: ctx.optionalNum("timeout-seconds")
4698
+ })
4699
+ });
4700
+
4320
4701
  // src/commands/te-engage/engage-task/index.ts
4321
4702
  var commands6 = [
4322
4703
  taskList,
@@ -4332,6 +4713,9 @@ var commands6 = [
4332
4713
  groupDelete,
4333
4714
  groupList,
4334
4715
  groupUpdate,
4716
+ taskIndicatorUserSql,
4717
+ taskIndicatorUserRun,
4718
+ taskIndicatorUserExport,
4335
4719
  metricList,
4336
4720
  metricUpdate,
4337
4721
  operationLogQuery2,
@@ -4343,7 +4727,8 @@ var commands6 = [
4343
4727
  segmentListSetVisibility,
4344
4728
  taskDelete,
4345
4729
  taskModifyGroup,
4346
- taskSubmitApproval
4730
+ taskSubmitApproval,
4731
+ taskUserDetailExport
4347
4732
  ];
4348
4733
  var engage_task_default = commands6;
4349
4734