@thinkingai/ae-cli 6.0.58 → 6.0.61
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 +14 -6
- package/README.zh.md +16 -6
- package/bin/ai-monitor.js +2 -0
- package/bin/runtime-capabilities.json +1 -1
- package/dist/ai-monitor-NUKSJPLE.js +33 -0
- package/dist/ai-monitor.js +136 -0
- package/dist/{auth-A5OO4VS4.js → auth-MVAEBGBP.js} +24 -15
- package/dist/{automation-FD2QZUP6.js → automation-6L6IAYRK.js} +6 -7
- package/dist/{capability-SKI4GHF4.js → capability-74N7AN5X.js} +35 -38
- package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
- package/dist/{chunk-QWSA3EOD.js → chunk-7WBCSJL6.js} +23 -9
- package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
- package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
- package/dist/chunk-BQFLABJQ.js +186 -0
- package/dist/{chunk-E25OSZLJ.js → chunk-COOMXFUG.js} +3 -3
- package/dist/chunk-EFGUBGA6.js +64 -0
- package/dist/{chunk-HQCY3QCA.js → chunk-H35VDOAE.js} +18 -13
- package/dist/{chunk-VDICGXCY.js → chunk-HIMOBNEY.js} +2 -2
- package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
- package/dist/chunk-HRFYYEXR.js +1285 -0
- package/dist/{chunk-UYJMEHAF.js → chunk-JZY6WWAP.js} +22 -21
- package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
- package/dist/{chunk-YVG6QD3V.js → chunk-LFJ7N36I.js} +103 -8
- package/dist/{chunk-EEARZNHE.js → chunk-LPKIMGIU.js} +89 -37
- package/dist/chunk-NNK3JBH4.js +60 -0
- package/dist/{chunk-WMDO53YK.js → chunk-OTZ4JQDU.js} +2 -2
- package/dist/{chunk-SOSFRU3O.js → chunk-PLNS5J33.js} +58 -26
- package/dist/chunk-PUSFEC6B.js +29 -0
- package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
- package/dist/{chunk-K2Z7QHDR.js → chunk-RB26WNLM.js} +52 -15
- package/dist/chunk-SVNED423.js +556 -0
- package/dist/{chunk-AWVZTN2B.js → chunk-THTROEGD.js} +1 -1
- package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
- package/dist/{chunk-JSBLCLFE.js → chunk-VLOGOM7N.js} +13 -7
- package/dist/{chunk-GBSACKFB.js → chunk-XPARQSYS.js} +528 -299
- package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
- package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
- package/dist/{compat-check-WFEKVLTH.js → compat-check-W4XC27RG.js} +5 -4
- package/dist/{config-U4I7X25P.js → config-264GB6C7.js} +28 -14
- package/dist/{context-CDB5H5PD.js → context-SOQDFZIB.js} +8 -6
- package/dist/{data-integration-QE37EQ3A.js → data-integration-UNJ7EPW2.js} +6 -6
- package/dist/{evaluation-LR4YDYWL.js → evaluation-Q3AIGFOG.js} +14 -159
- package/dist/index.js +98 -589
- package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
- package/dist/{memory-SNFR5M23.js → memory-ZLTTULZK.js} +9 -10
- package/dist/{metadata-6QM6EED5.js → metadata-EN2IWCDI.js} +11 -10
- package/dist/{model-KEVCEXWD.js → model-NAKQWK4W.js} +4 -5
- package/dist/{personal-semantic-preference-7VXQPP2N.js → personal-semantic-preference-UGN67KTN.js} +46 -15
- package/dist/{project-semantic-PSEPYH2L.js → project-semantic-5OP3YPZD.js} +19 -16
- package/dist/{sync-22ACDK5Z.js → sync-LDJQZRQH.js} +9 -9
- package/dist/{te-agent-BJ36B4QI.js → te-agent-WNNAD4AJ.js} +303 -17
- package/dist/{te-analysis-WQ6D6YG4.js → te-analysis-KIMH6AGU.js} +399 -205
- package/dist/{te-community-VRWMFGI6.js → te-community-P7NNBVCS.js} +17 -15
- package/dist/{te-dataops-YTLFTTW7.js → te-dataops-ZRKSG4R7.js} +13 -11
- package/dist/{te-engage-V2QW7TIC.js → te-engage-PVBVNRSU.js} +13 -12
- package/dist/{te-kb-4AQLISDR.js → te-kb-W7PRC7QN.js} +80 -20
- package/dist/{te-system-CYWSK3UN.js → te-system-F4ZU2HRQ.js} +6 -7
- package/dist/{te-team-6ELNGBWT.js → te-team-5ONMRGKF.js} +9 -8
- package/dist/{things-HFWLGCUH.js → things-PFENSIF4.js} +9 -8
- package/dist/{update-3CRVVHV5.js → update-EUZ4GNND.js} +8 -6
- package/dist/{workspace-2CKQX2XL.js → workspace-Z7L33OBQ.js} +6 -7
- package/package.json +12 -7
- package/skills/ae-agent/SKILL.md +19 -5
- package/skills/ae-agent/references/a2a.md +103 -0
- package/skills/ae-agent/references/command_index.md +11 -0
- 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 +43 -25
- package/skills/ae-analysis/references/adhoc_export.md +3 -1
- package/skills/ae-analysis/references/ai_models.md +1 -0
- package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
- package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
- 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 +44 -35
- 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_export.md +2 -2
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
- 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 +8 -2
- 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_evaluation.md +17 -1
- package/skills/ae-analysis/references/scenario_list.md +7 -7
- 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 +16 -8
- 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-generate-tracking-plan/SKILL.md +5 -0
- package/skills/ae-kb/SKILL.md +8 -4
- package/skills/ae-kb/references/analysis-workflow.md +11 -2
- package/skills/ae-kb/references/publication.md +45 -0
- 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
- package/dist/chunk-Y74WTIKJ.js +0 -10
|
@@ -7,16 +7,26 @@ import {
|
|
|
7
7
|
waitForAnalysisRun,
|
|
8
8
|
withAsyncArtifactLifecycle,
|
|
9
9
|
withInterruptSignal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LPKIMGIU.js";
|
|
11
|
+
import {
|
|
12
|
+
evalApi
|
|
13
|
+
} from "./chunk-BQFLABJQ.js";
|
|
14
|
+
import {
|
|
15
|
+
EvalApiError
|
|
16
|
+
} from "./chunk-LFJ7N36I.js";
|
|
11
17
|
import {
|
|
12
18
|
createCapabilityCommand,
|
|
13
19
|
definitionIntentSnapshotFlag,
|
|
14
20
|
modelDefinitionIntentSnapshotFlag
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-H35VDOAE.js";
|
|
16
22
|
import {
|
|
17
23
|
registerCapabilityGatewayRoute,
|
|
18
24
|
resolveGatewayDomain
|
|
19
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AWW2T2WL.js";
|
|
26
|
+
import {
|
|
27
|
+
unwrapOutputData,
|
|
28
|
+
withOutputMetadata
|
|
29
|
+
} from "./chunk-OTZ4JQDU.js";
|
|
20
30
|
import {
|
|
21
31
|
CapabilityGatewayError,
|
|
22
32
|
buildCapabilityGatewayUrl,
|
|
@@ -30,19 +40,17 @@ import {
|
|
|
30
40
|
uploadInputFile,
|
|
31
41
|
validateCapability,
|
|
32
42
|
validateCapabilityWithEnvelope
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import "./chunk-Y74WTIKJ.js";
|
|
38
|
-
import "./chunk-GBSACKFB.js";
|
|
43
|
+
} from "./chunk-JZY6WWAP.js";
|
|
44
|
+
import "./chunk-NNK3JBH4.js";
|
|
45
|
+
import "./chunk-XPARQSYS.js";
|
|
46
|
+
import "./chunk-PUSFEC6B.js";
|
|
39
47
|
import {
|
|
40
48
|
getCliToken
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-PLNS5J33.js";
|
|
50
|
+
import "./chunk-AMURHMS3.js";
|
|
43
51
|
import {
|
|
44
52
|
CliValidationError
|
|
45
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-R2SVAO4G.js";
|
|
46
54
|
|
|
47
55
|
// src/commands/te-analysis/capability-shared.ts
|
|
48
56
|
var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
|
|
@@ -51,12 +59,12 @@ var analysisDataExportRoutingHelp = "Routing: use export for full, unknown-size,
|
|
|
51
59
|
function createAnalysisCapabilityCommand(config) {
|
|
52
60
|
const cliPath = resolveAnalysisGatewayCliPath(config);
|
|
53
61
|
const { asyncArtifact, ...coreConfig } = config;
|
|
54
|
-
const
|
|
62
|
+
const command2 = createCapabilityCommand({
|
|
55
63
|
...coreConfig,
|
|
56
64
|
...cliPath,
|
|
57
65
|
gatewayDomain: "analysis"
|
|
58
66
|
});
|
|
59
|
-
return asyncArtifact ? withAsyncArtifactLifecycle(
|
|
67
|
+
return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
|
|
60
68
|
}
|
|
61
69
|
function resolveAnalysisGatewayCliPath(config) {
|
|
62
70
|
const [capabilityService, capabilityResource, capabilityAction, ...extraSegments] = config.capabilityId.split(".");
|
|
@@ -73,32 +81,32 @@ function resolveAnalysisGatewayCliPath(config) {
|
|
|
73
81
|
);
|
|
74
82
|
}
|
|
75
83
|
const resource = capabilityResource.replaceAll("_", "-");
|
|
76
|
-
const
|
|
84
|
+
const command2 = capabilityAction.replaceAll("_", "-");
|
|
77
85
|
const expectedLegacyResource = `${capabilityService} ${resource}`;
|
|
78
|
-
if (config.resource !== expectedLegacyResource || config.command !==
|
|
86
|
+
if (config.resource !== expectedLegacyResource || config.command !== command2) {
|
|
79
87
|
throw new Error(
|
|
80
|
-
`Capability '${config.capabilityId}' must map to ae-cli ${capabilityService} ${resource} ${
|
|
88
|
+
`Capability '${config.capabilityId}' must map to ae-cli ${capabilityService} ${resource} ${command2}.`
|
|
81
89
|
);
|
|
82
90
|
}
|
|
83
|
-
return { cliService: capabilityService, resource, command };
|
|
91
|
+
return { cliService: capabilityService, resource, command: command2 };
|
|
84
92
|
}
|
|
85
93
|
function createAnalysisMetaCapabilityCommand(config) {
|
|
86
94
|
const { asyncArtifact, ...coreConfig } = config;
|
|
87
|
-
const
|
|
95
|
+
const command2 = createCapabilityCommand({
|
|
88
96
|
...coreConfig,
|
|
89
97
|
cliService: "analysis-meta",
|
|
90
98
|
gatewayDomain: "analysis"
|
|
91
99
|
});
|
|
92
|
-
return asyncArtifact ? withAsyncArtifactLifecycle(
|
|
100
|
+
return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
|
|
93
101
|
}
|
|
94
102
|
function createAnalysisGovernanceCapabilityCommand(config) {
|
|
95
103
|
const { asyncArtifact, ...coreConfig } = config;
|
|
96
|
-
const
|
|
104
|
+
const command2 = createCapabilityCommand({
|
|
97
105
|
...coreConfig,
|
|
98
106
|
cliService: "analysis-governance",
|
|
99
107
|
gatewayDomain: "analysis"
|
|
100
108
|
});
|
|
101
|
-
return asyncArtifact ? withAsyncArtifactLifecycle(
|
|
109
|
+
return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
|
|
102
110
|
}
|
|
103
111
|
var projectIdFlag = {
|
|
104
112
|
name: "project-id",
|
|
@@ -184,6 +192,12 @@ var directoryOffsetFlag = {
|
|
|
184
192
|
alias: "o",
|
|
185
193
|
min: 0
|
|
186
194
|
};
|
|
195
|
+
var manageableOnlyFlag = {
|
|
196
|
+
name: "manageable-only",
|
|
197
|
+
type: "boolean",
|
|
198
|
+
required: false,
|
|
199
|
+
desc: "Restrict the list to assets the current user can edit or manage. Defaults to all readable assets."
|
|
200
|
+
};
|
|
187
201
|
var certificationScopeFlag = {
|
|
188
202
|
name: "certification-scope",
|
|
189
203
|
type: "string",
|
|
@@ -281,6 +295,7 @@ function reportListInput(ctx) {
|
|
|
281
295
|
return compactInput({
|
|
282
296
|
...listInput(ctx),
|
|
283
297
|
model_types: optionalJson(ctx, "model-types"),
|
|
298
|
+
manageable_only: optionalBoolean(ctx, "manageable-only"),
|
|
284
299
|
certification_scope: certificationScopeInput(ctx)
|
|
285
300
|
});
|
|
286
301
|
}
|
|
@@ -816,7 +831,7 @@ var metadataEventUpdate = createAnalysisMetaCapabilityCommand({
|
|
|
816
831
|
{ name: "remark", type: "string", required: false, desc: "Event remark." }
|
|
817
832
|
],
|
|
818
833
|
risk: "write",
|
|
819
|
-
buildInput: (ctx) => compactInput({ ...projectInput(ctx), event_name: ctx.str("event-name"), event_desc: optionalString(ctx, "event-desc"), remark:
|
|
834
|
+
buildInput: (ctx) => compactInput({ ...projectInput(ctx), event_name: ctx.str("event-name"), event_desc: optionalString(ctx, "event-desc"), remark: optionalStringPreserveEmpty(ctx, "remark") })
|
|
820
835
|
});
|
|
821
836
|
|
|
822
837
|
// src/commands/te-analysis/meta/event/relation-update.ts
|
|
@@ -1015,7 +1030,7 @@ var metadataPropertyUpdate = createAnalysisMetaCapabilityCommand({
|
|
|
1015
1030
|
{ name: "prop-remark", type: "string", required: false, desc: "Property remark." }
|
|
1016
1031
|
],
|
|
1017
1032
|
risk: "write",
|
|
1018
|
-
buildInput: (ctx) => compactInput({ ...projectInput(ctx), table_type: ctx.str("table-type"), prop_name: ctx.str("prop-name"), prop_desc: optionalString(ctx, "prop-desc"), prop_remark:
|
|
1033
|
+
buildInput: (ctx) => compactInput({ ...projectInput(ctx), table_type: ctx.str("table-type"), prop_name: ctx.str("prop-name"), prop_desc: optionalString(ctx, "prop-desc"), prop_remark: optionalStringPreserveEmpty(ctx, "prop-remark") })
|
|
1019
1034
|
});
|
|
1020
1035
|
|
|
1021
1036
|
// src/commands/te-analysis/meta/property/relation-update.ts
|
|
@@ -1223,7 +1238,7 @@ var metadataVirtualPropertyCreate = createAnalysisMetaCapabilityCommand({
|
|
|
1223
1238
|
{ name: "properties", type: "json", required: false, desc: "Dependent property JSON array." },
|
|
1224
1239
|
{ name: "sql-event-relation-type", type: "string", required: false, desc: "relation_default, relation_always, or relation_by_setting." },
|
|
1225
1240
|
{ name: "related-events", type: "json", required: false, desc: "Related events JSON array when using relation_by_setting." },
|
|
1226
|
-
{ name: "tag-date-policies", type: "json", required: false, desc: "
|
|
1241
|
+
{ name: "tag-date-policies", type: "json", required: false, desc: "Event SQL tag policies: [{tag_name,cluster_date_policy,specified_cluster_date?}]. LATEST or AUTO omit the date; SPECIFIED requires yyyy-MM-dd." },
|
|
1227
1242
|
{ name: "replace-remark", type: "string", required: false, desc: "Replacement remark." },
|
|
1228
1243
|
{ name: "replace-suggestion", type: "string", required: false, desc: "Replacement suggestion." }
|
|
1229
1244
|
],
|
|
@@ -1275,7 +1290,7 @@ var metadataVirtualPropertySqlRuleUpdate = createAnalysisMetaCapabilityCommand({
|
|
|
1275
1290
|
{ name: "properties", type: "json", required: false, desc: "Dependent property JSON array." },
|
|
1276
1291
|
{ name: "sql-event-relation-type", type: "string", required: false, desc: "relation_default, relation_always, or relation_by_setting." },
|
|
1277
1292
|
{ name: "related-events", type: "json", required: false, desc: "Related events JSON array when using relation_by_setting." },
|
|
1278
|
-
{ name: "tag-date-policies", type: "json", required: false, desc: "
|
|
1293
|
+
{ name: "tag-date-policies", type: "json", required: false, desc: "Event SQL tag policies: [{tag_name,cluster_date_policy,specified_cluster_date?}]. LATEST or AUTO omit the date; SPECIFIED requires yyyy-MM-dd." },
|
|
1279
1294
|
{ name: "replace-remark", type: "string", required: false, desc: "Replacement remark." },
|
|
1280
1295
|
{ name: "replace-suggestion", type: "string", required: false, desc: "Replacement suggestion." }
|
|
1281
1296
|
],
|
|
@@ -1462,7 +1477,7 @@ var metadataMetricUpdate = createAnalysisMetaCapabilityCommand({
|
|
|
1462
1477
|
metric_id: ctx.num("metric-id"),
|
|
1463
1478
|
metric_name: optionalString(ctx, "metric-name"),
|
|
1464
1479
|
metric_desc: optionalString(ctx, "metric-desc"),
|
|
1465
|
-
metric_remark:
|
|
1480
|
+
metric_remark: optionalStringPreserveEmpty(ctx, "metric-remark"),
|
|
1466
1481
|
metric_mode: optionalMetricMode(ctx),
|
|
1467
1482
|
metric_events: optionalJson(ctx, "metric-events"),
|
|
1468
1483
|
metric_params: optionalJson(ctx, "metric-params")
|
|
@@ -2459,12 +2474,12 @@ async function planBoundedExpansion(ctx, input) {
|
|
|
2459
2474
|
let finalExport = {};
|
|
2460
2475
|
let finalLimit = DEFAULT_LIMIT;
|
|
2461
2476
|
let stopReason = "top_100_inspected";
|
|
2462
|
-
for (const
|
|
2463
|
-
const exported = await exportRecommendationMaterial(ctx, input,
|
|
2477
|
+
for (const limit2 of EXPANSION_LIMITS) {
|
|
2478
|
+
const exported = await exportRecommendationMaterial(ctx, input, limit2);
|
|
2464
2479
|
finalExport = exported.data;
|
|
2465
|
-
const summary = summarizeExport(exported.data,
|
|
2480
|
+
const summary = summarizeExport(exported.data, limit2);
|
|
2466
2481
|
attempts.push(summary);
|
|
2467
|
-
finalLimit =
|
|
2482
|
+
finalLimit = limit2;
|
|
2468
2483
|
const pendingAssets = numberValue(summary.pending_asset_candidates);
|
|
2469
2484
|
const pendingWorkUnits = numberValue(summary.pending_work_units);
|
|
2470
2485
|
const hasMore = summary.has_more === true;
|
|
@@ -2492,12 +2507,12 @@ async function planBoundedExpansion(ctx, input) {
|
|
|
2492
2507
|
finalExport
|
|
2493
2508
|
};
|
|
2494
2509
|
}
|
|
2495
|
-
function exportRecommendationMaterial(ctx, input,
|
|
2510
|
+
function exportRecommendationMaterial(ctx, input, limit2) {
|
|
2496
2511
|
return executeCapabilityWithEnvelope(
|
|
2497
2512
|
ctx.host(),
|
|
2498
2513
|
gatewayDomain(),
|
|
2499
2514
|
EXPORT_CAPABILITY_ID,
|
|
2500
|
-
compactInput({ ...input, limit, include_completed: false })
|
|
2515
|
+
compactInput({ ...input, limit: limit2, include_completed: false })
|
|
2501
2516
|
);
|
|
2502
2517
|
}
|
|
2503
2518
|
function summarizeExport(result, requestedLimit) {
|
|
@@ -2520,12 +2535,12 @@ function countPendingAssetCandidates(workUnits) {
|
|
|
2520
2535
|
const seen = /* @__PURE__ */ new Set();
|
|
2521
2536
|
for (const unit of workUnits) {
|
|
2522
2537
|
for (const candidate of array(record(unit).asset_candidates)) {
|
|
2523
|
-
const
|
|
2524
|
-
if (
|
|
2538
|
+
const item2 = record(candidate);
|
|
2539
|
+
if (item2.actionable !== true || item2.action_state !== "PENDING") {
|
|
2525
2540
|
continue;
|
|
2526
2541
|
}
|
|
2527
|
-
const type = stringValue(
|
|
2528
|
-
const key = stringValue(
|
|
2542
|
+
const type = stringValue(item2.resource_type);
|
|
2543
|
+
const key = stringValue(item2.resource_key);
|
|
2529
2544
|
if (type && key) {
|
|
2530
2545
|
seen.add(`${type}|${key}`);
|
|
2531
2546
|
}
|
|
@@ -2629,13 +2644,13 @@ function autoReviewReason(reason) {
|
|
|
2629
2644
|
}
|
|
2630
2645
|
function autoReviewItemsWithDisplayReason(items) {
|
|
2631
2646
|
return array(items).map((value) => {
|
|
2632
|
-
const
|
|
2647
|
+
const item2 = record(value);
|
|
2633
2648
|
const copy = {
|
|
2634
|
-
...
|
|
2635
|
-
semantic_duplicate_targets: semanticDuplicateTargetsFromReason(stringValue(
|
|
2649
|
+
...item2,
|
|
2650
|
+
semantic_duplicate_targets: semanticDuplicateTargetsFromReason(stringValue(item2.reason) ?? "")
|
|
2636
2651
|
};
|
|
2637
|
-
if (
|
|
2638
|
-
copy.display_reason = autoReviewDisplayReason(
|
|
2652
|
+
if (item2.decision !== "APPROVE") {
|
|
2653
|
+
copy.display_reason = autoReviewDisplayReason(item2);
|
|
2639
2654
|
}
|
|
2640
2655
|
return copy;
|
|
2641
2656
|
});
|
|
@@ -2754,7 +2769,7 @@ function semanticDuplicateTargetsFromReason(reason) {
|
|
|
2754
2769
|
return array(decodeReasonPayload(encoded).targets);
|
|
2755
2770
|
}
|
|
2756
2771
|
function listIncludes(value, expected) {
|
|
2757
|
-
return array(value).some((
|
|
2772
|
+
return array(value).some((item2) => item2 === expected);
|
|
2758
2773
|
}
|
|
2759
2774
|
function buildManualReviewHandoff(autoReviewResult, exportResult) {
|
|
2760
2775
|
const result = record(autoReviewResult);
|
|
@@ -2800,7 +2815,7 @@ function buildManualReviewHandoff(autoReviewResult, exportResult) {
|
|
|
2800
2815
|
});
|
|
2801
2816
|
}
|
|
2802
2817
|
const pageReviewItems = buildPageReviewItems(handoffItems, candidates, relations, decisions);
|
|
2803
|
-
const pageReviewIds = new Set(pageReviewItems.map((
|
|
2818
|
+
const pageReviewIds = new Set(pageReviewItems.map((item2) => stringValue(item2.client_item_id)).filter(Boolean));
|
|
2804
2819
|
return {
|
|
2805
2820
|
schema_version: "1.0",
|
|
2806
2821
|
handoff_type: "auto_review_uncertified_assets_to_page_review",
|
|
@@ -2816,10 +2831,10 @@ function buildManualReviewHandoff(autoReviewResult, exportResult) {
|
|
|
2816
2831
|
skipped: result.skipped,
|
|
2817
2832
|
overflow: result.overflow,
|
|
2818
2833
|
approved_items: autoCertifiedItems,
|
|
2819
|
-
skipped_items: handoffItems.map((
|
|
2820
|
-
target_ref: record(
|
|
2821
|
-
display_name:
|
|
2822
|
-
manual_review_reason:
|
|
2834
|
+
skipped_items: handoffItems.map((item2) => ({
|
|
2835
|
+
target_ref: record(item2.target_ref),
|
|
2836
|
+
display_name: item2.display_name,
|
|
2837
|
+
manual_review_reason: item2.manual_review_reason
|
|
2823
2838
|
}))
|
|
2824
2839
|
},
|
|
2825
2840
|
auto_certified_items: autoCertifiedItems,
|
|
@@ -2848,8 +2863,8 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
|
|
|
2848
2863
|
const id = stringValue(candidate.client_item_id);
|
|
2849
2864
|
if (id) byId.set(id, candidate);
|
|
2850
2865
|
}
|
|
2851
|
-
for (const
|
|
2852
|
-
const id = stringValue(
|
|
2866
|
+
for (const item2 of handoffItems) {
|
|
2867
|
+
const id = stringValue(item2.client_item_id);
|
|
2853
2868
|
if (id) requiredIds.add(id);
|
|
2854
2869
|
}
|
|
2855
2870
|
let changed = true;
|
|
@@ -2864,7 +2879,7 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
|
|
|
2864
2879
|
}
|
|
2865
2880
|
}
|
|
2866
2881
|
}
|
|
2867
|
-
const handoffById = new Map(handoffItems.map((
|
|
2882
|
+
const handoffById = new Map(handoffItems.map((item2) => [stringValue(item2.client_item_id), item2]).filter((entry) => !!entry[0]));
|
|
2868
2883
|
return candidates.map(record).filter((candidate) => {
|
|
2869
2884
|
const id = stringValue(candidate.client_item_id);
|
|
2870
2885
|
return id !== void 0 && requiredIds.has(id);
|
|
@@ -2880,15 +2895,15 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
|
|
|
2880
2895
|
});
|
|
2881
2896
|
}
|
|
2882
2897
|
function markContextCandidate(candidate, decision) {
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2885
|
-
|
|
2898
|
+
const item2 = { ...candidate };
|
|
2899
|
+
item2.manual_review_context = true;
|
|
2900
|
+
item2.manual_review_reason = "\u8BE5\u8D44\u4EA7\u7528\u4E8E\u4FDD\u7559\u81EA\u52A8\u53D1\u73B0\u9875\u9762\u7684\u7236\u5B50\u5C42\u7EA7\u548C\u6765\u6E90\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u4F5C\u4E3A\u672C\u6B21\u4EBA\u5DE5\u5BA1\u6838\u5BF9\u8C61\u3002";
|
|
2886
2901
|
if (decision?.decision === "APPROVE" && decision.landing_status === "APPLIED") {
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2902
|
+
item2.auto_review_decision = decision.raw;
|
|
2903
|
+
item2.auto_review_context_reason = autoReviewDisplayReason(decision.raw, candidate);
|
|
2904
|
+
item2.evidence_snapshot = markEvidenceAuthenticated(record(candidate.evidence_snapshot));
|
|
2890
2905
|
}
|
|
2891
|
-
return
|
|
2906
|
+
return item2;
|
|
2892
2907
|
}
|
|
2893
2908
|
function markEvidenceAuthenticated(evidence) {
|
|
2894
2909
|
const snapshot = { ...evidence };
|
|
@@ -2901,21 +2916,21 @@ function markEvidenceAuthenticated(evidence) {
|
|
|
2901
2916
|
function decisionsByAsset(value) {
|
|
2902
2917
|
const result = /* @__PURE__ */ new Map();
|
|
2903
2918
|
for (const itemValue of array(value)) {
|
|
2904
|
-
const
|
|
2905
|
-
if (
|
|
2919
|
+
const item2 = record(itemValue);
|
|
2920
|
+
if (item2.item_type !== "asset") {
|
|
2906
2921
|
continue;
|
|
2907
2922
|
}
|
|
2908
|
-
const type = stringValue(
|
|
2909
|
-
const key = stringValue(
|
|
2923
|
+
const type = stringValue(item2.resource_type);
|
|
2924
|
+
const key = stringValue(item2.resource_key);
|
|
2910
2925
|
if (!type || !key) {
|
|
2911
2926
|
continue;
|
|
2912
2927
|
}
|
|
2913
2928
|
const assetKey = `${type}|${key}`;
|
|
2914
2929
|
result.set(assetKey, {
|
|
2915
2930
|
assetKey,
|
|
2916
|
-
decision: stringValue(
|
|
2917
|
-
landing_status: stringValue(
|
|
2918
|
-
raw:
|
|
2931
|
+
decision: stringValue(item2.decision) ?? "",
|
|
2932
|
+
landing_status: stringValue(item2.landing_status) ?? "",
|
|
2933
|
+
raw: item2
|
|
2919
2934
|
});
|
|
2920
2935
|
}
|
|
2921
2936
|
return result;
|
|
@@ -3253,8 +3268,8 @@ var agentReviewSubmitToPage = createAnalysisMetaCapabilityCommand({
|
|
|
3253
3268
|
});
|
|
3254
3269
|
function validateInput(input) {
|
|
3255
3270
|
const items = array2(input.items, "items").map((value) => {
|
|
3256
|
-
const
|
|
3257
|
-
fields(
|
|
3271
|
+
const item2 = object(value, "items[]");
|
|
3272
|
+
fields(item2, [
|
|
3258
3273
|
"client_item_id",
|
|
3259
3274
|
"target_ref",
|
|
3260
3275
|
"action_type",
|
|
@@ -3264,10 +3279,10 @@ function validateInput(input) {
|
|
|
3264
3279
|
"source_link",
|
|
3265
3280
|
"evidence_links"
|
|
3266
3281
|
], "items[]");
|
|
3267
|
-
if (typeof
|
|
3282
|
+
if (typeof item2.client_item_id !== "string" || !item2.client_item_id.trim()) {
|
|
3268
3283
|
throw new Error("items[].client_item_id must be a nonempty string.");
|
|
3269
3284
|
}
|
|
3270
|
-
const target = object(
|
|
3285
|
+
const target = object(item2.target_ref, "items[].target_ref");
|
|
3271
3286
|
const targetType = typeof target.type === "string" ? target.type.trim() : "";
|
|
3272
3287
|
const targetKey = typeof target.key === "string" ? target.key.trim() : "";
|
|
3273
3288
|
if (!targetType || !targetKey) {
|
|
@@ -3276,21 +3291,21 @@ function validateInput(input) {
|
|
|
3276
3291
|
if (!supportedTargetTypes.has(targetType)) {
|
|
3277
3292
|
throw new Error("items[].target_ref.type must be one of dashboard, report, event, event_prop, user_prop, user_tag, user_cluster, metric.");
|
|
3278
3293
|
}
|
|
3279
|
-
const proposal = object(
|
|
3294
|
+
const proposal = object(item2.proposal_payload, "items[].proposal_payload");
|
|
3280
3295
|
fields(proposal, ["authentication_status"], "items[].proposal_payload");
|
|
3281
|
-
if (
|
|
3296
|
+
if (item2.action_type !== "CERTIFY" || proposal.authentication_status !== 1) {
|
|
3282
3297
|
throw new Error("Only CERTIFY with authentication_status=1 is supported by the review page.");
|
|
3283
3298
|
}
|
|
3284
|
-
const aiSummary = object(
|
|
3285
|
-
const evidenceSnapshot = object(
|
|
3286
|
-
validateItemAiSummary(aiSummary, `items[${String(
|
|
3299
|
+
const aiSummary = object(item2.ai_summary, "items[].ai_summary");
|
|
3300
|
+
const evidenceSnapshot = object(item2.evidence_snapshot, "items[].evidence_snapshot");
|
|
3301
|
+
validateItemAiSummary(aiSummary, `items[${String(item2.client_item_id)}].ai_summary`);
|
|
3287
3302
|
if (targetType === "report") {
|
|
3288
|
-
validateReportAnalysis(aiSummary, evidenceSnapshot, `items[${String(
|
|
3303
|
+
validateReportAnalysis(aiSummary, evidenceSnapshot, `items[${String(item2.client_item_id)}]`);
|
|
3289
3304
|
}
|
|
3290
|
-
validateEvidenceLinks(
|
|
3291
|
-
return
|
|
3305
|
+
validateEvidenceLinks(item2);
|
|
3306
|
+
return item2;
|
|
3292
3307
|
});
|
|
3293
|
-
unique(items.map((
|
|
3308
|
+
unique(items.map((item2) => item2.client_item_id), "client_item_id");
|
|
3294
3309
|
fields(input, [
|
|
3295
3310
|
"project_id",
|
|
3296
3311
|
"review_type",
|
|
@@ -3305,7 +3320,7 @@ function validateInput(input) {
|
|
|
3305
3320
|
"items"
|
|
3306
3321
|
], "submit-to-page input");
|
|
3307
3322
|
object(input.ai_summary, "ai_summary");
|
|
3308
|
-
validatePresentation(object(input.presentation_snapshot, "presentation_snapshot"), new Set(items.map((
|
|
3323
|
+
validatePresentation(object(input.presentation_snapshot, "presentation_snapshot"), new Set(items.map((item2) => item2.client_item_id)));
|
|
3309
3324
|
if (input.review_type !== "ASSET_GOVERNANCE" || input.schema_version !== "1.0") {
|
|
3310
3325
|
throw new Error("submit-to-page input requires review_type=ASSET_GOVERNANCE and schema_version=1.0.");
|
|
3311
3326
|
}
|
|
@@ -3365,11 +3380,11 @@ function resolvesAnalysisPath(analysis, path) {
|
|
|
3365
3380
|
}
|
|
3366
3381
|
return index === suffix.length;
|
|
3367
3382
|
}
|
|
3368
|
-
function validateEvidenceLinks(
|
|
3369
|
-
const sourceLink = typeof
|
|
3383
|
+
function validateEvidenceLinks(item2) {
|
|
3384
|
+
const sourceLink = typeof item2.source_link === "string" && item2.source_link.trim();
|
|
3370
3385
|
let evidenceLink = false;
|
|
3371
|
-
if ("evidence_links" in
|
|
3372
|
-
evidenceLink = array2(
|
|
3386
|
+
if ("evidence_links" in item2) {
|
|
3387
|
+
evidenceLink = array2(item2.evidence_links, "items[].evidence_links").some((value) => {
|
|
3373
3388
|
const link = object(value, "items[].evidence_links[]");
|
|
3374
3389
|
return typeof link.url === "string" && !!link.url.trim();
|
|
3375
3390
|
});
|
|
@@ -3393,16 +3408,16 @@ function validatePresentation(presentation, itemIds) {
|
|
|
3393
3408
|
throw new Error("presentation_snapshot.topics[].groups[] requires nonempty string id and name.");
|
|
3394
3409
|
}
|
|
3395
3410
|
for (const itemValue of array2(group.items, "presentation_snapshot.topics[].groups[].items")) {
|
|
3396
|
-
const
|
|
3397
|
-
if (typeof
|
|
3411
|
+
const item2 = object(itemValue, "presentation_snapshot.topics[].groups[].items[]");
|
|
3412
|
+
if (typeof item2.id !== "string" || !item2.id.trim()) {
|
|
3398
3413
|
throw new Error("presentation_snapshot display items require nonempty string id.");
|
|
3399
3414
|
}
|
|
3400
|
-
if (!itemIds.has(
|
|
3415
|
+
if (!itemIds.has(item2.id)) {
|
|
3401
3416
|
throw new Error("presentation_snapshot references an unknown client_item_id.");
|
|
3402
3417
|
}
|
|
3403
|
-
displayed.add(
|
|
3404
|
-
topicItemIds.add(
|
|
3405
|
-
groupItemIds.add(
|
|
3418
|
+
displayed.add(item2.id);
|
|
3419
|
+
topicItemIds.add(item2.id);
|
|
3420
|
+
groupItemIds.add(item2.id);
|
|
3406
3421
|
}
|
|
3407
3422
|
if (group.semantic_basis !== void 0) {
|
|
3408
3423
|
const basis = object(group.semantic_basis, "presentation_snapshot.topics[].groups[].semantic_basis");
|
|
@@ -3538,9 +3553,9 @@ var agentReviewList = createAnalysisMetaCapabilityCommand({
|
|
|
3538
3553
|
risk: "read",
|
|
3539
3554
|
flags: [projectFlag, { name: "limit", type: "number", min: 1, max: 500, default: 20, desc: "Maximum recent batches, from 1 to 500. Default: 20." }],
|
|
3540
3555
|
buildInput: (ctx) => {
|
|
3541
|
-
const
|
|
3542
|
-
if (!Number.isInteger(
|
|
3543
|
-
return { ...projectInput2(ctx), limit };
|
|
3556
|
+
const limit2 = ctx.str("limit") === "" ? 20 : ctx.num("limit");
|
|
3557
|
+
if (!Number.isInteger(limit2) || limit2 < 1 || limit2 > 500) throw new Error("--limit must be an integer from 1 to 500.");
|
|
3558
|
+
return { ...projectInput2(ctx), limit: limit2 };
|
|
3544
3559
|
}
|
|
3545
3560
|
});
|
|
3546
3561
|
var agentReviewDetail = createAnalysisMetaCapabilityCommand({
|
|
@@ -4048,7 +4063,7 @@ function normalizeRef(value, index) {
|
|
|
4048
4063
|
function validateStringArray(ctx, name, allowed) {
|
|
4049
4064
|
const value = optionalJson(ctx, name);
|
|
4050
4065
|
if (value === void 0) return;
|
|
4051
|
-
if (!Array.isArray(value) || value.length === 0 || value.some((
|
|
4066
|
+
if (!Array.isArray(value) || value.length === 0 || value.some((item2) => typeof item2 !== "string" || !allowed.has(item2))) {
|
|
4052
4067
|
throw new CliValidationError(`--${name} must be a non-empty JSON array of supported values`);
|
|
4053
4068
|
}
|
|
4054
4069
|
}
|
|
@@ -4119,7 +4134,7 @@ var expectedSnapshotHashFlag = {
|
|
|
4119
4134
|
name: "expected-snapshot-hash",
|
|
4120
4135
|
type: "string",
|
|
4121
4136
|
required: false,
|
|
4122
|
-
desc: "
|
|
4137
|
+
desc: "Deprecated compatibility no-op. Project snapshots are not checked; only specified assets are updated."
|
|
4123
4138
|
};
|
|
4124
4139
|
var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabilityCommand({
|
|
4125
4140
|
resource: "asset-authentication",
|
|
@@ -4137,13 +4152,17 @@ var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabi
|
|
|
4137
4152
|
requestIdFlag
|
|
4138
4153
|
],
|
|
4139
4154
|
risk: "write",
|
|
4140
|
-
buildInput: (ctx) =>
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4155
|
+
buildInput: (ctx) => {
|
|
4156
|
+
if (optionalString(ctx, "expected-snapshot-hash") !== void 0) {
|
|
4157
|
+
process.stderr.write("Warning: --expected-snapshot-hash is deprecated and ignored. Only the specified assets are updated; project snapshots are not checked.\n");
|
|
4158
|
+
}
|
|
4159
|
+
return compactInput({
|
|
4160
|
+
project_id: ctx.num("project-id"),
|
|
4161
|
+
authentication_status: ctx.num("authentication-status"),
|
|
4162
|
+
asset_refs: assetRefsInput(ctx),
|
|
4163
|
+
request_id: optionalString(ctx, "request-id")
|
|
4164
|
+
});
|
|
4165
|
+
}
|
|
4147
4166
|
});
|
|
4148
4167
|
|
|
4149
4168
|
// src/commands/te-analysis/governance/index.ts
|
|
@@ -4179,10 +4198,11 @@ var reportList = createAnalysisCapabilityCommand({
|
|
|
4179
4198
|
resource: "report",
|
|
4180
4199
|
command: "list",
|
|
4181
4200
|
capabilityId: "analysis.report.list",
|
|
4182
|
-
description: "List
|
|
4201
|
+
description: "List readable reports. For management workflows use --manageable-only. Use analysis asset search for asset discovery.",
|
|
4183
4202
|
flags: [
|
|
4184
4203
|
projectIdFlag,
|
|
4185
4204
|
queriesFlag,
|
|
4205
|
+
manageableOnlyFlag,
|
|
4186
4206
|
fieldsFlag,
|
|
4187
4207
|
reportModelTypesFlag,
|
|
4188
4208
|
reportListLimitFlag,
|
|
@@ -4258,7 +4278,7 @@ var REPORT_WRITE_MODEL_TYPE_VALUES = [
|
|
|
4258
4278
|
"tag"
|
|
4259
4279
|
];
|
|
4260
4280
|
var REPORT_WRITE_MODEL_DESCRIPTION = `${AI_MODEL_DESCRIPTION} Report create/update also supports tag for saved tag report data; use tag as the AI-facing spelling.`;
|
|
4261
|
-
var AI_DEFINITION_DESCRIPTION = 'Event metrics: omit optional display_name unless the target command schema explicitly supports it. Funnel step filters use event_property_name (not field) and string-array values, including "true"/"false" for boolean properties. For tag/cluster filters, cluster_date_policy accepts LATEST (default), AUTO (match the computed result for each analysis date), or SPECIFIED (requires specified_cluster_date in yyyy-MM-dd format). AI-facing model definition JSON. Do not pass raw QP, events, event_view, visual_view, or analysis_query. Distribution filters must be attached to the corresponding distribution_metrics[].filters; do not use top-level filters or relation. For path definitions, global filters support user_property, cluster, and tag only; event_property is not supported. session_unit accepts second (1..999), minute (1..999), or hour (1..24). Do not use day; express one day as session_interval=24 and session_unit=hour. For SQL, a simple query is {"sql":"select ..."}; raw variables use ${name}, while typed params use ${Text:name}, ${Selector:name}, or ${PartDate:name}. PartDate expands to a complete predicate, so write WHERE ${PartDate:d}, not a column followed by the placeholder. A part_date parameter may set boolean use_timezone; it defaults to false and controls whether that parameter uses the query effective timezone. Selector value must match one options[].value. Trino identifiers containing #, $, @, spaces, punctuation, or a reserved word must be delimited with double quotes, for example SELECT "#user_id", "$part_event", "end" FROM ...; single quotes are string literals. For multiline SQL JSON, the decoded sql value must contain a real line break; do not submit a literal \\n sequence outside quoted SQL text. Queries against an event table must include a date-partition predicate on the quoted "$part_date" column, for example WHERE "$part_date" BETWEEN \'2026-07-01\' AND \'2026-07-07\'; the backend rejects event-table SQL without it. The CLI preserves SQL text and never auto-quotes identifiers.';
|
|
4281
|
+
var AI_DEFINITION_DESCRIPTION = 'Event metrics: omit optional display_name unless the target command schema explicitly supports it. Funnel step filters use event_property_name (not field) and string-array values, including "true"/"false" for boolean properties. For tag/cluster filters and groups, put the policy beside field. For tags, AUTO and SPECIFIED require has_history_versions=true from analysis-meta catalog list. Only local SPECIFIED dates must match user-tag get --include-history-dates true. cluster_date_policy accepts LATEST (default), AUTO (match the computed result for each analysis date), or SPECIFIED (requires specified_cluster_date in yyyy-MM-dd format). AI-facing model definition JSON. Do not pass raw QP, events, event_view, visual_view, or analysis_query. Distribution filters must be attached to the corresponding distribution_metrics[].filters; do not use top-level filters or relation. For path definitions, global filters support user_property, cluster, and tag only; event_property is not supported. session_unit accepts second (1..999), minute (1..999), or hour (1..24). Do not use day; express one day as session_interval=24 and session_unit=hour. For SQL, a simple query is {"sql":"select ..."}; raw variables use ${name}, while typed params use ${Text:name}, ${Selector:name}, or ${PartDate:name}. PartDate expands to a complete predicate, so write WHERE ${PartDate:d}, not a column followed by the placeholder. A part_date parameter may set boolean use_timezone; it defaults to false and controls whether that parameter uses the query effective timezone. Selector value must match one options[].value. Trino identifiers containing #, $, @, spaces, punctuation, or a reserved word must be delimited with double quotes, for example SELECT "#user_id", "$part_event", "end" FROM ...; single quotes are string literals. For multiline SQL JSON, the decoded sql value must contain a real line break; do not submit a literal \\n sequence outside quoted SQL text. Queries against an event table must include a date-partition predicate on the quoted "$part_date" column, for example WHERE "$part_date" BETWEEN \'2026-07-01\' AND \'2026-07-07\'; the backend rejects event-table SQL without it. The CLI preserves SQL text and never auto-quotes identifiers.';
|
|
4262
4282
|
var REPORT_WRITE_DEFINITION_DESCRIPTION = `${AI_DEFINITION_DESCRIPTION} Saved funnel definitions may set optional funnel.steps[].display_name; report get returns it and report create/update preserves it. Saved-report filters may contain one compound group level only; every item inside that group must be a leaf without another items array. Historical deeper trees remain readable but cannot be written back as a definition. For model_type=tag, pass a tag report intent such as {"tag":{"tag_name":"vip_users","time_range":{"mode":"recent","unit":"day","value":7}}}. Tags are supported for report create/update and report data, not ad-hoc analysis.`;
|
|
4263
4283
|
function aiModelTypeFlag(required) {
|
|
4264
4284
|
return {
|
|
@@ -4285,7 +4305,7 @@ function validateFunnelStepFilters(modelType, definition) {
|
|
|
4285
4305
|
if (!Array.isArray(filter.items) || filter.items.length === 0) {
|
|
4286
4306
|
errors.push(`${location}.items: use a non-empty array of event-property filters or nested groups.`);
|
|
4287
4307
|
} else {
|
|
4288
|
-
filter.items.forEach((
|
|
4308
|
+
filter.items.forEach((item2, index) => visit(item2, `${location}.items[${index}]`));
|
|
4289
4309
|
}
|
|
4290
4310
|
return;
|
|
4291
4311
|
}
|
|
@@ -4385,12 +4405,12 @@ function validateReportPresentation(ctx) {
|
|
|
4385
4405
|
function validateSeries(value) {
|
|
4386
4406
|
if (!Array.isArray(value)) throw new Error("--presentation.series must be an array; [] resets all series.");
|
|
4387
4407
|
const indexes = /* @__PURE__ */ new Set();
|
|
4388
|
-
for (const [position,
|
|
4408
|
+
for (const [position, item2] of value.entries()) {
|
|
4389
4409
|
const path = `--presentation.series[${position}]`;
|
|
4390
|
-
if (!
|
|
4410
|
+
if (!item2 || typeof item2 !== "object" || Array.isArray(item2) || Object.keys(item2).length !== 3 || Object.keys(item2).some((key) => !["metric_index", "type", "axis"].includes(key))) {
|
|
4391
4411
|
throw new Error(`${path} requires only metric_index, type, and axis, all three required.`);
|
|
4392
4412
|
}
|
|
4393
|
-
const series =
|
|
4413
|
+
const series = item2;
|
|
4394
4414
|
if (typeof series.metric_index !== "number" || !Number.isInteger(series.metric_index) || series.metric_index < 1) {
|
|
4395
4415
|
throw new Error(`${path}.metric_index must be a positive 1-based integer position in definition.metrics.`);
|
|
4396
4416
|
}
|
|
@@ -4548,12 +4568,12 @@ async function withSqlSelectorRuntimeErrorHint(operation) {
|
|
|
4548
4568
|
throw enrichSqlSelectorRuntimeError(error);
|
|
4549
4569
|
}
|
|
4550
4570
|
}
|
|
4551
|
-
function withSqlSelectorRuntimeDiagnostics(
|
|
4552
|
-
const validateInput2 =
|
|
4553
|
-
const dryRun =
|
|
4554
|
-
const execute =
|
|
4571
|
+
function withSqlSelectorRuntimeDiagnostics(command2) {
|
|
4572
|
+
const validateInput2 = command2.validateInput;
|
|
4573
|
+
const dryRun = command2.dryRun;
|
|
4574
|
+
const execute = command2.execute;
|
|
4555
4575
|
return {
|
|
4556
|
-
...
|
|
4576
|
+
...command2,
|
|
4557
4577
|
...validateInput2 ? { validateInput: (ctx) => withSqlSelectorRuntimeErrorHint(() => validateInput2(ctx)) } : {},
|
|
4558
4578
|
...dryRun ? { dryRun: (ctx) => withSqlSelectorRuntimeErrorHint(() => dryRun(ctx)) } : {},
|
|
4559
4579
|
execute: (ctx) => withSqlSelectorRuntimeErrorHint(() => execute(ctx))
|
|
@@ -4739,10 +4759,11 @@ var dashboardList = createAnalysisCapabilityCommand({
|
|
|
4739
4759
|
resource: "dashboard",
|
|
4740
4760
|
command: "list",
|
|
4741
4761
|
capabilityId: "analysis.dashboard.list",
|
|
4742
|
-
description: "List dashboards
|
|
4762
|
+
description: "List readable dashboards. For management workflows use --manageable-only. Use analysis asset search for asset discovery.",
|
|
4743
4763
|
flags: [
|
|
4744
4764
|
projectIdFlag,
|
|
4745
4765
|
queriesFlag,
|
|
4766
|
+
manageableOnlyFlag,
|
|
4746
4767
|
{
|
|
4747
4768
|
name: "fields",
|
|
4748
4769
|
type: "json",
|
|
@@ -4758,6 +4779,7 @@ var dashboardList = createAnalysisCapabilityCommand({
|
|
|
4758
4779
|
validate: validateQueriesFlag,
|
|
4759
4780
|
buildInput: (ctx) => compactInput({
|
|
4760
4781
|
...listInput(ctx),
|
|
4782
|
+
manageable_only: optionalBoolean(ctx, "manageable-only"),
|
|
4761
4783
|
certification_scope: certificationScopeInput(ctx)
|
|
4762
4784
|
})
|
|
4763
4785
|
});
|
|
@@ -4824,7 +4846,7 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
|
|
|
4824
4846
|
{ name: "note-id", type: "number", required: false, desc: "Dashboard note ID. Omit to create a new note attached to the dashboard." },
|
|
4825
4847
|
{ name: "note-title", type: "string", required: false, desc: "Dashboard note title. Defaults to empty on create; omitted values are preserved on update." },
|
|
4826
4848
|
{ name: "description", type: "string", required: false, desc: "Dashboard note description. Defaults to empty on create; omitted values are preserved on update." },
|
|
4827
|
-
{ name: "ui-config", type: "string", required: false, desc: "
|
|
4849
|
+
{ name: "ui-config", type: "string", required: false, desc: "Note UI config string. Omitted note style is preserved on update. Retained as a deprecated no-op for settings." },
|
|
4828
4850
|
{ name: "filter-name", type: "string", required: false, desc: "Saved filter name. Required with --operation default-filter or personal-default-filter." },
|
|
4829
4851
|
{ name: "filter", type: "json", required: false, desc: 'Saved filter in snake_case QP form: root junction_kind (and/or) and ta_filters array; SIMPLE conditions use filter_type="SIMPLE", column_name, table_type ("0" event, "1" user, "2" cluster/tag), select_type, calcu_symbol (C00 equals), and ftv. Do not use metadata table names or property_name/values. Common validates the QP format; ae-cli forwards it without local QP validation. Required with --operation default-filter, personal-default-filter, or business-filter. Pass {"junction_kind":"and","ta_filters":[]} to clear a business filter.' },
|
|
4830
4852
|
payloadFlag
|
|
@@ -4875,7 +4897,7 @@ var dashboardShare = createAnalysisCapabilityCommand({
|
|
|
4875
4897
|
{ name: "member-authorities", type: "json", required: false, desc: 'Complete user authority map: {"<numeric_user_id>":"READ|EDIT|CREATOR|MAINTAIN"}. An empty object removes all directly shared users.' },
|
|
4876
4898
|
payloadFlag
|
|
4877
4899
|
],
|
|
4878
|
-
risk: "write",
|
|
4900
|
+
risk: "high-risk-write",
|
|
4879
4901
|
buildInput: (ctx) => compactInput({
|
|
4880
4902
|
...projectInput(ctx),
|
|
4881
4903
|
dashboard_id: ctx.num("dashboard-id"),
|
|
@@ -4909,7 +4931,7 @@ var dashboardHandover = createAnalysisCapabilityCommand({
|
|
|
4909
4931
|
{ name: "dashboard-ids", type: "json", required: true, desc: "Dashboard ID array." },
|
|
4910
4932
|
{ name: "to-user-id", type: "number", required: true, desc: "Target user ID." }
|
|
4911
4933
|
],
|
|
4912
|
-
risk: "write",
|
|
4934
|
+
risk: "high-risk-write",
|
|
4913
4935
|
buildInput: (ctx) => ({
|
|
4914
4936
|
...projectInput(ctx),
|
|
4915
4937
|
dashboard_ids: jsonArray(ctx, "dashboard-ids"),
|
|
@@ -5211,13 +5233,14 @@ var dashboardReportDataExport = createAnalysisCapabilityCommand({
|
|
|
5211
5233
|
clusterQueryScopeFlag,
|
|
5212
5234
|
slaveClusterIdFlag,
|
|
5213
5235
|
{ name: "zone-offset", type: "number", required: false, desc: reportDataZoneOffsetDescription },
|
|
5236
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Deprecated compatibility no-op. Exports always bypass query cache; true and false are accepted without changing execution." },
|
|
5214
5237
|
{ name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
|
|
5215
5238
|
asyncTimeoutSecondsFlag,
|
|
5216
5239
|
{ name: "artifact-format", type: "string", required: false, desc: "Artifact format. Only jsonl is supported." }
|
|
5217
5240
|
],
|
|
5218
5241
|
risk: "read",
|
|
5219
5242
|
validate: validateClusterQueryRouting,
|
|
5220
|
-
buildInput:
|
|
5243
|
+
buildInput: dashboardReportDataInput
|
|
5221
5244
|
});
|
|
5222
5245
|
|
|
5223
5246
|
// src/commands/te-analysis/dashboard-report-data/index.ts
|
|
@@ -5237,7 +5260,7 @@ var queryCancel = createAnalysisCapabilityCommand({
|
|
|
5237
5260
|
{ name: "run-id", type: "string", required: true, desc: "Async run ID returned by an export capability." },
|
|
5238
5261
|
{ name: "reason", type: "string", required: false, desc: "Optional cancellation reason." }
|
|
5239
5262
|
],
|
|
5240
|
-
risk: "write",
|
|
5263
|
+
risk: "high-risk-write",
|
|
5241
5264
|
buildInput: (ctx) => compactInput({
|
|
5242
5265
|
run_id: ctx.str("run-id"),
|
|
5243
5266
|
reason: optionalString(ctx, "reason")
|
|
@@ -5572,7 +5595,7 @@ var adhocRunFlags = [
|
|
|
5572
5595
|
analysisModelPreviewRowsFlag
|
|
5573
5596
|
];
|
|
5574
5597
|
var adhocExportFlags = [
|
|
5575
|
-
...adhocBaseFlags,
|
|
5598
|
+
...adhocBaseFlags.map((flag) => flag.name === "use-cache" ? { ...flag, desc: "Deprecated compatibility no-op. Exports always bypass query cache; true and false are accepted without changing execution." } : flag),
|
|
5576
5599
|
artifactFormatFlag,
|
|
5577
5600
|
asyncTimeoutSecondsFlag
|
|
5578
5601
|
];
|
|
@@ -5758,7 +5781,7 @@ function dailyReportUpdateFlags() {
|
|
|
5758
5781
|
{ name: "enable-slack", type: "boolean", required: false, desc: "Whether scheduled Slack delivery is enabled." },
|
|
5759
5782
|
...destinationFlags,
|
|
5760
5783
|
{ name: "send-date", type: "string", required: false, desc: "Scheduled weekdays, comma-separated 1..7." },
|
|
5761
|
-
{ name: "send-time", type: "string", required: false, desc: "Scheduled
|
|
5784
|
+
{ name: "send-time", type: "string", required: false, desc: "Scheduled whole hours: hour or HH:00, optionally comma-separated, for example 9 or 09:00,18:00." },
|
|
5762
5785
|
{ name: "enable-send", type: "boolean", required: false, desc: "Whether scheduled sending is enabled." }
|
|
5763
5786
|
];
|
|
5764
5787
|
}
|
|
@@ -5957,7 +5980,7 @@ var biPanelShare = createAnalysisCapabilityCommand({
|
|
|
5957
5980
|
capabilityId: "analysis.bi_panel.share",
|
|
5958
5981
|
description: "Modify BI panel sharing members.",
|
|
5959
5982
|
flags: [projectIdFlag, { name: "panel-id", type: "number", required: true, desc: "BI panel ID." }, payloadFlag],
|
|
5960
|
-
risk: "write",
|
|
5983
|
+
risk: "high-risk-write",
|
|
5961
5984
|
buildInput: (ctx) => compactInput({
|
|
5962
5985
|
...projectInput(ctx),
|
|
5963
5986
|
panel_id: ctx.num("panel-id"),
|
|
@@ -6933,6 +6956,12 @@ var autoRefreshCronFlag = {
|
|
|
6933
6956
|
desc: "Optional Quartz cron expression for an existing enabled auto-refresh schedule. This does not enable auto refresh."
|
|
6934
6957
|
};
|
|
6935
6958
|
var tagAutoRefreshFlags = [
|
|
6959
|
+
{
|
|
6960
|
+
name: "enable-history-tag-backup",
|
|
6961
|
+
type: "boolean",
|
|
6962
|
+
required: false,
|
|
6963
|
+
desc: "Save historical tag versions during scheduled refresh. Enabling requires periodic refresh. Omit on update to preserve the setting."
|
|
6964
|
+
},
|
|
6936
6965
|
{
|
|
6937
6966
|
name: "enable-auto-refresh",
|
|
6938
6967
|
type: "boolean",
|
|
@@ -7053,10 +7082,10 @@ var groupColFlag = {
|
|
|
7053
7082
|
required: true,
|
|
7054
7083
|
desc: "Exact statistic value or bucket from history-tag-data results to drill down into."
|
|
7055
7084
|
};
|
|
7056
|
-
function capability(resource,
|
|
7085
|
+
function capability(resource, command2, capabilityId, description, flags, risk, buildInput2, options = {}) {
|
|
7057
7086
|
return createAnalysisCapabilityCommand({
|
|
7058
7087
|
resource,
|
|
7059
|
-
command,
|
|
7088
|
+
command: command2,
|
|
7060
7089
|
capabilityId,
|
|
7061
7090
|
description,
|
|
7062
7091
|
flags,
|
|
@@ -7065,14 +7094,14 @@ function capability(resource, command, capabilityId, description, flags, risk, b
|
|
|
7065
7094
|
...options
|
|
7066
7095
|
});
|
|
7067
7096
|
}
|
|
7068
|
-
function idImportCapability(
|
|
7069
|
-
const originalValidate =
|
|
7070
|
-
const originalValidateInput =
|
|
7071
|
-
const originalDryRun =
|
|
7072
|
-
const originalExecute =
|
|
7097
|
+
function idImportCapability(command2) {
|
|
7098
|
+
const originalValidate = command2.validate;
|
|
7099
|
+
const originalValidateInput = command2.validateInput;
|
|
7100
|
+
const originalDryRun = command2.dryRun;
|
|
7101
|
+
const originalExecute = command2.execute;
|
|
7073
7102
|
return {
|
|
7074
|
-
...
|
|
7075
|
-
flags:
|
|
7103
|
+
...command2,
|
|
7104
|
+
flags: command2.flags.flatMap((flag) => flag.name === "input-file-id" ? [inputFileFlag, flag] : [flag]),
|
|
7076
7105
|
validate: (ctx) => {
|
|
7077
7106
|
originalValidate?.(ctx);
|
|
7078
7107
|
const sources = ["input-file", "input-file-id", "file-content"].filter((name) => ctx.str(name).trim() !== "");
|
|
@@ -7103,7 +7132,7 @@ function idImportCapability(command) {
|
|
|
7103
7132
|
},
|
|
7104
7133
|
{
|
|
7105
7134
|
method: "POST",
|
|
7106
|
-
url:
|
|
7135
|
+
url: buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `capabilities/${command2.capabilityId}/dry-run`),
|
|
7107
7136
|
body: {
|
|
7108
7137
|
input_file_id: "<input_file_id returned by upload step>",
|
|
7109
7138
|
note: "The remaining command flags are sent unchanged after upload."
|
|
@@ -7198,6 +7227,7 @@ function clusterWriteInput(ctx, create) {
|
|
|
7198
7227
|
function tagWriteInput(ctx, create) {
|
|
7199
7228
|
const definitionRequest = optionalJson(ctx, "definition-request");
|
|
7200
7229
|
validateDefinitionRequest(create, definitionRequest);
|
|
7230
|
+
const backup = optionalBoolean(ctx, "enable-history-tag-backup");
|
|
7201
7231
|
const enabled = optionalBoolean(ctx, "enable-auto-refresh");
|
|
7202
7232
|
const cron = optionalString(ctx, "auto-refresh-cron");
|
|
7203
7233
|
const schedule = optionalJson(ctx, "auto-refresh-schedule");
|
|
@@ -7207,6 +7237,9 @@ function tagWriteInput(ctx, create) {
|
|
|
7207
7237
|
if (enabled === false && (cron !== void 0 || schedule !== void 0)) {
|
|
7208
7238
|
throw new Error("Cannot set a schedule with --enable-auto-refresh false");
|
|
7209
7239
|
}
|
|
7240
|
+
if (backup === true && (enabled === false || create && schedule === void 0 && cron === void 0)) {
|
|
7241
|
+
throw new Error("Enabling history tag backup requires periodic refresh with a schedule");
|
|
7242
|
+
}
|
|
7210
7243
|
if (create && enabled === true && cron === void 0 && schedule === void 0) {
|
|
7211
7244
|
throw new Error("Enabling auto refresh on create requires --auto-refresh-schedule or --auto-refresh-cron");
|
|
7212
7245
|
}
|
|
@@ -7219,6 +7252,7 @@ function tagWriteInput(ctx, create) {
|
|
|
7219
7252
|
remark: create ? void 0 : optionalString(ctx, "remark"),
|
|
7220
7253
|
zone_offset: optionalNumber(ctx, "zone-offset"),
|
|
7221
7254
|
enable_auto_refresh: enabled,
|
|
7255
|
+
enable_history_tag_backup: backup,
|
|
7222
7256
|
auto_refresh_cron: cron,
|
|
7223
7257
|
auto_refresh_schedule: schedule,
|
|
7224
7258
|
entity_id: create ? optionalNumber(ctx, "entity-id") : void 0
|
|
@@ -7461,10 +7495,12 @@ var commands41 = [
|
|
|
7461
7495
|
),
|
|
7462
7496
|
capability("user-tag", "get", "analysis.user_tag.get", "Get user tag details by exact tag_name values.", [
|
|
7463
7497
|
projectIdFlag,
|
|
7498
|
+
{ name: "include-history-dates", type: "boolean", desc: "Include selectable local dates. Cross-source dates are not enumerated." },
|
|
7464
7499
|
{ name: "tag-names", type: "json", required: true, desc: "JSON array of exact tag_name values." }
|
|
7465
7500
|
], "read", (ctx) => ({
|
|
7466
7501
|
project_id: ctx.num("project-id"),
|
|
7467
|
-
tag_names: ctx.json("tag-names")
|
|
7502
|
+
tag_names: ctx.json("tag-names"),
|
|
7503
|
+
...compactInput({ include_history_dates: optionalBoolean(ctx, "include-history-dates") })
|
|
7468
7504
|
})),
|
|
7469
7505
|
capability("user-tag-member", "list", "analysis.user_tag_member.list", `Run a bounded user tag member query. ${memberDataRunRoutingHelp}`, [
|
|
7470
7506
|
tagNameFlag,
|
|
@@ -7483,7 +7519,10 @@ var commands41 = [
|
|
|
7483
7519
|
tagDefinitionRequestFlag,
|
|
7484
7520
|
authenticatedOnlyFlag,
|
|
7485
7521
|
zoneOffsetFlag2,
|
|
7486
|
-
|
|
7522
|
+
{
|
|
7523
|
+
...entityIdFlag,
|
|
7524
|
+
desc: "For SQL tags, explicitly pass the project entity that receives the tag. Resolve it with project entity list/get and verify the first SQL column identifies that entity. Matching SQL types alone are insufficient."
|
|
7525
|
+
},
|
|
7487
7526
|
...tagAutoRefreshFlags
|
|
7488
7527
|
], "write", (ctx) => tagWriteInput(ctx, true)),
|
|
7489
7528
|
capability("user-tag", "update", "analysis.user_tag.update", "Update a user tag. Pass only fields that should change.", [
|
|
@@ -7698,7 +7737,7 @@ var inputFileInspect = {
|
|
|
7698
7737
|
risk: "read",
|
|
7699
7738
|
dryRun: (ctx) => ({
|
|
7700
7739
|
method: "GET",
|
|
7701
|
-
url:
|
|
7740
|
+
url: buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${ctx.str("input-file-id")}`)
|
|
7702
7741
|
}),
|
|
7703
7742
|
execute: async (ctx) => {
|
|
7704
7743
|
const inputFileId = ctx.str("input-file-id");
|
|
@@ -7709,7 +7748,7 @@ var inputFileInspect = {
|
|
|
7709
7748
|
);
|
|
7710
7749
|
return {
|
|
7711
7750
|
...result,
|
|
7712
|
-
inspect_path:
|
|
7751
|
+
inspect_path: new URL(buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${inputFileId}`)).pathname,
|
|
7713
7752
|
inspect_command: `ae-cli analysis input-file inspect --input-file-id ${inputFileId}`
|
|
7714
7753
|
};
|
|
7715
7754
|
}
|
|
@@ -7760,7 +7799,7 @@ var inputFileUpload = {
|
|
|
7760
7799
|
const inputFileId = result?.input_file_id ?? result?.inputFileId;
|
|
7761
7800
|
return {
|
|
7762
7801
|
...result,
|
|
7763
|
-
inspect_path: typeof inputFileId === "string" ?
|
|
7802
|
+
inspect_path: typeof inputFileId === "string" ? new URL(buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${inputFileId}`)).pathname : result?.inspect_path,
|
|
7764
7803
|
inspect_command: typeof inputFileId === "string" ? `ae-cli analysis input-file inspect --input-file-id ${inputFileId}` : void 0
|
|
7765
7804
|
};
|
|
7766
7805
|
}
|
|
@@ -7853,7 +7892,7 @@ var projectDataPowerUpsert = createAnalysisCapabilityCommand({
|
|
|
7853
7892
|
projectIdFlag,
|
|
7854
7893
|
requiredPayloadFlag
|
|
7855
7894
|
],
|
|
7856
|
-
risk: "write",
|
|
7895
|
+
risk: "high-risk-write",
|
|
7857
7896
|
buildInput: (ctx) => compactInput({
|
|
7858
7897
|
project_id: ctx.num("project-id"),
|
|
7859
7898
|
payload: ctx.json("payload")
|
|
@@ -8144,8 +8183,8 @@ var projectMarkTimeCreate = createAnalysisCapabilityCommand({
|
|
|
8144
8183
|
flags: [
|
|
8145
8184
|
projectIdFlag,
|
|
8146
8185
|
{ name: "marked-at", type: "string", required: true, desc: "Marker timestamp, for example yyyy-MM-dd HH:mm." },
|
|
8147
|
-
{ name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset." },
|
|
8148
|
-
{ name: "content", type: "string", required: true, desc: "Marker content." },
|
|
8186
|
+
{ name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset. When project time zones are enabled, fixed offsets are -12..14 and 99 preserves stored local time. Omit for the project default." },
|
|
8187
|
+
{ name: "content", type: "string", required: true, desc: "Marker content, at most 200 characters." },
|
|
8149
8188
|
{ name: "is-visible", type: "number", required: false, desc: "Whether the marker is visible. 1 visible, 0 hidden." }
|
|
8150
8189
|
],
|
|
8151
8190
|
risk: "write",
|
|
@@ -8211,8 +8250,8 @@ var projectMarkTimeUpdate = createAnalysisCapabilityCommand({
|
|
|
8211
8250
|
projectIdFlag,
|
|
8212
8251
|
{ name: "mark-time-id", type: "number", required: true, desc: "Date marker ID." },
|
|
8213
8252
|
{ name: "marked-at", type: "string", required: true, desc: "Marker timestamp, for example yyyy-MM-dd HH:mm." },
|
|
8214
|
-
{ name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset." },
|
|
8215
|
-
{ name: "content", type: "string", required: true, desc: "Marker content." },
|
|
8253
|
+
{ name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset. When project time zones are enabled, fixed offsets are -12..14 and 99 preserves stored local time. Omit for the project default." },
|
|
8254
|
+
{ name: "content", type: "string", required: true, desc: "Marker content, at most 200 characters." },
|
|
8216
8255
|
{ name: "is-visible", type: "number", required: false, desc: "Whether the marker is visible. 1 visible, 0 hidden." }
|
|
8217
8256
|
],
|
|
8218
8257
|
risk: "write",
|
|
@@ -8251,7 +8290,7 @@ var projectMemberAdd = createAnalysisCapabilityCommand({
|
|
|
8251
8290
|
desc: "Member add type: 0 creates a company member from project management; 1 adds an existing company member. Type 0 may be disabled by company configuration."
|
|
8252
8291
|
}
|
|
8253
8292
|
],
|
|
8254
|
-
risk: "write",
|
|
8293
|
+
risk: "high-risk-write",
|
|
8255
8294
|
buildInput: (ctx) => compactInput({
|
|
8256
8295
|
project_id: ctx.num("project-id"),
|
|
8257
8296
|
payload: ctx.json("payload"),
|
|
@@ -8269,7 +8308,7 @@ var projectMemberBatchUpdate = createAnalysisCapabilityCommand({
|
|
|
8269
8308
|
projectIdFlag,
|
|
8270
8309
|
requiredPayloadFlag
|
|
8271
8310
|
],
|
|
8272
|
-
risk: "write",
|
|
8311
|
+
risk: "high-risk-write",
|
|
8273
8312
|
buildInput: (ctx) => compactInput({
|
|
8274
8313
|
project_id: ctx.num("project-id"),
|
|
8275
8314
|
payload: ctx.json("payload")
|
|
@@ -8340,7 +8379,7 @@ var projectMemberUpdate = createAnalysisCapabilityCommand({
|
|
|
8340
8379
|
requiredPayloadFlag,
|
|
8341
8380
|
{ name: "target-user-id", type: "number", required: true, desc: "Target user ID." }
|
|
8342
8381
|
],
|
|
8343
|
-
risk: "write",
|
|
8382
|
+
risk: "high-risk-write",
|
|
8344
8383
|
buildInput: (ctx) => compactInput({
|
|
8345
8384
|
project_id: ctx.num("project-id"),
|
|
8346
8385
|
payload: ctx.json("payload"),
|
|
@@ -8584,7 +8623,7 @@ var projectMemberHandoverRun = createAnalysisCapabilityCommand({
|
|
|
8584
8623
|
projectIdFlag,
|
|
8585
8624
|
requiredPayloadFlag
|
|
8586
8625
|
],
|
|
8587
|
-
risk: "write",
|
|
8626
|
+
risk: "high-risk-write",
|
|
8588
8627
|
buildInput: (ctx) => compactInput({
|
|
8589
8628
|
project_id: ctx.num("project-id"),
|
|
8590
8629
|
payload: ctx.json("payload")
|
|
@@ -8628,11 +8667,11 @@ var projectOwnerUpdate = createAnalysisCapabilityCommand({
|
|
|
8628
8667
|
flags: [
|
|
8629
8668
|
projectIdFlag,
|
|
8630
8669
|
{ name: "company-id", type: "number", required: true, desc: "Company ID." },
|
|
8631
|
-
{ name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Omit
|
|
8670
|
+
{ name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Common treats a company root as company-admin management. Omit for the same behavior; the existing owner is downgraded." },
|
|
8632
8671
|
{ name: "project-name", type: "string", required: false, desc: "Optional project name update." },
|
|
8633
8672
|
{ name: "project-remark", type: "string", required: false, desc: "Optional project remark update." }
|
|
8634
8673
|
],
|
|
8635
|
-
risk: "write",
|
|
8674
|
+
risk: "high-risk-write",
|
|
8636
8675
|
buildInput: (ctx) => compactInput({
|
|
8637
8676
|
project_id: ctx.num("project-id"),
|
|
8638
8677
|
company_id: ctx.num("company-id"),
|
|
@@ -8779,7 +8818,7 @@ var projectRoleUpsert = createAnalysisCapabilityCommand({
|
|
|
8779
8818
|
desc: "Role payload with role_func_list object items containing function_name and has_power (0 or 1)."
|
|
8780
8819
|
}
|
|
8781
8820
|
],
|
|
8782
|
-
risk: "write",
|
|
8821
|
+
risk: "high-risk-write",
|
|
8783
8822
|
buildInput: (ctx) => compactInput({
|
|
8784
8823
|
project_id: ctx.num("project-id"),
|
|
8785
8824
|
payload: ctx.json("payload")
|
|
@@ -8900,78 +8939,78 @@ var projectTimezoneUpdate = createAnalysisCapabilityCommand({
|
|
|
8900
8939
|
],
|
|
8901
8940
|
risk: "write",
|
|
8902
8941
|
buildInput: (ctx) => {
|
|
8903
|
-
const
|
|
8942
|
+
const item2 = ctx.str("item").toLowerCase();
|
|
8904
8943
|
const payload = ctx.json("payload");
|
|
8905
|
-
validateTimezonePayload(
|
|
8944
|
+
validateTimezonePayload(item2, payload);
|
|
8906
8945
|
return compactInput({
|
|
8907
8946
|
project_id: ctx.num("project-id"),
|
|
8908
8947
|
payload,
|
|
8909
|
-
item
|
|
8948
|
+
item: item2
|
|
8910
8949
|
});
|
|
8911
8950
|
}
|
|
8912
8951
|
});
|
|
8913
|
-
function validateTimezonePayload(
|
|
8914
|
-
if (!TIMEZONE_ITEMS.includes(
|
|
8952
|
+
function validateTimezonePayload(item2, payload) {
|
|
8953
|
+
if (!TIMEZONE_ITEMS.includes(item2)) {
|
|
8915
8954
|
throw new CliValidationError(
|
|
8916
8955
|
"--item must be timezone_toggle, zone_offset, user_timezone, or project_timezone_display.",
|
|
8917
8956
|
{ code: "INVALID_TIMEZONE_ITEM" }
|
|
8918
8957
|
);
|
|
8919
8958
|
}
|
|
8920
8959
|
if (!isObject(payload)) {
|
|
8921
|
-
throw invalidPayload(
|
|
8960
|
+
throw invalidPayload(item2, "must be a JSON object");
|
|
8922
8961
|
}
|
|
8923
|
-
switch (
|
|
8962
|
+
switch (item2) {
|
|
8924
8963
|
case "timezone_toggle":
|
|
8925
8964
|
if (typeof payload.toggle !== "boolean") {
|
|
8926
|
-
throw invalidPayload(
|
|
8965
|
+
throw invalidPayload(item2, "requires boolean field toggle", '{"toggle":true}');
|
|
8927
8966
|
}
|
|
8928
|
-
allowOnly(payload,
|
|
8967
|
+
allowOnly(payload, item2, ["toggle"]);
|
|
8929
8968
|
return;
|
|
8930
8969
|
case "zone_offset":
|
|
8931
8970
|
if (typeof payload.column_name !== "string") {
|
|
8932
|
-
throw invalidPayload(
|
|
8971
|
+
throw invalidPayload(item2, "requires string field column_name", '{"column_name":"#zone_offset"}');
|
|
8933
8972
|
}
|
|
8934
|
-
allowOnly(payload,
|
|
8973
|
+
allowOnly(payload, item2, ["column_name"]);
|
|
8935
8974
|
return;
|
|
8936
8975
|
case "user_timezone":
|
|
8937
8976
|
if (typeof payload.column_name !== "string" || payload.column_name.length === 0) {
|
|
8938
|
-
throw invalidPayload(
|
|
8977
|
+
throw invalidPayload(item2, "requires non-empty string field column_name", '{"column_name":"user_timezone"}');
|
|
8939
8978
|
}
|
|
8940
8979
|
if (payload.codetable !== void 0 && typeof payload.codetable !== "string") {
|
|
8941
|
-
throw invalidPayload(
|
|
8980
|
+
throw invalidPayload(item2, "optional field codetable must be a string", '{"column_name":"user_timezone","codetable":"timezone_code_table"}');
|
|
8942
8981
|
}
|
|
8943
|
-
allowOnly(payload,
|
|
8982
|
+
allowOnly(payload, item2, ["column_name", "codetable"]);
|
|
8944
8983
|
return;
|
|
8945
8984
|
case "project_timezone_display":
|
|
8946
|
-
validateDisplayTimezones(payload.display_timezones,
|
|
8947
|
-
allowOnly(payload,
|
|
8985
|
+
validateDisplayTimezones(payload.display_timezones, item2);
|
|
8986
|
+
allowOnly(payload, item2, ["display_timezones"]);
|
|
8948
8987
|
}
|
|
8949
8988
|
}
|
|
8950
|
-
function validateDisplayTimezones(value,
|
|
8989
|
+
function validateDisplayTimezones(value, item2) {
|
|
8951
8990
|
if (!Array.isArray(value) || value.length === 0) {
|
|
8952
|
-
throw invalidPayload(
|
|
8991
|
+
throw invalidPayload(item2, "requires non-empty array field display_timezones", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
|
|
8953
8992
|
}
|
|
8954
8993
|
for (const entry of value) {
|
|
8955
8994
|
if (!isObject(entry)) {
|
|
8956
|
-
throw invalidPayload(
|
|
8995
|
+
throw invalidPayload(item2, "display_timezones entries must be objects", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
|
|
8957
8996
|
}
|
|
8958
|
-
allowOnly(entry,
|
|
8997
|
+
allowOnly(entry, item2, ["timezone", "is_default"]);
|
|
8959
8998
|
if (!Number.isInteger(entry.timezone) || !(entry.timezone >= -12 && entry.timezone <= 14 || entry.timezone === 99)) {
|
|
8960
|
-
throw invalidPayload(
|
|
8999
|
+
throw invalidPayload(item2, "display_timezones[].timezone must be an integer from -12 through 14, or 99 for no fixed display timezone");
|
|
8961
9000
|
}
|
|
8962
9001
|
if (entry.is_default !== void 0 && typeof entry.is_default !== "boolean") {
|
|
8963
|
-
throw invalidPayload(
|
|
9002
|
+
throw invalidPayload(item2, "display_timezones[].is_default must be a boolean when provided");
|
|
8964
9003
|
}
|
|
8965
9004
|
}
|
|
8966
9005
|
}
|
|
8967
|
-
function allowOnly(payload,
|
|
9006
|
+
function allowOnly(payload, item2, fields2) {
|
|
8968
9007
|
if (Object.keys(payload).some((field) => !fields2.includes(field))) {
|
|
8969
|
-
throw invalidPayload(
|
|
9008
|
+
throw invalidPayload(item2, `supports only fields ${fields2.join(", ")}`);
|
|
8970
9009
|
}
|
|
8971
9010
|
}
|
|
8972
|
-
function invalidPayload(
|
|
9011
|
+
function invalidPayload(item2, reason, example) {
|
|
8973
9012
|
return new CliValidationError(
|
|
8974
|
-
`--payload for --item ${
|
|
9013
|
+
`--payload for --item ${item2} ${reason}.`,
|
|
8975
9014
|
{
|
|
8976
9015
|
code: "INVALID_TIMEZONE_PAYLOAD",
|
|
8977
9016
|
hint: example === void 0 ? void 0 : `Use: --payload '${example}'`
|
|
@@ -9041,12 +9080,12 @@ var project_default = commands66;
|
|
|
9041
9080
|
// src/commands/te-analysis/tracking/shared.ts
|
|
9042
9081
|
function createTrackingCapabilityCommand(config) {
|
|
9043
9082
|
const { asyncArtifact, ...coreConfig } = config;
|
|
9044
|
-
const
|
|
9083
|
+
const command2 = createCapabilityCommand({
|
|
9045
9084
|
...coreConfig,
|
|
9046
9085
|
cliService: "tracking",
|
|
9047
9086
|
gatewayDomain: "analysis"
|
|
9048
9087
|
});
|
|
9049
|
-
return asyncArtifact ? withAsyncArtifactLifecycle(
|
|
9088
|
+
return asyncArtifact ? withAsyncArtifactLifecycle(command2) : command2;
|
|
9050
9089
|
}
|
|
9051
9090
|
var eventsFlag = {
|
|
9052
9091
|
name: "events",
|
|
@@ -9510,20 +9549,20 @@ function definitions(candidates, kind) {
|
|
|
9510
9549
|
function existingDefinitions(value, nameField, displayNameField) {
|
|
9511
9550
|
if (!Array.isArray(value)) return [];
|
|
9512
9551
|
const rows = [];
|
|
9513
|
-
for (const
|
|
9514
|
-
if (!isRecord2(
|
|
9515
|
-
const name = nonEmptyString(
|
|
9552
|
+
for (const item2 of value) {
|
|
9553
|
+
if (!isRecord2(item2)) continue;
|
|
9554
|
+
const name = nonEmptyString(item2[nameField]);
|
|
9516
9555
|
if (!name) continue;
|
|
9517
9556
|
rows.push({
|
|
9518
9557
|
name,
|
|
9519
|
-
displayName: nonEmptyString(
|
|
9558
|
+
displayName: nonEmptyString(item2[displayNameField])
|
|
9520
9559
|
});
|
|
9521
9560
|
}
|
|
9522
9561
|
return rows;
|
|
9523
9562
|
}
|
|
9524
9563
|
function buildGroup(type, source, existing) {
|
|
9525
9564
|
const existingByName = new Map(
|
|
9526
|
-
existing.map((
|
|
9565
|
+
existing.map((item2) => [item2.name, item2.displayName])
|
|
9527
9566
|
);
|
|
9528
9567
|
const items = [];
|
|
9529
9568
|
const skippedExisting = [];
|
|
@@ -10312,6 +10351,26 @@ var alert_notice_config_default = commands81;
|
|
|
10312
10351
|
// src/commands/te-analysis/system/shared.ts
|
|
10313
10352
|
import { readFileSync as readFileSync3, statSync as statSync3 } from "fs";
|
|
10314
10353
|
var secretValues = /* @__PURE__ */ new WeakMap();
|
|
10354
|
+
var backendConfirmationCapabilities = /* @__PURE__ */ new Set([
|
|
10355
|
+
"system.member_status.update",
|
|
10356
|
+
"system.member_project.batch_update",
|
|
10357
|
+
"system.member_password.reset",
|
|
10358
|
+
"system.member.delete",
|
|
10359
|
+
"system.role.upsert",
|
|
10360
|
+
"system.role.delete",
|
|
10361
|
+
"system.admin.upsert",
|
|
10362
|
+
"system.admin_function.update",
|
|
10363
|
+
"system.admin.remove",
|
|
10364
|
+
"system.seat.update",
|
|
10365
|
+
"system.mfa.update",
|
|
10366
|
+
"system.member_mfa.unbind",
|
|
10367
|
+
"system.query_task.cancel",
|
|
10368
|
+
"system.query_alert_rule.update",
|
|
10369
|
+
"system.ops_alert_contact.delete",
|
|
10370
|
+
"system.smtp.delete",
|
|
10371
|
+
"system.receiver_address.delete",
|
|
10372
|
+
"system.third_party_login.disable"
|
|
10373
|
+
]);
|
|
10315
10374
|
var companyIdField = {
|
|
10316
10375
|
flag: "company-id",
|
|
10317
10376
|
input: "company_id",
|
|
@@ -10360,7 +10419,7 @@ function defineSystemCommand(spec) {
|
|
|
10360
10419
|
risk: spec.risk,
|
|
10361
10420
|
validate: (ctx) => {
|
|
10362
10421
|
validateSecretSources(ctx, secrets);
|
|
10363
|
-
const input = buildSystemInput(ctx, fields2, [], spec.
|
|
10422
|
+
const input = buildSystemInput(ctx, fields2, [], spec.capabilityId);
|
|
10364
10423
|
for (const secret of secrets) {
|
|
10365
10424
|
if (ctx.str(`${secret.flag}-file`) || ctx.bool(`${secret.flag}-stdin`)) {
|
|
10366
10425
|
input[secret.input] = "<provided>";
|
|
@@ -10370,7 +10429,7 @@ function defineSystemCommand(spec) {
|
|
|
10370
10429
|
spec.validate?.(ctx, input);
|
|
10371
10430
|
},
|
|
10372
10431
|
buildInput: (ctx) => {
|
|
10373
|
-
const input = buildSystemInput(ctx, fields2, secrets, spec.
|
|
10432
|
+
const input = buildSystemInput(ctx, fields2, secrets, spec.capabilityId);
|
|
10374
10433
|
validateFields(fields2, input);
|
|
10375
10434
|
validateSecretSources(ctx, secrets);
|
|
10376
10435
|
spec.validate?.(ctx, input);
|
|
@@ -10407,7 +10466,7 @@ function secretFlags(secret) {
|
|
|
10407
10466
|
}
|
|
10408
10467
|
];
|
|
10409
10468
|
}
|
|
10410
|
-
function buildSystemInput(ctx, fields2, secrets,
|
|
10469
|
+
function buildSystemInput(ctx, fields2, secrets, capabilityId) {
|
|
10411
10470
|
const input = {};
|
|
10412
10471
|
for (const field of fields2) {
|
|
10413
10472
|
const value = fieldValue(ctx, field);
|
|
@@ -10417,7 +10476,7 @@ function buildSystemInput(ctx, fields2, secrets, risk) {
|
|
|
10417
10476
|
const value = secretValue(ctx, secret);
|
|
10418
10477
|
if (value !== void 0) input[secret.input] = secret.transform ? secret.transform(value) : value;
|
|
10419
10478
|
}
|
|
10420
|
-
if (
|
|
10479
|
+
if (backendConfirmationCapabilities.has(capabilityId)) input.yes = true;
|
|
10421
10480
|
return compactInput(input);
|
|
10422
10481
|
}
|
|
10423
10482
|
function fieldValue(ctx, field) {
|
|
@@ -10501,12 +10560,12 @@ function requireArrayObjects(input, name, requiredKeys) {
|
|
|
10501
10560
|
const value = input[name];
|
|
10502
10561
|
if (value === void 0) return;
|
|
10503
10562
|
if (!Array.isArray(value)) throw validation(`${snakeToFlag(name)} must be a JSON array.`);
|
|
10504
|
-
value.forEach((
|
|
10505
|
-
if (!
|
|
10563
|
+
value.forEach((item2, index) => {
|
|
10564
|
+
if (!item2 || typeof item2 !== "object" || Array.isArray(item2)) {
|
|
10506
10565
|
throw validation(`${snakeToFlag(name)} item ${index + 1} must be an object.`);
|
|
10507
10566
|
}
|
|
10508
10567
|
for (const key of requiredKeys) {
|
|
10509
|
-
if (!(key in
|
|
10568
|
+
if (!(key in item2)) {
|
|
10510
10569
|
throw validation(`${snakeToFlag(name)} item ${index + 1} is missing ${key}.`);
|
|
10511
10570
|
}
|
|
10512
10571
|
}
|
|
@@ -10693,7 +10752,7 @@ var systemConfigurationCommands = [
|
|
|
10693
10752
|
command: "upsert",
|
|
10694
10753
|
capabilityId: "system.third_party_login.upsert",
|
|
10695
10754
|
description: "Create or update a third-party login configuration using protected secret sources.",
|
|
10696
|
-
risk: "write",
|
|
10755
|
+
risk: "high-risk-write",
|
|
10697
10756
|
fields: [
|
|
10698
10757
|
loginType,
|
|
10699
10758
|
{ flag: "app-id", type: "string", required: true, desc: "Provider application ID." },
|
|
@@ -10730,7 +10789,7 @@ var systemConfigurationCommands = [
|
|
|
10730
10789
|
command: "update",
|
|
10731
10790
|
capabilityId: "system.oauth2.update",
|
|
10732
10791
|
description: "Enable or disable company OAuth2 login.",
|
|
10733
|
-
risk: "write",
|
|
10792
|
+
risk: "high-risk-write",
|
|
10734
10793
|
fields: [
|
|
10735
10794
|
{ flag: "enable-oauth2", type: "boolean", required: true, desc: "Target OAuth2 login state." }
|
|
10736
10795
|
]
|
|
@@ -11148,17 +11207,17 @@ var systemMonitoringCommands = [
|
|
|
11148
11207
|
throw validation("--delete-ids must contain positive integers.");
|
|
11149
11208
|
}
|
|
11150
11209
|
const upserts = input.upserts;
|
|
11151
|
-
for (const [index,
|
|
11152
|
-
const metric = Number(
|
|
11153
|
-
const wheelMinutes = Number(
|
|
11154
|
-
const wheelInterval = Number(
|
|
11155
|
-
const threshold = Number(
|
|
11210
|
+
for (const [index, item2] of (upserts ?? []).entries()) {
|
|
11211
|
+
const metric = Number(item2.metric_content);
|
|
11212
|
+
const wheelMinutes = Number(item2.wheel_minutes);
|
|
11213
|
+
const wheelInterval = Number(item2.wheel_interval);
|
|
11214
|
+
const threshold = Number(item2.threshold);
|
|
11156
11215
|
if (![1, 2, 3].includes(metric) || !Number.isInteger(wheelMinutes) || wheelMinutes < 1 || wheelMinutes > 1440 || !Number.isInteger(wheelInterval) || wheelInterval < 1 || wheelInterval > 1e3 || !Number.isFinite(threshold) || threshold < 0) {
|
|
11157
11216
|
throw validation(`--upserts item ${index + 1} contains an invalid metric/window/threshold.`);
|
|
11158
11217
|
}
|
|
11159
11218
|
}
|
|
11160
11219
|
const deleted = new Set((deleteIds ?? []).map(Number));
|
|
11161
|
-
if ((upserts ?? []).some((
|
|
11220
|
+
if ((upserts ?? []).some((item2) => item2.rule_id !== void 0 && deleted.has(Number(item2.rule_id)))) {
|
|
11162
11221
|
throw validation("The same rule_id cannot appear in both --upserts and --delete-ids.");
|
|
11163
11222
|
}
|
|
11164
11223
|
}
|
|
@@ -11194,7 +11253,7 @@ var systemMonitoringCommands = [
|
|
|
11194
11253
|
if (input.on_status === void 0) throw validation("--on-status is required when creating a contact.");
|
|
11195
11254
|
requireAtLeastOne(
|
|
11196
11255
|
input,
|
|
11197
|
-
["mail_address", "mobile", ...contactWebhookSecrets.map((
|
|
11256
|
+
["mail_address", "mobile", ...contactWebhookSecrets.map((item2) => item2.input)],
|
|
11198
11257
|
"Provide at least one delivery target when creating a contact."
|
|
11199
11258
|
);
|
|
11200
11259
|
}
|
|
@@ -11553,11 +11612,11 @@ var commonFlags2 = [
|
|
|
11553
11612
|
{ name: "query-path", type: "json", desc: "1..64 ordered references: [{capability_id,invocation_id?,client_request_id?,purpose?}]. Prefer only returned meta.invocation_id; fallback to returned gateway meta.client_request_id, never business request_id. One analysis data-query step required. Inputs/status/timing come from existing call telemetry. Never include query results." },
|
|
11554
11613
|
{ name: "project-id", type: "number", desc: "Source analysis project. Collection is skipped if omitted or the project has not explicitly enabled scenario samples." }
|
|
11555
11614
|
];
|
|
11556
|
-
function withProjectCollectionPolicy(
|
|
11615
|
+
function withProjectCollectionPolicy(command2) {
|
|
11557
11616
|
return {
|
|
11558
|
-
...
|
|
11617
|
+
...command2,
|
|
11559
11618
|
execute: async (ctx) => {
|
|
11560
|
-
const input = scenarioInput(ctx,
|
|
11619
|
+
const input = scenarioInput(ctx, command2.command === "append");
|
|
11561
11620
|
const skipped = (reason) => withOutputMetadata({
|
|
11562
11621
|
accepted: false,
|
|
11563
11622
|
skipped: true,
|
|
@@ -11566,9 +11625,9 @@ function withProjectCollectionPolicy(command) {
|
|
|
11566
11625
|
...input.answer_id ? { answer_id: input.answer_id } : {},
|
|
11567
11626
|
...input.entry_id ? { entry_id: input.entry_id } : {},
|
|
11568
11627
|
...input.target_answer_id ? { target_answer_id: input.target_answer_id } : {},
|
|
11569
|
-
event_name:
|
|
11628
|
+
event_name: command2.command === "append" ? "cli_analysis_scenario_entry" : "cli_analysis_scenario",
|
|
11570
11629
|
delivery: "best_effort"
|
|
11571
|
-
}, { capability_id:
|
|
11630
|
+
}, { capability_id: command2.capabilityId });
|
|
11572
11631
|
if (input.project_id === void 0) return skipped("PROJECT_REQUIRED");
|
|
11573
11632
|
try {
|
|
11574
11633
|
const policy = await executeCapabilityWithEnvelope(ctx.host(), "analysis", "project.info.get", {
|
|
@@ -11580,7 +11639,7 @@ function withProjectCollectionPolicy(command) {
|
|
|
11580
11639
|
} catch {
|
|
11581
11640
|
return skipped("PROJECT_COLLECTION_CONFIG_UNAVAILABLE");
|
|
11582
11641
|
}
|
|
11583
|
-
return
|
|
11642
|
+
return command2.execute(ctx);
|
|
11584
11643
|
}
|
|
11585
11644
|
};
|
|
11586
11645
|
}
|
|
@@ -11669,7 +11728,7 @@ var scenarioList = createAnalysisCapabilityCommand({
|
|
|
11669
11728
|
buildInput: scenarioListInput
|
|
11670
11729
|
});
|
|
11671
11730
|
function scenarioGetInput(ctx) {
|
|
11672
|
-
const { limit, offset, ...input } = scenarioListInput(ctx);
|
|
11731
|
+
const { limit: limit2, offset, ...input } = scenarioListInput(ctx);
|
|
11673
11732
|
for (const key of ["open-id", "agent-session-id", "question-id"]) {
|
|
11674
11733
|
input[key.replaceAll("-", "_")] = text2(ctx.str(key), key, 191);
|
|
11675
11734
|
}
|
|
@@ -11691,6 +11750,140 @@ var scenarioGet = createAnalysisCapabilityCommand({
|
|
|
11691
11750
|
});
|
|
11692
11751
|
var scenario_default = [scenarioBegin, scenarioCollect, scenarioAppend, scenarioList, scenarioGet];
|
|
11693
11752
|
|
|
11753
|
+
// src/commands/te-analysis/bad-case/evaluation-sync.ts
|
|
11754
|
+
async function syncBadCaseEvaluation(ctx, projectId, value) {
|
|
11755
|
+
const item2 = value;
|
|
11756
|
+
if (!item2?.evaluation || !["PENDING", "ERROR"].includes(item2.evaluation.state)) return value;
|
|
11757
|
+
const common = (action, input = {}) => executeCapability(ctx.host(), "analysis", `analysis.bad_case.${action}`, { project_id: projectId, ...input });
|
|
11758
|
+
let report;
|
|
11759
|
+
try {
|
|
11760
|
+
const config = await common("evaluation_config");
|
|
11761
|
+
if (!config?.initialized || config.te_project_id !== String(projectId) || !config.dataset_id)
|
|
11762
|
+
throw new EvalApiError("Initialize this project evaluation configuration first.", { code: "NOT_INITIALIZED", httpStatus: 0 });
|
|
11763
|
+
const version = Number(item2.version);
|
|
11764
|
+
if (!Number.isSafeInteger(version) || version <= 0)
|
|
11765
|
+
throw new EvalApiError("Invalid source version.", { code: "INVALID_RESPONSE", httpStatus: 0 });
|
|
11766
|
+
const active = item2.review_state === "APPROVED";
|
|
11767
|
+
const result = await evalApi(
|
|
11768
|
+
ctx,
|
|
11769
|
+
"PUT",
|
|
11770
|
+
`/semantic-evaluation/datasets/${encodeURIComponent(config.dataset_id)}/cases/${encodeURIComponent(item2.id)}`,
|
|
11771
|
+
void 0,
|
|
11772
|
+
{
|
|
11773
|
+
version,
|
|
11774
|
+
active,
|
|
11775
|
+
question: item2.evidence_snapshot.question,
|
|
11776
|
+
answer: item2.evidence_snapshot.answer,
|
|
11777
|
+
reason: item2.ai_summary.reason,
|
|
11778
|
+
supplement: item2.review?.supplement || ""
|
|
11779
|
+
},
|
|
11780
|
+
{ teProjectId: String(projectId) }
|
|
11781
|
+
);
|
|
11782
|
+
if (result?.source_version !== version || typeof result.case_id !== "string" || (active ? !/^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/.test(result.case_id) : result.case_id !== ""))
|
|
11783
|
+
throw new EvalApiError("Invalid synchronization response.", { code: "INVALID_RESPONSE", httpStatus: 0 });
|
|
11784
|
+
report = { state: "SYNCED", case_id: result.case_id };
|
|
11785
|
+
} catch (error) {
|
|
11786
|
+
const code = error instanceof EvalApiError ? error.code : "";
|
|
11787
|
+
report = { state: "ERROR", error_code: ["NOT_INITIALIZED", "INVALID_RESPONSE"].includes(code) ? code : error instanceof EvalApiError && error.httpStatus === 403 ? "FORBIDDEN" : error instanceof EvalApiError && (error.httpStatus === 401 || code === "EVAL_ACCESS_TOKEN_MISSING") ? "UNAUTHORIZED" : "AE_SYNC_FAILED" };
|
|
11788
|
+
}
|
|
11789
|
+
try {
|
|
11790
|
+
return await common("evaluation_result", { item_id: item2.id, version: item2.version, ...report });
|
|
11791
|
+
} catch {
|
|
11792
|
+
try {
|
|
11793
|
+
return await common("get", { item_id: item2.id });
|
|
11794
|
+
} catch {
|
|
11795
|
+
return { ...item2, evaluation: { state: "PENDING" } };
|
|
11796
|
+
}
|
|
11797
|
+
}
|
|
11798
|
+
}
|
|
11799
|
+
|
|
11800
|
+
// src/commands/te-analysis/bad-case/index.ts
|
|
11801
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
11802
|
+
var project = { name: "project-id", type: "number", required: true, desc: "Project owner or administrator access is required." };
|
|
11803
|
+
var request = { name: "client-request-id", type: "string", required: true, desc: "Stable request ID; preserve on retries." };
|
|
11804
|
+
var item = { name: "item-id", type: "string", required: true, desc: "Bad Case item ID as a decimal string." };
|
|
11805
|
+
var batch = { name: "batch-id", type: "string", required: true, desc: "Discovery batch ID returned by begin." };
|
|
11806
|
+
var limit = { name: "limit", type: "number", desc: "Page size, 1..100. Follow pagination until complete." };
|
|
11807
|
+
function badCaseInput(action, flags, ctx) {
|
|
11808
|
+
const input = {};
|
|
11809
|
+
for (const flag of flags) {
|
|
11810
|
+
if (flag.name === "input-file") continue;
|
|
11811
|
+
const value = ctx.str(flag.name);
|
|
11812
|
+
if (!value && !flag.required) continue;
|
|
11813
|
+
if (!value && flag.required) throw new CliValidationError(`${flag.name} is required.`);
|
|
11814
|
+
if (flag.type === "number") {
|
|
11815
|
+
const number = Number(value);
|
|
11816
|
+
const minimum = flag.name === "offset" ? 0 : 1;
|
|
11817
|
+
const maximum = flag.name === "limit" ? 100 : 2147483647;
|
|
11818
|
+
if (!Number.isInteger(number) || number < minimum || number > maximum) throw new CliValidationError(`${flag.name} must be an integer between ${minimum} and ${maximum}.`);
|
|
11819
|
+
input[flag.name.replaceAll("-", "_")] = number;
|
|
11820
|
+
} else if (flag.type === "boolean") {
|
|
11821
|
+
if (!["true", "false"].includes(value)) throw new CliValidationError(`${flag.name} must be true or false.`);
|
|
11822
|
+
input[flag.name.replaceAll("-", "_")] = value === "true";
|
|
11823
|
+
} else {
|
|
11824
|
+
if (["item-id", "batch-id", "after-id", "version"].includes(flag.name) && (!/^\d+$/.test(value) || BigInt(value) > 9223372036854775807n)) throw new CliValidationError(`${flag.name} must be a nonnegative 64-bit integer string.`);
|
|
11825
|
+
input[flag.name.replaceAll("-", "_")] = value;
|
|
11826
|
+
}
|
|
11827
|
+
}
|
|
11828
|
+
if (action === "review" && !["APPROVE", "REJECT", "REVOKE"].includes(String(input.decision))) throw new CliValidationError("decision must be APPROVE, REJECT or REVOKE.");
|
|
11829
|
+
if (action === "run" && !["HEARTBEAT", "FAILED"].includes(String(input.action))) throw new CliValidationError("action must be HEARTBEAT or FAILED.");
|
|
11830
|
+
if (action === "submit") {
|
|
11831
|
+
let packet;
|
|
11832
|
+
try {
|
|
11833
|
+
packet = JSON.parse(readFileSync4(ctx.str("input-file"), "utf8"));
|
|
11834
|
+
} catch {
|
|
11835
|
+
throw new CliValidationError("input-file must be a readable JSON file.");
|
|
11836
|
+
}
|
|
11837
|
+
if (!packet || typeof packet !== "object" || Array.isArray(packet) || Object.keys(packet).some((key) => key !== "candidates") || !("candidates" in packet) || !Array.isArray(packet.candidates) || packet.candidates.length > 200) {
|
|
11838
|
+
throw new CliValidationError("The file must contain only candidates: an array of at most 200 occurrences. Empty batches are allowed.");
|
|
11839
|
+
}
|
|
11840
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11841
|
+
const roots = /* @__PURE__ */ new Set();
|
|
11842
|
+
for (const candidate of packet.candidates) {
|
|
11843
|
+
if (!candidate || typeof candidate !== "object" || !candidate.candidate_id || seen.has(candidate.candidate_id)) throw new CliValidationError("Every occurrence needs a unique candidate_id.");
|
|
11844
|
+
seen.add(candidate.candidate_id);
|
|
11845
|
+
if (candidate.duplicate_of) {
|
|
11846
|
+
if (candidate.duplicate_item_id || !roots.has(candidate.duplicate_of) || !candidate.dedup_reason) throw new CliValidationError("duplicate_of needs an earlier canonical candidate and dedup_reason.");
|
|
11847
|
+
} else {
|
|
11848
|
+
roots.add(candidate.candidate_id);
|
|
11849
|
+
if (candidate.duplicate_item_id ? !candidate.dedup_reason : !["INCORRECT", "INCOMPLETE"].includes(candidate.issue_type) || !candidate.reason) throw new CliValidationError("Provide a supported issue_type and reason, or a historical duplicate_item_id and dedup_reason.");
|
|
11850
|
+
}
|
|
11851
|
+
if (!candidate.source || ["open_id", "agent_session_id", "question_id", "answer_id", "days", "end_time"].some((key) => !candidate.source[key])) throw new CliValidationError("Each source must preserve the exact scenario identity and scan window.");
|
|
11852
|
+
}
|
|
11853
|
+
input.candidates = packet.candidates;
|
|
11854
|
+
}
|
|
11855
|
+
return input;
|
|
11856
|
+
}
|
|
11857
|
+
function command(action, description, flags, read = false) {
|
|
11858
|
+
return createAnalysisCapabilityCommand({
|
|
11859
|
+
resource: "bad-case",
|
|
11860
|
+
command: action,
|
|
11861
|
+
capabilityId: `analysis.bad_case.${action.replaceAll("-", "_")}`,
|
|
11862
|
+
description,
|
|
11863
|
+
risk: read ? "read" : "write",
|
|
11864
|
+
flags: [project, ...flags],
|
|
11865
|
+
buildInput: (ctx) => badCaseInput(action, [project, ...flags], ctx),
|
|
11866
|
+
...action === "review" ? { postProcess: (result, input, ctx) => syncBadCaseEvaluation(ctx, Number(input.project_id), result) } : {}
|
|
11867
|
+
});
|
|
11868
|
+
}
|
|
11869
|
+
var badCaseBegin = command("begin", "Begin a project-serialized discovery batch. Renew its 15-minute lease every minute; preserve request ID on retry.", [request, { name: "source-task-id", type: "string", desc: "Actual scheduled task ID, if known." }]);
|
|
11870
|
+
var badCaseRun = command("run", "Heartbeat or fail the current discovery. Failure never deletes earlier cases.", [batch, { name: "action", type: "string", required: true, desc: "HEARTBEAT or FAILED." }]);
|
|
11871
|
+
var badCaseHistory = command("history", "Read all historical cases for Agent semantic deduplication, including pending, approved, rejected and CLI-only cases.", [limit, { name: "after-id", type: "string", desc: "Follow next_after_id until has_more=false. Default 0." }], true);
|
|
11872
|
+
var badCaseSubmit = command("submit", "Submit Agent-assessed and semantically deduplicated occurrences from a JSON file. Saves a batch even when all occurrences are duplicates. Never approves.", [batch, { name: "input-file", type: "string", required: true, desc: "JSON file containing {candidates:[...]}; follow bad_case_review.md for new and duplicate occurrence shapes." }, { name: "submit-to-page", type: "boolean", desc: "Explicitly publish new and reused pending cases for page review. Default false for the CLI-only workflow." }]);
|
|
11873
|
+
var badCaseList = command("list", "List saved Bad Cases across all batches, including CLI-only cases.", [limit, { name: "offset", type: "number", desc: "Zero-based offset; default 0." }, { name: "query", type: "string", desc: "Search question or discovery reason." }, { name: "state", type: "string", desc: "PENDING, APPROVED or REJECTED; omit for all." }], true);
|
|
11874
|
+
var badCaseGet = command("get", "Read the reviewed question, answer, CLI calls and optional human supplement.", [item], true);
|
|
11875
|
+
var badCaseReview = command("review", "Record an explicit human decision, then synchronize the saved case directly with AE. A saved review remains successful if synchronization fails; inspect evaluation.state and retry with sync-evaluation.", [item, request, { name: "version", type: "string", required: true, desc: "Exact version returned by get." }, { name: "decision", type: "string", required: true, desc: "APPROVE or REJECT a pending case; REVOKE an approved or rejected case to PENDING. Only as explicitly directed by the human." }, { name: "supplement", type: "string", sensitive: true, desc: "Optional correct answer, evidence or caveats. Omit when revoking rejection to preserve its supplement." }]);
|
|
11876
|
+
var badCaseSubmitToPage = command("submit-to-page", "Publish an existing pending case for page review without copying it or changing its review state.", [item, request]);
|
|
11877
|
+
var badCaseSyncEvaluation = {
|
|
11878
|
+
...badCaseGet,
|
|
11879
|
+
command: "sync-evaluation",
|
|
11880
|
+
capabilityId: void 0,
|
|
11881
|
+
risk: "write",
|
|
11882
|
+
description: "Retry AE synchronization using the latest saved review. Does not change the review decision; reports synchronization state.",
|
|
11883
|
+
execute: async (ctx) => syncBadCaseEvaluation(ctx, Number(ctx.str("project-id")), unwrapOutputData(await badCaseGet.execute(ctx)))
|
|
11884
|
+
};
|
|
11885
|
+
var bad_case_default = [badCaseBegin, badCaseRun, badCaseHistory, badCaseSubmit, badCaseList, badCaseGet, badCaseReview, badCaseSubmitToPage, badCaseSyncEvaluation];
|
|
11886
|
+
|
|
11694
11887
|
// src/commands/te-analysis/index.ts
|
|
11695
11888
|
registerCapabilityGatewayRoute("analysis", { gatewayDomain: "analysis" });
|
|
11696
11889
|
registerCapabilityGatewayRoute("project", { gatewayDomain: "analysis" });
|
|
@@ -11739,7 +11932,8 @@ var baseCommands = [
|
|
|
11739
11932
|
...alert_notice_config_default,
|
|
11740
11933
|
...system_default,
|
|
11741
11934
|
...feedback_default,
|
|
11742
|
-
...scenario_default
|
|
11935
|
+
...scenario_default,
|
|
11936
|
+
...bad_case_default
|
|
11743
11937
|
];
|
|
11744
11938
|
var commands83 = [...baseCommands];
|
|
11745
11939
|
var te_analysis_default = commands83;
|