@thinkingai/ae-cli 6.1.18 → 6.1.19

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 (96) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +6 -0
  3. package/dist/{auth-ROB2EDYV.js → auth-QPEVVBKT.js} +13 -7
  4. package/dist/auth-UMJAA72O.js +15 -0
  5. package/dist/{capability-DKMYUTLC.js → capability-ASI62I4A.js} +11 -10
  6. package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
  7. package/dist/{chunk-4XXOWOTA.js → chunk-6QK7SYYY.js} +5 -4
  8. package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
  9. package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
  10. package/dist/{sync-HKIOZXQE.js → chunk-B5HMQAOM.js} +31 -540
  11. package/dist/{chunk-Y3LOALAV.js → chunk-DKEXH6Q5.js} +4 -3
  12. package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
  13. package/dist/{chunk-JHENBQ5B.js → chunk-FR2EDAQM.js} +1 -0
  14. package/dist/{chunk-ZQ47LWTI.js → chunk-GJXRF7Y6.js} +6 -5
  15. package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
  16. package/dist/chunk-JYMGHGCE.js +191 -0
  17. package/dist/{chunk-BYYS3ANB.js → chunk-KEWVSO64.js} +5 -4
  18. package/dist/{chunk-3FY3RJ26.js → chunk-KZ6ZHF5J.js} +2 -1
  19. package/dist/{chunk-ZQKDZXDO.js → chunk-O6K2ODUE.js} +3 -2
  20. package/dist/chunk-QL6R6TSK.js +25215 -0
  21. package/dist/{chunk-J2DEBMRF.js → chunk-RWXIXOZG.js} +22 -9
  22. package/dist/{chunk-QZ3AS4KK.js → chunk-S5PONFBM.js} +5 -4
  23. package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
  24. package/dist/{chunk-3KWQYGYI.js → chunk-TKHSULJT.js} +2 -0
  25. package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
  26. package/dist/{client-L2YDMHQ6.js → client-N7NGZUNI.js} +4 -3
  27. package/dist/{community-report-client-C7WDGET3.js → community-report-client-6OL6GBQW.js} +3 -2
  28. package/dist/{config-BMYZX2UE.js → config-XNMACCKX.js} +8 -7
  29. package/dist/{data-integration-QEKDWQDY.js → data-integration-4NZGZ45E.js} +913 -92
  30. package/dist/index.js +38 -36
  31. package/dist/{local-data-upload-client-4YYHSYD6.js → local-data-upload-client-EFHDLXFG.js} +3 -2
  32. package/dist/{memory-I2WXDTV2.js → memory-HBJQ2GC5.js} +8 -7
  33. package/dist/{metadata-I4C2EWUN.js → metadata-62EWBEIG.js} +12 -11
  34. package/dist/{model-HLHIEFMU.js → model-BHLJ2QMT.js} +10 -9
  35. package/dist/{personal-semantic-preference-LIPACBDX.js → personal-semantic-preference-JBVMAI7L.js} +11 -10
  36. package/dist/{project-semantic-RT3R2VQD.js → project-semantic-BQ4MPUS5.js} +12 -11
  37. package/dist/sync-MUWPRM5I.js +522 -0
  38. package/dist/{te-agent-BR6VDBNX.js → te-agent-WQZTMEK4.js} +10 -9
  39. package/dist/{te-analysis-7VUNUYWZ.js → te-analysis-MNCG65LU.js} +107 -20
  40. package/dist/{te-community-5DMNKJWY.js → te-community-BNE6KREL.js} +8 -7
  41. package/dist/{te-dataops-6P5IKWNJ.js → te-dataops-TXLKM2W6.js} +467 -67
  42. package/dist/{te-engage-KZPR5R22.js → te-engage-TPKLRVTL.js} +84 -10
  43. package/dist/{te-experiment-6BITX4RD.js → te-experiment-6BYKTCY7.js} +85 -12
  44. package/dist/{te-kb-RCLSSH2Q.js → te-kb-BUD6N3NI.js} +311 -24
  45. package/dist/{te-system-FXITO2JG.js → te-system-44LZJDTQ.js} +573 -37
  46. package/dist/{te-team-ADOC2ROP.js → te-team-XMP47YXE.js} +10 -7
  47. package/dist/{update-YCYCKJOO.js → update-UODFOZ4P.js} +7 -6
  48. package/package.json +18 -9
  49. package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
  50. package/skills/ae-analysis/references/audience_models.md +18 -0
  51. package/skills/ae-analysis/references/command_index.md +2 -2
  52. package/skills/ae-analysis/references/project_timezone_update.md +13 -4
  53. package/skills/ae-analysis/references/property_create.md +2 -0
  54. package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
  55. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  56. package/skills/ae-analysis/references/user_cluster_update.md +8 -4
  57. package/skills/ae-analysis/references/user_tag_create.md +7 -1
  58. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  59. package/skills/ae-data-integration/SKILL.md +1 -0
  60. package/skills/ae-data-integration/references/error-handling.md +54 -1
  61. package/skills/ae-data-integration/references/source-inspect.md +18 -2
  62. package/skills/ae-data-integration/references/transform.md +3 -1
  63. package/skills/ae-data-integration/references/ue-routing.md +23 -0
  64. package/skills/ae-dataops/SKILL.md +11 -1
  65. package/skills/ae-dataops/references/dataops-backfill.md +135 -0
  66. package/skills/ae-engage/SKILL.md +5 -0
  67. package/skills/ae-engage/references/build-task-save-guide.md +5 -1
  68. package/skills/ae-engage/references/save-flow.md +37 -1
  69. package/skills/ae-engage/references/save-task.md +6 -0
  70. package/skills/ae-experiment/SKILL.md +6 -2
  71. package/skills/ae-experiment/references/save_metric.md +20 -8
  72. package/skills/ae-kb/SKILL.md +120 -9
  73. package/skills/ae-system/SKILL.md +28 -30
  74. package/skills/ae-system/references/channel-management.md +303 -0
  75. package/dist/auth-GBMV6TEJ.js +0 -14
  76. package/dist/capability-HYVVPG25.js +0 -352
  77. package/dist/chunk-EFH4XWYC.js +0 -556
  78. package/dist/chunk-JRJY5DMJ.js +0 -71
  79. package/dist/chunk-OMPRXM3V.js +0 -349
  80. package/dist/chunk-QNOLN2LJ.js +0 -509
  81. package/dist/chunk-RJDU7NYP.js +0 -1198
  82. package/dist/chunk-RNAALWJK.js +0 -98
  83. package/dist/chunk-SERWF6G5.js +0 -13
  84. package/dist/memory-3ORCR7JH.js +0 -893
  85. package/dist/metadata-VUOQJE26.js +0 -339
  86. package/dist/model-UGRDX4MW.js +0 -139
  87. package/dist/personal-semantic-preference-OEISBRHM.js +0 -239
  88. package/dist/project-semantic-FFPWFPIW.js +0 -1114
  89. package/dist/sync-TFHU2UTG.js +0 -10261
  90. package/dist/te-agent-VLYOV7S4.js +0 -3894
  91. package/dist/te-analysis-4YGQL5RC.js +0 -9357
  92. package/dist/te-community-ISDQWJU7.js +0 -1859
  93. package/dist/te-dataops-CVULXNVB.js +0 -2209
  94. package/dist/te-engage-N5WI32H6.js +0 -4898
  95. package/dist/te-experiment-UVR4HLND.js +0 -988
  96. package/dist/te-system-K2GYMCTB.js +0 -2213
@@ -1,29 +1,30 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
1
2
  import {
2
3
  createCapabilityCommand
3
- } from "./chunk-Y3LOALAV.js";
4
+ } from "./chunk-DKEXH6Q5.js";
4
5
  import {
5
6
  registerCapabilityGatewayRoute,
6
7
  resolveGatewayDomain
7
- } from "./chunk-3KWQYGYI.js";
8
+ } from "./chunk-TKHSULJT.js";
8
9
  import {
9
10
  printError,
10
11
  withOutputMetadata
11
- } from "./chunk-BYYS3ANB.js";
12
+ } from "./chunk-KEWVSO64.js";
12
13
  import {
13
14
  CapabilityGatewayError,
14
15
  buildCapabilityGatewayUrl,
15
16
  fetchCapabilityGateway,
16
17
  requestCapabilityGateway,
17
18
  requestCapabilityGatewayWithEnvelope
18
- } from "./chunk-ZQ47LWTI.js";
19
- import "./chunk-SERWF6G5.js";
20
- import "./chunk-J2DEBMRF.js";
21
- import "./chunk-ZQKDZXDO.js";
22
- import "./chunk-3FY3RJ26.js";
19
+ } from "./chunk-GJXRF7Y6.js";
20
+ import "./chunk-Y74WTIKJ.js";
21
+ import "./chunk-RWXIXOZG.js";
22
+ import "./chunk-O6K2ODUE.js";
23
+ import "./chunk-KZ6ZHF5J.js";
23
24
  import {
24
25
  CliValidationError
25
- } from "./chunk-UW5UN47B.js";
26
- import "./chunk-JHENBQ5B.js";
26
+ } from "./chunk-533JK3YX.js";
27
+ import "./chunk-FR2EDAQM.js";
27
28
 
28
29
  // src/commands/te-engage/shared.ts
29
30
  function createEngageCapabilityCommand(cliService, config) {
@@ -323,6 +324,9 @@ function validateSemanticMetricDefinition(value, path) {
323
324
  function validateEmbeddedSemanticDefinitions(value, path) {
324
325
  walk(value, path);
325
326
  }
327
+ function validateFlowAbIndicatorDefinitions(value, path) {
328
+ walkFlowAbIndicators(value, path);
329
+ }
326
330
  function validateTaskTriggerPeriodDefinition(value, path) {
327
331
  const request = object(value, path);
328
332
  if (!isObject(request.triggerConfig)) return;
@@ -335,6 +339,20 @@ function validateTaskTriggerPeriodDefinition(value, path) {
335
339
  required(primaryRule.periodTimeSymbol, symbolPath);
336
340
  enumValue(primaryRule.periodTimeSymbol, TASK_TRIGGER_PERIOD_SYMBOLS, symbolPath);
337
341
  }
342
+ function validateTaskAudienceChannelCompatibility(value, path) {
343
+ const request = object(value, path);
344
+ if (!isObject(request.channelConfig) || !isObject(request.targetConfig)) return;
345
+ const channelType = request.channelConfig.channelType;
346
+ const targetClusterType = request.targetConfig.targetClusterType;
347
+ if (typeof channelType !== "number" || typeof targetClusterType !== "number") return;
348
+ const clientSide = channelType === 3;
349
+ if (clientSide && targetClusterType === 2) {
350
+ invalid(`${path}.targetConfig.targetClusterType=2 (existing cluster) is not supported for client-side delivery; use 1 or 3.`);
351
+ }
352
+ if (!clientSide && targetClusterType === 3) {
353
+ invalid(`${path}.targetConfig.targetClusterType=3 (all users) is not supported for server-side delivery; use 1 or 2.`);
354
+ }
355
+ }
338
356
  function walk(value, path) {
339
357
  if (Array.isArray(value)) {
340
358
  value.forEach((item, index) => walk(item, `${path}[${index}]`));
@@ -357,6 +375,60 @@ function walk(value, path) {
357
375
  }
358
376
  }
359
377
  }
378
+ function walkFlowAbIndicators(value, path) {
379
+ if (Array.isArray(value)) {
380
+ value.forEach((item, index) => walkFlowAbIndicators(item, `${path}[${index}]`));
381
+ return;
382
+ }
383
+ if (!isObject(value)) return;
384
+ if (value.indicatorsDef !== void 0 && value.indicatorsDef !== null) {
385
+ array(value.indicatorsDef, `${path}.indicatorsDef`).forEach((item, index) => {
386
+ const indicatorPath = `${path}.indicatorsDef[${index}]`;
387
+ const indicator = object(item, indicatorPath);
388
+ const hasDefinition = indicator.eventDefinition !== void 0 && indicator.eventDefinition !== null;
389
+ const hasLegacyEvent = indicator.event !== void 0 && indicator.event !== null;
390
+ if (hasDefinition && hasLegacyEvent) {
391
+ invalid(`${indicatorPath} cannot contain both event and eventDefinition.`);
392
+ }
393
+ if (!hasDefinition && !hasLegacyEvent) {
394
+ invalid(`${indicatorPath} must contain eventDefinition or legacy event.`);
395
+ }
396
+ if (hasDefinition) validateFlowAbIndicatorEvent(indicator.eventDefinition, `${indicatorPath}.eventDefinition`);
397
+ });
398
+ }
399
+ for (const [key, item] of Object.entries(value)) {
400
+ const itemPath = `${path}.${key}`;
401
+ if (key === "config" && typeof item === "string") {
402
+ try {
403
+ walkFlowAbIndicators(JSON.parse(item), itemPath);
404
+ } catch (error) {
405
+ if (error instanceof SyntaxError) invalid(`${itemPath} must contain valid JSON.`);
406
+ throw error;
407
+ }
408
+ } else {
409
+ walkFlowAbIndicators(item, itemPath);
410
+ }
411
+ }
412
+ }
413
+ function validateFlowAbIndicatorEvent(value, path) {
414
+ validateSemanticEventDefinition(value, path);
415
+ const event = object(value, path);
416
+ enumValue(event.aggregation, AUDIENCE_AGGREGATIONS, `${path}.aggregation`);
417
+ enumValue(event.operator, /* @__PURE__ */ new Set(["eq", "neq", "lt", "lte", "gt", "gte"]), `${path}.operator`);
418
+ required(event.value, `${path}.value`);
419
+ optionalNumber(event.value, `${path}.value`);
420
+ if (["sum", "avg", "max", "min", "distinct_count"].includes(String(event.aggregation))) {
421
+ nonBlankString(event.property, `${path}.property`);
422
+ }
423
+ if (isObject(event.filters)) {
424
+ array(event.filters.items, `${path}.filters.items`, 1).forEach((filterValue, index) => {
425
+ const filter = object(filterValue, `${path}.filters.items[${index}]`);
426
+ if (!["exists", "not_exists", "is_true", "is_false"].includes(String(filter.operator))) {
427
+ array(filter.values, `${path}.filters.items[${index}].values`, 1);
428
+ }
429
+ });
430
+ }
431
+ }
360
432
  function validateTriggerDefinition(value, path) {
361
433
  const definition = object(value, path);
362
434
  rejectUnknown(definition, ["rules"], path);
@@ -608,6 +680,7 @@ function readRequest(ctx) {
608
680
  throw new Error("Flag --req.sourceFlowUuid is unsupported; get the source flow and build nodes/edges instead");
609
681
  }
610
682
  validateEmbeddedSemanticDefinitions(req, "--req");
683
+ validateFlowAbIndicatorDefinitions(req, "--req");
611
684
  return req;
612
685
  }
613
686
  var flowSave = createEngageFlowCapabilityCommand({
@@ -4609,6 +4682,7 @@ var taskSave = createEngageTaskCapabilityCommand({
4609
4682
  validate: (ctx) => {
4610
4683
  const req = readRequiredJsonObject(ctx, "req");
4611
4684
  validateEmbeddedSemanticDefinitions(req, "--req");
4685
+ validateTaskAudienceChannelCompatibility(req, "--req");
4612
4686
  validateTaskTriggerPeriodDefinition(req, "--req");
4613
4687
  },
4614
4688
  buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredJsonObject(ctx, "req") })
@@ -1,17 +1,18 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
1
2
  import {
2
3
  createCapabilityCommand
3
- } from "./chunk-JRJY5DMJ.js";
4
+ } from "./chunk-DKEXH6Q5.js";
4
5
  import {
5
6
  registerCapabilityGatewayRoute
6
- } from "./chunk-3KWQYGYI.js";
7
- import "./chunk-BYYS3ANB.js";
8
- import "./chunk-OMPRXM3V.js";
9
- import "./chunk-6EIJSNBD.js";
10
- import "./chunk-J2DEBMRF.js";
11
- import "./chunk-ZQKDZXDO.js";
12
- import "./chunk-3FY3RJ26.js";
13
- import "./chunk-UW5UN47B.js";
14
- import "./chunk-JHENBQ5B.js";
7
+ } from "./chunk-TKHSULJT.js";
8
+ import "./chunk-KEWVSO64.js";
9
+ import "./chunk-GJXRF7Y6.js";
10
+ import "./chunk-Y74WTIKJ.js";
11
+ import "./chunk-RWXIXOZG.js";
12
+ import "./chunk-O6K2ODUE.js";
13
+ import "./chunk-KZ6ZHF5J.js";
14
+ import "./chunk-533JK3YX.js";
15
+ import "./chunk-FR2EDAQM.js";
15
16
 
16
17
  // src/commands/te-experiment/capability-shared.ts
17
18
  function createExperimentCapabilityCommand(config) {
@@ -650,6 +651,78 @@ var metricList = createExperimentCapabilityCommand({
650
651
  });
651
652
 
652
653
  // src/commands/te-experiment/metric/save.ts
654
+ var aggregations = /* @__PURE__ */ new Set([
655
+ "total_count",
656
+ "user_count",
657
+ "active_days",
658
+ "sum",
659
+ "avg",
660
+ "max",
661
+ "distinct_count"
662
+ ]);
663
+ var propertyAggregations = /* @__PURE__ */ new Set(["sum", "avg", "max", "distinct_count"]);
664
+ var metricDefinitionFields = /* @__PURE__ */ new Set([
665
+ "type",
666
+ "event",
667
+ "aggregation",
668
+ "property",
669
+ "filters"
670
+ ]);
671
+ function validateMetricFilters(rawFilters) {
672
+ if (rawFilters === void 0) return;
673
+ if (!rawFilters || typeof rawFilters !== "object" || Array.isArray(rawFilters)) {
674
+ throw new Error("Flag --req.metricDefinition.filters must be a JSON object");
675
+ }
676
+ const filters = rawFilters;
677
+ if (!["and", "or"].includes(String(filters.relation))) {
678
+ throw new Error("Flag --req.metricDefinition.filters.relation must be one of: and, or");
679
+ }
680
+ if (!Array.isArray(filters.items) || filters.items.length === 0) {
681
+ throw new Error("Flag --req.metricDefinition.filters.items must be a non-empty array");
682
+ }
683
+ filters.items.forEach((rawItem, index) => {
684
+ const path = `Flag --req.metricDefinition.filters.items[${index}]`;
685
+ if (!rawItem || typeof rawItem !== "object" || Array.isArray(rawItem)) {
686
+ throw new Error(`${path} must be a JSON object`);
687
+ }
688
+ const item = rawItem;
689
+ const field = item.field;
690
+ const validField = typeof field === "string" && field.trim() !== "" || Boolean(field && typeof field === "object" && !Array.isArray(field) && typeof field.name === "string" && String(field.name).trim() !== "");
691
+ if (!validField) throw new Error(`${path}.field is required`);
692
+ if (typeof item.operator !== "string" || item.operator.trim() === "") {
693
+ throw new Error(`${path}.operator is required and expresses the property comparison`);
694
+ }
695
+ if (!Array.isArray(item.values)) {
696
+ throw new Error(`${path}.values must be an array containing the comparison value(s)`);
697
+ }
698
+ });
699
+ }
700
+ function validateMetricSaveRequest(req) {
701
+ const rawDefinition = req.metricDefinition;
702
+ if (rawDefinition === void 0 && req.update === true) return;
703
+ if (!rawDefinition || typeof rawDefinition !== "object" || Array.isArray(rawDefinition)) {
704
+ throw new Error("Flag --req.metricDefinition must be a JSON object");
705
+ }
706
+ const definition = rawDefinition;
707
+ for (const field of Object.keys(definition)) {
708
+ if (!metricDefinitionFields.has(field)) {
709
+ throw new Error(`Flag --req.metricDefinition.${field} is not supported`);
710
+ }
711
+ }
712
+ if (definition.type !== "event") {
713
+ throw new Error("Flag --req.metricDefinition.type must be event");
714
+ }
715
+ if (typeof definition.event !== "string" || definition.event.trim() === "") {
716
+ throw new Error("Flag --req.metricDefinition.event is required");
717
+ }
718
+ if (typeof definition.aggregation !== "string" || !aggregations.has(definition.aggregation)) {
719
+ throw new Error(`Flag --req.metricDefinition.aggregation must be one of: ${[...aggregations].join(", ")}`);
720
+ }
721
+ if (propertyAggregations.has(definition.aggregation) && (typeof definition.property !== "string" || definition.property.trim() === "")) {
722
+ throw new Error(`Flag --req.metricDefinition.property is required for ${definition.aggregation}`);
723
+ }
724
+ validateMetricFilters(definition.filters);
725
+ }
653
726
  var metricSave = createExperimentCapabilityCommand({
654
727
  resource: "metric",
655
728
  command: "save",
@@ -661,12 +734,12 @@ var metricSave = createExperimentCapabilityCommand({
661
734
  name: "req",
662
735
  type: "json",
663
736
  required: true,
664
- desc: "Native camelCase request; use metricDefinition, never metricConfig or calcType."
737
+ desc: "Native camelCase request. Property comparisons use metricDefinition.filters={relation,items:[{field,operator,values}]}. Never use metricConfig, calcType, or raw filts."
665
738
  }
666
739
  ],
667
740
  risk: "write",
668
741
  validate: (ctx) => {
669
- readRequiredObject(ctx, "req");
742
+ validateMetricSaveRequest(readRequiredObject(ctx, "req"));
670
743
  },
671
744
  buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
672
745
  });