@thinkingai/ae-cli 6.1.19 → 6.1.21
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 +96 -38
- package/README.zh.md +96 -38
- package/dist/{auth-QPEVVBKT.js → auth-XZNXFRJS.js} +236 -127
- package/dist/{capability-ASI62I4A.js → capability-FYTU3X6L.js} +80 -37
- package/dist/{chunk-QL6R6TSK.js → chunk-4NRCTUZJ.js} +27045 -477
- package/dist/{chunk-JYMGHGCE.js → chunk-57RRFUEZ.js} +42 -15
- package/dist/chunk-6ZIQV5GW.js +26 -0
- package/dist/{chunk-KZ6ZHF5J.js → chunk-7FTTULED.js} +14 -14
- package/dist/chunk-7XGFSUOM.js +623 -0
- package/dist/chunk-CCS66K4K.js +155 -0
- package/dist/{chunk-B5HMQAOM.js → chunk-DVMLWQD4.js} +8 -186
- package/dist/{chunk-KEWVSO64.js → chunk-DX5CDO34.js} +28 -18
- package/dist/chunk-EQ255HKO.js +38248 -0
- package/dist/{chunk-6QK7SYYY.js → chunk-HBGADCKA.js} +29 -37
- package/dist/{chunk-GJXRF7Y6.js → chunk-HFGZGYCG.js} +54 -81
- package/dist/chunk-JOCDD4ON.js +15 -0
- package/dist/{chunk-TKHSULJT.js → chunk-KPQY44JQ.js} +6 -0
- package/dist/{chunk-FR2EDAQM.js → chunk-MAPZ7VB6.js} +90 -2
- package/dist/chunk-V2NUHPXF.js +196 -0
- package/dist/{chunk-S5PONFBM.js → chunk-VYXXOKYS.js} +9 -9
- package/dist/{community-report-client-6OL6GBQW.js → community-report-client-CU22W53K.js} +2 -4
- package/dist/{config-XNMACCKX.js → config-XO3LI3SA.js} +8 -9
- package/dist/context-IFJI3LIT.js +46 -0
- package/dist/{data-integration-4NZGZ45E.js → data-integration-HNGUKFIC.js} +55 -44
- package/dist/index.js +122 -112
- package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-GTRIT64F.js} +4 -5
- package/dist/{memory-HBJQ2GC5.js → memory-QGPSNCQS.js} +4 -6
- package/dist/{metadata-62EWBEIG.js → metadata-DI5BMYFU.js} +8 -10
- package/dist/{model-BHLJ2QMT.js → model-RNPQXIBI.js} +4 -6
- package/dist/{personal-semantic-preference-JBVMAI7L.js → personal-semantic-preference-5C3WUXFI.js} +11 -10
- package/dist/{project-semantic-BQ4MPUS5.js → project-semantic-3LF6Q6JZ.js} +29 -25
- package/dist/{sync-MUWPRM5I.js → sync-O45NXEQY.js} +7 -8
- package/dist/{te-agent-WQZTMEK4.js → te-agent-K5MSPNHJ.js} +393 -90
- package/dist/{te-analysis-MNCG65LU.js → te-analysis-AISWCOOZ.js} +1175 -377
- package/dist/{te-community-BNE6KREL.js → te-community-4OYU3BDA.js} +10 -33
- package/dist/{te-dataops-TXLKM2W6.js → te-dataops-NFIPB6FX.js} +19 -20
- package/dist/{te-engage-TPKLRVTL.js → te-engage-BAM3GBFX.js} +13 -15
- package/dist/{te-experiment-6BYKTCY7.js → te-experiment-GUTZXZ5Z.js} +132 -16
- package/dist/te-kb-3TS73NO6.js +1992 -0
- package/dist/{te-system-44LZJDTQ.js → te-system-STMHLS5J.js} +12 -9
- package/dist/{te-team-XMP47YXE.js → te-team-3I5AOX3N.js} +6 -8
- package/dist/{update-UODFOZ4P.js → update-RZXLPCRH.js} +7 -8
- package/package.json +29 -19
- package/skills/ae-agent/SKILL.md +30 -13
- package/skills/ae-agent/references/agent-distribution.md +94 -0
- package/skills/ae-agent/references/approval-request.md +4 -0
- package/skills/ae-agent/references/command_index.md +9 -2
- package/skills/ae-agent/references/create-automation.md +20 -2
- package/skills/ae-agent/references/get-agent-context.md +70 -0
- package/skills/ae-agent/references/list-automations.md +18 -3
- package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
- package/skills/ae-agent/references/mcp-token.md +3 -3
- package/skills/ae-agent/references/set-mcp-credential.md +0 -1
- package/skills/ae-agent/references/update-automation.md +18 -0
- package/skills/ae-analysis/SKILL.md +101 -79
- package/skills/ae-analysis/references/adhoc_export.md +11 -18
- package/skills/ae-analysis/references/adhoc_run.md +17 -7
- package/skills/ae-analysis/references/agent_review_detail.md +11 -0
- package/skills/ae-analysis/references/agent_review_evidence.md +46 -0
- package/skills/ae-analysis/references/agent_review_list.md +9 -0
- package/skills/ae-analysis/references/agent_review_preflight.md +96 -0
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +76 -0
- package/skills/ae-analysis/references/agent_review_records.md +9 -0
- package/skills/ae-analysis/references/agent_review_retry.md +12 -0
- package/skills/ae-analysis/references/agent_review_review.md +16 -0
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +184 -0
- package/skills/ae-analysis/references/ai_models/attribution.md +29 -0
- package/skills/ae-analysis/references/ai_models/distribution.md +40 -0
- package/skills/ae-analysis/references/ai_models/event.md +108 -0
- package/skills/ae-analysis/references/ai_models/funnel.md +46 -0
- package/skills/ae-analysis/references/ai_models/heat_map.md +26 -0
- package/skills/ae-analysis/references/ai_models/interval.md +20 -0
- package/skills/ae-analysis/references/ai_models/path.md +38 -0
- package/skills/ae-analysis/references/ai_models/prop_analysis.md +39 -0
- package/skills/ae-analysis/references/ai_models/rank_list.md +25 -0
- package/skills/ae-analysis/references/ai_models/retention.md +70 -0
- package/skills/ae-analysis/references/ai_models/revenue.md +28 -0
- package/skills/ae-analysis/references/ai_models/sql.md +74 -0
- package/skills/ae-analysis/references/ai_models/tag.md +19 -0
- package/skills/ae-analysis/references/ai_models.md +32 -453
- package/skills/ae-analysis/references/alert_create.md +7 -7
- package/skills/ae-analysis/references/alert_delete.md +4 -6
- package/skills/ae-analysis/references/alert_detail_list.md +7 -9
- package/skills/ae-analysis/references/alert_get.md +5 -7
- package/skills/ae-analysis/references/alert_job_list.md +4 -6
- package/skills/ae-analysis/references/alert_list.md +6 -8
- package/skills/ae-analysis/references/alert_notice_config_list.md +4 -6
- package/skills/ae-analysis/references/alert_start.md +5 -7
- package/skills/ae-analysis/references/alert_stop.md +5 -7
- package/skills/ae-analysis/references/alert_update.md +8 -8
- package/skills/ae-analysis/references/analysis_data_export.md +72 -0
- package/skills/ae-analysis/references/analysis_data_retrieval.md +32 -196
- package/skills/ae-analysis/references/analysis_gateway_assets.md +23 -180
- package/skills/ae-analysis/references/analysis_interpretation.md +37 -17
- package/skills/ae-analysis/references/asset_abnormal_get.md +0 -1
- package/skills/ae-analysis/references/asset_abnormal_list.md +0 -1
- package/skills/ae-analysis/references/asset_authentication_export.md +4 -0
- package/skills/ae-analysis/references/asset_authentication_list.md +7 -1
- package/skills/ae-analysis/references/asset_authentication_update.md +5 -1
- package/skills/ae-analysis/references/asset_batch_dashboard_schedule_freeze.md +8 -6
- package/skills/ae-analysis/references/asset_batch_delete.md +6 -6
- package/skills/ae-analysis/references/asset_batch_disable_auto_backup.md +4 -5
- package/skills/ae-analysis/references/asset_batch_disable_auto_update.md +5 -6
- package/skills/ae-analysis/references/asset_batch_handover.md +4 -5
- package/skills/ae-analysis/references/asset_batch_info_export.md +4 -5
- package/skills/ae-analysis/references/asset_batch_sql_export.md +5 -6
- package/skills/ae-analysis/references/asset_dependency_list.md +4 -5
- package/skills/ae-analysis/references/asset_export.md +4 -5
- package/skills/ae-analysis/references/asset_impact_list.md +5 -9
- package/skills/ae-analysis/references/asset_lineage_get.md +5 -6
- package/skills/ae-analysis/references/asset_list.md +4 -5
- package/skills/ae-analysis/references/asset_query_history_list.md +4 -8
- package/skills/ae-analysis/references/asset_recent_list.md +0 -1
- package/skills/ae-analysis/references/asset_search.md +12 -9
- package/skills/ae-analysis/references/asset_url_get.md +3 -4
- package/skills/ae-analysis/references/bi_panel_copy.md +2 -2
- package/skills/ae-analysis/references/bi_panel_page_data_export.md +4 -12
- package/skills/ae-analysis/references/bi_panel_page_data_run.md +2 -0
- package/skills/ae-analysis/references/catalog_export.md +4 -17
- package/skills/ae-analysis/references/catalog_list.md +4 -4
- package/skills/ae-analysis/references/check_delete.md +5 -7
- package/skills/ae-analysis/references/check_export.md +11 -11
- package/skills/ae-analysis/references/check_get.md +8 -10
- package/skills/ae-analysis/references/check_list.md +4 -6
- package/skills/ae-analysis/references/check_retry.md +8 -10
- package/skills/ae-analysis/references/check_run.md +2 -4
- package/skills/ae-analysis/references/command_index.md +46 -28
- package/skills/ae-analysis/references/cross_source_config.md +84 -0
- package/skills/ae-analysis/references/dashboard_report_data_export.md +5 -13
- package/skills/ae-analysis/references/dashboard_report_data_run.md +1 -1
- package/skills/ae-analysis/references/dashboard_update.md +15 -4
- package/skills/ae-analysis/references/datatable_columns_get.md +0 -1
- package/skills/ae-analysis/references/datatable_influence_list.md +0 -1
- package/skills/ae-analysis/references/datatable_version_get.md +0 -1
- package/skills/ae-analysis/references/datatable_version_list.md +0 -1
- package/skills/ae-analysis/references/debug_device_add.md +1 -2
- package/skills/ae-analysis/references/drilldown_entities_export.md +3 -3
- package/skills/ae-analysis/references/drilldown_events_export.md +3 -2
- package/skills/ae-analysis/references/drilldown_user_events_export.md +2 -2
- package/skills/ae-analysis/references/entity_detail_export.md +3 -2
- package/skills/ae-analysis/references/entity_detail_run.md +1 -0
- package/skills/ae-analysis/references/event_blacklist_add.md +5 -7
- package/skills/ae-analysis/references/event_blacklist_list.md +4 -6
- package/skills/ae-analysis/references/event_blacklist_update.md +6 -8
- package/skills/ae-analysis/references/event_changelog_list.md +0 -1
- package/skills/ae-analysis/references/event_create.md +0 -1
- package/skills/ae-analysis/references/event_detail_export.md +3 -2
- package/skills/ae-analysis/references/event_detail_run.md +1 -0
- package/skills/ae-analysis/references/event_export.md +0 -1
- package/skills/ae-analysis/references/event_get.md +0 -1
- package/skills/ae-analysis/references/event_hide_update.md +0 -1
- package/skills/ae-analysis/references/event_influence_list.md +0 -1
- package/skills/ae-analysis/references/event_list.md +0 -1
- package/skills/ae-analysis/references/event_property_bundle_export.md +5 -14
- package/skills/ae-analysis/references/event_property_bundle_import.md +2 -6
- package/skills/ae-analysis/references/event_relation_update.md +0 -1
- package/skills/ae-analysis/references/event_update.md +0 -1
- package/skills/ae-analysis/references/exchange_config_update.md +0 -1
- package/skills/ae-analysis/references/exchange_rate_refresh.md +0 -1
- package/skills/ae-analysis/references/exchange_rule_list.md +0 -1
- package/skills/ae-analysis/references/exchange_rule_update.md +0 -1
- package/skills/ae-analysis/references/exchange_rule_validate.md +0 -1
- package/skills/ae-analysis/references/governance_recommendation_decisions.md +23 -0
- package/skills/ae-analysis/references/governance_recommendation_export.md +108 -0
- package/skills/ae-analysis/references/governance_recommendation_submit.md +41 -0
- package/skills/ae-analysis/references/history_tag_data_drilldown_export.md +4 -4
- package/skills/ae-analysis/references/history_tag_data_export.md +3 -3
- package/skills/ae-analysis/references/ingest_error_list.md +7 -9
- package/skills/ae-analysis/references/ingest_summary.md +6 -8
- package/skills/ae-analysis/references/live_data_export.md +10 -10
- package/skills/ae-analysis/references/live_data_list.md +7 -9
- package/skills/ae-analysis/references/metadata_resolution.md +78 -0
- package/skills/ae-analysis/references/metric_export.md +0 -1
- package/skills/ae-analysis/references/metric_get.md +0 -1
- package/skills/ae-analysis/references/metric_list.md +4 -5
- package/skills/ae-analysis/references/metric_update.md +0 -1
- package/skills/ae-analysis/references/operation_record_export.md +4 -5
- package/skills/ae-analysis/references/operation_record_list.md +4 -5
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +18 -1
- package/skills/ae-analysis/references/plan_change_log_export.md +10 -10
- package/skills/ae-analysis/references/plan_change_log_list.md +4 -6
- package/skills/ae-analysis/references/plan_delete_items.md +2 -4
- package/skills/ae-analysis/references/plan_export.md +9 -9
- package/skills/ae-analysis/references/plan_generate.md +2 -4
- package/skills/ae-analysis/references/plan_get.md +4 -6
- package/skills/ae-analysis/references/plan_import_excel.md +6 -8
- package/skills/ae-analysis/references/plan_save_items.md +2 -4
- package/skills/ae-analysis/references/plan_sync_from_meta.md +4 -6
- package/skills/ae-analysis/references/project_access_detail_get.md +0 -1
- package/skills/ae-analysis/references/project_data_power_get.md +0 -1
- package/skills/ae-analysis/references/project_data_power_list.md +0 -1
- package/skills/ae-analysis/references/project_data_power_upsert.md +0 -1
- package/skills/ae-analysis/references/project_entity_create.md +0 -1
- package/skills/ae-analysis/references/project_entity_event_list.md +0 -1
- package/skills/ae-analysis/references/project_entity_get.md +0 -1
- package/skills/ae-analysis/references/project_entity_list.md +0 -1
- package/skills/ae-analysis/references/project_entity_update.md +0 -1
- package/skills/ae-analysis/references/project_function_list.md +0 -1
- package/skills/ae-analysis/references/project_info_get.md +0 -1
- package/skills/ae-analysis/references/project_info_list.md +0 -1
- package/skills/ae-analysis/references/project_info_update.md +0 -1
- package/skills/ae-analysis/references/project_mark_time_create.md +0 -1
- package/skills/ae-analysis/references/project_mark_time_list.md +0 -1
- package/skills/ae-analysis/references/project_mark_time_update.md +0 -1
- package/skills/ae-analysis/references/project_member_add.md +6 -5
- package/skills/ae-analysis/references/project_member_batch_update.md +0 -1
- package/skills/ae-analysis/references/project_member_candidate_list.md +4 -3
- package/skills/ae-analysis/references/project_member_handover_run.md +2 -3
- package/skills/ae-analysis/references/project_member_list.md +0 -1
- package/skills/ae-analysis/references/project_member_receiver_list.md +0 -1
- package/skills/ae-analysis/references/project_member_update.md +0 -1
- package/skills/ae-analysis/references/project_owner_update.md +0 -1
- package/skills/ae-analysis/references/project_permission_binding_list.md +0 -1
- package/skills/ae-analysis/references/project_role_function_list.md +0 -1
- package/skills/ae-analysis/references/project_role_get.md +0 -1
- package/skills/ae-analysis/references/project_role_list.md +0 -1
- package/skills/ae-analysis/references/project_role_upsert.md +32 -2
- package/skills/ae-analysis/references/project_role_user_list.md +0 -1
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +214 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +93 -0
- package/skills/ae-analysis/references/project_timezone_get.md +0 -1
- package/skills/ae-analysis/references/project_timezone_overview.md +0 -1
- package/skills/ae-analysis/references/project_timezone_update.md +0 -1
- package/skills/ae-analysis/references/project_user_id_items_update.md +0 -1
- package/skills/ae-analysis/references/property_changelog_list.md +0 -1
- package/skills/ae-analysis/references/property_create.md +0 -1
- package/skills/ae-analysis/references/property_export.md +0 -1
- package/skills/ae-analysis/references/property_get.md +0 -1
- package/skills/ae-analysis/references/property_hide_update.md +0 -1
- package/skills/ae-analysis/references/property_influence_list.md +0 -1
- package/skills/ae-analysis/references/property_list.md +3 -4
- package/skills/ae-analysis/references/property_related_events.md +0 -1
- package/skills/ae-analysis/references/property_relation_update.md +0 -1
- package/skills/ae-analysis/references/property_update.md +0 -1
- package/skills/ae-analysis/references/report_create.md +4 -2
- package/skills/ae-analysis/references/report_data_export.md +11 -9
- package/skills/ae-analysis/references/report_data_run.md +14 -7
- package/skills/ae-analysis/references/report_get.md +5 -3
- package/skills/ae-analysis/references/report_list.md +2 -0
- package/skills/ae-analysis/references/report_update.md +5 -3
- package/skills/ae-analysis/references/rule_create.md +5 -6
- package/skills/ae-analysis/references/rule_delete.md +5 -5
- package/skills/ae-analysis/references/rule_list.md +3 -4
- package/skills/ae-analysis/references/rule_schema.md +3 -4
- package/skills/ae-analysis/references/rule_update.md +5 -6
- package/skills/ae-analysis/references/sdk_sample_generate.md +2 -4
- package/skills/ae-analysis/references/sql_table_columns.md +1 -1
- package/skills/ae-analysis/references/super_metadata_batch_create.md +1 -1
- package/skills/ae-analysis/references/super_metadata_batch_edit.md +1 -1
- package/skills/ae-analysis/references/system_member_add.md +1 -2
- package/skills/ae-analysis/references/system_member_status_update.md +1 -1
- package/skills/ae-analysis/references/system_ops_alert_contact_list.md +1 -1
- package/skills/ae-analysis/references/system_ops_alert_contact_test.md +0 -1
- package/skills/ae-analysis/references/system_query_monitor_overview.md +3 -3
- package/skills/ae-analysis/references/system_query_task_export.md +4 -14
- package/skills/ae-analysis/references/system_query_task_get.md +1 -1
- package/skills/ae-analysis/references/system_query_task_list.md +5 -6
- package/skills/ae-analysis/references/system_receiver_address_upsert.md +3 -3
- package/skills/ae-analysis/references/system_receiver_detection_get.md +1 -1
- package/skills/ae-analysis/references/system_third_party_login_disable.md +1 -1
- package/skills/ae-analysis/references/system_usage_trend_export.md +3 -12
- package/skills/ae-analysis/references/user_cluster_list.md +1 -1
- package/skills/ae-analysis/references/user_cluster_member_export.md +4 -4
- package/skills/ae-analysis/references/user_tag_create.md +23 -1
- package/skills/ae-analysis/references/user_tag_list.md +1 -1
- package/skills/ae-analysis/references/user_tag_member_export.md +4 -4
- package/skills/ae-analysis/references/user_tag_models.md +9 -1
- package/skills/ae-analysis/references/user_tag_update.md +14 -2
- package/skills/ae-analysis/references/virtual_event_create.md +10 -5
- package/skills/ae-analysis/references/virtual_event_get.md +0 -1
- package/skills/ae-analysis/references/virtual_property_create.md +0 -1
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +0 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +1054 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +112 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +30 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +2735 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +376 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +264 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +49 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/upload-kb-sources-concurrently.mjs +200 -0
- package/skills/ae-analysis/scripts/read_results.py +197 -0
- package/skills/ae-analysis-global/SKILL.md +1 -1
- package/skills/ae-capability/SKILL.md +1 -1
- package/skills/ae-community/SKILL.md +1 -1
- package/skills/ae-current-context/SKILL.md +53 -0
- package/skills/ae-data-integration/SKILL.md +6 -4
- package/skills/ae-data-integration/references/dimension-routing.md +36 -0
- package/skills/ae-data-integration/references/lark-bitable-source.md +288 -0
- package/skills/ae-data-integration/references/lark-sheet-source.md +130 -0
- package/skills/ae-data-integration/references/local-analysis.md +2 -0
- package/skills/ae-data-integration/references/manual-export-source.md +83 -0
- package/skills/ae-data-integration/references/reuse.md +2 -0
- package/skills/ae-data-integration/references/sink-upload.md +32 -0
- package/skills/ae-data-integration/references/source-inspect.md +1 -1
- package/skills/ae-data-integration/references/tracking-plan.md +5 -2
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +7 -4
- package/skills/ae-data-integration/references/ue-routing.md +17 -1
- package/skills/ae-data-integration-helper/SKILL.md +5 -5
- package/skills/ae-data-integration-helper/references/android_sdk_faq.md +3 -3
- package/skills/ae-data-integration-helper/references/c_sdk_faq.md +3 -3
- package/skills/ae-data-integration-helper/references/cocoscreator_sdk_faq.md +1 -1
- package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +3 -3
- package/skills/ae-data-integration-helper/references/ios_sdk_faq.md +1 -1
- package/skills/ae-data-integration-helper/references/java_sdk_faq.md +3 -3
- package/skills/ae-data-integration-helper/references/javascript_sdk_faq.md +1 -1
- package/skills/ae-data-integration-helper/references/logbus2_guide.md +1 -1
- package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +2 -2
- package/skills/ae-data-integration-helper/references/minigame_sdk_faq.md +2 -2
- package/skills/ae-data-integration-helper/references/miniprogram_sdk_faq.md +1 -1
- package/skills/ae-data-integration-helper/references/python_sdk_faq.md +2 -2
- package/skills/ae-data-integration-helper/references/restful_api_notes.md +2 -2
- package/skills/ae-data-integration-helper/references/sdk_log_guide.md +3 -3
- package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +11 -11
- package/skills/ae-data-integration-helper/references/unity_sdk_faq.md +1 -1
- package/skills/ae-dataops/SKILL.md +1 -1
- package/skills/ae-engage/SKILL.md +4 -3
- package/skills/ae-engage/references/build-task-save-guide.md +3 -0
- package/skills/ae-engage/references/flow-metric-update.md +115 -1
- package/skills/ae-engage/references/save-flow.md +3 -0
- package/skills/ae-engage/references/save-task.md +21 -0
- package/skills/ae-engage/references/task-metric-update.md +151 -0
- package/skills/ae-experiment/SKILL.md +14 -7
- package/skills/ae-experiment/references/save_submit_external_experiment.md +52 -0
- package/skills/ae-experiment-design/SKILL.md +3 -3
- package/skills/ae-experiment-design/references/platform-operations.md +1 -1
- package/skills/ae-experiment-insight/SKILL.md +2 -2
- package/skills/ae-experiment-insight/references/platform-operations.md +1 -1
- package/skills/ae-generate-tracking-code/SKILL.md +2 -1
- package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +1 -1
- package/skills/ae-generate-tracking-code/references/datax-config.md +1 -1
- package/skills/ae-generate-tracking-code/references/logbus-config.md +1 -1
- package/skills/ae-generate-tracking-code/references/modes.md +1 -1
- package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +5 -5
- package/skills/ae-generate-tracking-code/references/snippet-delivery.md +3 -3
- package/skills/ae-generate-tracking-plan/SKILL.md +27 -15
- package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
- package/skills/ae-generate-tracking-plan/references/te-api.md +1 -0
- package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +3 -2
- package/skills/ae-kb/SKILL.md +147 -37
- package/skills/ae-kb/references/analysis-workflow.md +292 -0
- package/skills/ae-kb/references/query-workflow.md +59 -29
- package/skills/ae-kb/references/source-mutations.md +95 -0
- package/skills/ae-kb/references/versions.md +46 -0
- package/skills/ae-kb-discovery/SKILL.md +5 -1
- package/skills/ae-metadata/SKILL.md +1 -1
- package/skills/ae-migrate-tracking-code/SKILL.md +195 -0
- package/skills/ae-migrate-tracking-code/references/ae-preset-properties.md +76 -0
- package/skills/ae-migrate-tracking-code/references/ir.md +167 -0
- package/skills/ae-migrate-tracking-code/references/mapping-framework.md +112 -0
- package/skills/ae-migrate-tracking-code/references/providers/README.md +58 -0
- package/skills/ae-migrate-tracking-code/references/providers/amplitude.md +208 -0
- package/skills/ae-migrate-tracking-code/references/providers/firebase.md +160 -0
- package/skills/ae-migrate-tracking-code/references/providers/ga4.md +92 -0
- package/skills/ae-migrate-tracking-code/references/providers/mixpanel.md +150 -0
- package/skills/ae-migrate-tracking-code/references/providers/sensors-data.md +146 -0
- package/skills/ae-project-semantic/SKILL.md +1 -1
- package/skills/ae-system/SKILL.md +5 -5
- package/skills/ae-team/SKILL.md +2 -2
- package/skills/ae-use-agent/SKILL.md +42 -0
- package/skills/ae-use-agent/references/local-agent.md +114 -0
- package/dist/auth-UMJAA72O.js +0 -15
- package/dist/chunk-533JK3YX.js +0 -72
- package/dist/chunk-DKEXH6Q5.js +0 -72
- package/dist/chunk-O6K2ODUE.js +0 -318
- package/dist/chunk-RWXIXOZG.js +0 -326
- package/dist/client-N7NGZUNI.js +0 -204
- package/dist/te-kb-BUD6N3NI.js +0 -1222
- package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
- package/skills/ae-analysis/metadata_resolution.md +0 -184
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
MultiselectCancelled,
|
|
4
|
+
promptSingleSelect
|
|
5
|
+
} from "./chunk-7K24F7T2.js";
|
|
6
|
+
import {
|
|
7
|
+
missingAeHostGuidance,
|
|
8
|
+
missingAeHostHint
|
|
9
|
+
} from "./chunk-6ZIQV5GW.js";
|
|
2
10
|
import {
|
|
3
11
|
getLocalCliPackageInfo
|
|
4
12
|
} from "./chunk-E2JKXMVO.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveHost
|
|
15
|
+
} from "./chunk-JOCDD4ON.js";
|
|
5
16
|
import {
|
|
6
17
|
printError,
|
|
7
18
|
printOutput,
|
|
8
19
|
runHostCompatCheck
|
|
9
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DX5CDO34.js";
|
|
10
21
|
import {
|
|
11
22
|
CliTokenValidationUnavailableError,
|
|
12
|
-
|
|
23
|
+
SecureStoreAuthError,
|
|
24
|
+
activateCredential,
|
|
25
|
+
clearAllCredentials,
|
|
26
|
+
clearCliTokenCache,
|
|
27
|
+
getActiveCredential,
|
|
28
|
+
listCredentials,
|
|
13
29
|
mintCliToken,
|
|
30
|
+
removeActiveCredential,
|
|
31
|
+
saveCredential,
|
|
32
|
+
updateCredentialMetadata,
|
|
14
33
|
validateCliTokenOnServer
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
SecureStoreAuthError,
|
|
18
|
-
clear,
|
|
19
|
-
load,
|
|
20
|
-
missingAeHostGuidance,
|
|
21
|
-
missingAeHostHint,
|
|
22
|
-
resolveHost,
|
|
23
|
-
save
|
|
24
|
-
} from "./chunk-O6K2ODUE.js";
|
|
34
|
+
} from "./chunk-7XGFSUOM.js";
|
|
25
35
|
import {
|
|
26
36
|
getFallbackCliToken,
|
|
27
37
|
loadConfig,
|
|
28
38
|
normalizeUrl,
|
|
29
39
|
saveConfig
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
PermissionError
|
|
33
|
-
} from "./chunk-533JK3YX.js";
|
|
40
|
+
} from "./chunk-7FTTULED.js";
|
|
34
41
|
import {
|
|
42
|
+
PermissionError,
|
|
35
43
|
logger
|
|
36
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-MAPZ7VB6.js";
|
|
37
45
|
|
|
38
46
|
// src/core/device-auth.ts
|
|
39
47
|
import { execFileSync } from "child_process";
|
|
@@ -263,55 +271,141 @@ function resolveAuthHost(program, opts) {
|
|
|
263
271
|
}
|
|
264
272
|
async function validateExistingCliToken(host, cliToken) {
|
|
265
273
|
try {
|
|
266
|
-
await validateCliTokenOnServer(host, cliToken);
|
|
267
|
-
return true;
|
|
274
|
+
return { valid: true, trusted: false, details: await validateCliTokenOnServer(host, cliToken) };
|
|
268
275
|
} catch (error) {
|
|
269
276
|
if (error instanceof CliTokenValidationUnavailableError) {
|
|
270
277
|
logger.warn(`auth status: ${error.message}; trusting the stored CLI token for compatibility`);
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
if (!(error instanceof SecureStoreAuthError)) {
|
|
274
|
-
throw error;
|
|
278
|
+
return { valid: true, trusted: true, details: {} };
|
|
275
279
|
}
|
|
280
|
+
if (!(error instanceof SecureStoreAuthError)) throw error;
|
|
276
281
|
printError("auth", error.message);
|
|
277
282
|
process.exitCode = 1;
|
|
278
|
-
return false;
|
|
283
|
+
return { valid: false, trusted: false, details: {} };
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
286
|
function activateHostAfterLogin(host, explicitHostOverride) {
|
|
282
287
|
if (!explicitHostOverride) return;
|
|
283
288
|
const normalized = normalizeUrl(host);
|
|
284
289
|
const config = loadConfig();
|
|
285
|
-
if (!config.hosts[normalized]) {
|
|
286
|
-
config.hosts[normalized] = { label: normalized };
|
|
287
|
-
}
|
|
290
|
+
if (!config.hosts[normalized]) config.hosts[normalized] = { label: normalized };
|
|
288
291
|
config.activeHost = normalized;
|
|
289
292
|
saveConfig(config);
|
|
290
293
|
logger.info(`Active host set to ${normalized} after login`);
|
|
291
294
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
295
|
+
function accountOutput(account) {
|
|
296
|
+
return {
|
|
297
|
+
open_id: account.openId,
|
|
298
|
+
login_name: account.loginName,
|
|
299
|
+
user_name: account.userName
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function credentialOutput(credential, active) {
|
|
303
|
+
return {
|
|
304
|
+
credential_id: credential.id,
|
|
305
|
+
active,
|
|
306
|
+
...credential.account ? { account: accountOutput(credential.account) } : {},
|
|
307
|
+
cli_token: {
|
|
308
|
+
...credential.cliTokenExpiresAt ? { expires_at: credential.cliTokenExpiresAt } : {},
|
|
309
|
+
...credential.lastRenewedOn ? { last_renewed_on: credential.lastRenewedOn } : {}
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function buildAccountSelectionItems(credentials, activeCredentialId) {
|
|
314
|
+
return credentials.filter((credential) => Boolean(credential.account)).sort((left, right) => Number(right.id === activeCredentialId) - Number(left.id === activeCredentialId)).map((credential) => {
|
|
315
|
+
const account = credential.account;
|
|
316
|
+
const displayName = account.userName && account.userName !== account.loginName ? `${account.loginName} (${account.userName})` : account.loginName;
|
|
317
|
+
const active = credential.id === activeCredentialId ? " [active]" : "";
|
|
318
|
+
return {
|
|
319
|
+
value: account.openId,
|
|
320
|
+
label: `${displayName} \xB7 ${account.openId}${active}`
|
|
321
|
+
};
|
|
307
322
|
});
|
|
323
|
+
}
|
|
324
|
+
async function switchActiveAccount(program, opts) {
|
|
325
|
+
const host = resolveAuthHost(program, opts);
|
|
326
|
+
if (!host) {
|
|
327
|
+
printError("config", "No AE host configured.", missingAeHostHint());
|
|
328
|
+
process.exitCode = 1;
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
let account = opts.account;
|
|
332
|
+
if (!account) {
|
|
333
|
+
if (!process.stdin.isTTY || !process.stderr.isTTY) {
|
|
334
|
+
printError(
|
|
335
|
+
"validation",
|
|
336
|
+
"Interactive account selection requires a TTY.",
|
|
337
|
+
`Run: ae-cli auth list --host ${host}, then ae-cli auth use --host ${host} --account <login-name-or-open-id>`
|
|
338
|
+
);
|
|
339
|
+
process.exitCode = 1;
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const active = getActiveCredential(host);
|
|
343
|
+
const items = buildAccountSelectionItems(listCredentials(host), active?.id);
|
|
344
|
+
if (items.length === 0) {
|
|
345
|
+
printError(
|
|
346
|
+
"auth",
|
|
347
|
+
`No stored accounts with identity metadata for ${host}.`,
|
|
348
|
+
`Upgrade the AE server if needed, then run: ae-cli auth login --host ${host}`
|
|
349
|
+
);
|
|
350
|
+
process.exitCode = 1;
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
try {
|
|
354
|
+
account = await promptSingleSelect({
|
|
355
|
+
title: `Select an account for ${host} (up/down: move, enter: select, q: cancel)`,
|
|
356
|
+
items
|
|
357
|
+
});
|
|
358
|
+
} catch (error) {
|
|
359
|
+
if (error instanceof MultiselectCancelled) return;
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
try {
|
|
364
|
+
const selected = activateCredential(host, account);
|
|
365
|
+
clearCliTokenCache(host);
|
|
366
|
+
await printOutput({
|
|
367
|
+
host,
|
|
368
|
+
active: true,
|
|
369
|
+
account: accountOutput(selected.account)
|
|
370
|
+
}, program.opts().format || "json");
|
|
371
|
+
} catch (error) {
|
|
372
|
+
printError("auth", error.message);
|
|
373
|
+
process.exitCode = 1;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async function persistDeviceTokens(host, tokens, options = {}) {
|
|
377
|
+
const cliToken = await mintCliToken(host, tokens.access_token);
|
|
378
|
+
let validation = {};
|
|
379
|
+
try {
|
|
380
|
+
validation = await validateCliTokenOnServer(host, cliToken);
|
|
381
|
+
} catch (error) {
|
|
382
|
+
if (error instanceof CliTokenValidationUnavailableError) {
|
|
383
|
+
logger.warn(`auth login: ${error.message}; saving CLI token without account metadata for compatibility`);
|
|
384
|
+
} else {
|
|
385
|
+
clearCliTokenCache(host);
|
|
386
|
+
throw error;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
let saved;
|
|
390
|
+
try {
|
|
391
|
+
saved = saveCredential(host, {
|
|
392
|
+
cliToken,
|
|
393
|
+
...validation.account ? { account: validation.account } : {},
|
|
394
|
+
...validation.cliTokenExpiresAt ? { cliTokenExpiresAt: validation.cliTokenExpiresAt } : {}
|
|
395
|
+
}, options);
|
|
396
|
+
} catch (error) {
|
|
397
|
+
clearCliTokenCache(host);
|
|
398
|
+
throw error;
|
|
399
|
+
}
|
|
400
|
+
clearCliTokenCache(host);
|
|
308
401
|
await runHostCompatCheck(getLocalCliPackageInfo(), host);
|
|
402
|
+
return saved;
|
|
309
403
|
}
|
|
310
|
-
function loginSummary(host,
|
|
404
|
+
function loginSummary(host, credential) {
|
|
311
405
|
return {
|
|
312
406
|
authenticated: true,
|
|
313
407
|
host,
|
|
314
|
-
|
|
408
|
+
...credential.account ? { account: accountOutput(credential.account) } : {}
|
|
315
409
|
};
|
|
316
410
|
}
|
|
317
411
|
function resolveLoginTeClaudeBase(host) {
|
|
@@ -320,8 +414,10 @@ function resolveLoginTeClaudeBase(host) {
|
|
|
320
414
|
return base.endsWith(basePath) ? base : base + basePath;
|
|
321
415
|
}
|
|
322
416
|
function registerAuth(program) {
|
|
323
|
-
const auth = program.command("auth").description("
|
|
324
|
-
|
|
417
|
+
const auth = program.command("auth").description("Manage authentication or switch the active account interactively").action(async () => {
|
|
418
|
+
await switchActiveAccount(program, {});
|
|
419
|
+
});
|
|
420
|
+
auth.command("login").description("Log in to AE; by default replaces this host credentials, --add keeps existing accounts").option("--host <url>", HOST_OPTION_DESC).option("--add", "Add another account for the host and keep existing accounts").option("--no-browser", "Do not auto-open the browser; only print the authorization URL").option("--no-wait", "Print device authorization data and exit; resume with --device-code").option("--device-code <code>", "Resume a split-flow login with the given device code").action(async (opts) => {
|
|
325
421
|
const explicitHost = getExplicitAuthHostOverride(program, opts);
|
|
326
422
|
const host = resolveAuthHost(program, opts);
|
|
327
423
|
if (!host) {
|
|
@@ -331,135 +427,148 @@ function registerAuth(program) {
|
|
|
331
427
|
const config = loadConfig();
|
|
332
428
|
if (!config.hosts[host]) {
|
|
333
429
|
config.hosts[host] = { label: host };
|
|
334
|
-
if (!config.activeHost)
|
|
335
|
-
config.activeHost = host;
|
|
336
|
-
}
|
|
430
|
+
if (!config.activeHost) config.activeHost = host;
|
|
337
431
|
saveConfig(config);
|
|
338
|
-
logger.info(`Host config auto-saved for ${host}`);
|
|
339
432
|
process.stderr.write(`[ae-cli] Config saved for ${host}
|
|
340
433
|
`);
|
|
341
434
|
}
|
|
342
435
|
const noBrowser = !opts.browser;
|
|
343
|
-
const
|
|
436
|
+
const format = program.opts().format || "json";
|
|
344
437
|
const teClaudeBase = resolveLoginTeClaudeBase(host);
|
|
345
|
-
const emit = (
|
|
438
|
+
const emit = (message) => process.stderr.write(`[ae-cli] ${message}
|
|
346
439
|
`);
|
|
347
440
|
try {
|
|
348
441
|
if (opts.deviceCode) {
|
|
349
442
|
const tokens2 = await pollDeviceFlow(teClaudeBase, opts.deviceCode, {}, emit);
|
|
350
|
-
await persistDeviceTokens(host, tokens2);
|
|
443
|
+
const saved2 = await persistDeviceTokens(host, tokens2, { add: opts.add });
|
|
351
444
|
activateHostAfterLogin(host, explicitHost);
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
await printOutput(loginSummary(host, tokens2), fmt);
|
|
445
|
+
emit("Login successful! CLI token saved securely.");
|
|
446
|
+
await printOutput(loginSummary(host, saved2), format);
|
|
355
447
|
return;
|
|
356
448
|
}
|
|
357
449
|
if (opts.wait === false) {
|
|
358
450
|
const authResp = await authorizeDevice(teClaudeBase);
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
fmt
|
|
369
|
-
);
|
|
451
|
+
const addFlag = opts.add ? " --add" : "";
|
|
452
|
+
await printOutput({
|
|
453
|
+
device_code: authResp.device_code,
|
|
454
|
+
user_code: authResp.user_code,
|
|
455
|
+
verification_url: buildVerificationUrl(teClaudeBase, authResp.user_code),
|
|
456
|
+
interval: authResp.interval,
|
|
457
|
+
expires_in: authResp.expires_in,
|
|
458
|
+
next: `Open verification_url in a browser to authorize, then run: ae-cli auth login${addFlag} --device-code ${authResp.device_code}`
|
|
459
|
+
}, format);
|
|
370
460
|
return;
|
|
371
461
|
}
|
|
372
462
|
const tokens = await runDeviceFlow(teClaudeBase, { noBrowser }, emit);
|
|
373
|
-
await persistDeviceTokens(host, tokens);
|
|
463
|
+
const saved = await persistDeviceTokens(host, tokens, { add: opts.add });
|
|
374
464
|
activateHostAfterLogin(host, explicitHost);
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
printError(
|
|
381
|
-
"auth",
|
|
382
|
-
err.message,
|
|
383
|
-
"Upgrade the AE server to a version that supports device login."
|
|
384
|
-
);
|
|
465
|
+
emit("Login successful! CLI token saved securely.");
|
|
466
|
+
await printOutput(loginSummary(host, saved), format);
|
|
467
|
+
} catch (error) {
|
|
468
|
+
if (error instanceof DeviceFlowUnsupportedError) {
|
|
469
|
+
printError("auth", error.message, "Upgrade the AE server to a version that supports device login.");
|
|
385
470
|
process.exit(1);
|
|
386
471
|
}
|
|
387
|
-
if (
|
|
388
|
-
printError("permission",
|
|
472
|
+
if (error instanceof PermissionError) {
|
|
473
|
+
printError("permission", error.message, error.hint, error.code);
|
|
389
474
|
process.exit(1);
|
|
390
475
|
}
|
|
391
|
-
printError("auth",
|
|
476
|
+
printError("auth", error.message);
|
|
392
477
|
process.exit(1);
|
|
393
478
|
}
|
|
394
479
|
});
|
|
395
|
-
auth.command("status").description("Show authentication status for a host
|
|
480
|
+
auth.command("status").description("Show the active CLI-token authentication status for a host").option("--host <url>", HOST_OPTION_DESC).action(async (opts) => {
|
|
396
481
|
const host = resolveAuthHost(program, opts);
|
|
397
482
|
if (!host) {
|
|
398
|
-
await printOutput(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
},
|
|
405
|
-
program.opts().format || "json"
|
|
406
|
-
);
|
|
483
|
+
await printOutput({
|
|
484
|
+
authenticated: false,
|
|
485
|
+
host: "(none)",
|
|
486
|
+
hint: missingAeHostHint(),
|
|
487
|
+
next_steps: missingAeHostGuidance()
|
|
488
|
+
}, program.opts().format || "json");
|
|
407
489
|
return;
|
|
408
490
|
}
|
|
409
|
-
const
|
|
410
|
-
if (
|
|
411
|
-
|
|
412
|
-
|
|
491
|
+
const active = getActiveCredential(host);
|
|
492
|
+
if (active) {
|
|
493
|
+
const state = await validateExistingCliToken(host, active.cliToken);
|
|
494
|
+
if (!state.valid) return;
|
|
495
|
+
if (state.details.account || state.details.cliTokenExpiresAt) {
|
|
496
|
+
updateCredentialMetadata(host, active.cliToken, state.details);
|
|
413
497
|
}
|
|
414
|
-
const
|
|
415
|
-
await printOutput(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
hasCliToken: !!secureEntry.cliToken
|
|
498
|
+
const current = getActiveCredential(host) ?? active;
|
|
499
|
+
await printOutput({
|
|
500
|
+
authenticated: true,
|
|
501
|
+
host,
|
|
502
|
+
source: "secure-store",
|
|
503
|
+
cli_token: {
|
|
504
|
+
status: state.trusted ? "trusted" : "valid",
|
|
505
|
+
...current.cliTokenExpiresAt ? { expires_at: current.cliTokenExpiresAt } : {},
|
|
506
|
+
...current.lastRenewedOn ? { last_renewed_on: current.lastRenewedOn } : {}
|
|
424
507
|
},
|
|
425
|
-
|
|
426
|
-
);
|
|
508
|
+
...current.account ? { account: accountOutput(current.account) } : {}
|
|
509
|
+
}, program.opts().format || "json");
|
|
427
510
|
return;
|
|
428
511
|
}
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
note: "sandbox-provisioned cli-token.json; no user access token in secure-store"
|
|
512
|
+
const fallback = getFallbackCliToken(host);
|
|
513
|
+
if (fallback) {
|
|
514
|
+
const state = await validateExistingCliToken(host, fallback);
|
|
515
|
+
if (!state.valid) return;
|
|
516
|
+
await printOutput({
|
|
517
|
+
authenticated: true,
|
|
518
|
+
host,
|
|
519
|
+
source: "sandbox-cli-token",
|
|
520
|
+
cli_token: {
|
|
521
|
+
status: state.trusted ? "trusted" : "valid",
|
|
522
|
+
...state.details.cliTokenExpiresAt ? { expires_at: state.details.cliTokenExpiresAt } : {}
|
|
441
523
|
},
|
|
442
|
-
|
|
443
|
-
);
|
|
524
|
+
...state.details.account ? { account: accountOutput(state.details.account) } : {}
|
|
525
|
+
}, program.opts().format || "json");
|
|
444
526
|
return;
|
|
445
527
|
}
|
|
446
528
|
await printOutput({ authenticated: false, host, source: "none" }, program.opts().format || "json");
|
|
447
529
|
});
|
|
448
|
-
auth.command("
|
|
530
|
+
auth.command("list").description("List stored accounts for one host (does not call the server)").option("--host <url>", HOST_OPTION_DESC).action(async (opts) => {
|
|
449
531
|
const host = resolveAuthHost(program, opts);
|
|
450
532
|
if (!host) {
|
|
451
533
|
printError("config", "No AE host configured.", missingAeHostHint());
|
|
452
534
|
process.exit(1);
|
|
453
535
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
536
|
+
const active = getActiveCredential(host);
|
|
537
|
+
const credentials = listCredentials(host);
|
|
538
|
+
await printOutput({
|
|
539
|
+
host,
|
|
540
|
+
accounts: credentials.map((credential) => credentialOutput(credential, credential.id === active?.id))
|
|
541
|
+
}, program.opts().format || "json");
|
|
542
|
+
});
|
|
543
|
+
auth.command("use").description("Switch the active account for a host; omit --account to choose interactively").option("--account <login-name-or-open-id>", "Login name or open_id returned by auth list").option("--host <url>", HOST_OPTION_DESC).action(async (opts) => {
|
|
544
|
+
await switchActiveAccount(program, opts);
|
|
545
|
+
});
|
|
546
|
+
auth.command("logout").description("Remove the active account, or all accounts with --all").option("--host <url>", HOST_OPTION_DESC).option("--all", "Remove all accounts stored for this host").action(async (opts) => {
|
|
547
|
+
const host = resolveAuthHost(program, opts);
|
|
548
|
+
if (!host) {
|
|
549
|
+
printError("config", "No AE host configured.", missingAeHostHint());
|
|
550
|
+
process.exit(1);
|
|
551
|
+
}
|
|
552
|
+
clearCliTokenCache(host);
|
|
553
|
+
if (opts.all) {
|
|
554
|
+
clearAllCredentials(host);
|
|
555
|
+
await printOutput({ cleared: true, all: true, host }, program.opts().format || "json");
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
const result = removeActiveCredential(host);
|
|
559
|
+
await printOutput({
|
|
560
|
+
cleared: !!result.removed,
|
|
561
|
+
all: false,
|
|
562
|
+
host,
|
|
563
|
+
remaining_accounts: listCredentials(host).length,
|
|
564
|
+
...result.active?.account ? { active_account: accountOutput(result.active.account) } : {}
|
|
565
|
+
}, program.opts().format || "json");
|
|
459
566
|
});
|
|
460
567
|
}
|
|
461
568
|
export {
|
|
462
569
|
activateHostAfterLogin,
|
|
570
|
+
buildAccountSelectionItems,
|
|
571
|
+
persistDeviceTokens,
|
|
463
572
|
registerAuth,
|
|
464
573
|
resolveLoginTeClaudeBase
|
|
465
574
|
};
|