@thinkingai/ae-cli 6.1.30 → 6.1.32
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.
- package/README.md +11 -5
- package/README.zh.md +11 -5
- package/bin/ai-monitor.js +2 -0
- package/dist/ai-monitor-MKMHSSNI.js +32 -0
- package/dist/ai-monitor.js +135 -0
- package/dist/{auth-ADZHUIJR.js → auth-CZHHPZOQ.js} +10 -9
- package/dist/{automation-FD2QZUP6.js → automation-FLCPFMN4.js} +4 -4
- package/dist/{capability-QXFRJYZD.js → capability-64KVJFIA.js} +27 -31
- package/dist/{chunk-YULUBP3R.js → chunk-3ULDJJTZ.js} +1 -1
- package/dist/{chunk-HRUOV6EQ.js → chunk-4XKTRCRK.js} +15 -15
- package/dist/{chunk-JSBLCLFE.js → chunk-5M5LBRR3.js} +1 -1
- package/dist/chunk-6M7ZEDT2.js +182 -0
- package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
- package/dist/chunk-BNBCMCYN.js +563 -0
- package/dist/chunk-CF6JTT2U.js +64 -0
- package/dist/{chunk-CG773QXN.js → chunk-DWBYNGSR.js} +564 -314
- package/dist/{chunk-VDICGXCY.js → chunk-F2VFZUGG.js} +2 -2
- package/dist/{chunk-TFORY6WY.js → chunk-FCAA7I2D.js} +2 -2
- package/dist/{chunk-SOSFRU3O.js → chunk-HTZ2MLYA.js} +47 -21
- package/dist/{chunk-AWVZTN2B.js → chunk-HVMCPKOZ.js} +1 -1
- package/dist/chunk-IDDWEZ7F.js +1285 -0
- package/dist/{chunk-E25OSZLJ.js → chunk-KTJXD27G.js} +2 -2
- package/dist/{chunk-AVXDJAFC.js → chunk-NLEXY2TM.js} +47 -12
- package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
- package/dist/{chunk-EUFP4M2A.js → chunk-T7WF4HYW.js} +84 -32
- package/dist/{chunk-Y3AM6LIO.js → chunk-TMQGS4TO.js} +15 -10
- package/dist/{compat-check-HERBTQZN.js → compat-check-ZJNCMNQV.js} +2 -2
- package/dist/{config-E3KANXMK.js → config-FSH2NMNZ.js} +25 -12
- package/dist/{context-CDB5H5PD.js → context-YAQG6YQC.js} +2 -2
- package/dist/{evaluation-LR4YDYWL.js → evaluation-2JSF4V47.js} +13 -158
- package/dist/index.js +81 -583
- package/dist/{memory-SNFR5M23.js → memory-VEZZVAAP.js} +4 -4
- package/dist/{metadata-EXQYDZTH.js → metadata-3IWHX3V4.js} +7 -7
- package/dist/{model-KEVCEXWD.js → model-T7H7Q6BG.js} +2 -2
- package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-YITU23SA.js} +6 -6
- package/dist/{project-semantic-UHRMVOJF.js → project-semantic-MHEXJF3C.js} +15 -13
- package/dist/{sync-XKEBXESC.js → sync-AQHVCSPI.js} +4 -4
- package/dist/{te-agent-S6UQR4IE.js → te-agent-RXI7WOH4.js} +5 -5
- package/dist/{te-analysis-WOFFCIBC.js → te-analysis-CZY74HVF.js} +380 -191
- package/dist/{te-community-R7B6QYOO.js → te-community-DKCYUBCM.js} +6 -6
- package/dist/{te-dataops-KPILYVHA.js → te-dataops-QEH6VE56.js} +3 -3
- package/dist/{te-engage-IAUM6ONX.js → te-engage-WK7WKDKF.js} +6 -6
- package/dist/{te-experiment-TMLRA7B3.js → te-experiment-LH3RPIOE.js} +274 -29
- package/dist/{te-kb-GKWPSLSY.js → te-kb-UPORIOVN.js} +16 -7
- package/dist/{te-system-CYWSK3UN.js → te-system-AL4B4XZL.js} +2 -2
- package/dist/{te-team-ISN52YNG.js → te-team-LLVTO2G4.js} +5 -5
- package/dist/{things-DDQ52Z3Q.js → things-XLMLBYQR.js} +5 -5
- package/dist/{update-CTLNTX35.js → update-7J5UQHSK.js} +3 -3
- package/dist/{workspace-2CKQX2XL.js → workspace-FF2HXJGR.js} +4 -4
- package/package.json +9 -7
- package/skills/ae-ai-monitor/SKILL.md +179 -0
- package/skills/ae-ai-monitor/references/read-commands.md +866 -0
- package/skills/ae-analysis/SKILL.md +10 -4
- package/skills/ae-analysis/references/adhoc_export.md +3 -1
- package/skills/ae-analysis/references/ai_models/path.md +5 -6
- package/skills/ae-analysis/references/ai_models.md +1 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
- package/skills/ae-analysis/references/asset_search.md +1 -1
- package/skills/ae-analysis/references/bad_case_begin.md +12 -0
- package/skills/ae-analysis/references/bad_case_get.md +12 -0
- package/skills/ae-analysis/references/bad_case_history.md +12 -0
- package/skills/ae-analysis/references/bad_case_list.md +12 -0
- package/skills/ae-analysis/references/bad_case_review.md +51 -0
- package/skills/ae-analysis/references/bad_case_run.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
- package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
- package/skills/ae-analysis/references/bi_panel_list.md +1 -1
- package/skills/ae-analysis/references/bi_panel_share.md +3 -1
- package/skills/ae-analysis/references/catalog_list.md +2 -0
- package/skills/ae-analysis/references/command_index.md +38 -29
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
- package/skills/ae-analysis/references/dashboard_handover.md +3 -1
- package/skills/ae-analysis/references/dashboard_list.md +3 -3
- package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
- package/skills/ae-analysis/references/dashboard_share.md +3 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -2
- package/skills/ae-analysis/references/filter_value_list.md +2 -0
- package/skills/ae-analysis/references/folder_share.md +8 -2
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
- package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
- package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
- package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
- package/skills/ae-analysis/references/project_member_add.md +3 -1
- package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
- package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
- package/skills/ae-analysis/references/project_member_update.md +3 -1
- package/skills/ae-analysis/references/project_owner_update.md +3 -1
- package/skills/ae-analysis/references/project_role_upsert.md +5 -3
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
- package/skills/ae-analysis/references/project_space_share.md +8 -2
- package/skills/ae-analysis/references/property_get.md +2 -0
- package/skills/ae-analysis/references/public_link_list.md +3 -1
- package/skills/ae-analysis/references/query_cancel.md +4 -1
- package/skills/ae-analysis/references/report_data_run.md +1 -1
- package/skills/ae-analysis/references/report_list.md +3 -3
- package/skills/ae-analysis/references/scenario_append.md +2 -2
- package/skills/ae-analysis/references/scenario_collect.md +15 -4
- package/skills/ae-analysis/references/scenario_list.md +2 -1
- package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
- package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
- package/skills/ae-analysis/references/user_tag_create.md +4 -1
- package/skills/ae-analysis/references/user_tag_get.md +2 -0
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-analysis/references/user_tag_update.md +5 -2
- package/skills/ae-analysis/references/virtual_property_create.md +12 -1
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
- package/skills/ae-automation/SKILL.md +4 -2
- package/skills/ae-capability/SKILL.md +9 -5
- package/skills/ae-community/SKILL.md +1 -0
- package/skills/ae-dataops/SKILL.md +1 -0
- package/skills/ae-engage/SKILL.md +1 -0
- package/skills/ae-evaluation/SKILL.md +17 -2
- package/skills/ae-experiment/SKILL.md +38 -11
- package/skills/ae-experiment/references/experiment_approval.md +171 -0
- package/skills/ae-experiment/references/manage_experiment.md +11 -2
- package/skills/ae-experiment/references/save_experiment.md +28 -8
- package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
- package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
- package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
- package/skills/ae-kb/SKILL.md +5 -3
- package/skills/ae-kb/references/analysis-workflow.md +11 -2
- package/skills/ae-kb/references/query-workflow.md +3 -1
- package/skills/ae-kb/references/versions.md +1 -1
- package/skills/ae-metadata/SKILL.md +1 -0
- package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
- package/skills/ae-team/SKILL.md +1 -1
- package/skills/ae-tracking-matrix/SKILL.md +170 -0
- package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
- package/skills/ae-tracking-matrix/i18n.yaml +12 -0
- package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
- package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
- package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
- package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
- package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
- package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
- package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
- package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
- package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
- package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
- package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
- package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
- package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
- package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
- package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
- package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
- package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
- package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
- package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
- package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
- package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
- package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
- package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
- package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
- package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
- package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
- package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
- package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
- package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
- package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
- package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
- package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
- package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
- package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
- package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
- package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
- package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
- package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
- package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
- package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
- package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
- package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
- package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
- package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
- package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
- package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
- package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
- package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
- package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
- package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
- package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
- package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
- package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
- package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
- package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
- package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
- package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
- package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
- package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
- package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
- package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
- package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
- package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
- package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
- package/dist/chunk-AMBFK2K3.js +0 -28
|
@@ -62,10 +62,16 @@ From a fixed date through today:
|
|
|
62
62
|
|
|
63
63
|
## SQL tag
|
|
64
64
|
|
|
65
|
+
Before creating a SQL tag, identify who receives one tag value. Use `ae-cli project entity list --project-id <project_id>` to find that analysis entity in the target project. If its source field is unclear, inspect it with `project entity get`. Pass the resolved entity ID explicitly as `--entity-id`. When editing an existing SQL tag, read its entity with `analysis user-tag get` and keep that entity.
|
|
66
|
+
|
|
67
|
+
Trace the first column of the final SELECT through any aliases, CTEs and joins to the selected entity's identifier. Check that the final rows have that entity's grain. A compatible SQL type, a CAST or a matching alias does not establish identity. A reference tag can supply the calculation; reuse its entity only when the request targets the same subject.
|
|
68
|
+
|
|
69
|
+
For example, a reference SQL grouped by `#account_id` computes one value per account. For an account tag, select the project's account entity. For a user tag, return `#user_id` and compute one value per user using verified project fields or a verified account-to-user mapping. Renaming `#account_id` to `#user_id` still returns account IDs. If the intended entity is ambiguous, ask who should receive the tag. If the entity is clear but the mapping or the rule for combining accounts is unknown, ask for that missing information before issuing the write.
|
|
70
|
+
|
|
65
71
|
Return one row per distinct analysis-subject ID, with the tag value in the second column; a list tag requires a native SQL `ARRAY(varchar)` value, not a JSON string or repeated scalar rows. The server infers the tag type from that column, so do not add `selectType`; aggregate repeated subjects in the SQL itself, for example with `array_agg(DISTINCT CAST(value AS varchar))` and `GROUP BY` the subject ID.
|
|
66
72
|
|
|
67
73
|
```json
|
|
68
|
-
{"type":"sql","sql":"SELECT \"#user_id\", 'payer' AS tag_value FROM hive.ta.v_event_1 WHERE ${PartDate:partdate} AND \"$part_event\"='pay'","params":[{"name":"partdate","type":"part_date","recent_day":"1-7"}]}
|
|
74
|
+
{"type":"sql","sql":"SELECT DISTINCT \"#user_id\", 'payer' AS tag_value FROM hive.ta.v_event_1 WHERE ${PartDate:partdate} AND \"$part_event\"='pay'","params":[{"name":"partdate","type":"part_date","recent_day":"1-7"}]}
|
|
69
75
|
```
|
|
70
76
|
|
|
71
77
|
SQL tags support only `${PartDate:name}` dynamic placeholders. Every placeholder requires one `params` item with `type=part_date` and either `recent_day` or `start_time` plus `end_time`. `Text`, `Number`, `Variable`, `Time`, and `Selector` parameters are valid for general SQL analysis but are not valid for SQL tags.
|
|
@@ -74,7 +80,7 @@ For `recent_day`, `0-7` means 最近7天 and includes today; `1-7` means 过去7
|
|
|
74
80
|
`${base_date}` is a separate built-in computation-date macro, not a user-configurable dynamic placeholder. SQL tags may use `${base_date}`, a formatted value such as `${base_date:yyyy-MM-dd}`, or a server-supported offset such as `${base_date:yyyy-MM-dd-1*day}`. Keep the macro in `sql` and do not add it to `params`; it is expanded when the tag is calculated. Expansion produces plain text, so quote the macro when the SQL expression expects a string or date literal:
|
|
75
81
|
|
|
76
82
|
```json
|
|
77
|
-
{"type":"sql","sql":"SELECT \"#user_id\", 'payer' AS tag_value FROM hive.ta.v_event_1 WHERE \"$part_date\"='${base_date:yyyy-MM-dd}' AND \"$part_event\"='pay'"}
|
|
83
|
+
{"type":"sql","sql":"SELECT DISTINCT \"#user_id\", 'payer' AS tag_value FROM hive.ta.v_event_1 WHERE \"$part_date\"='${base_date:yyyy-MM-dd}' AND \"$part_event\"='pay'"}
|
|
78
84
|
```
|
|
79
85
|
|
|
80
86
|
Before writing a SQL tag, use `analysis sql-table list --project-id <project_id> --usage tag_cluster`, then call `analysis sql-table columns --project-id <project_id> --table-ref <table_ref> --usage tag_cluster`. The `tag_cluster` authorized table set is intentionally different from the general analysis SQL table set; do not reuse a table discovered with the default `usage=analysis`.
|
|
@@ -6,11 +6,11 @@ Do not use it for ID-file value replacement or to create a missing tag. A change
|
|
|
6
6
|
|
|
7
7
|
The response distinguishes both paths. An update that triggers recomputation returns `computation.triggered_automatically=true`, `result_freshness.is_stale=true`, and `next_action=poll_get` with an exact capability/input pair. An unchanged definition or display-name/remark-only update returns `computation.status=not_triggered`, `result_freshness.status=fresh`, and `next_action=none`.
|
|
8
8
|
|
|
9
|
-
Flags: `--project-id`, `--tag-name` required. Optional: `--display-name`, `--definition-request`, `--authenticated-only`, `--remark`, `--zone-offset`, `--enable-auto-refresh`, `--auto-refresh-schedule`, `--auto-refresh-cron`. The tag type comes from `definition_request.type` when the definition changes.
|
|
9
|
+
Flags: `--project-id`, `--tag-name` required. Optional: `--display-name`, `--definition-request`, `--authenticated-only`, `--remark`, `--zone-offset`, `--enable-auto-refresh`, `--enable-history-tag-backup`, `--auto-refresh-schedule`, `--auto-refresh-cron`. The tag type comes from `definition_request.type` when the definition changes.
|
|
10
10
|
|
|
11
11
|
`display_name` is at most 80 characters and `remark` is at most 400 characters. The CLI rejects violations before dispatch. `tag_name` is an existing exact identifier and cannot be renamed by update.
|
|
12
12
|
|
|
13
|
-
Read `user_tag_models.md` before changing the definition. The backend validates and compiles `definition_request` inside update and refuses to modify the tag if clarification is required.
|
|
13
|
+
Read `user_tag_models.md` before changing the definition. For SQL, check the replacement query against the existing tag's entity using the [SQL tag subject selection rules](user_tag_models.md#sql-tag). The backend validates and compiles `definition_request` inside update and refuses to modify the tag if clarification is required.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
ae-cli analysis user-tag update --project-id <project_id> --tag-name user_level --display-name "User Level v2"
|
|
@@ -29,3 +29,6 @@ ae-cli analysis user-tag update --project-id <project_id> --tag-name user_level
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Read `user-tag get` after updating to verify `enable_auto_refresh` (1=enabled, 0=disabled), `scheduler_ui_config`, and `cluster_zone_offset`. Schedule-only updates return `computation.status=not_triggered` and `next_action=none`.
|
|
32
|
+
|
|
33
|
+
Use `--enable-history-tag-backup true|false` to switch historical backups independently. Enabling requires periodic refresh already active or a schedule in the same update. Omitting the flag preserves the saved switch. A backup-only update keeps the schedule and does not start a calculation.
|
|
34
|
+
Read the tag with `user-tag get`: `enable_history_tag_backup=1` means enabled; the native read may omit the field or return null when disabled. Use `history-tag list` to check for a completed historical version after a scheduled refresh.
|
|
@@ -11,6 +11,7 @@ Command:
|
|
|
11
11
|
```bash
|
|
12
12
|
ae-cli analysis-meta virtual-property create --project-id <project_id> --property-name '#vp@demo' --table-type event --select-type string --sql-expression 'event_name' --sql-event-relation-type relation_default
|
|
13
13
|
ae-cli analysis-meta virtual-property create --project-id <project_id> --property-name '#vp@demo' --property-desc demo --table-type event --select-type string --sql-expression "CASE WHEN status = 1 THEN 'active' ELSE 'inactive' END" --sql-event-relation-type relation_by_setting --related-events '[{"eventName":"purchase"}]' --property-remark demo
|
|
14
|
+
ae-cli analysis-meta virtual-property create --project-id <project_id> --property-name '#vp@user_tier' --table-type user --select-type string --sql-expression 'ta_tag."vip_level"'
|
|
14
15
|
ae-cli analysis-meta virtual-property create --project-id <project_id> --sql-expression '<sql>' --v-prop '{"property":{"column_name":"#vp@demo","table_type":"event","select_type":"string"}}' --properties '[...]'
|
|
15
16
|
```
|
|
16
17
|
|
|
@@ -40,7 +41,7 @@ Output is a successful gateway envelope with no business data.
|
|
|
40
41
|
|
|
41
42
|
## Decision Rules
|
|
42
43
|
- `sql_expression` / `related_events` cannot be written from experience alone; they must be built from real project metadata.
|
|
43
|
-
-
|
|
44
|
+
- Start with `--project-id`, `--property-name`, `--table-type`, `--select-type`, and `--sql-expression`. Event relation flags apply only to event properties.
|
|
44
45
|
- If `--sql-event-relation-type=relation_by_setting`, `--related-events` must contain event names from `analysis-meta event list`.
|
|
45
46
|
- Columns starting with `#` or containing `@` should be double-quoted in Trino SQL.
|
|
46
47
|
- Use `--v-prop` only when an exact virtual property DTO is already available.
|
|
@@ -49,3 +50,13 @@ Output is a successful gateway envelope with no business data.
|
|
|
49
50
|
## Recommended Chain
|
|
50
51
|
- `analysis-meta property list` -> `analysis-meta virtual-property create`
|
|
51
52
|
- `analysis-meta property list` -> `analysis-meta event list` -> `analysis-meta virtual-property create` when using `relation_by_setting`
|
|
53
|
+
|
|
54
|
+
Both virtual **user** and **event** properties can reference a tag in SQL, for example `ta_tag."vip_level"`. Resolve the tag's resource key with `analysis-meta catalog list`. For a user property, choose a tag based on a user entity.
|
|
55
|
+
|
|
56
|
+
For an event property, pass each version override once:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
--tag-date-policies '[{"tag_name":"vip_level","cluster_date_policy":"AUTO"},{"tag_name":"tier","cluster_date_policy":"SPECIFIED","specified_cluster_date":"2026-10-09"}]'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
LATEST is the default. Only history-capable tags accept AUTO or SPECIFIED. Only SPECIFIED takes a date. For a local fixed date, choose from `analysis user-tag get --include-history-dates true`. For a cross-source tag, use the requested date.
|
|
@@ -28,3 +28,13 @@ Output is a successful gateway envelope with no business data.
|
|
|
28
28
|
| `--tag-date-policies` | No | Tag date policies JSON array. |
|
|
29
29
|
| `--replace-remark` | No | Replacement remark. |
|
|
30
30
|
| `--replace-suggestion` | No | Replacement suggestion. |
|
|
31
|
+
|
|
32
|
+
Both virtual **user** and **event** properties can reference a tag in SQL, for example `ta_tag."vip_level"`. Resolve the tag's resource key with `analysis-meta catalog list`. For a user property, choose a tag based on a user entity.
|
|
33
|
+
|
|
34
|
+
For an event property, pass each version override once:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
--tag-date-policies '[{"tag_name":"vip_level","cluster_date_policy":"AUTO"},{"tag_name":"tier","cluster_date_policy":"SPECIFIED","specified_cluster_date":"2026-10-09"}]'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
LATEST is the default. Only history-capable tags accept AUTO or SPECIFIED. Only SPECIFIED takes a date. For a local fixed date, choose from `analysis user-tag get --include-history-dates true`. For a cross-source tag, use the requested date. Read `analysis-meta property get` for the saved SQL and policies. Send changes for the tags you want to update. Set a referenced tag to LATEST explicitly to reset it. Other referenced tags retain their policy; removing a tag from the SQL removes its policy.
|
package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs
CHANGED
|
@@ -324,7 +324,12 @@ function validateSemanticPlan() {
|
|
|
324
324
|
if (!asArray(card.questions).map(clean).filter(Boolean).length || !clean(card.intent)) fail(`Recall card ${cardId} requires questions and intent.`);
|
|
325
325
|
assertAgentAuthoredRecallCard(card, domainId);
|
|
326
326
|
const preferred = asArray(card.preferred_asset_refs);
|
|
327
|
-
|
|
327
|
+
const routing = asObject(card.routing);
|
|
328
|
+
if (routing.contract_version !== undefined && routing.contract_version !== 1) fail(`Recall card ${cardId} has an unsupported routing contract version.`);
|
|
329
|
+
const branches = asArray(routing.branches);
|
|
330
|
+
const hasOnlyDecisions = routing.contract_version === 1 && branches.length > 0 &&
|
|
331
|
+
branches.every(branch => isDecisionOnly(branch.outcome));
|
|
332
|
+
if (!preferred.length && !hasOnlyDecisions) fail(`Recall card ${cardId} requires at least one preferred asset.`);
|
|
328
333
|
for (const ref of [...preferred, ...asArray(card.fallback_asset_refs)]) {
|
|
329
334
|
validateAssetRef(ref, cardId);
|
|
330
335
|
const type = clean(ref.resource_type);
|
|
@@ -335,26 +340,33 @@ function validateSemanticPlan() {
|
|
|
335
340
|
if (!inDomain) fail(`Recall card ${cardId} references ${type}:${key} outside domain ${domainId}.`);
|
|
336
341
|
if (preferred.includes(ref)) addMulti(preferredByAsset, `${type}:${key}`, cardId);
|
|
337
342
|
}
|
|
338
|
-
const routing = asObject(card.routing);
|
|
339
343
|
if (card.routing != null) {
|
|
340
344
|
for (const field of ['applicable_when', 'answer_grain', 'stop_when', 'fallback_when_unavailable', 'evidence_boundary']) {
|
|
341
345
|
if (!clean(routing[field])) fail(`Recall card ${cardId} routing requires ${field}.`);
|
|
342
346
|
}
|
|
343
347
|
if (!asArray(routing.branches).length) fail(`Recall card ${cardId} routing requires branches.`);
|
|
344
|
-
for (const branch of
|
|
345
|
-
if (
|
|
348
|
+
for (const branch of branches) {
|
|
349
|
+
if (branch.outcome !== undefined && routing.contract_version !== 1) fail(`Recall card ${cardId} branch outcome requires routing contract_version 1.`);
|
|
350
|
+
if (routing.contract_version === 1) validateAnswerBranch(branch, cardId);
|
|
351
|
+
const decisionOnly = routing.contract_version === 1 && isDecisionOnly(branch.outcome);
|
|
352
|
+
if (!clean(branch.when) || (!decisionOnly && !asArray(branch.asset_refs).length)) {
|
|
346
353
|
fail(`Recall card ${cardId} routing branch requires when and asset_refs.`);
|
|
347
354
|
}
|
|
355
|
+
const allowedRefs = [...preferred, ...asArray(card.fallback_asset_refs)];
|
|
356
|
+
if (decisionOnly) allowedRefs.push(...asArray(card.excluded_asset_refs));
|
|
348
357
|
for (const ref of asArray(branch.asset_refs)) {
|
|
349
358
|
validateAssetRef(ref, cardId);
|
|
350
|
-
if (!
|
|
359
|
+
if (!allowedRefs.some((allowed) =>
|
|
351
360
|
clean(allowed.resource_type) === clean(ref.resource_type) && clean(allowed.resource_key) === clean(ref.resource_key))) {
|
|
352
|
-
fail(`Recall card ${cardId} routing branch references an asset outside
|
|
361
|
+
fail(`Recall card ${cardId} routing branch references an asset outside its allowed card references.`);
|
|
353
362
|
}
|
|
354
363
|
}
|
|
355
364
|
const combination = asObject(branch.combination);
|
|
356
365
|
if (branch.combination != null) {
|
|
357
366
|
if (!['compatible', 'incompatible', 'unknown'].includes(clean(combination.compatibility))) fail(`Recall card ${cardId} has invalid combination compatibility.`);
|
|
367
|
+
if (routing.contract_version === 1 && !decisionOnly && combination.compatibility !== 'compatible') {
|
|
368
|
+
fail(`Recall card ${cardId} executable branch cannot rely on an unverified combination.`);
|
|
369
|
+
}
|
|
358
370
|
if (!clean(combination.reason)) fail(`Recall card ${cardId} combination requires an evidence-based reason.`);
|
|
359
371
|
if (combination.compatibility === 'compatible'
|
|
360
372
|
&& (!asArray(combination.join_keys).length || !clean(combination.time_alignment))) {
|
|
@@ -614,6 +626,24 @@ function normalizePlanAssetRef(value, label) {
|
|
|
614
626
|
return { resource_type: type, resource_key: key };
|
|
615
627
|
}
|
|
616
628
|
|
|
629
|
+
function isDecisionOnly(outcome) {
|
|
630
|
+
return outcome === 'clarify' || outcome === 'unsupported';
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function validateAnswerBranch(branch, cardId) {
|
|
634
|
+
const hasText = value => typeof value === 'string' && value.trim().length > 0;
|
|
635
|
+
const invalid = message => fail(`Recall card ${cardId} routing branch ${message}.`);
|
|
636
|
+
if (!['direct', 'transform', 'clarify', 'unsupported'].includes(branch.outcome)) invalid('requires a valid outcome');
|
|
637
|
+
if (!hasText(branch.when) || !hasText(branch.reason) || !hasText(branch.action)) invalid('requires when, reason and action');
|
|
638
|
+
if (!Array.isArray(branch.asset_refs)) invalid('requires an asset_refs array');
|
|
639
|
+
if (branch.answer_grain !== undefined && !hasText(branch.answer_grain)) invalid('has invalid answer_grain');
|
|
640
|
+
if (branch.source_grain !== undefined && !hasText(branch.source_grain)) invalid('has invalid source_grain');
|
|
641
|
+
if (branch.checks !== undefined && (!Array.isArray(branch.checks) || !branch.checks.every(hasText))) invalid('has invalid checks');
|
|
642
|
+
if (isDecisionOnly(branch.outcome)) return;
|
|
643
|
+
if (!hasText(branch.source_grain)) invalid('requires source_grain');
|
|
644
|
+
if (!branch.checks?.length) invalid('requires evidence-based checks');
|
|
645
|
+
}
|
|
646
|
+
|
|
617
647
|
function assertAgentAuthoredRecallCard(card, domainId) {
|
|
618
648
|
const cardId = clean(card.card_id);
|
|
619
649
|
const values = [card.intent, card.live_execution_reason, ...asArray(card.questions)].map(clean);
|
|
@@ -772,14 +802,24 @@ ${asArray(values).map((ref) => {
|
|
|
772
802
|
return `- [${escapeLink(recallAssetLabel(ref))}](${linkPath}):${clean(ref.reason)}`;
|
|
773
803
|
}).join('\n') || '- 无'}`;
|
|
774
804
|
const routing = asObject(card.routing);
|
|
805
|
+
const versioned = routing.contract_version === 1;
|
|
775
806
|
const branches = asArray(routing.branches).map((branch) => {
|
|
776
807
|
const item = asObject(branch);
|
|
777
808
|
const targets = asArray(item.asset_refs).map(ref => `[${escapeLink(recallAssetLabel(ref))}](${assetPath(clean(ref.resource_type), clean(ref.resource_key))})`).join('、') || '回到业务域核对资产';
|
|
778
809
|
const combination = asObject(item.combination);
|
|
779
810
|
const combinationNote = asArray(item.asset_refs).filter(ref => ref.resource_type !== 'dashboard').length > 1
|
|
780
811
|
? ` Combination: ${clean(combination.compatibility) || 'unknown'}; ${clean(combination.reason) || 'Verify common population, stable identity, grain and time before combining.'}${asArray(combination.join_keys).length ? ` Keys: ${asArray(combination.join_keys).join(', ')}.` : ''}${clean(combination.time_alignment) ? ` Time: ${clean(combination.time_alignment)}.` : ''}${asArray(combination.missing_coverage).length ? ` Gaps: ${asArray(combination.missing_coverage).join('; ')}.` : ''}` : '';
|
|
812
|
+
if (versioned) {
|
|
813
|
+
const lines = [`- **${item.when}** (${item.outcome}) — ${item.reason}`];
|
|
814
|
+
if (item.source_grain) lines.push(` - Source grain: ${item.source_grain}`);
|
|
815
|
+
lines.push(` - Answer grain: ${item.answer_grain || routing.answer_grain}`, ` - Action: ${item.action}`);
|
|
816
|
+
for (const check of asArray(item.checks)) lines.push(` - Check: ${check}`);
|
|
817
|
+
if (item.asset_refs.length) lines.push(` - Evidence: ${targets}${combinationNote}`);
|
|
818
|
+
return lines.join('\n');
|
|
819
|
+
}
|
|
781
820
|
return `- 当${clean(item.when)}:使用 ${targets}。${clean(item.reason)}${combinationNote}`;
|
|
782
821
|
});
|
|
822
|
+
const openingRoutes = [...branches, `- If prerequisites fail: ${routing.fallback_when_unavailable}`].join('\n');
|
|
783
823
|
return `---
|
|
784
824
|
type: project-semantic-recall-card
|
|
785
825
|
card_id: ${yaml(card.card_id)}
|
|
@@ -794,10 +834,10 @@ requires_live_execution: ${Boolean(card.requires_live_execution)}
|
|
|
794
834
|
|
|
795
835
|
- 适用问题:${title}
|
|
796
836
|
- 意图:${clean(card.intent) || '未说明'}
|
|
797
|
-
|
|
837
|
+
${versioned ? openingRoutes : `- 首选资产:${asArray(card.preferred_asset_refs).map(recallAssetLabel).join('、') || '无'}
|
|
798
838
|
- 备选资产:${asArray(card.fallback_asset_refs).map(recallAssetLabel).join('、') || '无'}
|
|
799
839
|
- 排除资产:${asArray(card.excluded_asset_refs).map(recallAssetLabel).join('、') || '无'}
|
|
800
|
-
- 实时执行:${Boolean(card.requires_live_execution) ? `需要,${clean(card.live_execution_reason) || '当前数值、客户名单、趋势或明细需要实时执行。'}` : '不强制,但当前数值仍需按具体资产能力实时确认。'}
|
|
840
|
+
- 实时执行:${Boolean(card.requires_live_execution) ? `需要,${clean(card.live_execution_reason) || '当前数值、客户名单、趋势或明细需要实时执行。'}` : '不强制,但当前数值仍需按具体资产能力实时确认。'}`}
|
|
801
841
|
|
|
802
842
|
## 用户问法
|
|
803
843
|
|
|
@@ -812,7 +852,7 @@ ${clean(card.intent)}
|
|
|
812
852
|
- 适用条件:${clean(routing.applicable_when) || clean(card.intent)}
|
|
813
853
|
- 答案对象与粒度:${clean(routing.answer_grain) || '先按用户问法确认对象、统计粒度与时间范围。'}
|
|
814
854
|
- 必要参数:${asArray(routing.required_parameters).map(clean).filter(Boolean).join('、') || '按首选资产的输入定义核对。'}
|
|
815
|
-
${branches.join('\n') || `- 问法和资产定义匹配时使用首选资产;不匹配时先回到业务域确认对象与口径,再考虑备选资产。`}
|
|
855
|
+
${versioned ? '' : branches.join('\n') || `- 问法和资产定义匹配时使用首选资产;不匹配时先回到业务域确认对象与口径,再考虑备选资产。`}
|
|
816
856
|
- 停止条件:${clean(routing.stop_when) || '取得对象、粒度、范围、时间和权威状态均匹配的最小证据后停止扩搜。'}
|
|
817
857
|
- 无匹配或不可用时:${clean(routing.fallback_when_unavailable) || '回到业务域按对象、粒度、过滤和时间筛选域内资产;仍不匹配则说明缺口。'}
|
|
818
858
|
- 执行边界:${clean(routing.evidence_boundary) || '排除资产不能作为当前答案;当前数值、客户名单、趋势或明细必须实时执行。'}
|
|
@@ -828,7 +868,7 @@ ${renderRecallEvidence(card)}
|
|
|
828
868
|
## 实时执行边界
|
|
829
869
|
|
|
830
870
|
- 是否需要执行实时数据:${Boolean(card.requires_live_execution)}
|
|
831
|
-
- 原因:${clean(card.live_execution_reason) || '未说明'}
|
|
871
|
+
- 原因:${clean(card.live_execution_reason) || '未说明'}${versioned ? '\n- Execute only a supported branch. Other evidence links explain the clarification or limitation.' : ''}
|
|
832
872
|
${renderTargetedKnowledge('recall_card', clean(card.card_id), '../personal-semantics/')}
|
|
833
873
|
`;
|
|
834
874
|
}
|
|
@@ -859,7 +899,8 @@ function renderRecallEvidence(card) {
|
|
|
859
899
|
const facts = report ? reportContract(report) : null;
|
|
860
900
|
const parameters = summary ? asArray(summary.input_parameters).map(item => `${clean(item.name)}: ${clean(item.meaning)}`) : [];
|
|
861
901
|
const measures = summary ? [] : asArray(report?.metric_occurrences).map(item =>
|
|
862
|
-
[clean(item.display_name || item.event_title || item.event_name), clean(item.aggregation_name || item.aggregation_code)
|
|
902
|
+
[clean(item.display_name || item.event_title || item.event_name), clean(item.aggregation_name || item.aggregation_code),
|
|
903
|
+
item.event_name && `event=${item.event_name}`, item.entity_grain != null && `entity=${JSON.stringify(item.entity_grain)}`].filter(Boolean).join(': '));
|
|
863
904
|
const savedScope = !summary && facts && Object.keys(facts.time).length ? ` Saved time scope: ${JSON.stringify(facts.time)}.` : '';
|
|
864
905
|
const reportSource = summary ? readText(path.join(buildIr, 'reports', fileName('report', clean(ref.resource_key)))) : '';
|
|
865
906
|
const outputs = summary ? asArray(summary.output_fields).map(item => {
|
|
@@ -874,7 +915,7 @@ function renderRecallEvidence(card) {
|
|
|
874
915
|
return `${name}${unverified ? ' (identity unknown)' : ''}`;
|
|
875
916
|
}) : [];
|
|
876
917
|
const reminders = summary ? [
|
|
877
|
-
...asArray(summary.calculation_rules).
|
|
918
|
+
...asArray(summary.calculation_rules).map(item => clean(item.meaning)),
|
|
878
919
|
...['time_semantics', 'coverage_gaps'].flatMap(key => asArray(summary[key]).map(item => clean(item.meaning))),
|
|
879
920
|
] : [];
|
|
880
921
|
lines.push(`- [${escapeLink(recallAssetLabel(ref))}](${assetPath(ref.resource_type, clean(ref.resource_key))}): ${clean(summary?.business_purpose) || clean(ref.reason)} Grain: ${clean(summary?.statistical_grain) || (facts ? JSON.stringify(facts.groups) : 'verify the asset definition')}.${parameters.length ? ` Parameters: ${parameters.join('; ')}.` : ''}${outputs.length ? ` Outputs: ${outputs.join(', ')}.` : ''}${measures.length ? ` Measures (verify result column identities): ${measures.join('; ')}.` : ''}${savedScope}${reminders.length ? ` Reminders: ${reminders.join('; ')}.` : ''}`);
|
|
@@ -1545,7 +1586,8 @@ function semanticPlanFragmentRefsForSource(identity, rel) {
|
|
|
1545
1586
|
if (sourceKind === 'recall-card' && assetKey) {
|
|
1546
1587
|
refs.add(`recall-card:${assetKey}`);
|
|
1547
1588
|
const card = planModel.cards.find(card => clean(card.card_id) === assetKey);
|
|
1548
|
-
|
|
1589
|
+
const branchRefs = asArray(card?.routing?.branches).flatMap(branch => asArray(branch.asset_refs));
|
|
1590
|
+
for (const ref of [...asArray(card?.preferred_asset_refs), ...asArray(card?.fallback_asset_refs), ...branchRefs]) {
|
|
1549
1591
|
if (ref.resource_type === 'report' && planModel.sqlByReportId.has(clean(ref.resource_key))) {
|
|
1550
1592
|
refs.add(`report:${clean(ref.resource_key)}:sql_semantics`);
|
|
1551
1593
|
}
|
|
@@ -9,11 +9,11 @@ const requestScoped = new Set(['+import-status']);
|
|
|
9
9
|
const directory = new Set(['+source-ls', '+source-read', '+source-put', '+source-rm']);
|
|
10
10
|
const value = (args, key) => args[args.indexOf(key) + 1];
|
|
11
11
|
|
|
12
|
-
export function invokeCompanyKbCli(flags, { spawn = spawnSync, localCli = path.resolve(import.meta.dirname, '../../../../bin/ae-cli.js') } = {}) {
|
|
12
|
+
export function invokeCompanyKbCli(flags, { spawn = spawnSync, localCli = path.resolve(import.meta.dirname, '../../../../bin/ae-cli.js'), timeoutMs } = {}) {
|
|
13
13
|
// Packaged/project scripts use their matching CLI; standalone installed Skills retain PATH lookup.
|
|
14
14
|
const bundled = fs.existsSync(localCli);
|
|
15
15
|
const child = spawn(bundled ? process.execPath : 'ae-cli', bundled ? [localCli, ...flags] : flags,
|
|
16
|
-
{ encoding: 'utf8', stdio: ['inherit', 'pipe', 'pipe'] });
|
|
16
|
+
{ encoding: 'utf8', stdio: ['inherit', 'pipe', 'pipe'], ...(timeoutMs === undefined ? {} : { timeout: timeoutMs }) });
|
|
17
17
|
if (child.stderr) process.stderr.write(child.stderr);
|
|
18
18
|
if (child.error) throw child.error;
|
|
19
19
|
if (child.status === 0) return JSON.parse(child.stdout);
|
|
@@ -7,11 +7,11 @@ These rules guide Schema generation for project semantic knowledge bases built f
|
|
|
7
7
|
- CLI-managed asset facts live under `sources/assets/**`. Adopted personal semantics exported by the asset package live under `sources/personal-semantics/**` and are also CLI-managed generated source. Human project background, business rules, meetings, decisions, corrections, and references live outside those generated directories; asset refresh must not delete or override those human inputs.
|
|
8
8
|
- Organize generated Wiki pages by scope and business use, not by mirroring every source file. The primary navigation has five ordered entries: project overview, project-wide shared knowledge, business domains, event and asset catalog, and governance with provenance. Within each domain, explain the business question, judgment path, relevant events, metrics, assets, and boundaries. Keep asset-type pages as secondary evidence and lookup indexes.
|
|
9
9
|
- Begin the root page with question-intent routing. Route business-state and current-value questions through the matching domain and recall card; route named assets and field/definition/dependency questions through the asset catalog and governance; route shared product background through project-wide knowledge. If no card matches, enter the relevant domain and filter assets by business object, answer grain, filters and time. If no suitable evidence remains, state the gap. Stop searching once the smallest authoritative evidence set matches object, grain, scope and time.
|
|
10
|
-
-
|
|
10
|
+
- Open each recall card with its triggering intent, parameters, source and answer grains, and evidenced branch: answer directly, transform, clarify or explain a gap. Link the relevant assets, distinguish the actual measure from its label, and preserve conversion steps, checks, excluded alternatives, stop conditions and fallback.
|
|
11
11
|
- Public event groups are a project event lookup taxonomy. A group such as a product module is not automatically a business domain or an event definition. Only include events present in the exported asset scope, preserve their event-name identity, and link to the canonical event page. Never infer business meaning, certification, or domain membership from a group label alone. Personal event catalogs must not enter a shared project Wiki.
|
|
12
12
|
- The project overview must start with the project-level business model: business positioning, audience roles, business objects, object relationships, decision chains, asset roles in those chains, and non-goals. Asset counts, snapshot hashes, source package metadata and build logs belong after that model. Do not reduce the overview to a directory, asset inventory, or build summary.
|
|
13
13
|
- Do not infer business meaning from titles alone. Preserve unknowns, conflicts, source scope, certification state, and provenance when evidence is incomplete.
|
|
14
|
-
-
|
|
14
|
+
- Keep scoped adopted methods tied to their verified events, fields, assets and adoption records. Preserve counting entities, deduplication keys and units; mark unverified equivalences and identities unknown.
|
|
15
15
|
- If the governed package contains neither certified entry assets nor adopted personal semantics, compile the uploaded empty skeleton as an explicit unknown-state Wiki with the normal five navigation layers. Do not invent business domains, decisions, metrics, or asset definitions. When later evidence replaces the skeleton, remove obsolete empty-state claims from the published Wiki.
|
|
16
16
|
- Corrections and decisions override other material only when they state target, content, date, status, and applicable scope.
|
|
17
17
|
|
package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 项目语义知识库编译准则
|
|
2
2
|
|
|
3
|
-
预置版本:1.
|
|
3
|
+
预置版本:1.3。导航分类版本:2.1。
|
|
4
4
|
|
|
5
5
|
## 总体要求
|
|
6
6
|
|
|
@@ -59,6 +59,12 @@
|
|
|
59
59
|
|
|
60
60
|
保留每张卡片的触发问题、适用范围、对象与回答粒度、必需参数、直接指向资产的条件分支、排除或不可互换的资产、停止条件,以及资产不可用、证据冲突或无匹配时的回退方式。不得将条件分支替换为统一的“首选资产、失败后备用资产”列表。缺失的路由或参数必须明确保留为缺口,不得编造。找到与对象、粒度、范围和时间匹配的最小权威证据集合后,停止扩展检索。当前数值、实体列表、趋势和明细结果必须通过已获授权的实时报表或查询执行获取。
|
|
61
61
|
|
|
62
|
+
分析召回卡按问法分支,把会改变答案的条件放在卡片开头,紧邻对应的证据链接。从来源定义分别说明显示名与实际计量对象、聚合方式、去重键、单位和统计范围;名称与计算不一致时并列保留,含义有歧义时给出需澄清的选择。其他体裁只保留与其用途有关的约束。
|
|
63
|
+
|
|
64
|
+
每个分支写清来源一行代表什么、答案一项代表什么,以及可直接回答、转换后回答、需澄清或证据不足中的适用结果。转换分支根据已核验的定义写明映射键、重叠或缺失覆盖、指标能否合并、时间对齐与操作顺序。只选择会影响本分支的条件;不能从同名字段推断等价或可加。将源卡已给出的操作和答前检查保留在该分支内,完整计算证据保留在资产详情。旧卡缺少说明时保留为待核对,不推定存在可执行转换。
|
|
65
|
+
|
|
66
|
+
把影响结论的限制写成可核验的动作:根据实际参数查覆盖窗口和状态时点,按原始单位、分母与精度区分真实零、取整零、缺行和被过滤行;调整条件后要求按相同口径重算比较双方。观察、原因解释和预测分别标明证据要求。证据不足时交付可支持的部分与具体缺口,代理值须明确含义及局限。只记录稳定方法及其来源,实际值和核验结果留到查询时取得。
|
|
67
|
+
|
|
62
68
|
## 页面元数据与来源追溯
|
|
63
69
|
|
|
64
70
|
每个 `wiki/**/*.md` 页面均以 YAML 元数据头开始,包含 `title`、`type`、`depth`、`related` 和 `source`;使用 ZIP 或 URL 证据时还须包含 `sourceId`。`type` 取值为 `overview`、`concept`、`guide`、`reference`、`synthesis` 或 `faq`;`depth` 取值为 `overview`、`detail` 或 `howto`;`summary` 为可选字段。使用真实的原始文件相对路径和真实父源文件身份,不得因存在来源字段就编造路径。正文中的来源引用使用纯文本路径,不使用指向原始文件的 Markdown 链接。Wiki 正文不得暴露凭据、宿主机路径或内部构建与调试标记。
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import { realpathSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { invokeCompanyKbCli, runCompanyKb } from './company-kb.mjs';
|
|
7
|
+
|
|
8
|
+
function failure(code, message) {
|
|
9
|
+
return Object.assign(new Error(message), { code });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Run lifecycle only: successful compilation still requires publication and content readback.
|
|
13
|
+
export async function waitForCompileRun(
|
|
14
|
+
{ name, runId, host, timeoutMs = 1_800_000, pollIntervalMs = 5_000 },
|
|
15
|
+
invoke = invokeCompanyKbCli,
|
|
16
|
+
{ now = () => performance.now(), sleep = delay } = {},
|
|
17
|
+
) {
|
|
18
|
+
if (![name, runId, host].every(value => typeof value === 'string' && value.trim())) {
|
|
19
|
+
throw new Error('--name, --run-id and --host are required.');
|
|
20
|
+
}
|
|
21
|
+
if (![timeoutMs, pollIntervalMs].every(value => Number.isSafeInteger(value) && value > 0)) {
|
|
22
|
+
throw new Error('--timeout-ms and --poll-interval-ms must be positive integers.');
|
|
23
|
+
}
|
|
24
|
+
const deadline = now() + timeoutMs;
|
|
25
|
+
let knowledgeBaseId;
|
|
26
|
+
for (;;) {
|
|
27
|
+
const remaining = Math.floor(deadline - now());
|
|
28
|
+
if (remaining <= 0) throw failure('KB_COMPILE_WAIT_TIMEOUT', `Timed out waiting for compile run ${runId}.`);
|
|
29
|
+
const result = await runCompanyKb('+status', ['--name', name, '--run-id', runId, '--host', host],
|
|
30
|
+
flags => invoke(flags, { timeoutMs: Math.min(30_000, remaining) }));
|
|
31
|
+
const { knowledgeBase, compileRun } = result.data ?? {};
|
|
32
|
+
if (!compileRun || compileRun.id !== runId || knowledgeBase?.scope !== 'company' || !knowledgeBase.id
|
|
33
|
+
|| (knowledgeBaseId && knowledgeBase.id !== knowledgeBaseId)) {
|
|
34
|
+
throw failure('KB_COMPILE_RUN_STATUS_UNSUPPORTED', 'Missing or mismatched compileRun identity; exact-run status support is required.');
|
|
35
|
+
}
|
|
36
|
+
knowledgeBaseId = knowledgeBase.id;
|
|
37
|
+
if (result.data.publicationReview) {
|
|
38
|
+
throw failure(result.data.publicationReview.code || 'KB_PUBLICATION_REVIEW_REQUIRED',
|
|
39
|
+
`Compile run ${runId} requires administrator review; stop polling without cancelling or restarting the run.`);
|
|
40
|
+
}
|
|
41
|
+
if (compileRun.status === 'succeeded') return result;
|
|
42
|
+
if (['failed', 'cancelled'].includes(compileRun.status)) {
|
|
43
|
+
throw failure(`KB_COMPILE_${compileRun.status.toUpperCase()}`,
|
|
44
|
+
`Compile run ${runId} ${compileRun.status}: ${compileRun.errorMessage || 'No error details returned.'}`);
|
|
45
|
+
}
|
|
46
|
+
if (!['queued', 'running'].includes(compileRun.status)) {
|
|
47
|
+
throw failure('KB_COMPILE_RUN_STATUS_UNSUPPORTED', `Unexpected compile run status: ${compileRun.status}`);
|
|
48
|
+
}
|
|
49
|
+
const wait = Math.min(pollIntervalMs, deadline - now());
|
|
50
|
+
if (wait > 0) await sleep(wait);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Installed Skills may be reached through a symlink; compare their resolved entry files.
|
|
55
|
+
function isCliEntry() {
|
|
56
|
+
try {
|
|
57
|
+
return process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url));
|
|
58
|
+
} catch {
|
|
59
|
+
// stdin/eval launchers need not provide a real entry file when importing this module.
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (isCliEntry()) {
|
|
64
|
+
try {
|
|
65
|
+
const { values } = parseArgs({ options: {
|
|
66
|
+
name: { type: 'string' }, 'run-id': { type: 'string' }, host: { type: 'string' },
|
|
67
|
+
'timeout-ms': { type: 'string' }, 'poll-interval-ms': { type: 'string' },
|
|
68
|
+
} });
|
|
69
|
+
const result = await waitForCompileRun({
|
|
70
|
+
name: values.name, runId: values['run-id'], host: values.host,
|
|
71
|
+
...(values['timeout-ms'] === undefined ? {} : { timeoutMs: Number(values['timeout-ms']) }),
|
|
72
|
+
...(values['poll-interval-ms'] === undefined ? {} : { pollIntervalMs: Number(values['poll-interval-ms']) }),
|
|
73
|
+
});
|
|
74
|
+
console.log(JSON.stringify(result, null, 2));
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error(JSON.stringify({ ok: false, error: { code: error.code ?? 'KB_COMPILE_WAIT_FAILED', message: error.message } }, null, 2));
|
|
77
|
+
process.exitCode = 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ae-automation
|
|
3
|
-
description: "
|
|
3
|
+
description: "Schedule AE platform automations: every day/week, daily reports, recurring reminders, monitoring, or repeat this task. Use ae-cli automation for persistent Agent/Agent Team tasks in the current space, instead of session-local CronCreate or /loop. Also manage schedules, runs, and results."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# AE Automation
|
|
7
7
|
|
|
8
|
+
Create recurring Agent work as a platform automation through `ae-cli automation`. If any prerequisite or write command returns `error.type: auth` or `error.type: config`, or reports a permission denial or unsupported configuration, report the blocker and stop the automation workflow. Leave credential and environment diagnosis or repair to a separate user request. Do not substitute session-local `CronCreate`, `/loop`, or `scheduled_tasks.json` for the requested platform automation.
|
|
9
|
+
|
|
8
10
|
See [command risks](references/command_index.md). Read [the command contract](references/cli.md) before writing or executing an automation. Use `ae-cli automation --help` and leaf help to discover flags.
|
|
9
11
|
|
|
10
12
|
1. Resolve the host and space. A local user signs in with `ae-cli auth login`; a sandbox uses the current conversation user's injected CLI token, never a shared sandbox's user binding. Pass `--agent-space-id` when the user identifies a space. Without an explicit space, the CLI inherits the current AgentSpace from its runtime context, working directory or verified current conversation; only a local invocation without space context uses the personal default. Show the resolved space when it matters.
|
|
11
13
|
2. Discover the automation with `automation list` and inspect `automation get`. Use the returned IDs; names are not unique.
|
|
12
14
|
3. For creation, select an Agent or team through the corresponding discovery commands. Match configuration to the target type. Use `--weekdays` or `--days-of-month` JSON arrays for multiple days with one time; skip dates absent in a month. For the actual last day of every month use `--days-of-month '["L"]'`, or combine it with dates, e.g. `'[1,15,"L"]'`; overlapping selections execute only once. Both Agent and Agent Team accept result notifications. Confirm the complete configuration before creation; save only the recurring task instructions as `--message`, never the automation-creation guide. Preview writes with `--dry-run` when useful; the CLI shows a redacted request and asks the server to validate authentication, space, permissions, target state, fields, and idempotency without applying the operation.
|
|
13
|
-
4. Execute the requested operation. Deleting an automation or stopping an execution requires confirmation; use `--yes` only when the user already authorized that action. In a non-interactive shell, these operations fail immediately unless global `--yes` is present.
|
|
15
|
+
4. Execute the requested operation. After creation, read back the returned automation ID with `automation get` and verify the saved space and configuration before reporting success; a local schedule or a promise to run later is not a platform creation receipt. Deleting an automation or stopping an execution requires confirmation; use `--yes` only when the user already authorized that action. In a non-interactive shell, these operations fail immediately unless global `--yes` is present.
|
|
14
16
|
5. Read the returned run ID, then `automation runs result`. Report acceptance separately from completion. Use `--wait` only when the user needs the final outcome now.
|
|
15
17
|
|
|
16
18
|
Results are read from the server and work outside the sandbox. This skill does not read complete conversations or continue a chat. Never infer an output from a different execution sharing the same conversation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ae-capability
|
|
3
|
-
version: 1.3.
|
|
3
|
+
version: 1.3.16
|
|
4
4
|
description: "AE capability gateway discovery and generic invocation with ae-cli. Use when the user needs to list or search available capabilities, inspect an unknown capability schema/risk/auth contract, optionally validate complex input or dry-run before execute, or invoke a long-tail capability that has no curated ae-cli command. Always discover and inspect before composing input; never guess capability IDs or input fields. Prefer on-demand validate OR dry-run — do not stack both by default."
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ Use this skill for progressive capability discovery and generic gateway invocati
|
|
|
18
18
|
2. Otherwise search the capability catalog.
|
|
19
19
|
3. Inspect the selected capability before constructing input.
|
|
20
20
|
4. **Optionally** pre-check — pick **at most one** path from the table below (do not stack validate + dry-run by default).
|
|
21
|
-
5. Execute (`capability run` / curated command).
|
|
21
|
+
5. Execute (`capability run` / curated command). Obtain explicit user confirmation for `high-risk-write`, including deletion, cancellation, sharing, ownership, permission, and authentication-policy changes.
|
|
22
22
|
|
|
23
23
|
Never guess a capability ID, input field, enum value, resource ID, or project ID.
|
|
24
24
|
|
|
@@ -102,9 +102,9 @@ Hard rule: **for the same final input, do not run both validate and dry-run by d
|
|
|
102
102
|
| Situation | What to call | Then |
|
|
103
103
|
| --- | --- | --- |
|
|
104
104
|
| Simple / familiar input (typical `read`, few scalar fields) | **Neither** — skip pre-check | `run` directly |
|
|
105
|
-
| Complex `qp` / nested `payload` / share maps; still iterating shape | **`--validate` / `capability validate` only** (may repeat while fixing) | After `valid=true`,
|
|
106
|
-
| Need risk / `output_mode` / `supports_cancel`, or `high-risk-write`
|
|
107
|
-
| Rare exception: many validate iterations, then still need
|
|
105
|
+
| Complex `qp` / nested `payload` / share maps; still iterating shape | **`--validate` / `capability validate` only** (may repeat while fixing) | After `valid=true`, run following the inspected risk and authorization requirements; skip dry-run unless below applies |
|
|
106
|
+
| Need risk / `output_mode` / `supports_cancel`, or `high-risk-write` gate | **`--dry-run` / `capability dry-run` only** (once on final input) | Then confirm the high-risk change / `run`. Do **not** validate first on the same final payload |
|
|
107
|
+
| Rare exception: many validate iterations, then still need high-risk confirmation | validate while drafting → **one** dry-run on the **final** input | Then chat confirm → `run --yes` |
|
|
108
108
|
|
|
109
109
|
Do **not** treat `validate → dry-run → run` as the normal path. That stack is the rare exception in the last row only.
|
|
110
110
|
|
|
@@ -149,6 +149,8 @@ The capability namespace is inferred from `<capability-id>` for `inspect`, `vali
|
|
|
149
149
|
|
|
150
150
|
## validate vs dry-run
|
|
151
151
|
|
|
152
|
+
The built-in `--jq`/`capability ... --jq` filter receives the command payload before the outer `{ok,data,meta}` envelope. For example, `capability list` uses `.capabilities[]`; only external jq over saved final JSON uses `.data.capabilities[]`.
|
|
153
|
+
|
|
152
154
|
| | `validate` / `--validate` | `dry-run` / `--dry-run` |
|
|
153
155
|
| --- | --- | --- |
|
|
154
156
|
| Purpose | Check **input shape** while composing complex payloads | **Pre-execution confirmation** (params + risk/output/cancel) |
|
|
@@ -231,3 +233,5 @@ ae-cli capability validate metadata.data_table.sql_write --input input.json
|
|
|
231
233
|
ae-cli capability dry-run analysis.folder.delete --input '{"project_id":1,"folder_ids":[1001]}'
|
|
232
234
|
ae-cli capability run analysis.dashboard.list --input input.json
|
|
233
235
|
```
|
|
236
|
+
|
|
237
|
+
For non-interactive high-risk execution, obtain explicit authorization and pass global `--yes`. Piped answers do not replace this flag. An interactive prompt ending at EOF aborts cleanly. Gateway permission errors retain `meta.request_id` and `meta.invocation_id` for diagnosis.
|
|
@@ -40,6 +40,7 @@ Global parameters:
|
|
|
40
40
|
| `--host <url>` | Override the active AE host for analysis-side commands and place it after the subcommand, e.g. `ae-cli community +<command> --host <url>`. It is intentionally unavailable for `community data report`; use `--endpoint` there. |
|
|
41
41
|
|
|
42
42
|
Output and errors:
|
|
43
|
+
- Built-in `--jq` receives the business payload before the outer `{ok,data,meta}` envelope. Use `.items`/`.page` (or the command's documented payload fields); use `.data...` only with external jq over saved final JSON.
|
|
43
44
|
- Successful commands return machine-readable JSON by default. Envelope may include optional `_notice.host_compat`.
|
|
44
45
|
- Failed commands return `{ "ok": false, "error": { "type": "...", "message": "...", "hint": "..." } }` and exit non-zero.
|
|
45
46
|
- **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.
|
|
@@ -33,6 +33,7 @@ Global parameters:
|
|
|
33
33
|
| `--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>`. |
|
|
34
34
|
|
|
35
35
|
Output and errors:
|
|
36
|
+
- Built-in `--jq` receives the business payload before the outer `{ok,data,meta}` envelope. Use payload fields directly inside the CLI; use `.data...` only with external jq over saved final JSON.
|
|
36
37
|
- JSON results use an outer `ok` and `data`; command errors use `ok:false` with `error.type/message/hint` on stderr and exit non-zero. Inspect both streams.
|
|
37
38
|
- **`ok:true` is not a business completion check.** Legacy commands can return `REJECTED`, `FAILED`, or `CHECK_FAILED` inside `data`. Check the specific result fields described by the reference before proceeding. Reading a failed task's status successfully is different from successfully executing that task.
|
|
38
39
|
- For asynchronous work, preserve the returned ID and query that same operation. Submission is not completion; do not submit again because it is still running. Use bounded polling with backoff; when the wait budget is exhausted, report the ID and current state rather than claiming success or restarting work.
|
|
@@ -33,6 +33,7 @@ Global parameters:
|
|
|
33
33
|
| `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli engage-flow flow list --host <url>`. |
|
|
34
34
|
|
|
35
35
|
Output and errors:
|
|
36
|
+
- Built-in `--jq` receives the business payload before the outer `{ok,data,meta}` envelope. Use payload fields directly inside the CLI; use `.data...` only with external jq over saved final JSON.
|
|
36
37
|
- Successful commands return machine-readable JSON by default. Envelope may include optional `_notice.host_compat`.
|
|
37
38
|
- Failed commands return `{ "ok": false, "error": { "type": "...", "message": "...", "hint": "..." } }` and exit non-zero.
|
|
38
39
|
- **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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ae-evaluation
|
|
3
|
-
version: 2.4.
|
|
3
|
+
version: 2.4.7
|
|
4
4
|
description: "Operate the Agent Evaluation (agent-test) platform through ae-cli: manage evaluation assets, configure and run Agent or preset-output evaluations, and analyze results. Use for platform evaluation tasks and their model, credential, integration, or schedule setup."
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -33,9 +33,24 @@ References contain command inputs, JSON contracts, and task-specific workflows;
|
|
|
33
33
|
- Use the online platform. Do not suggest localhost/loopback endpoints or obtain tokens from a local `agent-test/.env`.
|
|
34
34
|
- Authentication uses `AE_EVAL_ACCESS_TOKEN` when explicitly set; it is sent only as `Authorization: Bearer` and must never appear in command arguments or output.
|
|
35
35
|
- In an AE sandbox, when `AE_EVAL_ACCESS_TOKEN` is unset, ae-cli automatically exchanges the sandbox-provisioned `cli-token` through te-claude for a short-lived evaluation session. The CLI token is never sent to Agent Evaluation. If the token can access multiple TE projects, set `AE_EVAL_TE_PROJECT_ID` to the authorized TE project id.
|
|
36
|
-
- Outside a sandbox, obtain a session token through the platform web console (`sessionStorage.getItem('agent.evaluation.session-token')`) or `POST /agenteval/api/v1/auth/session`.
|
|
36
|
+
- Outside a sandbox, when the token is unset, the CLI immediately returns `EVAL_ACCESS_TOKEN_MISSING` with `token_missing` onboarding guidance and sends no network request. Module availability and service health remain unchecked. Direct the user to obtain a session token through the platform web console (`sessionStorage.getItem('agent.evaluation.session-token')`) or `POST /agenteval/api/v1/auth/session`. Never request tokens in chat.
|
|
37
37
|
- Successful commands return JSON by default; use the actual error envelope to diagnose failures.
|
|
38
38
|
|
|
39
|
+
### Evaluation availability and onboarding
|
|
40
|
+
|
|
41
|
+
AI Evaluation Center is an optional deployment module. CLI command/Skill availability does not establish that the server module is installed or that the user has access.
|
|
42
|
+
|
|
43
|
+
- When an error includes `error.details.onboarding`, follow the status-specific scope below. Do not blindly repeat the failed operation, change flags, refresh tokens, or use direct HTTP calls to bypass a denial. This is a host-Agent instruction, not a persistent CLI circuit breaker. Independent local work can continue.
|
|
44
|
+
- First preserve local work: when asked to organize and upload a dataset, finish and save the local CSV/JSON if possible. Confirm its actual file path. If a write times out, loses its response, or receives a gateway/server failure, explain that the write result is unconfirmed: the server may already have accepted it. Do not claim either success or failure and do not resubmit blindly. Once connectivity is restored, use authorized read-only status checks with any known resource/import ID to reconcile the result. If no reliable identifier or lookup exists, ask the administrator/support to verify before another write.
|
|
45
|
+
- Read `onboarding.status`, explain the evidence in the user's language, and follow its `next_steps`:
|
|
46
|
+
- `module_not_detected`: stop further evaluation commands on the affected host until deployment/routing is verified. The API route was not detected (generic route 404 or HTML fallback). The optional module may be missing or its routing may be wrong. Contact the ThinkingData service representative (CSM or Technical Support) to verify deployment/routing, install the module if needed, and grant access. Do not assert that installation is certainly absent.
|
|
47
|
+
- `access_not_granted`: stop only the denied operation. Independent authorized operations may continue; for example, a denied delete does not prohibit an authorized dataset read. Do not run other commands just to probe or bypass the denial. Stop a whole project or module only when that access scope is confirmed. Ask the administrator or ThinkingData support to check the required permission (READER / EDITOR / ADMIN as appropriate). A 403 alone proves neither cluster-wide denial nor module installation; do not recommend reinstallation or token rotation.
|
|
48
|
+
- `token_missing`: stop remote evaluation operations on this host until a token is configured. The external terminal has no token; no request was sent and endpoint availability was not checked. Follow the conditional web-console instructions; if the app launcher entry is missing, request administrator/support verification instead of sending the user to a nonexistent page. This status does not establish the health of every evaluation service.
|
|
49
|
+
- `availability_unknown`: stop blind retries of the failed operation. Network errors, timeouts, server failures, invalid responses, and missing sandbox session routes cannot establish installation state. Ask for host/network/service/routing verification; do not present an outage as an installation requirement. After connectivity is restored, authorized read-only status checks may reconcile an unconfirmed write; they must not resubmit it.
|
|
50
|
+
- Briefly relate the three capabilities to the user's task: **Datasets** manage single/multi-turn test cases and versions, with CSV/JSON imports and AI Monitor traces; **Evaluators** provide templates/custom LLM judges, human calibration, and prompt optimization; **Evaluation Runs** test live Agents or score preset outputs, schedule regressions, and inspect low-score cases and traces. Translate this explanation naturally for Chinese or English users; CLI envelopes remain English.
|
|
51
|
+
- If the user asks only about capabilities, explain them without a network call. If they also request current datasets/runs, apply the status-specific stop scope above when the first call reports onboarding; do not make another call just to demonstrate another capability.
|
|
52
|
+
- Existing business error codes, error type (`api`), and exit code remain unchanged. Onboarding is additive; ordinary business 404 errors (such as `DATASET_NOT_FOUND`) do not indicate a missing module. Older CLIs may omit onboarding; use their diagnostic evidence cautiously and do not infer installation from a bare 404/5xx.
|
|
53
|
+
|
|
39
54
|
## IDs, versions, and mutations
|
|
40
55
|
|
|
41
56
|
- Discover real IDs with list/get commands. UUIDs are version-7 strings; never guess IDs, JSON payload shapes, frequency fields, or `lock_version` values.
|