@thinkingai/ae-cli 6.0.48 → 6.1.0-project-role-upsert.1

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 (82) hide show
  1. package/README.md +4 -1
  2. package/README.zh.md +4 -1
  3. package/dist/{capability-J4FU4JZW.js → capability-AXFQW5WM.js} +13 -10
  4. package/dist/{chunk-6KBBAPPP.js → chunk-JDPEVVHR.js} +4 -3
  5. package/dist/index.js +23 -13
  6. package/dist/{metadata-3J5ZAVMF.js → metadata-SOALPEA7.js} +3 -3
  7. package/dist/{personal-semantic-preference-32AAJ37M.js → personal-semantic-preference-LOF33N5X.js} +2 -2
  8. package/dist/project-semantic-RV6NA5LN.js +1113 -0
  9. package/dist/{te-analysis-WHYXHRJD.js → te-analysis-TV2YZ4IC.js} +23 -7
  10. package/dist/{te-engage-DHKNJ5BO.js → te-engage-EUVMTUDJ.js} +63 -5
  11. package/dist/te-experiment-ESEYE2SK.js +1059 -0
  12. package/package.json +2 -1
  13. package/skills/ae-analysis/SKILL.md +17 -1
  14. package/skills/ae-analysis/references/command_index.md +1 -1
  15. package/skills/ae-analysis/references/personal_semantic_preference_add.md +1 -1
  16. package/skills/ae-analysis/references/personal_semantic_preference_get.md +3 -1
  17. package/skills/ae-analysis/references/personal_semantic_preference_list.md +3 -1
  18. package/skills/ae-analysis/references/personal_semantic_preference_update.md +1 -1
  19. package/skills/ae-analysis/references/project_role_upsert.md +32 -2
  20. package/skills/ae-engage/SKILL.md +2 -0
  21. package/skills/ae-engage/references/save-flow.md +37 -1
  22. package/skills/ae-experiment/SKILL.md +117 -0
  23. package/skills/ae-experiment/references/batch_delete_experiment.md +11 -0
  24. package/skills/ae-experiment/references/batch_delete_feature.md +11 -0
  25. package/skills/ae-experiment/references/batch_delete_traffic_layer.md +11 -0
  26. package/skills/ae-experiment/references/cancel_experiment_query_by_request_id.md +11 -0
  27. package/skills/ae-experiment/references/check_experiment_ready.md +17 -0
  28. package/skills/ae-experiment/references/check_experiment_traffic_layer_conflict.md +37 -0
  29. package/skills/ae-experiment/references/delete_metric.md +13 -0
  30. package/skills/ae-experiment/references/manage_experiment.md +17 -0
  31. package/skills/ae-experiment/references/manage_feature_status.md +11 -0
  32. package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
  33. package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
  34. package/skills/ae-experiment/references/query_bucket_list.md +12 -0
  35. package/skills/ae-experiment/references/query_experiment_detail.md +19 -0
  36. package/skills/ae-experiment/references/query_experiment_list.md +22 -0
  37. package/skills/ae-experiment/references/query_experiment_list_archived.md +18 -0
  38. package/skills/ae-experiment/references/query_experiment_metric_trend.md +12 -0
  39. package/skills/ae-experiment/references/query_experiment_operation_log.md +17 -0
  40. package/skills/ae-experiment/references/query_experiment_report_summary.md +12 -0
  41. package/skills/ae-experiment/references/query_experiment_sample_size_report.md +13 -0
  42. package/skills/ae-experiment/references/query_feature_detail.md +14 -0
  43. package/skills/ae-experiment/references/query_feature_list.md +12 -0
  44. package/skills/ae-experiment/references/query_feature_operation_log.md +19 -0
  45. package/skills/ae-experiment/references/query_feature_version_list.md +20 -0
  46. package/skills/ae-experiment/references/query_metric_detail.md +18 -0
  47. package/skills/ae-experiment/references/query_metric_list.md +15 -0
  48. package/skills/ae-experiment/references/query_traffic_layer_detail.md +13 -0
  49. package/skills/ae-experiment/references/query_traffic_layer_list.md +12 -0
  50. package/skills/ae-experiment/references/save_build_guide.md +39 -0
  51. package/skills/ae-experiment/references/save_experiment.md +210 -0
  52. package/skills/ae-experiment/references/save_feature.md +13 -0
  53. package/skills/ae-experiment/references/save_metric.md +91 -0
  54. package/skills/ae-experiment/references/save_submit_experiment.md +16 -0
  55. package/skills/ae-experiment/references/save_traffic_layer.md +13 -0
  56. package/skills/ae-experiment/references/save_validate.md +33 -0
  57. package/skills/ae-experiment/references/update_experiment_group.md +20 -0
  58. package/skills/ae-experiment-design/SKILL.md +149 -0
  59. package/skills/ae-experiment-design/agents/openai.yaml +4 -0
  60. package/skills/ae-experiment-design/references/client-experiment-sdk.md +147 -0
  61. package/skills/ae-experiment-design/references/experiment-creation.md +108 -0
  62. package/skills/ae-experiment-design/references/experiment-sdk-contract.md +100 -0
  63. package/skills/ae-experiment-design/references/exposure-contract.md +91 -0
  64. package/skills/ae-experiment-design/references/hybrid-experiment-sdk.md +74 -0
  65. package/skills/ae-experiment-design/references/metric-readiness.md +143 -0
  66. package/skills/ae-experiment-design/references/platform-operations.md +105 -0
  67. package/skills/ae-experiment-design/references/sdk-index.md +76 -0
  68. package/skills/ae-experiment-design/references/sdk-integration.md +114 -0
  69. package/skills/ae-experiment-design/references/sdk-troubleshooting.md +139 -0
  70. package/skills/ae-experiment-design/references/server-experiment-sdk.md +78 -0
  71. package/skills/ae-experiment-design/scripts/calculate_experiment_plan.py +450 -0
  72. package/skills/ae-experiment-insight/SKILL.md +149 -0
  73. package/skills/ae-experiment-insight/agents/openai.yaml +4 -0
  74. package/skills/ae-experiment-insight/references/decision-framework.md +69 -0
  75. package/skills/ae-experiment-insight/references/diagnostic-playbook.md +225 -0
  76. package/skills/ae-experiment-insight/references/platform-operations.md +82 -0
  77. package/skills/ae-experiment-insight/scripts/analyze_experiment.py +478 -0
  78. package/skills/ae-project-semantic/SKILL.md +193 -0
  79. package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
  80. package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
  81. package/dist/{chunk-HPLNYQPM.js → chunk-RSG4ONOI.js} +3 -3
  82. package/dist/{sync-2GTAKZYX.js → sync-YV3E66IF.js} +3 -3
@@ -7,14 +7,10 @@ import {
7
7
  waitForAnalysisRun,
8
8
  withAsyncArtifactLifecycle,
9
9
  withInterruptSignal
10
- } from "./chunk-HPLNYQPM.js";
10
+ } from "./chunk-RSG4ONOI.js";
11
11
  import {
12
12
  createCapabilityCommand
13
- } from "./chunk-6KBBAPPP.js";
14
- import {
15
- registerCapabilityGatewayRoute,
16
- resolveGatewayDomain
17
- } from "./chunk-TKHSULJT.js";
13
+ } from "./chunk-JDPEVVHR.js";
18
14
  import {
19
15
  CapabilityGatewayError,
20
16
  buildCapabilityGatewayUrl,
@@ -26,6 +22,10 @@ import {
26
22
  uploadInputFile,
27
23
  validateCapability
28
24
  } from "./chunk-QJQZH5GQ.js";
25
+ import {
26
+ registerCapabilityGatewayRoute,
27
+ resolveGatewayDomain
28
+ } from "./chunk-TKHSULJT.js";
29
29
  import {
30
30
  withOutputMetadata
31
31
  } from "./chunk-CZU3V3DQ.js";
@@ -6845,14 +6845,30 @@ var projectRoleList = createAnalysisCapabilityCommand({
6845
6845
  });
6846
6846
 
6847
6847
  // src/commands/te-analysis/project/role/upsert.ts
6848
+ var ROLE_UPSERT_HELP = [
6849
+ "Payload contract:",
6850
+ "- role_func_list is a non-empty array of objects. Each object requires a non-empty function_name and has_power set to integer 0 or 1.",
6851
+ "- Resolve valid function_name values with ae-cli project function list before saving the role.",
6852
+ "- role_desc is required when creating a role and must contain 1 to 80 characters. It may be omitted when updating an existing role.",
6853
+ "- Omit role_name to create a role. Pass the existing role_name to update that role.",
6854
+ "- Functions omitted from role_func_list are preserved by the service as unselected permissions with has_power=0.",
6855
+ "Example create payload:",
6856
+ '{"role_desc":"Data analyst","role_func_list":[{"function_name":"viewReport","has_power":1}]}',
6857
+ "Example update payload:",
6858
+ '{"role_name":"custom_role","role_func_list":[{"function_name":"viewReport","has_power":1}]}'
6859
+ ].join("\n");
6848
6860
  var projectRoleUpsert = createAnalysisCapabilityCommand({
6849
6861
  resource: "project role",
6850
6862
  command: "upsert",
6851
6863
  capabilityId: "project.role.upsert",
6852
6864
  description: "Create or update a project role.",
6865
+ helpText: ROLE_UPSERT_HELP,
6853
6866
  flags: [
6854
6867
  projectIdFlag,
6855
- requiredPayloadFlag
6868
+ {
6869
+ ...requiredPayloadFlag,
6870
+ desc: "Role payload with role_func_list object items containing function_name and has_power (0 or 1)."
6871
+ }
6856
6872
  ],
6857
6873
  risk: "write",
6858
6874
  buildInput: (ctx) => compactInput({
@@ -1,11 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createCapabilityCommand
4
- } from "./chunk-6KBBAPPP.js";
5
- import {
6
- registerCapabilityGatewayRoute,
7
- resolveGatewayDomain
8
- } from "./chunk-TKHSULJT.js";
4
+ } from "./chunk-JDPEVVHR.js";
9
5
  import {
10
6
  CapabilityGatewayError,
11
7
  buildCapabilityGatewayUrl,
@@ -13,6 +9,10 @@ import {
13
9
  requestCapabilityGateway,
14
10
  requestCapabilityGatewayWithEnvelope
15
11
  } from "./chunk-QJQZH5GQ.js";
12
+ import {
13
+ registerCapabilityGatewayRoute,
14
+ resolveGatewayDomain
15
+ } from "./chunk-TKHSULJT.js";
16
16
  import {
17
17
  printError,
18
18
  withOutputMetadata
@@ -322,6 +322,9 @@ function validateSemanticMetricDefinition(value, path) {
322
322
  function validateEmbeddedSemanticDefinitions(value, path) {
323
323
  walk(value, path);
324
324
  }
325
+ function validateFlowAbIndicatorDefinitions(value, path) {
326
+ walkFlowAbIndicators(value, path);
327
+ }
325
328
  function validateTaskTriggerPeriodDefinition(value, path) {
326
329
  const request = object(value, path);
327
330
  if (!isObject(request.triggerConfig)) return;
@@ -370,6 +373,60 @@ function walk(value, path) {
370
373
  }
371
374
  }
372
375
  }
376
+ function walkFlowAbIndicators(value, path) {
377
+ if (Array.isArray(value)) {
378
+ value.forEach((item, index) => walkFlowAbIndicators(item, `${path}[${index}]`));
379
+ return;
380
+ }
381
+ if (!isObject(value)) return;
382
+ if (value.indicatorsDef !== void 0 && value.indicatorsDef !== null) {
383
+ array(value.indicatorsDef, `${path}.indicatorsDef`).forEach((item, index) => {
384
+ const indicatorPath = `${path}.indicatorsDef[${index}]`;
385
+ const indicator = object(item, indicatorPath);
386
+ const hasDefinition = indicator.eventDefinition !== void 0 && indicator.eventDefinition !== null;
387
+ const hasLegacyEvent = indicator.event !== void 0 && indicator.event !== null;
388
+ if (hasDefinition && hasLegacyEvent) {
389
+ invalid(`${indicatorPath} cannot contain both event and eventDefinition.`);
390
+ }
391
+ if (!hasDefinition && !hasLegacyEvent) {
392
+ invalid(`${indicatorPath} must contain eventDefinition or legacy event.`);
393
+ }
394
+ if (hasDefinition) validateFlowAbIndicatorEvent(indicator.eventDefinition, `${indicatorPath}.eventDefinition`);
395
+ });
396
+ }
397
+ for (const [key, item] of Object.entries(value)) {
398
+ const itemPath = `${path}.${key}`;
399
+ if (key === "config" && typeof item === "string") {
400
+ try {
401
+ walkFlowAbIndicators(JSON.parse(item), itemPath);
402
+ } catch (error) {
403
+ if (error instanceof SyntaxError) invalid(`${itemPath} must contain valid JSON.`);
404
+ throw error;
405
+ }
406
+ } else {
407
+ walkFlowAbIndicators(item, itemPath);
408
+ }
409
+ }
410
+ }
411
+ function validateFlowAbIndicatorEvent(value, path) {
412
+ validateSemanticEventDefinition(value, path);
413
+ const event = object(value, path);
414
+ enumValue(event.aggregation, AUDIENCE_AGGREGATIONS, `${path}.aggregation`);
415
+ enumValue(event.operator, /* @__PURE__ */ new Set(["eq", "neq", "lt", "lte", "gt", "gte"]), `${path}.operator`);
416
+ required(event.value, `${path}.value`);
417
+ optionalNumber(event.value, `${path}.value`);
418
+ if (["sum", "avg", "max", "min", "distinct_count"].includes(String(event.aggregation))) {
419
+ nonBlankString(event.property, `${path}.property`);
420
+ }
421
+ if (isObject(event.filters)) {
422
+ array(event.filters.items, `${path}.filters.items`, 1).forEach((filterValue, index) => {
423
+ const filter = object(filterValue, `${path}.filters.items[${index}]`);
424
+ if (!["exists", "not_exists", "is_true", "is_false"].includes(String(filter.operator))) {
425
+ array(filter.values, `${path}.filters.items[${index}].values`, 1);
426
+ }
427
+ });
428
+ }
429
+ }
373
430
  function validateTriggerDefinition(value, path) {
374
431
  const definition = object(value, path);
375
432
  rejectUnknown(definition, ["rules"], path);
@@ -621,6 +678,7 @@ function readRequest(ctx) {
621
678
  throw new Error("Flag --req.sourceFlowUuid is unsupported; get the source flow and build nodes/edges instead");
622
679
  }
623
680
  validateEmbeddedSemanticDefinitions(req, "--req");
681
+ validateFlowAbIndicatorDefinitions(req, "--req");
624
682
  return req;
625
683
  }
626
684
  var flowSave = createEngageFlowCapabilityCommand({